diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..6d7caf21422e0483b931b419c2e75556c75f6ccc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +# Dependency folders (The biggest space eaters) +node_modules/ +__pycache__/ +*.pyc +venv/ +.env + +# Git history (Not needed inside the container) +.git +.gitignore + +# Build outputs from your local machine +dist/ +build/ + +# OS trash +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index 542c3004e86dc81535041bad361142f47c2b6abd..526b6f121fde32c126c75f6413018351f123bdf3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,59 @@ --- -title: Optimization Dev -emoji: 🏆 -colorFrom: indigo -colorTo: purple +title: Optimization +emoji: 🚀 +colorFrom: purple +colorTo: indigo sdk: static +app_file: dist/index.html pinned: false --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# Developer's Guide for React frontend + +## Prerequisites + +Install **Node.js** if not done yet. The following commands should run if you have it installed. + +```bash +node -v +npm -v +``` + +## Local Development + +First go to the react frontend folder: +```bash +cd frontends/react +``` + +Run the following commands to install required packages when you run the code the first time or after you make changes to `package.json`. +```bash +npm install +``` + +Now you should be able to start the local development server: +```bash +npm run dev +``` +Open the link printed out on the terminal. The webpage automatically reloads when files are edited. + +## Deploy to Hugging Face + +### Build the production version: + +```bash +npm run build +``` + +This generates the production build inside the `dist/` directory. + +### Commit and push: + +```bash +git add +git commit +git push +``` + +⚠️ Make sure the `dist/` directory is included when adding to git. +⚠️ Even if you only changed the backend, you must still run `npm run build` when deploying or it will not update. diff --git a/backend/.python-version b/backend/.python-version new file mode 100644 index 0000000000000000000000000000000000000000..e4fba2183587225f216eeada4c78dfab6b2e65f5 --- /dev/null +++ b/backend/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/backend/README 2.md b/backend/README 2.md new file mode 100644 index 0000000000000000000000000000000000000000..678e292f9a9381dbde41d7b53e0e0e7a6dd078ae --- /dev/null +++ b/backend/README 2.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`. diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000000000000000000000000000000000000..678e292f9a9381dbde41d7b53e0e0e7a6dd078ae --- /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`. diff --git a/backend/contract/gradient_descent_quadratic 2.json b/backend/contract/gradient_descent_quadratic 2.json new file mode 100644 index 0000000000000000000000000000000000000000..30302582bef3ee8e495f4596b099d8160d9b37d5 --- /dev/null +++ b/backend/contract/gradient_descent_quadratic 2.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/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 2.json b/backend/contract/invalid_function 2.json new file mode 100644 index 0000000000000000000000000000000000000000..da1418c754f5024ea56e7d2934358f538eb45dd7 --- /dev/null +++ b/backend/contract/invalid_function 2.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": "use only x" } } + } +} diff --git a/backend/contract/invalid_function.json b/backend/contract/invalid_function.json new file mode 100644 index 0000000000000000000000000000000000000000..da1418c754f5024ea56e7d2934358f538eb45dd7 --- /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": "use only x" } } + } +} diff --git a/backend/contract/newton_singular_hessian 2.json b/backend/contract/newton_singular_hessian 2.json new file mode 100644 index 0000000000000000000000000000000000000000..4511621a4a2946d01ab59cfaf143d69e422264f7 --- /dev/null +++ b/backend/contract/newton_singular_hessian 2.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/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 2.json b/backend/contract/past_the_end 2.json new file mode 100644 index 0000000000000000000000000000000000000000..c79a30a60f989c3e6e1b891344d67ea5bb9327dc --- /dev/null +++ b/backend/contract/past_the_end 2.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/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 new file mode 100644 index 0000000000000000000000000000000000000000..08fcfea66a061fd4a6619ce4cdb48eed70782941 --- /dev/null +++ b/backend/pyproject.toml @@ -0,0 +1,18 @@ +[project] +name = "backend" +version = "0.1.0" +description = "Optimisation visualisation: objective functions and optimisers, run in the browser by Pyodide" +requires-python = ">=3.12" +dependencies = [ + "numpy>=2.4.0", + "sympy>=1.14.0", +] + +[dependency-groups] +dev = [ + "pytest>=9.2.0", +] + +[tool.pytest.ini_options] +pythonpath = ["src", "."] +testpaths = ["tests"] diff --git a/backend/src/algorithms 2.json b/backend/src/algorithms 2.json new file mode 100644 index 0000000000000000000000000000000000000000..50f5c5c75e4ec216467f9ff4fd90f1fe63009db8 --- /dev/null +++ b/backend/src/algorithms 2.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 the denominator 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 the denominator 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 the denominator 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/algorithms.json b/backend/src/algorithms.json new file mode 100644 index 0000000000000000000000000000000000000000..50f5c5c75e4ec216467f9ff4fd90f1fe63009db8 --- /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 the denominator 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 the denominator 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 the denominator 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..ee88e59a27ba86b11a9aace266e2e8d47893ea53 --- /dev/null +++ b/backend/src/logic.py @@ -0,0 +1,231 @@ +"""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 numpy as np +from sympy import Abs, Expr, 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, +} + + +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] + names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES + try: + expr = parse_expr( + expression, + local_dict=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: + allowed = " and ".join(str(v) for v in variables) + raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: use only {allowed}.") + return expr + + +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, expr.diff(v), modules="numpy") for v in variables] + self._hessian = [[lambdify(variables, expr.diff(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 + 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 + 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/manager 2.py b/backend/src/manager 2.py new file mode 100644 index 0000000000000000000000000000000000000000..2e1b93e39e6d45c20db91dcf1903608ec45c90fb --- /dev/null +++ b/backend/src/manager 2.py @@ -0,0 +1,118 @@ +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 +# 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: + self._objective = Objective(expr, n) + except Exception: + raise UserError("This function can't be differentiated here. Try writing it another way.") + + 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 None} + for run, p, end in zip(self._runs, points, ended) + ] + } diff --git a/backend/src/manager.py b/backend/src/manager.py new file mode 100644 index 0000000000000000000000000000000000000000..2e1b93e39e6d45c20db91dcf1903608ec45c90fb --- /dev/null +++ b/backend/src/manager.py @@ -0,0 +1,118 @@ +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 +# 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: + self._objective = Objective(expr, n) + except Exception: + raise UserError("This function can't be differentiated here. Try writing it another way.") + + 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 None} + for run, p, end in zip(self._runs, points, ended) + ] + } 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 2.py b/backend/tests/test_logic 2.py new file mode 100644 index 0000000000000000000000000000000000000000..e77aa372eb58c9353cb79f9c28dc6ccd7654128b --- /dev/null +++ b/backend/tests/test_logic 2.py @@ -0,0 +1,175 @@ +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"), +]) +def test_parse_function_errors(expression, message): + with pytest.raises(ValueError, match=message): + parse_function(expression, 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_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"] + + +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_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/tests/test_logic.py b/backend/tests/test_logic.py new file mode 100644 index 0000000000000000000000000000000000000000..e77aa372eb58c9353cb79f9c28dc6ccd7654128b --- /dev/null +++ b/backend/tests/test_logic.py @@ -0,0 +1,175 @@ +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"), +]) +def test_parse_function_errors(expression, message): + with pytest.raises(ValueError, match=message): + parse_function(expression, 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_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"] + + +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_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 new file mode 100644 index 0000000000000000000000000000000000000000..f1b281db76a8a40dd783a0b1aad3af825b688c16 --- /dev/null +++ b/backend/uv.lock @@ -0,0 +1,169 @@ +version = 1 +revision = 5 +requires-python = ">=3.12" + +[[package]] +name = "backend" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "numpy" }, + { name = "sympy" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "numpy", specifier = ">=2.4.0" }, + { name = "sympy", specifier = ">=1.14.0" }, +] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=9.2.0" }] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.1" +source = { registry = "https://pypi.org/simple" } +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/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]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.0" +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" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8b/ff/f6400ffec95de41c74b8e73df32e3fff1830633193a7b1e409be7fb1bb8c/numpy-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2a8b6bb8369abefb8bd1801b054ad50e02b3275c8614dc6e5b0373c305291037", size = 16653117, upload-time = "2025-12-20T16:16:06.709Z" }, + { url = "https://files.pythonhosted.org/packages/fd/28/6c23e97450035072e8d830a3c411bf1abd1f42c611ff9d29e3d8f55c6252/numpy-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2e284ca13d5a8367e43734148622caf0b261b275673823593e3e3634a6490f83", size = 12369711, upload-time = "2025-12-20T16:16:08.758Z" }, + { url = "https://files.pythonhosted.org/packages/bc/af/acbef97b630ab1bb45e6a7d01d1452e4251aa88ce680ac36e56c272120ec/numpy-2.4.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:49ff32b09f5aa0cd30a20c2b39db3e669c845589f2b7fc910365210887e39344", size = 5198355, upload-time = "2025-12-20T16:16:10.902Z" }, + { url = "https://files.pythonhosted.org/packages/c1/c8/4e0d436b66b826f2e53330adaa6311f5cac9871a5b5c31ad773b27f25a74/numpy-2.4.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:36cbfb13c152b1c7c184ddac43765db8ad672567e7bafff2cc755a09917ed2e6", size = 6545298, upload-time = "2025-12-20T16:16:12.607Z" }, + { url = "https://files.pythonhosted.org/packages/ef/27/e1f5d144ab54eac34875e79037011d511ac57b21b220063310cb96c80fbc/numpy-2.4.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:35ddc8f4914466e6fc954c76527aa91aa763682a4f6d73249ef20b418fe6effb", size = 14398387, upload-time = "2025-12-20T16:16:14.257Z" }, + { url = "https://files.pythonhosted.org/packages/67/64/4cb909dd5ab09a9a5d086eff9586e69e827b88a5585517386879474f4cf7/numpy-2.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dc578891de1db95b2a35001b695451767b580bb45753717498213c5ff3c41d63", size = 16363091, upload-time = "2025-12-20T16:16:17.32Z" }, + { url = "https://files.pythonhosted.org/packages/9d/9c/8efe24577523ec6809261859737cf117b0eb6fdb655abdfdc81b2e468ce4/numpy-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:98e81648e0b36e325ab67e46b5400a7a6d4a22b8a7c8e8bbfe20e7db7906bf95", size = 16176394, upload-time = "2025-12-20T16:16:19.524Z" }, + { url = "https://files.pythonhosted.org/packages/61/f0/1687441ece7b47a62e45a1f82015352c240765c707928edd8aef875d5951/numpy-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d57b5046c120561ba8fa8e4030fbb8b822f3063910fa901ffadf16e2b7128ad6", size = 18287378, upload-time = "2025-12-20T16:16:22.866Z" }, + { url = "https://files.pythonhosted.org/packages/d3/6f/f868765d44e6fc466467ed810ba9d8d6db1add7d4a748abfa2a4c99a3194/numpy-2.4.0-cp312-cp312-win32.whl", hash = "sha256:92190db305a6f48734d3982f2c60fa30d6b5ee9bff10f2887b930d7b40119f4c", size = 5955432, upload-time = "2025-12-20T16:16:25.06Z" }, + { url = "https://files.pythonhosted.org/packages/d4/b5/94c1e79fcbab38d1ca15e13777477b2914dd2d559b410f96949d6637b085/numpy-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:680060061adb2d74ce352628cb798cfdec399068aa7f07ba9fb818b2b3305f98", size = 12306201, upload-time = "2025-12-20T16:16:26.979Z" }, + { url = "https://files.pythonhosted.org/packages/70/09/c39dadf0b13bb0768cd29d6a3aaff1fb7c6905ac40e9aaeca26b1c086e06/numpy-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:39699233bc72dd482da1415dcb06076e32f60eddc796a796c5fb6c5efce94667", size = 10308234, upload-time = "2025-12-20T16:16:29.417Z" }, + { 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" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +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/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 = "pluggy" +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +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/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 = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +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/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 = "pytest" +version = "9.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +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/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" +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" }, +] diff --git a/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J 2.woff2 b/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..20e72b01579543fe0cb4aed955a146b6b949709f Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J 2.woff2 differ 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 2.woff b/dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..1487d93d8ab5bcc7b7d885166537a932b2f68314 Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ 2.woff 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 2.woff b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..7e53f599659b74de7a800d3261e924cade84555c Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv 2.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 2.woff2 b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..328efe3dbc8c2e910c3827d51fcf450a809bbb60 Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag 2.woff2 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 2.woff b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..eff6edd7ebf1249b57421ff033388b1b12a882fa Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f 2.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 2.woff2 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 2.woff b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..626c775ae55209a9b5daff9a0cf1169106f7739f Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..7d066e9264cbb8e831f941d5f8f867285582fc5c Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T 2.woff2 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 2.woff b/dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..8c83fdc0351f0d6451158a64bd5b638d951a8983 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0804aaff92260b5359330f63e05b9ac25ccabeee Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y 2.woff2 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 2.woff b/dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..780de71bc414a580ed244d1a60afdfd284ede41b Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..090f82f7ec7997047324e07650865305a099969a Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd 2.woff2 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 2.woff2 b/dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..732c64d4dfd589bd5a7abebc1c91d972f678f077 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV 2.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 2.woff b/dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..338fc76a84ce2f71519547ec38f882c15c5cf48b Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..6f33f8c0578588d14260678edb9bffe9c10d2bd3 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5 2.woff2 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 2.woff b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..370da9c897037a4cdfa5b3e8be1070b674fa20fa Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx 2.woff 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 2.woff2 b/dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..21612f479ed33f94abf24d978f4e7c1613155b34 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq 2.woff2 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- 2.woff b/dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S- 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..dfa68b0a6ec90690c57fe74baf850fe248e5ee36 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S- 2.woff 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 2.woff b/dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH 2.woff new file mode 100644 index 0000000000000000000000000000000000000000..b1a1d1278c0789d1d17866cbf2978f63b8754f47 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH 2.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 2.woff2 b/dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..392089009854b61c7db04965bab86d7b7712badc Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu 2.woff2 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-CkwIAi5p 2.js b/dist/assets/index-CkwIAi5p 2.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1b03bc201080f4e940c5750d7e577d695e9535 --- /dev/null +++ b/dist/assets/index-CkwIAi5p 2.js @@ -0,0 +1,3811 @@ +(function(){const Ke=document.createElement("link").relList;if(Ke&&Ke.supports&&Ke.supports("modulepreload"))return;for(const Xt of document.querySelectorAll('link[rel="modulepreload"]'))ut(Xt);new MutationObserver(Xt=>{for(const $t of Xt)if($t.type==="childList")for(const cr of $t.addedNodes)cr.tagName==="LINK"&&cr.rel==="modulepreload"&&ut(cr)}).observe(document,{childList:!0,subtree:!0});function ot(Xt){const $t={};return Xt.integrity&&($t.integrity=Xt.integrity),Xt.referrerPolicy&&($t.referrerPolicy=Xt.referrerPolicy),Xt.crossOrigin==="use-credentials"?$t.credentials="include":Xt.crossOrigin==="anonymous"?$t.credentials="omit":$t.credentials="same-origin",$t}function ut(Xt){if(Xt.ep)return;Xt.ep=!0;const $t=ot(Xt);fetch(Xt.href,$t)}})();function Nk(we){return we&&we.__esModule&&Object.prototype.hasOwnProperty.call(we,"default")?we.default:we}var q6={exports:{}},AT={};var R8;function FF(){if(R8)return AT;R8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.fragment");function ot(ut,Xt,$t){var cr=null;if($t!==void 0&&(cr=""+$t),Xt.key!==void 0&&(cr=""+Xt.key),"key"in Xt){$t={};for(var kr in Xt)kr!=="key"&&($t[kr]=Xt[kr])}else $t=Xt;return Xt=$t.ref,{$$typeof:we,type:ut,key:cr,ref:Xt!==void 0?Xt:null,props:$t}}return AT.Fragment=Ke,AT.jsx=ot,AT.jsxs=ot,AT}var I8;function BF(){return I8||(I8=1,q6.exports=FF()),q6.exports}var ra=BF(),V6={exports:{}},ku={};var D8;function NF(){if(D8)return ku;D8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.portal"),ot=Symbol.for("react.fragment"),ut=Symbol.for("react.strict_mode"),Xt=Symbol.for("react.profiler"),$t=Symbol.for("react.consumer"),cr=Symbol.for("react.context"),kr=Symbol.for("react.forward_ref"),tn=Symbol.for("react.suspense"),Ur=Symbol.for("react.memo"),yn=Symbol.for("react.lazy"),Mn=Symbol.for("react.activity"),ea=Symbol.iterator;function Bn(qa){return qa===null||typeof qa!="object"?null:(qa=ea&&qa[ea]||qa["@@iterator"],typeof qa=="function"?qa:null)}var Gi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bo=Object.assign,eo={};function li(qa,ro,Kn){this.props=qa,this.context=ro,this.refs=eo,this.updater=Kn||Gi}li.prototype.isReactComponent={},li.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")},li.prototype.forceUpdate=function(qa){this.updater.enqueueForceUpdate(this,qa,"forceUpdate")};function Ge(){}Ge.prototype=li.prototype;function wo(qa,ro,Kn){this.props=qa,this.context=ro,this.refs=eo,this.updater=Kn||Gi}var vl=wo.prototype=new Ge;vl.constructor=wo,bo(vl,li.prototype),vl.isPureReactComponent=!0;var Eo=Array.isArray;function ui(){}var mo={H:null,A:null,T:null,S:null},Rs=Object.prototype.hasOwnProperty;function ki(qa,ro,Kn){var vs=Kn.ref;return{$$typeof:we,type:qa,key:ro,ref:vs!==void 0?vs:null,props:Kn}}function $s(qa,ro){return ki(qa.type,ro,qa.props)}function Di(qa){return typeof qa=="object"&&qa!==null&&qa.$$typeof===we}function zo(qa){var ro={"=":"=0",":":"=2"};return"$"+qa.replace(/[=:]/g,function(Kn){return ro[Kn]})}var Nl=/\/+/g;function Si(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(ui,ui):(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,Kn,vs,Is){var Ki=typeof qa;(Ki==="undefined"||Ki==="boolean")&&(qa=null);var Ns=!1;if(qa===null)Ns=!0;else switch(Ki){case"bigint":case"string":case"number":Ns=!0;break;case"object":switch(qa.$$typeof){case we:case Ke:Ns=!0;break;case yn:return Ns=qa._init,Ti(Ns(qa._payload),ro,Kn,vs,Is)}}if(Ns)return Is=Is(qa),Ns=vs===""?"."+Si(qa,0):vs,Eo(Is)?(Kn="",Ns!=null&&(Kn=Ns.replace(Nl,"$&/")+"/"),Ti(Is,ro,Kn,"",function(Od){return Od})):Is!=null&&(Di(Is)&&(Is=$s(Is,Kn+(Is.key==null||qa&&qa.key===Is.key?"":(""+Is.key).replace(Nl,"$&/")+"/")+Ns)),ro.push(Is)),1;Ns=0;var ff=vs===""?".":vs+":";if(Eo(qa))for(var tc=0;tc>>1,ba=Ti[bu];if(0>>1;buXt(Kn,ws))vsXt(Is,Kn)?(Ti[bu]=Is,Ti[vs]=ws,bu=vs):(Ti[bu]=Kn,Ti[ro]=ws,bu=ro);else if(vsXt(Is,ws))Ti[bu]=Is,Ti[vs]=ws,bu=vs;else break e}}return So}function Xt(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 $t=performance;we.unstable_now=function(){return $t.now()}}else{var cr=Date,kr=cr.now();we.unstable_now=function(){return cr.now()-kr}}var tn=[],Ur=[],yn=1,Mn=null,ea=3,Bn=!1,Gi=!1,bo=!1,eo=!1,li=typeof setTimeout=="function"?setTimeout:null,Ge=typeof clearTimeout=="function"?clearTimeout:null,wo=typeof setImmediate<"u"?setImmediate:null;function vl(Ti){for(var So=ot(Ur);So!==null;){if(So.callback===null)ut(Ur);else if(So.startTime<=Ti)ut(Ur),So.sortIndex=So.expirationTime,Ke(tn,So);else break;So=ot(Ur)}}function Eo(Ti){if(bo=!1,vl(Ti),!Gi)if(ot(tn)!==null)Gi=!0,ui||(ui=!0,zo());else{var So=ot(Ur);So!==null&&Ii(Eo,So.startTime-Ti)}}var ui=!1,mo=-1,Rs=5,ki=-1;function $s(){return eo?!0:!(we.unstable_now()-kiTi&&$s());){var bu=Mn.callback;if(typeof bu=="function"){Mn.callback=null,ea=Mn.priorityLevel;var ba=bu(Mn.expirationTime<=Ti);if(Ti=we.unstable_now(),typeof ba=="function"){Mn.callback=ba,vl(Ti),So=!0;break t}Mn===ot(tn)&&ut(tn),vl(Ti)}else ut(tn);Mn=ot(tn)}if(Mn!==null)So=!0;else{var qa=ot(Ur);qa!==null&&Ii(Eo,qa.startTime-Ti),So=!1}}break e}finally{Mn=null,ea=ws,Bn=!1}So=void 0}}finally{So?zo():ui=!1}}}var zo;if(typeof wo=="function")zo=function(){wo(Di)};else if(typeof MessageChannel<"u"){var Nl=new MessageChannel,Si=Nl.port2;Nl.port1.onmessage=Di,zo=function(){Si.postMessage(null)}}else zo=function(){li(Di,0)};function Ii(Ti,So){mo=li(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(Ur,Ti),ot(tn)===null&&Ti===ot(Ur)&&(bo?(Ge(mo),mo=-1):bo=!0,Ii(Eo,ws-bu))):(Ti.sortIndex=ba,Ke(tn,Ti),Gi||Bn||(Gi=!0,ui||(ui=!0,zo()))),Ti},we.unstable_shouldYield=$s,we.unstable_wrapCallback=function(Ti){var So=ea;return function(){var ws=ea;ea=So;try{return Ti.apply(this,arguments)}finally{ea=ws}}}})(X6)),X6}var F8;function jF(){return F8||(F8=1,G6.exports=UF()),G6.exports}var Y6={exports:{}},Qv={};var B8;function qF(){if(B8)return Qv;B8=1;var we=_M();function Ke(tn){var Ur="https://react.dev/errors/"+tn;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(we)}catch(Ke){console.error(Ke)}}return we(),Y6.exports=qF(),Y6.exports}var U8;function HF(){if(U8)return ST;U8=1;var we=jF(),Ke=_M(),ot=VF();function ut(O){var W="https://react.dev/errors/"+O;if(1ba||(O.current=bu[ba],bu[ba]=null,ba--)}function Kn(O,W){ba++,bu[ba]=O.current,O.current=W}var vs=qa(null),Is=qa(null),Ki=qa(null),Ns=qa(null);function ff(O,W){switch(Kn(Ki,W),Kn(Is,O),Kn(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),Kn(vs,O)}function tc(){ro(vs),ro(Is),ro(Ki)}function Od(O){O.memoizedState!==null&&Kn(Ns,O);var W=vs.current,ve=b3(W,O.type);W!==ve&&(Kn(Is,O),Kn(vs,ve))}function Gl(O){Is.current===O&&(ro(vs),ro(Is)),Ns.current===O&&(ro(Ns),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 Wg(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 qs(O){try{var W="",ve=null;do W+=Wg(O,ve),ve=O,O=O.return;while(O);return W}catch(Ie){return` +Error generating stack: `+Ie.message+` +`+Ie.stack}}var Ul=Object.prototype.hasOwnProperty,lu=we.unstable_scheduleCallback,Vc=we.unstable_cancelCallback,Wd=we.unstable_shouldYield,$g=we.unstable_requestPaint,bv=we.unstable_now,Uw=we.unstable_getCurrentPriorityLevel,oo=we.unstable_ImmediatePriority,us=we.unstable_UserBlockingPriority,nu=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:TM,nm=Math.log,Dp=Math.LN2;function TM(O){return O>>>=0,O===0?32:31-(nm(O)/Dp|0)|0}var ax=256,ix=262144,ox=4194304;function Qm(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 sx(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 wn=Ie&134217727;return wn!==0?(Ie=wn&~Pt,Ie!==0?ht=Qm(Ie):(Ir&=wn,Ir!==0?ht=Qm(Ir):ve||(ve=wn&~O,ve!==0&&(ht=Qm(ve))))):(wn=Ie&~Pt,wn!==0?ht=Qm(wn):Ir!==0?ht=Qm(Ir):ve||(ve=Ie&~O,ve!==0&&(ht=Qm(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 b1(O,W){return(O.pendingLanes&~(O.suspendedLanes&~O.pingedLanes)&W)===0}function AM(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 BT(){var O=ox;return ox<<=1,(ox&62914560)===0&&(ox=4194304),O}function jw(O){for(var W=[],ve=0;31>ve;ve++)W.push(O);return W}function w1(O,W){O.pendingLanes|=W,W!==268435456&&(O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0)}function SM(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 wn=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 S1=/[\n"\\]/g;function yp(O){return O.replace(S1,function(W){return"\\"+W.charCodeAt(0).toString(16)+" "})}function fx(O,W,ve,Ie,ht,Pt,Ir,wn){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"),wn!=null&&typeof wn!="function"&&typeof wn!="symbol"&&typeof wn!="boolean"?O.name=""+gp(wn):O.removeAttribute("name")}function ry(O,W,ve,Ie,ht,Pt,Ir,wn){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)){cx(O);return}ve=ve!=null?""+gp(ve):"",W=W!=null?""+gp(W):ve,wn||W===O.value||(O.value=W),O.defaultValue=W}Ie=Ie??ht,Ie=typeof Ie!="function"&&typeof Ie!="symbol"&&!!Ie,O.checked=wn?O.checked:!!Ie,O.defaultChecked=!!Ie,Ir!=null&&typeof Ir!="function"&&typeof Ir!="symbol"&&typeof Ir!="boolean"&&(O.name=Ir),cx(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(l0)try{var Op={};Object.defineProperty(Op,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Op,Op),window.removeEventListener("test",Op,Op)}catch{yd=!1}var Pv=null,dx=null,yh=null;function XT(){if(yh)return yh;var O,W=dx,ve=W.length,Ie,ht="value"in Pv?Pv.value:Pv.textContent,Pt=ht.length;for(O=0;O=k1),C1=" ",mx=!1;function gx(O,W){switch(O){case"keyup":return FM.indexOf(W.keyCode)!==-1;case"keydown":return W.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yx(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 yx(W);case"keypress":return W.which!==32?null:(mx=!0,C1);case"textInput":return O=W.data,O===C1&&mx?null:O;default:return null}}function n5(O,W){if(_p)return O==="compositionend"||!Jw&&gx(O,W)?(O=XT(),yh=dx=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=s5(ve)}}function u5(O,W){return O&&W?O===W?!0:O&&O.nodeType===3?!1:W&&W.nodeType===3?u5(O,W.parentNode):"contains"in O?O.contains(W):O.compareDocumentPosition?!!(O.compareDocumentPosition(W)&16):!1:!1}function c5(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 jM=l0&&"documentMode"in document&&11>=document.documentMode,ay=null,bx=null,fm=null,hm=!1;function u0(O,W,ve){var Ie=ve.window===ve?ve.document:ve.nodeType===9?ve:ve.ownerDocument;hm||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}),fm&&P1(fm,Ie)||(fm=Ie,Ie=g_(bx,"onSelect"),0>=Ir,ht-=Ir,Zf=1<<32-If(W)+ht|ve<xu?(Xu=Us,Us=null):Xu=Us.sibling;var Rc=Pi(si,Us,xi[xu],ao);if(Rc===null){Us===null&&(Us=Xu);break}O&&Us&&Rc.alternate===null&&W(si,Us),Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc,Us=Xu}if(xu===xi.length)return ve(si,Us),Vu&&Ph(si,xu),bl;if(Us===null){for(;xuxu?(Xu=Us,Us=null):Xu=Us.sibling;var Bm=Pi(si,Us,Rc.value,ao);if(Bm===null){Us===null&&(Us=Xu);break}O&&Us&&Bm.alternate===null&&W(si,Us),Xa=Pt(Bm,Xa,xu),xc===null?bl=Bm:xc.sibling=Bm,xc=Bm,Us=Xu}if(Rc.done)return ve(si,Us),Vu&&Ph(si,xu),bl;if(Us===null){for(;!Rc.done;xu++,Rc=xi.next())Rc=uo(si,Rc.value,ao),Rc!==null&&(Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc);return Vu&&Ph(si,xu),bl}for(Us=Ie(Us);!Rc.done;xu++,Rc=xi.next())Rc=Ui(Us,si,xu,Rc.value,ao),Rc!==null&&(O&&Rc.alternate!==null&&Us.delete(Rc.key===null?xu:Rc.key),Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc);return O&&Us.forEach(function(gE){return W(si,gE)}),Vu&&Ph(si,xu),bl}function Sf(si,Xa,xi,ao){if(typeof xi=="object"&&xi!==null&&xi.type===bo&&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===bo){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===Rs&&dg(bl)===Xa.type){ve(si,Xa.sibling),ao=ht(Xa,xi.props),U1(ao,xi),ao.return=si,si=ao;break e}ve(si,Xa);break}else W(si,Xa);Xa=Xa.sibling}xi.type===bo?(ao=dm(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),U1(ao,xi),ao.return=si,si=ao)}return Ir(si);case Gi: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 Rs:return xi=dg(xi),Sf(si,Xa,xi,ao)}if(Ii(xi))return Ks(si,Xa,xi,ao);if(zo(xi)){if(bl=zo(xi),typeof bl!="function")throw Error(ut(150));return xi=bl.call(xi),jl(si,Xa,xi,ao)}if(typeof xi.then=="function")return Sf(si,Xa,Rx(xi),ao);if(xi.$$typeof===wo)return Sf(si,Xa,Ex(si,xi),ao);kc(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{N1=0;var bl=Sf(si,Xa,xi,ao);return dy=null,bl}catch(Us){if(Us===gm||Us===hy)throw Us;var xc=Jd(29,Us,null,si.mode);return xc.lanes=ao,xc.return=si,xc}}}var ym=y2(!0),T5=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 _m(O){return{lane:O,tag:0,payload:null,callback:null,next:null}}function xm(O,W,ve){var Ie=O.updateQueue;if(Ie===null)return null;if(Ie=Ie.shared,(Lc&2)!==0){var ht=Ie.pending;return ht===null?W.next=W:(W.next=ht.next,ht.next=W),Ie.pending=W,W=Sx(O),qp(O,null,ve),W}return Ax(O,Ie,W,ve),Sx(O)}function j1(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 q1(){if(w2){var O=fy;if(O!==null)throw O}}function V1(O,W,ve,Ie){w2=!1;var ht=O.updateQueue;U0=!1;var Pt=ht.firstBaseUpdate,Ir=ht.lastBaseUpdate,wn=ht.shared.pending;if(wn!==null){ht.shared.pending=null;var Ma=wn,Ai=Ma.next;Ma.next=null,Ir===null?Pt=Ai:Ir.next=Ai,Ir=Ma;var no=O.alternate;no!==null&&(no=no.updateQueue,wn=no.lastBaseUpdate,wn!==Ir&&(wn===null?no.firstBaseUpdate=Ai:wn.next=Ai,no.lastBaseUpdate=Ma))}if(Pt!==null){var uo=ht.baseState;Ir=0,no=Ai=Ma=null,wn=Pt;do{var Pi=wn.lane&-536870913,Ui=Pi!==wn.lane;if(Ui?(ic&Pi)===Pi:(Ie&Pi)===Pi){Pi!==0&&Pi===hg&&(w2=!0),no!==null&&(no=no.next={lane:0,tag:wn.tag,payload:wn.payload,callback:null,next:null});e:{var Ks=O,jl=wn;Pi=W;var Sf=ve;switch(jl.tag){case 1:if(Ks=jl.payload,typeof Ks=="function"){uo=Ks.call(Sf,uo,Pi);break e}uo=Ks;break e;case 3:Ks.flags=Ks.flags&-65537|128;case 0:if(Ks=jl.payload,Pi=typeof Ks=="function"?Ks.call(Sf,uo,Pi):Ks,Pi==null)break e;uo=Mn({},uo,Pi);break e;case 2:U0=!0}}Pi=wn.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:wn.tag,payload:wn.payload,callback:wn.callback,next:null},no===null?(Ai=no=Ui,Ma=uo):no=no.next=Ui,Ir|=Pi;if(wn=wn.next,wn===null){if(wn=ht.shared.pending,wn===null)break;Ui=wn,wn=Ui.next,Ui.next=null,ht.lastBaseUpdate=Ui,ht.shared.pending=null}}while(!0);no===null&&(Ma=uo),ht.baseState=Ma,ht.firstBaseUpdate=Ai,ht.lastBaseUpdate=no,Pt===null&&(ht.shared.lanes=0),Z0|=Ir,O.lanes=Ir,O.memoizedState=uo}}function A5(O,W){if(typeof O!="function")throw Error(ut(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,wn={};Ti.T=wn,J1(O,!1,W,ve);try{var Ma=ht(),Ai=Ti.S;if(Ai!==null&&Ai(wn,Ma),Ma!==null&&typeof Ma=="object"&&typeof Ma.then=="function"){var no=YM(Ma,Ie);_y(O,W,no,fv(O))}else _y(O,W,Ie,fv(O))}catch(uo){_y(O,W,{then:function(){},status:"rejected",reason:uo},fv())}finally{So.p=Pt,Ir!==null&&wn.types!==null&&(Ir.types=wn.types),Ti.T=Ir}}function rb(){}function nb(O,W,ve,Ie){if(O.tag!==5)throw Error(ut(476));var ht=K1(O).queue;D2(O,ht,W,ws,ve===null?rb:function(){return z2(O),ve(Ie)})}function K1(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:d0,lastRenderedState:ws},next:null};var ve={};return W.next={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:ve},next:null},O.memoizedState=W,O=O.alternate,O!==null&&(O.memoizedState=W),W}function z2(O){var W=K1(O);W.next===null&&(W=O.alternate.memoizedState),_y(O,W.next.queue,{},fv())}function ab(){return jd(qy)}function z5(){return bh().memoizedState}function O2(){return bh().memoizedState}function O5(O){for(var W=O.return;W!==null;){switch(W.tag){case 24:case 3:var ve=fv();O=_m(ve);var Ie=xm(W,O,ve);Ie!==null&&(Nv(Ie,W,ve),j1(Ie,W,ve)),W={cache:p2()},O.payload=W;return}W=W.return}}function F5(O,W,ve){var Ie=fv();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),B5(ve,W,Ie)))}function ib(O,W,ve){var Ie=fv();_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,wn=Pt(Ir,ve);if(ht.hasEagerState=!0,ht.eagerState=wn,np(wn,Ir))return Ax(O,W,ht,0),Of===null&&I1(),!1}catch{}if(ve=l2(O,W,ht,Ie),ve!==null)return Nv(ve,O,Ie),B5(ve,W,Ie),!0}return!1}function J1(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(ut(479))}else W=l2(O,ve,Ie,2),W!==null&&Nv(W,O,2)}function xy(O){var W=O.alternate;return O===ou||W!==null&&W===ou}function F2(O,W){my=wm=!0;var ve=O.pending;ve===null?W.next=W:(W.next=ve.next,ve.next=W),O.pending=W}function B5(O,W,ve){if((ve&4194048)!==0){var Ie=W.lanes;Ie&=O.pendingLanes,ve|=Ie,W.lanes=ve,qw(O,ve)}}var Q1={readContext:jd,use:Ox,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};Q1.useEffectEvent=xh;var B2={readContext:jd,use:Ox,useCallback:function(O,W){return bd().memoizedState=[O,W===void 0?null:W],O},useContext:jd,useEffect:Kx,useImperativeHandle:function(O,W,ve){ve=ve!=null?ve.concat([O]):null,Wx(4194308,4,Qx.bind(null,W,O),ve)},useLayoutEffect:function(O,W){return Wx(4194308,4,O,W)},useInsertionEffect:function(O,W){Wx(4,2,O,W)},useMemo:function(O,W){var ve=bd();W=W===void 0?null:W;var Ie=O();if(pg){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(pg){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=F5.bind(null,ou,O),[Ie.memoizedState,O]},useRef:function(O){var W=bd();return O={current:O},W.memoizedState=O},useState:function(O){O=Y1(O);var W=O.queue,ve=ib.bind(null,ou,W);return W.dispatch=ve,[O.memoizedState,ve]},useDebugValue:eb,useDeferredValue:function(O,W){var ve=bd();return $1(ve,O,W)},useTransition:function(){var O=Y1(!1);return O=D2.bind(null,ou,O.queue,!0,!1),bd().memoizedState=O,[!1,O]},useSyncExternalStore:function(O,W,ve){var Ie=ou,ht=bd();if(Vu){if(ve===void 0)throw Error(ut(407));ve=ve()}else{if(ve=W(),Of===null)throw Error(ut(349));(ic&127)!==0||Ux(Ie,W,ve)}ht.memoizedState=ve;var Pt={value:ve,getSnapshot:W};return ht.queue=Pt,Kx(qx.bind(null,Ie,Pt,O),[O]),Ie.flags|=2048,yy(9,{destroy:void 0},jx.bind(null,Ie,Pt,ve,W),null),ve},useId:function(){var O=bd(),W=Of.identifierPrefix;if(Vu){var ve=bp,Ie=Zf;ve=(Ie&~(1<<32-If(Ie)-1)).toString(32)+ve,W="_"+W+"R_"+ve,ve=mg++,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[sv]=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&&v0(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&&v0(W);else{if(typeof Ie!="string"&&W.stateNode===null)throw Error(ut(166));if(O=Ki.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||Mb(O.nodeValue,ve)),O||vm(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(ut(318));if(O=W.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(ut(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(ut(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(ut(318));if(ht=W.memoizedState,ht=ht!==null?ht.dehydrated:null,!ht)throw Error(ut(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),db(W,W.updateQueue),eh(W),null);case 4:return tc(),O===null&&Fy(W.stateNode.containerInfo),eh(W),null;case 10:return Xp(W.type),eh(W),null;case 19:if(ro(cc),Ie=W.memoizedState,Ie===null)return eh(W),null;if(ht=(W.flags&128)!==0,Pt=Ie.rendering,Pt===null)if(ht)t_(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,t_(Ie,!1),O=Pt.updateQueue,W.updateQueue=O,db(W,O),W.subtreeFlags=0,O=ve,ve=W.child;ve!==null;)v5(ve,O),ve=ve.sibling;return Kn(cc,cc.current&1|2),Vu&&Ph(W,Ie.treeForkCount),W.child}O=O.sibling}Ie.tail!==null&&bv()>mb&&(W.flags|=128,ht=!0,t_(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,db(W,O),t_(Ie,!0),Ie.tail===null&&Ie.tailMode==="hidden"&&!Pt.alternate&&!Vu)return eh(W),null}else 2*bv()-Ie.renderingStartTime>mb&&ve!==536870912&&(W.flags|=128,ht=!0,t_(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=bv(),O.sibling=null,ve=cc.current,Kn(cc,ht?ve&1|2:ve&1),Vu&&Ph(W,Ie.treeForkCount),O):(eh(W),null);case 22:case 23:return cp(W),bm(),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&&db(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(mm),null;case 24:return ve=null,O!==null&&(ve=O.memoizedState.cache),W.memoizedState.cache!==ve&&(W.flags|=2048),Xp(od),eh(W),null;case 25:return null;case 30:return null}throw Error(ut(156,W.tag))}function eE(O,W){switch(lg(W),W.tag){case 1:return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 3:return Xp(od),tc(),O=W.flags,(O&65536)!==0&&(O&128)===0?(W.flags=O&-65537|128,W):null;case 26:case 27:case 5:return Gl(W),null;case 31:if(W.memoizedState!==null){if(cp(W),W.alternate===null)throw Error(ut(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(ut(340));B0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 19:return ro(cc),null;case 4:return tc(),null;case 10:return Xp(W.type),null;case 22:case 23:return cp(W),bm(),O!==null&&ro(mm),O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 24:return Xp(od),null;case 25:return null;default:return null}}function nA(O,W){switch(lg(W),W.tag){case 3:Xp(od),tc();break;case 26:case 27:case 5:Gl(W);break;case 4:tc();break;case 31:W.memoizedState!==null&&cp(W);break;case 13:cp(W);break;case 19:ro(cc);break;case 10:Xp(W.type);break;case 22:case 23:cp(W),bm(),O!==null&&ro(mm);break;case 24:Xp(od)}}function r_(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(wn){hf(W,W.return,wn)}}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,wn=Ir.destroy;if(wn!==void 0){Ir.destroy=void 0,ht=W;var Ma=ve,Ai=wn;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 aA(O,W,ve){ve.props=yg(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 Zp(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 iA(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[sv]=W}catch(ht){hf(O,O.return,ht)}}function _g(O){return O.tag===5||O.tag===3||O.tag===26||O.tag===27&&x0(O.type)||O.tag===4}function n_(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||_g(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&&x0(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=pc));else if(Ie!==4&&(Ie===27&&x0(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 a_(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&&x0(O.type)&&(ve=O.stateNode),O=O.child,O!==null))for(a_(O,W,ve),O=O.sibling;O!==null;)a_(O,W,ve),O=O.sibling}function oA(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[sv]=ve}catch(Pt){hf(O,O.return,Pt)}}var H0=!1,ld=!1,r3=!1,n3=typeof WeakSet=="function"?WeakSet:Set,Rh=null;function tE(O,W){if(O=O.containerInfo,K0=L_,O=c5(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,wn=-1,Ma=-1,Ai=0,no=0,uo=O,Pi=null;t:for(;;){for(var Ui;uo!==ve||ht!==0&&uo.nodeType!==3||(wn=Ir+ht),uo!==Pt||Ie!==0&&uo.nodeType!==3||(Ma=Ir+Ie),uo.nodeType===3&&(Ir+=uo.nodeValue.length),(Ui=uo.firstChild)!==null;)Pi=uo,uo=Ui;for(;;){if(uo===O)break t;if(Pi===ve&&++Ai===ht&&(wn=Ir),Pi===Pt&&++no===Ie&&(Ma=Ir),(Ui=uo.nextSibling)!==null)break;uo=Pi,Pi=uo.parentNode}uo=Ui}ve=wn===-1||Ma===-1?null:{start:wn,end:Ma}}else ve=null}ve=ve||{start:0,end:0}}else ve=null;for(Im={focusedElem:O,selectionRange:ve},L_=!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=qA("link","href",ht).get(Ie+(ve.href||""));if(Ir){for(var wn=0;wnSf&&(Ir=Sf,Sf=jl,jl=Ir);var si=l5(wn,jl),Xa=l5(wn,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=uo.createRange();xi.setStart(si.node,si.offset),Ui.removeAllRanges(),jl>Sf?(Ui.addRange(xi),Ui.extend(Xa.node,Xa.offset)):(xi.setEnd(Xa.node,Xa.offset),Ui.addRange(xi))}}}}for(uo=[],Ui=wn;Ui=Ui.parentNode;)Ui.nodeType===1&&uo.push({element:Ui,left:Ui.scrollLeft,top:Ui.scrollTop});for(typeof wn.focus=="function"&&wn.focus(),wn=0;wnve?32:ve,Ti.T=null,ve=u3,u3=null;var Pt=Cm,Ir=W0;if(ud=0,wg=Cm=null,W0=0,(Lc&6)!==0)throw Error(ut(331));var wn=Lc;if(Lc|=4,Sy(Pt.current),dA(Pt,Pt.current,Ir,ve),Lc=wn,c_(0,!1),pd&&typeof pd.onPostCommitFiberRoot=="function")try{pd.onPostCommitFiberRoot(wv,Pt)}catch{}return!0}finally{So.p=ht,Ti.T=Ie,LA(O,W)}}function RA(O,W,ve){W=Lh(ve,W),W=q0(O.stateNode,W,2),O=xm(O,W,2),O!==null&&(w1(O,2),y0(O))}function hf(O,W,ve){if(O.tag===3)RA(O,O,ve);else for(;W!==null;){if(W.tag===3){RA(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=G5(2),Ie=xm(W,ve,2),Ie!==null&&(X5(ve,Ie,W,O),w1(Ie,2),y0(Ie));break}}W=W.return}}function h3(O,W,ve){var Ie=O.pingCache;if(Ie===null){Ie=O.pingCache=new mA;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)||(Em=!0,ht.add(ve),O=lE.bind(null,O,W,ve),W.then(O,O))}function lE(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>bv()-s_?(Lc&2)===0&&ky(O,0):l3|=ve,km===ic&&(km=0)),y0(O)}function IA(O,W){W===0&&(W=BT()),O=jp(O,W),O!==null&&(w1(O,W),y0(O))}function Ly(O){var W=O.memoizedState,ve=0;W!==null&&(ve=W.retryLane),IA(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(ut(314))}Ie!==null&&Ie.delete(W),IA(O,ve)}function d3(O,W){return lu(O,W)}var Tb=null,g0=null,v3=!1,Ry=!1,p3=!1,Pm=0;function y0(O){O!==g0&&O.next===null&&(g0===null?Tb=g0=O:g0=g0.next=O),Ry=!0,v3||(v3=!0,cE())}function c_(O,W){if(!p3&&Ry){p3=!0;do for(var ve=!1,Ie=Tb;Ie!==null;){if(O!==0){var ht=Ie.pendingLanes;if(ht===0)var Pt=0;else{var Ir=Ie.suspendedLanes,wn=Ie.pingedLanes;Pt=(1<<31-If(42|O)+1)-1,Pt&=ht&~(Ir&~wn),Pt=Pt&201326741?Pt&201326741|1:Pt?Pt|2:0}Pt!==0&&(ve=!0,DA(Ie,Pt))}else Pt=ic,Pt=sx(Ie,Ie===Of?Pt:0,Ie.cancelPendingCommit!==null||Ie.timeoutHandle!==-1),(Pt&3)===0||b1(Ie,Pt)||(ve=!0,DA(Ie,Pt));Ie=Ie.next}while(ve);p3=!1}}function uE(){m3()}function m3(){Ry=v3=!1;var O=0;Pm!==0&&BA()&&(O=Pm);for(var W=bv(),ve=null,Ie=Tb;Ie!==null;){var ht=Ie.next,Pt=f_(Ie,W);Pt===0?(Ie.next=null,ve===null?Tb=ht:ve.next=ht,ht===null&&(g0=ve)):(ve=Ie,(O!==0||(Pt&3)!==0)&&(Ry=!0)),Ie=ht}ud!==0&&ud!==5||c_(O),Pm!==0&&(Pm=0)}function f_(O,W){for(var ve=O.suspendedLanes,Ie=O.pingedLanes,ht=O.expirationTimes,Pt=O.pendingLanes&-62914561;0wn)break;var no=Ma.transferSize,uo=Ma.initiatorType;no&&$0(uo)&&(Ma=Ma.responseEnd,Ir+=no*(Ma"u"?null:document;function Db(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+'"]'),Ib.has(ht)||(Ib.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 Eg(O){Jp.D(O),Db("dns-prefetch",O,null)}function C3(O,W){Jp.C(O,W),Db("preconnect",O,W)}function zb(O,W,ve){Jp.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=Dm(O);break;case"script":Pt=Cg(O)}qv.has(Pt)||(O=Mn({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(w_(Pt))||W==="script"&&Ie.querySelector(Lg(Pt))||(W=Ie.createElement("link"),cd(W,"link",O),Fd(W),Ie.head.appendChild(W)))}}function Ob(O,W){Jp.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=Cg(O)}if(!qv.has(Pt)&&(O=Mn({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(Lg(Pt)))return}Ie=ve.createElement("link"),cd(Ie,"link",O),Fd(Ie),ve.head.appendChild(Ie)}}}function b_(O,W,ve){Jp.S(O,W,ve);var Ie=Ny;if(Ie&&O){var ht=ey(Ie).hoistableStyles,Pt=Dm(O);W=W||"default";var Ir=ht.get(Pt);if(!Ir){var wn={loading:0,preload:null};if(Ir=Ie.querySelector(w_(Pt)))wn.loading=5;else{O=Mn({rel:"stylesheet",href:O,"data-precedence":W},ve),(ve=qv.get(Pt))&&Pg(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(){wn.loading|=1}),Ma.addEventListener("error",function(){wn.loading|=2}),wn.loading|=4,T_(Ir,W,Ie)}Ir={type:"stylesheet",instance:Ir,count:1,state:wn},ht.set(Pt,Ir)}}}function Uy(O,W){Jp.X(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Cg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Lg(ht)),Pt||(O=Mn({src:O,async:!0},W),(W=qv.get(ht))&&Bb(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){Jp.M(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Cg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Lg(ht)),Pt||(O=Mn({src:O,async:!0,type:"module"},W),(W=qv.get(ht))&&Bb(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 Fb(O,W,ve,Ie){var ht=(ht=Ki.current)?w0(ht):null;if(!ht)throw Error(ut(446));switch(O){case"meta":case"title":return null;case"style":return typeof ve.precedence=="string"&&typeof ve.href=="string"?(W=Dm(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=Dm(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(w_(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||jA(ht,O,ve,Ir.state))),W&&Ie===null)throw Error(ut(528,""));return Ir}if(W&&Ie!==null)throw Error(ut(529,""));return null;case"script":return W=ve.async,ve=ve.src,typeof ve=="string"&&W&&typeof W!="function"&&typeof W!="symbol"?(W=Cg(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(ut(444,O))}}function Dm(O){return'href="'+yp(O)+'"'}function w_(O){return'link[rel="stylesheet"]['+O+"]"}function kg(O){return Mn({},O,{"data-precedence":O.precedence,precedence:null})}function jA(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 Cg(O){return'[src="'+yp(O)+'"]'}function Lg(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=Mn({},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),T_(Ie,ve.precedence,O),W.instance=Ie;case"stylesheet":ht=Dm(ve.href);var Pt=O.querySelector(w_(ht));if(Pt)return W.state.loading|=4,W.instance=Pt,Fd(Pt),Pt;Ie=kg(ve),(ht=qv.get(ht))&&Pg(Ie,ht),Pt=(O.ownerDocument||O).createElement("link"),Fd(Pt);var Ir=Pt;return Ir._p=new Promise(function(wn,Ma){Ir.onload=wn,Ir.onerror=Ma}),cd(Pt,"link",Ie),W.state.loading|=4,T_(Pt,ve.precedence,O),W.instance=Pt;case"script":return Pt=Cg(ve.src),(ht=O.querySelector(Lg(Pt)))?(W.instance=ht,Fd(ht),ht):(Ie=ve,(ht=qv.get(Pt))&&(Ie=Mn({},ve),Bb(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(ut(443,W.type))}else W.type==="stylesheet"&&(W.state.loading&4)===0&&(Ie=W.instance,W.state.loading|=4,T_(Ie,ve.precedence,O));return W.instance}function T_(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 vE(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=Dm(Ie.href),Pt=W.querySelector(w_(ht));if(Pt){W=Pt._p,W!==null&&typeof W=="object"&&typeof W.then=="function"&&(O.count++,O=M_.bind(O),W.then(O,O)),ve.state.loading|=4,ve.instance=Pt,Fd(Pt);return}Pt=W.ownerDocument||W,Ie=kg(Ie),(ht=qv.get(ht))&&Pg(Ie,ht),Pt=Pt.createElement("link"),Fd(Pt);var Ir=Pt;Ir._p=new Promise(function(wn,Ma){Ir.onload=wn,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=M_.bind(O),W.addEventListener("load",ve),W.addEventListener("error",ve))}}var Nb=0;function Ub(O,W){return O.stylesheets&&O.count===0&&k_(O,O.stylesheets),0Nb?50:800)+W);return O.unsuspend=ve,function(){O.unsuspend=null,clearTimeout(Ie),clearTimeout(ht)}}:null}function M_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)k_(this,this.stylesheets);else if(this.unsuspend){var O=this.unsuspend;this.unsuspend=null,O()}}}var E_=null;function k_(O,W){O.stylesheets=null,O.unsuspend!==null&&(O.count++,E_=new Map,W.forEach(R3,O),E_=null,M_.call(O))}function R3(O,W){if(!(W.state.loading&4)){var ve=E_.get(O);if(ve)var Ie=ve.get(null);else{ve=new Map,E_.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(),H6.exports=HF(),H6.exports}var XF=GF();const YF=we=>we?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ZF(we,Ke,ot=[]){if(Ke==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:YF(we),size:24,node:Ke,...ot.length>0?{aliases:ot}:{}}}const WF=we=>{let Ke="",ot=!1;for(const ut of we){if(ut==="-"||ut==="_"||ut<=" "){ot=Ke.length>0;continue}Ke.length===0?Ke+=ut.toLowerCase():Ke+=ot?ut.toUpperCase():ut,ot=!1}return Ke};const $F=we=>{const Ke=WF(we);return Ke.charAt(0).toUpperCase()+Ke.slice(1)};const bk=(...we)=>we.filter((Ke,ot,ut)=>!!Ke&&Ke.trim()!==""&&ut.indexOf(Ke)===ot).join(" ").trim();const tx={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 Z6(we){return we!=null}function KF(we,Ke={}){const ot=Ke.attributeNames??{},ut=ea=>ot[ea]??ea,Xt=we.size??we.width??tx.width,$t=we.size??we.height??tx.height,cr=we.aliases?.filter(ea=>typeof ea=="string"&&ea.trim()!=="").map(ea=>`lucide-${ea}`)??[],kr=[...we.name?[`lucide-${we.name}`]:[],...cr],tn=Ke.className?.split(" ").filter(Boolean)??[],Ur=Ke.includeDefaultClasses===!1?bk(...tn):bk("lucide",...kr,...tn),yn=Ke.absoluteStrokeWidth?Number(Ke.strokeWidth??tx["stroke-width"])*Number(we.size??we.width??tx.width)/Number(Ke.size??Ke.width??tx.width):Ke.strokeWidth??tx["stroke-width"];return["svg",{...Object.entries(tx).reduce((ea,[Bn,Gi])=>(ea[ut(Bn)]=Gi,ea),{}),..."color"in Ke&&Ke.color&&{[ut("stroke")]:Ke.color},..."size"in Ke&&Z6(Ke.size)&&{[ut("width")]:Ke.size,[ut("height")]:Ke.size},..."width"in Ke&&Z6(Ke.width)&&{[ut("width")]:Ke.width},..."height"in Ke&&Z6(Ke.height)&&{[ut("height")]:Ke.height},[ut("stroke-width")]:yn,...Ur&&{[ut("class")]:Ur},[ut("viewBox")]:`0 0 ${Xt} ${$t}`,...Ke.hasA11yProp===!1?{[ut("aria-hidden")]:"true"}:{},..."attributes"in Ke&&Ke.attributes},we.node.map(ea=>{const[Bn,Gi,bo]=ea,eo=Ke.nonScalingStroke?{[ut("vector-effect")]:"non-scaling-stroke",...Gi}:Gi;return bo?[Bn,eo,bo]:[Bn,eo]})]}function JF(we,Ke={}){return KF(we,{...Ke,attributeNames:{...Ke.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const QF=we=>{for(const Ke in we)if(Ke.startsWith("aria-")||Ke==="role"||Ke==="title")return!0;return!1},eB=ru.createContext({}),tB=()=>ru.useContext(eB),rB=ru.forwardRef(({color:we,size:Ke,width:ot,height:ut,strokeWidth:Xt,absoluteStrokeWidth:$t,nonScalingStroke:cr,className:kr="",children:tn,iconNode:Ur=[],icon:yn={node:Ur,aliases:[],size:24},...Mn},ea)=>{const{size:Bn=24,strokeWidth:Gi=2,absoluteStrokeWidth:bo=!1,nonScalingStroke:eo=!1,color:li="currentColor",className:Ge=""}=tB()??{},wo=!!tn||QF(Mn),[vl,Eo,ui=[]]=JF(yn,{color:we??li,width:ot??Ke??Bn,height:ut??Ke??Bn,strokeWidth:Xt??Gi,absoluteStrokeWidth:$t??bo,nonScalingStroke:cr??eo,className:bk(Ge,kr),hasA11yProp:wo,attributes:Mn});return ru.createElement(vl,{ref:ea,...Eo},[...ui.map(([mo,Rs])=>ru.createElement(mo,Rs)),...Array.isArray(tn)?tn:[tn]])});function k0(we,Ke=[],ot=[]){const ut=typeof we=="string"?ZF(we,Ke,ot):we,Xt=ru.forwardRef(({className:$t,...cr},kr)=>ru.createElement(rB,{ref:kr,icon:ut,className:$t,...cr}));return ut.name&&(Xt.displayName=$F(ut.name)),Xt}const Z4={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"}]]};Z4.node;const nB=k0(Z4);const W4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};W4.node;const aB=k0(W4);const $4={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"}]]};$4.node;const iB=k0($4);const K4={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"]};K4.node;const oB=k0(K4);const J4={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"}]]};J4.node;const sB=k0(J4);const Q4={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"}]]};Q4.node;const lB=k0(Q4);const eP={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"}]]};eP.node;const uB=k0(eP);const tP={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"}]]};tP.node;const cB=k0(tP);const rP={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"}]]};rP.node;const cM=k0(rP);const nP={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"}]]};nP.node;const fB=k0(nP);const aP={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"}]]};aP.node;const hB=k0(aP);const iP={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};iP.node;const oP=k0(iP);function Uk({title:we,open:Ke,onClose:ot,wide:ut=!1,children:Xt}){const $t=ru.useRef(null);return ru.useEffect(()=>{const cr=$t.current;Ke&&!cr?.open?cr?.showModal():!Ke&&cr?.open&&cr.close()},[Ke]),ra.jsxs("dialog",{ref:$t,"aria-label":we,onClose:ot,onClick:cr=>cr.target===$t.current&&ot(),className:`m-auto ${ut?"w-[min(72rem,calc(100vw-2rem))]":"w-[min(48rem,calc(100vw-2rem))]"} max-h-[85dvh] p-0 bg-white border-[1.5px] border-ink rounded-md text-ink backdrop:bg-ink/40`,children:[ra.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-grid bg-white pl-5 pr-2 py-1",children:[ra.jsx("h2",{className:"text-lg font-semibold",children:we}),ra.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:ra.jsx(oP,{size:18,"aria-hidden":!0})})]}),ra.jsx("div",{className:"p-5",children:Xt})]})}const dB="https://huggingface.co/spaces/elvis-hf/homepage",q8="bg-white border-[1.5px] border-ink rounded-md",sP="flex items-center gap-2 h-11 px-3.5 text-sm font-medium bg-white border-[1.5px] border-ink rounded cursor-pointer hover:bg-paper";function vB({title:we,tabs:Ke,panel:ot,footer:ut,usage:Xt,examples:$t,homeUrl:cr=dB,children:kr}){const[tn,Ur]=ru.useState(0);return ru.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[tn]),ra.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:[ra.jsxs("header",{className:"flex flex-wrap items-center gap-3",children:[ra.jsxs("h1",{className:"mr-auto flex items-baseline gap-3 text-2xl lg:text-3xl font-bold tracking-tight",children:[ra.jsx("span",{className:"px-1 bg-[linear-gradient(transparent_58%,var(--color-marker)_58%,var(--color-marker)_92%,transparent_92%)]",children:"ELVIS"}),ra.jsx("span",{className:"font-normal text-ink-muted",children:"—"}),ra.jsx("span",{className:"font-semibold",children:we})]}),Xt&&ra.jsx(V8,{label:"Usage",icon:nB,children:Xt}),$t&&ra.jsx(V8,{label:"Examples",icon:lB,children:$t}),ra.jsxs("a",{href:cr,target:"_blank",rel:"noopener noreferrer",className:sP,children:[ra.jsx(oB,{size:16,"aria-hidden":!0}),"Home"]})]}),ra.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_24rem] gap-5 flex-1 min-h-0",children:[ra.jsx("main",{className:`${q8} flex flex-col min-h-[320px] lg:min-h-0 p-4`,children:kr}),ra.jsxs("aside",{"aria-label":"Controls",className:`${q8} flex flex-col min-h-0`,children:[Ke?ra.jsx(pB,{tabs:Ke,active:tn,onSelect:Ur}):ra.jsx("div",{className:lP,children:ot}),ut&&ra.jsx("div",{className:"flex shrink-0 flex-col gap-3 border-t-[1.5px] border-ink p-4",children:ut})]})]})]})}const lP="flex flex-1 flex-col gap-6 min-h-0 overflow-auto p-4";function pB({tabs:we,active:Ke,onSelect:ot}){return ra.jsxs(ra.Fragment,{children:[ra.jsx("div",{role:"tablist",className:"flex gap-1 pt-2 px-2 border-b-[1.5px] border-ink",children:we.map(({label:ut},Xt)=>ra.jsx("button",{type:"button",role:"tab","aria-selected":Xt===Ke,onClick:()=>ot(Xt),className:`flex-1 h-11 px-3 text-sm cursor-pointer rounded-t border-[1.5px] ${Xt===Ke?"-mb-[1.5px] font-semibold border-ink border-b-white bg-white":"font-medium border-transparent text-ink-muted hover:bg-paper"}`,children:ut},ut))}),we.map(({label:ut,content:Xt},$t)=>ra.jsx("div",{role:"tabpanel",className:$t===Ke?lP:"hidden",children:Xt},ut))]})}function V8({label:we,icon:Ke,children:ot}){const[ut,Xt]=ru.useState(!1);return ra.jsxs(ra.Fragment,{children:[ra.jsxs("button",{type:"button",onClick:()=>Xt(!0),className:sP,children:[ra.jsx("span",{"aria-hidden":!0,children:ra.jsx(Ke,{size:16})}),we]}),ra.jsx(Uk,{title:we,open:ut,onClose:()=>Xt(!1),children:ot})]})}const mB="px-4 rounded bg-white 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",gB={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 fM({label:we,onClick:Ke,variant:ot="secondary",disabled:ut=!1}){return ra.jsx("button",{type:"button",onClick:Ke,disabled:ut,className:`${mB} ${gB[ot]}`,children:we})}function PT({label:we,onClick:Ke,disabled:ot=!1,children:ut}){return ra.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-white 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:ra.jsx("span",{"aria-hidden":!0,children:ut})})}function yB({label:we,colors:Ke,value:ot,onChange:ut,taken:Xt=[]}){const[$t,cr]=ru.useState(!1),kr=ru.useRef(null),tn=Ke.find(Ur=>Ur.value===ot);return ru.useEffect(()=>{if(!$t)return;function Ur(Mn){kr.current?.contains(Mn.target)||cr(!1)}function yn(Mn){Mn.key==="Escape"&&cr(!1)}return document.addEventListener("pointerdown",Ur),document.addEventListener("keydown",yn),()=>{document.removeEventListener("pointerdown",Ur),document.removeEventListener("keydown",yn)}},[$t]),ra.jsxs("div",{ref:kr,className:"relative shrink-0",children:[ra.jsx("button",{type:"button","aria-label":`${we}: ${tn?.name??ot}`,title:`${we}: ${tn?.name??ot}`,"aria-expanded":$t,onClick:()=>cr(!$t),className:"flex size-9 items-center justify-center rounded cursor-pointer hover:bg-paper focus-visible:outline-2 focus-visible:outline-ink",children:ra.jsx("span",{"aria-hidden":!0,className:"block size-6 rounded-full border-2 border-white ring-[1.5px] ring-grid",style:{backgroundColor:ot}})}),$t&&ra.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-white p-2",children:Ke.map(Ur=>{const yn=Ur.value!==ot&&Xt.includes(Ur.value);return ra.jsx("button",{type:"button","aria-label":Ur.name,"aria-pressed":Ur.value===ot,title:yn?`${Ur.name} (used by another run)`:Ur.name,disabled:yn,onClick:()=>{ut(Ur.value),cr(!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:ra.jsx("span",{"aria-hidden":!0,className:`block size-6 rounded-full border-2 border-white ${Ur.value===ot?"ring-[3px] ring-ink":"ring-[1.5px] ring-grid"}`,style:{backgroundColor:Ur.value}})},Ur.value)})})]})}function H8(){return ra.jsx("div",{className:"h-px shrink-0 bg-grid"})}function uP({label:we,hideLabel:Ke=!1,options:ot=[],groupedOptions:ut=[],activeOption:Xt,onChange:$t}){return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("label",{className:Ke?"sr-only":"text-gray-700 text-sm",children:we}),ra.jsxs("select",{"aria-label":we,value:Xt,onChange:cr=>$t(cr.target.value),className:"p-2 rounded bg-white border border-gray-300",children:[ot.map(cr=>ra.jsx("option",{value:cr,children:cr},cr)),ut.map(cr=>ra.jsx("optgroup",{label:cr.label,children:cr.options.map(kr=>ra.jsx("option",{value:kr,children:kr},kr))},cr.label))]})]})}function wk({label:we,value:Ke,onChange:ot,readonly:ut=!1,rows:Xt,error:$t,mono:cr=!1,prefix:kr,hideLabel:tn=!1}){const Ur=ru.useId(),yn=!!Xt&&Xt>1,Mn=[yn?"items-start":"items-center","flex w-full rounded border text-sm text-ink focus-within:outline-2 focus-within:outline-ink",cr?"font-mono":"",ut?"bg-paper":"bg-white",$t?"border-red-600 focus-within:outline-red-600":"border-gray-300"].join(" "),ea="min-w-0 flex-1 bg-transparent px-2 outline-none";return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("label",{htmlFor:Ur,className:tn?"sr-only":"text-gray-700 text-sm",children:we}),ra.jsxs("div",{className:Mn,children:[kr&&ra.jsx("span",{"aria-hidden":!0,className:`shrink-0 select-none pl-2 text-ink-muted ${yn?"py-1.5":""}`,children:kr}),yn?ra.jsx("textarea",{id:Ur,value:Ke,rows:Xt,readOnly:ut,spellCheck:!1,"aria-invalid":!!$t,onChange:Bn=>ot&&ot(Bn.target.value),className:`${ea} py-1.5 resize-none`}):ra.jsx("input",{id:Ur,type:"text",value:Ke,readOnly:ut,spellCheck:!1,"aria-invalid":!!$t,onChange:Bn=>ot&&ot(Bn.target.value),className:`${ea} h-9`})]}),$t&&ra.jsx("p",{className:"text-red-600 font-semibold text-sm",children:$t})]})}function W6({label:we,children:Ke}){return ra.jsxs("section",{className:"flex flex-col gap-4",children:[ra.jsx("div",{className:"flex items-center gap-3",children:ra.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-ink-muted",children:we})}),Ke]})}function _B({label:we,options:Ke,value:ot,onChange:ut}){return ra.jsx("div",{role:"group","aria-label":we,className:"grid rounded border-[1.5px] border-ink overflow-hidden",style:{gridTemplateColumns:`repeat(${Ke.length}, minmax(0, 1fr))`},children:Ke.map(Xt=>ra.jsx("button",{type:"button","aria-pressed":ot===Xt.value,onClick:()=>ot!==Xt.value&&ut(Xt.value),className:`h-8 px-1 text-xs font-medium cursor-pointer border-l-[1.5px] border-ink first:border-l-0 ${ot===Xt.value?"bg-ink text-white":"bg-white hover:bg-paper"}`,children:Xt.label},Xt.value))})}function xB(we,Ke){ru.useEffect(()=>{const ot=we();if(!ot||!Ke)return;function ut(Xt){const $t=ot._fullLayout;if(!$t)return;const cr=ot.getBoundingClientRect(),kr=$t.xaxis.p2c(Xt.clientX-cr.left-$t.xaxis._offset),tn=$t.yaxis.p2c(Xt.clientY-cr.top-$t.yaxis._offset);G8(kr,$t.xaxis.range)&&G8(tn,$t.yaxis.range)&&Ke(kr,tn)}return ot.addEventListener("click",ut),()=>ot.removeEventListener("click",ut)})}function G8(we,[Ke,ot]){return Number.isFinite(we)&&we>=Math.min(Ke,ot)&&we<=Math.max(Ke,ot)}class bB{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=ut=>(this.listeners.add(ut),()=>this.listeners.delete(ut)),this.setStepSize=ut=>this.set({stepSize:Math.max(1,Math.round(ut))}),this.setAnimate=ut=>this.set({animate:ut}),this.start=async()=>{const ut=this.generation;this.set({busy:!0});const Xt=await this.get(0,ut);ut===this.generation&&this.set({busy:!1,...Xt!==null&&{state:Xt,iteration:0}})},this.step=async()=>{if(this.current.busy||this.current.running&&!this.playing)return!1;const{stepSize:ut,animate:Xt}=this.current;Xt&&ut>1&&!this.playing&&this.set({running:!0});const $t=await this.advance(ut,Xt,this.generation);return!this.playing&&this.current.running&&this.set({running:!1}),$t},this.back=()=>{if(this.current.busy)return;const ut=Math.max(0,this.current.iteration-this.current.stepSize);this.states.has(ut)&&this.set({iteration:ut,state:this.states.get(ut)})},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=(ut=this.options)=>(this.pause(),this.options=ut,this.generation++,this.states.clear(),this.set({iteration:0,state:void 0,lastIteration:ut.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,ut){const Xt=this.current.iteration;let $t=Xt,cr=this.current.state;this.set({busy:!0,error:null});for(let kr=0;krsetTimeout(Ur,this.interval())),ut!==this.generation))return!1}return this.set({busy:!1,iteration:$t,state:cr}),$t!==Xt}async get(Ke,ot){const ut=this.states.get(Ke);if(ut!==void 0)return ut;try{const Xt=await this.fetchState(Ke);return ot!==this.generation?null:Xt===null?(this.set({lastIteration:Math.max(Ke-1,0)}),null):(this.states.set(Ke,Xt),Xt)}catch(Xt){return ot===this.generation&&this.set({error:Xt instanceof Error?Xt.message:String(Xt)}),null}}atEnd(Ke=this.current.iteration){return this.current.lastIteration!==null&&Ke>=this.current.lastIteration}interval(){return this.options.intervalMs??400}set(Ke){this.current={...this.current,...Ke},this.listeners.forEach(ot=>ot())}}function wB(we,Ke){const[ot]=ru.useState(()=>new bB(we,Ke));return ot.setFetchState(we),ru.useEffect(()=>(ot.start(),()=>ot.pause()),[ot]),{...ru.useSyncExternalStore(ot.subscribe,ot.getSnapshot),stepper:ot}}const TB="flex size-11 shrink-0 items-center justify-center rounded border-[1.5px] border-ink bg-white 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 AB({stepper:we}){const{stepper:Ke,iteration:ot,lastIteration:ut,running:Xt,busy:$t,stepSize:cr}=we,[kr,tn]=ru.useState(String(cr)),Ur=/^[1-9]\d*$/.test(kr.trim()),yn=ot===0,Mn=ut!==null&&ot>=ut;return ra.jsxs("section",{className:"flex flex-col gap-3",children:[ra.jsxs("div",{className:"flex gap-2",children:[ra.jsx($6,{label:"Reset to iteration 0",onClick:Ke.reset,disabled:yn&&!Xt,children:ra.jsx(cM,{size:18})}),ra.jsx($6,{label:`Step back ${cr}`,onClick:Ke.back,disabled:yn||Xt||$t,children:ra.jsx(fB,{size:18})}),ra.jsxs("button",{type:"button",onClick:Xt?Ke.pause:Ke.play,disabled:!Xt&&Mn,className:"flex h-11 flex-1 items-center justify-center gap-2 rounded border-2 border-ink bg-ink text-sm font-semibold text-white 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:[ra.jsx("span",{"aria-hidden":!0,children:Xt?ra.jsx(uB,{size:16}):ra.jsx(cB,{size:16})}),Xt?"Pause":"Play"]}),ra.jsx($6,{label:`Step forward ${cr}`,onClick:Ke.step,disabled:Mn||Xt||$t,children:ra.jsx(hB,{size:18})}),ra.jsxs("label",{title:"Iterations per step",className:"flex shrink-0 items-center gap-1 font-mono text-sm text-ink-muted",children:["×",ra.jsx("input",{type:"number",min:1,step:1,inputMode:"numeric","aria-label":"Iterations per step","aria-invalid":!Ur,value:kr,onChange:ea=>{tn(ea.target.value),/^[1-9]\d*$/.test(ea.target.value.trim())&&Ke.setStepSize(Number(ea.target.value))},className:`h-11 w-14 rounded border-[1.5px] bg-white px-1.5 text-center text-ink ${Ur?"border-ink":"border-red-600 outline-red-600"}`})]})]}),ra.jsxs("p",{className:"font-mono text-sm text-ink-muted","aria-live":"polite",children:["iteration ",ot,ut!==null?` / ${ut}`:""]}),we.error&&ra.jsx("p",{className:"text-red-600 font-semibold",children:we.error})]})}function $6({label:we,onClick:Ke,disabled:ot,children:ut}){return ra.jsx("button",{type:"button","aria-label":we,title:we,onClick:Ke,disabled:ot,className:TB,children:ra.jsx("span",{"aria-hidden":!0,children:ut})})}const Tk="h-9 shrink-0 rounded border border-gray-300 bg-white px-2 font-mono text-sm text-ink",K6="\0none",J6="\0number";function Ak({param:we,value:Ke,onChange:ot,fill:ut=!1}){const Xt=$t=>ut?"w-full min-w-0":$t;switch(we.kind){case"boolean":return ra.jsx("input",{type:"checkbox",checked:Ke===!0,onChange:$t=>ot($t.target.checked),className:"size-4 accent-ink cursor-pointer"});case"choice":return ra.jsx("select",{value:Ke,onChange:$t=>ot($t.target.value),className:`${Tk} ${Xt("w-28")} font-sans`,children:we.options.map($t=>ra.jsx("option",{value:$t.value,children:$t.label},$t.value))});case"mixed":{const $t=we.number,cr=typeof Ke=="number";return ra.jsxs("span",{className:`flex gap-1 ${ut?"w-full":""}`,children:[ra.jsxs("select",{value:cr?J6:Ke===null?K6:String(Ke),onChange:kr=>{const tn=kr.target.value;ot(tn===J6?MB($t):tn===K6?null:tn)},className:`${Tk} ${ut?"min-w-0 flex-1":cr?"w-24":"w-28"} font-sans`,children:[we.options.map(kr=>ra.jsx("option",{value:kr.value??K6,children:kr.label},kr.label)),$t&&ra.jsx("option",{value:J6,children:"Number…"})]}),cr&&ra.jsx(X8,{range:$t,value:Ke,onChange:ot,className:ut?"min-w-0 flex-1":"w-20"})]})}default:return ra.jsx(X8,{range:{...we,integer:we.kind==="integer"},nullable:we.nullable,value:Ke,onChange:ot,className:Xt("w-28")})}}function X8({range:we,nullable:Ke,value:ot,onChange:ut,className:Xt}){const[$t,cr]=ru.useState(Y8(ot)),kr=Q6(we,Ke,$t)!==void 0;return ru.useEffect(()=>{Q6(we,Ke,$t)!==ot&&cr(Y8(ot))},[ot]),ra.jsx("input",{type:"number",inputMode:"decimal",min:we.min,max:we.max,step:we.integer?1:"any",placeholder:Ke,value:$t,"aria-invalid":!kr,title:kr?void 0:SB(we),onChange:tn=>{cr(tn.target.value);const Ur=Q6(we,Ke,tn.target.value);Ur!==void 0&&ut(Ur)},className:`${Tk} ${Xt} ${kr?"":"border-red-600 outline-red-600"}`})}function Y8(we){return we===null?"":String(we)}function Q6(we,Ke,ot){if(ot.trim()==="")return Ke?null:void 0;const ut=Number(ot);return Number.isFinite(ut)&&cP(we,ut)?ut:void 0}function cP({integer:we,min:Ke,max:ot,minExclusive:ut,maxExclusive:Xt},$t){return!(we&&!Number.isInteger($t)||Ke!==void 0&&(ut?$t<=Ke:$t=ot:$t>ot))}function SB({integer:we,min:Ke,max:ot,minExclusive:ut,maxExclusive:Xt}){const $t=Ke===void 0?null:`${ut?"more than":"at least"} ${Ke}`,cr=ot===void 0?null:`${Xt?"less than":"at most"} ${ot}`;return[Ke!==void 0&&ot!==void 0&&!ut&&!Xt?`${Ke} to ${ot}`:[$t,cr].filter(Boolean).join(" and "),we?"a whole number":null].filter(Boolean).join(", ")||"a number"}function MB(we){return cP(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 jk(we,Ke){return Object.fromEntries(we.map(ot=>[ot.name,ot.name in Ke?Ke[ot.name]:ot.default]))}function qk(we,Ke){return Object.entries(we.when??{}).every(([ot,ut])=>ut.includes(String(Ke[ot])))}function fP(we,Ke){return we.name in Ke&&Ke[we.name]!==we.default}function hP(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 Sk(we){return we.kind==="integer"||we.kind==="mixed"&&!!we.number?.integer}function EB(we,Ke){if(!we.estimator)return null;const ot=jk(we.params,Ke),ut=new Map(Object.entries(we.fixed??{}).map(([cr,kr])=>[cr,[kr,!0]]));for(const cr of we.params)qk(cr,ot)&&ut.set(cr.name,[ot[cr.name],Sk(cr)]);for(const cr of we.otherParams??[])cr.name in Ke&&ut.set(cr.name,[Ke[cr.name],Sk(cr)]);const Xt=we.libraryDefaults??{},$t=[...ut].filter(([cr,[kr]])=>!(cr in Xt)||Xt[cr]!==kr);return`${we.estimator}(${$t.map(([cr,[kr,tn]])=>`${cr}=${hP(kr,tn)}`).join(", ")})`}function dP({model:we,values:Ke,onChange:ot,onResetOne:ut,onReset:Xt}){const $t=[...we.params,...we.otherParams??[]],cr=jk($t,Ke);return ra.jsxs("div",{className:"flex flex-col gap-3",children:[ra.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[ra.jsxs("p",{className:"text-sm text-ink-muted",children:["Every setting of ",ra.jsx("code",{className:"font-mono text-ink",children:we.estimator??we.label}),". Changed settings are highlighted."]}),ra.jsx(fM,{label:"Reset all",onClick:Xt})]}),ra.jsx("div",{className:"overflow-auto max-h-[65dvh] rounded border-[1.5px] border-ink",children:ra.jsxs("table",{className:"w-full border-collapse text-sm",children:[ra.jsx("thead",{className:"sticky top-0 z-10 bg-white",children:ra.jsxs("tr",{className:"border-b-[1.5px] border-ink text-left text-xs uppercase tracking-widest text-ink-muted",children:[ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Setting"}),ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Value"}),ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Default"}),ra.jsx("th",{scope:"col",className:"w-11",children:ra.jsx("span",{className:"sr-only",children:"Reset"})})]})}),ra.jsx("tbody",{children:$t.map(kr=>{const tn=fP(kr,Ke),Ur=qk(kr,cr);return ra.jsxs("tr",{className:`border-t border-grid align-top ${tn?"bg-marker-soft":""}`,children:[ra.jsxs("td",{className:`px-3 py-2 ${Ur?"":"opacity-50"}`,children:[ra.jsxs("div",{children:[ra.jsx("span",{className:"font-medium",children:kr.label})," ",kr.label!==kr.name&&ra.jsx("code",{className:"font-mono text-xs text-ink-muted",children:kr.name})]}),kr.description&&ra.jsx("p",{className:"mt-0.5 max-w-prose text-xs text-ink-muted",children:kr.description}),!Ur&&ra.jsx("p",{className:"mt-0.5 text-xs italic text-ink-muted",children:"Not used with the current settings."})]}),ra.jsx("td",{className:"px-3 py-2",children:ra.jsx("label",{className:"flex min-h-9 items-center","aria-label":kr.label,children:ra.jsx(Ak,{param:kr,value:cr[kr.name],onChange:yn=>ot(kr.name,yn)})})}),ra.jsx("td",{className:"px-3 py-2 pt-3.5 font-mono text-xs text-ink-muted whitespace-nowrap",children:hP(kr.default,Sk(kr))}),ra.jsx("td",{className:"py-1 pr-1",children:kr.name in Ke&&ra.jsx("button",{type:"button",onClick:()=>ut(kr.name),"aria-label":`Reset ${kr.label}`,title:"Reset to default",className:"flex size-9 items-center justify-center rounded text-ink-muted cursor-pointer hover:bg-paper",children:ra.jsx(cM,{size:16,"aria-hidden":!0})})})]},kr.name)})})]})})]})}function kB({model:we,values:Ke,onChange:ot,showQuickSettings:ut=!0,inline:Xt=!1}){const[$t,cr]=ru.useState(!1),kr=we.otherParams??[],tn=[...we.params,...kr],Ur=jk(tn,Ke),yn=Object.keys(Ke).map(eo=>kr.find(li=>li.name===eo)).filter(eo=>eo!==void 0).slice(-3).reverse(),Mn=ut?[...we.params.filter(eo=>qk(eo,Ur)),...yn]:[],ea=tn.filter(eo=>fP(eo,Ke)).length,Bn=EB(we,Ke);function Gi(eo,li){const{[eo]:Ge,...wo}=Ke;ot({...wo,[eo]:li})}function bo(eo){const{[eo]:li,...Ge}=Ke;ot(Ge)}return Xt?ra.jsxs("div",{className:"flex min-h-15 gap-2",children:[Mn.length===0&&ra.jsxs("p",{className:"self-center text-sm text-ink-muted",children:[we.label," has no settings."]}),Mn.map(eo=>ra.jsxs("label",{title:[`${eo.label} (${eo.name})`,eo.description].filter(Boolean).join(": "),className:"flex min-w-0 flex-1 flex-col gap-1",children:[ra.jsx("span",{"aria-hidden":!0,className:"text-sm text-gray-700",children:eo.symbol??eo.label}),ra.jsx("span",{className:"sr-only",children:eo.label}),ra.jsx(Ak,{param:eo,value:Ur[eo.name],onChange:li=>Gi(eo.name,li),fill:!0})]},eo.name))]}):ra.jsxs("div",{className:"flex flex-col gap-2",children:[Mn.map(eo=>ra.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-700",children:[ra.jsxs("span",{className:"min-w-0",children:[eo.label," ",eo.label!==eo.name&&ra.jsx("code",{className:"font-mono text-xs text-ink-muted",children:eo.name})]}),ra.jsx(Ak,{param:eo,value:Ur[eo.name],onChange:li=>Gi(eo.name,li)})]},eo.name)),kr.length>0||!ut&&tn.length>0?ra.jsx(fM,{label:`Customise settings${ea>0?` · ${ea} changed`:""}`,onClick:()=>cr(!0)}):Mn.length>0&&ra.jsx(fM,{label:"Reset to defaults",onClick:()=>ot({})}),Bn&&ra.jsx("code",{title:"The code these settings make",className:"block rounded bg-paper px-2 py-1.5 font-mono text-xs text-ink break-words",children:Bn}),ra.jsx(Uk,{title:`${we.label} settings`,open:$t,onClose:()=>cr(!1),wide:!0,children:ra.jsx(dP,{model:we,values:Ke,onChange:Gi,onResetOne:bo,onReset:()=>ot({})})})]})}const CB="text-xs font-semibold uppercase tracking-widest text-ink-muted";function LB({title:we,items:Ke}){return Ke.length===0?null:ra.jsxs("section",{className:"flex flex-col gap-2",children:[ra.jsx("h3",{className:CB,children:we}),ra.jsx("div",{className:"flex flex-col gap-2 text-sm text-gray-700",children:Ke.map(ot=>ra.jsx(PB,{item:ot},ot.name))})]})}function PB({item:we}){switch(we.kind){case"scalar":return typeof we.value=="number"?ra.jsxs("div",{className:"flex justify-between gap-3",children:[ra.jsx("span",{children:we.name}),ra.jsx("span",{className:"font-mono text-ink",children:ek(we.value)})]}):ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("div",{className:"break-words font-mono text-xs text-ink",children:we.value})]});case"vector":return ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("dl",{className:"mt-0.5 flex flex-col pl-3 font-mono text-xs",children:we.value.labels.map((Ke,ot)=>ra.jsxs("div",{className:"flex justify-between gap-3",children:[ra.jsx("dt",{className:"min-w-0 truncate text-ink-muted",title:Ke,children:Ke}),ra.jsx("dd",{className:"text-ink",children:ek(we.value.values[ot])})]},Ke))})]});case"matrix":return ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("div",{className:"mt-0.5 overflow-x-auto",children:ra.jsxs("table",{className:"w-max border-collapse font-mono text-xs",children:[ra.jsx("thead",{children:ra.jsxs("tr",{children:[ra.jsx("th",{}),we.value.columns.map(Ke=>ra.jsx("th",{scope:"col",className:"px-1.5 text-right font-normal text-ink-muted",children:Ke},Ke))]})}),ra.jsx("tbody",{children:we.value.rows.map((Ke,ot)=>ra.jsxs("tr",{className:"border-t border-grid",children:[ra.jsx("th",{scope:"row",className:"pr-1.5 text-left font-normal text-ink-muted",children:Ke}),we.value.values[ot].map((ut,Xt)=>ra.jsx("td",{className:"px-1.5 text-right text-ink",children:ek(ut)},Xt))]},Ke))})]})})]});case"text":return ra.jsxs("details",{children:[ra.jsx("summary",{className:"cursor-pointer",children:we.name}),ra.jsx("pre",{className:"mt-1 max-h-60 overflow-auto rounded bg-paper p-2 font-mono text-[11px] text-ink",children:we.value})]})}}function ek(we){return Number.isInteger(we)?String(we):we!==0&&Math.abs(we)<.001?we.toExponential(2):String(Number(we.toPrecision(3)))}const RB=[{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 the denominator 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 the denominator 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 the denominator 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."}]}],IB={algorithms:RB},hM=IB.algorithms;function dM(we){return hM.find(Ke=>Ke.id===we)??hM[0]}const _1=[{name:"Black",value:"#000000"},{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"}],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]}]},Mk=[...Fw[1],...Fw[2]],Z8="Custom",DB=/asin|acos|atan|sin|cos|tan|sqrt|abs|exp|log|ln|pi/g;function W8(we){return/y/.test(we.replace(DB,""))?2:1}var tk={},rk={},nk={exports:{}},ak,$8;function zB(){if($8)return ak;$8=1;var we="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ak=we,ak}var ik,K8;function OB(){if(K8)return ik;K8=1;var we=zB();function Ke(){}function ot(){}return ot.resetWarningCache=Ke,ik=function(){function ut(cr,kr,tn,Ur,yn,Mn){if(Mn!==we){var ea=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 ea.name="Invariant Violation",ea}}ut.isRequired=ut;function Xt(){return ut}var $t={array:ut,bigint:ut,bool:ut,func:ut,number:ut,object:ut,string:ut,symbol:ut,any:ut,arrayOf:Xt,element:ut,elementType:ut,instanceOf:Xt,node:ut,objectOf:Xt,oneOf:Xt,oneOfType:Xt,shape:Xt,exact:Xt,checkPropTypes:ot,resetWarningCache:Ke};return $t.PropTypes=$t,$t},ik}var J8;function FB(){return J8||(J8=1,nk.exports=OB()()),nk.exports}var Q8;function BB(){return Q8||(Q8=1,(function(we){function Ke(Eo){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ui){return typeof ui}:function(ui){return ui&&typeof Symbol=="function"&&ui.constructor===Symbol&&ui!==Symbol.prototype?"symbol":typeof ui},Ke(Eo)}Object.defineProperty(we,"__esModule",{value:!0}),we.default=vl;var ot=cr(_M()),ut=Xt(FB());function Xt(Eo){return Eo&&Eo.__esModule?Eo:{default:Eo}}function $t(Eo){if(typeof WeakMap!="function")return null;var ui=new WeakMap,mo=new WeakMap;return($t=function(ki){return ki?mo:ui})(Eo)}function cr(Eo,ui){if(Eo&&Eo.__esModule)return Eo;if(Eo===null||Ke(Eo)!=="object"&&typeof Eo!="function")return{default:Eo};var mo=$t(ui);if(mo&&mo.has(Eo))return mo.get(Eo);var Rs={},ki=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $s in Eo)if($s!=="default"&&Object.prototype.hasOwnProperty.call(Eo,$s)){var Di=ki?Object.getOwnPropertyDescriptor(Eo,$s):null;Di&&(Di.get||Di.set)?Object.defineProperty(Rs,$s,Di):Rs[$s]=Eo[$s]}return Rs.default=Eo,mo&&mo.set(Eo,Rs),Rs}function kr(Eo,ui){if(!(Eo instanceof ui))throw new TypeError("Cannot call a class as a function")}function tn(Eo,ui){for(var mo=0;mo"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 eo(Eo){return eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(mo){return mo.__proto__||Object.getPrototypeOf(mo)},eo(Eo)}var li=["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"],wo=typeof window<"u";function vl(Eo){var ui=(function(mo){yn(ki,mo);var Rs=ea(ki);function ki($s){var Di;return kr(this,ki),Di=Rs.call(this,$s),Di.p=Promise.resolve(),Di.resizeHandler=null,Di.handlers={},Di.syncWindowResize=Di.syncWindowResize.bind(Gi(Di)),Di.syncEventHandlers=Di.syncEventHandlers.bind(Gi(Di)),Di.attachUpdateEvents=Di.attachUpdateEvents.bind(Gi(Di)),Di.getRef=Di.getRef.bind(Gi(Di)),Di.handleUpdate=Di.handleUpdate.bind(Gi(Di)),Di.figureCallback=Di.figureCallback.bind(Gi(Di)),Di.updatePlotly=Di.updatePlotly.bind(Gi(Di)),Di}return Ur(ki,[{key:"updatePlotly",value:function(Di,zo,Nl){var Si=this;this.p=this.p.then(function(){if(!Si.unmounting){if(!Si.el)throw new Error("Missing element reference");return Eo.react(Si.el,{data:Si.props.data,layout:Si.props.layout,config:Si.props.config,frames:Si.props.frames})}}).then(function(){Si.unmounting||(Si.syncWindowResize(Di),Si.syncEventHandlers(),Si.figureCallback(zo),Nl&&Si.attachUpdateEvents())}).catch(function(Ii){Si.props.onError&&Si.props.onError(Ii)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(Di){this.unmounting=!1;var zo=Di.frames&&Di.frames.length?Di.frames.length:0,Nl=this.props.frames&&this.props.frames.length?this.props.frames.length:0,Si=!(Di.layout===this.props.layout&&Di.data===this.props.data&&Di.config===this.props.config&&Nl===zo),Ii=Di.revision!==void 0,Ti=Di.revision!==this.props.revision;!Si&&(!Ii||Ii&&!Ti)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&wo&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Eo.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var Di=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Di.el.on(zo,Di.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var Di=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Di.el.removeListener(zo,Di.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(Di){if(typeof Di=="function"){var zo=this.el,Nl=zo.data,Si=zo.layout,Ii=this.el._transitionData?this.el._transitionData._frames:null,Ti={data:Nl,layout:Si,frames:Ii};Di(Ti,this.el)}}},{key:"syncWindowResize",value:function(Di){var zo=this;wo&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Eo.Plots.resize(zo.el)},window.addEventListener("resize",this.resizeHandler),Di&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(Di){this.el=Di,this.props.debug&&wo&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var Di=this;li.forEach(function(zo){var Nl=Di.props["on"+zo],Si=Di.handlers[zo],Ii=!!Si;Nl&&!Ii?Di.addEventHandler(zo,Nl):!Nl&&Ii?Di.removeEventHandler(zo):Nl&&Ii&&Nl!==Si&&(Di.removeEventHandler(zo),Di.addEventHandler(zo,Nl))})}},{key:"addEventHandler",value:function(Di,zo){this.handlers[Di]=zo,this.el.on(this.getPlotlyEventName(Di),this.handlers[Di])}},{key:"removeEventHandler",value:function(Di){this.el.removeListener(this.getPlotlyEventName(Di),this.handlers[Di]),delete this.handlers[Di]}},{key:"getPlotlyEventName",value:function(Di){return"plotly_"+Di.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 ui.propTypes={data:ut.default.arrayOf(ut.default.object),config:ut.default.object,layout:ut.default.object,frames:ut.default.arrayOf(ut.default.object),revision:ut.default.number,onInitialized:ut.default.func,onPurge:ut.default.func,onError:ut.default.func,onUpdate:ut.default.func,debug:ut.default.bool,style:ut.default.object,className:ut.default.string,useResizeHandler:ut.default.bool,divId:ut.default.string},li.forEach(function(mo){ui.propTypes["on"+mo]=ut.default.func}),ui.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},ui}})(rk)),rk}var sM={exports:{}},NB=sM.exports,e4;function UB(){return e4||(e4=1,(function(we){var Ke={};(function(ot,ut){we.exports?we.exports=ut():ot.moduleName=ut()})(typeof self<"u"?self:NB,()=>{var ot=(()=>{var ut=Object.create,Xt=Object.defineProperty,$t=Object.defineProperties,cr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,Ur=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,Bn=(K,G,h)=>G in K?Xt(K,G,{enumerable:!0,configurable:!0,writable:!0,value:h}):K[G]=h,Gi=(K,G)=>{for(var h in G||(G={}))Mn.call(G,h)&&Bn(K,h,G[h]);if(Ur)for(var h of Ur(G))ea.call(G,h)&&Bn(K,h,G[h]);return K},bo=(K,G)=>$t(K,kr(G)),eo=(K,G)=>{var h={};for(var b in K)Mn.call(K,b)&&G.indexOf(b)<0&&(h[b]=K[b]);if(K!=null&&Ur)for(var b of Ur(K))G.indexOf(b)<0&&ea.call(K,b)&&(h[b]=K[b]);return h},li=(K,G)=>function(){return K&&(G=(0,K[tn(K)[0]])(K=0)),G},Ge=(K,G)=>function(){return G||(0,K[tn(K)[0]])((G={exports:{}}).exports,G),G.exports},wo=(K,G)=>{for(var h in G)Xt(K,h,{get:G[h],enumerable:!0})},vl=(K,G,h,b)=>{if(G&&typeof G=="object"||typeof G=="function")for(let S of tn(G))!Mn.call(K,S)&&S!==h&&Xt(K,S,{get:()=>G[S],enumerable:!(b=cr(G,S))||b.enumerable});return K},Eo=(K,G,h)=>(h=K!=null?ut(yn(K)):{},vl(Xt(h,"default",{value:K,enumerable:!0}),K)),ui=K=>vl(Xt({},"__esModule",{value:!0}),K),mo=Ge({"src/version.js"(K){K.version="3.3.1"}}),Rs=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,hn=_r.length,Sn=Oe[Zr++],Cn,La,zn,Qn=new A,la;++Xr=Oe.length)return er;var Zr=[],Xr=rt[_r++];return er.forEach(function(hn,Sn){Zr.push({key:hn,values:tr(Sn,_r)})}),Xr?Zr.sort(function(hn,Sn){return Xr(hn.key,Sn.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=Er);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)+"$"),hn;for(var Sn in this)if(hn=Sn.match(Xr)){var Cn=this[Sn];this.removeEventListener(hn[1],Cn,Cn.$),delete this[Sn]}}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 Er(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 Mr,$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(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(tr){if(wt.on(Oe,null),Mr&&(St[Mr]=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 Nr=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(Nr<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();Nr=!(It.f||It.e),rt.remove()}}return Nr?(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,Br=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,hn,Sn;if(Xr0&&(lo=lo.transition().duration(tr)),lo.call(Ra.event)}function _o(){Qn&&Qn.domain(zn.range().map(function(lo){return(lo-ge.x)/ge.k}).map(zn.invert)),Sa&&Sa.domain(la.range().map(function(lo){return(lo-ge.y)/ge.k}).map(la.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),el=0,$l=h.select(t(lo)).on(Zr,El).on(Xr,Kl),zl=sa(h.mouse(lo)),Ac=Sr(lo);Ta.call(lo),ko(Ls);function El(){el=1,zi(h.mouse(lo),zl),Ws(Ls)}function Kl(){$l.on(Zr,null).on(Xr,null),Ac(el),Po(Ls)}}function nl(){var lo=this,Ls=La.of(lo,arguments),el={},$l=0,zl,Ac=".zoom-"+h.event.changedTouches[0].identifier,El="touchmove"+Ac,Kl="touchend"+Ac,Kc=[],Pu=h.select(lo),mt=Sr(lo);wr(),ko(Ls),Pu.on(_r,null).on(Sn,wr);function yr(){var gn=h.touches(lo);return zl=ge.k,gn.forEach(function(pn){pn.identifier in el&&(el[pn.identifier]=sa(pn))}),gn}function wr(){var gn=h.event.target;h.select(gn).on(El,Ln).on(Kl,fa),Kc.push(gn);for(var pn=h.event.changedTouches,za=0,Ia=pn.length;za1){var Bi=Da[0],yi=Da[1],Ga=Bi[0]-yi[0],ga=Bi[1]-yi[1];$l=Ga*Ga+ga*ga}}function Ln(){var gn=h.touches(lo),pn,za,Ia,Da;Ta.call(lo);for(var Za=0,Bi=gn.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?da(ge.l,ge.a,ge.b):da((ge=Dr((ge=h.rgb(ge)).r,ge.g,ge.b)).l,ge.a,ge.b):new sr(ge,Oe,rt)}var qt=sr.prototype=new aa;qt.brighter=function(ge){return new sr(this.h,this.c,Math.min(100,this.l+Gr*(arguments.length?ge:1)))},qt.darker=function(ge){return new sr(this.h,this.c,Math.max(0,this.l-Gr*(arguments.length?ge:1)))},qt.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,sn=.95047,mn=1,Tn=1.08883,Jn=ur.prototype=new aa;Jn.brighter=function(ge){return new ur(Math.min(100,this.l+Gr*(arguments.length?ge:1)),this.a,this.b)},Jn.darker=function(ge){return new ur(Math.max(0,this.l-Gr*(arguments.length?ge:1)),this.a,this.b)},Jn.rgb=function(){return ma(this.l,this.a,this.b)};function ma(ge,Oe,rt){var wt=(ge+16)/116,St=wt+Oe/500,It=wt-rt/200;return St=_a(St)*sn,wt=_a(wt)*mn,It=_a(It)*Tn,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 da(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 Mi(ge){return new pi(ge>>16,ge>>8&255,ge&255)}function Dt(ge){return Mi(ge)+""}var xt=pi.prototype=new aa;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)/sn),St=Ca((.2126729*ge+.7151522*Oe+.072175*rt)/mn),It=Ca((.0193339*ge+.119192*Oe+.9503041*rt)/Tn);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 ln(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,Mi(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,hn;if(!Xr&&Rn(er)||Xr>=200&&Xr<300||Xr===304){try{hn=rt.call(St,er)}catch(Sn){It.error.call(St,Sn);return}It.load.call(St,hn)}else It.error.call(St,er)}return er.onprogress=function(Xr){var hn=h.event;h.event=Xr;try{It.progress.call(St,er)}finally{h.event=hn}},St.header=function(Xr,hn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?tr[Xr]:(hn==null?delete tr[Xr]:tr[Xr]=hn+"",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,hn,Sn){if(arguments.length===2&&typeof hn=="function"&&(Sn=hn,hn=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),Sn!=null&&St.on("error",Sn).on("load",function(La){Sn(null,La)}),It.beforesend.call(St,er),er.send(hn??null),St},St.abort=function(){return er.abort(),St},h.rebind(St,It,"on"),wt==null?St:St.get(un(wt))}function un(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,hn){arguments.length<3&&(hn=Xr,Xr=null);var Sn=zr(Zr,Oe,Xr==null?It:tr(Xr),hn);return Sn.row=function(Cn){return arguments.length?Sn.response((Xr=Cn)==null?It:tr(Cn)):Xr},Sn}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 hn;return St.parseRows(Zr,function(Sn,Cn){if(hn)return hn(Sn,Cn-1);var La=function(zn){for(var Qn={},la=Sn.length,Sa=0;Sa=La)return Sn;if(Sa)return Sa=!1,hn;var ai=zn;if(Zr.charCodeAt(ai)===34){for(var Yi=ai;Yi++24?(isFinite(Oe)&&(clearTimeout(In),In=setTimeout(Ci,Oe)),cn=0):(cn=1,gi(Ci))}h.timer.flush=function(){Hi(),so()};function Hi(){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[hn[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=ll(ge);if(Vs.insert(wt,_r),!(!wt&&!St)){if(wt===St){ul(wt),St=ll(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}ul(wt),ul(St);var Zr=wt.site,Xr=Zr.x,hn=Zr.y,Sn=ge.x-Xr,Cn=ge.y-hn,La=St.site,zn=La.x-Xr,Qn=La.y-hn,la=2*(Sn*Qn-Cn*zn),Sa=Sn*Sn+Cn*Cn,Ra=zn*zn+Qn*Qn,sa={x:(Qn*Sa-Cn*Ra)/la+Xr,y:(Sn*Ra-zn*Sa)/la+hn};Io(St.edge,Zr,La,sa),_r.edge=Xl(Zr,ge,null,sa),St.edge=Xl(ge,La,null,sa),Zs(wt),Zs(St)}}function di(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,hn=1/It-1/Zr,Sn=Xr/Zr;return hn?(-Sn+Math.sqrt(Sn*Sn-2*hn*(Xr*Xr/(-2*Zr)-_r+Zr/2+St-It/2)))/hn+wt:(wt+er)/2}function to(ge,Oe){var rt=ge.N;if(rt)return di(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,hn,Sn,Cn,La,zn,Qn;Xr--;)if(hn=Zr[Xr],!(!hn||!hn.prepare()))for(Cn=hn.edges,La=Cn.length,Sn=0;SnJe||l(_r-tr)>Je)&&(Cn.splice(Sn,0,new cu(Yl(hn.site,Qn,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 Sn=_r*_r+Zr*Zr,Cn=Xr*Xr+Qn*Qn,La=(Qn*Sn-Zr*Cn)/hn,zn=(_r*Cn-Xr*Sn)/hn,Qn=zn+er,la=vo.pop()||new Rl;la.arc=ge,la.site=St,la.x=La+tr,la.y=Qn+Math.sqrt(La*La+zn*zn),la.cy=Qn,ge.circle=la;for(var Sa=null,Ra=Zo._;Ra;)if(la.y0)){if(zn/=Cn,Cn<0){if(zn0){if(zn>Sn)return;zn>hn&&(hn=zn)}if(zn=rt-er,!(!Cn&&zn<0)){if(zn/=Cn,Cn<0){if(zn>Sn)return;zn>hn&&(hn=zn)}else if(Cn>0){if(zn0)){if(zn/=La,La<0){if(zn0){if(zn>Sn)return;zn>hn&&(hn=zn)}if(zn=wt-_r,!(!La&&zn<0)){if(zn/=La,La<0){if(zn>Sn)return;zn>hn&&(hn=zn)}else if(La>0){if(zn0&&(St.a={x:er+hn*Cn,y:_r+hn*La}),Sn<1&&(St.b={x:er+Sn*Cn,y:_r+Sn*La}),St}}}}}}function Ji(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>Sn){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>Sn){if(!wt)wt={x:(tr-la)/Qn,y:tr};else if(wt.y>=er)return;rt={x:(er-la)/Qn,y:er}}else{if(!wt)wt={x:(er-la)/Qn,y:er};else if(wt.y=It)return;rt={x:It,y:Qn*It+la}}else{if(!wt)wt={x:It,y:Qn*It+la};else if(wt.x=Xr&&la.x<=Sn&&la.y>=hn&&la.y<=Cn?[[Xr,Cn],[Sn,Cn],[Sn,hn],[Xr,hn]]:[];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 Yu(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 Yu(er(_r)).cells.forEach(function(Xr,hn){for(var Sn=Xr.site,Cn=Xr.edges.sort(Fo),La=-1,zn=Cn.length,Qn,la=Cn[zn-1].edge,Sa=la.l===Sn?la.r:la.l;++LaRa&&(Ra=Xr.x),Xr.y>sa&&(sa=Xr.y),Cn.push(Xr.x),La.push(Xr.y);else for(zn=0;znRa&&(Ra=ai),Yi>sa&&(sa=Yi),Cn.push(ai),La.push(Yi)}var zi=Ra-la,Vi=sa-Sa;zi>Vi?sa=Sa+zi:Ra=la+Vi;function _o(Po,os,nl,Iu,eu,lo,Ls,el){if(!(isNaN(nl)||isNaN(Iu)))if(Po.leaf){var $l=Po.x,zl=Po.y;if($l!=null)if(l($l-nl)+l(zl-Iu)<.01)ko(Po,os,nl,Iu,eu,lo,Ls,el);else{var Ac=Po.point;Po.x=Po.y=Po.point=null,ko(Po,Ac,$l,zl,eu,lo,Ls,el),ko(Po,os,nl,Iu,eu,lo,Ls,el)}else Po.x=nl,Po.y=Iu,Po.point=os}else ko(Po,os,nl,Iu,eu,lo,Ls,el)}function ko(Po,os,nl,Iu,eu,lo,Ls,el){var $l=(eu+Ls)*.5,zl=(lo+el)*.5,Ac=nl>=$l,El=Iu>=zl,Kl=El<<1|Ac;Po.leaf=!1,Po=Po.nodes[Kl]||(Po.nodes[Kl]=Tl()),Ac?eu=$l:Ls=$l,El?lo=zl:el=zl,_o(Po,os,nl,Iu,eu,lo,Ls,el)}var Ws=Tl();if(Ws.add=function(Po){_o(Ws,Po,+hn(Po,++zn),+Sn(Po,zn),la,Sa,Ra,sa)},Ws.visit=function(Po){Ic(Po,Ws,la,Sa,Ra,sa)},Ws.find=function(Po){return zh(Ws,Po[0],Po[1],la,Sa,Ra,sa)},zn=-1,Oe==null){for(;++znIt||Sn>tr||Cn=ai,Vi=rt>=Yi,_o=Vi<<1|zi,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=Wu.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 aa?oc:Array.isArray(Oe)?Il:rt==="object"&&isNaN(Oe)?Zu:sc)(ge,Oe)}],h.interpolateArray=Il;function Il(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=bc.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 $u(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 ma(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 Bl(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),Ku(ge.translate,Oe.translate,rt,wt),Wf(ge.rotate,Oe.rotate,rt,wt),Nh(ge.skew,Oe.skew,rt,wt),Bl(ge.scale,Oe.scale,rt,wt),ge=Oe=null,function(St){for(var It=-1,tr=wt.length,er;++It0?It=sa:(rt.c=null,rt.t=NaN,rt=null,Oe.end({type:"end",alpha:It=0})):sa>0&&(Oe.start({type:"start",alpha:It=sa}),rt=Ea(ge.tick)),ge):It},ge.start=function(){var sa,ai=Cn.length,Yi=La.length,zi=wt[0],Vi=wt[1],_o,ko;for(sa=0;sa=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(hn){var Sn,Cn;ge&&(Sn=hn.children)&&Sn.sort(ge),rt&&(Cn=hn.parent)&&(Cn.value+=hn.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=ev,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 Fc(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,Sn){for(var er=[],_r=It.map(Oe,this),Zr=rt.call(this,_r,Sn),Xr=wt.call(this,Zr,_r,Sn),hn,Sn=-1,Cn=_r.length,La=Xr.length-1,zn=ge?1:1/Cn,Qn;++Sn0)for(Sn=-1;++Sn=Zr[0]&&Qn<=Zr[1]&&(hn=er[h.bisect(Xr,Qn,1,La)-1],hn.y+=zn,hn.push(It[Sn]));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 su(tr,It)}:At(It),St):wt},St.frequency=function(It){return arguments.length?(ge=!!It,St):ge},St};function Uh(ge,Oe){return su(ge,Math.ceil(Math.log(Oe.length)/Math.LN2+1))}function su(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],hn=wt==null?Math.sqrt:typeof wt=="function"?wt:function(){return wt};if(_r.x=_r.y=0,pf(_r,function(Cn){Cn.r=+hn(Cn.value)}),pf(_r,vh),Oe){var Sn=Oe*(wt?1:Math.max(2*_r.r/Zr,2*_r.r/Xr))/2;pf(_r,function(Cn){Cn.r+=Sn}),pf(_r,vh),pf(_r,function(Cn){Cn.r-=Sn})}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)||!(Sn=Oe.length))return;var Oe,rt=1/0,wt=-1/0,St=1/0,It=-1/0,tr,er,_r,Zr,Xr,hn,Sn;function Cn(sa){rt=Math.min(sa.x-sa.r,rt),wt=Math.max(sa.x+sa.r,wt),St=Math.min(sa.y-sa.r,St),It=Math.max(sa.y+sa.r,It)}if(Oe.forEach(kd),tr=Oe[0],tr.x=-tr.r,tr.y=0,Cn(tr),Sn>1&&(er=Oe[1],er.x=er.r,er.y=0,Cn(er),Sn>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;ZrQn.x&&(Qn=ai),ai.depth>la.depth&&(la=ai)});var Sa=Oe(zn,Qn)/2-zn.x,Ra=rt[0]/(Qn.x+Oe(Qn,zn)/2+Sa),sa=rt[1]/(la.depth||1);rh(Cn,function(ai){ai.x=(ai.x+Sa)*Ra,ai.y=ai.depth*sa})}return Sn}function It(Xr){for(var hn={A:null,children:[Xr]},Sn=[hn],Cn;(Cn=Sn.pop())!=null;)for(var La=Cn.children,zn,Qn=0,la=La.length;Qn0&&(wc(Vf(zn,Xr,Sn),Xr,ai),la+=ai,Sa+=ai),Ra+=zn.m,la+=Cn.m,sa+=Qn.m,Sa+=La.m;zn&&!Su(La)&&(La.t=zn,La.m+=Ra-Sa),Cn&&!gf(Qn)&&(Qn.t=Cn,Qn.m+=la-sa,Sn=Xr)}return Sn}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 wc(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 Qn=zn.children;Qn&&Qn.length?(zn.x=jh(Qn),zn.y=yf(Qn)):(zn.x=Zr?Xr+=Oe(zn,Zr):0,zn.y=0,Zr=zn)});var hn=fr(_r),Sn=Rr(_r),Cn=hn.x-Oe(hn,Sn)/2,La=Sn.x+Oe(Sn,hn)/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 fr(ge){var Oe=ge.children;return Oe&&Oe.length?fr(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=vn,It=!1,tr,er="squarify",_r=.5*(1+Math.sqrt(5));function Zr(zn,Qn){for(var la=-1,Sa=zn.length,Ra,sa;++la0;)Sa.push(sa=Ra[Vi-1]),Sa.area+=sa.area,er!=="squarify"||(Yi=Sn(Sa,zi))<=ai?(Ra.pop(),ai=Yi):(Sa.area-=Sa.pop().area,Cn(Sa,zi,la,!1),zi=Math.min(la.dx,la.dy),Sa.length=Sa.area=0,ai=1/0);Sa.length&&(Cn(Sa,zi,la,!0),Sa.length=Sa.area=0),Qn.forEach(Xr)}}function hn(zn){var Qn=zn.children;if(Qn&&Qn.length){var la=St(zn),Sa=Qn.slice(),Ra,sa=[];for(Zr(Sa,la.dx*la.dy/zn.value),sa.area=0;Ra=Sa.pop();)sa.push(Ra),sa.area+=Ra.area,Ra.z!=null&&(Cn(sa,Ra.z?la.dx:la.dy,la,!Sa.length),sa.length=sa.area=0);Qn.forEach(hn)}}function Sn(zn,Qn){for(var la=zn.area,Sa,Ra=0,sa=1/0,ai=-1,Yi=zn.length;++aiRa&&(Ra=Sa));return la*=la,Qn*=Qn,la?Math.max(Qn*Ra*_r/la,la/(Qn*sa*_r)):1/0}function Cn(zn,Qn,la,Sa){var Ra=-1,sa=zn.length,ai=la.x,Yi=la.y,zi=Qn?Oe(zn.area/Qn):0,Vi;if(Qn==la.dx){for((Sa||zi>la.dy)&&(zi=la.dy);++Rala.dx)&&(zi=la.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,ci(Xi(ge,Oe)[2])),ti(ge,ci(Xi(ge,Oe)[2])),ge}function Xi(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,Xi(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],hn=Math.floor(St(Zr)),Sn=Math.ceil(St(Xr)),Cn=Oe%1?2:Oe;if(isFinite(Sn-hn)){if(rt){for(;hn0;La--)_r.push(It(hn)*La);for(hn=0;_r[hn]Xr;Sn--);_r=_r.slice(hn,Sn)}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=Zi(Oe),St=Zi(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=Zi(Oe=tr),St=Zi(1/Oe),ge.domain(rt.map(wt)),It):Oe},It.copy=function(){return jo(ge.copy(),Oe,rt)},Qa(It,ge)}function Zi(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],ItSn?0:1;if(Xr=Ee)return _r(Xr,La)+(Zr?_r(Zr,1-La):"")+"Z";var zn,Qn,la,Sa,Ra=0,sa=0,ai,Yi,zi,Vi,_o,ko,Ws,Po,os=[];if((Sa=(+tr.apply(this,arguments)||0)/2)&&(la=wt===Vl?Math.sqrt(Zr*Zr+Xr*Xr):+wt.apply(this,arguments),La||(sa*=-1),Xr&&(sa=Ot(la/Xr*Math.sin(Sa))),Zr&&(Ra=Ot(la/Zr*Math.sin(Sa)))),Xr){ai=Xr*Math.cos(hn+sa),Yi=Xr*Math.sin(hn+sa),zi=Xr*Math.cos(Sn-sa),Vi=Xr*Math.sin(Sn-sa);var nl=Math.abs(Sn-hn-2*sa)<=xe?0:1;if(sa&&yc(ai,Yi,zi,Vi)===La^nl){var Iu=(hn+Sn)/2;ai=Xr*Math.cos(Iu),Yi=Xr*Math.sin(Iu),zi=Vi=null}}else ai=Yi=0;if(Zr){_o=Zr*Math.cos(Sn-Ra),ko=Zr*Math.sin(Sn-Ra),Ws=Zr*Math.cos(hn+Ra),Po=Zr*Math.sin(hn+Ra);var eu=Math.abs(hn-Sn+2*Ra)<=xe?0:1;if(Ra&&yc(_o,ko,Ws,Po)===1-La^eu){var lo=(hn+Sn)/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){Qn=Zr0?0:1}function Tc(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,hn=ge[1]+Zr,Sn=Oe[0]+_r,Cn=Oe[1]+Zr,La=(Xr+Sn)/2,zn=(hn+Cn)/2,Qn=Sn-Xr,la=Cn-hn,Sa=Qn*Qn+la*la,Ra=rt-wt,sa=Xr*Cn-Sn*hn,ai=(la<0?-1:1)*Math.sqrt(Math.max(0,Ra*Ra*Sa-sa*sa)),Yi=(sa*la-Qn*ai)/Sa,zi=(-sa*Qn-la*ai)/Sa,Vi=(sa*la+Qn*ai)/Sa,_o=(-sa*Qn+la*ai)/Sa,ko=Yi-La,Ws=zi-zn,Po=Vi-La,os=_o-zn;return ko*ko+Ws*Ws>Po*Po+os*os&&(Yi=Vi,zi=_o),[[Yi-_r,zi-Zr],[Yi*rt/Ra,zi*rt/Ra]]}function $f(){return!0}function _c(ge){var Oe=io,rt=Mo,wt=$f,St=Lu,It=St.key,tr=.7;function er(_r){var Zr=[],Xr=[],hn=-1,Sn=_r.length,Cn,La=At(Oe),zn=At(rt);function Qn(){Zr.push("M",St(ge(Xr),tr))}for(;++hn1?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=_c(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 "+hn}function Zr(Xr,hn,Sn,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))||on)(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 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 En=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*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=To||++Wi,rt=Qs(ge),wt=[],St,It,tr=ho||{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,hn=Zr.length;++Xr0;)hn[--Sa].call(ge,la);if(Qn>=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(Sn,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=al,rt=6,wt=6,St=3,It=[10],tr=null,er;function _r(Zr){Zr.each(function(){var Xr=h.select(this),hn=this.__chart__||ge,Sn=this.__chart__=ge.copy(),Cn=tr??(Sn.ticks?Sn.ticks.apply(Sn,It):Sn.domain()),La=er??(Sn.tickFormat?Sn.tickFormat.apply(Sn,It):F),zn=Xr.selectAll(".tick").data(Cn,Sn),Qn=zn.enter().insert("g",".domain").attr("class","tick").style("opacity",Je),la=h.transition(zn.exit()).style("opacity",Je).remove(),Sa=h.transition(zn.order()).style("opacity",1),Ra=Math.max(rt,0)+St,sa,ai=Aa(Sn),Yi=Xr.selectAll(".domain").data([0]),zi=(Yi.enter().append("path").attr("class","domain"),h.transition(Yi));Qn.append("line"),Qn.append("text");var Vi=Qn.select("line"),_o=Sa.select("line"),ko=zn.select("text").text(La),Ws=Qn.select("text"),Po=Sa.select("text"),os=Oe==="top"||Oe==="left"?-1:1,nl,Iu,eu,lo;if(Oe==="bottom"||Oe==="top"?(sa=iu,nl="x",eu="y",Iu="x2",lo="y2",ko.attr("dy",os<0?"0em":".71em").style("text-anchor","middle"),zi.attr("d","M"+ai[0]+","+os*wt+"V0H"+ai[1]+"V"+os*wt)):(sa=ks,nl="y",eu="x",Iu="y2",lo="x2",ko.attr("dy",".32em").style("text-anchor",os<0?"end":"start"),zi.attr("d","M"+os*wt+","+ai[0]+"H0V"+ai[1]+"H"+os*wt)),Vi.attr(lo,os*rt),Ws.attr(eu,os*Ra),_o.attr(Iu,0).attr(lo,os*rt),Po.attr(nl,0).attr(eu,os*Ra),Sn.rangeBand){var Ls=Sn,el=Ls.rangeBand()/2;hn=Sn=function($l){return Ls($l)+el}}else hn.rangeBand?hn=Sn:la.call(sa,Sn,hn);Qn.call(sa,hn,Sn),Sa.call(sa,Sn,Sn)})}return _r.scale=function(Zr){return arguments.length?(ge=Zr,_r):ge},_r.orient=function(Zr){return arguments.length?(Oe=Zr in mu?Zr+"":al,_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 al="bottom",mu={top:1,right:1,bottom:1,left:1};function iu(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 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),la=Qn.selectAll(".background").data([0]);la.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 Sa=Qn.selectAll(".resize").data(Zr,F);Sa.exit().remove(),Sa.enter().append("g").attr("class",function(Yi){return"resize "+Yi}).style("cursor",function(Yi){return Cs[Yi]}).append("rect").attr("x",function(Yi){return/[ew]$/.test(Yi)?-3:null}).attr("y",function(Yi){return/^[ns]/.test(Yi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Sa.style("display",Xr.empty()?"none":null);var Ra=h.transition(Qn),sa=h.transition(la),ai;Oe&&(ai=Aa(Oe),sa.attr("x",ai[0]).attr("width",ai[1]-ai[0]),Sn(Ra)),rt&&(ai=Aa(rt),sa.attr("y",ai[0]).attr("height",ai[1]-ai[0]),Cn(Ra)),hn(Ra)})}Xr.event=function(zn){zn.each(function(){var Qn=ge.of(this,arguments),la={x:wt,y:St,i:It,j:tr},Sa=this.__chart__||la;this.__chart__=la,To?h.select(this).transition().each("start.brush",function(){It=Sa.i,tr=Sa.j,wt=Sa.x,St=Sa.y,Qn({type:"brushstart"})}).tween("brush:brush",function(){var Ra=Il(wt,la.x),sa=Il(St,la.y);return It=tr=null,function(ai){wt=la.x=Ra(ai),St=la.y=sa(ai),Qn({type:"brush",mode:"resize"})}}).each("end.brush",function(){It=la.i,tr=la.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("+wt[+/e$/.test(Qn)]+","+St[+/^s/.test(Qn)]+")"})}function Sn(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,Qn=h.select(h.event.target),la=ge.of(zn,arguments),Sa=h.select(zn),Ra=Qn.datum(),sa=!/^(n|s)$/.test(Ra)&&Oe,ai=!/^(e|w)$/.test(Ra)&&rt,Yi=Qn.classed("extent"),zi=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",eu).on("touchend.brush",Ls):Ws.on("mousemove.brush",eu).on("mouseup.brush",Ls),Sa.interrupt().selectAll("*").interrupt(),Yi)_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",Qn.style("cursor")),la({type:"brushstart"}),eu();function nl(){h.event.keyCode==32&&(Yi||(Vi=null,_o[0]-=wt[1],_o[1]-=St[1],Yi=2),re())}function Iu(){h.event.keyCode==32&&Yi==2&&(_o[0]+=wt[1],_o[1]+=St[1],Yi=0,re())}function eu(){var el=h.mouse(zn),$l=!1;ko&&(el[0]+=ko[0],el[1]+=ko[1]),Yi||(h.event.altKey?(Vi||(Vi=[(wt[0]+wt[1])/2,(St[0]+St[1])/2]),_o[0]=wt[+(el[0]0))return ar;do ar.push(Er=new Date(+Ft)),Ne(Ft,Qt),pe(Ft);while(Er=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););})},lt&&(nt.count=function(Ft,Nt){return b.setTime(+Ft),S.setTime(+Nt),pe(b),pe(S),Math.floor(lt(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,lt){Ne.setTime(+Ne+lt*pe)},function(Ne,lt){return(lt-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,lt){Ne.setDate(Ne.getDate()+lt*7)},function(Ne,lt){return(lt-Ne-(lt.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,lt){Ne.setFullYear(Ne.getFullYear()+lt*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,lt){Ne.setUTCDate(Ne.getUTCDate()+lt*7)},function(Ne,lt){return(lt-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,lt){Ne.setUTCFullYear(Ne.getUTCFullYear()+lt*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})})}}),Di=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,$s()):(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),Br=f(Qe),kn=c(Qe),Wn=f(Lt),Vn=c(Lt),na={a:ma,A:da,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},aa={a:Mi,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:lt,Y:dt,Z:nt,"%":Ft},Un={a:or,A:ur,b:Gr,B:sn,c:mn,d:m,e:m,f:z,H:d,I:d,j:u,L,m:w,M:y,p:qt,q:_,Q:N,s:B,S:I,u:v,U:T,V:l,w:p,W:g,x:Tn,X:Jn,y:A,Y:x,Z:M,"%":F};na.x=ka(ke,na),na.X=ka(xe,na),na.c=ka(Je,na),aa.x=ka(ke,aa),aa.X=ka(xe,aa),aa.c=ka(Je,aa);function ka(Dr,qr){return function(ln){var Jr=[],At=-1,lr=0,zr=Dr.length,un,Rn,qn;for(ln instanceof Date||(ln=new Date(+ln));++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,ln,Jr){for(var At=0,lr=qr.length,zr=ln.length,un,Rn;At=zr)return-1;if(un=qr.charCodeAt(At++),un===37){if(un=qr.charAt(At++),Rn=Un[un in r?qr.charAt(At++):un],!Rn||(Jr=Rn(Dr,ln,Jr))<0)return-1}else if(un!=ln.charCodeAt(Jr++))return-1}return Jr}function qt(Dr,qr,ln){var Jr=Ct.exec(qr.slice(ln));return Jr?(Dr.p=Ot[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function or(Dr,qr,ln){var Jr=mr.exec(qr.slice(ln));return Jr?(Dr.w=vr[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function ur(Dr,qr,ln){var Jr=Kt.exec(qr.slice(ln));return Jr?(Dr.w=xr[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function Gr(Dr,qr,ln){var Jr=Wn.exec(qr.slice(ln));return Jr?(Dr.m=Vn[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function sn(Dr,qr,ln){var Jr=Br.exec(qr.slice(ln));return Jr?(Dr.m=kn[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function mn(Dr,qr,ln){return sr(Dr,Je,qr,ln)}function Tn(Dr,qr,ln){return sr(Dr,ke,qr,ln)}function Jn(Dr,qr,ln){return sr(Dr,xe,qr,ln)}function ma(Dr){return Xe[Dr.getDay()]}function da(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 Mi(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+="",na);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+="",aa);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 lt(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;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 ar=t(je),h.timeFormat=ar.format,h.timeParse=ar.parse,h.utcFormat=ar.utcFormat,h.utcParse=ar.utcParse,ar}var Mr="%Y-%m-%dT%H:%M:%S.%LZ";function $r(je){return je.toISOString()}var Sr=Date.prototype.toISOString?$r:h.utcFormat(Mr);function Nr(je){var Je=new Date(je);return isNaN(Je)?null:Je}var Mt=+new Date("2000-01-01T00:00:00.000Z")?Nr:h.utcParse(Mr);h.isoFormat=Sr,h.isoParse=Mt,h.timeFormatDefaultLocale=Er,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})})}}),Nl=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}}}),Si=Ge({"node_modules/fast-isnumeric/index.js"(K,G){var h=Nl();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}}}),Kn=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}}}),Is=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)}}),Ki=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)}}}),Wg=Ge({"src/lib/coerce.js"(K){var G=Si(),h=Is(),b=Ki().extendFlat,S=Gl(),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")}}}}),Vc=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;eGi({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),K.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>Gi({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})}}),sv=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=Gl(),S=Ns(),E=md().dash,e=Ki().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=sv();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=Ki().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}}}}),T1=Ge({"src/plots/layout_attributes.js"(K,G){var h=Ns(),b=Jg(),S=Xf(),E=Qg(),e=Vw(),t=Hw(),r=Ki().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"})}}}),UT=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=lu(),h=Vc(),b=Wd(),S=So(),E=Kg().addStyleRule,e=Ki(),t=Gl(),r=T1(),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;K.incrementMonth=function(F,N,B){B=v(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},K.findExactDates=function(F,N){for(var B=0,R=0,U=0,j=0,Z,re,fe=v(N)&&a.getComponentMethod("calendars","getCal")(N),le=0;le1?(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}}}),qT=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)}}}),MM=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}}}),VT=Ge({"src/lib/preserve_drawing_buffer.js"(K,G){var h=Si(),b=MM();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}}}),HT=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}}}),EM=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}}}),A1=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=Si(),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=Di().utcFormat,S=zo().format,E=Si(),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=Kn();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=Wg();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=am();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=zp();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=lx();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=jT();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=qT();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=Ki();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var M=lu();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=VT(),n.makeTraceGroups=HT(),n._=EM(),n.notifier=Ul(),n.filterUnique=A1(),n.filterVisible=ux(),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=Vc(),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(bo(Gi({},te),{opts:U}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=te=>ce(bo(Gi({},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(bo(Gi({},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]}}}),kM=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}}),cx=Ge({"node_modules/is-browser/client.js"(K,G){G.exports=!0}}),Xw=Ge({"node_modules/has-hover/index.js"(K,G){var h=cx(),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=Di().timeFormatLocale,S=zo().formatLocale,E=Si(),e=Ti(),t=Ro(),r=ry(),o=_u(),n=_n(),i=go(),a=Ii().BADNUM,s=Df(),f=im().clearOutline,c=om(),p=Jg(),v=fx(),T=Bd().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,x=G.exports={};n.extendFlat(x,t),x.attributes=Gl(),x.attributes.type.values=x.allTypes,x.fontAttrs=Ns(),x.layoutAttributes=T1();var A=GT();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),lt=Object.keys(Ae.y);if(Ne.length>1&<.length>1){for(t.getComponentMethod("grid","sizeDefaults")(te,ue),Le=0;Le15&<.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")),Er=Qt,Mr=ar;Er&&!Mr?$._bgLayer.remove():Mr&&!Er&&(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={},Nr;for(Nr in $r)Sr[Nr]="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 lt in Fe)lt!=="base"&&E(Fe[lt][pe].size)&&(Ne=Fe[lt][pe].size>Ne?Fe[lt][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,Er=Nt.val,Mr=Nt.size,$r=ne-H.r-H.l,Sr=$-H.t-H.b;for(var Nr in Fe){if(E(ar)&&Fe[Nr].r){var Mt=Fe[Nr].r.val,je=Fe[Nr].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(Mr)&&Fe[Nr].t){var xe=Fe[Nr].t.val,ye=Fe[Nr].t.size;if(xe>Er){var Ee=(Mr*xe+(ye-Sr)*Er)/(xe-Er),Xe=(ye*(1-Er)+(Mr-Sr)*(1-xe))/(xe-Er);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)}}}}),Ec=Ge({"src/components/colorscale/index.js"(K,G){var h=pp(),b=gd();G.exports={moduleType:"component",name:"colorscale",attributes:zu(),layoutAttributes:eg(),supplyLayoutDefaults:XT(),handleDefaults:yh(),crossTraceDefaults:vx(),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))}}}}),Fp=Ge({"src/traces/scatter/make_bubble_size_func.js"(K,G){var h=Si();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}}}}),$d=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 lt=Pe%100;return l.symbolFuncs[lt](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,lt,dt){var nt=I[Ne];return L(Pe,Ae,pe,nt.type,lt,dt,nt.start,nt.stop,!1,nt.reversed)};function L(Pe,Ae,pe,Ne,lt,dt,nt,Ft,Nt,Qt){var ar=lt.length,Er;Ne==="linear"?Er={node:"linearGradient",attrs:{x1:nt.x,y1:nt.y,x2:Ft.x,y2:Ft.y,gradientUnits:Nt?"userSpaceOnUse":"objectBoundingBox"},reversed:Qt}:Ne==="radial"&&(Er={node:"radialGradient",reversed:Qt});for(var Mr=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),Er=ae(Pe,pe);Ae.attr("d",d(Qt,Nt,ar,Er))}var Mr=!1,$r,Sr,Nr;if(Pe.so)Nr=Ft.outlierwidth,Sr=Ft.outliercolor,$r=nt.outliercolor;else{var Mt=(Ft||{}).width;Nr=(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,Mr=!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":(Nr||1)+"px",fill:"none"});else{Ae.style("stroke-width",(Pe.isBlank?0:Nr)+"px");var je=nt.gradient,Je=Pe.mgt;Je?Mr=!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?Mr=!0:Ee=je.color;var Xe=pe.uid;Mr&&(Xe+="-"+Pe.i),l.gradient(Ae,lt,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",lt,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);Nr&&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||{},lt=Pe.marker||{},dt=pe.marker||{},nt=Ne.marker||{},Ft=lt.opacity,Nt=dt.opacity,Qt=nt.opacity,ar=Nt!==void 0,Er=Qt!==void 0;(b.isArrayOrTypedArray(Ft)||ar||Er)&&(Ae.selectedOpacityFn=function(xe){var ye=xe.mo===void 0?lt.opacity:xe.mo;return xe.selected?ar?Nt:ye:Er?Qt:c*ye});var Mr=lt.color,$r=dt.color,Sr=nt.color;($r||Sr)&&(Ae.selectedColorFn=function(xe){var ye=xe.mcc||Mr;return xe.selected?$r||ye:Sr||ye});var Nr=lt.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||Nr/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||{},lt=Pe.textfont||{},dt=pe.textfont||{},nt=Ne.textfont||{},Ft=lt.color,Nt=dt.color,Qt=nt.color;return Ae.selectedTextColorFn=function(ar){var Er=ar.tc||Ft;return ar.selected?Nt||Er:Qt||(Nt?Er:r.addOpacity(Er,c))},Ae},l.selectedPointStyle=function(Pe,Ae){if(!(!Pe.size()||!Ae.selectedpoints)){var pe=l.makeSelectedPointStyleFns(Ae),Ne=Ae.marker||{},lt=[];pe.selectedOpacityFn&<.push(function(dt,nt){dt.style("opacity",pe.selectedOpacityFn(nt))}),pe.selectedColorFn&<.push(function(dt,nt){r.fill(dt,pe.selectedColorFn(nt))}),pe.selectedSizeFn&<.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}),lt.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 lt=l.makeSelectedTextStyleFns(Ae);Ne=lt.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,Er=ar?ar(Ft,Ae,nt):{},Mr={};T(Mr,Ae,Ft.i),Qt=b.texttemplateString({data:[Mr,Ft,Ae._meta],fallback:Ae.texttemplatefallback,labels:Er,locale:nt._d3locale,template:Qt})}var $r=Ft.tp||Ae.textposition,Sr=N(Ft,Ae),Nr=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:Nr}).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 lt=h.select(this),dt=pe.selectedTextColorFn(Ne),nt=Ne.tp||Ae.textposition,Ft=N(Ne,Ae);r.fill(lt,dt);var Nt=t.traceIs(Ae,"bar-like");F(lt,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=[],lt;for(lt=1;lt=Nt||xe>=ar&&xe<=Nt)&&(ye<=Er&&ye>=Qt||ye>=Er&&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 lt=Pe.childNodes[0];if(pe=$(lt),pe){var dt=+lt.getAttribute("x")||0,nt=+lt.getAttribute("y")||0,Ft=lt.getAttribute("transform");if(!Ft){var Nt=l.bBox(lt,!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 Er=Qt.getBoundingClientRect(),Mr=l.testref.node().getBoundingClientRect();Ae||ar.removeChild(Qt);var $r={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]=$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")||"",lt=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+lt[0]||0,y:+lt[1]||0}},l.setTranslate=function(Pe,Ae,pe){var Ne=/(\btranslate\(.*?\);?)/,lt=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[lt]("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")||"",lt=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+lt[0]||1,y:+lt[1]||1}},l.setScale=function(Pe,Ae,pe){var Ne=/(\bscale\(.*?\);?)/,lt=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[lt]("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 lt=(this.getAttribute("transform")||"").replace(te,"");lt+=Ne,lt=lt.trim(),this.setAttribute("transform",lt)})}};var H=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Pe,Ae,pe){Pe&&Pe.each(function(){var Ne,lt=h.select(this),dt=lt.select("text");if(dt.node()){var nt=parseFloat(dt.attr("x")||0),Ft=parseFloat(dt.attr("y")||0),Nt=(lt.attr("transform")||"").match(H);Ae===1&&pe===1?Ne=[]:Ne=[n(nt,Ft),"scale("+Ae+","+pe+")",n(-nt,-Ft)],Nt&&Ne.push(Nt),lt.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,lt,dt=Ae.marker.angleref;if(dt==="previous"||dt==="north"){if(Ae._geo){var nt=Ae._geo.project(Pe.lonlat);Ne=nt[0],lt=nt[1]}else{var Ft=Ae._xA,Nt=Ae._yA;if(Ft&&Nt)Ne=Ft.c2p(Pe.x),lt=Nt.c2p(Pe.y);else return 90}if(Ae._geo){var Qt=Pe.lonlat[0],ar=Pe.lonlat[1],Er=Ae._geo.project([Qt,ar+1e-5]),Mr=Ae._geo.project([Qt+1e-5,ar]),$r=ie(Mr[1]-lt,Mr[0]-Ne),Sr=ie(Er[1]-lt,Er[0]-Ne),Nr;if(dt==="north")Nr=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);Nr=-ie(ye,Ee)-Math.PI,Fe=Qt,ze=ar}var Xe=Le($r,[de(Nr),0]),Qe=Le(Sr,[Se(Nr),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(lt)){var Lt=Ne-Ye,Ct=lt-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=lt,ct=Pe.i,at=Ae.uid,pe}l.getMarkerAngle=et}}),lm=Ge({"src/components/titles/index.js"(K,G){var h=ki(),b=Si(),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(Mr,$r){return Mr===void 0||$r===void 0?!1:Mr.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,lt=T+"-subtitle",dt=$||at;if(V&&(Ne=d.selectAll("text."+lt).data(dt?[0]:[]),Ne.enter().append("text"),Ne.text($).attr("class",lt),Ne.exit().remove()),!Pe)return d;function nt(Mr,$r){e.syncOrAsync([Ft,Nt],{title:Mr,subtitle:$r})}function Ft(Mr){var $r=Mr.title,Sr=Mr.subtitle,Nr;!u&&Ae&&(u={}),u?(Nr="",u.rotate&&(Nr+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||Ae)&&(Nr+=t(0,(u.offset||0)-(Ae||0)))):Nr=null,$r.attr("transform",Nr);function Mt(Ee){if(Ee){var Xe=h.select(Ee.node().parentNode).select("."+lt);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",Nr),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(Mr){var $r=Mr.title,Sr=h.select($r.node().parentNode);if(w&&w.selection&&w.side&&L){Sr.attr("transform",null);var Nr=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[Nr])+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(Mr,$r){Mr.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(Mr){_!==void 0?E.call("_guiRestyle",v,A,Mr,_):E.call("_guiRelayout",v,A,Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).on("input",function(Mr){this.text(Mr||" ").call(n.positionText,m.x,m.y)}),V)){if(V&&!L){var ar=pe.node().getBBox(),Er=ar.y+ar.height+c*ie;Ne.attr("y",Er)}$?Ne.on(".opacity",null):(Qt(Ne,ee),ue=!0),Ne.call(n.makeEditable,{gd:v}).on("edit",function(Mr){E.call("_guiRelayout",v,"title.subtitle.text",Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).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),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=Di().utcFormat,S=_n(),E=S.numberFormat,e=Si(),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),lt=!1)}lt&&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])}}}),Bp=Ge({"src/plots/cartesian/autorange.js"(K,G){var h=ki(),b=Si(),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=Si(),S=ef(),E=Ro(),e=_n(),t=e.strTranslate,r=nc(),o=lm(),n=go(),i=As(),a=id(),s=hx(),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 $=um(),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=Bp();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),ln=Cr._fullLayout._subplots[qr+"axis"],Jr=jr+"ref",At={};return Vr||(Vr=ln[0]||(typeof Dr=="string"?Dr:Dr[0])),Dr||(Dr=Vr),ln=ln.concat(ln.map(function(lr){return lr+" domain"})),At[Jr]={valType:"enumerated",values:ln.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,ln,Jr=ne.getRefType(jr);if(Jr!=="range")qr=e.ensureNumber,ln=Cr(Vr,Dr);else{var At=ne.getFromId(xt,jr);Dr=At.fraction2r(Dr),ln=Cr(Vr,Dr),qr=At.cleanPos}Dt[Vr]=qr(ln)},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,ln){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 un=Cr.dtick/2;Dt+=Dt+unqr){var ln=Number(Cr.slice(1));Dr.exactYears>qr&&ln%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 ln=b(xt.dtick),Jr=b(Dt.dtick),At=ln?xt.dtick:+xt.dtick.substring(1),lr=Jr?Dt.dtick:+Dt.dtick.substring(1);ln&&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 ln=Dt[Dr].value,Jr=Dt[qr].value,At=Math.abs(Jr-ln),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 un;zr>=At&&(zr=At,un=!0);var Rn=Vr+zr;if(xt.rangebreaks&&zr>0){for(var qn=84,jn=0,cn=0;cn_&&(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",ln=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 Hi=!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(Hi?ne.prepMinorTicks(so,xt,Cr):ne.prepTicks(so,Cr),so.tickmode==="array"){Ci?(cn=[],qn=Ne(xt,!Hi)):(In=[],jn=Ne(xt,!Hi));continue}if(so.tickmode==="sync"){cn=[],qn=pe(xt);continue}var io=de(At),Mo=io[0],fi=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=fi:Jo<=fi;Jo=ne.tickIncrement(Jo,Vs,lr,Vr)){if(Ci&&Uo++,so.rangebreaks&&!lr){if(Jo=un)break}if(cn.length>Rn||Jo===cs)break;cs=Jo;var sl={value:Jo};Ci?(Ho&&Jo!==(Jo|0)&&(sl.simpleLabel=!0),Dr>1&&Uo%Dr&&(sl.skipLabel=!0),cn.push(sl)):(sl.minor=!0,In.push(sl))}}if(!In||In.length<2)Jr=!1;else{var fs=(In[1].value-In[0].value)*(ln?-1:1);Mi(fs,xt.tickformat)||(Jr=!1)}if(!Jr)gi=cn;else{var Zo=cn.concat(In);qr&&cn.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 vo=Zo.map(function(Io,cu){return Io.minor===void 0&&!Io.skipLabel?cu:null}).filter(function(Io){return Io!==null});vo.forEach(function(Io){Jr.map(function(cu){var vu=Io+cu;vu>=0&&vu-1;Ps--){if(cn[Ps].drop){cn.splice(Ps,1);continue}cn[Ps].value=da(cn[Ps].value,xt);var ul=xt.c2p(cn[Ps].value);(Fo?Zs>ul-Rl:Zsun||Osun&&(vu.periodX=un),OsVr&&unp)xt/=p,jr=Vr(10),Dt.dtick="M"+12*Er(xt,jr,lt);else if(Dr>A)xt/=A,Dt.dtick="M"+Er(xt,1,dt);else if(Dr>w){if(Dt.dtick=Er(xt,w,Dt._hasDayOfWeekBreaks?[1,2,7,14]:Ft),!Cr){var qr=ne.getTickFormat(Dt),ln=Dt.ticklabelmode==="period";ln&&(Dt._rawTick0=Dt.tick0),/%[uVW]/.test(qr)?Dt.tick0=e.dateTick0(Dt.calendar,2):Dt.tick0=e.dateTick0(Dt.calendar,1),ln&&(Dt._dowTick0=Dt.tick0)}}else Dr>u?Dt.dtick=Er(xt,u,dt):Dr>d?Dt.dtick=Er(xt,d,nt):Dr>y?Dt.dtick=Er(xt,y,nt):(jr=Vr(10),Dt.dtick=Er(xt,jr,lt))}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"+Er(xt,jr,lt)}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))):ma(Dt)?(Dt.tick0=0,jr=1,Dt.dtick=Er(xt,jr,ar)):(Dt.tick0=0,jr=Vr(10),Dt.dtick=Er(xt,jr,lt));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 Mr(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 ln=Math.max(Math.abs(qr[0]),Math.abs(qr[1])),Jr=Math.floor(Math.log(ln)/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 ln=xt==="D2"?Qt:Nt,Jr=Dt+Vr*.01,At=e.roundUp(e.mod(Jr,1),ln,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?cn:null};if(Dr&&e.isArrayOrTypedArray(Dt.ticktext)){var zr=e.simpleMap(Dt.range,Dt.r2l),un=(Math.abs(zr[1]-zr[0])-(Dt._lBreaks||0))/1e4;for(At=0;At"+ln;else{var At=_a(Dt),lr=Dt._trueSide||Dt.side;(!At&&lr==="top"||At&&lr==="bottom")&&(qr+="
")}xt.text=qr}function Nr(Dt,xt,Cr,jr,Vr){var Dr=Dt.dtick,qr=xt.x,ln=Dt.tickformat,Jr=typeof Dr=="string"&&Dr.charAt(0);if(Vr==="never"&&(Vr=""),jr&&Jr!=="L"&&(Dr="L3",Jr="L"),ln||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],un=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],un>0&&(xt.text+="x10"),xt.text==="1x10"&&(xt.text="10"),zr!==0&&zr!==1&&(xt.text+=""+(zr>0?"":z)+un+""),xt.fontSize*=1.25):(Rn==="e"||Rn==="E")&&un>2?xt.text=lr[0]+Rn+(zr>0?"+":z)+un:(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 ln=xt.x<0;qr[1]===1?qr[0]===1?xt.text="π":xt.text=qr[0]+"π":xt.text=["",qr[0],"","⁄","",qr[1],"","π"].join(""),ln&&(xt.text=z+xt.text)}}}else xt.text=Ot(xt.x,Dt,Vr,jr)}function xe(Dt){function xt(ln,Jr){return Math.abs(ln-Jr)<=1e-6}function Cr(ln,Jr){return xt(Jr,0)?ln:Cr(Jr,ln%Jr)}function jr(ln){for(var Jr=1;!xt(Math.round(ln*Jr)/Jr,ln);)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",ln=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]};Mr(lr),Dr=(Number(lr._tickround)||0)+4,ln=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"&&(ln=0),Dt=Math.abs(Dt),Dt"+qn+"":qr==="B"&&ln===9?Dt+="B":Xe(qr)&&(Dt+=qr==="SI extended"?Ee[ln/3+10]:ye[ln/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)),un=lr.indexOf(At.charAt(0));return zr===un?Number(Jr.replace(/(L|D)/g,""))-Number(At.replace(/(L|D)/g,"")):zr-un}else return typeof Jr=="number"?1:-1}function Vr(Jr,At,lr){var zr=lr||function(qn){return qn},un=At[0],Rn=At[1];return(!un&&typeof un!="number"||zr(un)<=zr(Jr))&&(!Rn&&typeof Rn!="number"||zr(Rn)>=zr(Jr))}function Dr(Jr,At){var lr=At[0]===null,zr=At[1]===null,un=jr(Jr,At[0])>=0,Rn=jr(Jr,At[1])<=0;return(lr||un)&&(zr||Rn)}var qr,ln;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 ln={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=ln,Cr.overlayingShiftedAx=qr;var lr=ne.drawOne(Dt,At,Cr);return At._shiftPusher&&Hn(At,At._fullDepth||0,ln,!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,ln;xt.setScale();var Jr=Dt._fullLayout,At=xt._id,lr=At.charAt(0),zr=ne.counterLetter(At),un=Jr._plots[xt._mainSubplot],Rn=xt.zerolinelayer==="above traces";if(!un)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=un[lr+"axislayer"],cn=xt._mainLinePosition,In=cn+=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 Yu=0,df=0;if(xt._shiftPusher&&(Yu=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+=aa(xt))),xt._fullDepth=Math.max(Yu,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 Ic=xt._offset-Os.top;Ic>0&&(wl.yt=1,wl.t=Ic)}wl[zr]=xt.anchor==="free"?xt.position:xt._anchorAxis.domain[Xc[0]],xt.title.text!==Jr._dfltTitle[lr]&&(wl[Yl]+=aa(xt)+(xt.title.standoff||0)),xt.mirror&&xt.anchor!=="free"&&(Fl={x:0,y:0,r:0,l:0,t:0,b:0},Fl[Io]=xt.linewidth,xt.mirror&&xt.mirror!==!0&&(Fl[Io]+=vu),xt.mirror===!0||xt.mirror==="ticks"?Fl[zr]=xt._anchorAxis.domain[Xc[1]]:(xt.mirror==="all"||xt.mirror==="allticks")&&(Fl[zr]=[xt._counterDomainMin,xt._counterDomainMax][Xc[1]]))}Xl&&(ql=E.getComponentMethod("rangeslider","autoMarginOpts")(Dt,xt)),typeof xt.automargin=="string"&&(Kt(wl,xt.automargin),Kt(Fl,xt.automargin)),S.autoMargin(Dt,or(xt),wl),S.autoMargin(Dt,ur(xt),Fl),S.autoMargin(Dt,Gr(xt),ql)}),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 ln=Dr.xbnd[qr];ln!==null&&Cr.push(e.extendFlat({},Dr,{x:ln}))};if(xt.length){for(jr=0;jrDt.range[1],ln=Dt.ticklabelposition&&Dt.ticklabelposition.indexOf("inside")!==-1,Jr=!ln;if(Cr){var At=qr?-1:1;Cr=Cr*At}if(jr){var lr=Dt.side,zr=ln&&(lr==="top"||lr==="left")||Jr&&(lr==="bottom"||lr==="right")?1:-1;jr=jr*zr}return Dt._id.charAt(0)==="x"?function(un){return t(Vr+Dt._offset+Dt.l2p(kn(un))+Cr,Dr+jr)}:function(un){return t(Dr+jr,Vr+Dt._offset+Dt.l2p(kn(un))+Cr)}};function kn(Dt){return Dt.periodX!==void 0?Dt.periodX:Dt.x}function Wn(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"),ln=jr("bottom"),Jr=jr("inside"),At=Cr!=="boundaries"&&(ln||Dr||Vr||qr);if(!At&&!Jr)return[0,0];var lr=Dt.side,zr=At?(Dt.tickwidth||0)/2:0,un=ee,Rn=Dt.tickfont?Dt.tickfont.size:12;return(ln||Vr)&&(zr+=Rn*le,un+=(Dt.linewidth||0)/2),(Dr||qr)&&(zr+=(Dt.linewidth||0)/2,un+=ee),Jr&&lr==="top"&&(un-=Rn*(1-le)),(Dr||Vr)&&(zr=-zr),(lr==="bottom"||lr==="right")&&(un=-un),[At?zr:0,Jr?un: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),ln=(Dt.linewidth||1)/2;return qr==="x"?"M0,"+(xt+ln*Cr)+"v"+Dr*Cr:"M"+(xt+ln*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"),ln=Dr("left"),Jr=Dr("right"),At=Dr("bottom"),lr=Vr!=="boundaries"&&(At||ln||qr||Jr),zr=Dr("inside"),un=jr==="inside"&&Dt.ticks==="inside"||!zr&&Dt.ticks==="outside"&&Vr!=="boundaries",Rn=0,qn=0,jn=un?Dt.ticklen:0;if(zr?jn*=-1:lr&&(jn=0),un&&(Rn+=jn,Cr)){var cn=e.deg2rad(Cr);Rn=jn*Math.cos(cn)+1,qn=jn*Math.sin(cn)}Dt.showticklabels&&(un||Dt.showline)&&(Rn+=.2*Dt.tickfont.size),Rn+=(Dt.linewidth||1)/2*(zr?-1:1);var In={labelStandoff:Rn,labelShift:qn},gi,Ea,Ci,Hi,so=0,io=Dt.side,Mo=Dt._id.charAt(0),fi=Dt.tickangle,ts;if(Mo==="x")ts=!zr&&io==="bottom"||zr&&io==="top",Hi=ts?1:-1,zr&&(Hi*=-1),gi=qn*Hi,Ea=xt+Rn*Hi,Ci=ts?1:-.2,Math.abs(fi)===90&&(zr?Ci+=fe:fi===-90&&io==="bottom"?Ci=le:fi===90&&io==="top"?Ci=fe:Ci=.5,so=fe/2*(fi/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(ln)return"end";if(Jr)return"start"}return!b(Jo)||Jo===0||Jo===180?"middle":Jo*Hi<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",Hi=ts?1:-1,zr&&(Hi*=-1),gi=Rn,Ea=qn*Hi,Ci=0,!zr&&Math.abs(fi)===90&&(fi===-90&&io==="left"||fi===90&&io==="right"?Ci=le:Ci=.5),zr){var Ho=b(fi)?+fi:0;if(Ho!==0){var Xs=e.deg2rad(Ho);so=Math.abs(Math.sin(Xs))*le*Hi,Ci=0}}In.xFn=function(cs){return cs.dx+xt-(gi+cs.fontSize*Ci)*Hi+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}):[],ln=Cr.counterAxis;if(ln&&ne.shouldShowZeroLine(Dt,xt,ln))for(var Jr=xt.tickmode==="array",At=0;At=0;qn--){var jn=qn?un:Rn;if(jn){var cn=jn.selectAll("path."+jr).data(qn?qr:Dr,Vn);cn.exit().remove(),cn.enter().append("path").classed(jr,1).classed("crisp",Cr.crisp!==!1),cn.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"&&cn.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,ln){return te(qr.id,ln.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",ln=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?ln:[],Vn),un=[];zr.enter().append("g").classed(qr,1).append("text").attr("text-anchor","middle").each(function(fs){var Zo=h.select(this),vo=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[vo]?un.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(vo){var hs=h.select(this),ll=hs.select(".text-math-group"),kl=Jr.anchorFn(vo,Zo),Pl=Cr.transFn.call(hs.node(),vo)+(b(Zo)&&+Zo!=0?" rotate("+Zo+","+Jr.xFn(vo)+","+(Jr.yFn(vo)-vo.fontSize/2)+")":""),Ms=r.lineCount(hs),di=ce*vo.fontSize,to=Jr.heightFn(vo,b(Zo)?+Zo:0,(Ms-1)*di);if(to&&(Pl+=t(0,to)),ll.empty()){var Cl=hs.select("text");Cl.attr({transform:Pl,"text-anchor":kl}),Cl.style("display",null),xt._adjustTickLabelsOverflow&&xt._adjustTickLabelsOverflow()}else{var Ps=i.bBox(ll.node()).width,Fo=Ps*{end:-.5,start:.5}[kl];ll.attr("transform",Pl+t(Fo,0))}})}xt._adjustTickLabelsOverflow=function(){var fs=xt.ticklabeloverflow;if(!(!fs||fs==="allow")){var Zo=fs.indexOf("hide")!==-1,vo=xt._id.charAt(0)==="x",hs=0,ll=vo?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,ll=xt.l2p(kl[1])+xt._offset}var Pl=Math.min(hs,ll),Ms=Math.max(hs,ll),di=xt.side,to=1/0,Cl=-1/0;zr.each(function(Zs){var ul=h.select(this),Au=ul.select(".text-math-group");if(Au.empty()){var Ji=i.bBox(ul.node()),gs=0;vo?(Ji.right>Ms||Ji.leftMs||Ji.top+(xt.tickangle?0:Zs.fontSize/4)xt["_visibleLabelMin_"+kl._id]?ul.style("display","none"):Ms.K==="tick"&&!Pl&&ul.node().style.display!=="none"&&ul.style("display",null)})})})})},Rn(zr,lr+1?lr:At);function qn(){return un.length&&Promise.all(un)}var jn=null;function cn(){if(Rn(zr,At),ln.length&&xt.autotickangles&&(xt.type!=="log"||String(xt.dtick).charAt(0)!=="D")){jn=xt.autotickangles[0];var fs=0,Zo=[],vo,hs=1;zr.each(function(wl){fs=Math.max(fs,wl.fontSize);var Fl=xt.l2p(wl.x),ql=qt(this),Yu=i.bBox(ql.node());hs=Math.max(hs,r.lineCount(ql)),Zo.push({top:0,bottom:10,height:10,left:Fl-Yu.width/2,right:Fl+Yu.width/2+2,width:Yu.width+2})});var ll=(xt.tickson==="boundaries"||xt.showdividers)&&!Cr.secondary,kl=ln.length,Pl=Math.abs((ln[kl-1].x-ln[0].x)*xt._m)/(kl-1),Ms=ll?Pl/2:Pl,di=ll?xt.ticklen:fs*1.25*hs,to=Math.sqrt(Math.pow(Ms,2)+Math.pow(di,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,Fl){return Math.abs(Math.cos(wl))Ys*Uo&&(Xs=Uo,fi[Mo]=ts[Mo]=cs[Mo])}var Vs=Math.abs(Xs-Ho);Vs-Hi>0?(Vs-=Hi,Hi*=1+Hi/Vs):Hi=0,xt._id.charAt(0)!=="y"&&(Hi=-Hi),fi[io]=Ea.p2r(Ea.r2p(ts[io])+so*Hi),Ea.autorange==="min"||Ea.autorange==="max reversed"?(fi[0]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0):(Ea.autorange==="max"||Ea.autorange==="min reversed")&&(fi[1]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0),jr._insideTickLabelsUpdaterange[Ea._name+".range"]=fi}var sl=e.syncOrAsync(In);return sl&&sl.then&&Dt._promises.push(sl),sl};function na(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 aa(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,ln=(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+ln*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,un,Rn;Vr==="x"?(un=xt._offset+xt._length/2,Rn=xt.side==="top"?lr-qr:lr+qr):(Rn=xt._offset+xt._length/2,un=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 cn=i.getTranslate(jn.node().parentNode);qn.offsetLeft=cn.x,qn.offsetTop=cn.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:un,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}}}),YT=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")}}}),ZT=Ge({"src/plots/cartesian/range_defaults.js"(K,G){var h=YT();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=cx();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()}}),LM=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}}}),PM=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]}}}),RM=Ge({"src/components/dragelement/unhover.js"(K,G){var h=S1(),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}))}}}),lv=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=LM(),t.getCursor=PM();var r=RM();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)}}}),Np=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)}}}),IM=Ge({"src/lib/override_cursor.js"(K,G){var h=Np(),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 lt="legendfill-"+de.uid;e.gradient(Ne,M,lt,T(Ye),ze,"fill")}},ct=function(Ne){if(Ne.size()){var lt="legendline-"+de.uid;e.lineGroupStyle(Ne),e.gradient(Ne,M,lt,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 lt=S.nestedProperty(ae,Pe).get(),dt=S.isArrayOrTypedArray(lt)&&Ae?Ae(lt):lt;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,lt=g(at.size,8,10),dt=g(at.solidity,.5,1),nt="legend-"+$.uid;Se.call(e.pattern,"legend",M,nt,Pe,lt,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}}}),e5=Ge({"src/components/legend/draw.js"(K,G){var h=ki(),b=_n(),S=ef(),E=Ro(),e=S1(),t=lv(),r=As(),o=go(),n=nc(),i=Kw(),a=KT(),s=ad(),f=s.LINE_SPACING,c=s.FROM_TL,p=s.FROM_BR,v=DM(),T=QT(),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 lt=F(U,fe,pe,Ne);if(lt)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,Er=Qt/ar,Mr=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+Mr}),r.setClipUrl(Le,le,U),xe(Mr,Nt,Er),ie.on("wheel",function(){Mr=b.constrain(Z._scrollY+h.event.deltaY/ar*Qt,0,ar),xe(Mr,Nt,Er),Mr!==0&&Mr!==ar&&h.event.preventDefault()});var $r,Sr,Nr,Mt=function(Lt,Ct,Ot){var Kt=(Ot-Ct)/Er+Lt;return b.constrain(Kt,0,ar)},je=function(Lt,Ct,Ot){var Kt=(Ct-Ot)/Er+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,Nr=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(Nr,$r,Sr),xe(Mr,Nt,Er))});Ye.call(Je);var ke=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"&&($r=Lt.changedTouches[0].clientY,Nr=Mr)}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.type==="touchmove"&&(Sr=Lt.changedTouches[0].clientY,Mr=je(Nr,$r,Sr),xe(Mr,Nt,Er))});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",lt=Se||de,dt=fe.width/2;re._maxWidth=Math.max(pe?lt&&Ae==="left"?ce.l+ce.w:dt:Ne?lt&&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,Er=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,Er+=Qt+Le,Qt=ye):Qt=Math.max(Qt,ye),r.setTranslate(this,ar,Er),ar+=Ee}),re._width=Math.max(Nt,ar)+$,re._height=Er+Qt+ae}else{var Mr=Z.size(),$r=Ft+ue+(Mr-1)*te=re._maxWidth&&(Nt=Math.max(Nt,je),Nr=0,Mt+=Sr,re._height+=Sr,Sr=0),r.setTranslate(this,Pe[0]+$+Nr,Pe[1]+$+Mt+ye/2+te),je=Nr+Ee+te,Nr+=Xe,Sr=Math.max(Sr,ye)}),$r?(re._width=Nr+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"}}}),t5=Ge({"src/components/fx/hover.js"(K){var G=ki(),h=Si(),b=Is(),S=_n(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=S1(),o=nc(),n=IM(),i=As(),a=go(),s=lv(),f=Ts(),c=sh().zindexSeparator,p=Ro(),v=$d(),T=ff(),l=$T(),g=e5(),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 lt=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(lt,dt),ar=Math.max(lt,dt),Er=Math.min(nt,Ft),Mr=Math.max(nt,Ft),$r=Ne.trace;if(p.traceIs($r,"gl3d")){var Sr=Se._fullLayout[$r.scene]._scene.container,Nr=Sr.offsetLeft,Mt=Sr.offsetTop;Qt+=Nr,ar+=Nr,Er+=Mt,Mr+=Mt}Nt.bbox={x0:Qt+Fe,x1:ar+Fe,y0:Er+Le,y1:Mr+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,lt){return Ne.y0-lt.y0}).each(function(Ne,lt){var dt=Ne.y0-Ne.by/2;dt-atar[0]._length||aa<0||aa>Er[0]._length)return s.unhoverRaw(H,ae)}if(ae.pointerX=na+ar[0]._offset,ae.pointerY=aa+Er[0]._offset,"xval"in ae?ke=v.flat(Le,ae.xval):ke=v.p2c(ar,na),"yval"in ae?xe=v.flat(Le,ae.yval):xe=v.p2c(Er,aa),!h(ke[0])||!h(xe[0]))return S.warn("Fx.hover failed",ae,H),s.unhoverRaw(H,ae)}var Va=1/0;function sr(fi,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(vo){return vo.spikeDistance<=Mt})),Uo&&Uo.length){var Ys,Vs=Uo.filter(function(vo){return vo.xa.showspikes&&vo.xa.spikesnap!=="hovered data"});if(Vs.length){var sl=Vs[0];h(sl.x0)&&h(sl.y0)&&(Ys=or(sl),(!Br.vLinePoint||Br.vLinePoint.spikeDistance>Ys.spikeDistance)&&(Br.vLinePoint=Ys))}var fs=Uo.filter(function(vo){return vo.ya.showspikes&&vo.ya.spikesnap!=="hovered data"});if(fs.length){var Zo=fs[0];h(Zo.x0)&&h(Zo.y0)&&(Ys=or(Zo),(!Br.hLinePoint||Br.hLinePoint.spikeDistance>Ys.spikeDistance)&&(Br.hLinePoint=Ys))}}}}}sr();function qt(fi,ts,Ho){for(var Xs=null,cs=1/0,Jo,Uo=0;Uofi.trace.index===Hn.trace.index):je=[Hn];var pi=je.length,Mi=ne("x",Hn,ze),Dt=ne("y",Hn,ze);sr(Mi,Dt);var xt=[],Cr={},jr=0,Vr=function(fi){var ts=d[fi.trace.type]?z(fi):fi.trace.index;if(!Cr[ts])jr++,Cr[ts]=jr,xt.push(fi);else{var Ho=Cr[ts]-1,Xs=xt[Ho];Ho>0&&Math.abs(fi.distance)pi-1;Dr--)Vr(je[Dr]);je=xt,sn()}var qr=H._hoverdata,ln=[],Jr=$(H),At=ue(H);for(const fi of je){var lr=v.makeEventData(fi,fi.trace,fi.cd);if(fi.hovertemplate!==!1){var zr=!1;fi.cd[fi.index]&&fi.cd[fi.index].ht&&(zr=fi.cd[fi.index].ht),fi.hovertemplate=zr||fi.trace.hovertemplate||!1}if(fi.xa&&fi.ya){var un=fi.x0+fi.xa._offset,Rn=fi.x1+fi.xa._offset,qn=fi.y0+fi.ya._offset,jn=fi.y1+fi.ya._offset,cn=Math.min(un,Rn),In=Math.max(un,Rn),gi=Math.min(qn,jn),Ea=Math.max(qn,jn);lr.bbox={x0:cn+At,x1:In+At,y0:gi+Jr,y1:Ea+Jr}}fi.eventData=[lr],ln.push(lr)}H._hoverdata=ln;var Ci=et==="y"&&(Je.length>1||je.length>1)||et==="closest"&&kn&&je.length>1,Hi=a.combine(ze.plot_bgcolor||a.background,ze.paper_bgcolor),so=N(je,{gd:H,hovermode:et,rotateLabels:Ci,bgColor:Hi,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,ln);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:Er,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,lt=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 Er=0;Erde.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=ln-(u*2+Dr.height),Ee.maxY=ln-u):(Ee.minY=ln+u,Ee.maxY=ln+(u*2+Dr.height))}else{var zr,un,Rn;Ft.side==="right"?(zr="start",un=1,Rn="",qr=nt._offset+nt._length):(zr="end",un=-1,Rn="-",qr=nt._offset),ln=Ft._offset+(dt.y0+dt.y1)/2,Mi.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=ln-(u+Dr.height/2),Ee.maxY=ln+(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,cn="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?da=mn:Tn+ka=0?da=Tn:Jn+ka=0?_a=Gr:sn+Va=0?_a=sn:ma+Va=0,(Hn.idealAlign==="top"||!Ci)&&Hi?(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=un+qn/2+Ea<=Sr,Hi=un-qn/2-Ea>=0,(Hn.idealAlign==="left"||!Ci)&&Hi)un-=qn/2,Hn.anchor="end";else if(Ci)un+=qn/2,Hn.anchor="start";else{Hn.anchor="middle";var so=Ea/2,io=un+so-Sr,Mo=un-so;io>0&&(un-=io),Mo<0&&(un+=-Mo)}Hn.crossPos=un}ln.attr("text-anchor",Hn.anchor),At&&Jr.attr("text-anchor",Hn.anchor),pi.attr("transform",e(un,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),Br=vr+pe(Kt*ke.bx);xr=ke.crossPos+Math.min(vr,Br),mr=ke.crossPos+Math.max(vr,Br)}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 lt,dt,nt,Ft,Nt,Qt,ar;function Er(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;lt=!1}if(!(nt<.01)){if(dt<-.01){for(Nt=ke.length-1;Nt>=0;Nt--)ke[Nt].dp-=nt;lt=!1}if(lt){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(;!lt&&Fe<=Ye;){for(Fe++,lt=!0,Ft=0;Ft.01){for(Nt=$r.length-1;Nt>=0;Nt--)$r[Nt].dp+=dt;for(Mr.push.apply(Mr,$r),st.splice(Ft+1,1),ar=0,Nt=Mr.length-1;Nt>=0;Nt--)ar+=Mr[Nt].dp;for(nt=ar/Mr.length,Nt=Mr.length-1;Nt>=0;Nt--)Mr[Nt].dp-=nt;lt=!1}else Ft++}st.forEach(Er)}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,lt;pe?lt="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?lt="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":lt="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",lt);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,lt=ct.spikemode,dt=ct.spikethickness,nt=ct.spikecolor||Ne,Ft=f.getPxPosition(H,ct),Nt,Qt;if(lt.indexOf("toaxis")!==-1||lt.indexOf("across")!==-1){if(lt.indexOf("toaxis")!==-1&&(Nt=Ft,Qt=Pe),lt.indexOf("across")!==-1){var ar=ct._counterDomainMin,Er=ct._counterDomainMax;ct.anchor==="free"&&(ar=Math.min(ar,ct.position),Er=Math.max(Er,ct.position)),Nt=Le.l+ar*Le.w,Qt=Le.l+Er*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)}lt.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 Mr=ae.vLinePoint,$r,Sr;st=Mr&&Mr.xa,ct=Mr&&Mr.ya;var Nr=st.spikesnap;Nr==="cursor"?($r=Fe.pointerX,Sr=Fe.pointerY):($r=st._offset+Mr.x,Sr=ct._offset+Mr.y);var Mt=b.readability(Mr.color,at)<1.5?a.contrast(at):Mr.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)}}}}),px=Ge({"src/components/fx/hoverlabel_defaults.js"(K,G){var h=_n(),b=go(),S=$d().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)}}}),zM=Ge({"src/components/fx/layout_global_defaults.js"(K,G){var h=_n(),b=px(),S=tc();G.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}b(e,t,r)}}}),OM=Ge({"src/components/fx/defaults.js"(K,G){var h=_n(),b=Od(),S=px();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)}}}),r5=Ge({"src/components/fx/hovermode_defaults.js"(K,G){var h=_n(),b=tc();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")}}}),FM=Ge({"src/components/fx/layout_defaults.js"(K,G){var h=_n(),b=tc(),S=r5(),E=px();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("")}}}}),gx=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)}}}),yx=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=sm(),h=gx(),b=h.CIRCLE_SIDES,S=h.SQRT2,E=yx(),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=cm(),r=t.getPathString,o=sv(),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 Mr(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"),Er(xe),je(z,I),ke(y,I,d),Ft.moveFn=Nt==="move"?Nr: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 Nr(xe,ye){if(I.type==="path"){var Ee=function(Lt){return Lt},Xe=Ee,Qe=Ee;R?re("xanchor",I.xanchor=lt(ee+xe)):(Xe=function(Ct){return lt(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=lt(ee+xe)):(re("x0",I.x0=lt(fe+xe)),re("x1",I.x1=lt(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=lt(ee+xe)):(Xe=function(ka){return lt(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:lt(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:lt(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"),Br=xr("w"),kn=xr("e"),Wn=mr?$+ye:$,Vn=vr?ue+ye:ue,na=Br?te+xe:te,aa=kn?H+xe:H;U&&(mr&&(Wn=$-ye),vr&&(Vn=ue-ye)),(!U&&Vn-Wn>B||U&&Wn-Vn>B)&&(re(ae,I[ae]=U?Wn:dt(Wn)),re(ie,I[ie]=U?Vn:dt(Vn))),aa-na>N&&(re(de,I[de]=R?na:lt(na)),re(Se,I[Se]=R?aa:lt(aa)))}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))}}}}),BM=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}}),NM=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}}),UM=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=UM();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=lx().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}}}}),jM=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=u5(),b=c5(),S=Ro(),E=As().dashStyle,e=go(),t=Yf(),r=$d().makeEventData,o=Up(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=cm(),p=_x(),v=ng(),T=im().clearOutline,l=_p(),g=l.handleEllipse,x=l.readPaths,A=Qw().newShapes,M=n5(),_=o5().activateLastSelection,w=_n(),m=w.sorterAsc,u=ny(),d=R0(),y=Df().getFromId,I=C1(),L=xx().redrawReglTraces,z=jM(),F=z.MINSELECT,N=u.filter,B=u.tester,R=yx(),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,Br=vr._fullLayout,kn=Ot&&Br.newselection.mode==="immediate"&&Ee,Wn=Br._zoomlayer,Vn=xe.element.getBoundingClientRect(),na=xe.plotinfo,aa=Z(na),Un=Je-Vn.left,ka=ke-Vn.top;Br._calcInverseTransform(vr);var Va=w.apply3DTransform(Br._invTransform)(Un,ka);Un=Va[0],ka=Va[1];var sr=Br._invScaleX,qt=Br._invScaleY,or=Un,ur=ka,Gr="M"+Un+","+ka,sn=xe.xaxes[0],mn=xe.yaxes[0],Tn=sn._length,Jn=mn._length,ma=je.altKey&&!(a(ye)&&Lt),da,_a,Ca,Hn,pi,Mi,Dt;$(je,vr,xe),Xe&&(da=N([[Un,ka]],z.BENDPX));var xt=Wn.selectAll("path.select-outline-"+na.id).data([1]),Cr=Ct?Br.newshape:Br.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-"+na.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",aa).attr("d",Gr+"Z");var Dr=Wn.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",aa).attr("d","M0,0Z");if(Ct&&xe.hasText){var qr=Wn.select(".label-temp");qr.empty()&&(qr=Wn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ln=Br._uid+z.SELECTID,Jr=[],At=ie(vr,xe.xaxes,xe.yaxes,xe.subplot);kn&&!je.shiftKey&&(xe._clearSubplotSelections=function(){if(Ee){var zr=sn._id,un=mn._id;dt(vr,zr,un,At);for(var Rn=(vr.layout||{}).selections||[],qn=[],jn=!1,cn=0;cn=0){vr._fullLayout._deactivateShape(vr);return}if(!Ct){var Rn=Br.clickmode;d.done(ln).then(function(){if(d.clear(ln),zr===2){for(xt.remove(),pi=0;pi-1&&le(un,vr,xe.xaxes,xe.yaxes,xe.subplot,xe,xt),Rn==="event"&&Nr(vr,void 0);t.click(vr,un,na.id)}).catch(w.error)}},xe.doneFn=function(){Dr.remove(),d.done(ln).then(function(){d.clear(ln),!kn&&Hn&&xe.selectionDefs&&(Hn.subtract=ma,xe.selectionDefs.push(Hn),xe.mergedPolygons.length=0,[].push.apply(xe.mergedPolygons,Ca)),(kn||Ct)&&H(xe,kn),xe.doneFnCompleted&&xe.doneFnCompleted(Jr),Ot&&Nr(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,Br,kn,Wn,Vn,na,aa,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 un=zr[0].xref,Rn=zr[0].yref;if(un&&Rn){var qn=ar(zr),jn=Mr([y(je,un,"x"),y(je,Rn,"y")]);jn(Jr,qn)}}je._fullLayout._noEmitSelectedAtStart?je._fullLayout._noEmitSelectedAtStart=!1:lr&&Nr(je,Jr),xr._reselect=!1}if(!Xe&&xr._deselect){var cn=xr._deselect;Qe=cn.xref,Lt=cn.yref,lt(Qe,Lt,Ot)||dt(je,Qe,Lt,xe),lr&&(Jr.points.length?Nr(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,ln=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 un=Dr.d2r(zr);un!==void 0&&t.call("_guiRelayout",jr,ln,un)})}}c.init(Ot);var mr,vr,Br,kn,Wn,Vn,na,aa,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],Br={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(),Wn="M0,0H"+Qt+"V"+ar+"H0V0",Vn=!1,na="xy",ka=!1,aa=fe(at,kn,Ft,Nt,Wn),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);Br.l=Math.min(mr,jr),Br.r=Math.max(mr,jr),Br.t=Math.min(vr,Vr),Br.b=Math.max(vr,Vr);function ln(){na="",Br.r=Br.l,Br.t=Br.b,Un.attr("d","M0,0Z")}if(Er.isSubplotConstrained)Dr>I||qr>I?(na="xy",Dr/Qt>qr/ar?(qr=Dr*ar/Qt,vr>Vr?Br.t=vr-qr:Br.b=vr+qr):(Dr=qr*Qt/ar,mr>jr?Br.l=mr-Dr:Br.r=mr+Dr),Un.attr("d",te(Br))):ln();else if(Mr.isSubplotConstrained)if(Dr>I||qr>I){na="xy";var Jr=Math.min(Br.l/Qt,(ar-Br.b)/ar),At=Math.max(Br.r/Qt,(ar-Br.t)/ar);Br.l=Jr*Qt,Br.r=At*Qt,Br.b=(1-Jr)*ar,Br.t=(1-At)*ar,Un.attr("d",te(Br))}else ln();else!Sr||qr0){var zr;if(Mr.isSubplotConstrained||!$r&&Sr.length===1){for(zr=0;zr1&&(ln.maxallowed!==void 0&&Mt===(ln.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,lt=0;lt1&&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}}),Tx=Ge({"src/plot_api/plot_api.js"(K){var G=ki(),h=Si(),b=Xw(),S=_n(),E=S.nestedProperty,e=S1(),t=yp(),r=Ro(),o=ry(),n=ef(),i=Ts(),a=ZT(),s=id(),f=As(),c=go(),p=h5().initInteractions,v=Lv(),T=Qf().clearOutline,l=qs().dfltConfig,g=VM(),x=d5(),A=xx(),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[sn]!="string";)sn--;var mn=or.parts[sn],Tn=or.parts[sn-1]+"."+mn,Jn=or.parts.slice(0,sn).join("."),ma=E(ke.layout,Jn).get(),da=E(Ee,Jn).get(),_a=or.get();if(ur!==void 0){na[qt]=ur,aa[qt]=mn==="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(qt,Hn),Ca.impliedEdits[Hn]);if(["width","height"].indexOf(qt)!==-1)if(ur){Un("autosize",null);var pi=qt==="height"?"width":"height";Un(pi,Ee[pi])}else Ee[qt]=ke._initialAutoSize[qt];else if(qt==="autosize")Un("width",ur?null:Ee.width),Un("height",ur?null:Ee.height);else if(Tn.match(ze))sr(Tn),E(Ee,Jn+"._inputRange").set(null);else if(Tn.match(Ye)){sr(Tn),E(Ee,Jn+"._inputRange").set(null);var Mi=E(Ee,Jn).get();Mi._inputDomain&&(Mi._input.domain=Mi._inputDomain.slice())}else Tn.match(st)&&E(Ee,Jn+"._inputDomain").set(null);if(mn==="type"){Va=ma;var Dt=da.type==="linear"&&ur==="log",xt=da.type==="log"&&ur==="linear";if(Dt||xt){if(!Va||!Va.range)Un(Jn+".autorange",!0);else if(da.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(Jn+".autorange",!0),Cr<=0?Cr=jr/1e6:jr<=0&&(jr=Cr/1e6),Un(Jn+".range[0]",Math.log(Cr)/Math.LN10),Un(Jn+".range[1]",Math.log(jr)/Math.LN10)):(Un(Jn+".range[0]",Math.pow(10,Cr)),Un(Jn+".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,da,ur,Un),r.getComponentMethod("images","convertCoords")(ke,da,ur,Un)}else Un(Jn+".autorange",!0),Un(Jn+".range",null);E(Ee,Jn+"._inputRange").set(null)}else if(mn.match(_)){var Vr=E(Ee,qt).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(qt);if(qr){xr=qr.array,mr=qr.index;var ln=qr.property,Jr=Ca||{editType:"calc"};mr!==""&&ln===""&&(g.isAddVal(ur)?aa[qt]=null:g.isRemoveVal(ur)?aa[qt]=(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[ln]=ur,delete xe[qt]}else mn==="reverse"?(ma.range?ma.range.reverse():(Un(Jn+".autorange",!0),ma.range=[1,0]),da.autorange?Vn.calc=!0:Vn.plot=!0):(qt==="dragmode"&&(ur===!1&&_a!==!1||ur!==!1&&_a===!1)||Ee._has("scatter-like")&&Ee._has("regl")&&qt==="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 un=Va&&Va._constraintGroup;if(un){Vn.calc=!0;for(var Rn in un)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[Jn,ke._ev.listeners(Jn)]);Qe=K.newPlot(ke,xe,ye,Ee).then(()=>{for(const[Jn,ma]of Tn)ma.forEach(da=>ke.on(Jn,da));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,Br=vr.datarevision===void 0,kn=vr.transition,Wn=Er(ke,Ot,vr,Br,kn),Vn=Wn.newDataRevision,na=ar(ke,Ct,mr,Br,kn,Vn);if(at(ke)&&(Wn.layoutReplot=!0),na.calc||Wn.calc){ke.calcdata=void 0;for(var aa=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(Br){var kn=o.getTraceValObject(Kt,Br);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 mn=Ee._frameQueue.pop();mn.onInterrupt&&mn.onInterrupt()}ke.emit("plotly_animationinterrupted",[])}}function vr(mn){if(mn.length!==0){for(var Tn=0;TnEe._timeToNext&&kn()};mn()}var Vn=0;function na(mn){return Array.isArray(Xe)?Vn>=Xe.length?mn.transitionOpts=Xe[Vn]:mn.transitionOpts=Xe[0]:mn.transitionOpts=Xe,Vn++,mn}var aa,Un,ka=[],Va=xe==null,sr=Array.isArray(xe),qt=!Va&&!sr&&S.isPlainObject(xe);if(qt)ka.push({type:"object",data:na(S.extendFlat({},xe))});else if(Va||["string","number"].indexOf(typeof xe)!==-1)for(aa=0;aa0&&GrGr)&&sn.push(Un);ka=sn}}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,Br=(Ot[vr]||mr[vr]||{}).name,kn=xe[Ee].name,Wn=Ot[Br]||mr[Br];Br&&kn&&typeof kn=="number"&&Wn&&wor.index?-1:qt.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=Nr,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}}),c0=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=om();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)}}}),Hp=Ge({"src/plots/cartesian/align_period.js"(K,G){var h=Si(),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"}))}}}),f0=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,Br=.5-Ct,kn=.5-Ot,Wn=mr*mr+vr*vr,Vn=mr*Br+vr*kn;if(Vn>0&&Vn1||Math.abs(Br.y-Kt[0][1])>1)&&(Br=[Br.x,Br.y],xr&&Le(Br,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),Br=nt(mr),kn=[];if(vr&&Br&&Ft(vr,Br))return kn;vr&&kn.push(vr),Br&&kn.push(Br);var Wn=2*r.constrain((xr[Ct]+mr[Ct])/2,Ot,Kt)-((vr||xr)[Ct]+(Br||mr)[Ct]);if(Wn){var Vn;vr&&Br?Vn=Wn>0==vr[Ct]>Br[Ct]?vr:Br:Vn=vr||Br,Vn[Ct]+=Wn}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 Er(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 Mr(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],Br=Kt===z[F-2][1];xr&&(Ot===ze||Ot===Ye)&&vr?Br?F--:z[F-1]=Ct:mr&&(Kt===st||Kt===ct)&&Br?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]&&Mr([Ae,pe]),Mr(Ct),Ne=null,Ae=pe=0}var Sr=r.isArrayOrTypedArray(M);function Nr(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 lt=ar(z[F-1],Ct)[0],z[F++]=lt;var Kt=z[F-1];et&&Pe&&(Kt[0]!==et||Kt[1]!==Pe)?(Ne&&(Ae!==et&&pe!==Pe?Mr(Ae&&pe?Er(Ne,Ct):[Ae||et,pe||Pe]):Ae&&pe&&Mr([Ae,pe])),Mr([et,Pe])):Ae-et&&pe-Pe&&Mr([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;Nr(Z),B=Z}}Ne&&Mr([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(Mr){return _?Mr.transition():Mr}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(Mr){var $r=Mr[Mr.length-1];return Mr.length>1&&Mr[0][0]===$r[0]&&Mr[0][1]===$r[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: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]}}}}}),lg=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()))}}}}),Vu=Ge({"src/plots/cartesian/line_grid_defaults.js"(K,G){var h=Is().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)}}}}),Gp=Ge({"src/plots/cartesian/axis_defaults.js"(K,G){var h=Si(),b=Ro(),S=_n(),E=_u(),e=yd(),t=id(),r=tg(),o=z0(),n=Op(),i=Pv(),a=zf(),s=Vu(),f=ZT(),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=$d().isUnifiedHover,E=r5(),e=_u(),t=T1(),r=id(),o=Ud(),n=Gp(),i=ig(),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=p5(),K.layoutAttributes=id(),K.supplyLayoutDefaults=c2(),K.transitionAxes=vm(),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 lt=!1,dt=["x","y"],nt=0;nt1)&&(Qt===Nt?(Qe=ar.r2fraction(x["a"+Ft]),(Qe<0||Qe>1)&&(lt=!0)):lt=!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=Mr*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,Nr),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(lt){ce.remove();return}var vr=0,Br=0;if(x.align!=="left"&&(vr=(et-ct)*(x.align==="center"?.5:1)),x.valign!=="top"&&(Br=(Pe-at)*(x.valign==="middle"?.5:1)),Ye)ze.select("svg").attr({x:ne+vr-1,y:ne+Br}).call(o.setClipUrl,ue?B:null,g);else{var kn=ne+Br-st.top,Wn=ne+vr-st.left;ie.call(i.positionText,Wn,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(aa,Un){j.selectAll(".annotation-arrow-g").remove();var ka=R.x.head,Va=R.y.head,sr=R.x.tail+aa,qt=R.y.tail+Un,or=R.x.text+aa,ur=R.y.text+Un,Gr=E.rotationXYMatrix(U,or,ur),sn=E.apply2DTransform(Gr),mn=E.apply2DTransform2(Gr),Tn=+$.attr("width"),Jn=+$.attr("height"),ma=or-.5*Tn,da=ma+Tn,_a=ur-.5*Jn,Ca=_a+Jn,Hn=[[ma,_a,ma,Ca],[ma,Ca,da,Ca],[da,Ca,da,_a],[da,_a,ma,_a]].map(mn);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,qt,ka,Va,At[0],At[1],At[2],At[3]);lr&&(sr=lr.x,qt=lr.y)});var pi=x.arrowwidth,Mi=x.arrowcolor,Dt=x.arrowside,xt=j.append("g").style({opacity:r.opacity(Mi)}).classed("annotation-arrow-g",!0),Cr=xt.append("path").attr("d","M"+sr+","+qt+"L"+ka+","+Va).style("stroke-width",pi+"px").call(r.stroke,r.rgb(Mi));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-qt,2));jr+=x.standoff*(sr-ka)/Dr,Vr+=x.standoff*(qt-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)+","+(qt-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)"),ln,Jr;s.init({element:qr.node(),gd:g,prepFn:function(){var At=o.getTranslate(ce);ln=At.x,Jr=At.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(At,lr){var zr=sn(ln,Jr),un=zr[0]+At,Rn=zr[1]+lr;ce.call(o.setTranslate,un,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+","+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&&Vn(0,0),re){var na;s.init({element:ce.node(),gd:g,prepFn:function(){na=Z.attr("transform")},moveFn:function(aa,Un){var ka="pointer";if(x.showarrow)x.axref===x.xref?F("ax",T(_,aa,"ax",u,x)):F("ax",x.ax+aa),x.ayref===x.yref?F("ay",T(w,Un,"ay",u.w,x)):F("ay",x.ay+Un),Vn(aa,Un);else{if(M)return;var Va,sr;if(_)Va=T(_,aa,"x",u,x);else{var qt=x._xsize/u.w,or=x.x+(x._xshift-x.xshift)/u.w-qt/2;Va=s.align(or+aa/u.w,qt,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(aa,Un)+na}),a(ce,ka)},clickFn:function(aa,Un){x.captureevents&&g.emit("plotly_clickannotation",le(Un))},doneFn:function(){a(ce),b.call("_guiRelayout",g,N());var aa=document.querySelector(".js-notes-box-panel");aa&&aa.redraw(aa.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))}}}}),fg=Ge({"src/components/annotations3d/index.js"(K,G){var h=Ro(),b=_n();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Xp()}}},layoutAttributes:Xp(),handleDefaults:d2(),includeBasePlot:S,convert:v2(),draw:Mx()};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]}}}}),GM=Ge({"src/components/shapes/index.js"(K,G){var h=ag();G.exports={moduleType:"component",name:"shapes",layoutAttributes:jd(),supplyLayoutDefaults:Ex(),supplyDrawNewShapeDefaults:g5(),includeBasePlot:R1()("shapes"),calcAutorange:HM(),draw:h.draw,drawOne:h.drawOne}}}),y5=Ge({"src/components/images/attributes.js"(K,G){var h=sh(),b=_u().templatedArray;fm(),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=y5(),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"))}}}),XM=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)}}}}),_5=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=F1(),i=XM();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)}}}),x5=Ge({"src/components/sliders/index.js"(K,G){var h=B1();G.exports={moduleType:"component",name:h.name,layoutAttributes:mm(),supplyLayoutDefaults:m2(),draw:kx()}}}),gm=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"}}}),Cx=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}}}),Lx=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}}}),_m=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)})}}}),xm=Ge({"src/components/errorbars/index.js"(K,G){var h=_n(),b=Hc().overrideAll,S=ym(),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:T5(),calc:_2(),makeComputeError:U0(),plot:x2(),style:_m(),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))}}}),j1=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=Is(),S=ef(),E=Ro(),e=Ts(),t=lv(),r=_n(),o=r.strTranslate,n=Ki().extendFlat,i=Np(),a=As(),s=go(),f=lm(),c=nc(),p=gd().flipScale,v=Gp(),T=Rv(),l=id(),g=ad(),x=g.LINE_SPACING,A=g.FROM_TL,M=g.FROM_BR,_=j1().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&&(Mr.tick0=0)}Mr.dtick=Sr}Mr.domain=N?[ar+ee/ae.h,ar+Ne-ee/ae.h]:[ar+V/ae.w,ar+Ne-V/ae.w],Mr.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=Mr.ticklabelposition,xe=Mr.title.font.size,ye=L.select("."+_.cbaxis),Ee,Xe=0,Qe=0;function Lt(mr,vr){var Br={propContainer:Mr,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(Br,vr||{}))}function Ct(){if(N&&$r||!N&&!$r){var mr,vr;Le==="top"&&(mr=V+ae.l+lt*ne,vr=ee+ae.t+dt*(1-ar-Ne)+3+xe*.75),Le==="bottom"&&(mr=V+ae.l+lt*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+lt*ar),Lt(Mr._id+"title",{attributes:{x:mr,y:vr,"text-anchor":N?"start":"middle"}})}}function Ot(){if(N&&!$r||!N&&$r){var mr=Mr.position||0,vr=Mr._offset+Mr._length/2,Br,kn;if(Le==="right")kn=vr,Br=ae.l+lt*mr+10+xe*(Mr.showticklabels?1:.5);else if(Br=vr,Le==="bottom"&&(kn=ae.t+dt*mr+10+(ke.indexOf("inside")===-1?Mr.tickfont.size:0)+(Mr.ticks!=="inside"&&z.ticklen||0)),Le==="top"){var Wn=Se.text.split("
").length;kn=ae.t+dt*mr+10-Pe-x*xe*Wn}Lt((N?"h":"v")+Mr._id+"title",{avoid:{selection:h.select(F).selectAll("g."+Mr._id+"tick"),side:Le,offsetTop:N?0:ae.t,offsetLeft:N?ae.l:0,maxShift:N?H.width:H.height},attributes:{x:Br,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"),Br=[-Z/2,Z/2],kn=mr.select(".h"+Mr._id+"title-math-group").node(),Wn=15.6;vr.node()&&(Wn=parseInt(vr.node().style.fontSize,10)*x);var Vn;if(kn?(Vn=a.bBox(kn),Qe=Vn.width,Xe=Vn.height,Xe>Wn&&(Br[1]-=(Xe-Wn)/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")Mr.domain[1]-=Xe/ae.h,Br[1]*=-1;else{Mr.domain[0]+=Xe/ae.h;var na=c.lineCount(vr);Br[1]+=(1-na)*Wn}mr.attr("transform",o(Br[0],Br[1])),Mr.setScale()}}else Qe&&(Le==="right"&&(Mr.domain[0]+=(Qe+xe/2)/ae.w),mr.attr("transform",o(Br[0],Br[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 aa=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(at);aa.enter().append("rect").classed(_.cbfill,!0).attr("style",""),aa.exit().remove();var Un=Fe.map(Mr.c2p).map(Math.round).sort(function(or,ur){return or-ur});aa.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(Mr.c2p).map(Math.round);N&&(Gr[1]=r.constrain(Gr[1]+(Gr[1]>Gr[0])?1:-1,Un[0],Un[1]));var sn=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(sn,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var mn=Ye(or).replace("e-","");sn.attr("fill",b(mn).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(Mr.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."+Mr._id+"tick,path").remove();var Va=nt+Pe+(Z||0)/2-(z.ticks==="outside"?1:0),sr=e.calcTicks(Mr),qt=e.getTickSigns(Mr)[2];return e.drawTicks(F,Mr,{vals:Mr.ticks==="inside"?e.clipEnds(Mr,sr):sr,layer:ye,path:e.makeTickPath(Mr,Va,qt),transFn:e.makeTransTickFn(Mr)}),e.drawLabels(F,Mr,{vals:sr,layer:ye,transFn:e.makeTransTickLabelFn(Mr),labelFns:e.makeLabelFns(Mr,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 Br=0,kn=N&&Le==="top",Wn=!N&&Le==="right",Vn=0;if(Ee.node()&&!Ee.classed(_.jsPlaceholder)){var na,aa=Je.select(".h"+Mr._id+"title-math-group").node();aa&&(N&&$r||!N&&!$r)?(mr=a.bBox(aa),Br=mr.width,na=mr.height):(mr=a.bBox(Je.node()),Br=mr.right-ae.l-(N?nt:Er),na=mr.bottom-ae.t-(N?Er:nt),!N&&Le==="top"&&(vr+=mr.height,Vn=mr.height)),Wn&&(Ee.attr("transform",o(Br/2+xe/2,0)),Br*=2),vr=Math.max(vr,N?Br:na)}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:Er)-Va/2-(N?V:0),qt=(N?Er:nt)-(N?pe:ee+Vn-ka);L.select("."+_.cbbg).attr("x",sr).attr("y",qt).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=Wn?Math.max(Br-10,0):0;L.selectAll("."+_.cboutline).attr("x",(N?nt:Er+V)+or).attr("y",(N?Er+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 sn=ye.selectAll("text"),mn=sn[0].length,Tn=L.select("."+_.cbbg).node(),Jn=a.bBox(Tn),ma=a.getTranslate(L),da=2;sn.each(function(Vr,Dr){var qr=0,ln=mn-1;if(Dr===qr||Dr===ln){var Jr=a.bBox(this),At=a.getTranslate(this),lr;if(Dr===ln){var zr=Jr.right+At.x,un=Jn.right+ma.x+Er-re-da+ne;lr=un-zr,lr>0&&(lr=0)}else if(Dr===qr){var Rn=Jr.left+At.x,qn=Jn.left+ma.x+Er+re+da;lr=qn-Rn,lr<0&&(lr=0)}lr&&(mn<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],Mi=M[ce],Dt=Un-Pe;N?(R==="pixels"?(_a.y=$,_a.t=pe*pi,_a.b=pe*Mi):(_a.t=_a.b=0,_a.yt=$+B*pi,_a.yb=$-B*Mi),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*Mi):(_a.t=Dt*pi,_a.b=Dt*Mi,_a.yt=$-U*pi,_a.yb=$+U*Mi));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-qt-Gr,t:qt+_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)}}}),Yp=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}}}),ou=Ge({"src/traces/bar/plot.js"(K,G){var h=ki(),b=Si(),S=_n(),E=nc(),e=go(),t=As(),r=Ro(),o=Ts().tickText,n=cc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=xd(),f=py(),c=bm(),p=qh(),v=p.text,T=p.textposition,l=$d().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(lt,dt){var nt=h.select(this),Ft=w(lt,ne,$,at),Nt=Ft[0][0],Qt=Ft[0][1],ar=Ft[1][0],Er=Ft[1][1],Mr=(at?Qt-Nt:Er-ar)===0;Mr&&st&&f.getLineWidth(de,lt)&&(Mr=!1),Mr||(Mr=!b(Nt)||!b(Qt)||!b(ar)||!b(Er)),lt.isBlank=Mr,Mr&&(at?Qt=Nt:Er=ar),ct&&!Mr&&(at?(Nt-=_(Nt,Qt)*ct,Qt+=_(Nt,Qt)*ct):(ar-=_(ar,Er)*ct,Er+=_(ar,Er)*ct));var $r,Sr;if(de.type==="waterfall"){if(!Mr){var Nr=de[lt.dir].marker;$r=Nr.line.width,Sr=Nr.color}}else $r=f.getLineWidth(de,lt),Sr=lt.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,qt){return qt&&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,Er,!at),Er=ke(Er,ar,!at));var xe=at?ne.c2p:$.c2p,ye;lt.s0>0?ye=lt._sMax:lt.s0<0?ye=lt._sMin:ye=lt.s1>0?lt._sMax:lt._sMin;function Ee(Va,sr){if(!Va)return 0;var qt=Math.abs(at?Er-ar:Qt-Nt),or=Math.abs(at?Qt-Nt:Er-ar),ur=ke(Math.abs(xe(ye,!0)-xe(0,!0))),Gr=lt.hasB?Math.min(qt/2,or/2):Math.min(qt/2,ur),sn;if(sr==="%"){var mn=Math.min(50,Va);sn=qt*(mn/100)}else sn=Va;return ke(Math.max(Math.min(sn,Gr),0))}var Xe=Ye||ze?Ee(Se.cornerradiusvalue,Se.cornerradiusform):0,Qe,Lt,Ct="M"+Nt+","+ar+"V"+Er+"H"+Qt+"V"+ar+"Z",Ot=0;if(Xe&<.s){var Kt=M(lt.s0)===0||M(lt.s)===M(lt.s0)?lt.s1:lt.s0;if(Ot=ke(lt.hasB?0:Math.abs(xe(ye,!0)-xe(Kt,!0))),Ot0?Math.sqrt(Ot*(2*Xe-Ot)):0,Wn=xr>0?Math.max:Math.min;Qe="M"+Nt+","+ar+"V"+(Er-Br*mr)+"H"+Wn(Qt-(Xe-Ot)*xr,Nt)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(Er-Xe*mr-kn)+"V"+(ar+Xe*mr+kn)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Wn(Qt-(Xe-Ot)*xr,Nt)+","+(ar+Br*mr)+"Z"}else if(lt.hasB)Qe="M"+(Nt+Xe*xr)+","+ar+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Nt+","+(ar+Xe*mr)+"V"+(Er-Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr)+","+Er+"H"+(Qt-Xe*xr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(Er-Xe*mr)+"V"+(ar+Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Xe*xr)+","+ar+"Z";else{Lt=Math.abs(Er-ar)+Ot;var Vn=Lt0?Math.sqrt(Ot*(2*Xe-Ot)):0,aa=mr>0?Math.max:Math.min;Qe="M"+(Nt+Vn*xr)+","+ar+"V"+aa(Er-(Xe-Ot)*mr,ar)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr-na)+","+Er+"H"+(Qt-Xe*xr+na)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Vn*xr)+","+aa(Er-(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)*(Er-ar))||Mr&&re._context.staticPlot?"M0,0Z":Qe).call(t.setClipUrl,fe.layerClipId,re),!ue.uniformtext.mode&&et){var ka=t.makePointStyleFns(de);t.singlePointStyle(lt,Un,de,ka,re)}y(re,fe,nt,ae,dt,Nt,Qt,ar,Er,Xe,Ot,V,ee),fe.layerClipId&&t.hideOutsideRangePoint(lt,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,lt=s.getBarColor(ce[V],Ye),dt=s.getInsideTextFont(Ye,V,Ne,lt),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(Er-2*te,Mr,Nr,Mt,st)||I(Er,Mr-2*te,Nr,Mt,st):st?ke=I(Er-(te-H),Mr,Nr,Mt,st)||I(Er,Mr-2*(te-H),Nr,Mt,st):ke=I(Er,Mr-(te-H),Nr,Mt,st)||I(Er-2*(te-H),Mr,Nr,Mt,st):ke=I(Er,Mr,Nr,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()),Nr=Sr.width,Mt=Sr.height,$r.attr("transform",xe),Nr<=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 lt=N(re,fe,le,ce,Ae,Fe,ze,ne,Le);pe=lt.scale,Ne=lt.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 Er=(ne?Ae.x:Ae.y)/2;Fe&&(H||Le)&&(et+=Ne);var Mr=ne?_(re,fe):_(le,ce);ne?ae?(Ft=re+Mr*et,Qt=-Mr*Er):(Ft=fe-Mr*et,Qt=Mr*Er):ae?(Nt=le+Mr*et,ar=-Mr*Er):(Nt=ce-Mr*et,ar=Mr*Er)}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}}}),Cc=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}}}),wm=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(Mr){return L.d2c((M[Mr]||[])[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 Er=g(le,ee);le.ln=le.med-Er,le.un=le.med+Er,lt=Math.min(lt,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([lt,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}}}),Dx=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}}}),Nx=Ge({"src/traces/histogram/calc.js"(K,G){var h=Si(),b=_n(),S=Ro(),E=Ts(),{hasColorscale:e}=gd(),t=_d(),r=Yp(),o=Fx(),n=d0(),i=X1(),a=Bx();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}}}),M5=Ge({"src/traces/histogram2d/calc.js"(K,G){var h=_n(),b=Ts(),S=Fx(),E=d0(),e=X1(),t=Bx(),r=Nx().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}}}),Vx=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,lt;Le==="fast"?(Ne=ee?function(In){return V-1-In}:t.identity,lt=ne?function(In){return ce-1-In}:t.identity):(Ne=function(In){return t.constrain(Math.round(d.c2p(U[In])-$),0,ze)},lt=function(In){return t.constrain(Math.round(y.c2p(j[In])-H),0,Ye)});var dt=lt(0),nt=[dt,dt],Ft=ee?0:1,Nt=ne?0:1,Qt=0,ar=0,Er=0,Mr=0,$r,Sr,Nr,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,Er+=Ea[1]*gi,Mr+=Ea[2]*gi,Ea}return[0,0,0,0]}function ke(In,gi,Ea,Ci){var Hi=In[Ea.bin0];if(Hi===void 0)return Je(void 0,1);var so=In[Ea.bin1],io=gi[Ea.bin0],Mo=gi[Ea.bin1],fi=so-Hi||0,ts=io-Hi||0,Ho;return so===void 0?Mo===void 0?Ho=0:io===void 0?Ho=2*(Mo-Hi):Ho=(2*Mo-io-Hi)*2/3:Mo===void 0?io===void 0?Ho=0:Ho=(2*Hi-so-io)*2/3:io===void 0?Ho=(2*Mo-so-Hi)*2/3:Ho=Mo+Hi-so-io,Je(Hi+Ea.frac*fi+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;iema||ma>y._length))for(de=sn;de_a||_a>d._length)){var Ca=o({x:da,y:Jn},F,_._fullLayout);Ca.x=da,Ca.y=Jn;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 Mi=t.texttemplateString({data:[Ca,F._meta],fallback:F.texttemplatefallback,labels:Ca,locale:_._fullLayout._d3locale,template:ka});if(Mi){var Dt=Mi.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:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),W1=Ge({"src/traces/contour/attributes.js"(K,G){var h=bd(),b=Gc(),S=pc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=zu(),r=md().dash,o=Ns(),n=Ki().extendFlat,i=Qx(),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"}))}}),eb=Ge({"src/traces/histogram2dcontour/attributes.js"(K,G){var h=Kx(),b=W1(),S=zu(),E=pc().axisHoverFormat,e=Ki().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"}))}}),tb=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")}}}),$1=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)}}}),D5=Ge({"src/traces/histogram2dcontour/defaults.js"(K,G){var h=_n(),b=Jx(),S=tb(),E=$1(),e=gg(),t=eb();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}}}),rb=Ge({"src/traces/contour/end_plus.js"(K,G){G.exports=function(b){return b.end+b.size/1e6}}}),nb=Ge({"src/traces/contour/calc.js"(K,G){var h=Ec(),b=Y1(),S=D2(),E=rb();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}}}),K1=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=K1();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}}}),ab=Ge({"src/traces/contour/find_all_paths.js"(K,G){var h=_n(),b=K1();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]}}}}),z5=Ge({"src/traces/contour/constraint_mapping.js"(K,G){var h=Qx(),b=Si();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=z5(),S=rb();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}}}),O5=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}}}}),ib=Ge({"src/traces/contour/plot.js"(K){var G=ki(),h=_n(),b=As(),S=Ec(),E=nc(),e=Ts(),t=rp(),r=Gx(),o=z2(),n=ab(),i=O2(),a=O5(),s=F5(),f=K1(),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=qp(),E=B2(),e=tb(),t=$1(),r=gg(),o=W1();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")}}}),N5=Ge({"src/traces/contour/index.js"(K,G){G.exports={attributes:W1(),supplyDefaults:N2(),calc:nb(),plot:ib().plot,style:J1(),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=N5()}}),ob=Ge({"src/traces/scatterternary/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=Gc(),t=Gl(),r=zu(),o=md().dash,n=Ki().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()}}}),U5=Ge({"src/traces/scatterternary/defaults.js"(K,G){var h=_n(),b=u0(),S=uu(),E=Kd(),e=Vp(),t=Jd(),r=op(),o=Nd(),n=ob();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}}}),H5=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}}}),sb=Ge({"src/plots/ternary/ternary.js"(K,G){var h=ki(),b=Is(),S=Ro(),E=_n(),e=E.strTranslate,t=E._,r=go(),o=As(),n=rp(),i=Ki().extendFlat,a=ef(),s=Ts(),f=lv(),c=Yf(),p=Up(),v=p.freeMode,T=p.rectMode,l=lm(),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 lt=j._fullLayout._invTransform,dt=E.apply3DTransform(lt)(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,lt=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=(lt/2+nt)*R.w,Nt=(1-lt/2-dt)*R.w,Qt=(Ft+Nt)/2,ar=Nt-Ft,Er=(1-lt)*R.h,Mr=Er-ar/u;ar<_.MINZOOM?(ne=V,H.attr("d",ue),ae.attr("d","M0,0Z")):(ne={a:V.a+lt*ee,b:V.b+dt*ee,c:V.c+nt*ee},H.attr("d",ue+"M"+Ft+","+Er+"H"+Nt+"L"+Qt+","+Mr+"L"+Ft+","+Er+"Z"),ae.attr("d","M"+le+","+ce+F+"M"+Ft+","+Er+I+"M"+Nt+","+Er+L+"M"+Qt+","+Mr+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 lt=[ne.a,ne.b,ne.c].sort(E.sorterAsc),dt={a:lt.indexOf(ne.a),b:lt.indexOf(ne.b),c:lt.indexOf(ne.c)};lt[0]<0&&(lt[1]+lt[0]/2<0?(lt[2]+=lt[0]+lt[1],lt[0]=lt[1]=0):(lt[2]+=lt[0]/2,lt[1]+=lt[0]/2,lt[0]=0),ne={a:lt[dt.a],b:lt[dt.b],c:lt[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=kc().attributes,S=id(),E=Hc().overrideAll,e=Ki().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=kc().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")}}}),X5=Ge({"src/plots/ternary/index.js"(K){var G=sb(),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=G5(),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=Cc().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}}}),Q5=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:J5(),plot:$2(),style:fb().style,hoverPoints:K2(),eventData:Q5(),selectPoints:wm(),moduleType:"trace",name:"funnel",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),eA=Ge({"lib/funnel.js"(K,G){G.exports=J2()}}),V0=Ge({"src/traces/waterfall/constants.js"(K,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),hb=Ge({"src/traces/waterfall/attributes.js"(K,G){var h=qh(),b=Gc().line,S=Gl(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=V0(),n=Ki().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}}}),tA=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:"▼"}}}}),v0=Ge({"src/traces/waterfall/defaults.js"(K,G){var h=_n(),b=O0(),S=Dv().handleText,E=jp(),e=qp(),t=hb(),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}}}),QM=Ge({"src/traces/waterfall/hover.js"(K,G){var h=Ts().hoverLabelText,b=go().opacity,S=Cc().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}}}),eE=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}}}),nA=Ge({"src/traces/waterfall/index.js"(K,G){G.exports={attributes:hb(),layoutAttributes:tA(),supplyDefaults:v0().supplyDefaults,crossTraceDefaults:v0().crossTraceDefaults,supplyLayoutDefaults:Q2(),calc:rA(),crossTraceCalc:db(),plot:t_(),style:eh().style,hoverPoints:QM(),eventData:eE(),selectPoints:wm(),moduleType:"trace",name:"waterfall",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),r_=Ge({"lib/waterfall.js"(K,G){G.exports=nA()}}),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=Gl(),b=Gc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=Ki().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}}}),_g=Ge({"node_modules/buffer/index.js"(K){var G=iA(),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 lt=p(Pe);if(lt)return lt;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 lt=Ne.write(Pe,Ae);return lt!==pe&&(Ne=Ne.slice(0,lt)),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,lt=pe.length;for(let dt=0,nt=Math.min(Ne,lt);dtlt.length?(t.isBuffer(nt)||(nt=t.from(nt)),nt.copy(lt,dt)):Uint8Array.prototype.set.call(lt,nt,dt);else if(t.isBuffer(nt))nt.copy(lt,dt);else throw new TypeError('"list" argument must be an Array of Buffers');dt+=nt.length}return lt};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 lt=!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(lt)return Ne?-1:de(Pe).length;Ae=(""+Ae).toLowerCase(),lt=!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,lt,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),lt===void 0&&(lt=0),dt===void 0&&(dt=this.length),pe<0||Ne>Ae.length||lt<0||dt>this.length)throw new RangeError("out of range index");if(lt>=dt&&pe>=Ne)return 0;if(lt>=dt)return-1;if(pe>=Ne)return 1;if(pe>>>=0,Ne>>>=0,lt>>>=0,dt>>>=0,this===Ae)return 0;let nt=dt-lt,Ft=Ne-pe;const Nt=Math.min(nt,Ft),Qt=this.slice(lt,dt),ar=Ae.slice(pe,Ne);for(let Er=0;Er2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),pe=+pe,st(pe)&&(pe=lt?0:Pe.length-1),pe<0&&(pe=Pe.length+pe),pe>=Pe.length){if(lt)return-1;pe=Pe.length-1}else if(pe<0)if(lt)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,lt);if(typeof Ae=="number")return Ae=Ae&255,typeof Uint8Array.prototype.indexOf=="function"?lt?Uint8Array.prototype.indexOf.call(Pe,Ae,pe):Uint8Array.prototype.lastIndexOf.call(Pe,Ae,pe):M(Pe,[Ae],pe,Ne,lt);throw new TypeError("val must be string, number or Buffer")}function M(Pe,Ae,pe,Ne,lt){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,Er){return dt===1?ar[Er]:ar.readUInt16BE(Er*dt)}let Qt;if(lt){let ar=-1;for(Qt=pe;Qtnt&&(pe=nt-Ft),Qt=pe;Qt>=0;Qt--){let ar=!0;for(let Er=0;Erlt&&(Ne=lt)):Ne=lt;const dt=Ae.length;Ne>dt/2&&(Ne=dt/2);let nt;for(nt=0;nt>>0,isFinite(Ne)?(Ne=Ne>>>0,lt===void 0&&(lt="utf8")):(lt=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");lt||(lt="utf8");let nt=!1;for(;;)switch(lt){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: "+lt);lt=(""+lt).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 lt=Ae;for(;lt239?4:dt>223?3:dt>191?2:1;if(lt+Ft<=pe){let Nt,Qt,ar,Er;switch(Ft){case 1:dt<128&&(nt=dt);break;case 2:Nt=Pe[lt+1],(Nt&192)===128&&(Er=(dt&31)<<6|Nt&63,Er>127&&(nt=Er));break;case 3:Nt=Pe[lt+1],Qt=Pe[lt+2],(Nt&192)===128&&(Qt&192)===128&&(Er=(dt&15)<<12|(Nt&63)<<6|Qt&63,Er>2047&&(Er<55296||Er>57343)&&(nt=Er));break;case 4:Nt=Pe[lt+1],Qt=Pe[lt+2],ar=Pe[lt+3],(Nt&192)===128&&(Qt&192)===128&&(ar&192)===128&&(Er=(dt&15)<<18|(Nt&63)<<12|(Qt&63)<<6|ar&63,Er>65535&&Er<1114112&&(nt=Er))}}nt===null?(nt=65533,Ft=1):nt>65535&&(nt-=65536,Ne.push(nt>>>10&1023|55296),nt=56320|nt&1023),Ne.push(nt),lt+=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 lt="";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 lt=this[Ae],dt=1,nt=0;for(;++nt>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=this[Ae+--pe],dt=1;for(;pe>0&&(dt*=256);)lt+=this[Ae+--pe]*dt;return lt},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 lt=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(lt)+(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 lt=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(lt)<>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=this[Ae],dt=1,nt=0;for(;++nt=dt&&(lt-=Math.pow(2,8*pe)),lt},t.prototype.readIntBE=function(Ae,pe,Ne){Ae=Ae>>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=pe,dt=1,nt=this[Ae+--lt];for(;lt>0&&(dt*=256);)nt+=this[Ae+--lt]*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 lt=this[Ae+4]+this[Ae+5]*2**8+this[Ae+6]*2**16+(Ne<<24);return(BigInt(lt)<>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const lt=(pe<<24)+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae];return(BigInt(lt)<>>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,lt,dt){if(!t.isBuffer(Pe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ae>lt||AePe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(Ae,pe,Ne,lt){if(Ae=+Ae,pe=pe>>>0,Ne=Ne>>>0,!lt){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,!lt){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,lt){ue(Ae,Ne,lt,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,lt){ue(Ae,Ne,lt,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,lt){if(Ae=+Ae,pe=pe>>>0,!lt){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,lt){if(Ae=+Ae,pe=pe>>>0,!lt){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,lt,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,lt){return Ae=+Ae,pe=pe>>>0,lt||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,lt){return Ae=+Ae,pe=pe>>>0,lt||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,lt){if(!t.isBuffer(Ae))throw new TypeError("argument should be a Buffer");if(Ne||(Ne=0),!lt&<!==0&&(lt=this.length),pe>=Ae.length&&(pe=Ae.length),pe||(pe=0),lt>0&<=this.length)throw new RangeError("Index out of range");if(lt<0)throw new RangeError("sourceEnd out of bounds");lt>this.length&&(lt=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?lt=ne(String(pe)):typeof pe=="bigint"&&(lt=String(pe),(pe>BigInt(2)**BigInt(32)||pe<-(BigInt(2)**BigInt(32)))&&(lt=ne(lt)),lt+="n"),Ne+=` It must be ${Ae}. Received ${lt}`,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,lt,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,lt,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 lt=null;const dt=[];for(let nt=0;nt55295&&pe<57344){if(!lt){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}lt=pe;continue}if(pe<56320){(Ae-=3)>-1&&dt.push(239,191,189),lt=pe;continue}pe=(lt-55296<<10|pe-56320)+65536}else lt&&(Ae-=3)>-1&&dt.push(239,191,189);if(lt=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,lt=pe%256,dt.push(lt),dt.push(Ne);return dt}function Fe(Pe){return G.toByteArray(ie(Pe))}function ze(Pe,Ae,pe,Ne){let lt;for(lt=0;lt=Ae.length||lt>=Pe.length);++lt)Ae[lt+pe]=Pe[lt];return lt}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 lt=0;lt<16;++lt)Ae[Ne+lt]=Pe[pe]+Pe[lt]}return Ae})();function at(Pe){return typeof BigInt>"u"?et:Pe}function et(){throw new Error("BigInt not supported")}}}),n_=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=n_();G.exports=function(){return h()&&!!Symbol.toStringTag}}}),a_=Ge({"node_modules/es-object-atoms/index.js"(K,G){G.exports=Object}}),oA=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}}),tE=Ge({"node_modules/es-errors/uri.js"(K,G){G.exports=URIError}}),sA=Ge({"node_modules/math-intrinsics/abs.js"(K,G){G.exports=Math.abs}}),lA=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}}),uA=Ge({"node_modules/math-intrinsics/round.js"(K,G){G.exports=Math.round}}),cA=Ge({"node_modules/math-intrinsics/isNaN.js"(K,G){G.exports=Number.isNaN||function(b){return b!==b}}}),fA=Ge({"node_modules/math-intrinsics/sign.js"(K,G){var h=cA();G.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),rE=Ge({"node_modules/gopd/gOPD.js"(K,G){G.exports=Object.getOwnPropertyDescriptor}}),X0=Ge({"node_modules/gopd/index.js"(K,G){var h=rE();if(h)try{h([],"length")}catch{h=null}G.exports=h}}),Qd=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}}),Wp=Ge({"node_modules/has-symbols/index.js"(K,G){var h=typeof Symbol<"u"&&Symbol,b=n_();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=a_();G.exports=h.getPrototypeOf||null}}),hA=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=i_(),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=Qd(),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=Qd(),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}}),vA=Ge({"node_modules/set-function-length/index.js"(K,G){var h=xg(),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}}}),Sm=Ge({"node_modules/call-bind/index.js"(K,G){var h=fp(),b=xg(),S=vA(),E=Rh(),e=b("%Function.prototype.apply%"),t=b("%Function.prototype.call%"),r=b("%Reflect.apply%",!0)||h.call(t,e),o=Qd(),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=xg(),b=Sm(),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}}}),vb=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}}),pA=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}}}),nE=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)}}}),mA=Ge({"node_modules/for-each/index.js"(K,G){var h=nE(),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}}),Lc=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=mA(),b=Lc(),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=vb(),h=pA(),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($){return" "+$}).join(` +`).slice(2):ee=` +`+ee.split(` +`).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]}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;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})()}}),bg=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}}}),Em=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}}),m0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(K,G){var h=Em().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=Zp(),e=_g().Buffer,t=window.Uint8Array||function(){};function r(V){return e.from(V)}function o(V){return e.isBuffer(V)||V instanceof t}var n=bg(),i=m0(),a=i.getHighWaterMark,s=Em().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):""}}}),km=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(K,G){var h=Em().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=o_()),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}}),gb=Ge({"node_modules/stream-browserify/index.js"(K,G){G.exports=S;var h=D0().EventEmitter,b=Tp();b(S,h),S.Readable=pb(),S.Writable=Z0(),S.Duplex=Ap(),S.Transform=s_(),S.PassThrough=gA(),S.finished=km(),S.pipeline=mb(),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($){return" "+$}).join(` +`).slice(2):ee=` +`+ee.split(` +`).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]}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}}),Cm=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($[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(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(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(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(d,"+").concat(I," ").concat(at),re+=` +`.concat(y,"-").concat(I," ").concat(ct),Fe+=2):(fe+=re,re="",(st===1||ue===0)&&(fe+=` + `.concat(at),Fe++))}if(Fe>20&&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="",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($)),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=$,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}}),wg=Ge({"node_modules/object-keys/isArguments.js"(K,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}}}),W0=Ge({"node_modules/object-keys/implementation.js"(K,G){var h;Object.keys||(b=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=wg(),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,lt=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+)/)}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{}}}}),wA=Ge({"node_modules/stream-parser/index.js"(K,G){var h=Ey(),b=bA()("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}}}}),Pc=Ge({"node_modules/probe-image-size/lib/common.js"(K){var G=gb().Transform,h=wA();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}}}}),iE=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().readUInt32BE,E=xb(),e=u_(),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}}}}}}}}),oE=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),sE=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),TA=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"(K,G){var h=Pc().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"}}}}}),AA=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(K,G){var h=Pc().readUInt16BE,b=Pc().str2arr,S=Pc().sliceEq,E=u_(),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=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),bb=Ge({"node_modules/probe-image-size/lib/parse_sync/psd.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),SA=Ge({"node_modules/probe-image-size/lib/parse_sync/svg.js"(K,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):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}}}}}),kA=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"(K,G){G.exports={avif:iE(),bmp:oE(),gif:sE(),ico:TA(),jpeg:AA(),png:Cy(),psd:bb(),svg:SA(),tiff:MA(),webp:EA()}}}),CA=Ge({"node_modules/probe-image-size/sync.js"(K,G){var h=kA();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)})}}}),RA=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}}}),lE=Ge({"src/traces/image/index.js"(K,G){G.exports={attributes:e3(),supplyDefaults:aA(),calc:wb(),plot:PA(),style:RA(),hoverPoints:hf(),eventData:h3(),moduleType:"trace",name:"image",basePlotModule:_h(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),IA=Ge({"lib/image.js"(K,G){G.exports=lE()}}),Ly=Ge({"src/traces/pie/attributes.js"(K,G){var h=Gl(),b=kc().attributes,S=Ns(),E=Xf(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Ki().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=Si(),b=_n(),S=Ly(),E=kc().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"}}}}),Tb=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")}}}),g0=Ge({"src/traces/pie/calc.js"(K,G){var h=Si(),b=Is(),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&&(lt+=Nt*pe.pxmid[0],dt+=Nt*pe.pxmid[1])}pe.cxFinal=lt,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 Er="M"+(lt+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"+(lt+ar*pe.px0[0])+","+(dt+ar*pe.px0[1])+Qt(pe.px0,pe.pxmid,!1,ar)+Qt(pe.pxmid,pe.px0,!1,ar)+"Z"+Er):Ft.attr("d",Er)}else{var Mr=Qt(pe.px0,pe.px1,!0,1);if(ar){var $r=1-ar;Ft.attr("d","M"+(lt+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]+Mr+"Z")}else Ft.attr("d","M"+lt+","+dt+"l"+pe.px0[0]+","+pe.px0[1]+Mr+"Z")}ce(ee,pe,de);var Sr=c.castOption(Se.textposition,pe.pts),Nr=nt.selectAll("g.slicetext").data(pe.text&&Sr!=="none"?[0]:[]);Nr.enter().append("g").classed("slicetext",!0),Nr.exit().remove(),Nr.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=lt+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 lt;Se.title.position==="middle center"?lt=F(de):lt=N(de,te),pe.attr("transform",o(lt.x,lt.y)+r(Math.min(1,lt.scale))+o(lt.tx,lt.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,lt=0;lt=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),lt=ue?Ae.yLabelMin:Ae.yLabelMax,dt=ue?Ae.yLabelMax:Ae.yLabelMin,nt=Ae.cyFinal+ae(Ae.px0[1],Ae.px1[1]),Ft=Ne-lt,Nt,Qt,ar,Er,Mr,$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?(Er=ar.cyFinal+ae(ar.px0[1],ar.px1[1]),Ft=Er-lt-Ae.labelExtraY,Ft*de>0&&(Ae.labelExtraY+=Ft)):(dt+Ae.labelExtraY-nt)*de>0&&(Nt=3*ie*Math.abs(Qt-Fe.indexOf(Ae)),Mr=ar.cxFinal+H(ar.px0[0],ar.px1[0]),$r=Mr+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=E1(),S=cc().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)})})}}}),Pm=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)}}}),y0=Ge({"src/traces/pie/index.js"(K,G){G.exports={attributes:Ly(),supplyDefaults:Py().supplyDefaults,supplyLayoutDefaults:Tb(),layoutAttributes:d3(),calc:g0().calc,crossTraceCalc:g0().crossTraceCalc,plot:Ry().plot,style:p3(),styleOne:E1(),moduleType:"trace",name:"pie",basePlotModule:Pm(),categories:["pie-like","pie","showLegend"],meta:{}}}}),c_=Ge({"lib/pie.js"(K,G){G.exports=y0()}}),uE=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"]}}}),f_=Ge({"src/traces/sunburst/attributes.js"(K,G){var h=Gl(),{hovertemplateAttrs:b,texttemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=zu(),t=kc().attributes,r=Ly(),o=m3(),n=Ki().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"}}}}),DA=Ge({"src/traces/sunburst/defaults.js"(K,G){var h=_n(),b=f_(),S=kc().defaults,E=Dv().handleText,e=Py().handleMarkerDefaults,t=Ec(),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}}}),cE=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 Br=vr.children;Br?(vr.x=S(Br),vr.y=e(Br)):(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 lt(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,Br=Kt;Kt.eachBefore(function(aa){aa.xvr.x&&(vr=aa),aa.depth>Br.depth&&(Br=aa)});var kn=mr===vr?1:ke(mr,vr)/2,Wn=kn-mr.x,Vn=xe/(vr.x+kn+Wn),na=ye/(Br.depth||1);Kt.eachBefore(function(aa){aa.x=(aa.x+Wn)*Vn,aa.y=aa.depth*na})}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 Br=(xr[0].z+xr[xr.length-1].z)/2;vr?(Kt.z=vr.z+ke(Kt._,vr._),Kt.m=Kt.z-Br):Kt.z=Br}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,Br=Kt,kn=xr,Wn=vr.parent.children[0],Vn=vr.m,na=Br.m,aa=kn.m,Un=Wn.m,ka;kn=lt(kn),vr=Ne(vr),kn&&vr;)Wn=Ne(Wn),Br=lt(Br),Br.a=Kt,ka=kn.z+aa-vr.z-Vn+ke(kn._,vr._),ka>0&&(dt(Ft(kn,Kt,mr),Kt,ka),Vn+=ka,na+=ka),aa+=kn.m,Vn+=vr.m,Un+=Wn.m,na+=Br.m;kn&&!lt(Br)&&(Br.t=kn,Br.m+=aa-na),vr&&!Ne(Wn)&&(Wn.t=vr,Wn.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 Er(ke,xe,ye,Ee,Xe){for(var Qe=ke.children,Lt,Ct=-1,Ot=Qe.length,Kt=ke.value&&(Xe-ye)/ke.value;++Ctaa&&(aa=Kt),sr=Vn*Vn*Va,Un=Math.max(aa/sr,sr/na),Un>ka){Vn-=Kt;break}ka=Un}Lt.push(Ot={value:Vn,dice:Br1?Ee:1)},ye})(Mr);function Nr(){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 Br=Xe[vr.depth],kn=vr.x0+Br,Wn=vr.y0+Br,Vn=vr.x1-Br,na=vr.y1-Br;Vn=vr-1){var aa=Qe[mr];aa.x0=kn,aa.y0=Wn,aa.x1=Vn,aa.y1=na;return}for(var Un=Kt[mr],ka=Br/2+Un,Va=mr+1,sr=vr-1;Va>>1;Kt[qt]na-Wn){var Gr=(kn*ur+Vn*or)/Br;xr(mr,Va,or,kn,Wn,Gr,na),xr(Va,vr,ur,Gr,Wn,Vn,na)}else{var sn=(Wn*ur+na*or)/Br;xr(mr,Va,or,kn,Wn,Vn,sn),xr(Va,vr,ur,kn,sn,Vn,na)}}}function je(ke,xe,ye,Ee,Xe){(ke.depth&1?Er: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,Br,kn=Ot.length,Wn=Ee.value;++vr1?Ee:1)},ye})(Mr);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=Nr,h.treemapBinary=Mt,h.treemapDice=ze,h.treemapResquarify=Je,h.treemapSlice=Er,h.treemapSliceDice=je,h.treemapSquarify=Sr,Object.defineProperty(h,"__esModule",{value:!0})})}}),h_=Ge({"src/traces/sunburst/calc.js"(K){var G=Iy(),h=Si(),b=_n(),S=Ec().makeColorScaleFuncFromTrace,E=g0().makePullColorFn,e=g0().generateExtendedColors,t=Ec().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?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=kb.exec(K))?new wd(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=Cb.exec(K))?zy(G[1],G[2],G[3],G[4]):(G=BA.exec(K))?zy(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=w3.exec(K))?FA(G[1],G[2]/100,G[3]/100,1):(G=NA.exec(K))?FA(G[1],G[2]/100,G[3]/100,G[4]):Lb.hasOwnProperty(K)?Hu(Lb[K]):K==="transparent"?new wd(NaN,NaN,NaN,0):null}function Hu(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 _0||(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 Ab(){return`#${Ag(this.r)}${Ag(this.g)}${Ag(this.b)}`}function m_(){return`#${Ag(this.r)}${Ag(this.g)}${Ag(this.b)}${Ag((isNaN(this.opacity)?1:this.opacity)*255)}`}function g_(){const K=Sb(this.opacity);return`${K===1?"rgb(":"rgba("}${Rm(this.r)}, ${Rm(this.g)}, ${Rm(this.b)}${K===1?")":`, ${K})`}`}function Sb(K){return isNaN(K)?1:Math.max(0,Math.min(1,K))}function Rm(K){return Math.max(0,Math.min(255,Math.round(K)||0))}function Ag(K){return K=Rm(K),(K<16?"0":"")+K.toString(16)}function FA(K,G,h,b){return b<=0?K=G=h=NaN:h<=0||h>=1?K=G=NaN:G<=0&&(K=NaN),new Gu(K,G,h,b)}function y3(K){if(K instanceof Gu)return new Gu(K.h,K.s,K.l,K.opacity);if(K instanceof _0||(K=Dy(K)),!K)return new Gu;if(K instanceof Gu)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 Gu(e,t,r,K.opacity)}function Mb(K,G,h,b){return arguments.length===1?y3(K):new Gu(K,G,h,b??1)}function Gu(K,G,h,b){this.h=+K,this.s=+G,this.l=+h,this.opacity=+b}function Eb(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,Sg,K0,Im,Uv,x3,b3,kb,Cb,BA,w3,NA,Lb,T3=li({"node_modules/d3-color/src/color.js"(){v_(),$0=.7,Sg=1/$0,K0="\\s*([+-]?\\d+)\\s*",Im="\\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}\\)$`),kb=new RegExp(`^rgb\\(${Uv},${Uv},${Uv}\\)$`),Cb=new RegExp(`^rgba\\(${K0},${K0},${K0},${Im}\\)$`),BA=new RegExp(`^rgba\\(${Uv},${Uv},${Uv},${Im}\\)$`),w3=new RegExp(`^hsl\\(${Im},${Uv},${Uv}\\)$`),NA=new RegExp(`^hsla\\(${Im},${Uv},${Uv},${Im}\\)$`),Lb={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},Tg(_0,Dy,{copy(K){return Object.assign(new this.constructor,this,K)},displayable(){return this.rgb().displayable()},hex:zA,formatHex:zA,formatHex8:fE,formatHsl:p_,formatRgb:OA,toString:OA}),Tg(wd,Fy,d_(_0,{brighter(K){return K=K==null?Sg:Math.pow(Sg,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(Rm(this.r),Rm(this.g),Rm(this.b),Sb(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:Ab,formatHex:Ab,formatHex8:m_,formatRgb:g_,toString:g_})),Tg(Gu,Mb,d_(_0,{brighter(K){return K=K==null?Sg:Math.pow(Sg,K),new Gu(this.h,this.s,this.l*K,this.opacity)},darker(K){return K=K==null?$0:Math.pow($0,K),new Gu(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 Gu(Eb(this.h),cd(this.s),cd(this.l),Sb(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=Sb(this.opacity);return`${K===1?"hsl(":"hsla("}${Eb(this.h)}, ${cd(this.s)*100}%, ${cd(this.l)*100}%${K===1?")":`, ${K})`}`}}))}}),A3,x0,S3=li({"node_modules/d3-color/src/math.js"(){A3=Math.PI/180,x0=180/Math.PI}});function M3(K){if(K instanceof b0)return new b0(K.l,K.a,K.b,K.opacity);if(K instanceof Kp)return k3(K);K instanceof wd||(K=Oy(K));var G=x_(K.r),h=x_(K.g),b=x_(K.b),S=E3((.2225045*G+.7168786*h+.0606169*b)/Mg),E,e;return G===h&&h===b?E=e=S:(E=E3((.4360747*G+.3850649*h+.1430804*b)/Rb),e=E3((.0139322*G+.0971045*h+.7141733*b)/qv)),new b0(116*S-16,500*(E-S),200*(S-e),K.opacity)}function y_(K,G,h,b){return arguments.length===1?M3(K):new b0(K,G,h,b??1)}function b0(K,G,h,b){this.l=+K,this.a=+G,this.b=+h,this.opacity=+b}function E3(K){return K>UA?Math.pow(K,.3333333333333333):K/Jp+Ib}function Pb(K){return K>w0?K*K*K:Jp*(K-Ib)}function __(K){return 255*(K<=.0031308?12.92*K:1.055*Math.pow(K,.4166666666666667)-.055)}function x_(K){return(K/=255)<=.04045?K/12.92:Math.pow((K+.055)/1.055,2.4)}function hE(K){if(K instanceof Kp)return new Kp(K.h,K.c,K.l,K.opacity);if(K instanceof b0||(K=M3(K)),K.a===0&&K.b===0)return new Kp(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 A_(K,G){return function(h){return K+h*G}}function qA(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 S_(K,G){var h=G-K;return h?A_(K,h>180||h<-180?h-360*Math.round(h/360):h):Pg(isNaN(K)?G:K)}function vE(K){return(K=+K)==1?Td:function(G,h){return h-G?qA(G,h,K):Pg(isNaN(G)?h:G)}}function Td(K,G){var h=G-K;return h?A_(K,h):Pg(isNaN(K)?G:K)}var jy=li({"node_modules/d3-interpolate/src/color.js"(){Bb()}});function Nb(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:Qp(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:Qp(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:Qp(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:Qp(o,i)},{i:c-2,x:Qp(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:()=>VA,interpolateBasis:()=>Cg,interpolateBasisClosed:()=>P3,interpolateCubehelix:()=>Pi,interpolateCubehelixLong:()=>Ui,interpolateDate:()=>O3,interpolateDiscrete:()=>zm,interpolateHcl:()=>Ma,interpolateHclLong:()=>Ai,interpolateHsl:()=>ve,interpolateHslLong:()=>Ie,interpolateHue:()=>P_,interpolateLab:()=>Pt,interpolateNumber:()=>Qp,interpolateNumberArray:()=>R3,interpolateObject:()=>L_,interpolateRgb:()=>Ub,interpolateRgbBasis:()=>M_,interpolateRgbBasisClosed:()=>E_,interpolateRound:()=>Fm,interpolateString:()=>qb,interpolateTransformCss:()=>U3,interpolateTransformSvg:()=>Dg,interpolateZoom:()=>D_,piecewise:()=>jl,quantize:()=>si});var ao=li({"node_modules/d3-interpolate/src/index.js"(){e0(),z3(),Lg(),T_(),jb(),Om(),R_(),C_(),I3(),HA(),mE(),B3(),YA(),O(),k_(),ht(),Ir(),no(),Ks(),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)}}}),xc=Ge({"src/traces/sunburst/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=cc().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}}}),Us=Ge({"src/traces/sunburst/helpers.js"(K){var G=_n(),h=go(),b=Np(),S=rg();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=$d().appendArrayPointValue,E=Yf(),e=_n(),t=S1(),r=Us(),o=rg(),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;lt={x0:nt,x1:nt}}else lt={rpx0:le,rpx1:le},E.extendFlat(lt,Ae(pe));else lt={rpx0:0,rpx1:0};else lt={x0:ae,x1:ae};return b(lt,dt)}function Pe(pe){var Ne=ne[T.getPtId(pe)],lt,dt=pe.transform;if(Ne)lt=Ne;else if(lt={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;lt.x0=lt.x1=nt}else E.extendFlat(lt,Ae(pe));else lt.x0=lt.x1=ae;else lt.x0=lt.x1=ae;var Ft=b(lt.transform.textPosAngle,pe.transform.textPosAngle),Nt=b(lt.rpx1,pe.rpx1),Qt=b(lt.x0,pe.x0),ar=b(lt.x1,pe.x1),Er=b(lt.transform.scale,dt.scale),Mr=b(lt.transform.rotate,dt.rotate),$r=dt.rCenter===0?3:lt.transform.rCenter===0?1/3:1,Sr=b(lt.transform.rCenter,dt.rCenter),Nr=function(Mt){return Sr(Math.pow(Mt,$r))};return function(Mt){var je=Nt(Mt);Qt(Mt),ar(Mt);var Je=Nr(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:Er(Mt),rotate:Mr(Mt),rCenter:Je}}}}function Ae(pe){var Ne=pe.parent,lt=ne[T.getPtId(Ne)],dt={};if(lt){var nt=Ne.children,Ft=nt.indexOf(pe),Nt=nt.length,Qt=b(lt.x0,lt.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)]}}}),Rc=Ge({"src/traces/sunburst/index.js"(K,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:uE(),categories:[],animatable:!0,attributes:f_(),layoutAttributes:g3(),supplyDefaults:DA(),supplyLayoutDefaults:cE(),calc:h_().calc,crossTraceCalc:h_().crossTraceCalc,plot:Xu().plot,style:xc().style,colorbar:Zf(),meta:{}}}}),Bm=Ge({"lib/sunburst.js"(K,G){G.exports=Rc()}}),gE=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)}}}),Wb=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}}}),yE=Ge({"src/traces/treemap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=kc().attributes,t=Ly(),r=f_(),o=Wb(),n=Ki().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"})}}}),nC=Ge({"src/traces/treemap/layout_attributes.js"(K,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),iR=Ge({"src/traces/treemap/defaults.js"(K,G){var h=_n(),b=yE(),S=go(),E=kc().defaults,e=Dv().handleText,t=bm().TEXTPAD,r=Py().handleMarkerDefaults,o=Ec(),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}}}),oR=Ge({"src/traces/treemap/layout_defaults.js"(K,G){var h=_n(),b=nC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),aC=Ge({"src/traces/treemap/calc.js"(K){var G=h_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("treemap",h)}}}),iC=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))})}}}),lR=Ge({"src/traces/treemap/plot_one.js"(K,G){var h=ki(),b=(ao(),ui(xi)).interpolate,S=Us(),E=_n(),e=bm().TEXTPAD,t=ou(),r=t.toMoveInsideBar,o=cc(),n=o.recordMinTextSize,i=Wb(),a=sR();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,Nr,Mt){var je=A.tiling.pad,Je=function(Ee){return Ee-je<=Nr.x0},ke=function(Ee){return Ee+je>=Nr.x1},xe=function(Ee){return Ee-je<=Nr.y0},ye=function(Ee){return Ee+je>=Nr.y1};return Sr.x0===Nr.x0&&Sr.x1===Nr.x1&&Sr.y0===Nr.y0&&Sr.y1===Nr.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,Nr){return Nr?ee[s(Sr)]:ne[s(Sr)]},te=function(Sr,Nr,Mt,je){if(Nr)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,Nr){return Sr+","+Nr}var st=Fe(0),ct=function(Sr){Sr.x=Math.max(st,Sr.x)},at=A.pathbar.edgeshape,et=function(Sr){var Nr=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=Nr,ye.x=Mt,xe.y=ye.y=(je+Je)/2;var Ee={x:Nr,y:je},Xe={x:Mt,y:je},Qe={x:Mt,y:Je},Lt={x:Nr,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"),lt=Ae("right"),dt=Ae("bottom"),nt=function(Sr){var Nr=ie(Sr.x0),Mt=ie(Sr.x1),je=de(Sr.y0),Je=de(Sr.y1),ke=Mt-Nr,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)),lt&&(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(Nr,je+Ee)+Xe(Ee,-Ee)+"L"+Ye(Mt-Ee,je)+Xe(Ee,Ee)+"L"+Ye(Mt,Je-Ee)+Xe(-Ee,Ee)+"L"+Ye(Nr+Ee,Je)+Xe(-Ee,-Ee)+"Z"},Ft=function(Sr,Nr){var Mt=Sr.x0,je=Sr.x1,Je=Sr.y0,ke=Sr.y1,xe=Sr.textBB,ye=pe||Nr.isHeader&&!dt,Ee=ye?"start":dt?"end":"middle",Xe=Ae("right"),Qe=Ae("left")||Nr.onPathbar,Lt=Qe?-1:Xe?1:0;if(Nr.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}}}),cR=Ge({"src/traces/treemap/plot.js"(K,G){var h=sC(),b=uR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"treemap",drawDescendants:b})}}}),fR=Ge({"src/traces/treemap/index.js"(K,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:gE(),categories:[],animatable:!0,attributes:yE(),layoutAttributes:nC(),supplyDefaults:iR(),supplyLayoutDefaults:oR(),calc:aC().calc,crossTraceCalc:aC().crossTraceCalc,plot:cR(),style:_E().style,colorbar:Zf(),meta:{}}}}),hR=Ge({"lib/treemap.js"(K,G){G.exports=fR()}}),dR=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)}}}),lC=Ge({"src/traces/icicle/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=kc().attributes,t=Ly(),r=f_(),o=yE(),n=Wb(),i=Ki().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"})}}}),uC=Ge({"src/traces/icicle/layout_attributes.js"(K,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),vR=Ge({"src/traces/icicle/defaults.js"(K,G){var h=_n(),b=lC(),S=go(),E=kc().defaults,e=Dv().handleText,t=bm().TEXTPAD,r=Py().handleMarkerDefaults,o=Ec(),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}}}),pR=Ge({"src/traces/icicle/layout_defaults.js"(K,G){var h=_n(),b=uC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),cC=Ge({"src/traces/icicle/calc.js"(K){var G=h_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("icicle",h)}}}),mR=Ge({"src/traces/icicle/partition.js"(K,G){var h=Iy(),b=iC();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}}}),fC=Ge({"src/traces/icicle/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=cc().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}}}),gR=Ge({"src/traces/icicle/draw_descendants.js"(K,G){var h=ki(),b=_n(),S=As(),E=nc(),e=mR(),t=fC().styleOne,r=Wb(),o=Us(),n=xu(),i=Xu().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}}}),yR=Ge({"src/traces/icicle/plot.js"(K,G){var h=sC(),b=gR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"icicle",drawDescendants:b})}}}),_R=Ge({"src/traces/icicle/index.js"(K,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:dR(),categories:[],animatable:!0,attributes:lC(),layoutAttributes:uC(),supplyDefaults:vR(),supplyLayoutDefaults:pR(),calc:cC().calc,crossTraceCalc:cC().crossTraceCalc,plot:yR(),style:fC().style,colorbar:Zf(),meta:{}}}}),xR=Ge({"lib/icicle.js"(K,G){G.exports=_R()}}),bR=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)}}}),hC=Ge({"src/traces/funnelarea/attributes.js"(K,G){var h=Ly(),b=Gl(),S=kc().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Ki().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"}}}}),dC=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"}}}}),wR=Ge({"src/traces/funnelarea/defaults.js"(K,G){var h=_n(),b=hC(),S=kc().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")}}}),TR=Ge({"src/traces/funnelarea/layout_defaults.js"(K,G){var h=_n(),b=dC();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")}}}),vC=Ge({"src/traces/funnelarea/calc.js"(K,G){var h=g0();function b(E,e){return h.calc(E,e)}function S(E){h.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:b,crossTraceCalc:S}}}),AR=Ge({"src/traces/funnelarea/plot.js"(K,G){var h=ki(),b=As(),S=_n(),E=S.strScale,e=S.strTranslate,t=nc(),r=ou(),o=r.toMoveInsideBar,n=cc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=rg(),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}}}}),SR=Ge({"src/traces/funnelarea/style.js"(K,G){var h=ki(),b=E1(),S=cc().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)})})}}}),MR=Ge({"src/traces/funnelarea/index.js"(K,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:bR(),categories:["pie-like","funnelarea","showLegend"],attributes:hC(),layoutAttributes:dC(),supplyDefaults:wR(),supplyLayoutDefaults:TR(),calc:vC().calc,crossTraceCalc:vC().crossTraceCalc,plot:AR(),style:SR(),styleOne:E1(),meta:{}}}}),ER=Ge({"lib/funnelarea.js"(K,G){G.exports=MR()}}),hv=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;R 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * (view * conePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);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; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),a=o([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);e.exports=function(s){return n(s,i,a,null,[{name:"position",type:"vec2"}])}}),811:(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}}),840:(function(e,t,r){var o=r(3236),n=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +vec4 project(vec3 p) { + return projection * (view * (model * vec4(p, 1.0))); +} + +void main() { + gl_Position = project(position); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * vec4(position , 1.0); + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + f_color = color; + f_data = position; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),a=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_color = color; + f_data = position; + f_uv = uv; +}`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),f=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),p=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_id = id; + f_position = position; +}`]),v=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),T=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),l=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); +}`]),g=o([`precision highp float; +#define GLSLIFY 1 + +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:v,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:v,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),v=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),g=o.mallocDouble(s*8);function x(d){var y=n.nextPow2(d);f.length>>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;Ye max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + if ( + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) + ) discard; + + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color — in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; +} +`]),s=n([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute float f; + +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); + + vec4 clipPosition = projection * (view * worldPosition); + clipPosition.z += zOffset; + + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; + + vColor = texture2D(colormap, vec2(value, value)); + + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); +} +`]),f=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec2 shape; +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} + +void main() { + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; + + vec2 ux = splitFloat(planeCoordinate.x / shape.x); + vec2 uy = splitFloat(planeCoordinate.y / shape.y); + gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); +} +`]);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) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform vec4 highlightId; +uniform float highlightScale; +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = 1.0; + if(distance(highlightId, id) < 0.0001) { + scale = highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1); + vec4 viewPosition = view * worldPosition; + viewPosition = viewPosition / viewPosition.w; + vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),a=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float highlightScale, pixelRatio; +uniform vec4 highlightId; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = pixelRatio; + if(distance(highlightId.bgr, id.bgr) < 0.001) { + scale *= highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1.0); + vec4 viewPosition = view * worldPosition; + vec4 clipPosition = projection * viewPosition; + clipPosition /= clipPosition.w; + + gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),s=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform float highlightScale; +uniform vec4 highlightId; +uniform vec3 axes[2]; +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float scale, pixelRatio; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float lscale = pixelRatio * scale; + if(distance(highlightId, id) < 0.0001) { + lscale *= highlightScale; + } + + vec4 clipCenter = projection * (view * (model * vec4(position, 1))); + vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; + vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = dataPosition; + } +} +`]),f=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float opacity; + +varying vec4 interpColor; +varying vec3 dataCoordinate; + +void main() { + if ( + outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || + interpColor.a * opacity == 0. + ) discard; + gl_FragColor = interpColor * opacity; +} +`]),c=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float pickGroup; + +varying vec4 pickId; +varying vec3 dataCoordinate; + +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"}],v={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(_,v)},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]),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: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;v HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +} +`]),f=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(v){return n(v,s,f,null,[{name:"position",type:"vec3"}])};var c=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),p=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);t.bg=function(v){return n(v,c,p,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),1888:(function(e,t,r){var o=r(8828),n=r(1338),i=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:n([32,0]),UINT16:n([32,0]),UINT32:n([32,0]),BIGUINT64:n([32,0]),INT8:n([32,0]),INT16:n([32,0]),INT32:n([32,0]),BIGINT64:n([32,0]),FLOAT:n([32,0]),DOUBLE:n([32,0]),DATA:n([32,0]),UINT8C:n([32,0]),BUFFER:n([32,0])});var a=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",f=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=n([32,0])),c.BIGUINT64||(c.BIGUINT64=n([32,0])),c.BIGINT64||(c.BIGINT64=n([32,0])),c.BUFFER||(c.BUFFER=n([32,0]));var p=c.DATA,v=c.BUFFER;t.free=function(B){if(i.isBuffer(B))v[o.log2(B.length)].push(B);else{if(Object.prototype.toString.call(B)!=="[object ArrayBuffer]"&&(B=B.buffer),!B)return;var R=B.length||B.byteLength,U=o.log2(R)|0;p[U].push(B)}};function T(N){if(N){var B=N.length||N.byteLength,R=o.log2(B);p[R].push(N)}}function l(N){T(N.buffer)}t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=l,t.freeArrayBuffer=T,t.freeBuffer=function(B){v[o.log2(B.length)].push(B)},t.malloc=function(B,R){if(R===void 0||R==="arraybuffer")return g(B);switch(R){case"uint8":return x(B);case"uint16":return A(B);case"uint32":return M(B);case"int8":return _(B);case"int16":return w(B);case"int32":return m(B);case"float":case"float32":return u(B);case"double":case"float64":return d(B);case"uint8_clamped":return y(B);case"bigint64":return L(B);case"biguint64":return I(B);case"buffer":return F(B);case"data":case"dataview":return z(B);default:return null}return null};function g(B){var B=o.nextPow2(B),R=o.log2(B),U=p[R];return U.length>0?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 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; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),a=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) 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,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,Er=Ft[Qt],Mr=Ft[ar],$r=Nt[Qt],Sr=Nt[ar];if(Er>0&&Sr>0){Pe(Qt);return}else if(Er>0&&Sr<0){Pe(Qt);return}else if(Er<0&&Sr>0){Pe(Qt);return}else if(Er<0&&Sr<0){Pe(Qt);return}else if(Mr>0&&$r>0){Pe(ar);return}else if(Mr>0&&$r<0){Pe(ar);return}else if(Mr<0&&$r>0){Pe(ar);return}else if(Mr<0&&$r<0){Pe(ar);return}}for(var $=0;$<3;++$){for(var pe=ue[$].primalMinor,Ne=ue[$].mirrorMinor,lt=l(I,ue[$].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[$]&&(lt[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)lt[ie]+=ne*pe[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks($,this.tickSize[$],this.tickAngle[$],lt,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)lt[ie]+=ne*pe[ie]*this.labelPad[ie]/F[5*ie];lt[$]+=.5*(R[0][$]+R[1][$]),this._text.drawLabel($,this.labelSize[$],this.labelAngle[$],lt,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 lt=d.style;lt.position=lt.position||"absolute",lt.left="0px",lt.top="0px",lt.width=Pe+"px",lt.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(Nr(xe,ArrayBuffer)||xe&&Nr(xe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nr(xe,SharedArrayBuffer)||xe&&Nr(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(Nr(ye,Uint8Array)&&(ye=d.from(ye,ye.offset,ye.byteLength)),Nr(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)||Nr(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(Nr(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,Wn){return Lt===1?kn[Wn]:kn.readUInt16BE(Wn*Lt)}var xr;if(Qe){var mr=-1;for(xr=Ee;xrCt&&(Ee=Ct-Ot),xr=Ee;xr>=0;xr--){for(var vr=!0,Br=0;BrQe&&(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 lt(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)}lt(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 Er(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 Nr(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;w 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * (view * tubePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}}),6743:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=i+i,p=a+a,v=s+s,T=i*c,l=i*p,g=i*v,x=a*p,A=a*v,M=s*v,_=f*c,w=f*p,m=f*v;return r[0]=1-(x+M),r[1]=l+m,r[2]=g-w,r[3]=0,r[4]=l-m,r[5]=1-(T+M),r[6]=A+_,r[7]=0,r[8]=g+w,r[9]=A-_,r[10]=1-(T+x),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}}),6760:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=o[4],p=o[5],v=o[6],T=o[7],l=o[8],g=o[9],x=o[10],A=o[11],M=o[12],_=o[13],w=o[14],m=o[15],u=n[0],d=n[1],y=n[2],I=n[3];return r[0]=u*i+d*c+y*l+I*M,r[1]=u*a+d*p+y*g+I*_,r[2]=u*s+d*v+y*x+I*w,r[3]=u*f+d*T+y*A+I*m,u=n[4],d=n[5],y=n[6],I=n[7],r[4]=u*i+d*c+y*l+I*M,r[5]=u*a+d*p+y*g+I*_,r[6]=u*s+d*v+y*x+I*w,r[7]=u*f+d*T+y*A+I*m,u=n[8],d=n[9],y=n[10],I=n[11],r[8]=u*i+d*c+y*l+I*M,r[9]=u*a+d*p+y*g+I*_,r[10]=u*s+d*v+y*x+I*w,r[11]=u*f+d*T+y*A+I*m,u=n[12],d=n[13],y=n[14],I=n[15],r[12]=u*i+d*c+y*l+I*M,r[13]=u*a+d*p+y*g+I*_,r[14]=u*s+d*v+y*x+I*w,r[15]=u*f+d*T+y*A+I*m,r}}),6768:(function(e,t,r){var o=r(6859);e.exports=n;function n(i){return new o(i)}}),6803:(function(e,t,r){r(8828),r(1755);function o(n,i){var a=n.length,s=n.length-i.length,f=Math.min;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-i[0];case 2:var l=n[0]+n[1]-i[0]-i[1];return l||f(n[0],n[1])-f(i[0],i[1]);case 3:var c=n[0]+n[1],p=i[0]+i[1];if(l=c+n[2]-(p+i[2]),l)return l;var v=f(n[0],n[1]),T=f(i[0],i[1]),l=f(v,n[2])-f(T,i[2]);return l||f(v+n[2],c)-f(T+i[2],p);default:var g=n.slice(0);g.sort();var x=i.slice(0);x.sort();for(var A=0;A0?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,lt=Z[7]|0,dt=lt&8191,nt=lt>>>13,Ft=Z[8]|0,Nt=Ft&8191,Qt=Ft>>>13,ar=Z[9]|0,Er=ar&8191,Mr=ar>>>13,$r=re[0]|0,Sr=$r&8191,Nr=$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,Br=vr&8191,kn=vr>>>13,Wn=re[7]|0,Vn=Wn&8191,na=Wn>>>13,aa=re[8]|0,Un=aa&8191,ka=aa>>>13,Va=re[9]|0,sr=Va&8191,qt=Va>>>13;j.negative=R.negative^U.negative,j.length=19,ce=Math.imul($,Sr),V=Math.imul($,Nr),V=V+Math.imul(ue,Sr)|0,ee=Math.imul(ue,Nr);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,Nr),V=V+Math.imul(ae,Sr)|0,ee=Math.imul(ae,Nr),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,Nr),V=V+Math.imul(Se,Sr)|0,ee=Math.imul(Se,Nr),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,Nr),V=V+Math.imul(ze,Sr)|0,ee=Math.imul(ze,Nr),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 sn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(sn>>>26)|0,sn&=67108863,ce=Math.imul(st,Sr),V=Math.imul(st,Nr),V=V+Math.imul(ct,Sr)|0,ee=Math.imul(ct,Nr),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 mn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(mn>>>26)|0,mn&=67108863,ce=Math.imul(et,Sr),V=Math.imul(et,Nr),V=V+Math.imul(Pe,Sr)|0,ee=Math.imul(Pe,Nr),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 Tn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ce=Math.imul(pe,Sr),V=Math.imul(pe,Nr),V=V+Math.imul(Ne,Sr)|0,ee=Math.imul(Ne,Nr),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($,Br)|0,V=V+Math.imul($,kn)|0,V=V+Math.imul(ue,Br)|0,ee=ee+Math.imul(ue,kn)|0;var Jn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,ce=Math.imul(dt,Sr),V=Math.imul(dt,Nr),V=V+Math.imul(nt,Sr)|0,ee=Math.imul(nt,Nr),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,Br)|0,V=V+Math.imul(H,kn)|0,V=V+Math.imul(ae,Br)|0,ee=ee+Math.imul(ae,kn)|0,ce=ce+Math.imul($,Vn)|0,V=V+Math.imul($,na)|0,V=V+Math.imul(ue,Vn)|0,ee=ee+Math.imul(ue,na)|0;var ma=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ma>>>26)|0,ma&=67108863,ce=Math.imul(Nt,Sr),V=Math.imul(Nt,Nr),V=V+Math.imul(Qt,Sr)|0,ee=Math.imul(Qt,Nr),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,Br)|0,V=V+Math.imul(de,kn)|0,V=V+Math.imul(Se,Br)|0,ee=ee+Math.imul(Se,kn)|0,ce=ce+Math.imul(H,Vn)|0,V=V+Math.imul(H,na)|0,V=V+Math.imul(ae,Vn)|0,ee=ee+Math.imul(ae,na)|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 da=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(da>>>26)|0,da&=67108863,ce=Math.imul(Er,Sr),V=Math.imul(Er,Nr),V=V+Math.imul(Mr,Sr)|0,ee=Math.imul(Mr,Nr),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,Br)|0,V=V+Math.imul(Fe,kn)|0,V=V+Math.imul(ze,Br)|0,ee=ee+Math.imul(ze,kn)|0,ce=ce+Math.imul(de,Vn)|0,V=V+Math.imul(de,na)|0,V=V+Math.imul(Se,Vn)|0,ee=ee+Math.imul(Se,na)|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($,qt)|0,V=V+Math.imul(ue,sr)|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,Je),V=V+Math.imul(Mr,je)|0,ee=Math.imul(Mr,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,Br)|0,V=V+Math.imul(st,kn)|0,V=V+Math.imul(ct,Br)|0,ee=ee+Math.imul(ct,kn)|0,ce=ce+Math.imul(Fe,Vn)|0,V=V+Math.imul(Fe,na)|0,V=V+Math.imul(ze,Vn)|0,ee=ee+Math.imul(ze,na)|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,qt)|0,V=V+Math.imul(ae,sr)|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,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,Br)|0,V=V+Math.imul(et,kn)|0,V=V+Math.imul(Pe,Br)|0,ee=ee+Math.imul(Pe,kn)|0,ce=ce+Math.imul(st,Vn)|0,V=V+Math.imul(st,na)|0,V=V+Math.imul(ct,Vn)|0,ee=ee+Math.imul(ct,na)|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,qt)|0,V=V+Math.imul(Se,sr)|0,ee=ee+Math.imul(Se,qt)|0;var Hn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,ce=Math.imul(Er,Xe),V=Math.imul(Er,Qe),V=V+Math.imul(Mr,Xe)|0,ee=Math.imul(Mr,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,Br)|0,V=V+Math.imul(pe,kn)|0,V=V+Math.imul(Ne,Br)|0,ee=ee+Math.imul(Ne,kn)|0,ce=ce+Math.imul(et,Vn)|0,V=V+Math.imul(et,na)|0,V=V+Math.imul(Pe,Vn)|0,ee=ee+Math.imul(Pe,na)|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,qt)|0,V=V+Math.imul(ze,sr)|0,ee=ee+Math.imul(ze,qt)|0;var pi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pi>>>26)|0,pi&=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,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,Br)|0,V=V+Math.imul(dt,kn)|0,V=V+Math.imul(nt,Br)|0,ee=ee+Math.imul(nt,kn)|0,ce=ce+Math.imul(pe,Vn)|0,V=V+Math.imul(pe,na)|0,V=V+Math.imul(Ne,Vn)|0,ee=ee+Math.imul(Ne,na)|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,qt)|0,V=V+Math.imul(ct,sr)|0,ee=ee+Math.imul(ct,qt)|0;var Mi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,ce=Math.imul(Er,xr),V=Math.imul(Er,mr),V=V+Math.imul(Mr,xr)|0,ee=Math.imul(Mr,mr),ce=ce+Math.imul(Nt,Br)|0,V=V+Math.imul(Nt,kn)|0,V=V+Math.imul(Qt,Br)|0,ee=ee+Math.imul(Qt,kn)|0,ce=ce+Math.imul(dt,Vn)|0,V=V+Math.imul(dt,na)|0,V=V+Math.imul(nt,Vn)|0,ee=ee+Math.imul(nt,na)|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,qt)|0,V=V+Math.imul(Pe,sr)|0,ee=ee+Math.imul(Pe,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,Br),V=Math.imul(Er,kn),V=V+Math.imul(Mr,Br)|0,ee=Math.imul(Mr,kn),ce=ce+Math.imul(Nt,Vn)|0,V=V+Math.imul(Nt,na)|0,V=V+Math.imul(Qt,Vn)|0,ee=ee+Math.imul(Qt,na)|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,qt)|0,V=V+Math.imul(Ne,sr)|0,ee=ee+Math.imul(Ne,qt)|0;var xt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(xt>>>26)|0,xt&=67108863,ce=Math.imul(Er,Vn),V=Math.imul(Er,na),V=V+Math.imul(Mr,Vn)|0,ee=Math.imul(Mr,na),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,qt)|0,V=V+Math.imul(nt,sr)|0,ee=ee+Math.imul(nt,qt)|0;var Cr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,ce=Math.imul(Er,Un),V=Math.imul(Er,ka),V=V+Math.imul(Mr,Un)|0,ee=Math.imul(Mr,ka),ce=ce+Math.imul(Nt,sr)|0,V=V+Math.imul(Nt,qt)|0,V=V+Math.imul(Qt,sr)|0,ee=ee+Math.imul(Qt,qt)|0;var jr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(jr>>>26)|0,jr&=67108863,ce=Math.imul(Er,sr),V=Math.imul(Er,qt),V=V+Math.imul(Mr,sr)|0,ee=Math.imul(Mr,qt);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]=sn,fe[4]=mn,fe[5]=Tn,fe[6]=Jn,fe[7]=ma,fe[8]=da,fe[9]=_a,fe[10]=Ca,fe[11]=Hn,fe[12]=pi,fe[13]=Mi,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,lt,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=lt,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);ie max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),f=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(c){return n(c,i,a,null,f)},t.createPickShader=function(c){return n(c,i,s,null,f)}}),7352:(function(e,t,r){var o=r(5721),n=r(4750),i=r(2690);e.exports=a;function a(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var c=s[0].length;return c===0?[]:c===1?o(s):c===2?n(s):i(s,c)}}),7399:(function(e){e.exports=t;function t(r,o){var n=o[0],i=o[1],a=o[2],s=o[3],f=n+n,c=i+i,p=a+a,v=n*f,T=i*f,l=i*c,g=a*f,x=a*c,A=a*p,M=s*f,_=s*c,w=s*p;return r[0]=1-l-A,r[1]=T+w,r[2]=g-_,r[3]=0,r[4]=T-w,r[5]=1-v-A,r[6]=x+M,r[7]=0,r[8]=g+_,r[9]=x-M,r[10]=1-v-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7417:(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}}),7442:(function(e,t,r){var o=r(6658),n=r(7182),i=r(2652),a=r(9921),s=r(8648),f=T(),c=T(),p=T();e.exports=v;function v(x,A,M,_){if(a(A)===0||a(M)===0)return!1;var w=i(A,f.translate,f.scale,f.skew,f.perspective,f.quaternion),m=i(M,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!w||!m?!1:(o(p.translate,f.translate,c.translate,_),o(p.skew,f.skew,c.skew,_),o(p.scale,f.scale,c.scale,_),o(p.perspective,f.perspective,c.perspective,_),s(p.quaternion,f.quaternion,c.quaternion,_),n(x,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:g(),quaternion:g()}}function l(x){return[x||0,x||0,x||0]}function g(){return[0,0,0,1]}}),7507:(function(e,t){t.byteLength=c,t.toByteArray=v,t.fromByteArray=g;for(var r=[],o=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)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,lt,dt,nt,Ft,Nt,Qt,ar,Er=d,Mr=T(Er),$r=T(Er);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&&(lt=lt.replace(ze(),"?px "),de*=Math.pow(.75,Nt-Ft),lt=lt.replace("?px ",ze())),ie+=.25*V*(Nt-Ft)}if(U.superscripts===!0){var Qt=pe.indexOf(g),ar=Ne.indexOf(g),Er=Qt>-1?parseInt(pe[1+Qt]):0,Mr=ar>-1?parseInt(Ne[1+ar]):0;Er!==Mr&&(lt=lt.replace(ze(),"?px "),de*=Math.pow(.75,Mr-Er),lt=lt.replace("?px ",ze())),ie-=.25*V*(Mr-Er)}if(U.bolds===!0){var $r=pe.indexOf(p)>-1,Sr=Ne.indexOf(p)>-1;!$r&&Sr&&(Nr?lt=lt.replace("italic ","italic bold "):lt="bold "+lt),$r&&!Sr&&(lt=lt.replace("bold ",""))}if(U.italics===!0){var Nr=pe.indexOf(T)>-1,Mt=Ne.indexOf(T)>-1;!Nr&&Mt&&(lt="italic "+lt),Nr&&!Mt&&(lt=lt.replace("italic ",""))}F.font=lt}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 lt=o.create();return o.lerp(lt,pe,Ne,ne),lt},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 lt=M(Fe,Le,Se,U(L,pe)),dt=M(Fe,Le,Se,U(z,Ne));if(Math.abs(lt[1])>Math.abs(dt[1])){var nt=lt;lt=dt,dt=nt,nt=pe,pe=Ne,Ne=nt;var Ft=Pe;Pe=Ae,Ae=Ft}lt[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 Nr=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],Wn=Ft.cells||[],Vn=Ft.positions||[],dt=0;dt=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 lt=this._pickResult.level,dt=0;dt<3;++dt)if(lt[dt]=x.le(this.contourLevels[dt],Ye[dt]),lt[dt]<0)this.contourLevels[dt].length>0&&(lt[dt]=0);else if(lt[dt]Math.abs(Ft-Ye[dt])&&(lt[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 da=0;da<5;++da)mr.pop();ke-=1}continue e}}}Wn.push(ke)}this._contourOffsets[vr]=kn,this._contourCounts[vr]=Wn}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})()}}),pC=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]}}}),kR=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"(K,G){var h=pC();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}}}}),CR=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"(K,G){var h=kR();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}}}),$A=Ge({"node_modules/clamp/index.js"(K,G){G.exports=h;function h(b,S,E){return SE?E:b:bS?S:b}}}),xE=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}}}}),z_=Ge({"node_modules/color-normalize/index.js"(K,G){var h=CR(),b=$A(),S=xE();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=z_();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=Si(),b=Is(),S=z_(),E=Ec(),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}}),gC=Ge({"src/traces/scatter3d/attributes.js"(K,G){var h=Gc(),b=Ns(),S=zu(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Gl(),n=mC(),i=bE(),a=Ki().extendFlat,s=Hc().overrideAll,f=zp(),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"}}),RR=Ge({"src/traces/scatter3d/defaults.js"(K,G){var h=Ro(),b=_n(),S=uu(),E=Kd(),e=Vp(),t=op(),r=gC();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}}}),IR=Ge({"src/traces/scatter3d/calc.js"(K,G){var h=f0(),b=sp();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),b(E,e),t}}}),DR=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)}}}),NR=Ge({"src/plots/gl3d/scene.js"(K,G){var h=hv().gl_plot3d,b=h.createCamera,S=h.createScene,E=zR(),e=Ww(),t=Ro(),r=_n(),o=r.preserveDrawingBuffer(),n=Ts(),i=Yf(),a=Gy(),s=yC(),f=cg(),c=OR(),p=FR(),v=BR(),T=Bp().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 lt=B.container.style;lt.position="absolute",lt.left=Ne.l+pe.x[0]*Ne.w+"px",lt.top=Ne.t+(1-pe.y[1])*Ne.h+"px",lt.width=Ne.w*(pe.x[1]-pe.x[0])+"px",lt.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}}),UR=Ge({"src/plots/gl3d/layout/attributes.js"(K,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),_C=Ge({"src/plots/gl3d/layout/axis_attributes.js"(K,G){var h=go(),b=id(),S=Ki().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")}}),xC=Ge({"src/plots/gl3d/layout/layout_attributes.js"(K,G){var h=_C(),b=kc().attributes,S=Ki().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"}}}),jR=Ge({"src/plots/gl3d/layout/axis_defaults.js"(K,G){var h=Is().mix,b=_n(),S=_u(),E=_C(),e=Ud(),t=Gp(),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"))}}}),O_=Ge({"src/plots/gl3d/index.js"(K){var G=Hc().overrideAll,h=tc(),b=NR(),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=UR(),K.layoutAttributes=xC(),K.baseLayoutAttrOverrides=G({hoverlabel:h.hoverlabel},"plot","nested"),K.supplyLayoutDefaults=qR(),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}}}),TE=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&&(Wn.push(aa.id),Ct==="x"?Vn.push([aa.distRatio,0,0]):Ct==="y"?Vn.push([0,aa.distRatio,0]):Vn.push([0,0,aa.distRatio]))}else Ct==="x"?kn=$r(1,u-1):Ct==="y"?kn=$r(1,d-1):kn=$r(1,y-1);Wn.length>0&&(Ct==="x"?Ot[xr]=ar(Mt,Wn,mr,vr,Vn,Ot[xr]):Ct==="y"?Ot[xr]=Er(Mt,Wn,mr,vr,Vn,Ot[xr]):Ot[xr]=Mr(Mt,Wn,mr,vr,Vn,Ot[xr]),xr++),kn.length>0&&(Ct==="x"?Ot[xr]=lt(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]=lt(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 Nr(),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}}}),WR=Ge({"src/traces/isosurface/index.js"(K,G){G.exports={attributes:wE(),supplyDefaults:wC().supplyDefaults,calc:TC(),colorbar:{min:"cmin",max:"cmax"},plot:AE().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),$R=Ge({"lib/isosurface.js"(K,G){G.exports=WR()}}),AC=Ge({"src/traces/volume/attributes.js"(K,G){var h=zu(),b=wE(),S=KA(),E=Gl(),e=Ki().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"}}),KR=Ge({"src/traces/volume/defaults.js"(K,G){var h=_n(),b=AC(),S=wC().supplyIsoDefaults,E=bC().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)}}}),JR=Ge({"src/traces/volume/convert.js"(K,G){var h=hv().gl_mesh3d,b=Xy().parseColorScale,S=_n().isArrayOrTypedArray,E=Gy(),e=Ec().extractOpts,t=q3(),r=AE().findNearestOnAxis,o=AE().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}}),QR=Ge({"src/traces/volume/index.js"(K,G){G.exports={attributes:AC(),supplyDefaults:KR(),calc:TC(),colorbar:{min:"cmin",max:"cmax"},plot:JR(),moduleType:"trace",name:"volume",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),eI=Ge({"lib/volume.js"(K,G){G.exports=QR()}}),tI=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}}}),rI=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"})}}}),nI=Ge({"src/traces/mesh3d/convert.js"(K,G){var h=hv().gl_mesh3d,b=hv().delaunay_triangulate,S=hv().alpha_shape,E=hv().convex_hull,e=Xy().parseColorScale,t=_n().isArrayOrTypedArray,r=Gy(),o=Ec().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}}),aI=Ge({"src/traces/mesh3d/index.js"(K,G){G.exports={attributes:j3(),supplyDefaults:tI(),calc:rI(),colorbar:{min:"cmin",max:"cmax"},plot:nI(),moduleType:"trace",name:"mesh3d",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),iI=Ge({"lib/mesh3d.js"(K,G){G.exports=aI()}}),SC=Ge({"src/traces/cone/attributes.js"(K,G){var h=zu(),b=pc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=j3(),t=Gl(),r=Ki().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}}),oI=Ge({"src/traces/cone/defaults.js"(K,G){var h=_n(),b=yh(),S=SC();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}}}),sI=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}}),kE=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=EE();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}}),_I=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=EE(),h=kE();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}}),xI=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=kE();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")}}}),wI=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}}}),TI=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:fr<0?-1:0},m=Math.sqrt,u=Math.tan;function d(fr){return fr>1?0:fr<-1?n:Math.acos(fr)}function y(fr){return fr>1?i:fr<-1?-i:Math.asin(fr)}function I(fr){return(fr=_(fr/2))*fr}function L(){}function z(fr,Rr){fr&&N.hasOwnProperty(fr.type)&&N[fr.type](fr,Rr)}var F={Feature:function(fr,Rr){z(fr.geometry,Rr)},FeatureCollection:function(fr,Rr){for(var vn=fr.features,an=-1,On=vn.length;++an=0?1:-1,On=an*vn,Aa=l(Rr),xa=_(Rr),ti=V*xa,ci=ce*Aa+ti*l(On),Ni=ti*an*_(On);j.add(T(Ni,ci)),le=fr,ce=Aa,V=xa}function H(fr){return Z.reset(),U(fr,ee),Z*2}function ae(fr){return[T(fr[1],fr[0]),y(fr[2])]}function ie(fr){var Rr=fr[0],vn=fr[1],an=l(vn);return[an*l(Rr),an*_(Rr),_(vn)]}function de(fr,Rr){return fr[0]*Rr[0]+fr[1]*Rr[1]+fr[2]*Rr[2]}function Se(fr,Rr){return[fr[1]*Rr[2]-fr[2]*Rr[1],fr[2]*Rr[0]-fr[0]*Rr[2],fr[0]*Rr[1]-fr[1]*Rr[0]]}function Le(fr,Rr){fr[0]+=Rr[0],fr[1]+=Rr[1],fr[2]+=Rr[2]}function Fe(fr,Rr){return[fr[0]*Rr,fr[1]*Rr,fr[2]*Rr]}function ze(fr){var Rr=m(fr[0]*fr[0]+fr[1]*fr[1]+fr[2]*fr[2]);fr[0]/=Rr,fr[1]/=Rr,fr[2]/=Rr}var Ye,st,ct,at,et,Pe,Ae,pe,Ne=S(),lt,dt,nt={point:Ft,lineStart:Qt,lineEnd:ar,polygonStart:function(){nt.point=Er,nt.lineStart=Mr,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(fr,Rr){lt.push(dt=[Ye=fr,ct=fr]),Rrat&&(at=Rr)}function Nt(fr,Rr){var vn=ie([fr*c,Rr*c]);if(pe){var an=Se(pe,vn),On=[an[1],-an[0],0],Aa=Se(On,an);ze(Aa),Aa=ae(Aa);var xa=fr-et,ti=xa>0?1:-1,ci=Aa[0]*f*ti,Ni,Ha=p(xa)>180;Ha^(ti*etat&&(at=Ni)):(ci=(ci+360)%360-180,Ha^(ti*etat&&(at=Rr))),Ha?frSr(Ye,ct)&&(ct=fr):Sr(fr,ct)>Sr(Ye,ct)&&(Ye=fr):ct>=Ye?(frct&&(ct=fr)):fr>et?Sr(Ye,fr)>Sr(Ye,ct)&&(ct=fr):Sr(fr,ct)>Sr(Ye,ct)&&(Ye=fr)}else lt.push(dt=[Ye=fr,ct=fr]);Rrat&&(at=Rr),pe=vn,et=fr}function Qt(){nt.point=Nt}function ar(){dt[0]=Ye,dt[1]=ct,nt.point=Ft,pe=null}function Er(fr,Rr){if(pe){var vn=fr-et;Ne.add(p(vn)>180?vn+(vn>0?360:-360):vn)}else Pe=fr,Ae=Rr;ee.point(fr,Rr),Nt(fr,Rr)}function Mr(){ee.lineStart()}function $r(){Er(Pe,Ae),ee.lineEnd(),p(Ne)>r&&(Ye=-(ct=180)),dt[0]=Ye,dt[1]=ct,pe=null}function Sr(fr,Rr){return(Rr-=fr)<0?Rr+360:Rr}function Nr(fr,Rr){return fr[0]-Rr[0]}function Mt(fr,Rr){return fr[0]<=fr[1]?fr[0]<=Rr&&Rr<=fr[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,vn=Aa.length-1,Rr=0,an=Aa[vn];Rr<=vn;an=On,++Rr)On=Aa[Rr],(ti=Sr(an[1],On[0]))>xa&&(xa=ti,Ye=On[0],ct=an[1])}return lt=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,Br,kn,Wn={sphere:L,point:Vn,lineStart:aa,lineEnd:Va,polygonStart:function(){Wn.lineStart=sr,Wn.lineEnd=qt},polygonEnd:function(){Wn.lineStart=aa,Wn.lineEnd=Va}};function Vn(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr);na(vn*l(fr),vn*_(fr),_(Rr))}function na(fr,Rr,vn){++Je,xe+=(fr-xe)/Je,ye+=(Rr-ye)/Je,Ee+=(vn-Ee)/Je}function aa(){Wn.point=Un}function Un(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr);vr=vn*l(fr),Br=vn*_(fr),kn=_(Rr),Wn.point=ka,na(vr,Br,kn)}function ka(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr),an=vn*l(fr),On=vn*_(fr),Aa=_(Rr),xa=T(m((xa=Br*Aa-kn*On)*xa+(xa=kn*an-vr*Aa)*xa+(xa=vr*On-Br*an)*xa),vr*an+Br*On+kn*Aa);ke+=xa,Xe+=xa*(vr+(vr=an)),Qe+=xa*(Br+(Br=On)),Lt+=xa*(kn+(kn=Aa)),na(vr,Br,kn)}function Va(){Wn.point=Vn}function sr(){Wn.point=or}function qt(){ur(xr,mr),Wn.point=Vn}function or(fr,Rr){xr=fr,mr=Rr,fr*=c,Rr*=c,Wn.point=ur;var vn=l(Rr);vr=vn*l(fr),Br=vn*_(fr),kn=_(Rr),na(vr,Br,kn)}function ur(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr),an=vn*l(fr),On=vn*_(fr),Aa=_(Rr),xa=Br*Aa-kn*On,ti=kn*an-vr*Aa,ci=vr*On-Br*an,Ni=m(xa*xa+ti*ti+ci*ci),Ha=y(Ni),bi=Ni&&-Ha/Ni;Ct+=bi*xa,Ot+=bi*ti,Kt+=bi*ci,ke+=Ha,Xe+=Ha*(vr+(vr=an)),Qe+=Ha*(Br+(Br=On)),Lt+=Ha*(kn+(kn=Aa)),na(vr,Br,kn)}function Gr(fr){Je=ke=xe=ye=Ee=Xe=Qe=Lt=Ct=Ot=Kt=0,U(fr,Wn);var Rr=Ct,vn=Ot,an=Kt,On=Rr*Rr+vn*vn+an*an;return Onn?fr+Math.round(-fr/s)*s:fr,Rr]}Tn.invert=Tn;function Jn(fr,Rr,vn){return(fr%=s)?Rr||vn?mn(da(fr),_a(Rr,vn)):da(fr):Rr||vn?_a(Rr,vn):Tn}function ma(fr){return function(Rr,vn){return Rr+=fr,[Rr>n?Rr-s:Rr<-n?Rr+s:Rr,vn]}}function da(fr){var Rr=ma(fr);return Rr.invert=ma(-fr),Rr}function _a(fr,Rr){var vn=l(fr),an=_(fr),On=l(Rr),Aa=_(Rr);function xa(ti,ci){var Ni=l(ci),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(ci),Na=Qa*vn+Ha*an;return[T(bi*On-Na*Aa,Ha*vn-Qa*an),y(Na*On+bi*Aa)]}return xa.invert=function(ti,ci){var Ni=l(ci),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(ci),Na=Qa*On-bi*Aa;return[T(bi*On+Qa*Aa,Ha*vn+Na*an),y(Na*vn-Ha*an)]},xa}function Ca(fr){fr=Jn(fr[0]*c,fr[1]*c,fr.length>2?fr[2]*c:0);function Rr(vn){return vn=fr(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn}return Rr.invert=function(vn){return vn=fr.invert(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn},Rr}function Hn(fr,Rr,vn,an,On,Aa){if(vn){var xa=l(Rr),ti=_(Rr),ci=an*vn;On==null?(On=Rr+an*s,Aa=Rr-ci/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&&fr.push(fr.pop().concat(fr.shift()))},result:function(){var vn=fr;return fr=[],Rr=null,vn}}}function xt(fr,Rr){return p(fr[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(fr){if(Rr=fr.length){for(var Rr,vn=0,an=fr[0],On;++vn=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>=vn^Zi>=vn){var Cu=Se(ie(Qa),ie(jo));ze(Cu);var Mu=Se(Aa,Cu);ze(Mu);var Vl=(Wl^Al>=0?-1:1)*y(Mu[2]);(an>Vl||an===Vl&&(Cu[0]||Cu[1]))&&(ti+=Wl^Al>=0?1:-1)}}return(xa<-r||xa0){for(ci||(On.polygonStart(),ci=!0),On.lineStart(),Bs=0;Bs1&&Li&2&&ns.push(ns.pop().concat(ns.shift())),Ha.push(ns.filter(At))}}return Qa}}function At(fr){return fr.length>1}function lr(fr,Rr){return((fr=fr.x)[0]<0?fr[1]-i-r:i-fr[1])-((Rr=Rr.x)[0]<0?Rr[1]-i-r:i-Rr[1])}var zr=Jr(function(){return!0},un,qn,[-n,-i]);function un(fr){var Rr=NaN,vn=NaN,an=NaN,On;return{lineStart:function(){fr.lineStart(),On=1},point:function(Aa,xa){var ti=Aa>0?n:-n,ci=p(Aa-Rr);p(ci-n)0?i:-i),fr.point(an,vn),fr.lineEnd(),fr.lineStart(),fr.point(ti,vn),fr.point(Aa,vn),On=0):an!==ti&&ci>=n&&(p(Rr-an)r?v((_(Rr)*(Aa=l(an))*_(vn)-_(an)*(On=l(Rr))*_(fr))/(On*Aa*xa)):(Rr+an)/2}function qn(fr,Rr,vn,an){var On;if(fr==null)On=vn*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(fr[0]-Rr[0])>r){var Aa=fr[0]0,On=p(Rr)>r;function Aa(Ha,bi,Qa,Na){Hn(Na,fr,vn,Qa,Ha,bi)}function xa(Ha,bi){return l(Ha)*l(bi)>Rr}function ti(Ha){var bi,Qa,Na,Xi,No;return{lineStart:function(){Xi=Na=!1,No=1},point:function(Do,Go){var jo=[Do,Go],Zi,Li=xa(Do,Go),ns=an?Li?0:Ni(Do,Go):Li?Ni(Do+(Do<0?n:-n),Go):0;if(!bi&&(Xi=Na=Li)&&Ha.lineStart(),Li!==Na&&(Zi=ci(bi,jo),(!Zi||xt(bi,Zi)||xt(jo,Zi))&&(jo[2]=1)),Li!==Na)No=0,Li?(Ha.lineStart(),Zi=ci(jo,bi),Ha.point(Zi[0],Zi[1])):(Zi=ci(bi,jo),Ha.point(Zi[0],Zi[1],2),Ha.lineEnd()),bi=Zi;else if(On&&bi&&an^Li){var Bs;!(ns&Qa)&&(Bs=ci(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|(Xi&&Na)<<1}}}function ci(Ha,bi,Qa){var Na=ie(Ha),Xi=ie(bi),No=[1,0,0],Do=Se(Na,Xi),Go=de(Do,Do),jo=Do[0],Zi=Go-jo*jo;if(!Zi)return!Qa&&Ha;var Li=Rr*Go/Zi,ns=-Rr*jo/Zi,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),Vl=Fe(Ml,(-Wl-Mu)/rl);if(Le(Vl,Al),Vl=ae(Vl),!Qa)return Vl;var yo=Ha[0],ys=bi[0],Dl=Ha[1],ml=bi[1],gc;ys0^Vl[1]<(p(Vl[0]-yo)n^(yo<=Vl[0]&&Vl[0]<=ys)){var _c=Fe(Ml,(-Wl+Mu)/rl);return Le(_c,Al),[Vl,ae(_c)]}}}function Ni(Ha,bi){var Qa=an?fr:n-fr,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,-fr]:[-n,fr-n])}function cn(fr,Rr,vn,an,On,Aa){var xa=fr[0],ti=fr[1],ci=Rr[0],Ni=Rr[1],Ha=0,bi=1,Qa=ci-xa,Na=Ni-ti,Xi;if(Xi=vn-xa,!(!Qa&&Xi>0)){if(Xi/=Qa,Qa<0){if(Xi0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}if(Xi=On-xa,!(!Qa&&Xi<0)){if(Xi/=Qa,Qa<0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}else if(Qa>0){if(Xi0)){if(Xi/=Na,Na<0){if(Xi0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}if(Xi=Aa-ti,!(!Na&&Xi<0)){if(Xi/=Na,Na<0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}else if(Na>0){if(Xi0&&(fr[0]=xa+Ha*Qa,fr[1]=ti+Ha*Na),bi<1&&(Rr[0]=xa+bi*Qa,Rr[1]=ti+bi*Na),!0}}}}}var In=1e9,gi=-In;function Ea(fr,Rr,vn,an){function On(Ni,Ha){return fr<=Ni&&Ni<=vn&&Rr<=Ha&&Ha<=an}function Aa(Ni,Ha,bi,Qa){var Na=0,Xi=0;if(Ni==null||(Na=xa(Ni,bi))!==(Xi=xa(Ha,bi))||ci(Ni,Ha)<0^bi>0)do Qa.point(Na===0||Na===3?fr:vn,Na>1?an:Rr);while((Na=(Na+bi+4)%4)!==Xi);else Qa.point(Ha[0],Ha[1])}function xa(Ni,Ha){return p(Ni[0]-fr)0?0:3:p(Ni[0]-vn)0?2:1:p(Ni[1]-Rr)0?1:0:Ha>0?3:2}function ti(Ni,Ha){return ci(Ni.x,Ha.x)}function ci(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,Xi,No,Do,Go,jo,Zi,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,Dl=Na.length;ysan&&(Lf-$f)*(an-_c)>(Lu-_c)*(fr-$f)&&++yo:Lu<=an&&(Lf-$f)*(an-_c)<(Lu-_c)*(fr-$f)&&--yo;return yo}function Wl(){Ha=bi,Qa=[],Na=[],Bs=!0}function rl(){var yo=Ml(),ys=Bs&&yo,Dl=(Qa=b.merge(Qa)).length;(ys||Dl)&&(Ni.polygonStart(),ys&&(Ni.lineStart(),Aa(null,null,1,Ni),Ni.lineEnd()),Dl&&jr(Qa,ti,yo,Aa,Ni),Ni.polygonEnd()),Ha=Ni,Qa=Na=Xi=null}function Cu(){Al.point=Vl,Na&&Na.push(Xi=[]),ns=!0,Li=!1,jo=Zi=NaN}function Mu(){Qa&&(Vl(No,Do),Go&&Li&&bi.rejoin(),Qa.push(bi.result())),Al.point=Zl,Li&&Ha.lineEnd()}function Vl(yo,ys){var Dl=On(yo,ys);if(Na&&Xi.push([yo,ys]),ns)No=yo,Do=ys,Go=Dl,ns=!1,Dl&&(Ha.lineStart(),Ha.point(yo,ys));else if(Dl&&Li)Ha.point(yo,ys);else{var ml=[jo=Math.max(gi,Math.min(In,jo)),Zi=Math.max(gi,Math.min(In,Zi))],gc=[yo=Math.max(gi,Math.min(In,yo)),ys=Math.max(gi,Math.min(In,ys))];cn(ml,gc,fr,Rr,vn,an)?(Li||(Ha.lineStart(),Ha.point(ml[0],ml[1])),Ha.point(gc[0],gc[1]),Dl||Ha.lineEnd(),Bs=!1):Dl&&(Ha.lineStart(),Ha.point(yo,ys),Bs=!1)}jo=yo,Zi=ys,Li=Dl}return Al}}function Ci(){var fr=0,Rr=0,vn=960,an=500,On,Aa,xa;return xa={stream:function(ti){return On&&Aa===ti?On:On=Ea(fr,Rr,vn,an)(Aa=ti)},extent:function(ti){return arguments.length?(fr=+ti[0][0],Rr=+ti[0][1],vn=+ti[1][0],an=+ti[1][1],On=Aa=null,xa):[[fr,Rr],[vn,an]]}}}var Hi=S(),so,io,Mo,fi={sphere:L,point:L,lineStart:ts,lineEnd:L,polygonStart:L,polygonEnd:L};function ts(){fi.point=Xs,fi.lineEnd=Ho}function Ho(){fi.point=fi.lineEnd=L}function Xs(fr,Rr){fr*=c,Rr*=c,so=fr,io=_(Rr),Mo=l(Rr),fi.point=cs}function cs(fr,Rr){fr*=c,Rr*=c;var vn=_(Rr),an=l(Rr),On=p(fr-so),Aa=l(On),xa=_(On),ti=an*xa,ci=Mo*vn-io*an*Aa,Ni=io*vn+Mo*an*Aa;Hi.add(T(m(ti*ti+ci*ci),Ni)),so=fr,io=vn,Mo=an}function Jo(fr){return Hi.reset(),U(fr,fi),+Hi}var Uo=[null,null],Ys={type:"LineString",coordinates:Uo};function Vs(fr,Rr){return Uo[0]=fr,Uo[1]=Rr,Jo(Ys)}var sl={Feature:function(fr,Rr){return Zo(fr.geometry,Rr)},FeatureCollection:function(fr,Rr){for(var vn=fr.features,an=-1,On=vn.length;++an0&&(On=Vs(fr[Aa],fr[Aa-1]),On>0&&vn<=On&&an<=On&&(vn+an-On)*(1-Math.pow((vn-an)/On,2))r}).map(Qa)).concat(b.range(g(Aa/Ni)*Ni,On,Ni).filter(function(Zi){return p(Zi%bi)>r}).map(Na))}return Go.lines=function(){return jo().map(function(Zi){return{type:"LineString",coordinates:Zi}})},Go.outline=function(){return{type:"Polygon",coordinates:[Xi(an).concat(No(xa).slice(1),Xi(vn).reverse().slice(1),No(ti).reverse().slice(1))]}},Go.extent=function(Zi){return arguments.length?Go.extentMajor(Zi).extentMinor(Zi):Go.extentMinor()},Go.extentMajor=function(Zi){return arguments.length?(an=+Zi[0][0],vn=+Zi[1][0],ti=+Zi[0][1],xa=+Zi[1][1],an>vn&&(Zi=an,an=vn,vn=Zi),ti>xa&&(Zi=ti,ti=xa,xa=Zi),Go.precision(Do)):[[an,ti],[vn,xa]]},Go.extentMinor=function(Zi){return arguments.length?(Rr=+Zi[0][0],fr=+Zi[1][0],Aa=+Zi[0][1],On=+Zi[1][1],Rr>fr&&(Zi=Rr,Rr=fr,fr=Zi),Aa>On&&(Zi=Aa,Aa=On,On=Zi),Go.precision(Do)):[[Rr,Aa],[fr,On]]},Go.step=function(Zi){return arguments.length?Go.stepMajor(Zi).stepMinor(Zi):Go.stepMinor()},Go.stepMajor=function(Zi){return arguments.length?(Ha=+Zi[0],bi=+Zi[1],Go):[Ha,bi]},Go.stepMinor=function(Zi){return arguments.length?(ci=+Zi[0],Ni=+Zi[1],Go):[ci,Ni]},Go.precision=function(Zi){return arguments.length?(Do=+Zi,Qa=di(Aa,On,90),Na=to(Rr,fr,Do),Xi=di(ti,xa,90),No=to(an,vn,Do),Go):Do},Go.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ps(){return Cl()()}function Fo(fr,Rr){var vn=fr[0]*c,an=fr[1]*c,On=Rr[0]*c,Aa=Rr[1]*c,xa=l(an),ti=_(an),ci=l(Aa),Ni=_(Aa),Ha=xa*l(vn),bi=xa*_(vn),Qa=ci*l(On),Na=ci*_(On),Xi=2*y(m(I(Aa-an)+xa*ci*I(On-vn))),No=_(Xi),Do=Xi?function(Go){var jo=_(Go*=Xi)/No,Zi=_(Xi-Go)/No,Li=Zi*Ha+jo*Qa,ns=Zi*bi+jo*Na,Bs=Zi*ti+jo*Ni;return[T(ns,Li)*f,T(Bs,m(Li*Li+ns*ns))*f]}:function(){return[vn*f,an*f]};return Do.distance=Xi,Do}function Rl(fr){return fr}var Zs=S(),ul=S(),Au,Ji,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(ul)),ul.reset()},result:function(){var fr=Zs/2;return Zs.reset(),fr}};function Yl(){Xl.point=Io}function Io(fr,Rr){Xl.point=cu,Au=gs=fr,Ji=rs=Rr}function cu(fr,Rr){ul.add(rs*fr-gs*Rr),gs=fr,rs=Rr}function vu(){cu(Au,Ji)}var Os=1/0,wl=Os,Fl=-Os,ql=Fl,Yu={point:df,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var fr=[[Os,wl],[Fl,ql]];return Fl=ql=-(wl=Os=1/0),fr}};function df(fr,Rr){frFl&&(Fl=fr),Rrql&&(ql=Rr)}var Xc=0,rf=0,Dh=0,wh=0,Tl=0,Ic=0,zh=0,oc=0,Zu=0,sc,nf,Jl,Wu,Hs={point:Il,lineStart:Mf,lineEnd:fu,polygonStart:function(){Hs.lineStart=Sd,Hs.lineEnd=Fs},polygonEnd:function(){Hs.point=Il,Hs.lineStart=Mf,Hs.lineEnd=fu},result:function(){var fr=Zu?[zh/Zu,oc/Zu]:Ic?[wh/Ic,Tl/Ic]:Dh?[Xc/Dh,rf/Dh]:[NaN,NaN];return Xc=rf=Dh=wh=Tl=Ic=zh=oc=Zu=0,fr}};function Il(fr,Rr){Xc+=fr,rf+=Rr,++Dh}function Mf(){Hs.point=bc}function bc(fr,Rr){Hs.point=Ff,Il(Jl=fr,Wu=Rr)}function Ff(fr,Rr){var vn=fr-Jl,an=Rr-Wu,On=m(vn*vn+an*an);wh+=On*(Jl+fr)/2,Tl+=On*(Wu+Rr)/2,Ic+=On,Il(Jl=fr,Wu=Rr)}function fu(){Hs.point=Il}function Sd(){Hs.point=Vd}function Fs(){pl(sc,nf)}function Vd(fr,Rr){Hs.point=pl,Il(sc=Jl=fr,nf=Wu=Rr)}function pl(fr,Rr){var vn=fr-Jl,an=Rr-Wu,On=m(vn*vn+an*an);wh+=On*(Jl+fr)/2,Tl+=On*(Wu+Rr)/2,Ic+=On,On=Wu*fr-Jl*Rr,zh+=On*(Jl+fr),oc+=On*(Wu+Rr),Zu+=On*3,Il(Jl=fr,Wu=Rr)}function Oo(fr){this._context=fr}Oo.prototype={_radius:4.5,pointRadius:function(fr){return this._radius=fr,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(fr,Rr){switch(this._point){case 0:{this._context.moveTo(fr,Rr),this._point=1;break}case 1:{this._context.lineTo(fr,Rr);break}default:{this._context.moveTo(fr+this._radius,Rr),this._context.arc(fr,Rr,this._radius,0,s);break}}},result:L};var th=S(),af,Ou,Oh,Bf,uh,$u={point:L,lineStart:function(){$u.point=fd},lineEnd:function(){af&&Hh(Ou,Oh),$u.point=L},polygonStart:function(){af=!0},polygonEnd:function(){af=null},result:function(){var fr=+th;return th.reset(),fr}};function fd(fr,Rr){$u.point=Hh,Ou=Bf=fr,Oh=uh=Rr}function Hh(fr,Rr){Bf-=fr,uh-=Rr,th.add(m(Bf*Bf+uh*uh)),Bf=fr,uh=Rr}function ch(){this._string=[]}ch.prototype={_radius:4.5,_circle:Nf(4.5),pointRadius:function(fr){return(fr=+fr)!==this._radius&&(this._radius=fr,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(fr,Rr){switch(this._point){case 0:{this._string.push("M",fr,",",Rr),this._point=1;break}case 1:{this._string.push("L",fr,",",Rr);break}default:{this._circle==null&&(this._circle=Nf(this._radius)),this._string.push("M",fr,",",Rr,this._circle);break}}},result:function(){if(this._string.length){var fr=this._string.join("");return this._string=[],fr}else return null}};function Nf(fr){return"m0,"+fr+"a"+fr+","+fr+" 0 1,1 0,"+-2*fr+"a"+fr+","+fr+" 0 1,1 0,"+2*fr+"z"}function Fh(fr,Rr){var vn=4.5,an,On;function Aa(xa){return xa&&(typeof vn=="function"&&On.pointRadius(+vn.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($u)),$u.result()},Aa.bounds=function(xa){return U(xa,an(Yu)),Yu.result()},Aa.centroid=function(xa){return U(xa,an(Hs)),Hs.result()},Aa.projection=function(xa){return arguments.length?(an=xa==null?(fr=null,Rl):(fr=xa).stream,Aa):fr},Aa.context=function(xa){return arguments.length?(On=xa==null?(Rr=null,new ch):new Oo(Rr=xa),typeof vn!="function"&&On.pointRadius(vn),Aa):Rr},Aa.pointRadius=function(xa){return arguments.length?(vn=typeof xa=="function"?xa:(On.pointRadius(+xa),+xa),Aa):vn},Aa.projection(fr).context(Rr)}function Bh(fr){return{stream:of(fr)}}function of(fr){return function(Rr){var vn=new Gh;for(var an in fr)vn[an]=fr[an];return vn.stream=Rr,vn}}function Gh(){}Gh.prototype={constructor:Gh,point:function(fr,Rr){this.stream.point(fr,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(fr,Rr,vn){var an=fr.clipExtent&&fr.clipExtent();return fr.scale(150).translate([0,0]),an!=null&&fr.clipExtent(null),U(vn,fr.stream(Yu)),Rr(Yu.result()),an!=null&&fr.clipExtent(an),fr}function vf(fr,Rr,vn){return Ef(fr,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,ci=+Rr[0][1]+(Aa-xa*(an[1][1]+an[0][1]))/2;fr.scale(150*xa).translate([ti,ci])},vn)}function Ku(fr,Rr,vn){return vf(fr,[[0,0],Rr],vn)}function Wf(fr,Rr,vn){return Ef(fr,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];fr.scale(150*Aa).translate([xa,ti])},vn)}function Nh(fr,Rr,vn){return Ef(fr,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;fr.scale(150*Aa).translate([xa,ti])},vn)}var Bl=16,Th=l(30*c);function Md(fr,Rr){return+Rr?fh(fr,Rr):Xh(fr)}function Xh(fr){return of({point:function(Rr,vn){Rr=fr(Rr,vn),this.stream.point(Rr[0],Rr[1])}})}function fh(fr,Rr){function vn(an,On,Aa,xa,ti,ci,Ni,Ha,bi,Qa,Na,Xi,No,Do){var Go=Ni-an,jo=Ha-On,Zi=Go*Go+jo*jo;if(Zi>4*Rr&&No--){var Li=xa+Qa,ns=ti+Na,Bs=ci+Xi,Al=m(Li*Li+ns*ns+Bs*Bs),Zl=y(Bs/=Al),Ml=p(p(Bs)-1)Rr||p((Go*Mu+jo*Vl)/Zi-.5)>.3||xa*Qa+ti*Na+ci*Xi2?yo[2]%360*c:0,Mu()):[ti*f,ci*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),Vl()):m(ns)},rl.fitExtent=function(yo,ys){return vf(rl,yo,ys)},rl.fitSize=function(yo,ys){return Ku(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(vn,0,0,Qa,Na,bi).apply(null,Rr(Aa,xa)),ys=(bi?wu:Zh)(vn,an-yo[0],On-yo[1],Qa,Na,bi);return Ha=Jn(ti,ci,Ni),Al=mn(Rr,ys),Zl=mn(Ha,Al),Bs=Md(Al,ns),Vl()}function Vl(){return Ml=Wl=null,rl}return function(){return Rr=fr.apply(this,arguments),rl.invert=Rr.invert&&Cu,Mu()}}function Ql(fr){var Rr=0,vn=n/3,an=Uf(fr),On=an(Rr,vn);return On.parallels=function(Aa){return arguments.length?an(Rr=Aa[0]*c,vn=Aa[1]*c):[Rr*f,vn*f]},On}function kf(fr){var Rr=l(fr);function vn(an,On){return[an*Rr,_(On)/Rr]}return vn.invert=function(an,On){return[an/Rr,y(On*Rr)]},vn}function mc(fr,Rr){var vn=_(fr),an=(vn+_(Rr))/2;if(p(an)=.12&&Do<.234&&No>=-.425&&No<-.214?On:Do>=.166&&Do<.234&&No>=-.214&&No<-.115?xa:vn).invert(Qa)},Ha.stream=function(Qa){return fr&&Rr===Qa?fr:fr=rh([vn.stream(Rr=Qa),On.stream(Qa),xa.stream(Qa)])},Ha.precision=function(Qa){return arguments.length?(vn.precision(Qa),On.precision(Qa),xa.precision(Qa),bi()):vn.precision()},Ha.scale=function(Qa){return arguments.length?(vn.scale(Qa),On.scale(Qa*.35),xa.scale(Qa),Ha.translate(vn.translate())):vn.scale()},Ha.translate=function(Qa){if(!arguments.length)return vn.translate();var Na=vn.scale(),Xi=+Qa[0],No=+Qa[1];return an=vn.translate(Qa).clipExtent([[Xi-.455*Na,No-.238*Na],[Xi+.455*Na,No+.238*Na]]).stream(Ni),Aa=On.translate([Xi-.307*Na,No+.201*Na]).clipExtent([[Xi-.425*Na+r,No+.12*Na+r],[Xi-.214*Na-r,No+.234*Na-r]]).stream(Ni),ti=xa.translate([Xi-.205*Na,No+.212*Na]).clipExtent([[Xi-.214*Na+r,No+.166*Na+r],[Xi-.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 Ku(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 fr=Rr=null,Ha}return Ha.scale(1070)}function jf(fr){return function(Rr,vn){var an=l(Rr),On=l(vn),Aa=fr(an*On);return[Aa*On*_(Rr),Aa*_(vn)]}}function Ah(fr){return function(Rr,vn){var an=m(Rr*Rr+vn*vn),On=fr(an),Aa=_(On),xa=l(On);return[T(Rr*Aa,an*xa),y(an&&vn*Aa/an)]}}var Ed=jf(function(fr){return m(2/(1+fr))});Ed.invert=Ah(function(fr){return 2*y(fr/2)});function ev(){return zc(Ed).scale(124.75).clipAngle(180-.001)}var nh=jf(function(fr){return(fr=d(fr))&&fr/_(fr)});nh.invert=Ah(function(fr){return fr});function Sh(){return zc(nh).scale(79.4188).clipAngle(180-.001)}function Yc(fr,Rr){return[fr,A(u((i+Rr)/2))]}Yc.invert=function(fr,Rr){return[fr,2*v(x(Rr))-i]};function Mh(){return lc(Yc).scale(961/s)}function lc(fr){var Rr=zc(fr),vn=Rr.center,an=Rr.scale,On=Rr.translate,Aa=Rr.clipExtent,xa=null,ti,ci,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?(vn(bi),Ha()):vn()},Rr.clipExtent=function(bi){return arguments.length?(bi==null?xa=ti=ci=Ni=null:(xa=+bi[0][0],ti=+bi[0][1],ci=+bi[1][0],Ni=+bi[1][1]),Ha()):xa==null?null:[[xa,ti],[ci,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]]:fr===Yc?[[Math.max(Qa[0]-bi,xa),ti],[Math.min(Qa[0]+bi,ci),Ni]]:[[xa,Math.max(Qa[1]-bi,ti)],[ci,Math.min(Qa[1]+bi,Ni)]])}return Ha()}function ah(fr){return u((i+fr)/2)}function Wh(fr,Rr){var vn=l(fr),an=fr===Rr?_(fr):A(vn/l(Rr))/A(ah(Rr)/ah(fr)),On=vn*M(ah(fr),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 ci=On/M(ah(ti),an);return[ci*_(an*xa),On-ci*l(an*xa)]}return Aa.invert=function(xa,ti){var ci=On-ti,Ni=w(an)*m(xa*xa+ci*ci),Ha=T(xa,p(ci))*w(ci);return ci*an<0&&(Ha-=n*w(xa)*w(ci)),[Ha/an,2*v(M(On/Ni,1/an))-i]},Aa}function ih(){return Ql(Wh).scale(109.5).parallels([30,30])}function au(fr,Rr){return[fr,Rr]}au.invert=au;function Fc(){return zc(au).scale(152.63)}function sf(fr,Rr){var vn=l(fr),an=fr===Rr?_(fr):(vn-l(Rr))/(Rr-fr),On=vn/an+fr;if(p(an)r&&--an>0);return[fr/(.8707+(Aa=vn*vn)*(-.131979+Aa*(-.013791+Aa*Aa*Aa*(.003971-.001529*Aa)))),vn]};function gf(){return zc(Cf).scale(175.295)}function Su(fr,Rr){return[l(Rr)*_(fr),_(Rr)]}Su.invert=Ah(y);function wc(){return zc(Su).scale(249.5).clipAngle(90+r)}function pu(fr,Rr){var vn=l(Rr),an=1+l(fr)*vn;return[vn*_(fr)/an,_(Rr)/an]}pu.invert=Ah(function(fr){return 2*v(fr)});function Vf(){return zc(pu).scale(250).clipAngle(142)}function yf(fr,Rr){return[A(u((i+Rr)/2)),-fr]}yf.invert=function(fr,Rr){return[-Rr,2*v(x(fr))-i]};function jh(){var fr=lc(yf),Rr=fr.center,vn=fr.rotate;return fr.center=function(an){return arguments.length?Rr([-an[1],an[0]]):(an=Rr(),[an[1],-an[0]])},fr.rotate=function(an){return arguments.length?vn([an[0],an[1],an.length>2?an[2]+90:90]):(an=vn(),[an[0],an[1],an[2]-90])},vn([0,0,90]).scale(159.155)}h.geoAlbers=hu,h.geoAlbersUsa=pf,h.geoArea=H,h.geoAzimuthalEqualArea=ev,h.geoAzimuthalEqualAreaRaw=Ed,h.geoAzimuthalEquidistant=Sh,h.geoAzimuthalEquidistantRaw=nh,h.geoBounds=je,h.geoCentroid=Gr,h.geoCircle=Mi,h.geoClipAntimeridian=zr,h.geoClipCircle=jn,h.geoClipExtent=Ci,h.geoClipRectangle=Ea,h.geoConicConformal=ih,h.geoConicConformalRaw=Wh,h.geoConicEqualArea=Oc,h.geoConicEqualAreaRaw=mc,h.geoConicEquidistant=Uh,h.geoConicEquidistantRaw=sf,h.geoContains=Ms,h.geoDistance=Vs,h.geoEqualEarth=kd,h.geoEqualEarthRaw=vh,h.geoEquirectangular=Fc,h.geoEquirectangularRaw=au,h.geoGnomonic=$h,h.geoGnomonicRaw=fc,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=wc,h.geoOrthographicRaw=Su,h.geoPath=Fh,h.geoProjection=zc,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})})}}),AI=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,LC(),QA()):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,on=r(Yr),En=v(Yr),Pn=En/on,Xn=-i(E(on));gr-=Pr=(2/Pn*Xn-vt*Pn-Ut)/(-Xn/(En*En)+1-vt/(2*on*on))*(on<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),on=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,Wi=ri*(En*Pn+Ta*Pr*gr*on),To=ri*(.5*Et*Yr-Ta*2*Tr*Ut),ho=ri*.25*(Yr*Ut-Ta*Tr*En*Et),Wo=ri*(on*gr+Ta*Pn*Pr),Js=To*ho-Wo*Wi;if(!Js)break;var Qs=(ni*To-Wa*Wo)/Js,Es=(Wa*ho-ni*Wi)/Js;vt-=Qs,bt-=Es}while((E(Qs)>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,on=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,Wi=ri*En/2,To=-Pn*Ta,ho=tt*ri*Pn/2,Wo=vt*Xn+tt*En*Ta,Js=To*ho-Wo*Wi,Qs=(ni*To-Wa*Wo)/Js/2,Es=(Wa*ho-ni*Wi)/Js;E(Es)>2&&(Es/=2),Pr-=Qs,Yr-=Es}while((E(Qs)>l||E(Es)>l)&&--on>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 on=tt*-180;tt*on<180;on+=tt*90)Pr.point(on,tt*90);if(Ze)for(;tt*(on-=3*tt*Yr)>=-180;)Pr.point(on,tt*-t(r(on*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 on=0,En=360/Ze,Pn=2*x/Ze,Xn=90-180/Ze,Ta=A;on0&&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),Wi=(Wa[0]-on[0])/Ta,To=(Wa[1]-on[1])/Ta,ho=(ni[0]-on[0])/ri,Wo=(ni[1]-on[1])/ri,Js=Wo*Wi-To*ho,Qs=(E(Js)<.5?.5:1)/Js;if(Tr=(Pn*ho-En*Wo)*Qs,Pr=(En*To-Pn*Wi)*Qs,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 lt(){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 Er(){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 Mr=at(1,4/x,x);function $r(){return b.geoProjection(Mr).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 Nr(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=Nr(bt[0].v[0],bt[2].v[0],bt[1].v[0]),Tr=Nr(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 on(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 Wi=Yr.slice();for(Wa=0;Wa<3;++Wa){var To=Wa==2?0:Wa+1,ho=Nr(bt[Wa].v[0],ri[Wa][0],ri[To][0]);ri[Wa][1]<0&&(ho=-ho),Wa?Wa==1?(ho=Tr-ho,Wi[0]-=ri[Wa][0]*r(ho),Wi[1]-=ri[Wa][0]*v(ho)):(ho=Pr-ho,Wi[0]+=ri[Wa][0]*r(ho),Wi[1]+=ri[Wa][0]*v(ho)):(Wi[0]+=ri[Wa][0]*r(ho),Wi[1]-=ri[Wa][0]*v(ho))}return Wi[0]/=3,Wi[1]/=3,Wi}return on}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 Br(Ze,tt){var vt=F(8/(3*x));return[vt*Ze*(1-E(tt)/x),vt*tt]}Br.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(Br).scale(165.664)}function Wn(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)]}Wn.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(Wn).scale(165.664)}function na(Ze,tt){var vt=F(x*(4+x));return[2/vt*Ze*(1+F(1-4*tt*tt/(x*x))),4/vt*tt]}na.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 aa(){return b.geoProjection(na).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 qt(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]}qt.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(qt).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),on=r(gr),En=r(bt),Pn=F(En),Xn=Yr/(on+w*Pr*Pn),Ta=Xn*Xn,ri=F(2/(1+Ta)),Wa=w*on+(Pr+Tr)*Pn,ni=w*on+(Pr-Tr)*Pn,Wi=Wa/ni,To=F(Wi),ho=To-1/To,Wo=To+1/To,Js=ri*ho-2*i(To)-Ze,Qs=ri*Xn*Wo-2*e(Xn)-tt,Es=Yr&&_*Pn*Tr*Ta/Yr,al=(w*Pr*on+Pn)/(2*(on+w*Pr*Pn)*(on+w*Pr*Pn)*Pn),mu=-.5*Xn*ri*ri*ri,iu=mu*Es,ks=mu*al,Cs=(Cs=2*on+w*Pn*(Pr-Tr))*Cs*To,Ru=(w*Pr*on*Pn+En)/Cs,uc=-(w*Tr*Yr)/(Pn*Cs),Nc=ho*iu-2*Ru/To+ri*(Ru+Ru/Wi),ge=ho*ks-2*uc/To+ri*(uc+uc/Wi),Oe=Xn*Wo*iu-2*Es/(1+Ta)+ri*Wo*Es+ri*Xn*(Ru-Ru/Wi),rt=Xn*Wo*ks-2*al/(1+Ta)+ri*Wo*al+ri*Xn*(uc-uc/Wi),wt=ge*Oe-rt*Nc;if(!wt)break;var St=(Qs*ge-Js*rt)/wt,It=(Js*Oe-Qs*Nc)/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 on=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=on;var Wi=50,To;do Tr-=To=(Ze+Cr(Wa,Ta,Tr)*ni-on)/(Wa(Tr)*ni);while(E(To)>l&&--Wi>0);Pr=Xn*v(Tr),Trbt){var Tr=F(gr),Pr=t(Ut,Et),Yr=vt*c(Pr/vt),on=Pr-Yr;Et=Tr*r(on),Ut=Tr*v(on);for(var En=Et-A,Pn=v(Et),Xn=Ut/Pn,Ta=Etl||E(Xn)>l)&&--Ta>0);return[on,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 ln=Vr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return b.geoProjection(ln).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 un(){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 cn(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}cn.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,on=F(Yr),En=Yr*Et,Pn=F(En),Xn=on*gr,Ta,ri;if(Ze===0)return[0,-(Xn+bt*Pn)];var Wa=r(tt),ni=1/Wa,Wi=2*vt*Wa,To=(-3*bt+Tr*Ut)*Wi,ho=(-Pr*Wa-(1-vt)*To)/(Pr*Pr),Wo=.5*ho/on,Js=gr*Wo-2*bt*on*Wi,Qs=bt*Et*ho+Yr*Ut*Wi,Es=-ni*Wi,al=-ni*Qs,mu=-2*ni*Js,iu=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),Nc=Ta*(mu+Es*uc)+al*L(Ta/Pn)-iu;if(!Nc)break;Nc<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+al*L(Ta/Pn)-iu,St=rt+(al-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,on=F(Yr),En=Yr*(1+Ut),Pn=on*(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),Wi=1/ni,To=2*gr*ni,ho=(-3*zt+Tr*(1+3*Ut))*To,Wo=(-Pr*ni-(1-gr)*ho)/(Pr*Pr),Js=.5*Wo/on,Qs=(1-Ut)*Js-2*zt*on*To,Es=-2*Wi*Qs,al=-Wi*To,mu=-Wi*(zt*(1+Ut)*Wo+Yr*(1+3*Ut)*To);return[x/4*(Ze*(Es+al*Ta)+mu*L(Ze/F(En))),Wa]}function Ea(){return b.geoProjection(jn(cn)).scale(239.75)}function Ci(Ze,tt,vt){var bt,zt,Et;return Ze?(bt=Hi(Ze,vt),tt?(zt=Hi(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=Hi(tt,1-vt),[[0,zt[0]/zt[1]],[1/zt[1],0],[zt[2]/zt[1],0]])}function Hi(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=fi(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 fi(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),on=z(tt*Tr+vt*Pr*Yr),En=v(on),Pn=E(En)>l?on/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,on=-Ut*Tr,En=gr*tt,Pn=F(Yr*Yr+on*on-En*En),Xn=t(Yr*En+on*Pn,on*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,on;for(Ut.lineStart();++Yr=0;)Ut.point((on=Tr[Yr])[0],on[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 sl(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,on){var En,Pn=E(on);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,on<0&&(En[1]=-En[1])}else En=Vs(Yr,on);return En[0]*=gr,En[1]/=Tr,En}return Pr.invert=function(Yr,on){Yr/=gr,on*=Tr;var En=E(on);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,on<0&&(Xn[1]=-Xn[1]),Xn}return Vs.invert(Yr,on)},Pr}function fs(Ze,tt){return[Ze,tt&1?90-l:Ys]}function Zo(Ze,tt){return[Ze,tt&1?-90+l:-Ys]}function vo(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(vo):tt]}}function ll(){var Ze=4,tt=b.geoProjectionMutator(sl),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,on){var En=1-v(on),Pn,Xn;if(En&&En<2){var Ta=A-on,ri=25,Wa;do{var ni=v(Ta),Wi=r(Ta),To=bt+t(ni,tt-Wi),ho=1+Tr-2*tt*Wi;Ta-=Wa=(Ta-gr*bt-tt*ni+ho*To-.5*En*Et)/(2*tt*ni*To)}while(E(Wa)>g&&--ri>0);Pn=zt*F(ho),Xn=Yr*To/x}else Pn=zt*(Ze+En),Xn=Yr*bt/x;return[Pn*v(Xn),Ut-Pn*r(Xn)]}return Pr.invert=function(Yr,on){var En=Yr*Yr+(on-=Ut)*on,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 Pl(){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,di=.0528035274542;function to(Ze,tt){return tt>-Ms?(Ze=et(Ze,tt),Ze[1]+=di,Ze):nt(Ze,tt)}to.invert=function(Ze,tt){return tt>-Ms?et.invert(Ze,tt-di):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?di:-di,Ze):nt(Ze,tt)}Ps.invert=function(Ze,tt){return E(tt)>Ms?et.invert(Ze,tt+(tt>0?di:-di)):nt.invert(Ze,tt)};function Fo(){return b.geoProjection(Ps).scale(152.63)}function Rl(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(on){return F(1+Ze*r(2*on)+tt*r(4*on))}function Tr(on){var En=on*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(on){return gr(on)*v(on)}var Yr=function(on,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*on/x*r(Pn),Xn/Et*v(Pn)]};return Yr.invert=function(on,En){var Pn=Fe(Pr,En*Et/zt);return[on*x/(r(Pn)*zt*Et*gr(Pn)),L(vt*Tr(Pn/vt)/Ut)]},vt===0&&(zt=F(bt/x),Yr=function(on,En){return[on*zt,v(En)/zt]},Yr.invert=function(on,En){return[on/zt,L(En*zt)]}),Yr}function Zs(){var Ze=1,tt=0,vt=45*y,bt=2,zt=b.geoProjectionMutator(Rl),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 ul(Ze,tt,vt,bt,zt,Et,Ut,gr,Tr,Pr,Yr){if(Yr.nanEncountered)return NaN;var on,En,Pn,Xn,Ta,ri,Wa,ni,Wi,To;if(on=vt-tt,En=Ze(tt+on*.25),Pn=Ze(vt-on*.25),isNaN(En)){Yr.nanEncountered=!0;return}if(isNaN(Pn)){Yr.nanEncountered=!0;return}return Xn=on*(bt+4*En+zt)/12,Ta=on*(zt+4*Pn+Et)/12,ri=Xn+Ta,To=(ri-Ut)/15,Pr>Tr?(Yr.maxDepthCount++,ri+To):Math.abs(To)>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 on=2*Yr(1)/x*Et/vt,En=function(Pn,Xn){var Ta=Yr(E(v(Xn))),ri=bt(Ta)*Pn;return Ta/=on,[ri,Xn>=0?Ta:-Ta]};return En.invert=function(Pn,Xn){var Ta;return Xn*=on,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(Ji),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,on=tt[+(Pr<0)],En=0,Pn=on.length-1;Enon[En][2][0];++En);var Xn=Ze(Tr-on[En][1][0],Pr);return Xn[0]+=Ze(on[En][1][0],Yr*Pr>Yr*on[En][0][1]?on[En][0][1]:Pr)[0],Xn}vt?Et.invert=vt(Et):Ze.invert&&(Et.invert=function(Tr,Pr){for(var Yr=zt[+(Pr<0)],on=tt[+(Pr<0)],En=0,Pn=Yr.length;EnXn&&(Ta=Pn,Pn=Xn,Xn=Ta),[[on,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 Fl=[[[[-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 ql(){return Io(et,Fl).scale(169.529)}var Yu=[[[[-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,Yu).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 Ic(){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 Zu=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 Wu(){return b.geoProjection(Jl).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 Il(){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],on=Yr[0]+gr*(Pn=on)-Tr*En,En=Yr[1]+gr*En+Tr*Pn;return on=gr*(Pn=on)-Tr*En,En=gr*En+Tr*Pn,[on,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],on=Pr[1],En=0,Pn=0,Xn;--Tr>=0;)Pr=Ze[Tr],En=Yr+Ut*(Xn=En)-gr*Pn,Pn=on+Ut*Pn+gr*Xn,Yr=Pr[0]+Ut*(Xn=Yr)-gr*on,on=Pr[1]+Ut*on+gr*Xn;En=Yr+Ut*(Xn=En)-gr*Pn,Pn=on+Ut*Pn+gr*Xn,Yr=Ut*(Xn=Yr)-gr*on-bt,on=Ut*on+gr*Xn-zt;var Ta=En*En+Pn*Pn,ri,Wa;Ut-=ri=(Yr*En+on*Pn)/Ta,gr-=Wa=(on*En-Yr*Pn)/Ta}while(E(ri)+E(Wa)>l*l&&--Et>0);if(Et){var ni=F(Ut*Ut+gr*gr),Wi=2*e(ni*.5),To=v(Wi);return[t(Ut*To,ni*r(Wi)),ni?L(gr*To/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 $u(Fs,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ou(){return $u(Vd,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Oh(){return $u(pl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Bf(){return $u(Oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function uh(){return $u(th,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function $u(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 Ku(Ze,tt){return[Ze*(1+r(tt))/2,2*(tt-T(tt/2))]}Ku.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(Ku).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 Bl(){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,on=1+Pr/Tr,En=(Et*vt/gr-Et/2)/Yr,Pn=(Pr*vt/Tr+gr/2)/on,Xn=En*En+bt*bt/Yr,Ta=Pn*Pn-(Pr*vt*vt/Tr+gr*vt-1)/on;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,Dc=.02406,Zh=Xh,wu=5*fh,zc=7*Yh,Uf=9*Dc,Ql=1.790857183;function kf(Ze,tt){var vt=tt*tt;return[Ze,tt*(Xh+vt*vt*(fh+vt*(Yh+Dc*vt)))]}kf.invert=function(Ze,tt){tt>Ql?tt=Ql:tt<-Ql&&(tt=-Ql);var vt=tt,bt;do{var zt=vt*vt;vt-=bt=(vt*(Xh+zt*zt*(fh+zt*(Yh+Dc*zt)))-tt)/(Zh+zt*zt*(wu+zt*(zc+Uf*zt)))}while(E(bt)>l);return[Ze,vt]};function mc(){return b.geoProjection(kf).scale(139.319)}function Oc(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 fc(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=[],wc=[],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&&(wc.push(Su),Su=[])},result:function(){var Ze=wc.length?wc.length<2?{type:"LineString",coordinates:wc[0]}:{type:"MultiLineString",coordinates:wc}:null;return wc=[],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);wc.push(Su),Su=[]}},polygonEnd:mf,result:function(){if(!wc.length)return null;var Ze=[],tt=[];return wc.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])}),wc=[],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,on=-Pr*zt+(Et>0?1:-1)*Tr;Et=(-Yr-on)*_,Ut=(Yr-on)*_}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 fr(){return jh(cn).scale(176.423)}function Rr(){return jh(Mo).scale(111.48)}function vn(Ze,tt){if(!(0<=(tt=+tt)&&tt<=20))throw new Error("invalid digits");function vt(Pr){var Yr=Pr.length,on=2,En=new Array(Yr);for(En[0]=+Pr[0].toFixed(tt),En[1]=+Pr[1].toFixed(tt);on2||Pn[0]!=Yr[0]||Pn[1]!=Yr[1])&&(on.push(Pn),Yr=Pn)}return on.length===1&&Pr.length>1&&on.push(vt(Pr[Pr.length-1])),on}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,on=2*(E(vt)-gr)/Pr,En=Yr/Pr,Pn=on*(1-En*on*(1-2*En*on));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 ci(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=ci(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,Xi=Na+bi,No=180,Do=No-bi,Go=-90,jo=Go+bi,Zi=90,Li=Zi-bi;function ns(Ze){return Ze.length>0}function Bs(Ze){return Math.floor(Ze*Qa)/Qa}function Al(Ze){return Ze===Go||Ze===Zi?[0,Ze]:[Na,Bs(Ze)]}function Zl(Ze){var tt=Ze[0],vt=Ze[1],bt=!1;return tt<=Xi?(tt=Na,bt=!0):tt>=Do&&(tt=No,bt=!0),vt<=jo?(vt=Go,bt=!0):vt>=Li&&(vt=Zi,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 on=Ut+1;onXi&&Pnjo&&Xn=gr)break;vt.push({index:-1,polygon:tt,ring:Et=Et.slice(on-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),on=Pr.center;return delete Pr.rotate,Pr.center=function(En){return arguments.length?on(Yr(En)):Yr.invert(on())},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 gc(){return yc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function yc(Ze,tt){return Dl(ml,Ze,tt)}function Tc(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)),on=Tr<0?-1:1;return Pr*=Pr,Yr*=Yr,[(Pr-Yr)/(2*Ze),on*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)),on=r(F(Pr+(En=gr+vt)*En)),En,Pn;return[t(Pn=Yr-on,En=(Yr+on)*zt),(Tr<0?-1:1)*z(F(En*En+Pn*Pn)*Et)]},Ut}function $f(){return _c([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function _c(Ze,tt){return Dl(Tc,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 Bc(){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),on=2*L(Yr/2);return[t(Ut*T(on),Ze*Yr)/zt,Yr&&L(gr*v(on)/(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)),on=Yr/F(Pr*Tr*gr),En=1/(Yr*F(Pr*Tr*gr));return Ue(on,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 Gt(Ze,tt){return[Ze*F(1-3*tt*tt/(x*x)),tt]}Gt.invert=function(Ze,tt){return[Ze/F(1-3*tt*tt/(x*x)),tt]};function hr(){return b.geoProjection(Gt).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 en(Ze,tt){var vt=fe(Ze,tt);return[(vt[0]+Ze/A)/2,(vt[1]+tt)/2]}en.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),on=r(vt/2),En=v(vt/2),Pn=En*En,Xn=1-Pr*on*on,Ta=Xn?z(Et*on)*F(ri=1/Xn):ri=0,ri,Wa=.5*(2*Ta*Et*En+vt/A)-Ze,ni=.5*(Ta*Ut+bt)-tt,Wi=.5*ri*(Pr*Pn+Ta*Et*on*Tr)+.5/A,To=ri*(Yr*gr/4-Ta*Ut*En),ho=.125*ri*(gr*En-Ta*Ut*Pr*Yr),Wo=.5*ri*(Tr*on+Ta*Pn*Et)+.5,Js=To*ho-Wo*Wi,Qs=(ni*To-Wa*Wo)/Js,Es=(Wa*ho-ni*Wi)/Js;vt-=Qs,bt-=Es}while((E(Qs)>l||E(Es)>l)&&--zt>0);return[vt,bt]};function xn(){return b.geoProjection(en).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=lt,h.geoBoggsRaw=Ne,h.geoBonne=Qt,h.geoBonneRaw=Nt,h.geoBottomley=Er,h.geoBottomleyRaw=ar,h.geoBromley=$r,h.geoBromleyRaw=Mr,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=Br,h.geoEckert2=Vn,h.geoEckert2Raw=Wn,h.geoEckert3=aa,h.geoEckert3Raw=na,h.geoEckert4=ka,h.geoEckert4Raw=Un,h.geoEckert5=sr,h.geoEckert5Raw=Va,h.geoEckert6=or,h.geoEckert6Raw=qt,h.geoEisenlohr=sn,h.geoEisenlohrRaw=Gr,h.geoFahey=Jn,h.geoFaheyRaw=Tn,h.geoFoucaut=da,h.geoFoucautRaw=ma,h.geoFoucautSinusoidal=Ca,h.geoFoucautSinusoidalRaw=_a,h.geoGilbert=Mi,h.geoGingery=jr,h.geoGingeryRaw=Dt,h.geoGinzburg4=qr,h.geoGinzburg4Raw=Dr,h.geoGinzburg5=Jr,h.geoGinzburg5Raw=ln,h.geoGinzburg6=lr,h.geoGinzburg6Raw=At,h.geoGinzburg8=un,h.geoGinzburg8Raw=zr,h.geoGinzburg9=qn,h.geoGinzburg9Raw=Rn,h.geoGringorten=Ea,h.geoGringortenRaw=cn,h.geoGuyou=Ho,h.geoGuyouRaw=Mo,h.geoHammer=Le,h.geoHammerRaw=de,h.geoHammerRetroazimuthal=Jo,h.geoHammerRetroazimuthalRaw=Xs,h.geoHealpix=ll,h.geoHealpixRaw=sl,h.geoHill=Pl,h.geoHillRaw=kl,h.geoHomolosine=Fo,h.geoHomolosineRaw=Ps,h.geoHufnagel=Zs,h.geoHufnagelRaw=Rl,h.geoHyperelliptical=gs,h.geoHyperellipticalRaw=Ji,h.geoInterrupt=Io,h.geoInterruptedBoggs=vu,h.geoInterruptedHomolosine=wl,h.geoInterruptedMollweide=ql,h.geoInterruptedMollweideHemispheres=df,h.geoInterruptedSinuMollweide=rf,h.geoInterruptedSinusoidal=wh,h.geoKavrayskiy7=Ic,h.geoKavrayskiy7Raw=Tl,h.geoLagrange=oc,h.geoLagrangeRaw=zh,h.geoLarrivee=nf,h.geoLarriveeRaw=sc,h.geoLaskowski=Wu,h.geoLaskowskiRaw=Jl,h.geoLittrow=Il,h.geoLittrowRaw=Hs,h.geoLoximuthal=bc,h.geoLoximuthalRaw=Mf,h.geoMiller=fu,h.geoMillerRaw=Ff,h.geoModifiedStereographic=$u,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=Ku,h.geoInterruptedQuarticAuthalic=Bl,h.geoNicolosi=Md,h.geoNicolosiRaw=Th,h.geoPatterson=mc,h.geoPattersonRaw=kf,h.geoPolyconic=hu,h.geoPolyconicRaw=Oc,h.geoPolyhedral=nh,h.geoPolyhedralButterfly=au,h.geoPolyhedralCollignon=Uh,h.geoPolyhedralWaterman=su,h.geoProject=fc,h.geoGringortenQuincuncial=fr,h.geoPeirceQuincuncial=Rr,h.geoPierceQuincuncial=Rr,h.geoQuantize=vn,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=Vl,h.geoTimes=ys,h.geoTimesRaw=yo,h.geoTwoPointAzimuthal=yc,h.geoTwoPointAzimuthalRaw=ml,h.geoTwoPointAzimuthalUsa=gc,h.geoTwoPointEquidistant=_c,h.geoTwoPointEquidistantRaw=Tc,h.geoTwoPointEquidistantUsa=$f,h.geoVanDerGrinten=Lu,h.geoVanDerGrintenRaw=Lf,h.geoVanDerGrinten2=Xo,h.geoVanDerGrinten2Raw=Pf,h.geoVanDerGrinten3=Rf,h.geoVanDerGrinten3Raw=as,h.geoVanDerGrinten4=Bc,h.geoVanDerGrinten4Raw=$c,h.geoWagner=oe,h.geoWagner7=Me,h.geoWagnerRaw=P,h.geoWagner4=kt,h.geoWagner4Raw=_t,h.geoWagner6=hr,h.geoWagner6Raw=Gt,h.geoWiechel=Lr,h.geoWiechelRaw=Ar,h.geoWinkel3=xn,h.geoWinkel3Raw=en,Object.defineProperty(h,"__esModule",{value:!0})})}}),SI=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]]]}}}}),PC=Ge({"src/plots/geo/layout_attributes.js"(K,G){var h=Xf(),b=kc().attributes,S=md().dash,E=JA(),e=Hc().overrideAll,t=zp(),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"}}}),EI=Ge({"src/plots/geo/layout_defaults.js"(K,G){var h=_n(),b=q0(),S=Bd().getSubplotData,E=JA(),e=PC(),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))}}}),RC=Ge({"src/plots/geo/index.js"(K,G){var h=Bd().getSubplotCalcData,b=_n().counterRegex,S=MI(),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")}}}}),RE=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}}}),IE=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}}}),II=Ge({"src/traces/scattergl/defaults.js"(K,G){var h=_n(),b=Ro(),S=zE(),E=eS(),e=u0(),t=uu(),r=jp(),o=qp(),n=Kd(),i=Vp(),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)}}}}),zg=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}}}),Kb=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]}}}),zC=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))}}}),qI=Ge({"node_modules/svg-path-bounds/index.js"(K,G){var h=sm(),b=DC(),S=jI(),E=zC(),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}}}),VI=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}}}),Qb=Ge({"src/traces/scattergl/convert.js"(K,G){var h=Si(),b=XI(),S=z_(),E=Ro(),e=_n(),t=e.isArrayOrTypedArray,r=As(),o=Df(),n=Xy().formatColor,i=uu(),a=Fp(),s=zE(),f=N_(),c=kv().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=$d().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}}}),OC=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))),_}}}),FC=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);I 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),le.vert=v([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = (size + borderSize) * pointSizeScale; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); + fragColor = color; + fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; + fragWidth = 1. / gl_PointSize; +} +`]),x&&(le.frag=le.frag.replace("smoothstep","smoothStep"),fe.frag=fe.frag.replace("smoothstep","smoothStep")),this.drawCircle=d(le)}w.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var d=this,y=arguments.length,I=new Array(y),L=0;LAe)?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"}),lt({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=[],lt=0,dt=Math.min(at.length,et.count);lt=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}}}),QI=Ge({"node_modules/array-normalize/index.js"(K,G){var h=Kb();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}}}),XC=Ge({"node_modules/es5-ext/string/#/contains/index.js"(K,G){G.exports=hD()()?String.prototype.contains:dD()}}),Zy=Ge({"node_modules/d/index.js"(K,G){var h=ew(),b=HC(),S=UE(),E=GC(),e=XC(),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}}}),tS=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}}}),rS=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}}}),vD=Ge({"node_modules/ext/global-this/is-implemented.js"(K,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),pD=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__}})()}}),nS=Ge({"node_modules/ext/global-this/index.js"(K,G){G.exports=vD()()?globalThis:pD()}}),mD=Ge({"node_modules/es6-symbol/is-implemented.js"(K,G){var h=nS(),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])}}}),gD=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}}}),YC=Ge({"node_modules/es6-symbol/validate-symbol.js"(K,G){var h=gD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not a symbol");return b}}}),yD=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}}}),_D=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(K,G){var h=Zy(),b=nS().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"))})}}}),xD=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(K,G){var h=Zy(),b=YC(),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})})}}}),bD=Ge({"node_modules/es6-symbol/polyfill.js"(K,G){var h=Zy(),b=YC(),S=nS().Symbol,E=yD(),e=_D(),t=xD(),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]))}}),j_=Ge({"node_modules/es6-symbol/index.js"(K,G){G.exports=mD()()?nS().Symbol:bD()}}),wD=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}}}),TD=Ge({"node_modules/type/string/coerce.js"(K,G){var h=ew(),b=NE(),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}}}}),AD=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}}}}}),SD=Ge({"node_modules/type/lib/to-short-string.js"(K,G){var h=AD(),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)}}}),ZC=Ge({"node_modules/type/lib/resolve-exception.js"(K,G){var h=ew(),b=NE(),S=TD(),E=SD(),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))}}}),MD=Ge({"node_modules/type/value/ensure.js"(K,G){var h=ZC(),b=ew();G.exports=function(S){return b(S)?S:h(S,"Cannot use %v",arguments[1])}}}),ED=Ge({"node_modules/type/plain-function/ensure.js"(K,G){var h=ZC(),b=HC();G.exports=function(S){return b(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),kD=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"))}}}),CD=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))}}}),LD=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}}}),PD=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}}}),RD=Ge({"node_modules/es5-ext/math/sign/index.js"(K,G){G.exports=LD()()?Math.sign:PD()}}),ID=Ge({"node_modules/es5-ext/number/to-integer.js"(K,G){var h=RD(),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)))}}}),DD=Ge({"node_modules/es5-ext/number/to-pos-integer.js"(K,G){var h=ID(),b=Math.max;G.exports=function(S){return b(0,h(S))}}}),zD=Ge({"node_modules/es5-ext/array/from/shim.js"(K,G){var h=j_().iterator,b=tS(),S=CD(),E=DD(),e=G3(),t=Yy(),r=U_(),o=rS(),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}))}}),qD=Ge({"node_modules/es6-iterator/array.js"(K,G){var h=BE(),b=XC(),S=Zy(),E=j_(),e=WC(),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"))}}),VD=Ge({"node_modules/es6-iterator/string.js"(K,G){var h=BE(),b=Zy(),S=j_(),E=WC(),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"))}}),HD=Ge({"node_modules/es6-iterator/is-iterable.js"(K,G){var h=tS(),b=U_(),S=rS(),E=j_().iterator,e=Array.isArray;G.exports=function(t){return b(t)?e(t)||S(t)||h(t)?!0:typeof t[E]=="function":!1}}}),GD=Ge({"node_modules/es6-iterator/valid-iterable.js"(K,G){var h=HD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not iterable");return b}}}),$C=Ge({"node_modules/es6-iterator/get.js"(K,G){var h=tS(),b=rS(),S=qD(),E=VD(),e=GD(),t=j_().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)}}}),XD=Ge({"node_modules/es6-iterator/for-of.js"(K,G){var h=tS(),b=G3(),S=rS(),E=$C(),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()}}}}),YD=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]"})()}}),ZD=Ge({"node_modules/es6-weak-map/polyfill.js"(K,G){var h=U_(),b=BE(),S=nD(),E=Yy(),e=aD(),t=Zy(),r=$C(),o=XD(),n=j_().toStringTag,i=YD(),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"))}}),KC=Ge({"node_modules/es6-weak-map/index.js"(K,G){G.exports=eD()()?WeakMap:ZD()}}),WD=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;t 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`,l=` +precision highp float; + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`;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}}}),$D=Ge({"node_modules/regl-error2d/index.js"(K,G){var h=Kb(),b=z_(),S=NC(),E=zg(),e=Ad(),t=Jb(),{float32:r,fract32:o}=FE();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; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + 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:(d,y)=>[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()}}}}),KD=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):""}}}),QC=Ge({"node_modules/css-global-keywords/index.json"(K,G){G.exports=["inherit","initial","unset"]}}),eL=Ge({"node_modules/css-system-font-keywords/index.json"(K,G){G.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),tL=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"]}}),rL=Ge({"node_modules/css-font-style-keywords/index.json"(K,G){G.exports=["normal","italic","oblique"]}}),nL=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"]}}),JD=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}}),QD=Ge({"node_modules/string-split-by/index.js"(K,G){var h=JD();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 fa=mt.split(".");if(fa.length===1)return['"'+r(mt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Za=!1,Bi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(gn=yr,fa=gn.canvas):("gl"in yr?gn=yr.gl:"canvas"in yr?fa=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(pn=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&&(Bi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?fa=wr:Ln=wr),!gn){if(!fa){var ga=T(Ln||document.body,yi,Da);if(!ga)return null;fa=ga.canvas,Ga=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(fa,pn)}return gn?{gl:gn,canvas:fa,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Bi,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(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var fa=0;fa65535)<<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(gn){var pn=N(gn),za=mt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){mt[B(gn.byteLength)>>2].push(gn)}function Ln(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(yr(pn),0,pn);break;case d:za=new Uint8Array(yr(pn),0,pn);break;case y:za=new Int16Array(yr(2*pn),0,pn);break;case I:za=new Uint16Array(yr(2*pn),0,pn);break;case L:za=new Int32Array(yr(4*pn),0,pn);break;case z:za=new Uint32Array(yr(4*pn),0,pn);break;case F:za=new Float32Array(yr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function fa(gn){wr(gn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:fa}}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,lt=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,Er=36064,Mr=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,fa=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),fa=mt.getParameter(Pe));var gn=!!yr.oes_texture_float;if(gn){var pn=mt.createTexture();mt.bindTexture(pe,pn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,Er,pe,pn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)gn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Mr);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?gn=!1:(mt.deleteFramebuffer(za),mt.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)),Za=!0;if(!Da){var Bi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Bi),mt.texImage2D(lt,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Bi),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:fa,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:gn,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 Nr(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 oa=1,Yn=1;Yn0){if(typeof oa[0]=="number"){var $a=U.allocType(ia.dtype,oa.length);Gr($a,oa),Ua($a,ii),U.freeType($a)}else if(Array.isArray(oa[0])||Sr(oa[0])){Dn=Un(oa);var Oa=aa(oa,Dn,ia.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Nr(oa)){Dn=oa.shape;var Oi=oa.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=Oi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=Oi[0],Ya=Oi[1]);var Ao=Array.isArray(oa.data)?ia.dtype:ur(oa.data),qo=U.allocType(Ao,Lo*_i);sn(qo,oa.data,Lo,_i,ji,Ya,oa.offset),Ua(qo,ii),U.freeType(qo)}return hi}return ta||hi(nn),hi._reglType="buffer",hi._buffer=ia,hi.subdata=Ri,wr.profile&&(hi.stats=ia.stats),hi.destroy=function(){yi(ia)},hi}function ga(){Mt(gn).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(gn).forEach(function(Fn){nn+=gn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof pn?nn._buffer:null},restore:ga,_initBuffer:Bi}}var Tn=0,Jn=0,ma=1,da=1,_a=4,Ca=4,Hn={points:Tn,point:Jn,lines:ma,line:da,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Mi=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,ln=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var fa={},gn=0,pn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(pn.uint32=qr);function za(ga){this.id=gn++,fa[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 nn=Ia.pop();return nn||(nn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(nn,ga,Jr,-1,-1,0,0),nn}function Za(ga){Ia.push(ga)}function Bi(ga,nn,Fn,ta,ya,ia,hi){ga.buffer.bind();var Ua;if(nn){var Ri=hi;!hi&&(!Sr(nn)||Nr(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ga.buffer,nn,Fn,Ri,3)}else mt.bufferData(ln,ia,Fn),ga.buffer.dtype=Ua||Cr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=ia;if(Ua=hi,!hi){switch(ga.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ga.buffer.dtype=Ua}ga.type=Ua;var oa=ya;oa<0&&(oa=ga.buffer.byteLength,Ua===Vr?oa>>=1:Ua===qr&&(oa>>=2)),ga.vertCount=oa;var Yn=ta;if(ta<0){Yn=Dt;var ii=ga.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Mi),ii===3&&(Yn=Dt)}ga.primType=Yn}function yi(ga){Ln.elementsCount--,delete fa[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ga(ga,nn){var Fn=wr.create(null,ln,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(ia){if(!ia)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof ia=="number")Fn(ia),ta.primType=Dt,ta.vertCount=ia|0,ta.type=Cr;else{var hi=null,Ua=At,Ri=-1,oa=-1,Yn=0,ii=0;Array.isArray(ia)||Sr(ia)||Nr(ia)?hi=ia:("data"in ia&&(hi=ia.data),"usage"in ia&&(Ua=na[ia.usage]),"primitive"in ia&&(Ri=Hn[ia.primitive]),"count"in ia&&(oa=ia.count|0),"type"in ia&&(ii=pn[ia.type]),"length"in ia?Yn=ia.length|0:(Yn=oa,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Bi(ta,hi,Ua,Ri,oa,Yn,ii)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ta,ya.subdata=function(ia,hi){return Fn.subdata(ia,hi),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(fa).forEach(yi)}}}var zr=new Float32Array(1),un=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,gn=(Ln<<1>>>24)-127,pn=Ln>>13&1023;if(gn<-24)yr[wr]=fa;else if(gn<-14){var za=-14-gn;yr[wr]=fa+(pn+1024>>za)}else gn>15?yr[wr]=fa+31744:yr[wr]=fa+(gn+15<<10)+pn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var cn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Hi=6406,so=6407,io=6409,Mo=6410,fi=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,sl=35904,fs=35906,Zo=36193,vo=33776,hs=33777,ll=33778,kl=33779,Pl=35986,Ms=35987,di=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Rl=36196,Zs=5121,ul=5123,Au=5125,Ji=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Fl=9984,ql=9985,Yu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Ic=3317,zh=37440,oc=37441,Zu=37443,sc=37444,nf=33984,Jl=[Fl,Yu,ql,df],Wu=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Hi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[sl]=3,Hs[Ci]=Hs[fs]=4;function Il(mt){return"[object "+mt+"]"}var Mf=Il("HTMLCanvasElement"),bc=Il("OffscreenCanvas"),Ff=Il("CanvasRenderingContext2D"),fu=Il("ImageBitmap"),Sd=Il("HTMLImageElement"),Fs=Il("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,bc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Ji]=4,pl[Zo]=2,pl[ul]=2,pl[Au]=4;var Oo=[];Oo[fi]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[vo]=.5,Oo[hs]=.5,Oo[ll]=1,Oo[kl]=1,Oo[Pl]=.5,Oo[Ms]=1,Oo[di]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Rl]=.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)===bc}function uh(mt){return Ou(mt)===Ff}function $u(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)||Nr(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 ul:case Au:case Ji: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?Ji: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,fa,gn){for(var pn=mt.width,za=mt.height,Ia=mt.channels,Da=pn*za*Ia,Za=Bh(mt,Da),Bi=0,yi=0;yi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Ln}function vf(mt,yr,wr,Ln,fa,gn,pn){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":Fl,"linear mipmap nearest":ql,"nearest mipmap linear":Yu,"linear mipmap linear":df},Da),Bi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Hi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:fi,"rgb5 a1":ts,rgb565:Ho},ga={};yr.ext_srgb&&(Ga.srgb=sl,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Ji),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:ul,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":vo,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Pl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":di}),yr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Rl);var nn=Array.prototype.slice.call(mt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[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 ia=[];Object.keys(Da).forEach(function(q){var he=Da[q];ia[he]=q});var hi=[];Object.keys(Za).forEach(function(q){var he=Za[q];hi[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===Hi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===sl||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function oa(){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=Bi[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 ga&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==Wu[q.format]&&(q.format=q.internalformat=Wu[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Zu,q.colorSpace),mt.pixelStorei(Ic,q.unpackAlignment)}function $a(){oa.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=fa.viewportWidth,qe=fa.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(Nr(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,Wt,Vt,Jt,ir;pt.length===3?(Wt=pt[2],ir=$e[2]):(Wt=1,ir=1),it=pt[0],Tt=pt[1],Vt=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=Wt,q.format=q.internalformat=Wu[Wt],q.needsFree=!0,Gh(q,ft,Vt,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($u(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,Yt=q.channels;jn(J[0][0])?Yt=Yt||J[0][0].length:Yt=Yt||1;for(var Ht=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=Fl)}}function Ju(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,tu={},du=wr.maxTextureUnits,fo=Array(du).map(function(){return null});function Qu(q){oa.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,pn.profile&&(this.stats={size:0})}function js(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Ol(){var q=fo[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function hc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),fo[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete tu[q.id],gn.textureCount--}h(Qu.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}fo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Jt)-Wt,ir.height=ir.height||(J.height>>Jt)-Vt,js(J),Lo(ir,In,Wt,Vt,Jt),Ol(),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,js(J);for(var Wt=0;J.mipmask>>Wt;++Wt){var Vt=it>>Wt,Jt=Tt>>Wt;if(!Vt||!Jt)break;mt.texImage2D(In,Wt,J.format,Vt,Jt,0,J.format,J.type,null)}return Ol(),pn.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,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new Qu(gi);tu[pt.id]=pt,gn.cubeCount++;var $e=new Array(6);function it(Vt,Jt,ir,rr,Bt,Yt){var Ht,Or=pt.texInfo;for(gu.call(Or),Ht=0;Ht<6;++Ht)$e[Ht]=Eu();if(typeof Vt=="number"||!Vt){var Wr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo($e[Ht],Wr,Wr)}else if(typeof Vt=="object")if(Jt)Qo($e[0],Vt),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Yt);else if(Fu(Or,Vt),ii(pt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Yn($e[Ht],pt),Qo($e[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo($e[Ht],Vt);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,js(pt),Ht=0;Ht<6;++Ht)cl($e[Ht],Ea+Ht);for(Ju(Or,gi),Ol(),pn.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=ia[Or.magFilter],it.min=hi[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Ht=0;Ht<6;++Ht)tl($e[Ht]);return it}function Tt(Vt,Jt,ir,rr,Bt){var Yt=ir|0,Ht=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)-Yt,Wr.height=Wr.height||(pt.height>>Or)-Ht,js(pt),Lo(Wr,Ea+Vt,Yt,Ht,Or),Ol(),Ya(Wr),it}function Wt(Vt){var Jt=Vt|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,js(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 Ol(),pn.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=Wt,it._reglType="textureCube",it._texture=pt,pn.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);Ju(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(tl)>=0&&(Eu=!1))),("depthTexture"in fo||"depthStencilTexture"in fo)&&(du=!!(fo.depthTexture||fo.depthStencilTexture)),"depth"in fo&&(typeof fo.depth=="boolean"?Qo=fo.depth:(Ju=fo.depth,cl=!1)),"stencil"in fo&&(typeof fo.stencil=="boolean"?cl=fo.stencil:(_f=fo.stencil,Qo=!1)),"depthStencil"in fo&&(typeof fo.depthStencil=="boolean"?Qo=cl=fo.depthStencil:(tu=fo.depthStencil,Qo=!1,cl=!1))}var js=null,Ol=null,hc=null,dc=null;if(Array.isArray(es))js=es.map(Ga);else if(es)js=[Ga(es)];else for(js=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]=oa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=Ao.byteLength?qo.subdata(Ao):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=fa.create(ji,ih,!1,!0)),Ya.buffer=fa.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,Oi[_i]=1}else fa.getBuffer(ji)?(Ya.buffer=fa.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):fa.getBuffer(ji.buffer)?(Ya.buffer=fa.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 ga(){fa={},gn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,fa;++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 wc(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 fr(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 vn(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),fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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 ci(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],fa=[],gn=[];function pn(ga,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ga.push(ya,"="),ga.push.apply(ga,ti(arguments)),ga.push(";")),ya}return h(nn,{def:ta,toString:function(){return ci([Fn.length>0?"var "+Fn.join(",")+";":"",ci(ga)])}})}function Ia(){var ga=za(),nn=za(),Fn=ga.toString,ta=nn.toString;function ya(ia,hi){nn(ia,hi,"=",ga.def(ia,hi),";")}return h(function(){ga.apply(ga,ti(arguments))},{def:ga.def,entry:ga,exit:nn,save:ya,set:function(ia,hi,Ua){ya(ia,hi),ga(ia,hi,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ga=ci(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 ia=ya();return ia&&(ia="else{"+ia+"}"),ci(["if(",ga,"){",ta(),"}",ia])}})}var Za=za(),Bi={};function yi(ga,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},la={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)||Nr(mt)}function sa(mt){return mt.sort(function(yr,wr){return yr===Bc?-1:wr===Bc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var fa=mt.data;return new ai(fa.thisDep,fa.contextDep,fa.propDep,yr)}else{if(wr===Zi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(gn,pn,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,fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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,ia=wr.webgl_draw_buffers,hi=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},oa=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var Wt=Dn($e);oa.push($e),Ri[Wt]=Ua[Wt]=!!Tt,Yn[Wt]=it}function Oa($e,it,Tt){var Wt=Dn($e);oa.push($e),Array.isArray(Tt)?(Ua[Wt]=Tt.slice(),Ri[Wt]=Tt.slice()):Ua[Wt]=Ri[Wt]=Tt,ii[Wt]=it}function Oi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Sn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Vl,Vl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(Dl,Dl,St),Oa(ml,ml,1),$a(gc,Xn),Oa(yc,"polygonOffset",[0,0]),$a(Tc,Ta),$a($f,ri),Oa(_c,"sampleCoverage",[1,!1]),$a(Lf,on),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(Bc,Bc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Bi,elements:gn,buffer:fa,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ta,stencilOps:la,glTypes:kn,orientationType:Sa};ia&&(_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:ga}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var Wt=it(Lo),Vt=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Yt){Vt[Yt]=Tt.def(Wt,".",Yt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Yt){Array.isArray(Ua[Yt])&&(Jt[Yt]=Tt.def(Vt.next,".",Yt),ir[Yt]=Tt.def(Vt.current,".",Yt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Yt){rr[Yt]=Tt.def(JSON.stringify(_i[Yt]))}),$e.invoke=function(Yt,Ht){switch(Ht.type){case Xi:var Or=["this",Vt.context,Vt.props,$e.batchId];return Yt.def(it(Ht.data),".call(",Or.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Yt.def(Vt.props,Ht.data);case Do:return Yt.def(Vt.context,Ht.data);case Go:return Yt.def("this",Ht.data);case jo:return Ht.data.append($e,Yt),Ht.data.ref;case Zi:return Ht.data.toString();case Li:return Ht.data.map(function(Wr){return $e.invoke(Yt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Yt){var Ht=yr.id(Yt);if(Ht in Bt)return Bt[Ht];var Or=Da.scope[Ht];Or||(Or=Da.scope[Ht]=new Fn);var Wr=Bt[Ht]=it(Or);return Wr},$e}function Ao($e){var it=$e.static,Tt=$e.dynamic,Wt;if(Ue in it){var Vt=!!it[Ue];Wt=zi(function(ir,rr){return Vt}),Wt.enable=Vt}else if(Ue in Tt){var Jt=Tt[Ue];Wt=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return Wt}function qo($e,it){var Tt=$e.static,Wt=$e.dynamic;if(P in Tt){var Vt=Tt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(ir,rr){var Bt=ir.link(Vt),Yt=ir.shared;rr.set(Yt.framebuffer,".next",Bt);var Ht=Yt.context;return rr.set(Ht,"."+en,Bt+".width"),rr.set(Ht,"."+xn,Bt+".height"),Bt})):zi(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Yt=Bt.context;return rr.set(Yt,"."+en,Yt+"."+bt),rr.set(Yt,"."+xn,Yt+"."+zt),"null"})}else if(P in Wt){var Jt=Wt[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Yt=ir.shared,Ht=Yt.framebuffer,Or=rr.def(Ht,".getFramebuffer(",Bt,")");rr.set(Ht,".next",Or);var Wr=Yt.context;return rr.set(Wr,"."+en,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var Wt=$e.static,Vt=$e.dynamic;function Jt(Bt){if(Bt in Wt){var Yt=Wt[Bt],Ht=!0,Or=Yt.x|0,Wr=Yt.y|0,fn,ua;return"width"in Yt?fn=Yt.width|0:Ht=!1,"height"in Yt?ua=Yt.height|0:Ht=!1,new ai(!Ht&&it&&it.thisDep,!Ht&&it&&it.contextDep,!Ht&&it&&it.propDep,function(ca,va){var Pa=ca.shared.context,ha=fn;"width"in Yt||(ha=va.def(Pa,".",en,"-",Or));var Fa=ua;return"height"in Yt||(Fa=va.def(Pa,".",xn,"-",Wr)),[Or,Wr,ha,Fa]})}else if(Bt in Vt){var Zn=Vt[Bt],Gn=Vi(Zn,function(ca,va){var Pa=ca.invoke(va,Zn),ha=ca.shared.context,Fa=va.def(Pa,".x|0"),Ka=va.def(Pa,".y|0"),wi=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ha,".",en,"-",Fa,")"),qi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ha,".",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(ca,va){var Pa=ca.shared.context;return[0,0,va.def(Pa,".",en),va.def(Pa,".",xn)]}):null}var ir=Jt(Bc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Yt){var Ht=rr.append(Bt,Yt),Or=Bt.shared.context;return Yt.set(Or,"."+Ze,Ht[2]),Yt.set(Or,"."+tt,Ht[3]),Ht})}return{viewport:ir,scissor_box:Jt($c)}}function cl($e,it){var Tt=$e.static,Wt=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if(Wt){if(Object.keys(it.dynamic).length>0)return null;var Vt=it.static,Jt=Object.keys(Vt);if(Jt.length>0&&typeof Vt[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",ca,"=",ua,".createStream(",Ut,",",Ht,".buffer);","}else{",ca,"=",ua,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Wr.glTypes,"[",Ht,".type]:",ca,".dtype;",Zn.normalized,"=!!",Ht,".normalized;");function Pa(ha){Yt(Zn[ha],"=",Ht,".",ha,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Yt("}}"),Yt.exit("if(",Zn.isStream,"){",ua,".destroyStream(",ca,");","}"),Zn}Vt[Jt]=Vi(ir,rr)}),Vt}function Ju($e){var it=$e.static,Tt=$e.dynamic,Wt={};return Object.keys(it).forEach(function(Vt){var Jt=it[Vt];Wt[Vt]=zi(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Vt){var Jt=Tt[Vt];Wt[Vt]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),Wt}function _f($e,it,Tt,Wt,Vt){$e.static,$e.dynamic;var Jt=cl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Yt=tl($e),Ht=es($e,Vt,Jt);function Or(ca){var va=rr[ca];va&&(Yt[ca]=va)}Or(Bc),Or(Dn($c));var Wr=Object.keys(Yt).length>0,fn={framebuffer:ir,draw:Bt,shader:Ht,state:Yt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Ao($e),fn.uniforms=gu(Tt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var ua=!0,Zn=Ht.program.attributes.map(function(ca){var va=it.static[ca];return ua=ua&&!!va,va});if(ua&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));fn.drawVAO=new ai(null,null,null,function(ca,va){return ca.link(Gn)}),fn.useVAO=!0}}return Jt?fn.useVAO=!0:fn.attributes=Fu(it),fn.context=Ju(Wt),fn}function tu($e,it,Tt){var Wt=$e.shared,Vt=Wt.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Vt,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Vt,".",ir,"=[",Bt.join(),"];"):Jt(Vt,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,Wt){var Vt=$e.shared,Jt=Vt.gl,ir=Vt.framebuffer,rr;ia&&(rr=it.def(Vt.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Yt=Bt.drawBuffer,Ht=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),Wt||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),ia&&it(rr,".drawBuffersWEBGL(",Yt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),ia&&it(rr,".drawBuffersWEBGL(",Ht,");"),it("}",ir,".cur=",Or,";"),Wt||it("}")}function fo($e,it,Tt){var Wt=$e.shared,Vt=Wt.gl,Jt=$e.current,ir=$e.next,rr=Wt.current,Bt=Wt.next,Yt=$e.cond(rr,".dirty");oa.forEach(function(Ht){var Or=Dn(Ht);if(!(Or in Tt.state)){var Wr,fn;if(Or in ir){Wr=ir[Or],fn=Jt[Or];var ua=m(Ua[Or].length,function(Gn){return Yt.def(Wr,"[",Gn,"]")});Yt($e.cond(ua.map(function(Gn,ca){return Gn+"!=="+fn+"["+ca+"]"}).join("||")).then(Vt,".",ii[Or],"(",ua,");",ua.map(function(Gn,ca){return fn+"["+ca+"]="+Gn}).join(";"),";"))}else{Wr=Yt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Yt(Zn),Or in Yn?Zn($e.cond(Wr).then(Vt,".enable(",Yn[Or],");").else(Vt,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Vt,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Yt(rr,".dirty=false;"),it(Yt)}function Qu($e,it,Tt,Wt){var Vt=$e.shared,Jt=$e.current,ir=Vt.current,rr=Vt.gl,Bt;sa(Object.keys(Tt)).forEach(function(Yt){var Ht=Tt[Yt];if(!(Wt&&!Wt(Ht))){var Or=Ht.append($e,it);if(Yn[Yt]){var Wr=Yn[Yt];Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Or,";"))}else if(jn(Or)){var fn=Jt[Yt];it(rr,".",ii[Yt],"(",Or,");",Or.map(function(ua,Zn){return fn+"["+Zn+"]="+ua}).join(";"),";")}else Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Yt],"(",Bt,");",ir,".",Yt,"=",Bt,";")):it(rr,".",ii[Yt],"(",Or,");",ir,".",Yt,"=",Or,";")}})}function js($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Ol($e,it,Tt,Wt,Vt){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Yt=Tt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function fn(Pa){Or=it.def(),Pa(Or,"=",Ht(),";"),typeof Vt=="string"?Pa(ir,".count+=",Vt,";"):Pa(ir,".count++;"),Ga&&(Wt?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function ua(Pa){Pa(ir,".cpuTime+=",Ht(),"-",Or,";"),Ga&&(Wt?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var ha=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",ha,";")}var Gn;if(Yt){if(Yi(Yt)){Yt.enable?(fn(it),ua(it.exit),Zn("true")):Zn("false");return}Gn=Yt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ca=$e.block();fn(ca),it("if(",Gn,"){",ca,"}");var va=$e.block();ua(va),it.exit("if(",Gn,"){",va,"}")}function hc($e,it,Tt,Wt,Vt){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case al:return 2;case Wi:case Js:case mu:return 3;case To:case Qs:case iu:return 4;default:return 1}}function rr(Bt,Yt,Ht){var Or=Jt.gl,Wr=it.def(Bt,".location"),fn=it.def(Jt.attributes,"[",Wr,"]"),ua=Ht.state,Zn=Ht.buffer,Gn=[Ht.x,Ht.y,Ht.z,Ht.w],ca=["buffer","normalized","offset","stride"];function va(){it("if(!",fn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var ha=Ht.type,Fa;if(Ht.size?Fa=it.def(Ht.size,"||",Yt):Fa=Yt,it("if(",fn,".type!==",ha,"||",fn,".size!==",Fa,"||",ca.map(function(wi){return fn+"."+wi+"!=="+Ht[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,ha,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ha,";",fn,".size=",Fa,";",ca.map(function(wi){return fn+"."+wi+"="+Ht[wi]+";"}).join(""),"}"),ya){var Ka=Ht.divisor;it("if(",fn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",fn,".divisor=",Ka,";}")}}function Pa(){it("if(",fn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",fn,".buffer=null;","}if(",Ha.map(function(ha,Fa){return fn+"."+ha+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(ha,Fa){return fn+"."+ha+"="+Gn[Fa]+";"}).join(""),"}")}ua===Qa?va():ua===Na?Pa():(it("if(",ua,"===",Qa,"){"),va(),it("}else{"),Pa(),it("}"))}Wt.forEach(function(Bt){var Yt=Bt.name,Ht=Tt.attributes[Yt],Or;if(Ht){if(!Vt(Ht))return;Or=Ht.append($e,it)}else{if(!Vt(_o))return;var Wr=$e.scopeAttrib(Yt);Or={},Object.keys(new Fn).forEach(function(fn){Or[fn]=it.def(Wr,".",fn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function dc($e,it,Tt,Wt,Vt,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Yt=0;Yt1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,fn,ua,Zn],");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function ha(){function Fa(){Tt(Jt+".drawElements("+[Wr,ua,ca,fn+"<<(("+ca+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,fn,ua]+");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),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){"),ha(),Tt("}")):Pa():ha()}function ds($e,it,Tt,Wt,Vt){var Jt=Ya(),ir=Jt.proc("body",Vt);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,Wt),Jt.compile().body}function _s($e,it,Tt,Wt){js($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);"),hc($e,it,Tt,Wt.attributes,function(){return!0})),dc($e,it,Tt,Wt.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);js($e,Tt),tu($e,Tt,it.context),du($e,Tt,it.framebuffer),fo($e,Tt,it),Qu($e,Tt,it.state),Ol($e,Tt,it,!1,!0);var Wt=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Wt,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Vt=$e.global.def("{}"),Jt=Tt.def(Wt,".id"),ir=Tt.def(Vt,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Vt,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",Wt,");",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,Wt){$e.batchId="a1",js($e,it);function Vt(){return!0}hc($e,it,Tt,Wt.attributes,Vt),dc($e,it,Tt,Wt.uniforms,Vt,!1),Co($e,it,it,Tt)}function he($e,it,Tt,Wt){js($e,it);var Vt=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Yt=$e.scope(),Ht=$e.scope();it(Yt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Ht,"}",Yt.exit);function Or(ca){return ca.contextDep&&Vt||ca.propDep}function Wr(ca){return!Or(ca)}if(Tt.needsContext&&tu($e,Ht,Tt.context),Tt.needsFramebuffer&&du($e,Ht,Tt.framebuffer),Qu($e,Ht,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Ol($e,Ht,Tt,!1,!0),Wt)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Ht($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Ht),");"):Yt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Yt),");"):Yt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Yt($e.shared.vao,".setVAO(null);"),hc($e,Yt,Tt,Wt.attributes,Wr),hc($e,Ht,Tt,Wt.attributes,Or)),dc($e,Yt,Tt,Wt.uniforms,Wr,!1),dc($e,Ht,Tt,Wt.uniforms,Or,!0),Co($e,Yt,Ht,Tt);else{var fn=$e.global.def("{}"),ua=Tt.shader.progVar.append($e,Ht),Zn=Ht.def(ua,".id"),Gn=Ht.def(fn,"[",Zn,"]");Ht($e.shared.gl,".useProgram(",ua,".program);","if(!",Gn,"){",Gn,"=",fn,"[",Zn,"]=",$e.link(function(ca){return ds(q,$e,Tt,ca,2)}),"(",ua,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",js($e,Tt);var Wt=!1,Vt=!0;Object.keys(it.context).forEach(function(fn){Wt=Wt||it.context[fn].propDep}),Wt||(tu($e,Tt,it.context),Vt=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?Wt=ir=!0:Jt.contextDep&&Wt&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&(Wt=!0);function rr(fn){return fn.contextDep&&Wt||fn.propDep}fo($e,Tt,it),Qu($e,Tt,it.state,function(fn){return!rr(fn)}),(!it.profile||!rr(it.profile))&&Ol($e,Tt,it,!1,"a1"),it.contextDep=Wt,it.needsContext=Vt,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&Wt||Bt.propDep)he($e,Tt,it,null);else{var Yt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Yt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Or=Tt.def(Yt,".id"),Wr=Tt.def(Ht,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Ht,"[",Or,"]=",$e.link(function(fn){return ds(he,$e,it,fn,2)}),"(",Yt,");",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 Wt=$e.shared,Vt=Wt.current;if(tu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),sa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Yt=Bt.append($e,Tt);jn(Yt)?Yt.forEach(function(Ht,Or){Oi(Ht)?Tt.set($e.next[rr],"["+Or+"]",Ht):Tt.set($e.next[rr],"["+Or+"]",$e.link(Ht,{stable:!0}))}):Yi(Bt)?Tt.set(Wt.next,"."+rr,$e.link(Yt,{stable:!0})):Tt.set(Wt.next,"."+rr,Yt)}),Ol($e,Tt,it,!0,!0),[Ce,kt,_t,Gt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.draw,"."+rr,Yt):Tt.set(Wt.draw,"."+rr,$e.link(Yt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Yt){return Oi(Yt)?Yt:$e.link(Yt,{stable:!0})})+"]"),Tt.set(Wt.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Yt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Ht){Tt.set(Yt,"."+Ht,Bt[Ht])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);Oi(Jt)?Tt.set(Wt.vao,".targetVAO",Jt):Tt.set(Wt.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.shader,"."+rr,Yt):Tt.set(Wt.shader,"."+rr,$e.link(Yt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Vt,".dirty=true;"),Tt.exit(Vt,".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=Oi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&Oi.length>0&&(Ya=c.next(Ao))}function Qo(){Ya&&(c.cancel(Ao),Ya=null)}function cl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),fa.restore(),Ua.restore(),ta.restore(),Ri.restore(),oa.restore(),Yn.restore(),ia.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,cl,!1),Oa.addEventListener(zl,es,!1));function Eu(){Oi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,cl),Oa.removeEventListener(zl,es)),Ua.clear(),Yn.clear(),oa.clear(),ia.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ds(Vt){var Jt=h({},Vt);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(Yt){Jt[rr+"."+Yt]=Bt[Yt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Vt&&(Jt.vao=Vt.vao),Jt}function _s(Vt,Jt){var ir={},rr={};return Object.keys(Vt).forEach(function(Bt){var Yt=Vt[Bt];if(f.isDynamic(Yt)){rr[Bt]=f.unbox(Yt,Bt);return}else if(Jt&&Array.isArray(Yt)){for(var Ht=0;Ht0)return pt.call(this,Tt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return pt.call(this,Vt,Vt.length)}else return ft.call(this,Vt)}return h(Wt,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=tl({framebuffer:f.define.call(null,Ac,"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|=eu),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Ju(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){Oi.push(Co);function ds(){var _s=Kc(Oi,Co);function be(){var q=Kc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&Qo()}Oi[_s]=be}return qo(),{cancel:ds}}function tu(){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=Qu(),tu(),ii.procs.poll()}function fo(){Ri.refresh(),tu(),ii.procs.refresh(),Da&&Da.update()}function Qu(){return(p()-Za)/1e3}fo();function js(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 Ol(){return za}function hc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var dc=h(tl,{clear:Ju,prop:f.define.bind(null,Ac),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:tl({}),buffer:function(Co){return ta.create(Co,el,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:oa.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:ia.createVAO,attributes:Ln,frame:_f,on:js,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:fo,poll:function(){du(),Da&&Da.update()},now:Qu,stats:pn,getCachedCode:Ol,preloadCachedCode:hc});return yr.onDone(null,dc),dc}return Pu})}}),az=Ge({"node_modules/gl-util/context.js"(K,G){var h=zg();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}}}),iz=Ge({"node_modules/font-atlas/index.js"(K,G){var h=iL(),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}}}),oL=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}}}),oz=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}}),sz=Ge({"node_modules/typedarray-pool/pool.js"(K){var G=oL(),h=oz(),b=_g().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}}}),lz=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({}))}}}),sL=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}}}),uz=Ge({"node_modules/to-px/topx.js"(K,G){var h=sL();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}}}),cz=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)}}}),hz=Ge({"node_modules/gl-text/dist.js"(K,G){var h=rz(),b=zg(),S=nz(),E=az(),e=KC(),t=z_(),r=iz(),o=sz(),n=H3(),i=lz(),a=sL(),s=uz(),f=cz(),c=Ad(),p=fz(),v=Jb(),T=oL(),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; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > halfCharStep + halfCharWidth || + floor(uv.x) < halfCharStep - halfCharWidth) return; + + uv += charId * charStep; + uv = uv / atlasSize; + + vec4 color = fontColor; + vec4 mask = texture2D(atlas, uv); + + float maskY = lightness(mask); + // float colorY = lightness(color); + color.a *= maskY; + color.a *= opacity; + + // color.a += .1; + + // antialiasing, see yiq color space y-channel formula + // color.rgb += (1. - color.rgb) * (1. - mask.rgb); + + gl_FragColor = color; + }`}),d={};return{regl:m,draw:u,atlas:d}},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=v(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 d=!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 lt=pe.style,dt=pe.weight,nt=pe.stretch,Ft=pe.variant;pe=h.parse(h.stringify(pe)),lt&&(pe.style=lt),dt&&(pe.weight=dt),nt&&(pe.stretch=nt),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}),Qt=a(pe.size),ar=Math.round(Qt[0]*s(Qt[1]));if(ar!==u.fontSize[Ne]&&(y=!0,u.fontSize[Ne]=ar),(!u.font[Ne]||Nt!=u.font[Ne].baseString)&&(d=!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]}}),(d||y)&&this.font.forEach(function(pe,Ne){var lt=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[lt],!u.fontAtlas[Ne]){var dt=pe.metrics;u.shader.atlas[lt]=u.fontAtlas[Ne]={fontString:lt,step:Math.ceil(u.fontSize[Ne]*dt.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 lt=="number")return lt;switch(lt){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 lt=(u.font[Ne]||u.font[0]).metrics,dt=0;return dt+=lt.bottom*.5,typeof pe=="number"?dt+=pe-lt.baseline:dt+=-lt[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}}),dz=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 fa=mt.split(".");if(fa.length===1)return['"'+r(mt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Za=!1,Bi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(gn=yr,fa=gn.canvas):("gl"in yr?gn=yr.gl:"canvas"in yr?fa=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(pn=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&&(Bi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?fa=wr:Ln=wr),!gn){if(!fa){var ga=T(Ln||document.body,yi,Da);if(!ga)return null;fa=ga.canvas,Ga=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(fa,pn)}return gn?{gl:gn,canvas:fa,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Bi,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(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var fa=0;fa65535)<<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(gn){var pn=N(gn),za=mt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){mt[B(gn.byteLength)>>2].push(gn)}function Ln(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(yr(pn),0,pn);break;case d:za=new Uint8Array(yr(pn),0,pn);break;case y:za=new Int16Array(yr(2*pn),0,pn);break;case I:za=new Uint16Array(yr(2*pn),0,pn);break;case L:za=new Int32Array(yr(4*pn),0,pn);break;case z:za=new Uint32Array(yr(4*pn),0,pn);break;case F:za=new Float32Array(yr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function fa(gn){wr(gn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:fa}}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,lt=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,Er=36064,Mr=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,fa=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),fa=mt.getParameter(Pe));var gn=!!yr.oes_texture_float;if(gn){var pn=mt.createTexture();mt.bindTexture(pe,pn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,Er,pe,pn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)gn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Mr);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?gn=!1:(mt.deleteFramebuffer(za),mt.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)),Za=!0;if(!Da){var Bi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Bi),mt.texImage2D(lt,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Bi),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:fa,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:gn,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 Nr(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 oa=1,Yn=1;Yn0){if(typeof oa[0]=="number"){var $a=U.allocType(ia.dtype,oa.length);Gr($a,oa),Ua($a,ii),U.freeType($a)}else if(Array.isArray(oa[0])||Sr(oa[0])){Dn=Un(oa);var Oa=aa(oa,Dn,ia.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Nr(oa)){Dn=oa.shape;var Oi=oa.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=Oi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=Oi[0],Ya=Oi[1]);var Ao=Array.isArray(oa.data)?ia.dtype:ur(oa.data),qo=U.allocType(Ao,Lo*_i);sn(qo,oa.data,Lo,_i,ji,Ya,oa.offset),Ua(qo,ii),U.freeType(qo)}return hi}return ta||hi(nn),hi._reglType="buffer",hi._buffer=ia,hi.subdata=Ri,wr.profile&&(hi.stats=ia.stats),hi.destroy=function(){yi(ia)},hi}function ga(){Mt(gn).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(gn).forEach(function(Fn){nn+=gn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof pn?nn._buffer:null},restore:ga,_initBuffer:Bi}}var Tn=0,Jn=0,ma=1,da=1,_a=4,Ca=4,Hn={points:Tn,point:Jn,lines:ma,line:da,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Mi=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,ln=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var fa={},gn=0,pn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(pn.uint32=qr);function za(ga){this.id=gn++,fa[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 nn=Ia.pop();return nn||(nn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(nn,ga,Jr,-1,-1,0,0),nn}function Za(ga){Ia.push(ga)}function Bi(ga,nn,Fn,ta,ya,ia,hi){ga.buffer.bind();var Ua;if(nn){var Ri=hi;!hi&&(!Sr(nn)||Nr(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ga.buffer,nn,Fn,Ri,3)}else mt.bufferData(ln,ia,Fn),ga.buffer.dtype=Ua||Cr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=ia;if(Ua=hi,!hi){switch(ga.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ga.buffer.dtype=Ua}ga.type=Ua;var oa=ya;oa<0&&(oa=ga.buffer.byteLength,Ua===Vr?oa>>=1:Ua===qr&&(oa>>=2)),ga.vertCount=oa;var Yn=ta;if(ta<0){Yn=Dt;var ii=ga.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Mi),ii===3&&(Yn=Dt)}ga.primType=Yn}function yi(ga){Ln.elementsCount--,delete fa[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ga(ga,nn){var Fn=wr.create(null,ln,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(ia){if(!ia)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof ia=="number")Fn(ia),ta.primType=Dt,ta.vertCount=ia|0,ta.type=Cr;else{var hi=null,Ua=At,Ri=-1,oa=-1,Yn=0,ii=0;Array.isArray(ia)||Sr(ia)||Nr(ia)?hi=ia:("data"in ia&&(hi=ia.data),"usage"in ia&&(Ua=na[ia.usage]),"primitive"in ia&&(Ri=Hn[ia.primitive]),"count"in ia&&(oa=ia.count|0),"type"in ia&&(ii=pn[ia.type]),"length"in ia?Yn=ia.length|0:(Yn=oa,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Bi(ta,hi,Ua,Ri,oa,Yn,ii)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ta,ya.subdata=function(ia,hi){return Fn.subdata(ia,hi),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(fa).forEach(yi)}}}var zr=new Float32Array(1),un=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,gn=(Ln<<1>>>24)-127,pn=Ln>>13&1023;if(gn<-24)yr[wr]=fa;else if(gn<-14){var za=-14-gn;yr[wr]=fa+(pn+1024>>za)}else gn>15?yr[wr]=fa+31744:yr[wr]=fa+(gn+15<<10)+pn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var cn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Hi=6406,so=6407,io=6409,Mo=6410,fi=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,sl=35904,fs=35906,Zo=36193,vo=33776,hs=33777,ll=33778,kl=33779,Pl=35986,Ms=35987,di=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Rl=36196,Zs=5121,ul=5123,Au=5125,Ji=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Fl=9984,ql=9985,Yu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Ic=3317,zh=37440,oc=37441,Zu=37443,sc=37444,nf=33984,Jl=[Fl,Yu,ql,df],Wu=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Hi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[sl]=3,Hs[Ci]=Hs[fs]=4;function Il(mt){return"[object "+mt+"]"}var Mf=Il("HTMLCanvasElement"),bc=Il("OffscreenCanvas"),Ff=Il("CanvasRenderingContext2D"),fu=Il("ImageBitmap"),Sd=Il("HTMLImageElement"),Fs=Il("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,bc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Ji]=4,pl[Zo]=2,pl[ul]=2,pl[Au]=4;var Oo=[];Oo[fi]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[vo]=.5,Oo[hs]=.5,Oo[ll]=1,Oo[kl]=1,Oo[Pl]=.5,Oo[Ms]=1,Oo[di]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Rl]=.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)===bc}function uh(mt){return Ou(mt)===Ff}function $u(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)||Nr(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 ul:case Au:case Ji: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?Ji: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,fa,gn){for(var pn=mt.width,za=mt.height,Ia=mt.channels,Da=pn*za*Ia,Za=Bh(mt,Da),Bi=0,yi=0;yi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Ln}function vf(mt,yr,wr,Ln,fa,gn,pn){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":Fl,"linear mipmap nearest":ql,"nearest mipmap linear":Yu,"linear mipmap linear":df},Da),Bi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Hi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:fi,"rgb5 a1":ts,rgb565:Ho},ga={};yr.ext_srgb&&(Ga.srgb=sl,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Ji),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:ul,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":vo,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Pl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":di}),yr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Rl);var nn=Array.prototype.slice.call(mt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[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 ia=[];Object.keys(Da).forEach(function(q){var he=Da[q];ia[he]=q});var hi=[];Object.keys(Za).forEach(function(q){var he=Za[q];hi[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===Hi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===sl||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function oa(){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=Bi[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 ga&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==Wu[q.format]&&(q.format=q.internalformat=Wu[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Zu,q.colorSpace),mt.pixelStorei(Ic,q.unpackAlignment)}function $a(){oa.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=fa.viewportWidth,qe=fa.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(Nr(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,Wt,Vt,Jt,ir;pt.length===3?(Wt=pt[2],ir=$e[2]):(Wt=1,ir=1),it=pt[0],Tt=pt[1],Vt=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=Wt,q.format=q.internalformat=Wu[Wt],q.needsFree=!0,Gh(q,ft,Vt,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($u(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,Yt=q.channels;jn(J[0][0])?Yt=Yt||J[0][0].length:Yt=Yt||1;for(var Ht=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=Fl)}}function Ju(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,tu={},du=wr.maxTextureUnits,fo=Array(du).map(function(){return null});function Qu(q){oa.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,pn.profile&&(this.stats={size:0})}function js(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Ol(){var q=fo[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function hc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),fo[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete tu[q.id],gn.textureCount--}h(Qu.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}fo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Jt)-Wt,ir.height=ir.height||(J.height>>Jt)-Vt,js(J),Lo(ir,In,Wt,Vt,Jt),Ol(),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,js(J);for(var Wt=0;J.mipmask>>Wt;++Wt){var Vt=it>>Wt,Jt=Tt>>Wt;if(!Vt||!Jt)break;mt.texImage2D(In,Wt,J.format,Vt,Jt,0,J.format,J.type,null)}return Ol(),pn.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,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new Qu(gi);tu[pt.id]=pt,gn.cubeCount++;var $e=new Array(6);function it(Vt,Jt,ir,rr,Bt,Yt){var Ht,Or=pt.texInfo;for(gu.call(Or),Ht=0;Ht<6;++Ht)$e[Ht]=Eu();if(typeof Vt=="number"||!Vt){var Wr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo($e[Ht],Wr,Wr)}else if(typeof Vt=="object")if(Jt)Qo($e[0],Vt),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Yt);else if(Fu(Or,Vt),ii(pt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Yn($e[Ht],pt),Qo($e[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo($e[Ht],Vt);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,js(pt),Ht=0;Ht<6;++Ht)cl($e[Ht],Ea+Ht);for(Ju(Or,gi),Ol(),pn.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=ia[Or.magFilter],it.min=hi[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Ht=0;Ht<6;++Ht)tl($e[Ht]);return it}function Tt(Vt,Jt,ir,rr,Bt){var Yt=ir|0,Ht=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)-Yt,Wr.height=Wr.height||(pt.height>>Or)-Ht,js(pt),Lo(Wr,Ea+Vt,Yt,Ht,Or),Ol(),Ya(Wr),it}function Wt(Vt){var Jt=Vt|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,js(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 Ol(),pn.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=Wt,it._reglType="textureCube",it._texture=pt,pn.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);Ju(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(tl)>=0&&(Eu=!1))),("depthTexture"in fo||"depthStencilTexture"in fo)&&(du=!!(fo.depthTexture||fo.depthStencilTexture)),"depth"in fo&&(typeof fo.depth=="boolean"?Qo=fo.depth:(Ju=fo.depth,cl=!1)),"stencil"in fo&&(typeof fo.stencil=="boolean"?cl=fo.stencil:(_f=fo.stencil,Qo=!1)),"depthStencil"in fo&&(typeof fo.depthStencil=="boolean"?Qo=cl=fo.depthStencil:(tu=fo.depthStencil,Qo=!1,cl=!1))}var js=null,Ol=null,hc=null,dc=null;if(Array.isArray(es))js=es.map(Ga);else if(es)js=[Ga(es)];else for(js=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]=oa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=Ao.byteLength?qo.subdata(Ao):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=fa.create(ji,ih,!1,!0)),Ya.buffer=fa.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,Oi[_i]=1}else fa.getBuffer(ji)?(Ya.buffer=fa.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):fa.getBuffer(ji.buffer)?(Ya.buffer=fa.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 ga(){fa={},gn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,fa;++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 wc(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 fr(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 vn(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),fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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 ci(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],fa=[],gn=[];function pn(ga,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ga.push(ya,"="),ga.push.apply(ga,ti(arguments)),ga.push(";")),ya}return h(nn,{def:ta,toString:function(){return ci([Fn.length>0?"var "+Fn.join(",")+";":"",ci(ga)])}})}function Ia(){var ga=za(),nn=za(),Fn=ga.toString,ta=nn.toString;function ya(ia,hi){nn(ia,hi,"=",ga.def(ia,hi),";")}return h(function(){ga.apply(ga,ti(arguments))},{def:ga.def,entry:ga,exit:nn,save:ya,set:function(ia,hi,Ua){ya(ia,hi),ga(ia,hi,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ga=ci(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 ia=ya();return ia&&(ia="else{"+ia+"}"),ci(["if(",ga,"){",ta(),"}",ia])}})}var Za=za(),Bi={};function yi(ga,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},la={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)||Nr(mt)}function sa(mt){return mt.sort(function(yr,wr){return yr===Bc?-1:wr===Bc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var fa=mt.data;return new ai(fa.thisDep,fa.contextDep,fa.propDep,yr)}else{if(wr===Zi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(gn,pn,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,fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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,ia=wr.webgl_draw_buffers,hi=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},oa=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var Wt=Dn($e);oa.push($e),Ri[Wt]=Ua[Wt]=!!Tt,Yn[Wt]=it}function Oa($e,it,Tt){var Wt=Dn($e);oa.push($e),Array.isArray(Tt)?(Ua[Wt]=Tt.slice(),Ri[Wt]=Tt.slice()):Ua[Wt]=Ri[Wt]=Tt,ii[Wt]=it}function Oi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Sn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Vl,Vl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(Dl,Dl,St),Oa(ml,ml,1),$a(gc,Xn),Oa(yc,"polygonOffset",[0,0]),$a(Tc,Ta),$a($f,ri),Oa(_c,"sampleCoverage",[1,!1]),$a(Lf,on),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(Bc,Bc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Bi,elements:gn,buffer:fa,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ta,stencilOps:la,glTypes:kn,orientationType:Sa};ia&&(_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:ga}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var Wt=it(Lo),Vt=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Yt){Vt[Yt]=Tt.def(Wt,".",Yt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Yt){Array.isArray(Ua[Yt])&&(Jt[Yt]=Tt.def(Vt.next,".",Yt),ir[Yt]=Tt.def(Vt.current,".",Yt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Yt){rr[Yt]=Tt.def(JSON.stringify(_i[Yt]))}),$e.invoke=function(Yt,Ht){switch(Ht.type){case Xi:var Or=["this",Vt.context,Vt.props,$e.batchId];return Yt.def(it(Ht.data),".call(",Or.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Yt.def(Vt.props,Ht.data);case Do:return Yt.def(Vt.context,Ht.data);case Go:return Yt.def("this",Ht.data);case jo:return Ht.data.append($e,Yt),Ht.data.ref;case Zi:return Ht.data.toString();case Li:return Ht.data.map(function(Wr){return $e.invoke(Yt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Yt){var Ht=yr.id(Yt);if(Ht in Bt)return Bt[Ht];var Or=Da.scope[Ht];Or||(Or=Da.scope[Ht]=new Fn);var Wr=Bt[Ht]=it(Or);return Wr},$e}function Ao($e){var it=$e.static,Tt=$e.dynamic,Wt;if(Ue in it){var Vt=!!it[Ue];Wt=zi(function(ir,rr){return Vt}),Wt.enable=Vt}else if(Ue in Tt){var Jt=Tt[Ue];Wt=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return Wt}function qo($e,it){var Tt=$e.static,Wt=$e.dynamic;if(P in Tt){var Vt=Tt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(ir,rr){var Bt=ir.link(Vt),Yt=ir.shared;rr.set(Yt.framebuffer,".next",Bt);var Ht=Yt.context;return rr.set(Ht,"."+en,Bt+".width"),rr.set(Ht,"."+xn,Bt+".height"),Bt})):zi(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Yt=Bt.context;return rr.set(Yt,"."+en,Yt+"."+bt),rr.set(Yt,"."+xn,Yt+"."+zt),"null"})}else if(P in Wt){var Jt=Wt[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Yt=ir.shared,Ht=Yt.framebuffer,Or=rr.def(Ht,".getFramebuffer(",Bt,")");rr.set(Ht,".next",Or);var Wr=Yt.context;return rr.set(Wr,"."+en,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var Wt=$e.static,Vt=$e.dynamic;function Jt(Bt){if(Bt in Wt){var Yt=Wt[Bt],Ht=!0,Or=Yt.x|0,Wr=Yt.y|0,fn,ua;return"width"in Yt?fn=Yt.width|0:Ht=!1,"height"in Yt?ua=Yt.height|0:Ht=!1,new ai(!Ht&&it&&it.thisDep,!Ht&&it&&it.contextDep,!Ht&&it&&it.propDep,function(ca,va){var Pa=ca.shared.context,ha=fn;"width"in Yt||(ha=va.def(Pa,".",en,"-",Or));var Fa=ua;return"height"in Yt||(Fa=va.def(Pa,".",xn,"-",Wr)),[Or,Wr,ha,Fa]})}else if(Bt in Vt){var Zn=Vt[Bt],Gn=Vi(Zn,function(ca,va){var Pa=ca.invoke(va,Zn),ha=ca.shared.context,Fa=va.def(Pa,".x|0"),Ka=va.def(Pa,".y|0"),wi=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ha,".",en,"-",Fa,")"),qi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ha,".",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(ca,va){var Pa=ca.shared.context;return[0,0,va.def(Pa,".",en),va.def(Pa,".",xn)]}):null}var ir=Jt(Bc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Yt){var Ht=rr.append(Bt,Yt),Or=Bt.shared.context;return Yt.set(Or,"."+Ze,Ht[2]),Yt.set(Or,"."+tt,Ht[3]),Ht})}return{viewport:ir,scissor_box:Jt($c)}}function cl($e,it){var Tt=$e.static,Wt=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if(Wt){if(Object.keys(it.dynamic).length>0)return null;var Vt=it.static,Jt=Object.keys(Vt);if(Jt.length>0&&typeof Vt[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",ca,"=",ua,".createStream(",Ut,",",Ht,".buffer);","}else{",ca,"=",ua,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Wr.glTypes,"[",Ht,".type]:",ca,".dtype;",Zn.normalized,"=!!",Ht,".normalized;");function Pa(ha){Yt(Zn[ha],"=",Ht,".",ha,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Yt("}}"),Yt.exit("if(",Zn.isStream,"){",ua,".destroyStream(",ca,");","}"),Zn}Vt[Jt]=Vi(ir,rr)}),Vt}function Ju($e){var it=$e.static,Tt=$e.dynamic,Wt={};return Object.keys(it).forEach(function(Vt){var Jt=it[Vt];Wt[Vt]=zi(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Vt){var Jt=Tt[Vt];Wt[Vt]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),Wt}function _f($e,it,Tt,Wt,Vt){$e.static,$e.dynamic;var Jt=cl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Yt=tl($e),Ht=es($e,Vt,Jt);function Or(ca){var va=rr[ca];va&&(Yt[ca]=va)}Or(Bc),Or(Dn($c));var Wr=Object.keys(Yt).length>0,fn={framebuffer:ir,draw:Bt,shader:Ht,state:Yt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Ao($e),fn.uniforms=gu(Tt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var ua=!0,Zn=Ht.program.attributes.map(function(ca){var va=it.static[ca];return ua=ua&&!!va,va});if(ua&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));fn.drawVAO=new ai(null,null,null,function(ca,va){return ca.link(Gn)}),fn.useVAO=!0}}return Jt?fn.useVAO=!0:fn.attributes=Fu(it),fn.context=Ju(Wt),fn}function tu($e,it,Tt){var Wt=$e.shared,Vt=Wt.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Vt,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Vt,".",ir,"=[",Bt.join(),"];"):Jt(Vt,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,Wt){var Vt=$e.shared,Jt=Vt.gl,ir=Vt.framebuffer,rr;ia&&(rr=it.def(Vt.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Yt=Bt.drawBuffer,Ht=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),Wt||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),ia&&it(rr,".drawBuffersWEBGL(",Yt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),ia&&it(rr,".drawBuffersWEBGL(",Ht,");"),it("}",ir,".cur=",Or,";"),Wt||it("}")}function fo($e,it,Tt){var Wt=$e.shared,Vt=Wt.gl,Jt=$e.current,ir=$e.next,rr=Wt.current,Bt=Wt.next,Yt=$e.cond(rr,".dirty");oa.forEach(function(Ht){var Or=Dn(Ht);if(!(Or in Tt.state)){var Wr,fn;if(Or in ir){Wr=ir[Or],fn=Jt[Or];var ua=m(Ua[Or].length,function(Gn){return Yt.def(Wr,"[",Gn,"]")});Yt($e.cond(ua.map(function(Gn,ca){return Gn+"!=="+fn+"["+ca+"]"}).join("||")).then(Vt,".",ii[Or],"(",ua,");",ua.map(function(Gn,ca){return fn+"["+ca+"]="+Gn}).join(";"),";"))}else{Wr=Yt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Yt(Zn),Or in Yn?Zn($e.cond(Wr).then(Vt,".enable(",Yn[Or],");").else(Vt,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Vt,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Yt(rr,".dirty=false;"),it(Yt)}function Qu($e,it,Tt,Wt){var Vt=$e.shared,Jt=$e.current,ir=Vt.current,rr=Vt.gl,Bt;sa(Object.keys(Tt)).forEach(function(Yt){var Ht=Tt[Yt];if(!(Wt&&!Wt(Ht))){var Or=Ht.append($e,it);if(Yn[Yt]){var Wr=Yn[Yt];Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Or,";"))}else if(jn(Or)){var fn=Jt[Yt];it(rr,".",ii[Yt],"(",Or,");",Or.map(function(ua,Zn){return fn+"["+Zn+"]="+ua}).join(";"),";")}else Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Yt],"(",Bt,");",ir,".",Yt,"=",Bt,";")):it(rr,".",ii[Yt],"(",Or,");",ir,".",Yt,"=",Or,";")}})}function js($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Ol($e,it,Tt,Wt,Vt){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Yt=Tt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function fn(Pa){Or=it.def(),Pa(Or,"=",Ht(),";"),typeof Vt=="string"?Pa(ir,".count+=",Vt,";"):Pa(ir,".count++;"),Ga&&(Wt?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function ua(Pa){Pa(ir,".cpuTime+=",Ht(),"-",Or,";"),Ga&&(Wt?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var ha=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",ha,";")}var Gn;if(Yt){if(Yi(Yt)){Yt.enable?(fn(it),ua(it.exit),Zn("true")):Zn("false");return}Gn=Yt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ca=$e.block();fn(ca),it("if(",Gn,"){",ca,"}");var va=$e.block();ua(va),it.exit("if(",Gn,"){",va,"}")}function hc($e,it,Tt,Wt,Vt){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case al:return 2;case Wi:case Js:case mu:return 3;case To:case Qs:case iu:return 4;default:return 1}}function rr(Bt,Yt,Ht){var Or=Jt.gl,Wr=it.def(Bt,".location"),fn=it.def(Jt.attributes,"[",Wr,"]"),ua=Ht.state,Zn=Ht.buffer,Gn=[Ht.x,Ht.y,Ht.z,Ht.w],ca=["buffer","normalized","offset","stride"];function va(){it("if(!",fn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var ha=Ht.type,Fa;if(Ht.size?Fa=it.def(Ht.size,"||",Yt):Fa=Yt,it("if(",fn,".type!==",ha,"||",fn,".size!==",Fa,"||",ca.map(function(wi){return fn+"."+wi+"!=="+Ht[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,ha,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ha,";",fn,".size=",Fa,";",ca.map(function(wi){return fn+"."+wi+"="+Ht[wi]+";"}).join(""),"}"),ya){var Ka=Ht.divisor;it("if(",fn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",fn,".divisor=",Ka,";}")}}function Pa(){it("if(",fn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",fn,".buffer=null;","}if(",Ha.map(function(ha,Fa){return fn+"."+ha+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(ha,Fa){return fn+"."+ha+"="+Gn[Fa]+";"}).join(""),"}")}ua===Qa?va():ua===Na?Pa():(it("if(",ua,"===",Qa,"){"),va(),it("}else{"),Pa(),it("}"))}Wt.forEach(function(Bt){var Yt=Bt.name,Ht=Tt.attributes[Yt],Or;if(Ht){if(!Vt(Ht))return;Or=Ht.append($e,it)}else{if(!Vt(_o))return;var Wr=$e.scopeAttrib(Yt);Or={},Object.keys(new Fn).forEach(function(fn){Or[fn]=it.def(Wr,".",fn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function dc($e,it,Tt,Wt,Vt,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Yt=0;Yt1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,fn,ua,Zn],");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function ha(){function Fa(){Tt(Jt+".drawElements("+[Wr,ua,ca,fn+"<<(("+ca+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,fn,ua]+");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),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){"),ha(),Tt("}")):Pa():ha()}function ds($e,it,Tt,Wt,Vt){var Jt=Ya(),ir=Jt.proc("body",Vt);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,Wt),Jt.compile().body}function _s($e,it,Tt,Wt){js($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);"),hc($e,it,Tt,Wt.attributes,function(){return!0})),dc($e,it,Tt,Wt.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);js($e,Tt),tu($e,Tt,it.context),du($e,Tt,it.framebuffer),fo($e,Tt,it),Qu($e,Tt,it.state),Ol($e,Tt,it,!1,!0);var Wt=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Wt,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Vt=$e.global.def("{}"),Jt=Tt.def(Wt,".id"),ir=Tt.def(Vt,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Vt,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",Wt,");",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,Wt){$e.batchId="a1",js($e,it);function Vt(){return!0}hc($e,it,Tt,Wt.attributes,Vt),dc($e,it,Tt,Wt.uniforms,Vt,!1),Co($e,it,it,Tt)}function he($e,it,Tt,Wt){js($e,it);var Vt=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Yt=$e.scope(),Ht=$e.scope();it(Yt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Ht,"}",Yt.exit);function Or(ca){return ca.contextDep&&Vt||ca.propDep}function Wr(ca){return!Or(ca)}if(Tt.needsContext&&tu($e,Ht,Tt.context),Tt.needsFramebuffer&&du($e,Ht,Tt.framebuffer),Qu($e,Ht,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Ol($e,Ht,Tt,!1,!0),Wt)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Ht($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Ht),");"):Yt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Yt),");"):Yt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Yt($e.shared.vao,".setVAO(null);"),hc($e,Yt,Tt,Wt.attributes,Wr),hc($e,Ht,Tt,Wt.attributes,Or)),dc($e,Yt,Tt,Wt.uniforms,Wr,!1),dc($e,Ht,Tt,Wt.uniforms,Or,!0),Co($e,Yt,Ht,Tt);else{var fn=$e.global.def("{}"),ua=Tt.shader.progVar.append($e,Ht),Zn=Ht.def(ua,".id"),Gn=Ht.def(fn,"[",Zn,"]");Ht($e.shared.gl,".useProgram(",ua,".program);","if(!",Gn,"){",Gn,"=",fn,"[",Zn,"]=",$e.link(function(ca){return ds(q,$e,Tt,ca,2)}),"(",ua,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",js($e,Tt);var Wt=!1,Vt=!0;Object.keys(it.context).forEach(function(fn){Wt=Wt||it.context[fn].propDep}),Wt||(tu($e,Tt,it.context),Vt=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?Wt=ir=!0:Jt.contextDep&&Wt&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&(Wt=!0);function rr(fn){return fn.contextDep&&Wt||fn.propDep}fo($e,Tt,it),Qu($e,Tt,it.state,function(fn){return!rr(fn)}),(!it.profile||!rr(it.profile))&&Ol($e,Tt,it,!1,"a1"),it.contextDep=Wt,it.needsContext=Vt,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&Wt||Bt.propDep)he($e,Tt,it,null);else{var Yt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Yt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Or=Tt.def(Yt,".id"),Wr=Tt.def(Ht,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Ht,"[",Or,"]=",$e.link(function(fn){return ds(he,$e,it,fn,2)}),"(",Yt,");",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 Wt=$e.shared,Vt=Wt.current;if(tu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),sa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Yt=Bt.append($e,Tt);jn(Yt)?Yt.forEach(function(Ht,Or){Oi(Ht)?Tt.set($e.next[rr],"["+Or+"]",Ht):Tt.set($e.next[rr],"["+Or+"]",$e.link(Ht,{stable:!0}))}):Yi(Bt)?Tt.set(Wt.next,"."+rr,$e.link(Yt,{stable:!0})):Tt.set(Wt.next,"."+rr,Yt)}),Ol($e,Tt,it,!0,!0),[Ce,kt,_t,Gt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.draw,"."+rr,Yt):Tt.set(Wt.draw,"."+rr,$e.link(Yt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Yt){return Oi(Yt)?Yt:$e.link(Yt,{stable:!0})})+"]"),Tt.set(Wt.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Yt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Ht){Tt.set(Yt,"."+Ht,Bt[Ht])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);Oi(Jt)?Tt.set(Wt.vao,".targetVAO",Jt):Tt.set(Wt.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.shader,"."+rr,Yt):Tt.set(Wt.shader,"."+rr,$e.link(Yt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Vt,".dirty=true;"),Tt.exit(Vt,".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=Oi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&Oi.length>0&&(Ya=c.next(Ao))}function Qo(){Ya&&(c.cancel(Ao),Ya=null)}function cl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),fa.restore(),Ua.restore(),ta.restore(),Ri.restore(),oa.restore(),Yn.restore(),ia.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,cl,!1),Oa.addEventListener(zl,es,!1));function Eu(){Oi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,cl),Oa.removeEventListener(zl,es)),Ua.clear(),Yn.clear(),oa.clear(),ia.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ds(Vt){var Jt=h({},Vt);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(Yt){Jt[rr+"."+Yt]=Bt[Yt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Vt&&(Jt.vao=Vt.vao),Jt}function _s(Vt,Jt){var ir={},rr={};return Object.keys(Vt).forEach(function(Bt){var Yt=Vt[Bt];if(f.isDynamic(Yt)){rr[Bt]=f.unbox(Yt,Bt);return}else if(Jt&&Array.isArray(Yt)){for(var Ht=0;Ht0)return pt.call(this,Tt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return pt.call(this,Vt,Vt.length)}else return ft.call(this,Vt)}return h(Wt,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=tl({framebuffer:f.define.call(null,Ac,"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|=eu),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Ju(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){Oi.push(Co);function ds(){var _s=Kc(Oi,Co);function be(){var q=Kc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&Qo()}Oi[_s]=be}return qo(),{cancel:ds}}function tu(){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=Qu(),tu(),ii.procs.poll()}function fo(){Ri.refresh(),tu(),ii.procs.refresh(),Da&&Da.update()}function Qu(){return(p()-Za)/1e3}fo();function js(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 Ol(){return za}function hc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var dc=h(tl,{clear:Ju,prop:f.define.bind(null,Ac),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:tl({}),buffer:function(Co){return ta.create(Co,el,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:oa.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:ia.createVAO,attributes:Ln,frame:_f,on:js,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:fo,poll:function(){du(),Da&&Da.update()},now:Qu,stats:pn,getCachedCode:Ol,preloadCachedCode:hc});return yr.onDone(null,dc),dc}return Pu})}}),jE=Ge({"src/lib/prepare_regl.js"(K,G){var h=yC(),b=dz();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}}}),lL=Ge({"src/traces/scattergl/plot.js"(f,G){var h=UC(),b=JC(),S=$D(),E=hz(),e=_n(),t=Up().selectMode,r=jE(),o=uu(),n=up(),i=FC().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]}}}}),Tz=Ge({"src/traces/splom/plot.js"(K,G){var h=wz(),b=_n(),S=Df(),E=Up().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}}}),Pz=Ge({"src/traces/parcoords/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=kc().defaults,e=yd(),t=Ts(),r=fL(),o=hL(),n=aS().maxDimensionCount,i=qE();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")}}}),Rz=Ge({"src/traces/parcoords/calc.js"(K,G){var h=_n().isArrayOrTypedArray,b=Ec(),S=Og().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(),VE.default[K])S=VE.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(HE[a]!==void 0)return HE[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 VE,dL,HE,Dz=li({"node_modules/color-parse/index.js"(){VE=Eo(pC()),dL=Iz,HE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),iS,vL=li({"node_modules/color-space/rgb.js"(){iS={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),oS,zz=li({"node_modules/color-space/hsl.js"(){vL(),oS={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}},iS.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]}}}),pL={};wo(pL,{default:()=>Oz});function Oz(K){Array.isArray(K)&&K.raw&&(K=String.raw(...arguments)),K instanceof Number&&(K=+K);var G,h=dL(K);if(!h.space)return[];const b=h.space[0]==="h"?oS.min:iS.min,S=h.space[0]==="h"?oS.max:iS.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=oS.rgb(G)),G.push(Math.min(Math.max(h.alpha,0),1)),G}var Fz=li({"node_modules/color-rgba/index.js"(){Dz(),vL(),zz()}}),mL=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)}}}),Bz=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=aS().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 lt=1;lt=Nt||Mr>=Qt)return;var $r=nt.lineLayer.readPixel(Er,Qt-1-Mr),Sr=$r[3]!==0,Nr=Sr?$r[2]+256*($r[1]+256*$r[0]):null,Mt={x:Er,y:Mr,clientX:Ft.clientX,clientY:Ft.clientY,dataIndex:nt.model.key,curveNumber:Nr};Nr!==Le&&(Sr?ee.hover(Mt):ee.unhover&&ee.unhover(Mt),Le=Nr)}}),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 lt=Ae.selectAll("."+T.cn.axisExtentBottom).data(c,f);lt.enter().append("g").classed(T.cn.axisExtentBottom,!0),lt.attr("transform",function(nt){return o(0,nt.model.height+T.axisExtentOffset)});var dt=lt.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)}}}),gL=Ge({"src/traces/parcoords/plot.js"(r,G){var h=Nz(),b=jE(),S=mL().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}}),Uz=Ge({"src/traces/parcoords/base_plot.js"(K){var G=ki(),h=Bd().getModuleCalcData,b=gL(),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)}}}),jz=Ge({"src/traces/parcoords/base_index.js"(K,G){G.exports={attributes:fL(),supplyDefaults:Pz(),calc:Rz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Uz(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),qz=Ge({"src/traces/parcoords/index.js"(K,G){var h=jz();h.plot=gL(),G.exports=h}}),Vz=Ge({"lib/parcoords.js"(K,G){G.exports=qz()}}),yL=Ge({"src/traces/parcats/attributes.js"(K,G){var h=Ki().extendFlat,b=Gl(),S=Ns(),E=zu(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=kc().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}}}),Hz=Ge({"src/traces/parcats/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=kc().defaults,e=yd(),t=yL(),r=qE(),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)}})}}}),Gz=Ge({"src/traces/parcats/calc.js"(K,G){var h=Og().wrap,b=gd().hasColorscale,S=_d(),E=A1(),e=As(),t=_n(),r=Si();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}}}),Xz=Ge({"src/traces/parcats/parcats.js"(K,G){var h=ki(),b=(ao(),ui(xi)).interpolateNumber,S=Tx(),E=Yf(),e=_n(),t=e.strTranslate,r=As(),o=Is(),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,lt=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): "+lt.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]}),Nr=de.map(function(Mt){return Sr[Mt]});return Nr}Fe.sort(function($r,Sr){var Nr=Ye($r),Mt=Ye(Sr);return $.sortpaths==="backward"&&(Nr.reverse(),Mt.reverse()),Nr.push($r.valueInds[0]),Mt.push(Sr.valueInds[0]),$.bundlecolors&&(Nr.unshift($r.rawColor),Mt.unshift(Sr.rawColor)),NrMt?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,lt=(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:lt,bands:[],parcatsViewModel:$},lt=lt+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}}}}),_L=Ge({"src/traces/parcats/plot.js"(K,G){var h=Xz();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)}}}),Yz=Ge({"src/traces/parcats/base_plot.js"(K){var G=Bd().getModuleCalcData,h=_L(),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()}}}),Zz=Ge({"src/traces/parcats/index.js"(K,G){G.exports={attributes:yL(),supplyDefaults:Hz(),calc:Gz(),plot:_L(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:Yz(),categories:["noOpacity"],meta:{}}}}),Wz=Ge({"lib/parcats.js"(K,G){G.exports=Zz()}}),Wy=Ge({"src/plots/mapbox/constants.js"(K,G){var h=zp(),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')`}}}}),sS=Ge({"src/plots/mapbox/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=kc().attributes,E=Ns(),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"}}}),GE=Ge({"src/traces/scattermapbox/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=$b(),t=Gc(),r=sS(),o=Gl(),n=zu(),i=Ki().extendFlat,a=Hc().overrideAll,s=sS(),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")}}),xL=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}}}}),$z=Ge({"src/traces/scattermapbox/defaults.js"(K,G){var h=_n(),b=uu(),S=Kd(),E=Vp(),e=op(),t=Nd(),r=GE(),o=xL().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}}}),bL=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}}}),wL=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}}}}),Kz=Ge({"src/traces/scattermapbox/convert.js"(K,G){var h=Si(),b=_n(),S=Ii().BADNUM,E=F_(),e=Ec(),t=As(),r=Fp(),o=uu(),n=xL().isSupportedFont,i=wL(),a=$d().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}}}),Jz=Ge({"src/traces/scattermapbox/plot.js"(K,G){var h=_n(),b=Kz(),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}}}),Qz=Ge({"src/traces/scattermapbox/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),e7=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(jt,nr){jt&&(De=jt),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 jt=He||yt;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){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 jt=this._customAccessToken||Ft(se.params)||Le.ACCESS_TOKEN;return Le.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/",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(jt){return!jt.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 lt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function dt(k){return lt.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},jt=X?_(yt,X):yt,nr={url:ar(He),headers:{"Content-Type":"text/plain"},body:JSON.stringify([jt])};this.pendingRequest=Tn(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(jt){jt||He&&(Te.success[He]=!0)},se))}},C})($r),Nr=(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=Mr(Le.ACCESS_TOKEN),He=De?De.u:Le.ACCESS_TOKEN,yt=He!==this.eventData.tokenU;I(this.anonId)||(this.anonId=d(),yt=!0);var jt=this.queue.shift();if(this.eventData.lastSuccess){var nr=new Date(this.eventData.lastSuccess),dr=new Date(jt),Fr=(jt-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(jt,{"enabled.telemetry":!1},function(rn){rn||(Te.eventData.lastSuccess=jt,Te.eventData.tokenU=He)},se)}},C})($r),Mt=new Nr,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 Br=1/0;function kn(k){Br++,Br>Ee&&(k.getActor().send("enforceCacheSizeLimit",ye),Br=0)}function Wn(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(!qt(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)},sn=function(k,C){return Gr(_(k,{type:"json"}),C)},mn=function(k,C){return Gr(_(k,{type:"arrayBuffer"}),C)},Tn=function(k,C){return Gr(_(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 ma="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function da(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=ma})},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):ma}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 Mi=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,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"}},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:"*"}},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"}},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"}}},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"],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"}},Hi={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"}},fi={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"}},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"}},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"}},vo={"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"}},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"}},Pl={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ms={"*":{type:"string"}},di={$version:qr,$root:ln,sources:Jr,source:At,source_vector:lr,source_raster:zr,source_raster_dem:un,source_geojson:Rn,source_video:qn,source_image:jn,layer:cn,layout:In,layout_background:gi,layout_fill:Ea,layout_circle:Ci,layout_heatmap:Hi,"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:fi,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:sl,paint_circle:fs,paint_heatmap:Zo,paint_symbol:vo,paint_raster:hs,paint_hillshade:ll,paint_background:kl,transition:Pl,"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 Yu=[Au,Ji,gs,rs,Xl,Os,Yl,Fl(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=Yu;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 jt(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),$n=dr.substr(rn+1,Kr-(rn+1)).split(","),ja=1;switch(bn){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 wa=(parseFloat($n[0])%360+360)%360/360,mi=He($n[1]),Ja=He($n[2]),vi=Ja<=.5?Ja*(mi+1):Ja+mi-Ja*mi,Ei=Ja*2-vi;return[se(yt(Ei,vi,wa+1/3)*255),se(yt(Ei,vi,wa)*255),se(yt(Ei,vi,wa-1/3)*255),ja];default:return null}}return null}try{C.parseCSSColor=jt}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 Ic=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"})};Ic.prototype.compare=function(C,X){return this.collator.compare(C,X)},Ic.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 Ic)return!0;if(k instanceof oc)return!0;if(k instanceof Zu)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 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++}Te=Fl(He,jt)}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 jt=null;if(yt["font-scale"]&&(jt=X.parse(yt["font-scale"],1,Ji),!jt))return null;var nr=null;if(yt["text-font"]&&(nr=X.parse(yt["text-font"],1,Fl(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=jt,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 Jl(Te)===wl?new zh("",Te,null,null,null):new zh(Wu(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":Ji,"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 Il(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,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,jt=k;yt=0)return!1;var X=!0;return k.eachChild(function(se){X&&!zc(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 Ql=function(C,X,se,Te,De){X===void 0&&(X=[]),Te===void 0&&(Te=new ul),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};Ql.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)},Ql.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 bc(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,jt=He.type;if((yt.kind==="string"||yt.kind==="number"||yt.kind==="boolean"||yt.kind==="object"||yt.kind==="array")&&jt.kind==="value")He=se(He,yt,X.typeAnnotation||"assert");else if((yt.kind==="color"||yt.kind==="formatted"||yt.kind==="resolvedImage")&&(jt.kind==="value"||jt.kind==="string"))He=se(He,yt,X.typeAnnotation||"coerce");else if(this.checkSubtype(yt,jt))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.")},Ql.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 Ql(this.registry,Te,X||null,De,this.errors)},Ql.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))},Ql.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 Dc)return!1;var C=k instanceof Fs||k instanceof bc,X=!0;return k.eachChild(function(se){C?X=X&&kf(se):X=X&&se instanceof Hs}),X?Zh(k)&&zc(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function mc(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 Il("Input is not a number.");return 0}var Oc=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(jt,dr,De);if(!Fr)return null;De=De||Fr.type,Te.push([yt,Fr])}return new Oc(De,se,Te)},Oc.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=mc(X,Te);return se[He].evaluate(C)},Oc.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,ev=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 au(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Fc(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function sf(k){var C=Fc(k.r),X=Fc(k.g),se=Fc(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)/ev);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=ev*ih(se),new Tl(au(3.2404542*X-1.5371385*C-.4985314*se),au(-.969266*X+1.8760108*C+.041556*se),au(.0556434*X-.2040259*C+1.0572252*se),k.alpha)}function su(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:su},vh={forward:hh,reverse:qf,interpolate:dh},kd=Object.freeze({__proto__:null,lab:mf,hcl:vh}),fc=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:jt}}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,Ji),!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,$n,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 "+ql(dr)+" is not interpolatable."):new fc(dr,se,Te,De,nr)},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=mc(X,Te),yt=X[He],jt=X[He+1],nr=fc.interpolationFactor(this.interpolation,Te,yt,jt),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))},fc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X=se.length)throw new Il("Array index out of bounds: "+X+" > "+(se.length-1)+".");if(X!==Math.floor(X))throw new Il("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,Ji,Au,Io])?new Su(se,Te):X.error("Expected first argument to be of type boolean, string, number or null, but found "+ql(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 Il("Expected first argument to be of type boolean, string, number or null, but found "+ql(Jl(X))+" instead.");if(!rf(se,["string","array"]))throw new Il("Expected second argument to be of type array or string, but found "+ql(Jl(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 wc=function(C,X,se){this.type=Ji,this.needle=C,this.haystack=X,this.fromIndex=se};wc.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,Ji,Au,Io]))return X.error("Expected first argument to be of type boolean, string, number or null, but found "+ql(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ji);return De?new wc(se,Te,De):null}else return new wc(se,Te)},wc.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!rf(X,["boolean","string","number","null"]))throw new Il("Expected first argument to be of type boolean, string, number or null, but found "+ql(Jl(X))+" instead.");if(!rf(se,["string","array"]))throw new Il("Expected second argument to be of type array or string, but found "+ql(Jl(se))+" instead.");if(this.fromIndex){var Te=this.fromIndex.evaluate(C);return se.indexOf(X,Te)}return se.indexOf(X)},wc.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},wc.prototype.outputDefined=function(){return!1},wc.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=Jl(Kr);else if(dr.checkSubtype(se,Jl(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 $n=X.parse(C[1],1,Io);if(!$n)return null;var ja=X.parse(C[C.length-1],C.length-1,Te);return!ja||$n.type.kind!=="value"&&X.concat(1).checkSubtype(se,$n.type)?null:new pu(se,Te,$n,De,He,ja)},pu.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=Jl(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,Ji);if(!se||!Te)return null;if(!Xc(se.type,[Fl(Io),gs,Io]))return X.error("Expected first argument to be of type array or string, but found "+ql(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ji);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 Il("Expected first argument to be of type array or string, but found "+ql(Jl(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 fr(k,C,X){return C===X}function Rr(k,C,X){return C!==X}function vn(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 ci(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 jt=He[0],nr=yt.parse(He[1],1,Io);if(!nr)return null;if(!jh(jt,nr.type))return yt.concat(1).error('"'+jt+`" comparisons are not supported for type '`+ql(nr.type)+"'.");var dr=yt.parse(He[2],2,Io);if(!dr)return null;if(!jh(jt,dr.type))return yt.concat(2).error('"'+jt+`" comparisons are not supported for type '`+ql(dr.type)+"'.");if(nr.type.kind!==dr.type.kind&&nr.type.kind!=="value"&&dr.type.kind!=="value")return yt.error("Cannot compare types '"+ql(nr.type)+"' and '"+ql(dr.type)+"'.");se&&(nr.type.kind==="value"&&dr.type.kind!=="value"?nr=new bc(dr.type,[nr]):nr.type.kind!=="value"&&dr.type.kind==="value"&&(dr=new bc(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),jt=this.rhs.evaluate(He);if(se&&this.hasUntypedArgument){var nr=Jl(yt),dr=Jl(jt);if(nr.kind!==dr.kind||!(nr.kind==="string"||nr.kind==="number"))throw new Il('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=Jl(yt),rn=Jl(jt);if(Fr.kind!=="string"||rn.kind!=="string")return C(He,yt,jt)}return this.collator?X(He,yt,jt,this.collator.evaluate(He)):C(He,yt,jt)},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("==",fr,xa),Xi=Qa("!=",Rr,ti),No=Qa("<",vn,ci),Do=Qa(">",an,Ni),Go=Qa("<=",On,Ha),jo=Qa(">=",Aa,bi),Zi=function(C,X,se,Te,De){this.type=gs,this.number=C,this.locale=X,this.currency=se,this.minFractionDigits=Te,this.maxFractionDigits=De};Zi.parse=function(C,X){if(C.length!==3)return X.error("Expected two arguments.");var se=X.parse(C[1],1,Ji);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,Ji),!yt))return null;var jt=null;return Te["max-fraction-digits"]&&(jt=X.parse(Te["max-fraction-digits"],1,Ji),!jt)?null:new Zi(se,De,He,yt,jt)},Zi.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))},Zi.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)},Zi.prototype.outputDefined=function(){return!1},Zi.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=Ji,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 "+ql(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 Il("Expected value to be of type string or array, but found "+ql(Jl(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,"!=":Xi,">":Do,"<":No,">=":jo,"<=":Go,array:bc,at:gf,boolean:bc,case:Vf,coalesce:Wc,collator:af,format:Ff,image:fu,in:Su,"index-of":wc,interpolate:fc,"interpolate-hcl":fc,"interpolate-lab":fc,length:Li,let:Cf,literal:Hs,match:pu,number:bc,"number-format":Zi,object:bc,slice:yf,step:Oc,string:bc,"to-boolean":Fs,"to-color":Fs,"to-number":Fs,"to-string":Fs,var:Uf,within:Dc};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 Il(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 Il(X.evaluate(k))}],typeof:[gs,[Io],function(k,C){var X=C[0];return ql(Jl(X.evaluate(k)))}],"to-rgba":[Fl(Ji,4),[Xl],function(k,C){var X=C[0];return X.evaluate(k).toArray()}],rgb:[Xl,[Ji,Ji,Ji],Bs],rgba:[Xl,[Ji,Ji,Ji,Ji],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:[Ji,[],function(k){return k.globals.zoom}],"heatmap-density":[Ji,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Ji,[],function(k){return k.globals.lineProgress||0}],accumulated:[Io,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Ji,Wl(Ji),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,[Fl(gs)],function(k,C){var X=C[0];return X.value.indexOf(k.geometryType())>=0}],"filter-id-in":[rs,[Fl(Io)],function(k,C){var X=C[0];return X.value.indexOf(k.id())>=0}],"filter-in-small":[rs,[gs,Fl(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,Fl(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 Dl(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function ml(k){return k}function gc(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(po){return[po[0],Tl.parse(po[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,jt,nr;if(He==="exponential")yt=_c;else if(He==="interval")yt=$f;else if(He==="categorical"){yt=Tc,jt=Object.create(null);for(var dr=0,Fr=k.stops;dr=k.stops[se-1][0])return k.stops[se-1][1];var Te=mc(k.stops.map(function(De){return De[0]}),X);return k.stops[Te][1]}function _c(k,C,X){var se=k.base!==void 0?k.base:1;if(ys(X)!=="number")return yc(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=mc(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],jt=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),$n=jt.evaluate.apply(void 0,rn);if(!(bn===void 0||$n===void 0))return nr(bn,$n,He)}}:nr(yt,jt,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=Zu.fromString(X.toString()):ys(X)!==C.type&&(C.type!=="enum"||!C.values[X])&&(X=void 0),yc(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 Il("Expected value to be one of "+Object.keys(this._enumValues).map(function(jt){return JSON.stringify(jt)}).join(", ")+", but found "+JSON.stringify(yt)+" instead.");return yt}catch(jt){return this._warningHistory[jt.message]||(this._warningHistory[jt.message]=!0,typeof console<"u"&&console.warn(jt.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 Ql(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?fc.interpolationFactor(this.interpolationType,C,X,se):0};function Bc(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=zc(X,["zoom"]);if(!Te&&!Vl(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 fc&&!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 fc?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,gc(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(Dl(k))return new Ue(k,C);if(Xo(k)){var X=Bc(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 Gt(k){var C=k.valueSpec,X=Fo(k.value.type),se,Te={},De,He,yt=X!=="categorical"&&k.value.property===void 0,jt=!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&&(jt&&!Mu(k.valueSpec)?dr.push(new to(k.key,k.value,"property functions not supported")):yt&&!Vl(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($n){if(X==="identity")return[new to($n.key,$n.value,'identity function may not have a "stops" property')];var ja=[],wa=$n.value;return ja=ja.concat(_t({key:$n.key,value:wa,valueSpec:$n.valueSpec,style:$n.style,styleSpec:$n.styleSpec,arrayElementValidator:rn})),ys(wa)==="array"&&wa.length===0&&ja.push(new to($n.key,wa,"array must have at least one stop")),ja}function rn($n){var ja=[],wa=$n.value,mi=$n.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:$n.style,styleSpec:$n.styleSpec,objectElementValidators:{zoom:kt,value:Kr}}))}else ja=ja.concat(Kr({key:mi+"[0]",value:wa[0],style:$n.style,styleSpec:$n.styleSpec},wa));return Xo(Rl(wa[1]))?ja.concat([new to(mi+"[1]",wa[1],"expressions are not allowed in function stops.")]):ja.concat(Qs({key:mi+"[1]",value:wa[1],valueSpec:C,style:$n.style,styleSpec:$n.styleSpec}))}function Kr($n,ja){var wa=ys($n.value),mi=Fo($n.value),Ja=$n.value!==null?$n.value:ja;if(!se)se=wa;else if(wa!==se)return[new to($n.key,Ja,wa+" stop domain type must match previous stop domain type "+se)];if(wa!=="number"&&wa!=="string"&&wa!=="boolean")return[new to($n.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($n.key,Ja,vi)]}return X==="categorical"&&wa==="number"&&(!isFinite(mi)||Math.floor(mi)!==mi)?[new to($n.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(Rl(k.value))?hr(Ps({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):on(k)}function on(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(en({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 jt=this._convertToCellCoord(k),nr=this._convertToCellCoord(C),dr=this._convertToCellCoord(X),Fr=this._convertToCellCoord(se),rn=jt;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[jt].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 jt!=="Object"&&(nr.$name=jt),nr}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||_r(k)||Zr(k)||ArrayBuffer.isView(k)||k instanceof wt)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 Te=Object.create(se.prototype),De=0,He=Object.keys(k);De=0?jt:hn(jt)}}return Te}throw new Error("can't deserialize object of type "+typeof k)}var Sn=function(){this.first=!0};Sn.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 sa(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 Yi(k){return k>=1424&&k<=2303||Cn["Arabic Presentation Forms-A"](k)||Cn["Arabic Presentation Forms-B"](k)}function zi(k,C){return!(!C&&Yi(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(){eu.fire(new jr("pluginStateChange",{pluginStatus:Po,pluginURL:os}))}var eu=new Dr,lo=function(){return Po},Ls=function(k){return k({pluginStatus:Po,pluginURL:os}),eu.on("pluginStateChange",k),k},el=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&&mn({url:os},function(k){k?nl(k):(Po=ko.loaded,Iu())})},zl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Po===ko.loaded||zl.applyArabicShaping!=null},isLoading:function(){return Po===ko.loading},setState:function(C){Po=C.pluginStatus,os=C.pluginURL},isParsed:function(){return zl.applyArabicShaping!=null&&zl.processBidirectionalText!=null&&zl.processStyledBidirectionalText!=null},getPluginURL:function(){return os}},Ac=function(){!zl.isLoading()&&!zl.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 Sn,this.transition={})};El.prototype.isSupportedScript=function(C){return _o(C,zl.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})(pn),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",pn),tr("DataConstantProperty",gn),tr("CrossFadedDataDrivenProperty",za),tr("CrossFadedProperty",Ia),tr("ColorRampProperty",Da);var Bi="-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 fa(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,Bi)?this._transitionablePaint.getTransition(se.slice(0,-Bi.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,Bi))return this._transitionablePaint.setTransition(se.slice(0,-Bi.length),Te||void 0),!1;var yt=this._transitionablePaint._values[se],jt=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||jt||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:Nc(this,se.call(ks,{key:Te,layerType:this.type,objectKey:De,value:He,styleSpec:di,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},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},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=ia(He.type),jt=X=hi(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:jt}}),De=hi(X,Math.max(se,C));return{members:Te,size:De,alignment:C}}function ia(k){return Ga[k].BYTES_PER_ELEMENT}function hi(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 jt=se*4;return this.int16[jt+0]=Te,this.int16[jt+1]=De,this.int16[jt+2]=He,this.int16[jt+3]=yt,se},C})(ta);Ri.prototype.bytesPerElement=8,tr("StructArrayLayout4i8",Ri);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.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,this.int16[dr+5]=nr,se},C})(ta);oa.prototype.bytesPerElement=12,tr("StructArrayLayout2i4i12",oa);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,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt,nr,dr,Fr,rn){var Kr=this.length;return this.resize(Kr+1),this.emplace(Kr,se,Te,De,He,yt,jt,nr,dr,Fr,rn)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt,nr,dr,Fr,rn,Kr,bn){var $n=this.length;return this.resize($n+1),this.emplace($n,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n){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]=jt,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]=$n,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 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 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);Oi.prototype.bytesPerElement=4,tr("StructArrayLayout1ul4",Oi);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,jt,nr,dr,Fr){var rn=this.length;return this.resize(rn+1),this.emplace(rn,se,Te,De,He,yt,jt,nr,dr,Fr)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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 jt=this.length;return this.resize(jt+1),this.emplace(jt,se,Te,De,He,yt)},C.prototype.emplace=function(se,Te,De,He,yt,jt){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]=jt,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 jt=se*12,nr=se*3;return this.uint8[jt+0]=Te,this.uint8[jt+1]=De,this.float32[nr+1]=He,this.float32[nr+2]=yt,se},C})(ta);Ya.prototype.bytesPerElement=12,tr("StructArrayLayout2ub2f12",Ya);var Ao=(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);Ao.prototype.bytesPerElement=6,tr("StructArrayLayout3ui6",Ao);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,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja){var vi=this.length;return this.resize(vi+1),this.emplace(vi,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi){var Ei=se*24,$i=se*12,xo=se*48;return this.int16[Ei+0]=Te,this.int16[Ei+1]=De,this.uint16[Ei+2]=He,this.uint16[Ei+3]=yt,this.uint32[$i+2]=jt,this.uint32[$i+3]=nr,this.uint32[$i+4]=dr,this.uint16[Ei+10]=Fr,this.uint16[Ei+11]=rn,this.uint16[Ei+12]=Kr,this.float32[$i+7]=bn,this.float32[$i+8]=$n,this.uint8[xo+36]=ja,this.uint8[xo+37]=wa,this.uint8[xo+38]=mi,this.uint32[$i+10]=Ja,this.int16[Ei+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,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms){var Hl=this.length;return this.resize(Hl+1),this.emplace(Hl,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms,Hl){var il=se*34,Nu=se*17;return this.int16[il+0]=Te,this.int16[il+1]=De,this.int16[il+2]=He,this.int16[il+3]=yt,this.int16[il+4]=jt,this.int16[il+5]=nr,this.int16[il+6]=dr,this.int16[il+7]=Fr,this.uint16[il+8]=rn,this.uint16[il+9]=Kr,this.uint16[il+10]=bn,this.uint16[il+11]=$n,this.uint16[il+12]=ja,this.uint16[il+13]=wa,this.uint16[il+14]=mi,this.uint16[il+15]=Ja,this.uint16[il+16]=vi,this.uint16[il+17]=Ei,this.uint16[il+18]=$i,this.uint16[il+19]=xo,this.uint16[il+20]=po,this.uint16[il+21]=ss,this.uint16[il+22]=Bo,this.uint32[Nu+12]=Ko,this.float32[Nu+13]=dl,this.float32[Nu+14]=ls,this.float32[Nu+15]=ms,this.float32[Nu+16]=Hl,se},C})(ta);Qo.prototype.bytesPerElement=68,tr("StructArrayLayout8i15ui1ul4f68",Qo);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 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);cl.prototype.bytesPerElement=4,tr("StructArrayLayout1f4",cl);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,jt=se*4;return this.uint32[yt+0]=Te,this.uint16[jt+2]=De,this.uint16[jt+3]=He,se},C})(ta);Eu.prototype.bytesPerElement=8,tr("StructArrayLayout1ul2ui8",Eu);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,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);tl.prototype.bytesPerElement=4,tr("StructArrayLayout2ui4",tl);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 jt=se*4;return this.float32[jt+0]=Te,this.float32[jt+1]=De,this.float32[jt+2]=He,this.float32[jt+3]=yt,se},C})(ta);Fu.prototype.bytesPerElement=16,tr("StructArrayLayout4f16",Fu);var Ju=(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);Ju.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 Ju(this,se)},C})(Lo);tr("CollisionBoxArray",_f);var tu=(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);tu.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 tu(this,se)},C})(qo);tr("PlacedSymbolArray",du);var fo=(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);fo.prototype.size=68;var Qu=(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 fo(this,se)},C})(Qo);tr("SymbolInstanceArray",Qu);var js=(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);tr("GlyphOffsetArray",js);var Ol=(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",Ol);var hc=(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);hc.prototype.size=8;var dc=(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 hc(this,se)},C})(Eu);tr("FeatureIndexArray",dc);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)*jt&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)*jt+(((dr>>>16)*jt&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],jt=this.positions[3*se+1],nr=this.positions[3*se+2];He.push({index:yt,start:jt,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;Wt(k,De,He),Wt(C,3*De,3*He),Wt(C,3*De+1,3*He+1),Wt(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 xl(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?fl(k):[]}}function _l(k,C,X,se,Te){k.emplaceBack(C*2+(se+1)/2,X*2+(Te+1)/2)}var ec=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 Ao,this.segments=new _s,this.programConfigurations=new ha(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};ec.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,jt=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",ec,{omit:["layers"]});function ol(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 rv(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 jt=[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=jt;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 nv(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 s6(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function l6(k,C,X){var se=C[0],Te=C[1],De=C[2],He=X[0],yt=X[1],jt=X[2];return k[0]=Te*jt-De*yt,k[1]=De*He-se*jt,k[2]=se*yt-Te*He,k}function u6(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 c6=Vm;(function(){var k=qm();return function(C,X,se,Te,De,He){var yt,jt;for(X||(X=3),se||(se=0),Te?jt=Math.min(Te*X+se,C.length):jt=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,jt=0;jt80*X){yt=nr=k[0],jt=dr=k[1];for(var bn=X;bnnr&&(nr=Fr),rn>dr&&(dr=rn);Kr=Math.max(nr-yt,dr-jt),Kr=Kr!==0?1/Kr:0}return jg(De,He,X,yt,jt,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=gS(De,k[De],k[De+1],He);return He&&r1(He,He.next)&&(W_(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(W_(X),X=C=X.prev,X===X.next)break;se=!0}else X=X.next;while(se||X!==C);return C}function jg(k,C,X,se,Te,De,He){if(k){!He&&De&&K3(k,se,Te,De);for(var yt=k,jt,nr;k.prev!==k.next;){if(jt=k.prev,nr=k.next,De?g6(k,se,Te,De):$3(k)){C.push(jt.i/X),C.push(k.i/X),C.push(nr.i/X),W_(k),k=nr.next,yt=nr.next;continue}if(k=nr,k===yt){He?He===1?(k=y6(tm(k),C,X),jg(k,C,X,se,Te,De,2)):He===2&&vS(k,C,X,se,Te,De):jg(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(Xm(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 g6(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,jt,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&&Xm(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&&Xm(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&&Xm(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&&Xm(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 y6(k,C,X){var se=k;do{var Te=se.prev,De=se.next.next;!r1(Te,De)&&qg(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),W_(se),W_(se.next),se=k=De),se=se.next}while(se!==k);return tm(se)}function vS(k,C,X,se,Te,De){var He=k;do{for(var yt=He.next.next;yt!==He.prev;){if(He.i!==yt.i&&x6(He,yt)){var jt=eT(He,yt);He=tm(He,He.next),jt=tm(jt,jt.next),jg(He,C,X,se,Te,De),jg(jt,C,X,se,Te,De);return}yt=yt.next}He=He.next}while(He!==k)}function pS(k,C,X,se){var Te=[],De,He,yt,jt,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&&Xm(TeHe.x||X.x===He.x&&mS(He,X)))&&(He=X,Fr=rn)),X=X.next;while(X!==jt);return He}function mS(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,_6(Te)}function _6(k){var C,X,se,Te,De,He,yt,jt,nr=1;do{for(X=k,k=null,De=null,He=0;X;){for(He++,se=X,yt=0,C=0;C0||jt>0&&se;)yt!==0&&(jt===0||!se||X.z<=se.z)?(Te=X,X=X.nextZ,yt--):(Te=se,se=se.nextZ,jt--),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 fw(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 x6(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Q3(k,C)&&(n1(k,C)&&n1(C,k)&&hw(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 qg(k,C,X,se){var Te=Z_(oh(k,C,X)),De=Z_(oh(k,C,se)),He=Z_(oh(X,se,k)),yt=Z_(oh(X,se,C));return!!(Te!==De&&He!==yt||Te===0&&Y_(k,X,C)||De===0&&Y_(k,se,C)||He===0&&Y_(X,k,se)||yt===0&&Y_(X,C,se))}function Y_(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 Z_(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&&qg(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 hw(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 dw(k.i,k.x,k.y),se=new dw(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 gS(k,C,X,se){var Te=new dw(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 W_(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 dw(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}cw.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,jt=C.length;yt0&&(se+=k[Te-1].length,X.holes.push(se))}return X},uw.default=dS;function b6(k,C,X,se,Te){yS(k,C,X,se||k.length-1,Te||rT)}function yS(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),jt=.5*Math.exp(2*yt/3),nr=.5*Math.sqrt(yt*jt*(De-jt)/De)*(He-De/2<0?-1:1),dr=Math.max(X,Math.floor(C-He*jt/De+nr)),Fr=Math.min(se,Math.floor(C+(De-He)*jt/De+nr));yS(k,C,dr,Fr,Te)}var rn=k[C],Kr=X,bn=se;for($_(k,X,C),Te(k[se],rn)>0&&$_(k,X,se);Kr0;)bn--}Te(k[X],rn)===0?$_(k,X,bn):(bn++,$_(k,bn,se)),bn<=C&&(X=bn+1),C<=bn&&(se=bn-1)}}function $_(k,C,X){var se=k[C];k[C]=k[X],k[X]=se}function rT(k,C){return kC?1:0}function A0(k,C){var X=k.length;if(X<=1)return[k];for(var se=[],Te,De,He=0;He1)for(var jt=0;jt>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},Vg.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,jt=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,jt,yt,nr]},Vg.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=Vg.types[this.type],jt,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}ES.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 CS=LS;function LS(k,C){this.layers=k.readFields(PS,{},C)}function PS(k,C,X){if(k===3){var se=new iT(X,X.readVarint()+X.pos);se.length&&(C[se.name]=se)}}var RS=CS,w6=a1,T6=iT,Hg={VectorTile:RS,VectorTileFeature:w6,VectorTileLayer:T6},i1=Hg.VectorTileFeature.types,IS=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 oa,this.indexArray=new Ao,this.programConfigurations=new ha(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=vw("fill-extrusion",this.layers,X);for(var Te=0,De=C;Te=1){var vi=ja[mi-1];if(!mw(Ja,vi)){Kr.vertexLength+4>_s.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Ei=Ja.sub(vi)._perp()._unit(),$i=vi.dist(Ja);wa+$i>32768&&(wa=0),s1(this.layoutVertexArray,Ja.x,Ja.y,Ei.x,Ei.y,0,0,wa),s1(this.layoutVertexArray,Ja.x,Ja.y,Ei.x,Ei.y,0,1,wa),wa+=$i,s1(this.layoutVertexArray,vi.x,vi.y,Ei.x,Ei.y,0,0,wa),s1(this.layoutVertexArray,vi.x,vi.y,Ei.x,Ei.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 po=[],ss=[],Bo=Kr.vertexLength,Ko=0,dl=jt;Koqi)||k.y===C.y&&(k.y<0||k.y>qi)}function gw(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 A6=new Za({"fill-extrusion-opacity":new gn(di["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new pn(di["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gn(di["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gn(di["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new za(di["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new pn(di["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new pn(di["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gn(di["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),S6={paint:A6},M6=(function(k){function C(X){k.call(this,X,S6)}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,jt,nr,dr){var Fr=dp(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,nr),rn=this.paint.get("fill-extrusion-height").evaluate(Te,De),Kr=this.paint.get("fill-extrusion-base").evaluate(Te,De),bn=DS(Fr,dr,jt,0),$n=oT(He,Kr,rn,dr),ja=$n[0],wa=$n[1];return Zm(ja,wa,bn)},C})(yi);function S0(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(po&&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 dl=bn&&$n,ls=dl?se:jt?"butt":Te;if(dl&&ls==="round"&&($iDe&&(ls="bevel"),ls==="bevel"&&($i>2&&(ls="flipbevel"),$i100)Ja=wa.mult(-1);else{var ms=$i*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 Hl=-Math.sqrt($i*$i-1),il=ss?Hl:0,Nu=ss?0:Hl;if(bn&&this.addCurrentVertex(Kr,ja,il,Nu,rn),ls==="fakeround")for(var qc=Math.round(xo*180/Math.PI/uT),Uu=1;Uu2*Fr){var nd=Kr.add($n.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,jt=X.y-X.x*se,nr=-X.x+X.y*Te,dr=-X.y-X.x*Te;this.addHalfVertex(C,yt,jt,He,!1,se,De),this.addHalfVertex(C,nr,dr,He,!0,-Te,De),this.distance>yw/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 jt=C.x,nr=C.y,dr=this.lineClips?this.scaledDistance*(yw-1):this.scaledDistance,Fr=dr*l1;if(this.layoutVertexArray.emplaceBack((jt<<1)+(Te?1:0),(nr<<1)+(De?1:0),Math.round(BS*X)+128,Math.round(BS*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 $n=yt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,$n),yt.primitiveLength++),De?this.e2=$n:this.e1=$n},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 gn(di.layout_line["line-cap"]),"line-join":new pn(di.layout_line["line-join"]),"line-miter-limit":new gn(di.layout_line["line-miter-limit"]),"line-round-limit":new gn(di.layout_line["line-round-limit"]),"line-sort-key":new pn(di.layout_line["line-sort-key"])}),_w=new Za({"line-opacity":new pn(di.paint_line["line-opacity"]),"line-color":new pn(di.paint_line["line-color"]),"line-translate":new gn(di.paint_line["line-translate"]),"line-translate-anchor":new gn(di.paint_line["line-translate-anchor"]),"line-width":new pn(di.paint_line["line-width"]),"line-gap-width":new pn(di.paint_line["line-gap-width"]),"line-offset":new pn(di.paint_line["line-offset"]),"line-blur":new pn(di.paint_line["line-blur"]),"line-dasharray":new Ia(di.paint_line["line-dasharray"]),"line-pattern":new za(di.paint_line["line-pattern"]),"line-gradient":new Da(di.paint_line["line-gradient"])}),u1={paint:_w,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})(pn),xw=new fT(u1.paint.properties["line-width"].specification);xw.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 Oc,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"]=xw.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=jS(nv("line-width",this,Te),nv("line-gap-width",this,Te)),He=nv("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,jt,nr){var dr=dp(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,nr),Fr=nr/2*jS(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 jS(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===jt)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,jt,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,$n=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*(jt=Math.pow(2,-He))<1&&(He--,jt*=2),He+Fr>=1?C+=rn/jt:C+=rn*Math.pow(2,1-Fr),C*jt>=2&&(He++,jt/=2),He+Fr>=dr?(yt=0,He=dr):He+Fr>=1?(yt=(C*jt-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]|=$n*128},dn={read:Hr,write:Qr},An=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 pa=65536*65536,oi=1/pa,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)*pa;return this.pos+=8,k},readSFixed64:function(){var k=Av(this.buf,this.pos)+Qh(this.buf,this.pos+4)*pa;return this.pos+=8,k},readFloat:function(){var k=dn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=dn.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&&ei?pv(this.buf,C,k):vv(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=co(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){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=mv(this.buf,k,this.pos);var X=this.pos-C;X>=128&&Ds(C,X,this),this.pos=C-1,this.writeVarint(X),this.pos+=X},writeFloat:function(k){this.realloc(4),dn.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),dn.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&&Ds(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,zs,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Qi,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Gs,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Ll,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 Fi(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 co(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 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),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 Ds(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 vv(k,C,X){for(var se="",Te=C;Te239?4:De>223?3:De>191?2:1;if(Te+yt>X)break;var jt,nr,dr;yt===1?De<128&&(He=De):yt===2?(jt=k[Te+1],(jt&192)===128&&(He=(De&31)<<6|jt&63,He<=127&&(He=null))):yt===3?(jt=k[Te+1],nr=k[Te+2],(jt&192)===128&&(nr&192)===128&&(He=(De&15)<<12|(jt&63)<<6|nr&63,(He<=2047||He>=55296&&He<=57343)&&(He=null))):yt===4&&(jt=k[Te+1],nr=k[Te+2],dr=k[Te+3],(jt&192)===128&&(nr&192)===128&&(dr&192)===128&&(He=(De&15)<<18|(jt&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 pv(k,C,X){return ei.decode(k.subarray(C,X))}function mv(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(iv,C)}function iv(k,C,X){if(k===3){var se=X.readMessage(Xd,{}),Te=se.id,De=se.bitmap,He=se.width,yt=se.height,jt=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:jt,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 gv(k){return new An(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),jt=Math.max(jt,rn.x+rn.w),rn.w===bn.w&&rn.h===bn.h){var $n=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(ov.forText(C.scale,C.fontStack||X));for(var se=this.sections.length-1,Te=0;Te=r0?null:++this.imageSectionID:(this.imageSectionID=t0,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)il=Du.rect,Hl=Du.metrics;else{var cf=C[Ko.fontStack],Tf=cf&&cf[ls];if(!Tf)continue;Hl=Tf.metrics}ms=(Ei-Ko.scale)*br}Uu?(k.verticalizable=!0,po.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:dl,metrics:Hl,rect:il}),rn+=qc*Ko.scale+nr):(po.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:dl,metrics:Hl,rect:il}),rn+=Hl.advance*Ko.scale+nr)}if(po.length!==0){var _v=rn-nr;bn=Math.max(_v,bn),C6(po,0,po.length-1,ja,ss)}rn=0;var xv=De*Ei+ss;xo.lineOffset=Math.max(ss,$i),Kr+=xv,$n=Math.max(xv,$n),++wa}var zd=Kr-wf,Sv=yT(He),Mv=Sv.horizontalAlign,vd=Sv.verticalAlign;L6(k.positionedLines,ja,Mv,vd,bn,$n,De,zd,Te.length),k.top+=-vd*zd,k.bottom=k.top+zd,k.left+=-Mv*bn,k.right=k.left+bn}function C6(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,jt=C;jt<=X;jt++)k[jt].x-=yt,k[jt].y+=Te}function L6(k,C,X,se,Te,De,He,yt,jt){var nr=(C-X)*Te,dr=0;De!==He?dr=-yt*se-wf:dr=(-se*jt+.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 jt=[],nr=0;ytse;)nr-=jt.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-jt)/Kr,$n=hu(Fr.x,rn.x,bn),ja=hu(Fr.y,rn.y,bn),wa=new f1($n,ja,rn.angleTo(Fr),dr);return wa._round(),!He||HS(k,wa,yt,He,C)?wa:void 0}jt+=Kr}}function Gg(k,C,X,se,Te,De,He,yt,jt){var nr=Jv(se,De,He),dr=Wm(se,Te),Fr=dr*He,rn=k[0].x===0||k[0].x===jt||k[0].y===0||k[0].y===jt;C-Fr=0&&vi=0&&Ei=0&&rn+nr<=dr){var $i=new f1(vi,Ei,mi,bn);$i._round(),(!se||HS(k,$i,De,se,Te))&&Kr.push($i)}}Fr+=wa}return!yt&&!Kr.length&&!He&&(Kr=a0(k,Fr/2,X,se,Te,De,He,!0,jt)),Kr}function c8(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()),(!jt||!dr.equals(jt[jt.length-1]))&&(jt=[dr],De.push(jt)),jt.push(Fr)))))}return De}var ww=bf;function f8(k,C,X,se){var Te=[],De=k.image,He=De.pixelRatio,yt=De.paddedRect.w-2*ww,jt=De.paddedRect.h-2*ww,nr=k.right-k.left,dr=k.bottom-k.top,Fr=De.stretchX||[[0,yt]],rn=De.stretchY||[[0,jt]],Kr=function(ju,Du){return ju+Du[1]-Du[0]},bn=Fr.reduce(Kr,0),$n=rn.reduce(Kr,0),ja=yt-bn,wa=jt-$n,mi=0,Ja=bn,vi=0,Ei=$n,$i=0,xo=ja,po=0,ss=wa;if(De.content&&se){var Bo=De.content;mi=GS(Fr,0,Bo[0]),vi=GS(rn,0,Bo[1]),Ja=GS(Fr,Bo[0],Bo[2]),Ei=GS(rn,Bo[1],Bo[3]),$i=Bo[0]-mi,po=Bo[1]-vi,xo=Bo[2]-Bo[0]-Ja,ss=Bo[3]-Bo[1]-Ei}var Ko=function(ju,Du,cf,Tf){var ph=XS(ju.stretch-mi,Ja,nr,k.left),Ch=YS(ju.fixed-$i,xo,ju.stretch,bn),Dd=XS(Du.stretch-vi,Ei,dr,k.top),nd=YS(Du.fixed-po,ss,Du.stretch,$n),_v=XS(cf.stretch-mi,Ja,nr,k.left),xv=YS(cf.fixed-$i,xo,cf.stretch,bn),zd=XS(Tf.stretch-vi,Ei,dr,k.top),Sv=YS(Tf.fixed-po,ss,Tf.stretch,$n),Mv=new i(ph,Dd),vd=new i(_v,Dd),Ev=new i(_v,zd),Lp=new i(ph,zd),Zg=new i(Ch/He,nd/He),p1=new i(xv/He,Sv/He),m1=C*Math.PI/180;if(m1){var g1=Math.sin(m1),Lw=Math.cos(m1),M0=[Lw,-g1,g1,Lw];Mv._matMult(M0),vd._matMult(M0),Lp._matMult(M0),Ev._matMult(M0)}var QS=ju.stretch+ju.fixed,U6=cf.stretch+cf.fixed,eM=Du.stretch+Du.fixed,j6=Tf.stretch+Tf.fixed,i0={x:De.paddedRect.x+ww+QS,y:De.paddedRect.y+ww+eM,w:U6-QS,h:j6-eM},Pw=xo/He/nr,tM=ss/He/dr;return{tl:Mv,tr:vd,bl:Lp,br:Ev,tex:i0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Zg,pixelOffsetBR:p1,minFontScaleX:Pw,minFontScaleY:tM,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:jt+1}));else for(var dl=h8(Fr,ja,bn),ls=h8(rn,wa,$n),ms=0;ms0&&(bn=Math.max(10,bn),this.circleDiameter=bn)}else{var $n=He.top*yt-jt,ja=He.bottom*yt+jt,wa=He.left*yt-jt,mi=He.right*yt+jt,Ja=He.collisionPadding;if(Ja&&(wa-=Ja[0]*yt,$n-=Ja[1]*yt,mi+=Ja[2]*yt,ja+=Ja[3]*yt),dr){var vi=new i(wa,$n),Ei=new i(mi,$n),$i=new i(wa,ja),xo=new i(mi,ja),po=dr*Math.PI/180;vi._rotate(po),Ei._rotate(po),$i._rotate(po),xo._rotate(po),wa=Math.min(vi.x,Ei.x,$i.x,xo.x),mi=Math.max(vi.x,Ei.x,$i.x,xo.x),$n=Math.min(vi.y,Ei.y,$i.y,xo.y),ja=Math.max(vi.y,Ei.y,$i.y,xo.y)}C.emplaceBack(X.x,X.y,wa,$n,mi,ja,se,Te,De)}this.boxEndIndex=C.length},Tw=function(C,X){if(C===void 0&&(C=[]),X===void 0&&(X=rF),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)};Tw.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},Tw.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}},Tw.prototype.peek=function(){return this.data[0]},Tw.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},Tw.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]=jt,C=yt}se[C]=He};function rF(k,C){return kC?1:0}function nF(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],jt=0;jtDe)&&(De=nr.x),(!jt||nr.y>He)&&(He=nr.y)}var dr=De-se,Fr=He-Te,rn=Math.min(dr,Fr),Kr=rn/2,bn=new Tw([],aF);if(rn===0)return new i(se,Te);for(var $n=se;$nwa.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 Aw(Ja.p.x-Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Aw(Ja.p.x+Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Aw(Ja.p.x-Kr,Ja.p.y+Kr,Kr,k)),bn.push(new Aw(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 aF(k,C){return C.max-k.max}function Aw(k,C,X,se){this.p=new i(k,C),this.h=X,this.d=iF(this.p,se),this.max=this.d+this.h*Math.SQRT2}function iF(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 oF(k){for(var C=0,X=0,se=0,Te=k[0],De=0,He=Te.length,yt=He-1;De=qi||M0.y<0||M0.y>=qi||uF(k,M0,Lw,X,se,Te,ls,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,wa,Ei,po,jt,Ja,$i,ss,Kr,C,De,nr,dr,He)};if(Bo==="line")for(var Hl=0,il=c8(C.geometry,0,0,qi,qi);Hl1){var Dd=n0(Ch,xo,X.vertical||bn,se,$n,mi);Dd&&ms(Ch,Dd)}}else if(C.type==="Polygon")for(var nd=0,_v=A0(C.geometry,0);nd<_v.length;nd+=1){var xv=_v[nd],zd=nF(xv,16);ms(xv[0],new f1(zd.x,zd.y,0))}else if(C.type==="LineString")for(var Sv=0,Mv=C.geometry;Svd1&&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,$n,wa,yt,De,He,nr,C,jt.lineStartIndex,jt.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*Ei.compositeIconSizes[0].evaluate(vi,{},xo),ed*Ei.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&&(il=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 Zg=yt.layout.get("text-rotate").evaluate(vi,{},xo);Ko=new ZS(jt,C,nr,dr,Fr,Lp,rn,Kr,bn,Zg)}var p1=Lp.positionedLines.length===1;if(Nu+=v8(k,C,Lp,De,yt,bn,vi,$n,Bo,se.vertical?Hf.horizontal:Hf.horizontalOnly,p1?Object.keys(se.horizontal):[Ev],Du,Uu,Ei,xo),p1)break}se.vertical&&(qc+=v8(k,C,se.vertical,De,yt,bn,vi,$n,Bo,Hf.vertical,["vertical"],Du,ju,Ei,xo));var m1=Ko?Ko.boxStartIndex:k.collisionBoxArray.length,g1=Ko?Ko.boxEndIndex:k.collisionBoxArray.length,Lw=ls?ls.boxStartIndex:k.collisionBoxArray.length,M0=ls?ls.boxEndIndex:k.collisionBoxArray.length,QS=dl?dl.boxStartIndex:k.collisionBoxArray.length,U6=dl?dl.boxEndIndex:k.collisionBoxArray.length,eM=ms?ms.boxStartIndex:k.collisionBoxArray.length,j6=ms?ms.boxEndIndex:k.collisionBoxArray.length,i0=-1,Pw=function(TT,P8){return TT&&TT.circleDiameter?Math.max(TT.circleDiameter,P8):P8};i0=Pw(Ko,i0),i0=Pw(ls,i0),i0=Pw(dl,i0),i0=Pw(ms,i0);var tM=i0>-1?1:0;tM&&(i0*=po/br),k.glyphOffsetArray.length>=jc.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,Lw,M0,QS,U6,eM,j6,nr,Nu,qc,Hl,il,tM,0,rn,Tf,ph,i0)}function cF(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=jt.value.kind!=="constant"||!!jt.value.value||Object.keys(jt.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,$n=new El(this.zoom),ja=0,wa=C;ja=0;for(var qc=0,Uu=ss.sections;qc=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 nr=0;nr0},jc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},jc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},jc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},jc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},jc.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)===jt&&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",jc,{omit:["layers","collisionBoxArray","features","compareText"]}),jc.MAX_GLYPHS=65535,jc.addDynamicAttributes=z6;function vF(k,C){return C.replace(/{([^{}]+)}/g,function(X,se){return se in k?String(k[se]):""})}var pF=new Za({"symbol-placement":new gn(di.layout_symbol["symbol-placement"]),"symbol-spacing":new gn(di.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gn(di.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new pn(di.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gn(di.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gn(di.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gn(di.layout_symbol["icon-ignore-placement"]),"icon-optional":new gn(di.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gn(di.layout_symbol["icon-rotation-alignment"]),"icon-size":new pn(di.layout_symbol["icon-size"]),"icon-text-fit":new gn(di.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gn(di.layout_symbol["icon-text-fit-padding"]),"icon-image":new pn(di.layout_symbol["icon-image"]),"icon-rotate":new pn(di.layout_symbol["icon-rotate"]),"icon-padding":new gn(di.layout_symbol["icon-padding"]),"icon-keep-upright":new gn(di.layout_symbol["icon-keep-upright"]),"icon-offset":new pn(di.layout_symbol["icon-offset"]),"icon-anchor":new pn(di.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gn(di.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gn(di.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gn(di.layout_symbol["text-rotation-alignment"]),"text-field":new pn(di.layout_symbol["text-field"]),"text-font":new pn(di.layout_symbol["text-font"]),"text-size":new pn(di.layout_symbol["text-size"]),"text-max-width":new pn(di.layout_symbol["text-max-width"]),"text-line-height":new gn(di.layout_symbol["text-line-height"]),"text-letter-spacing":new pn(di.layout_symbol["text-letter-spacing"]),"text-justify":new pn(di.layout_symbol["text-justify"]),"text-radial-offset":new pn(di.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gn(di.layout_symbol["text-variable-anchor"]),"text-anchor":new pn(di.layout_symbol["text-anchor"]),"text-max-angle":new gn(di.layout_symbol["text-max-angle"]),"text-writing-mode":new gn(di.layout_symbol["text-writing-mode"]),"text-rotate":new pn(di.layout_symbol["text-rotate"]),"text-padding":new gn(di.layout_symbol["text-padding"]),"text-keep-upright":new gn(di.layout_symbol["text-keep-upright"]),"text-transform":new pn(di.layout_symbol["text-transform"]),"text-offset":new pn(di.layout_symbol["text-offset"]),"text-allow-overlap":new gn(di.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gn(di.layout_symbol["text-ignore-placement"]),"text-optional":new gn(di.layout_symbol["text-optional"])}),mF=new Za({"icon-opacity":new pn(di.paint_symbol["icon-opacity"]),"icon-color":new pn(di.paint_symbol["icon-color"]),"icon-halo-color":new pn(di.paint_symbol["icon-halo-color"]),"icon-halo-width":new pn(di.paint_symbol["icon-halo-width"]),"icon-halo-blur":new pn(di.paint_symbol["icon-halo-blur"]),"icon-translate":new gn(di.paint_symbol["icon-translate"]),"icon-translate-anchor":new gn(di.paint_symbol["icon-translate-anchor"]),"text-opacity":new pn(di.paint_symbol["text-opacity"]),"text-color":new pn(di.paint_symbol["text-color"],{runtimeType:Xl,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new pn(di.paint_symbol["text-halo-color"]),"text-halo-width":new pn(di.paint_symbol["text-halo-width"]),"text-halo-blur":new pn(di.paint_symbol["text-halo-blur"]),"text-translate":new gn(di.paint_symbol["text-translate"]),"text-translate-anchor":new gn(di.paint_symbol["text-translate-anchor"])}),O6={paint:mF,layout:pF},Ew=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Au,this.defaultValue=C};Ew.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},Ew.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var X=this.defaultValue.value;C(X._styleExpression.expression)}},Ew.prototype.outputDefined=function(){return!1},Ew.prototype.serialize=function(){return null},tr("FormatSectionOverride",Ew,{omit:["defaultValue"]});var gF=(function(k){function C(X){k.call(this,X,O6)}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,jt=De;yt",targetMapId:Te,sourceMapId:He.mapId})}}},kw.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)},kw.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)}},kw.prototype.processTask=function(C,X){var se=this;if(X.type===""){var Te=this.callbacks[C];delete this.callbacks[C],Te&&(X.error?Te(hn(X.error)):Te(null,hn(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},jt=null,nr=hn(X.data);if(this.parent[X.type])jt=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);jt=Fr[dr[1]](nr,yt)}else yt(new Error("Could not find function "+X.type));!De&&jt&&jt.cancel&&(this.cancelCallbacks[C]=jt.cancel)}},kw.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function kF(k,C,X){C=Math.pow(2,X)-C-1;var se=x8(k*256,C*256,X),Te=x8((k+1)*256,(C+1)*256,X);return se[0]+","+se[1]+","+Te[0]+","+Te[1]}function x8(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 b8=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=b8*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 w8=2*Math.PI*b8;function T8(k){return w8*Math.cos(k*Math.PI/180)}function A8(k){return(180+k)/360}function S8(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function M8(k,C){return k/T8(C)}function CF(k){return k*360-180}function B6(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function LF(k,C){return k*T8(B6(C))}function PF(k){return 1/Math.cos(k*Math.PI/180)}var Q_=function(C,X,se){se===void 0&&(se=0),this.x=+C,this.y=+X,this.z=+se};Q_.fromLngLat=function(C,X){X===void 0&&(X=0);var se=Gf.convert(C);return new Q_(A8(se.lng),S8(se.lat),M8(X,se.lat))},Q_.prototype.toLngLat=function(){return new Gf(CF(this.x),B6(this.y))},Q_.prototype.toAltitude=function(){return LF(this.z,this.y)},Q_.prototype.meterInMercatorCoordinateUnits=function(){return 1/w8*PF(B6(this.y))};var ex=function(C,X,se){this.z=C,this.x=X,this.y=se,this.key=wT(0,C,C,X,se)};ex.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},ex.prototype.url=function(C,X){var se=kF(this.x,this.y,this.z),Te=RF(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)},ex.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)},ex.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var E8=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 ex(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)},Xg.prototype._unpackMapbox=function(C,X,se){return(C*256*256+X*256+se)/10-1e4},Xg.prototype._unpackTerrarium=function(C,X,se){return C*256+X+se/256-32768},Xg.prototype.getPixels=function(){return new Hd({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Xg.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 jt=-X*this.dim,nr=-se*this.dim,dr=He;dr=0&&Fr[3]>=0&&jt.insert(yt,Fr[0],Fr[1],Fr[2],Fr[3])}},Yg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Hg.VectorTile(new An(this.rawTileData)).layers,this.sourceLayerCoder=new KS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yg.prototype.query=function(C,X,se,Te){var De=this;this.loadVTLayers();for(var He=C.params||{},yt=qi/C.tileSize/C.scale,jt=tt(He.filter),nr=C.queryGeometry,dr=C.queryPadding*yt,Fr=C8(nr),rn=this.grid.query(Fr.minX-dr,Fr.minY-dr,Fr.maxX+dr,Fr.maxY+dr),Kr=C8(C.cameraQueryGeometry),bn=this.grid3D.query(Kr.minX-dr,Kr.minY-dr,Kr.maxX+dr,Kr.maxY+dr,function($i,xo,po,ss){return Ep(C.cameraQueryGeometry,$i-dr,xo-dr,po+dr,ss+dr)}),$n=0,ja=bn;$nTe)De=!1;else if(!X)De=!0;else if(this.expirationTime=qr.maxzoom)&&qr.visibility!=="none"){f(Dr,this.zoom,ur);var ln=ma[qr.id]=qr.createBucket({index:Jn.bucketLayerIDs.length,layers:Dr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pi,sourceID:this.source});ln.populate(Mi,da,this.tileID.canonical),Jn.bucketLayerIDs.push(Dr.map(function(cn){return cn.id}))}}}}var Jr,At,lr,zr,un=e.mapObject(da.glyphDependencies,function(cn){return Object.keys(cn).map(Number)});Object.keys(un).length?Gr.send("getGlyphs",{uid:this.uid,stacks:un},function(cn,In){Jr||(Jr=cn,At=In,jn.call(mn))}):At={};var Rn=Object.keys(da.iconDependencies);Rn.length?Gr.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(cn,In){Jr||(Jr=cn,lr=In,jn.call(mn))}):lr={};var qn=Object.keys(da.patternDependencies);qn.length?Gr.send("getImages",{icons:qn,source:this.source,tileID:this.tileID,type:"patterns"},function(cn,In){Jr||(Jr=cn,zr=In,jn.call(mn))}):zr={},jn.call(this);function jn(){if(Jr)return sn(Jr);if(At&&lr&&zr){var cn=new a(At),In=new e.ImageAtlas(lr,zr);for(var gi in ma){var Ea=ma[gi];Ea instanceof e.SymbolBucket?(f(Ea.layers,this.zoom,ur),e.performSymbolLayout(Ea,At,cn.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(da,this.tileID.canonical,In.patternPositions))}this.status="done",sn(null,{buckets:e.values(ma).filter(function(Ci){return!Ci.isEmpty()}),featureIndex:Jn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:cn.image,imageAtlas:In,glyphMap:this.returnDependencies?At:null,iconMap:this.returnDependencies?lr:null,glyphPositions:this.returnDependencies?cn.positions:null})}}};function f(sr,qt,or){for(var ur=new e.EvaluationParameters(qt),Gr=0,sn=sr;Gr=0!=!!qt&&sr.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=[],or=0,ur=this._feature.geometry;or"u"&&(ur.push(Tn),Jn=ur.length-1,sn[Tn]=Jn),qt.writeVarint(Jn);var ma=or.properties[Tn],da=typeof ma;da!=="string"&&da!=="boolean"&&da!=="number"&&(ma=JSON.stringify(ma));var _a=da+":"+ma,Ca=mn[_a];typeof Ca>"u"&&(Gr.push(ma),Ca=Gr.length-1,mn[_a]=Ca),qt.writeVarint(Ca)}}function re(sr,qt){return(qt<<3)+(sr&7)}function fe(sr){return sr<<1^sr>>31}function le(sr,qt){for(var or=sr.loadGeometry(),ur=sr.type,Gr=0,sn=0,mn=or.length,Tn=0;Tn>1;ee(sr,qt,mn,ur,Gr,sn%2),V(sr,qt,or,ur,mn-1,sn+1),V(sr,qt,or,mn+1,Gr,sn+1)}}function ee(sr,qt,or,ur,Gr,sn){for(;Gr>ur;){if(Gr-ur>600){var mn=Gr-ur+1,Tn=or-ur+1,Jn=Math.log(mn),ma=.5*Math.exp(2*Jn/3),da=.5*Math.sqrt(Jn*ma*(mn-ma)/mn)*(Tn-mn/2<0?-1:1),_a=Math.max(ur,Math.floor(or-Tn*ma/mn+da)),Ca=Math.min(Gr,Math.floor(or+(mn-Tn)*ma/mn+da));ee(sr,qt,or,_a,Ca,sn)}var Hn=qt[2*or+sn],pi=ur,Mi=Gr;for(ne(sr,qt,ur,or),qt[2*Gr+sn]>Hn&&ne(sr,qt,ur,Gr);piHn;)Mi--}qt[2*ur+sn]===Hn?ne(sr,qt,ur,Mi):(Mi++,ne(sr,qt,Mi,Gr)),Mi<=or&&(ur=Mi+1),or<=Mi&&(Gr=Mi-1)}}function ne(sr,qt,or,ur){$(sr,or,ur),$(qt,2*or,2*ur),$(qt,2*or+1,2*ur+1)}function $(sr,qt,or){var ur=sr[qt];sr[qt]=sr[or],sr[or]=ur}function ue(sr,qt,or,ur,Gr,sn,mn){for(var Tn=[0,sr.length-1,0],Jn=[],ma,da;Tn.length;){var _a=Tn.pop(),Ca=Tn.pop(),Hn=Tn.pop();if(Ca-Hn<=mn){for(var pi=Hn;pi<=Ca;pi++)ma=qt[2*pi],da=qt[2*pi+1],ma>=or&&ma<=Gr&&da>=ur&&da<=sn&&Jn.push(sr[pi]);continue}var Mi=Math.floor((Hn+Ca)/2);ma=qt[2*Mi],da=qt[2*Mi+1],ma>=or&&ma<=Gr&&da>=ur&&da<=sn&&Jn.push(sr[Mi]);var Dt=(_a+1)%2;(_a===0?or<=ma:ur<=da)&&(Tn.push(Hn),Tn.push(Mi-1),Tn.push(Dt)),(_a===0?Gr>=ma:sn>=da)&&(Tn.push(Mi+1),Tn.push(Ca),Tn.push(Dt))}return Jn}function te(sr,qt,or,ur,Gr,sn){for(var mn=[0,sr.length-1,0],Tn=[],Jn=Gr*Gr;mn.length;){var ma=mn.pop(),da=mn.pop(),_a=mn.pop();if(da-_a<=sn){for(var Ca=_a;Ca<=da;Ca++)H(qt[2*Ca],qt[2*Ca+1],or,ur)<=Jn&&Tn.push(sr[Ca]);continue}var Hn=Math.floor((_a+da)/2),pi=qt[2*Hn],Mi=qt[2*Hn+1];H(pi,Mi,or,ur)<=Jn&&Tn.push(sr[Hn]);var Dt=(ma+1)%2;(ma===0?or-Gr<=pi:ur-Gr<=Mi)&&(mn.push(_a),mn.push(Hn-1),mn.push(Dt)),(ma===0?or+Gr>=pi:ur+Gr>=Mi)&&(mn.push(Hn+1),mn.push(da),mn.push(Dt))}return Tn}function H(sr,qt,or,ur){var Gr=sr-or,sn=qt-ur;return Gr*Gr+sn*sn}var ae=function(sr){return sr[0]},ie=function(sr){return sr[1]},de=function(qt,or,ur,Gr,sn){or===void 0&&(or=ae),ur===void 0&&(ur=ie),Gr===void 0&&(Gr=64),sn===void 0&&(sn=Float64Array),this.nodeSize=Gr,this.points=qt;for(var mn=qt.length<65536?Uint16Array:Uint32Array,Tn=this.ids=new mn(qt.length),Jn=this.coords=new sn(qt.length*2),ma=0;ma=Gr;da--){var _a=+Date.now();Jn=this._cluster(Jn,da),this.trees[da]=new de(Jn,pe,Ne,mn,Float32Array),ur&&console.log("z%d: %d clusters in %dms",da,Jn.length,+Date.now()-_a)}return ur&&console.timeEnd("total time"),this},Le.prototype.getClusters=function(qt,or){var ur=((qt[0]+180)%360+360)%360-180,Gr=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)ur=-180,sn=180;else if(ur>sn){var Tn=this.getClusters([ur,Gr,180,mn],or),Jn=this.getClusters([-180,Gr,sn,mn],or);return Tn.concat(Jn)}for(var ma=this.trees[this._limitZoom(or)],da=ma.range(ct(ur),at(mn),ct(sn),at(Gr)),_a=[],Ca=0,Hn=da;Caor&&(Mi+=jr.numPoints||1)}if(Mi>=Jn){for(var Vr=_a.x*pi,Dr=_a.y*pi,qr=Tn&&pi>1?this._map(_a,!0):null,ln=(da<<5)+(or+1)+this.points.length,Jr=0,At=Hn;Jr1)for(var Rn=0,qn=Hn;Rn>5},Le.prototype._getOriginZoom=function(qt){return(qt-this.points.length)%32},Le.prototype._map=function(qt,or){if(qt.numPoints)return or?Ae({},qt.properties):qt.properties;var ur=this.points[qt.index].properties,Gr=this.options.map(ur);return or&&Gr===ur?Ae({},Gr):Gr};function Fe(sr,qt,or,ur,Gr){return{x:sr,y:qt,zoom:1/0,id:or,parentId:-1,numPoints:ur,properties:Gr}}function ze(sr,qt){var or=sr.geometry.coordinates,ur=or[0],Gr=or[1];return{x:ct(ur),y:at(Gr),zoom:1/0,index:qt,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 qt=sr.numPoints,or=qt>=1e4?Math.round(qt/1e3)+"k":qt>=1e3?Math.round(qt/100)/10+"k":qt;return Ae(Ae({},sr.properties),{cluster:!0,cluster_id:sr.id,point_count:qt,point_count_abbreviated:or})}function ct(sr){return sr/360+.5}function at(sr){var qt=Math.sin(sr*Math.PI/180),or=.5-.25*Math.log((1+qt)/(1-qt))/Math.PI;return or<0?0:or>1?1:or}function et(sr){return(sr-.5)*360}function Pe(sr){var qt=(180-sr*360)*Math.PI/180;return 360*Math.atan(Math.exp(qt))/Math.PI-90}function Ae(sr,qt){for(var or in qt)sr[or]=qt[or];return sr}function pe(sr){return sr.x}function Ne(sr){return sr.y}function lt(sr,qt,or,ur){for(var Gr=ur,sn=or-qt>>1,mn=or-qt,Tn,Jn=sr[qt],ma=sr[qt+1],da=sr[or],_a=sr[or+1],Ca=qt+3;CaGr)Tn=Ca,Gr=Hn;else if(Hn===Gr){var pi=Math.abs(Ca-sn);piur&&(Tn-qt>3&<(sr,qt,Tn,ur),sr[Tn+2]=Gr,or-Tn>3&<(sr,Tn,or,ur))}function dt(sr,qt,or,ur,Gr,sn){var mn=Gr-or,Tn=sn-ur;if(mn!==0||Tn!==0){var Jn=((sr-or)*mn+(qt-ur)*Tn)/(mn*mn+Tn*Tn);Jn>1?(or=Gr,ur=sn):Jn>0&&(or+=mn*Jn,ur+=Tn*Jn)}return mn=sr-or,Tn=qt-ur,mn*mn+Tn*Tn}function nt(sr,qt,or,ur){var Gr={id:typeof sr>"u"?null:sr,type:qt,geometry:or,tags:ur,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ft(Gr),Gr}function Ft(sr){var qt=sr.geometry,or=sr.type;if(or==="Point"||or==="MultiPoint"||or==="LineString")Nt(sr,qt);else if(or==="Polygon"||or==="MultiLineString")for(var ur=0;ur0&&(ur?mn+=(Gr*ma-Jn*sn)/2:mn+=Math.sqrt(Math.pow(Jn-Gr,2)+Math.pow(ma-sn,2))),Gr=Jn,sn=ma}var da=qt.length-3;qt[2]=1,lt(qt,0,da,or),qt[da+2]=1,qt.size=Math.abs(mn),qt.start=0,qt.end=qt.size}function $r(sr,qt,or,ur){for(var Gr=0;Gr1?1:or}function Mt(sr,qt,or,ur,Gr,sn,mn,Tn){if(or/=qt,ur/=qt,sn>=or&&mn=ur)return null;for(var Jn=[],ma=0;ma=or&&pi=ur)continue;var Mi=[];if(Ca==="Point"||Ca==="MultiPoint")je(_a,Mi,or,ur,Gr);else if(Ca==="LineString")Je(_a,Mi,or,ur,Gr,!1,Tn.lineMetrics);else if(Ca==="MultiLineString")xe(_a,Mi,or,ur,Gr,!1);else if(Ca==="Polygon")xe(_a,Mi,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&&Mi.push(xt)}if(Mi.length){if(Tn.lineMetrics&&Ca==="LineString"){for(Dt=0;Dt=or&&mn<=ur&&(qt.push(sr[sn]),qt.push(sr[sn+1]),qt.push(sr[sn+2]))}}function Je(sr,qt,or,ur,Gr,sn,mn){for(var Tn=ke(sr),Jn=Gr===0?Ee:Xe,ma=sr.start,da,_a,Ca=0;Caor&&(_a=Jn(Tn,Hn,pi,Dt,xt,or),mn&&(Tn.start=ma+da*_a)):Cr>ur?jr=or&&(_a=Jn(Tn,Hn,pi,Dt,xt,or),Vr=!0),jr>ur&&Cr<=ur&&(_a=Jn(Tn,Hn,pi,Dt,xt,ur),Vr=!0),!sn&&Vr&&(mn&&(Tn.end=ma+da*_a),qt.push(Tn),Tn=ke(sr)),mn&&(ma+=da)}var Dr=sr.length-3;Hn=sr[Dr],pi=sr[Dr+1],Mi=sr[Dr+2],Cr=Gr===0?Hn:pi,Cr>=or&&Cr<=ur&&ye(Tn,Hn,pi,Mi),Dr=Tn.length-3,sn&&Dr>=3&&(Tn[Dr]!==Tn[0]||Tn[Dr+1]!==Tn[1])&&ye(Tn,Tn[0],Tn[1],Tn[2]),Tn.length&&qt.push(Tn)}function ke(sr){var qt=[];return qt.size=sr.size,qt.start=sr.start,qt.end=sr.end,qt}function xe(sr,qt,or,ur,Gr,sn){for(var mn=0;mnmn.maxX&&(mn.maxX=da),_a>mn.maxY&&(mn.maxY=_a)}return mn}function mr(sr,qt,or,ur){var Gr=qt.geometry,sn=qt.type,mn=[];if(sn==="Point"||sn==="MultiPoint")for(var Tn=0;Tn0&&qt.size<(Gr?mn:ur)){or.numPoints+=qt.length/3;return}for(var Tn=[],Jn=0;Jnmn)&&(or.numSimplified++,Tn.push(qt[Jn]),Tn.push(qt[Jn+1])),or.numPoints++;Gr&&Br(Tn,sn),sr.push(Tn)}function Br(sr,qt){for(var or=0,ur=0,Gr=sr.length,sn=Gr-2;ur0===qt)for(ur=0,Gr=sr.length;ur24)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 ur=Qt(sr,qt);this.tiles={},this.tileCoords=[],or&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ur=Qe(ur,qt),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)))}Wn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Wn.prototype.splitTile=function(sr,qt,or,ur,Gr,sn,mn){for(var Tn=[sr,qt,or,ur],Jn=this.options,ma=Jn.debug;Tn.length;){ur=Tn.pop(),or=Tn.pop(),qt=Tn.pop(),sr=Tn.pop();var da=1<1&&console.time("creation"),Ca=this.tiles[_a]=xr(sr,qt,or,ur,Jn),this.tileCoords.push({z:qt,x:or,y:ur}),ma)){ma>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,or,ur,Ca.numFeatures,Ca.numPoints,Ca.numSimplified),console.timeEnd("creation"));var Hn="z"+qt;this.stats[Hn]=(this.stats[Hn]||0)+1,this.total++}if(Ca.source=sr,Gr){if(qt===Jn.maxZoom||qt===Gr)continue;var pi=1<1&&console.time("clipping");var Mi=.5*Jn.buffer/Jn.extent,Dt=.5-Mi,xt=.5+Mi,Cr=1+Mi,jr,Vr,Dr,qr,ln,Jr;jr=Vr=Dr=qr=null,ln=Mt(sr,da,or-Mi,or+xt,0,Ca.minX,Ca.maxX,Jn),Jr=Mt(sr,da,or+Dt,or+Cr,0,Ca.minX,Ca.maxX,Jn),sr=null,ln&&(jr=Mt(ln,da,ur-Mi,ur+xt,1,Ca.minY,Ca.maxY,Jn),Vr=Mt(ln,da,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Jn),ln=null),Jr&&(Dr=Mt(Jr,da,ur-Mi,ur+xt,1,Ca.minY,Ca.maxY,Jn),qr=Mt(Jr,da,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Jn),Jr=null),ma>1&&console.timeEnd("clipping"),Tn.push(jr||[],qt+1,or*2,ur*2),Tn.push(Vr||[],qt+1,or*2,ur*2+1),Tn.push(Dr||[],qt+1,or*2+1,ur*2),Tn.push(qr||[],qt+1,or*2+1,ur*2+1)}}},Wn.prototype.getTile=function(sr,qt,or){var ur=this.options,Gr=ur.extent,sn=ur.debug;if(sr<0||sr>24)return null;var mn=1<1&&console.log("drilling down to z%d-%d-%d",sr,qt,or);for(var Jn=sr,ma=qt,da=or,_a;!_a&&Jn>0;)Jn--,ma=Math.floor(ma/2),da=Math.floor(da/2),_a=this.tiles[Vn(Jn,ma,da)];return!_a||!_a.source?null:(sn>1&&console.log("found parent tile z%d-%d-%d",Jn,ma,da),sn>1&&console.time("drilling down"),this.splitTile(_a.source,Jn,ma,da,sr,qt,or),sn>1&&console.timeEnd("drilling down"),this.tiles[Tn]?Ot(this.tiles[Tn],Gr):null)};function Vn(sr,qt,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,Wt){pt=null,qe||(qe=Tt,J=Wt,it())}),$e=e.getImage(q.transformRequest(q.normalizeSpriteURL(be,ft,".png"),e.ResourceType.SpriteImage),function(Tt,Wt){$e=null,qe||(qe=Tt,_e=Wt,it())});function it(){if(qe)he(qe);else if(J&&_e){var Tt=e.browser.getImageData(_e),Wt={};for(var Vt in J){var Jt=J[Vt],ir=Jt.width,rr=Jt.height,Bt=Jt.x,Yt=Jt.y,Ht=Jt.sdf,Or=Jt.pixelRatio,Wr=Jt.stretchX,fn=Jt.stretchY,ua=Jt.content,Zn=new e.RGBAImage({width:ir,height:rr});e.RGBAImage.copy(Tt,Zn,{x:Bt,y:Yt},{x:0,y:0},{width:ir,height:rr}),Wt[Vt]={data:Zn,pixelRatio:Or,sdf:Ht,stretchX:Wr,stretchY:fn,content:ua}}he(null,Wt)}}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:Wt,id:Vt,glyph:ir});return}var Bt=Jt.requests[rr];Bt||(Bt=Jt.requests[rr]=[],d.loadGlyphRange(Wt,rr,J.url,J.requestManager,function(Yt,Ht){if(Ht){for(var Or in Ht)J._doesCharSupportLocalGlyph(+Or)||(Jt.glyphs[+Or]=Ht[+Or]);Jt.ranges[rr]=!0}for(var Wr=0,fn=Bt;Wr1&&(it=q[++$e]);var Wt=Math.abs(Tt-it.left),Vt=Math.abs(Tt-it.right),Jt=Math.min(Wt,Vt),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 Wt=Math.abs(Tt-it.left),Vt=Math.abs(Tt-it.right),Jt=Math.min(Wt,Vt),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,Wt=$e;Ttthis.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(Wt)>1&&(Math.abs(Wt+Jt)===1?Wt+=Jt:Math.abs(Wt-Jt)===1&&(Wt-=Jt)),!(!Tt.dem||!it.dem)&&(it.dem.backfillBorder(Tt.dem,Wt,Vt),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 Wt=it;Wt.overscaledZ>_e;)if(Wt=Wt.scaledTo(Wt.overscaledZ-1),J[Wt.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 Wt in this._timers)clearTimeout(this._timers[Wt]),delete this._timers[Wt];for(var Vt in this._tiles){var Jt=this._tiles[Vt];this._setTileReloadTimer(Vt,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(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 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(Jn(this._source.type)){for(var Tt={},Wt={},Vt=Object.keys(it),Jt=0,ir=Vt;Jtthis._source.maxzoom){var Ht=Bt.children(this._source.maxzoom)[0],Or=this.getTile(Ht);if(Or&&Or.hasData()){qe[Ht.key]=Ht;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 fn=Yt.wasRequested(),ua=Bt.overscaledZ-1;ua>=pt;--ua){var Zn=Bt.scaledTo(ua);if(ft[Zn.key]||(ft[Zn.key]=!0,Yt=this.getTile(Zn),!Yt&&fn&&(Yt=this._addTile(Zn)),Yt&&(qe[Zn.key]=Zn,fn=Yt.wasRequested(),Yt.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(ua){return $e.pointCoordinate(ua)}),Wt=it.map(function(ua){return $e.pointCoordinate(ua)}),Vt=this.getIds(),Jt=1/0,ir=1/0,rr=-1/0,Bt=-1/0,Yt=0,Ht=Wt;Yt=0&&Pa[1].y+va>=0){var ha=Tt.map(function(Ka){return Gn.getTilePoint(Ka)}),Fa=Wt.map(function(Ka){return Gn.getTilePoint(Ka)});pt.push({tile:Zn,tileID:Gn,queryGeometry:ha,cameraQueryGeometry:Fa,scale:ca})}}},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 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);mn.maxOverzooming=10,mn.maxUnderzooming=3;function Tn(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 ma(){return new e.window.Worker(_s.workerUrl)}var da="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 ma);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[da]},_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 Mi(){var be=pi();be.acquire(da)}function Dt(){var be=Hn;be&&(be.isPreloaded()&&be.numActive()===1?(be.release(da),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 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 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}},cn.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=[],Wt={hitTest:_e,circle:{x:q,y:he,radius:J},seenUids:{box:{},circle:{}}};return this._forEachCell(ft,$e,pt,it,this._queryCellCircle,Tt,Wt,qe),_e?Tt.length>0:Tt},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,ft,pt,$e){var it=pt.seenUids,Tt=this.boxCells[qe];if(Tt!==null)for(var Wt=this.bboxes,Vt=0,Jt=Tt;Vt=Wt[rr+0]&&_e>=Wt[rr+1]&&(!$e||$e(this.boxKeys[ir]))){if(pt.hitTest)return ft.push(!0),!0;ft.push({key:this.boxKeys[ir],x1:Wt[rr],y1:Wt[rr+1],x2:Wt[rr+2],y2:Wt[rr+3]})}}}var Bt=this.circleCells[qe];if(Bt!==null)for(var Yt=this.circles,Ht=0,Or=Bt;Htpt*pt+$e*$e},cn.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,Wt=Math.abs(he-(qe+Tt));if(Wt>Tt+J)return!1;if(it<=$e||Wt<=Tt)return!0;var Vt=it-$e,Jt=Wt-Tt;return Vt*Vt+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 Hi(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],Wt=J?be.text.dynamicLayoutVertexArray:be.icon.dynamicLayoutVertexArray;Wt.clear();for(var Vt=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 fi(be,q,he,J,_e,qe,ft,pt,$e,it,Tt,Wt,Vt,Jt){var ir=q/24,rr=be.lineOffsetX*ir,Bt=be.lineOffsetY*ir,Yt;if(be.numGlyphs>1){var Ht=be.glyphStartIndex+be.numGlyphs,Or=be.lineStartIndex,Wr=be.lineStartIndex+be.lineLength,fn=io(ir,pt,rr,Bt,he,Tt,Wt,be,$e,qe,Vt);if(!fn)return{notEnoughRoom:!0};var ua=Ea(fn.first.point,ft).point,Zn=Ea(fn.last.point,ft).point;if(J&&!he){var Gn=Mo(be.writingMode,ua,Zn,Jt);if(Gn)return Gn}Yt=[fn.first];for(var ca=be.glyphStartIndex+1;ca0?Fa.point:ts(Wt,ha,va,1,_e),wi=Mo(be.writingMode,va,Ka,Jt);if(wi)return wi}var qi=Ho(ir*pt.getoffsetX(be.glyphStartIndex),rr,Bt,he,Tt,Wt,be.segment,be.lineStartIndex,be.lineStartIndex+be.lineLength,$e,qe,Vt);if(!qi)return{notEnoughRoom:!0};Yt=[qi]}for(var xs=0,ps=Yt;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,Yt=_e,Ht=0,Or=0,Wr=Math.abs(Vt),fn=[];Ht+Or<=Wr;){if(rr+=Jt,rr=$e)return null;if(Yt=Bt,fn.push(Bt),Bt=Wt[rr],Bt===void 0){var ua=new e.Point(it.getx(rr),it.gety(rr)),Zn=Ea(ua,Tt);if(Zn.signedDistanceFromCamera>0)Bt=Wt[rr]=Zn.point;else{var Gn=rr-Jt,ca=Ht===0?qe:new e.Point(it.getx(Gn),it.gety(Gn));Bt=ts(ca,ua,Yt,Wr-Ht+1,Tt)}}Ht+=Or,Or=Yt.dist(Bt)}var va=(Wr-Ht)/Or,Pa=Bt.sub(Yt),ha=Pa.mult(va)._add(Yt);ha._add(Pa._unit()._perp()._mult(he*Jt));var Fa=ir+Math.atan2(Bt.y-Yt.y,Bt.x-Yt.x);return fn.push(ha),{point:ha,angle:Fa,path:fn}}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 fl=1;fl0){for(var ol=ps[0].clone(),Tu=ps[0].clone(),Kf=1;Kf=Fa.x&&Tu.x<=Ka.x&&ol.y>=Fa.y&&Tu.y<=Ka.y?ec=[ps]:Tu.xKa.x||Tu.yKa.y?ec=[]:ec=e.clipLine([ps],Fa.x,Fa.y,Ka.x,Ka.y)}for(var Eh=0,Hv=ec;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[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID].text&&(Wr=this.prevPlacement.variableOffsets[Vt.crossTileID].anchor),this.variableOffsets[Vt.crossTileID]={textOffset:Bt,width:J,height:_e,anchor:q,textBoxScale:qe,prevAnchor:Wr},this.markUsedJustification(Jt,q,Vt,ir),Jt.allowVerticalPlacement&&(this.markUsedOrientation(Jt,ir,Vt),this.placedOrientations[Vt.crossTileID]=ir),{shift:Yt,placedGlyphBoxes:Ht}}},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,Wt=qe.textPixelRatio,Vt=qe.holdingForFade,Jt=qe.collisionBoxArray,ir=qe.partiallyEvaluatedTextSize,rr=qe.collisionGroup,Bt=pt.get("text-optional"),Yt=pt.get("icon-optional"),Ht=pt.get("text-allow-overlap"),Or=pt.get("icon-allow-overlap"),Wr=pt.get("text-rotation-alignment")==="map",fn=pt.get("text-pitch-alignment")==="map",ua=pt.get("icon-text-fit")!=="none",Zn=pt.get("symbol-z-order")==="viewport-y",Gn=Ht&&(Or||!ft.hasIconData()||Yt),ca=Or&&(Ht||!ft.hasTextData()||Bt);!ft.collisionArrays&&Jt&&ft.deserializeCollisionBoxes(Jt);var va=function(qi,xs){if(!he[qi.crossTileID]){if(Vt){_e.placements[qi.crossTileID]=new Zo(!1,!1,!1);return}var ps=!1,yl=!1,fl=!0,xl=null,_l={box:null,offscreen:null},ec={box:null},ol=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 tv=xs.textBox;if(tv){var hp=function(xf){var vc=e.WritingMode.horizontal;if(ft.allowVerticalPlacement&&!xf&&_e.prevPlacement){var av=_e.prevPlacement.placedOrientations[qi.crossTileID];av&&(_e.placedOrientations[qi.crossTileID]=av,vc=av,_e.markUsedOrientation(ft,vc,qi))}return vc},J0=function(xf,vc){if(ft.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&xs.verticalTextBox)for(var av=0,Ug=ft.writingModes;av0&&(dv=dv.filter(function(xf){return xf!==nv.anchor}),dv.unshift(nv.anchor))}var Xv=function(xf,vc,av){for(var Ug=xf.x2-xf.x1,Jy=xf.y2-xf.y1,Sc=qi.textBoxScale,V_=ua&&!Or?vc:null,qm={box:[],offscreen:!1},tw=Ht?dv.length*2:dv.length,Zv=0;Zv=dv.length,H_=_e.attemptAnchorPlacement(Vm,xf,Ug,Jy,Sc,Wr,fn,Wt,$e,rr,rw,qi,ft,av,V_);if(H_&&(qm=H_.placedGlyphBoxes,qm&&qm.box&&qm.box.length)){ps=!0,xl=H_.shift;break}}return qm},dp=function(){return Xv(tv,xs.iconBox,e.WritingMode.horizontal)},Yv=function(){var xf=xs.verticalTextBox,vc=_l&&_l.box&&_l.box.length;return ft.allowVerticalPlacement&&!vc&&qi.numVerticalGlyphVertices>0&&xf?Xv(xf,xs.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};J0(dp,Yv),_l&&(ps=_l.box,fl=_l.offscreen);var Fg=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,Fg))}}else{var Mp=function(xf,vc){var av=_e.collisionIndex.placeCollisionBox(xf,Ht,Wt,$e,rr.predicate);return av&&av.box&&av.box.length&&(_e.markUsedOrientation(ft,vc,qi),_e.placedOrientations[qi.crossTileID]=vc),av},rv=function(){return Mp(tv,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(rv,Ep),hp(_l&&_l.box&&_l.box.length)}}if(ol=_l,ps=ol&&ol.box&&ol.box.length>0,fl=ol&&ol.offscreen,qi.useRuntimeCollisionCircles){var Kh=ft.text.placedSymbolArray.get(qi.centerJustifiedTextSymbolIndex),em=e.evaluateSizeForFeature(ft.textSizeData,ir,Kh),Bg=pt.get("text-padding"),Cd=qi.collisionCircleDiameter;Tu=_e.collisionIndex.placeCollisionCircles(Ht,Kh,ft.lineVertexArray,ft.glyphOffsetArray,em,$e,it,Tt,J,fn,rr.predicate,Cd,Bg),ps=Ht||Tu.circles.length>0&&!Tu.collisionDetected,fl=fl&&Tu.offscreen}if(xs.iconFeatureIndex&&(Gv=xs.iconFeatureIndex),xs.iconBox){var Nm=function(xf){var vc=ua&&xl?Pl(xf,xl.x,xl.y,Wr,fn,_e.transform.angle):xf;return _e.collisionIndex.placeCollisionBox(vc,Or,Wt,$e,rr.predicate)};ec&&ec.box&&ec.box.length&&xs.verticalIconBox?(Kf=Nm(xs.verticalIconBox),yl=Kf.box.length>0):(Kf=Nm(xs.iconBox),yl=Kf.box.length>0),fl=fl&&Kf.offscreen}var $y=Bt||qi.numHorizontalGlyphVertices===0&&qi.numVerticalGlyphVertices===0,Ky=Yt||qi.numIconVertices===0;if(!$y&&!Ky?yl=ps=yl&&ps:Ky?$y||(yl=yl&&ps):ps=yl&&ps,ps&&ol&&ol.box&&(ec&&ec.box&&Hv?_e.collisionIndex.insertCollisionBox(ol.box,pt.get("text-ignore-placement"),ft.bucketInstanceId,Hv,rr.ID):_e.collisionIndex.insertCollisionBox(ol.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 Ng=ft.bucketInstanceId,Um=_e.collisionCircleArrays[Ng];Um===void 0&&(Um=_e.collisionCircleArrays[Ng]=new vo);for(var jm=0;jm=0;--ha){var Fa=Pa[ha];va(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 Wt in qe){var Vt=qe[Wt];if(!this.opacities[Wt]){var Jt=new fs(Vt,_e,!1,!1);Jt.isHidden()||(this.opacities[Wt]=Jt,J=J||Vt.text.placed||Vt.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||fn>0,va=Or.numIconVertices>0,Pa=_e.placedOrientations[Or.crossTileID],ha=Pa===e.WritingMode.vertical,Fa=Pa===e.WritingMode.horizontal||Pa===e.WritingMode.horizontalOnly;if(ca){var Ka=Au(Gn.text),wi=ha?Ji:Ka;ir(q.text,Wr,wi);var qi=Fa?Ji:Ka;ir(q.text,fn,qi);var xs=Gn.text.isHidden();[Or.rightJustifiedTextSymbolIndex,Or.centerJustifiedTextSymbolIndex,Or.leftJustifiedTextSymbolIndex].forEach(function(Gv){Gv>=0&&(q.text.placedSymbolArray.get(Gv).hidden=xs||ha?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(va){var fl=Au(Gn.icon),xl=!(Vt&&Or.verticalPlacedIconSymbolIndex&&ha);if(Or.placedIconSymbolIndex>=0){var _l=xl?fl:Ji;ir(q.icon,Or.numIconVertices,_l),q.icon.placedSymbolArray.get(Or.placedIconSymbolIndex).hidden=Gn.icon.isHidden()}if(Or.verticalPlacedIconSymbolIndex>=0){var ec=xl?Ji:fl;ir(q.icon,Or.numVerticalIconVertices,ec),q.icon.placedSymbolArray.get(Or.verticalPlacedIconSymbolIndex).hidden=Gn.icon.isHidden()}}if(q.hasIconCollisionBoxData()||q.hasTextCollisionBoxData()){var ol=q.collisionArrays[Ht];if(ol){var Tu=new e.Point(0,0);if(ol.textBox||ol.verticalTextBox){var Kf=!0;if(it){var Eh=_e.variableOffsets[ua];Eh?(Tu=kl(Eh.anchor,Eh.width,Eh.height,Eh.textOffset,Eh.textBoxScale),Tt&&Tu._rotate(Wt?_e.transform.angle:-_e.transform.angle)):Kf=!1}ol.textBox&&di(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||ha,Tu.x,Tu.y),ol.verticalTextBox&&di(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||Fa,Tu.x,Tu.y)}var Hv=!!(!Fa&&ol.verticalIconBox);ol.iconBox&&di(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,Hv,Vt?Tu.x:0,Vt?Tu.y:0),ol.verticalIconBox&&di(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,!Hv,Vt?Tu.x:0,Vt?Tu.y:0)}}},Bt=0;Btq},Ms.prototype.setStale=function(){this.stale=!0};function di(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),Rl=Math.pow(2,9),Zs=Math.pow(2,8),ul=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*Rl+q*Zs+he*ul+q}var Ji=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 Wt=q.scaledTo(Number(pt)),Vt=$e[Wt.key];Vt&&Vt.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 mn(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,Wt=J;Tt=0;Ht--){var Or=this._order[Ht];if(qe(Or))for(var Wr=pt.length-1;Wr>=0;Wr--){var fn=pt[Wr].feature;if(ft[fn.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;}`,$u=`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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;}`,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 +}`,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 +}`,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 +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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);}`,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() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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);}`,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 +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ku=` +#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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#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;}`,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 +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#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);}`,Bl=`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 +}`,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 +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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));}`,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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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);}`,Dc=`#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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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);}`,wu=su(Xc,rf),zc=su(Dh,wh),Uf=su(Tl,Ic),Ql=su(zh,oc),kf=su(Zu,sc),mc=su(nf,Jl),Oc=su(Wu,Hs),hu=su(Il,Mf),rh=su(bc,Ff),pf=su(fu,Sd),jf=su(Fs,Vd),Ah=su(pl,Oo),Ed=su(th,af),ev=su(Ou,Oh),nh=su(Bf,uh),Sh=su($u,fd),Yc=su(Hh,ch),Mh=su(Nf,Fh),lc=su(Bh,of),ah=su(Gh,Ef),Wh=su(vf,Ku),ih=su(Wf,Nh),au=su(Bl,Th),Fc=su(Md,Xh),sf=su(fh,Yh),Uh=su(Dc,Zh);function su(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,Wt,Vt){return pt[Vt]=!0,it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +varying `+Tt+" "+Wt+" "+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`}),q=q.replace(he,function($e,it,Tt,Wt,Vt){var Jt=Wt==="float"?"vec2":"vec4",ir=Vt.match(/color/)?"color":Jt;return pt[Vt]?it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+Tt+" "+Jt+" a_"+Vt+`; +varying `+Tt+" "+Wt+" "+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = a_"+Vt+`; +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = unpack_mix_"+ir+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+Tt+" "+Jt+" a_"+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = a_"+Vt+`; +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = unpack_mix_"+ir+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`}),{fragmentSource:be,vertexSource:q,staticAttributes:J,staticUniforms:ft}}var hh=Object.freeze({__proto__:null,prelude:wu,background:zc,backgroundPattern:Uf,circle:Ql,clippingMask:kf,heatmap:mc,heatmapTexture:Oc,collisionBox:hu,collisionCircle:rh,debug:pf,fill:jf,fillOutline:Ah,fillOutlinePattern:Ed,fillPattern:ev,fillExtrusion:nh,fillExtrusionPattern:Sh,hillshadePrepare:Yc,hillshade:Mh,line:lc,lineGradient:ah,linePattern:Wh,lineSDF:ih,raster:au,symbolIcon:Fc,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 Wt=!this.vao||this.boundProgram!==he||this.boundLayoutVertexBuffer!==J||it||this.boundIndexBuffer!==qe||this.boundVertexOffset!==ft||this.boundDynamicVertexBuffer!==pt||this.boundDynamicVertexBuffer2!==$e;!q.extVertexArrayObject||Wt?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,Wt=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 Vt=it;Vt<$e;Vt++)Wt.disableVertexAttribArray(Vt)}he.enableAttributes(Wt,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,Wt=Tt*(J.tileID.canonical.x+J.tileID.wrap*it),Vt=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:[Wt>>16,Vt>>16],u_pixel_coord_lower:[Wt&65535,Vt&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)}},fc=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)}},wc=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})},fr=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}},vn=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}},ci=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")}},Xi=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 Zi=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),Wt=it.width*_e.fromScale,Vt=Tt.width*_e.toScale;return e.extend(Al(be,q,he),{u_patternscale_a:[pt/Wt,-it.height/2],u_patternscale_b:[pt/Vt,-Tt.height/2],u_sdfgamma:ft.width/(Math.min(Wt,Vt)*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)}},Vl=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:Dl(_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 Dl(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)}},gc=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)}},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_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)}},Tc=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 Wt=_e.transform;return e.extend(Tc(be,q,he,J,_e,qe,ft,pt,$e,it),{u_gamma_scale:J?Math.cos(Wt._pitch)*Wt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},_c=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:fc,fill:Cf,fillPattern:gf,fillOutline:Su,fillOutlinePattern:wc,circle:fr,collisionBox:vn,collisionCircle:an,debug:xa,clippingMask:ci,heatmap:Ha,heatmapTexture:bi,hillshade:Xi,hillshadePrepare:No,line:Zi,lineGradient:Li,linePattern:ns,lineSDF:Bs,raster:Mu,symbolIcon:ml,symbolSDF:gc,symbolTextAndIcon:yc,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=[],Wt=0,Vt=0,Jt=0;Jt0){var Wr=e.create(),fn=Yt;e.mul(Wr,Bt.placementInvProjMatrix,be.transform.glCoordMatrix),e.mul(Wr,Wr,Bt.placementViewportMatrix),Tt.push({circleArray:Or,circleOffset:Vt,transform:fn,invTransform:Wr}),Wt+=Or.length/4,Vt=Wt}Ht&&it.draw(pt,$e.LINES,Vn.disabled,Un.disabled,be.colorModeForRenderPass(),Gr.disabled,On(Yt,be.transform,rr),he.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,null,be.transform.zoom,null,null,Ht.collisionVertexBuffer)}}if(!(!ft||!Tt.length)){var ua=be.useProgram("collisionCircle"),Zn=new e.StructArrayLayout2f1f2i16;Zn.resize(Wt*4),Zn._trim();for(var Gn=0,ca=0,va=Tt;ca=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}),Wt=!q||Math.abs(q.tileID.overscaledZ-Tt)>Math.abs(be.tileID.overscaledZ-Tt),Vt=Wt&&be.refreshedUponExpiration?1:e.clamp(Wt?pt:1-$e,0,1);return be.refreshedUponExpiration&&pt>=1&&(be.refreshedUponExpiration=!1),q?{opacity:1,mix:1-Vt}:{opacity:Vt,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 Wt=Un.disabled,Vt=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(),Yt=0,Ht=rr;Yt "+he.overscaledZ);var Yt=Bt+" "+Jt+"kb";Wo(be,Yt),ft.draw(J,_e.TRIANGLES,pt,$e,qt.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 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(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 Qs={symbol:P,circle:Gt,heatmap:hr,line:xn,fill:Ze,"fill-extrusion":vt,hillshade:zt,raster:gr,background:Pr,debug:To,custom:Js},Es=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 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,qt.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(qt.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]],fn=qe[Wr.source],ua=$e[Wr.source];this._renderTileClippingMasks(Wr,ua),this.renderLayer(this,fn,Wr,ua)}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],ca=(Zn.type==="symbol"?Tt:it)[Zn.source];this._renderTileClippingMasks(Zn,$e[Zn.source]),this.renderLayer(this,Gn,Zn,ca)}if(this.options.showTileBoundaries){var va,Pa,ha=e.values(this.style._layers);ha.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},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 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),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]]),Wt=e.sub([],ft[it[2]],ft[it[1]]),Vt=e.normalize([],e.cross([],Tt,Wt)),Jt=-e.dot(Vt,ft[it[1]]);return Vt.concat(Jt)});return new al(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,Wt=0;Wtthis.max[$e]-this.min[$e])return 0}return 1};var iu=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};iu.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},iu.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)},iu.prototype.equals=function(q){return this.top===q.top&&this.bottom===q.bottom&&this.left===q.left&&this.right===q.right},iu.prototype.clone=function(){return new iu(this.top,this.bottom,this.left,this.right)},iu.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 iu,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=al.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,he),$e=q.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&($e=he);var it=3,Tt=function(ha){return{aabb:new mu([ha*qe,0,0],[(ha+1)*qe,qe,0]),zoom:0,x:0,y:0,wrap:ha,fullyVisible:!1}},Wt=[],Vt=[],Jt=he,ir=q.reparseOverscaled?J:he;if(this._renderWorldCopies)for(var rr=1;rr<=3;rr++)Wt.push(Tt(-rr)),Wt.push(Tt(rr));for(Wt.push(Tt(0));Wt.length>0;){var Bt=Wt.pop(),Yt=Bt.x,Ht=Bt.y,Or=Bt.fullyVisible;if(!Or){var Wr=Bt.aabb.intersects(pt);if(Wr===0)continue;Or=Wr===2}var fn=Bt.aabb.distanceX(ft),ua=Bt.aabb.distanceY(ft),Zn=Math.max(Math.abs(fn),Math.abs(ua)),Gn=it+(1<Gn&&Bt.zoom>=$e){Vt.push({tileID:new e.OverscaledTileID(Bt.zoom===Jt?ir:Bt.zoom,Bt.wrap,Bt.zoom,Yt,Ht),distanceSq:e.sqrLen([ft[0]-.5-Yt,ft[1]-.5-Ht])});continue}for(var ca=0;ca<4;ca++){var va=(Yt<<1)+ca%2,Pa=(Ht<<1)+(ca>>1);Wt.push({aabb:Bt.aabb.quadrant(ca),zoom:Bt.zoom+1,x:va,y:Pa,wrap:Bt.wrap,fullyVisible:Or})}}return Vt.sort(function(ha,Fa){return ha.distanceSq-Fa.distanceSq}).map(function(ha){return ha.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,Wt=J[2]/qe,Vt=_e[2]/ft,Jt=Wt===Vt?0:(he-Wt)/(Vt-Wt);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 Wt=this.latRange;q=e.mercatorYfromLat(Wt[1])*this.worldSize,he=e.mercatorYfromLat(Wt[0])*this.worldSize,qe=he-qhe&&($e=he-Bt)}if(this.lngRange){var Yt=Jt.x,Ht=it.x/2;Yt-Ht_e&&(pt=_e-Ht)}(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,Wt=this.height/50,Vt=new Float64Array(16);e.perspective(Vt,this._fov,this.width/this.height,Wt,Tt),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,[-pt,-$e,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 Jt=this.width%2/2,ir=this.height%2/2,rr=Math.cos(this.angle),Bt=Math.sin(this.angle),Yt=pt-Math.round(pt)+rr*Jt+Bt*ir,Ht=$e-Math.round($e)+rr*ir+Bt*Jt,Or=new Float64Array(Vt);if(e.translate(Or,Or,[Yt>.5?Yt-1:Yt,Ht>.5?Ht-1:Ht,0]),this.alignedProjMatrix=Or,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={}}},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 Wt=this._hashName,Vt=!1,Jt=e.window.location.hash.slice(1).split("&").map(function(ir){var rr=ir.split("=")[0];return rr===Wt?(Vt=!0,rr+"="+Tt):ir}).filter(function(ir){return ir});return Vt||Jt.push(Wt+"="+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 Nc={linearity:.3,easing:e.bezier(0,0,.3,1)},ge=e.extend({deceleration:2500,maxSpeed:1400},Nc),Oe=e.extend({deceleration:20,maxSpeed:1400},Nc),rt=e.extend({deceleration:1e3,maxSpeed:360},Nc),wt=e.extend({deceleration:1e3,maxSpeed:90},Nc),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 Wt=tr(he.zoom,$e,Oe);it.zoom=this._map.transform.zoom+Wt.amount,It(it,Wt)}if(he.bearing){var Vt=tr(he.bearing,$e,rt);it.bearing=this._map.transform.bearing+e.clamp(Vt.amount,-179,179),It(it,Vt)}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 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 er(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 er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},hn.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()},hn.prototype.isEnabled=function(){return!0},hn.prototype.isActive=function(){return!1},hn.prototype.enable=function(){},hn.prototype.disable=function(){};var Sn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._container=q.getContainer(),this._clickTolerance=he.clickTolerance||1};Sn.prototype.isEnabled=function(){return!!this._enabled},Sn.prototype.isActive=function(){return!!this._active},Sn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Sn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sn.prototype.mousedown=function(q,he){this.isEnabled()&&q.shiftKey&&q.button===0&&(r.disableDrag(),this._startPos=this._lastPos=he,this._active=!0)},Sn.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)>la)&&(this.aborted=!0)}}},Sa.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 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,Ac(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 Ac(J)&&Ac(_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,fa=2,gn=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)};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%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()}},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)>yr?this._wheelZoomRate:this._defaultZoomRate,_e=fa/(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 Wt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Vt=$e(Wt);Tt=e.number(pt,ft,Vt),Wt<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}}},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),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},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 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 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 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 ga(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,fn):Math.max(.5,fn),ha=Math.pow(Pa,1-ca),Fa=ft.unproject(Or.add(Wr.mult(ca*ha)).mult(va));ft.setLocationAtPoint(ft.renderWorldCopies?Fa.wrap():Fa,Bt)}qe._fireMoveEvents(_e)},function(ca){qe._afterEase(_e,ca)},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(),Wt=this.getPadding(),Vt="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(Vt-$e),Yt=e.Point.convert(J.offset),Ht=pt.centerPoint.add(Yt),Or=pt.pointLocation(Ht),Wr=e.LngLat.convert(J.center||Or);this._normalizeCenter(Wr);var fn=pt.project(Or),ua=pt.project(Wr).sub(fn),Zn=J.curve,Gn=Math.max(pt.width,pt.height),ca=Gn/Bt,va=ua.mag();if("minZoom"in J){var Pa=e.clamp(Math.min(J.minZoom,$e,Vt),pt.minZoom,pt.maxZoom),ha=Gn/pt.zoomScale(Pa-$e);Zn=Math.sqrt(ha/va*2)}var Fa=Zn*Zn;function Ka(ol){var Tu=(ca*ca-Gn*Gn+(ol?-1:1)*Fa*Fa*va*va)/(2*(ol?ca:Gn)*Fa*va);return Math.log(Math.sqrt(Tu*Tu+1)-Tu)}function wi(ol){return(Math.exp(ol)-Math.exp(-ol))/2}function qi(ol){return(Math.exp(ol)+Math.exp(-ol))/2}function xs(ol){return wi(ol)/qi(ol)}var ps=Ka(0),yl=function(ol){return qi(ps)/qi(ps+Zn*ol)},fl=function(ol){return Gn*((qi(ps)*xs(ps+Zn*ol)-wi(ps))/Fa)/va},xl=(Ka(1)-ps)/Zn;if(Math.abs(va)<1e-6||!isFinite(xl)){if(Math.abs(Gn-ca)<1e-6)return this.easeTo(J,_e);var _l=caJ.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(ol){var Tu=ol*xl,Kf=1/yl(Tu);pt.zoom=ol===1?Vt:$e+pt.scaleZoom(Kf),qe._rotating&&(pt.bearing=e.number(it,Jt,ol)),qe._pitching&&(pt.pitch=e.number(Tt,ir,ol)),qe._padding&&(pt.interpolatePadding(Wt,rr,ol),Ht=pt.centerPoint.add(Yt));var Eh=ol===1?Wr:pt.unproject(fn.add(ua.mult(fl(Tu))).mult(Kf));pt.setLocationAtPoint(pt.renderWorldCopies?Eh.wrap():Eh,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 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 ia=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ia.prototype.add=function(q){var he=++this._id,J=this._queue;return J.push({callback:q,id:he,cancelled:!1}),he},ia.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 ia,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},hi,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 Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length?it||(it=!0,ft.call(pt,new er(_e,pt,Bt.originalEvent,{features:Yt}))):it=!1},Wt=function(){it=!1};return{layer:qe,listener:ft,delegates:{mousemove:Tt,mouseout:Wt}}}else if(_e==="mouseleave"||_e==="mouseout"){var Vt=!1,Jt=function(Bt){var Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length?Vt=!0:Vt&&(Vt=!1,ft.call(pt,new er(_e,pt,Bt.originalEvent)))},ir=function(Bt){Vt&&(Vt=!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 Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length&&(Bt.features=Yt,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],Wt=0;Wt180;){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 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,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"}],Wt=0,Vt=Tt;Wt=_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 tl(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,Ju=(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"),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,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 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(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"},tu=function(q){this.options=e.extend({},_f,q),e.bindAll(["_onMove","setUnit"],this)};tu.prototype.getDefaultPosition=function(){return"bottom-left"},tu.prototype._onMove=function(){du(this._map,this._container,this.options)},tu.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},tu.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},tu.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;fo(q,J,it,be._getUIString("ScaleControl.Miles"))}else fo(q,J,$e,be._getUIString("ScaleControl.Feet"))}else if(he&&he.unit==="nautical"){var Tt=pt/1852;fo(q,J,Tt,be._getUIString("ScaleControl.NauticalMiles"))}else pt>=1e3?fo(q,J,pt/1e3,be._getUIString("ScaleControl.Kilometers")):fo(q,J,pt,be._getUIString("ScaleControl.Meters"))}function fo(be,q,he,J){var _e=js(he),qe=_e/he;be.style.width=q*qe+"px",be.innerHTML=_e+" "+J}function Qu(be){var q=Math.pow(10,Math.ceil(-Math.log(be)/Math.LN10));return Math.round(be*q)/q}function js(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:Qu(he),q*he}var Ol=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")};Ol.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},Ol.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ol.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Ol.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)},Ol.prototype._updateTitle=function(){var q=this._getTitle();this._fullscreenButton.setAttribute("aria-label",q),this._fullscreenButton.title=q},Ol.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ol.prototype._isFullscreen=function(){return this._fullscreen},Ol.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())},Ol.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 hc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},dc=["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(hc),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=Ao(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,Wt;ft.y+$e.bottom.ythis._map.transform.height-Tt?Wt=["bottom"]:Wt=[],ft.xthis._map.transform.width-it/2&&Wt.push("right"),Wt.length===0?pt="bottom":pt=Wt.join("-")}var Vt=ft.add($e[pt]).round();r.setTransform(this._container,qo[pt]+" translate("+Vt.x+"px,"+Vt.y+"px)"),Qo(this._container,pt,"popup")}},q.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var J=this._container.querySelector(dc);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:Oi,NavigationControl:ji,GeolocateControl:Ju,AttributionControl:ta,ScaleControl:tu,FullscreenControl:Ol,Popup:Co,Marker:cl,Style:Yu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Mi,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})}}),t7=Ge({"src/plots/mapbox/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=wL(),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}}}),r7=Ge({"src/plots/mapbox/mapbox.js"(K,G){var h=TL(),b=_n(),S=B_(),E=Ro(),e=Ts(),t=lv(),r=Yf(),o=Up(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=Wy(),v=t7();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}}}),l7=Ge({"src/traces/choroplethmapbox/index.js"(K,G){G.exports={attributes:AL(),supplyDefaults:o7(),colorbar:Am(),calc:CE(),plot:s7(),hoverPoints:PE(),eventData:RE(),selectPoints:IE(),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/densitymapbox/hover.js"(K,G){var h=Ts(),b=XE().hoverPoints,S=XE().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]}}}}),p7=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}}}),m7=Ge({"src/traces/densitymapbox/index.js"(K,G){G.exports={attributes:ML(),supplyDefaults:c7(),colorbar:Am(),formatLabels:bL(),calc:f7(),plot:d7(),hoverPoints:v7(),eventData:p7(),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} +{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-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],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":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],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,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"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(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"}}}),_7=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"}}]}}}),q_=Ge({"src/plots/map/constants.js"(K,G){var h=zp(),b=y7(),S=_7(),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."}}}),lS=Ge({"src/plots/map/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=kc().attributes,E=Ns(),e=Gc().textposition,t=Hc().overrideAll,r=_u().templatedArray,o=q_(),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"}}}),ZE=Ge({"src/traces/scattermap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=$b(),t=Gc(),r=lS(),o=Gl(),n=zu(),i=Ki().extendFlat,a=Hc().overrideAll,s=lS(),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")}}),EL=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}}}}),x7=Ge({"src/traces/scattermap/defaults.js"(K,G){var h=_n(),b=uu(),S=Kd(),E=Vp(),e=op(),t=Nd(),r=ZE(),o=EL().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}}}),kL=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}}}),CL=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}}}}),b7=Ge({"src/traces/scattermap/convert.js"(K,G){var h=Si(),b=_n(),S=Ii().BADNUM,E=F_(),e=Ec(),t=As(),r=Fp(),o=uu(),n=EL().isSupportedFont,i=CL(),a=$d().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}}}),w7=Ge({"src/traces/scattermap/plot.js"(K,G){var h=_n(),b=b7(),S=q_().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}}}),T7=Ge({"src/traces/scattermap/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),A7=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(Zt,pr,br,Hr,Qr){const dn=4*Math.max(-pr,0),An=(Math.max(0,br)-br)*Hr*4+dn,Nn=4*Hr,pa=Math.max(0,pr),oi=Math.max(0,br);return{rect:{x:pa,y:oi,width:Math.min(Zt.width,pr+Hr)-pa,height:Math.min(Zt.height,br+Qr)-oi},layout:[{offset:An,stride:Nn}]}})(Y,D,Q,me,Re)),gt)for(let Zt=0;ZtL(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 Zt=yield We.blob();throw new ce(We.status,We.statusText,me.url,Zt)}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 Zt in me.headers)Rt.setRequestHeader(Zt,me.headers[Zt]);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 Zt=Rt.response;if(me.type==="json")try{Zt=JSON.parse(Rt.response)}catch(pr){return void We(pr)}Ve({data:Zt,cacheControl:Rt.getResponseHeader("Cache-Control"),expires:Rt.getResponseHeader("Expires")})}else{const Zt=new Blob([Rt.response],{type:Rt.getResponseHeader("Content-Type")});We(new ce(Rt.status,Rt.statusText,me.url,Zt))}},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(Er),Sr,Nr,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 Br(Y){return(Y%=360)<0&&(Y+=360),Y}function kn([Y,D,Q,me]){let Re,Ve;const We=Vn((.2225045*(Y=Wn(Y))+.7168786*(D=Wn(D))+.0606169*(Q=Wn(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 Wn(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 na([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),[aa(3.1338561*Ve-1.6168667*Re-.4906146*We),aa(-.9787684*Ve+1.9161415*Re+.033454*We),aa(.0719453*Ve-.2289914*Re+1.4052427*We),me]}function aa(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 qt(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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi]=We,Ba=[pr||" ",Qr||" ",Nn].join("");if(Ba===" "||Ba===" /"||Ba===",,"||Ba===",,,"){const ei=[Zt,Hr,An].join(""),Fi=ei==="%%%"?100:ei===""?255:0;if(Fi){const co=[sr(+Rt/Fi,0,1),sr(+br/Fi,0,1),sr(+dn/Fi,0,1),pa?Va(+pa,oi):1];if(qt(co))return co}}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,Zt,pr,br,Hr,Qr,dn]=Ve,An=[Rt||" ",pr||" ",Hr].join("");if(An===" "||An===" /"||An===",,"||An===",,,"){const Nn=[+gt,sr(+Zt,0,100),sr(+br,0,100),Qr?Va(+Qr,dn):1];if(qt(Nn))return(function([pa,oi,Ba,ei]){function Fi(co){const $o=(co+pa/30)%12,hl=oi*Math.min(Ba,1-Ba);return Ba-hl*Math.max(-1,Math.min($o-3,9-$o,1))}return pa=Br(pa),oi/=100,Ba/=100,[Fi(0),Fi(8),Fi(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)?Br(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 sn{constructor(D,Q,me,Re,Ve){this.text=D,this.image=Q,this.scale=me,this.fontStack=Re,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 Tn{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Tn)return D;if(typeof D=="number")return new Tn([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 Tn(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 ma{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof ma)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 mn||Y instanceof Tn||Y instanceof ma||Y instanceof da)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 Mr;if(Y instanceof mn)return $r;if(Y instanceof Tn)return Sr;if(Y instanceof ma)return Mt;if(Y instanceof da)return Nr;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=Er;break}Q=Re}return je(Q||Er,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 mn||Y instanceof Tn||Y instanceof ma||Y instanceof da?Y.toString():JSON.stringify(Y)}class Mi{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 Mi(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 Zt=D[1];if(typeof Zt!="string"||!(Zt in xt)||Zt==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);gt=xt[Zt],Re++}else gt=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],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=Tn.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=ma.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 mn.fromString(pi(this.args[0].evaluate(D)));case"resolvedImage":return da.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 ln{constructor(D,Q,me=[],Re,Ve=new lt,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 Mi)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){const gt=new qr;try{We=new Mi(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 ln(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,Er),Re=Q.parse(D[2],2,Er);return me&&Re?ye(me.type,[Nt,Ft,nt,dt,Er])?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 un{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,Er),Re=Q.parse(D[2],2,Er);if(!me||!Re)return null;if(!ye(me.type,[Nt,Ft,nt,dt,Er]))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 un(me,Re,Ve):null}return new un(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 Zt=2;ZtNumber.MAX_SAFE_INTEGER)return Hr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof dn=="number"&&Math.floor(dn)!==dn)return Hr.error("Numeric branch labels must be integer values.");if(me){if(Hr.checkSubtype(me,Hn(dn)))return null}else me=Hn(dn);if(Ve[String(dn)]!==void 0)return Hr.error("Branch labels must be unique.");Ve[String(dn)]=We.length}const Qr=Q.parse(br,Zt,Re);if(!Qr)return null;Re=Re||Qr.type,We.push(Qr)}const gt=Q.parse(D[1],1,Er);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,Er),Re=Q.parse(D[2],2,nt);if(!me||!Re)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 ${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 cn(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.',Zt);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[cn(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 Hi=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,Zt,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=Zt)):(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[dn,An,Nn,pa]=(function([oi,Ba,ei,Fi]){return oi=isNaN(oi)?0:oi*mr,na([ei,Math.cos(oi)*Ba,Math.sin(oi)*Ba,Fi])})([Hr,Qr??so(Ve,Zt,Q),so(We,pr,Q),so(gt,br,Q)]);return new ur(dn,An,Nn,pa,!1)}case"lab":{const[Re,Ve,We,gt]=na(io(Y.lab,D.lab,Q));return new ur(Re,Ve,We,gt,!1)}}},array:io,padding:function(Y,D,Q){return new Tn(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:Zt}}}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 Zt=0;Zt=pr)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Hr);const dn=Q.parse(br,Qr,Rt);if(!dn)return null;Rt=Rt||dn.type,gt.push([pr,dn])}return Xe(Rt,nt)||Xe(Rt,Qt)||Xe(Rt,Sr)||Xe(Rt,Mt)||Xe(Rt,je(nt))?new fi(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=cn(Q,Re),gt=fi.interpolationFactor(this.interpolation,Re,Q[We],Q[We+1]),Rt=me[We].evaluate(D),Zt=me[We+1].evaluate(D);switch(this.operator){case"interpolate":return Mo[this.type.kind](Rt,Zt,gt);case"interpolate-hcl":return Mo.color(Rt,Zt,gt,"hcl");case"interpolate-lab":return Mo.color(Rt,Zt,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?Er: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 da&&!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 vP{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,Er);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 Zt=We.parse(Ve[2],2,Er);if(!Zt)return null;if(!Xs(gt,Zt.type))return We.concat(2).error(`"${gt}" comparisons are not supported for type '${Je(Zt.type)}'.`);if(Rt.type.kind!==Zt.type.kind&&Rt.type.kind!=="value"&&Zt.type.kind!=="value")return We.error(`Cannot compare types '${Je(Rt.type)}' and '${Je(Zt.type)}'.`);me&&(Rt.type.kind==="value"&&Zt.type.kind!=="value"?Rt=new Cr(Zt.type,[Rt]):Rt.type.kind!=="value"&&Zt.type.kind==="value"&&(Zt=new Cr(Rt.type,[Zt])));let pr=null;if(Ve.length===4){if(Rt.type.kind!=="string"&&Zt.type.kind!=="string"&&Rt.type.kind!=="value"&&Zt.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(pr=We.parse(Ve[3],3,Mr),!pr)return null}return new vP(Rt,Zt,pr)}evaluate(Ve){const We=this.lhs.evaluate(Ve),gt=this.rhs.evaluate(Ve);if(me&&this.hasUntypedArgument){const Rt=Hn(We),Zt=Hn(gt);if(Rt.kind!==Zt.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}, ${Zt.kind}) instead.`)}if(this.collator&&!me&&this.hasUntypedArgument){const Rt=Hn(We),Zt=Hn(gt);if(Rt.kind!=="string"||Zt.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 vo{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 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 vo(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 ll{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 Zt=null;if(gt["text-font"]&&(Zt=Q.parse(gt["text-font"],1,je(Ft)),!Zt))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=Zt,br.textColor=pr}else{const Rt=Q.parse(D[We],1,Er);if(!Rt)return null;const Zt=Rt.type.kind;if(Zt!=="string"&&Zt!=="value"&&Zt!=="null"&&Zt!=="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 ll(Re)}evaluate(D){return new mn(this.sections.map(Q=>{const me=Q.content.evaluate(D);return Hn(me)===Nr?new sn("",me,null,null,null):new sn(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=Nr,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=da.fromString(Q);return me&&D.availableImages&&(me.available=D.availableImages.indexOf(Q)>-1),me}eachChild(D){D(this.input)}outputDefined(){return!1}}class Pl{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 Pl(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 di(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 Rl(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(ul(Y,Q))return!0;return!1}function Ji(Y,D){for(const Q of Y)if(!ul(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 Zt=[Rt.x+Ve[0],Rt.y+Ve[1]];Io(Zt,D,Q,Re),We.push(Zt)}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 Zt=[];for(const pr of Rt){const br=[pr.x+Ve[0],pr.y+Ve[1]];Cl(D,br),Zt.push(br)}We.push(Zt)}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 Zt of Rt)Io(Zt,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 Zt of Rt)if(!ul(Zt,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 Zt of Rt)if(!Au(Zt,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 Zt of Rt)if(!Ji(Zt,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 Zt of Rt)if(!gs(Zt,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 Fl(Y,D,Q,me,Re){ql(Y,D,Q,me||Y.length-1,Re||df)}function ql(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),Zt=.5*Math.sqrt(gt*Rt*(Ve-Rt)/Ve)*(We-Ve/2<0?-1:1);ql(Y,D,Math.max(Q,Math.floor(D-We*Rt/Ve+Zt)),Math.min(me,Math.floor(D+(Ve-We)*Rt/Ve+Zt)),Re)}var pr=Y[D],br=Q,Hr=me;for(Yu(Y,Q,D),Re(Y[me],pr)>0&&Yu(Y,Q,me);br0;)Hr--}Re(Y[Q],pr)===0?Yu(Y,Q,Hr):Yu(Y,++Hr,me),Hr<=D&&(Q=Hr+1),D<=Hr&&(me=Hr-1)}}function Yu(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?(Zt=D[Rt+1][0],pr=D[Rt+1][1]):Qr>0&&(Zt+=br/this.kx*Qr,pr+=Hr/this.ky*Qr)),br=this.wrap(Q[0]-Zt)*this.kx,Hr=(Q[1]-pr)*this.ky;const dn=br*br+Hr*Hr;dn180;)D-=360;return D}}function oc(Y,D){return D[0]-Y[0]}function Zu(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=Zu(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 Jl(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 Wu(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 Il(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,Zt=gt.length,pr=Zt-1;Rt0;){const Rt=We.pop();if(Rt[0]>=Ve)continue;const Zt=Rt[1],pr=D?50:100;if(Zu(Zt)<=pr){if(!sc(Zt,Y.length))return NaN;if(D){const br=Fs(Y,Zt,Q,me);if(isNaN(br)||br===0)return br;Ve=Math.min(Ve,br)}else for(let br=Zt[0];br<=Zt[1];++br){const Hr=Sd(Y[br],Q,me);if(Ve=Math.min(Ve,Hr),Ve===0)return 0}}else{const br=nf(Zt,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 Zt=Rt[1],pr=Rt[2],br=D?50:100,Hr=me?50:100;if(Zu(Zt)<=br&&Zu(pr)<=Hr){if(!sc(Zt,Y.length)&&sc(pr,Q.length))return NaN;let Qr;if(D&&me)Qr=Ff(Y,Zt,Q,pr,Re),We=Math.min(We,Qr);else if(D&&!me){const dn=Y.slice(Zt[0],Zt[1]+1);for(let An=pr[0];An<=pr[1];++An)if(Qr=Mf(Q[An],dn,Re),We=Math.min(We,Qr),We===0)return We}else if(!D&&me){const dn=Q.slice(pr[0],pr[1]+1);for(let An=Zt[0];An<=Zt[1];++An)if(Qr=Mf(Y[An],dn,Re),We=Math.min(We,Qr),We===0)return We}else Qr=fu(Y,Zt,Q,pr,Re),We=Math.min(We,Qr)}else{const Qr=nf(Zt,D),dn=nf(pr,me);th(gt,We,Re,Y,Q,Qr[0],dn[0]),th(gt,We,Re,Y,Q,Qr[0],dn[1]),th(gt,We,Re,Y,Q,Qr[1],dn[0]),th(gt,We,Re,Y,Q,Qr[1],dn[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(Zt=>Zt.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 Zt of Ve){switch(Rt.type){case"Point":gt=Math.min(gt,af([Rt.coordinates],!1,Zt,We,gt));break;case"LineString":gt=Math.min(gt,af(Rt.coordinates,!0,Zt,We,gt));break;case"Polygon":gt=Math.min(gt,pl(Zt,Rt.coordinates,We,gt))}if(gt===0)return gt}return gt})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const uh={"==":Uo,"!=":Ys,">":sl,"<":Vs,">=":Zo,"<=":fs,array:Cr,at:lr,boolean:Cr,case:qn,coalesce:Ho,collator:vo,format:ll,image:kl,in:zr,"index-of":un,interpolate:fi,"interpolate-hcl":fi,"interpolate-lab":fi,length:Pl,let:Jr,literal:Mi,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 $u{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=$u.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(([Zt])=>!Array.isArray(Zt)||Zt.length===D.length-1);let Rt=null;for(const[Zt,pr]of gt){Rt=new ln(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 Mi}),!!Q&&Bh(Y)&&Gh(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bh(Y){if(Y instanceof $u&&(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 $u&&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 $u&&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 Ku(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 Bl(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:Tn.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,Zt;if(Ve==="exponential")gt=Zh;else if(Ve==="interval")gt=Dc;else if(Ve==="categorical"){gt=Yh,Rt=Object.create(null);for(const pr of Y.stops)Rt[pr[0]]=pr[1];Zt=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 dn=0;dndn[0]),evaluate:({zoom:dn},An)=>Zh({stops:Hr,base:Y.base},D,dn).evaluate(dn,An)}}if(Re){const pr=Ve==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:pr,interpolationFactor:fi.interpolationFactor.bind(void 0,pr),zoomStops:Y.stops.map(br=>br[0]),evaluate:({zoom:br})=>gt(Y,D,br,Rt,Zt)}}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,Zt)}}}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 Dc(Y,D,Q){if(Bl(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=cn(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(Bl(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=cn(Y.stops.map(pr=>pr[0]),Q),We=(function(pr,br,Hr,Qr){const dn=Qr-Hr,An=pr-Hr;return dn===0?0:br===1?An/dn:(Math.pow(br,An)-1)/(Math.pow(br,dn)-1)})(Q,me,Y.stops[Ve][0],Y.stops[Ve+1][0]),gt=Y.stops[Ve][1],Rt=Y.stops[Ve+1][1],Zt=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 Zt(br,Hr,We,Y.colorSpace)}}:Zt(gt,Rt,We,Y.colorSpace)}function wu(Y,D,Q){switch(D.type){case"color":Q=ur.parse(Q);break;case"formatted":Q=mn.fromString(Q.toString());break;case"resolvedImage":Q=da.fromString(Q.toString());break;case"padding":Q=Tn.parse(Q);break;default:Bl(Q)===D.type||D.type==="enum"&&D.values[Q]||(Q=void 0)}return fh(Q,Y.default,D.default)}$u.register(uh,{error:[{kind:"error"},[Ft],(Y,[D])=>{throw new Dt(D.evaluate(Y))}],typeof:[Ft,[Er],(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:Er,overloads:[[[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.properties())],[[Ft,ar],(Y,[D,Q])=>ch(D.evaluate(Y),Q.evaluate(Y))]]},"feature-state":[Er,[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.featureState||{})],properties:[ar,[],Y=>Y.properties()],"geometry-type":[Ft,[],Y=>Y.geometryType()],id:[Er,[],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:[Er,[],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,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],Re=Q.value;return typeof me==typeof Re&&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],Re=Q.value;return typeof me==typeof Re&&me>Re}],"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],Re=Q.value;return typeof me==typeof Re&&me<=Re}],"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],Re=Q.value;return typeof me==typeof Re&&me>=Re}],"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,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(Er),(Y,D)=>D.map(Q=>pi(Q.evaluate(Y))).join("")],"resolved-locale":[Ft,[Mr],(Y,[D])=>D.evaluate(Y).resolvedLocale()]});class zc{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"?Tn.parse(me.default)||null:me.type==="variableAnchorOffsetCollection"?ma.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 Ql(Y,D){const Q=new ln(uh,Fh,[],D?(function(Re){const Ve={color:Qt,string:Ft,number:nt,enum:Ft,boolean:Nt,formatted:$r,padding:Sr,resolvedImage:Nr,variableAnchorOffsetCollection:Mt};return Re.type==="array"?je(Ve[Re.value]||Er,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 zc(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 mc{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?fi.interpolationFactor(this.interpolationType,D,Q,me):0}}function Oc(Y,D){const Q=Ql(Y,D);if(Q.result==="error")return Q;const me=Q.value.expression,Re=Bh(me);if(!Re&&!Ku(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 fi&&!Nh(D)?vf([new Ne("",'"interpolate" expressions cannot be used with this property')]):Ef(We?new mc(Re?"camera":"composite",Q.value,We.labels,We instanceof fi?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 fi)&&Y.input instanceof $u&&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=Ql(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:ev(Y)}}function Ed(Y,D){return YD?1:0}function ev(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=au(Y.value.type);let me,Re,Ve,We={};const gt=Q!=="categorical"&&Y.value.property===void 0,Rt=!gt,Zt=Bl(Y.value.stops)==="array"&&Bl(Y.value.stops[0])==="array"&&Bl(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 dn=[];const An=Qr.value;return dn=dn.concat(Uh({key:Qr.key,value:An,valueSpec:Qr.valueSpec,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,arrayElementValidator:br})),Bl(An)==="array"&&An.length===0&&dn.push(new Ae(Qr.key,An,"array must have at least one stop")),dn},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&&!Ku(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"&&!Zt||Y.value.property!==void 0||pr.push(new Ae(Y.key,Y.value,'"property" property is required')),pr;function br(Qr){let dn=[];const An=Qr.value,Nn=Qr.key;if(Bl(An)!=="array")return[new Ae(Nn,An,`array expected, ${Bl(An)} found`)];if(An.length!==2)return[new Ae(Nn,An,`array length 2 expected, length ${An.length} found`)];if(Zt){if(Bl(An[0])!=="object")return[new Ae(Nn,An,`object expected, ${Bl(An[0])} found`)];if(An[0].zoom===void 0)return[new Ae(Nn,An,"object stop key must have zoom")];if(An[0].value===void 0)return[new Ae(Nn,An,"object stop key must have value")];if(Ve&&Ve>au(An[0].zoom))return[new Ae(Nn,An[0].zoom,"stop zoom values must appear in ascending order")];au(An[0].zoom)!==Ve&&(Ve=au(An[0].zoom),Re=void 0,We={}),dn=dn.concat(sf({key:`${Nn}[0]`,value:An[0],valueSpec:{zoom:{}},validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,objectElementValidators:{zoom:su,value:Hr}}))}else dn=dn.concat(Hr({key:`${Nn}[0]`,value:An[0],validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec},An));return Uf(Fc(An[1]))?dn.concat([new Ae(`${Nn}[1]`,An[1],"expressions are not allowed in function stops.")]):dn.concat(Qr.validateSpec({key:`${Nn}[1]`,value:An[1],valueSpec:D,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec}))}function Hr(Qr,dn){const An=Bl(Qr.value),Nn=au(Qr.value),pa=Qr.value!==null?Qr.value:dn;if(me){if(An!==me)return[new Ae(Qr.key,pa,`${An} stop domain type must match previous stop domain type ${me}`)]}else me=An;if(An!=="number"&&An!=="string"&&An!=="boolean")return[new Ae(Qr.key,pa,"stop domain value must be a number, string, or boolean")];if(An!=="number"&&Q!=="categorical"){let oi=`number expected, ${An} found`;return Ku(D)&&Q===void 0&&(oi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ae(Qr.key,pa,oi)]}return Q!=="categorical"||An!=="number"||isFinite(Nn)&&Math.floor(Nn)===Nn?Q!=="categorical"&&An==="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(au(Q))===-1&&Re.push(new Ae(D,Q,`expected one of [${me.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(me.values).indexOf(au(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(Fc(Y.value))?qf(pe({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):mf(Y)}function mf(Y){const D=Y.value,Q=Y.key;if(Bl(D)!=="array")return[new Ae(Q,D,`array expected, ${Bl(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})),au(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&au(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=Bl(D[1]),Re!=="string"&&Ve.push(new Ae(`${Q}[1]`,D[1],`string expected, ${Re} found`)));for(let We=2;We{Zt in Q&&D.push(new Ae(me,Q[Zt],`"${Zt}" is prohibited for ref layers`))}),Re.layers.forEach(Zt=>{au(Zt.id)===gt&&(Rt=Zt)}),Rt?Rt.ref?D.push(new Ae(me,Q.ref,"ref cannot reference another ref layer")):We=au(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],Zt=Rt&&au(Rt.type);Rt?Zt==="vector"&&We==="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster source`)):Zt!=="raster-dem"&&We==="hillshade"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster-dem source`)):Zt==="raster"&&We!=="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a vector source`)):Zt!=="vector"||Q["source-layer"]?Zt==="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"]||Zt==="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:{"*":Zt=>fc(pe({layerType:We},Zt))}}),paint:Rt=>sf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Zt=>kd(pe({layerType:We},Zt))}})}})),D}function Wc(Y){const D=Y.value,Q=Y.key,me=Bl(D);return me!=="string"?[new Ae(Q,D,`string expected, ${me} found`)]:[]}const Cf={promoteId:function({key:Y,value:D}){if(Bl(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=au(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 Zt;const pr=(Zt=Rt.sourceName)!==null&&Zt!==void 0?Zt:"",br=Rt.value,Hr=Rt.styleSpec,Qr=Hr.source_raster_dem,dn=Rt.style;let An=[];const Nn=Bl(br);if(br===void 0)return An;if(Nn!=="object")return An.push(new Ae("source_raster_dem",br,`object expected, ${Nn} found`)),An;const pa=au(br.encoding)==="custom",oi=["redFactor","greenFactor","blueFactor","baseShift"],Ba=Rt.value.encoding?`"${Rt.value.encoding}"`:"Default";for(const ei in br)!pa&&oi.includes(ei)?An.push(new Ae(ei,br[ei],`In "${pr}": "${ei}" is only valid when "encoding" is set to "custom". ${Ba} encoding found`)):Qr[ei]?An=An.concat(Rt.validateSpec({key:ei,value:br[ei],valueSpec:Qr[ei],validateSpec:Rt.validateSpec,style:dn,styleSpec:Hr})):An.push(new Ae(ei,br[ei],`unknown property "${ei}"`));return An})({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[Zt,pr]=D.clusterProperties[Rt],br=typeof Zt=="string"?[Zt,["accumulated"],["get",Rt]]:Zt;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=Bl(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 wc(Y){const D=Y.value,Q=Y.styleSpec,me=Q.sky,Re=Y.style,Ve=Bl(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=Bl(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=Bl(D);return me!=="boolean"?[new Ae(Q,D,`boolean expected, ${me} found`)]:[]},number:su,color:function(Y){const D=Y.key,Q=Y.value,me=Bl(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:wc,terrain:pu,projection:function(Y){const D=Y.value,Q=Y.styleSpec,me=Q.projection,Re=Y.style,Ve=Bl(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(Bl(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 vn(Y){return function(D){return Y(bo(Gi({},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(vn(gf)),Rr.sprite=On(vn(Vf)),Rr.glyphs=On(vn(fr)),Rr.light=On(vn(Su)),Rr.sky=On(vn(wc)),Rr.terrain=On(vn(pu)),Rr.layer=On(vn($h)),Rr.filter=On(vn(dh)),Rr.paintProperty=On(vn(kd)),Rr.layoutProperty=On(vn(fc));const Aa=Rr,xa=Aa.light,ti=Aa.sky,ci=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[dn+0]&&Re>=br[dn+1])?(gt[Qr]=!0,We.push(pr[Qr])):gt[Qr]=!1}}}}_forEachCell(D,Q,me,Re,Ve,We,gt,Rt){const Zt=this._convertToCellCoord(D),pr=this._convertToCellCoord(Q),br=this._convertToCellCoord(me),Hr=this._convertToCellCoord(Re);for(let Qr=Zt;Qr<=br;Qr++)for(let dn=pr;dn<=Hr;dn++){const An=this.d*dn+Qr;if((!Rt||Rt(this._convertFromCellCoord(Qr),this._convertFromCellCoord(dn),this._convertFromCellCoord(Qr+1),this._convertFromCellCoord(dn+1)))&&Ve.call(this,D,Q,me,Re,An,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 Zi{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 Vl(Y){return Mu.test(String.fromCodePoint(Y))}function yo(Y,D){return!(!D&&Vl(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||Li.Khmer(Y))}function ys(Y){for(const D of Y)if(Vl(D.charCodeAt(0)))return!0;return!1}const Dl=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 Zi,this.transition={})}isSupportedScript(D){return(function(Q,me){for(const Re of Q)if(!yo(Re.charCodeAt(0),me))return!1;return!0})(D,Dl.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 gc{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=Oc(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=ma.parse(me)):Ve=Tn.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 yc{constructor(D){this.property=D,this.value=new gc(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 Tc{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 yc(this._values[D].property)),this._values[D].value=new gc(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 yc(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 _c(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 _c(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 Zt=Rt*Rt,pr=Zt*Rt;return 4*(Rt<.5?pr:3*(Rt-Zt)+pr-.75)})(gt))}}return Ve}}class _c{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 gc(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 Bc{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 gc(me,void 0),Ve=this.defaultTransitionablePropertyValues[Q]=new yc(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",Bc);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 Tc(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(ci,`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&&Ku(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 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 Re=2*D;return this.int16[Re+0]=Q,this.int16[Re+1]=me,D}}Gt.prototype.bytesPerElement=4,Na("StructArrayLayout2i4",Gt);class hr 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}}hr.prototype.bytesPerElement=6,Na("StructArrayLayout3i6",hr);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 en 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,Zt=8*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.uint8[Zt+4]=Re,this.uint8[Zt+5]=Ve,this.uint8[Zt+6]=We,this.uint8[Zt+7]=gt,D}}en.prototype.bytesPerElement=8,Na("StructArrayLayout2i4ub8",en);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,Zt,pr){const br=this.length;return this.resize(br+1),this.emplace(br,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,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]=Zt,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,Zt,pr,br,Hr){const Qr=this.length;return this.resize(Qr+1),this.emplace(Qr,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr){const dn=12*D;return this.int16[dn+0]=Q,this.int16[dn+1]=me,this.int16[dn+2]=Re,this.int16[dn+3]=Ve,this.uint16[dn+4]=We,this.uint16[dn+5]=gt,this.uint16[dn+6]=Rt,this.uint16[dn+7]=Zt,this.int16[dn+8]=pr,this.int16[dn+9]=br,this.int16[dn+10]=Hr,this.int16[dn+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,Zt){const pr=this.length;return this.resize(pr+1),this.emplace(pr,D,Q,me,Re,Ve,We,gt,Rt,Zt)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,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]=Zt,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,Zt=4*D,pr=8*D;return this.uint8[Rt+0]=Q,this.uint8[Rt+1]=me,this.float32[Zt+1]=Re,this.float32[Zt+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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa){const oi=this.length;return this.resize(oi+1),this.emplace(oi,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi){const Ba=24*D,ei=12*D,Fi=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]=Zt,this.uint16[Ba+11]=pr,this.uint16[Ba+12]=br,this.float32[ei+7]=Hr,this.float32[ei+8]=Qr,this.uint8[Fi+36]=dn,this.uint8[Fi+37]=An,this.uint8[Fi+38]=Nn,this.uint32[ei+10]=pa,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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss){const bs=this.length;return this.resize(bs+1),this.emplace(bs,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss,bs){const Qi=32*D,Gs=16*D;return this.int16[Qi+0]=Q,this.int16[Qi+1]=me,this.int16[Qi+2]=Re,this.int16[Qi+3]=Ve,this.int16[Qi+4]=We,this.int16[Qi+5]=gt,this.int16[Qi+6]=Rt,this.int16[Qi+7]=Zt,this.uint16[Qi+8]=pr,this.uint16[Qi+9]=br,this.uint16[Qi+10]=Hr,this.uint16[Qi+11]=Qr,this.uint16[Qi+12]=dn,this.uint16[Qi+13]=An,this.uint16[Qi+14]=Nn,this.uint16[Qi+15]=pa,this.uint16[Qi+16]=oi,this.uint16[Qi+17]=Ba,this.uint16[Qi+18]=ei,this.uint16[Qi+19]=Fi,this.uint16[Qi+20]=co,this.uint16[Qi+21]=$o,this.uint16[Qi+22]=hl,this.uint32[Gs+12]=is,this.float32[Gs+13]=Yo,this.float32[Gs+14]=Ds,this.uint16[Qi+30]=Ss,this.uint16[Qi+31]=bs,D}}Yr.prototype.bytesPerElement=64,Na("StructArrayLayout8i15ui1ul2f2ui64",Yr);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 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 Wi 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]}}Wi.prototype.size=48;class To extends Pr{get(D){return new Wi(this,D)}}Na("PlacedSymbolArray",To);class ho 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]}}ho.prototype.size=64;class Wo extends Yr{get(D){return new ho(this,D)}}Na("SymbolInstanceArray",Wo);class Js extends on{getoffsetX(D){return this.float32[1*D+0]}}Na("GlyphOffsetArray",Js);class Qs extends hr{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 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 al extends En{get(D){return new Es(this,D)}}Na("TextAnchorOffsetArray",al);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 iu extends Pn{get(D){return new mu(this,D)}}Na("FeatureIndexArray",iu);class ks extends Gt{}class Cs extends Gt{}class Ru extends Gt{}class uc extends Lr{}class Nc extends en{}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 hn{constructor(D=[]){this.segments=D}prepareSegment(D,Q,me,Re){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!==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 hn([{vertexOffset:D,primitiveOffset:Q,vertexLength:me,primitiveLength:Re,vaos:{},sortKey:0}])}}function Sn(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 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,Zt;for(me=Y.length-(Q=3&Y.length),Re=D,We=3432918353,gt=461845907,Zt=0;Zt>>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(Zt+2))<<16;case 2:Rt^=(255&Y.charCodeAt(Zt+1))<<8;case 1:Re^=Rt=(65535&(Rt=(Rt=(65535&(Rt^=255&Y.charCodeAt(Zt)))*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 Qn=zn.exports,la={exports:{}};la.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=Qn,Ra=la.exports;La.exports=Sa,La.exports.murmur3=Sa,La.exports.murmur2=Ra;var sa=r(La.exports);class ai{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,Q,me,Re){this.ids.push(Yi(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=Yi(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 zi(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 Yi(Y){const D=+Y;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:sa(String(Y))}function zi(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 eu{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 Ac(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:on,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",eu),Na("SourceExpressionBinder",lo),Na("CrossFadedCompositeBinder",el),Na("CompositeExpressionBinder",Ls),Na("ProgramConfiguration",$l,{omit:["_buffers"]}),Na("ProgramConfigurationSet",zl);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 hn,this.programConfigurations=new zl(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:Zt,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 dn=gt?We.evaluate(Qr,{},me):void 0,An={id:Zt,properties:Rt.properties,type:Rt.type,sourceLayerIndex:br,index:pr,geometry:Hr?Qr.geometry:mt(Rt),patterns:{},sortKey:dn};Ve.push(An)}gt&&Ve.sort((Rt,Zt)=>Rt.sortKey-Zt.sortKey);for(const Rt of Ve){const{geometry:Zt,index:pr,sourceLayerIndex:br}=Rt,Hr=D[pr].feature;this.addFeature(Rt,Zt,pr,me),Q.featureIndex.insert(Hr,Zt,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 Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),pr=Zt.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),Zt.vertexLength+=4,Zt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,{},Re)}}function fa(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 ga(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;gtOi(Nn,An))})(Zt,Rt),Qr=br?pr*gt:pr;for(const dn of Re)for(const An of dn){const Nn=br?An:Oi(An,Rt);let pa=Qr;const oi=$a([],[An.x,An.y,0,1],Rt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?pa*=oi[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(pa*=We.cameraToCenterDistance/oi[3]),gn(Hr,Nn,pa))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 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 Bc(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 Ao(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 Zt=Y.expression.evaluate(D);Re.data[We+gt+0]=Math.floor(255*Zt.r/Zt.a),Re.data[We+gt+1]=Math.floor(255*Zt.g/Zt.a),Re.data[We+gt+2]=Math.floor(255*Zt.b/Zt.a),Re.data[We+gt+3]=Math.floor(255*Zt.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),dn>br&&(br=dn)}Zt=Math.max(pr-gt,br-Rt),Zt=Zt!==0?32767/Zt:0}return js(Ve,We,Q,gt,Rt,Zt,0),We}function fo(Y,D,Q,me,Re){let Ve;if(Re===(function(We,gt,Rt,Zt){let pr=0;for(let br=gt,Hr=Rt-Zt;br0)for(let We=D;We=D;We-=me)Ve=Vt(We/me|0,Y[We],Y[We+1],Ve);return Ve&&ft(Ve,Ve.next)&&(Jt(Ve),Ve=Ve.next),Ve}function Qu(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 js(Y,D,Q,me,Re,Ve,We){if(!Y)return;!We&&Ve&&(function(Rt,Zt,pr,br){let Hr=Rt;do Hr.z===0&&(Hr.z=q(Hr.x,Hr.y,Zt,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 dn,An=1;do{let Nn,pa=Qr;Qr=null;let oi=null;for(dn=0;pa;){dn++;let Ba=pa,ei=0;for(let co=0;co0||Fi>0&&Ba;)ei!==0&&(Fi===0||!Ba||pa.z<=Ba.z)?(Nn=pa,pa=pa.nextZ,ei--):(Nn=Ba,Ba=Ba.nextZ,Fi--),oi?oi.nextZ=Nn:Qr=Nn,Nn.prevZ=oi,oi=Nn;pa=Ba}oi.nextZ=null,An*=2}while(dn>1)})(Hr)})(Y,me,Re,Ve);let gt=Y;for(;Y.prev!==Y.next;){const Rt=Y.prev,Zt=Y.next;if(Ve?hc(Y,me,Re,Ve):Ol(Y))D.push(Rt.i,Y.i,Zt.i),Jt(Y),Y=Zt.next,gt=Zt.next;else if((Y=Zt)===gt){We?We===1?js(Y=dc(Qu(Y),D),D,Q,me,Re,Ve,2):We===2&&Co(Y,D,Q,me,Re,Ve):js(Qu(Y),D,Q,me,Re,Ve,1);break}}}function Ol(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,Zt=me.y,pr=ReVe?Re>We?Re:We:Ve>We?Ve:We,Qr=gt>Rt?gt>Zt?gt:Zt:Rt>Zt?Rt:Zt;let dn=me.next;for(;dn!==D;){if(dn.x>=pr&&dn.x<=Hr&&dn.y>=br&&dn.y<=Qr&&J(Re,gt,Ve,Rt,We,Zt,dn.x,dn.y)&&qe(dn.prev,dn,dn.next)>=0)return!1;dn=dn.next}return!0}function hc(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,Zt=We.x,pr=Re.y,br=Ve.y,Hr=We.y,Qr=gtRt?gt>Zt?gt:Zt:Rt>Zt?Rt:Zt,Nn=pr>br?pr>Hr?pr:Hr:br>Hr?br:Hr,pa=q(Qr,dn,D,Q,me),oi=q(An,Nn,D,Q,me);let Ba=Y.prevZ,ei=Y.nextZ;for(;Ba&&Ba.z>=pa&&ei&&ei.z<=oi;){if(Ba.x>=Qr&&Ba.x<=An&&Ba.y>=dn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Zt,Hr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0||(Ba=Ba.prevZ,ei.x>=Qr&&ei.x<=An&&ei.y>=dn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Zt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0))return!1;ei=ei.nextZ}for(;Ba&&Ba.z>=pa;){if(Ba.x>=Qr&&Ba.x<=An&&Ba.y>=dn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Zt,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<=An&&ei.y>=dn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Zt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0)return!1;ei=ei.nextZ}return!0}function dc(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 Qu(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=Wt(We,gt);return We=Qu(We,We.next),Rt=Qu(Rt,Rt.next),js(We,D,Q,me,Re,Ve,0),void js(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 Zt,pr=-1/0;do{if(Rt<=We.y&&Rt>=We.next.y&&We.next.y!==We.y){const An=We.x+(Rt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(An<=gt&&An>pr&&(pr=An,Zt=We.x=We.x&&We.x>=Hr&>!==We.x&&J(RtZt.x||We.x===Zt.x&&be(Zt,We)))&&(Zt=We,dn=An)}We=We.next}while(We!==br);return Zt})(Y,D);if(!Q)return D;const me=Wt(Q,Y);return Qu(me,me.next),Qu(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 Wt(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 Vt(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),Zt=gt.evaluate({zoom:me},Q,{},Re.availableImages),pr=gt.evaluate({zoom:me+1},Q,{},Re.availableImages);Rt=Rt&&Rt.name?Rt.name:Rt,Zt=Zt&&Zt.name?Zt.name:Zt,pr=pr&&pr.name?pr.name:pr,Ve[Rt]=!0,Ve[Zt]=!0,Ve[pr]=!0,Q.patterns[We.id]={min:Rt,mid:Zt,max:pr}}}return Q}class Yt{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 zl(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=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:Zt,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,dn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Zt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(dn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Zt,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,Zt,me,{});Q.featureIndex.insert(D[Zt].feature,Rt,Zt,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,tu),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),Zt=Rt.vertexLength,pr=[],br=[];for(const Qr of We){if(Qr.length===0)continue;Qr!==We[0]&&br.push(pr.length/2);const dn=this.segments2.prepareSegment(Qr.length,this.layoutVertexArray,this.indexArray2),An=dn.vertexLength;this.layoutVertexArray.emplaceBack(Qr[0].x,Qr[0].y),this.indexArray2.emplaceBack(An+Qr.length-1,An),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 va(Ve,We));else{if(me!==7)throw new Error("unknown command "+me);D&&D.push(D[0].clone())}}return D&>.push(D),gt},ha.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,Zt=-1/0;Y.pos>3}if(me--,Q===1||Q===2)(Re+=Y.readSVarint())gt&&(gt=Re),(Ve+=Y.readSVarint())Zt&&(Zt=Ve);else if(Q!==7)throw new Error("unknown command "+Q)}return[We,Rt,gt,Zt]},ha.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(),Zt=ha.types[this.type];function pr(Qr){for(var dn=0;dn>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 fl(Y,D,Q){if(Y===3){var me=new yl(Q,Q.readVarint()+Q.pos);me.length&&(D[me.name]=me)}}ca.VectorTile=function(Y,D){this.layers=Y.readFields(fl,{},D)},ca.VectorTileFeature=Pa,ca.VectorTileLayer=qi;const xl=ca.VectorTileFeature.types,_l=Math.pow(2,13);function ec(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 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 uc,this.centroidVertexArray=new ks,this.indexArray=new er,this.programConfigurations=new zl(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=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,Zt=yr(Re,Rt);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Zt,me))continue;const pr={id:Ve,sourceLayerIndex:gt,index:We,geometry:Rt?Zt.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 dn of We)Rt+=dn.length;let Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const dn of We){if(dn.length===0||Kf(dn))continue;let An=0;for(let Nn=0;Nn=1){const oi=dn[Nn-1];if(!Tu(pa,oi)){Zt.vertexLength+4>hn.MAX_VERTEX_ARRAY_LENGTH&&(Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ba=pa.sub(oi)._perp()._unit(),ei=oi.dist(pa);An+ei>32768&&(An=0),ec(this.layoutVertexArray,pa.x,pa.y,Ba.x,Ba.y,0,0,An),ec(this.layoutVertexArray,pa.x,pa.y,Ba.x,Ba.y,0,1,An),gt.x+=2*pa.x,gt.y+=2*pa.y,gt.vertexCount+=2,An+=ei,ec(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,0,An),ec(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,1,An),gt.x+=2*oi.x,gt.y+=2*oi.y,gt.vertexCount+=2;const Fi=Zt.vertexLength;this.indexArray.emplaceBack(Fi,Fi+2,Fi+1),this.indexArray.emplaceBack(Fi+1,Fi+2,Fi+3),Zt.vertexLength+=4,Zt.primitiveLength+=2}}}}if(Zt.vertexLength+Rt>hn.MAX_VERTEX_ARRAY_LENGTH&&(Zt=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),xl[D.type]!=="Polygon")continue;const pr=[],br=[],Hr=Zt.vertexLength;for(const dn of We)if(dn.length!==0){dn!==We[0]&&br.push(pr.length/2);for(let An=0;AnKl)||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",ol,{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 ol(D)}queryRadius(){return Fn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,Q,me,Re,Ve,We,gt,Rt){const Zt=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(dn,An,Nn,pa){const oi=[];for(const Ba of dn){const ei=[Ba.x,Ba.y,0,1];$a(ei,ei,An),oi.push(new i(ei[0]/ei[3],ei[1]/ei[3]))}return oi})(Zt,Rt),Qr=(function(dn,An,Nn,pa){const oi=[],Ba=[],ei=pa[8]*An,Fi=pa[9]*An,co=pa[10]*An,$o=pa[11]*An,hl=pa[8]*Nn,is=pa[9]*Nn,Yo=pa[10]*Nn,Ds=pa[11]*Nn;for(const Ss of dn){const bs=[],Qi=[];for(const Gs of Ss){const zs=Gs.x,Ll=Gs.y,lf=pa[0]*zs+pa[4]*Ll+pa[12],Jc=pa[1]*zs+pa[5]*Ll+pa[13],hd=pa[2]*zs+pa[6]*Ll+pa[14],Av=pa[3]*zs+pa[7]*Ll+pa[15],kh=hd+co,Qh=Av+$o,vv=lf+hl,pv=Jc+is,mv=hd+Yo,Jf=Av+Ds,dd=new i((lf+ei)/Qh,(Jc+Fi)/Qh);dd.z=kh/Qh,bs.push(dd);const iv=new i(vv/Jf,pv/Jf);iv.z=mv/Jf,Qi.push(iv)}oi.push(bs),Ba.push(Qi)}return[oi,Ba]})(Re,br,pr,Rt);return(function(dn,An,Nn){let pa=1/0;pn(Nn,An)&&(pa=hp(Nn,An[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 Nc,this.layoutVertexArray2=new ge,this.indexArray=new er,this.programConfigurations=new zl(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=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:Zt,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,dn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Zt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(dn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Zt,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,Zt,me,{});Q.featureIndex.insert(D[Zt].feature,Rt,Zt,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"),Zt=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,Zt,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 pa=0;pa=2&&D[Rt-1].equals(D[Rt-2]);)Rt--;let Zt=0;for(;Zt0;if($o&&pa>Zt){const Ds=Hr.dist(Qr);if(Ds>2*pr){const Ss=Hr.sub(Hr.sub(Qr)._mult(pr/Ds)._round());this.updateDistance(Qr,Ss),this.addCurrentVertex(Ss,An,0,0,br),Qr=Ss}}const is=Qr&&dn;let Yo=is?me:gt?"butt":Re;if(is&&Yo==="round"&&(FiVe&&(Yo="bevel"),Yo==="bevel"&&(Fi>2&&(Yo="flipbevel"),Fi100)oi=Nn.mult(-1);else{const Ds=Fi*An.add(Nn).mag()/An.sub(Nn).mag();oi._perp()._mult(Ds*(hl?-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 Ds=-Math.sqrt(Fi*Fi-1),Ss=hl?Ds:0,bs=hl?0:Ds;if(Qr&&this.addCurrentVertex(Hr,An,Ss,bs,br),Yo==="fakeround"){const Qi=Math.round(180*co/Math.PI/20);for(let Gs=1;Gs2*pr){const Ss=Hr.add(dn.sub(Hr)._mult(pr/Ds)._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 Zt=.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&Zt)<<2,Zt>>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,Fg;Na("LineBucket",dp,{omit:["layers","patternFeatures"]});var Q0={get paint(){return Fg=Fg||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 Bc(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 Bg 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),Zt=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 dn=0;dn=3){for(let Nn=0;Nn0?D+2*Y:Y}const Nm=_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 Ng=_t([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Um=_t([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function jm(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()),Dl.applyArabicShaping&&(Re=Dl.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 vc=24,av=Sc,Ug=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-Zt;else{if(Ve===Rt)return We?NaN:1/0*(Qr?-1:1);We+=Math.pow(2,me),Ve-=Zt}return(Qr?-1:1)*We*Math.pow(2,Ve-me)},Jy=function(Y,D,Q,me,Re,Ve){var We,gt,Rt,Zt=8*Ve-Re-1,pr=(1<>1,Hr=Re===23?Math.pow(2,-24)-Math.pow(2,-77):0,Qr=0,dn=1,An=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+=dn,gt/=256,Re-=8);for(We=We<0;Y[Q+Qr]=255&We,Qr+=dn,We/=256,Zt-=8);Y[Q+Qr-dn]|=128*An};function Sc(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}Sc.Varint=0,Sc.Fixed64=1,Sc.Bytes=2,Sc.Fixed32=5;var V_=4294967296,qm=1/V_,tw=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Zv(Y){return Y.type===Sc.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function Vm(Y,D,Q){return Q?4294967296*D+(Y>>>0):4294967296*(D>>>0)+(Y>>>0)}function rw(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 H_(Y,D){for(var Q=0;Q>>8,Y[Q+2]=D>>>16,Y[Q+3]=D>>>24}function cS(Y,D){return(Y[D]|Y[D+1]<<8|Y[D+2]<<16)+(Y[D+3]<<24)}Sc.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=aw(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=cS(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=aw(this.buf,this.pos)+aw(this.buf,this.pos+4)*V_;return this.pos+=8,Y},readSFixed64:function(){var Y=aw(this.buf,this.pos)+cS(this.buf,this.pos+4)*V_;return this.pos+=8,Y},readFloat:function(){var Y=Ug(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=Ug(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,Zt=We.buf;if(gt=(112&(Rt=Zt[We.pos++]))>>4,Rt<128||(gt|=(127&(Rt=Zt[We.pos++]))<<3,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<10,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<17,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<24,Rt<128)||(gt|=(1&(Rt=Zt[We.pos++]))<<31,Rt<128))return Vm(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&&tw?(function(Q,me,Re){return tw.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],Zt=Q[We+3],(192&(gt=Q[We+1]))==128&&(192&Rt)==128&&(192&Zt)==128&&((br=(15&pr)<<18|(63>)<<12|(63&Rt)<<6|63&Zt)<=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!==Sc.Bytes)return Y.push(this.readVarint(D));var Q=Zv(this);for(Y=Y||[];this.pos127;);else if(D===Sc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Sc.Fixed32)this.pos+=4;else{if(D!==Sc.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&&rw(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&&rw(Q,me,this),this.pos=Q-1,this.writeVarint(me),this.pos+=me},writeMessage:function(Y,D,Q){this.writeTag(Y,Sc.Bytes),this.writeRawMessage(D,Q)},writePackedVarint:function(Y,D){D.length&&this.writeMessage(Y,H_,D)},writePackedSVarint:function(Y,D){D.length&&this.writeMessage(Y,s6,D)},writePackedBoolean:function(Y,D){D.length&&this.writeMessage(Y,c6,D)},writePackedFloat:function(Y,D){D.length&&this.writeMessage(Y,l6,D)},writePackedDouble:function(Y,D){D.length&&this.writeMessage(Y,u6,D)},writePackedFixed32:function(Y,D){D.length&&this.writeMessage(Y,f6,D)},writePackedSFixed32:function(Y,D){D.length&&this.writeMessage(Y,h6,D)},writePackedFixed64:function(Y,D){D.length&&this.writeMessage(Y,d6,D)},writePackedSFixed64:function(Y,D){D.length&&this.writeMessage(Y,nw,D)},writeBytesField:function(Y,D){this.writeTag(Y,Sc.Bytes),this.writeBytes(D)},writeFixed32Field:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(Y,D){this.writeTag(Y,Sc.Varint),this.writeVarint(D)},writeSVarintField:function(Y,D){this.writeTag(Y,Sc.Varint),this.writeSVarint(D)},writeStringField:function(Y,D){this.writeTag(Y,Sc.Bytes),this.writeString(D)},writeFloatField:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeFloat(D)},writeDoubleField:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeDouble(D)},writeBooleanField:function(Y,D){this.writeVarintField(Y,!!D)}};var X3=r(av);const iw=3;function v6(Y,D,Q){Y===1&&Q.readMessage(fS,D)}function fS(Y,D,Q){if(Y===3){const{id:me,bitmap:Re,width:Ve,height:We,left:gt,top:Rt,advance:Zt}=Q.readMessage(Y3,{});D.push({id:me,bitmap:new Qo({width:Ve+2*iw,height:We+2*iw},Re),metrics:{width:Ve,height:We,left:gt,top:Rt,advance:Zt}})}}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=iw;function ow(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 Zt=me.pop();gt=0&&me>=D&&lw[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(G_.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 sw(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn){const An=t1.fromFeature(Y,Re);let Nn;br===e.ah.vertical&&An.verticalizePunctuation();const{processBidirectionalText:pa,processStyledBidirectionalText:oi}=Dl;if(pa&&An.sections.length===1){Nn=[];const Fi=pa(An.toString(),jg(An,Zt,Ve,D,me,Qr));for(const co of Fi){const $o=new t1;$o.text=co,$o.sections=An.sections;for(let hl=0;hl0&&Cp>Pd&&(Pd=Cp)}else{const uf=$o[Bu.fontStack],Rd=uf&&uf[Uc];if(Rd&&Rd.rect)c1=Rd.rect,wf=Rd.metrics;else{const Cp=co[Bu.fontStack],Kv=Cp&&Cp[Uc];if(!Kv)continue;wf=Kv.metrics}Hf=(dd-Bu.scale)*vc}ov?(Fi.verticalizable=!0,gv.push({glyph:Uc,imageName:t0,x:Ll,y:lf+Hf,vertical:ov,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Mc,metrics:wf,rect:c1}),Ll+=r0*Bu.scale+Qi):(gv.push({glyph:Uc,imageName:t0,x:Ll,y:lf+Hf,vertical:ov,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Mc,metrics:wf,rect:c1}),Ll+=wf.advance*Bu.scale+Qi)}gv.length!==0&&(Jc=Math.max(Ll-Qi,Jc),g6(gv,0,gv.length-1,Av,Pd)),Ll=0;const $v=Yo*dd+Pd;Xd.lineOffset=Math.max(Pd,iv),lf+=$v,hd=Math.max($v,hd),++kh}var Qh;const vv=lf-e1,{horizontalAlign:pv,verticalAlign:mv}=$3(Ds);(function(Jf,dd,iv,Xd,gv,Pd,$v,bf,Bu){const Mc=(dd-iv)*gv;let Uc=0;Uc=Pd!==$v?-bf*Xd-e1:(-Xd*Bu+.5)*$v;for(const Hf of Jf)for(const wf of Hf.positionedGlyphs)wf.x+=Mc,wf.y+=Uc})(Fi.positionedLines,Av,pv,mv,Jc,hd,Yo,vv,is.length),Fi.top+=-mv*vv,Fi.bottom=Fi.top+vv,Fi.left+=-pv*Jc,Fi.right=Fi.left+Jc})(ei,D,Q,me,Nn,We,gt,Rt,br,Zt,Hr,dn),!(function(Fi){for(const co of Fi)if(co.positionedGlyphs.length!==0)return!1;return!0})(Ba)&&ei}const lw={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},p6={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},m6={40:!0};function uw(Y,D,Q,me,Re,Ve){if(D.imageName){const We=me[D.imageName];return We?We.displaySize[0]*D.scale*vc/Ve+Re:0}{const We=Q[D.fontStack],gt=We&&We[Y];return gt?gt.metrics.advance*D.scale+Re:0}}function dS(Y,D,Q,me){const Re=Math.pow(Y-D,2);return me?Y=0;let Zt=0;for(let br=0;brZt){const pr=Math.ceil(Ve/Zt);Re*=pr/We,We=pr}return{x1:me,y1:Re,x2:me+Ve,y2:Re+We}}function pS(Y,D,Q,me,Re,Ve){const We=Y.image;let gt;if(We.content){const Nn=We.content,pa=We.pixelRatio||1;gt=[Nn[0]/pa,Nn[1]/pa,We.displaySize[0]-Nn[2]/pa,We.displaySize[1]-Nn[3]/pa]}const Rt=D.left*Ve,Zt=D.right*Ve;let pr,br,Hr,Qr;Q==="width"||Q==="both"?(Qr=Re[0]+Rt-me[3],br=Re[0]+Zt+me[1]):(Qr=Re[0]+(Rt+Zt-We.displaySize[0])/2,br=Qr+We.displaySize[0]);const dn=D.top*Ve,An=D.bottom*Ve;return Q==="height"||Q==="both"?(pr=Re[1]+dn-me[0],Hr=Re[1]+An+me[2]):(pr=Re[1]+(dn+An-We.displaySize[1])/2,Hr=pr+We.displaySize[1]),{image:We,top:pr,right:br,bottom:Hr,left:Qr,collisionPadding:gt}}const X_=255,T0=128,Gm=X_*T0;function mS(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=oa([]),this.placementViewportMatrix=oa([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mS(this.zoom,Q["text-size"]),this.iconSizeData=mS(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 zl(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new oh(new zl(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Js,this.lineVertexArray=new Qs,this.symbolInstances=new Wo,this.textAnchorOffsets=new al}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=[],!Zt&&!pr)return;const Hr=Q.iconDependencies,Qr=Q.glyphDependencies,dn=Q.availableImages,An=new ml(this.zoom);for(const{feature:Nn,id:pa,index:oi,sourceLayerIndex:Ba}of D){const ei=Re._featureFilter.needGeometry,Fi=yr(Nn,ei);if(!Re._featureFilter.filter(An,Fi,me))continue;let co,$o;if(ei||(Fi.geometry=mt(Nn)),Zt){const is=Re.getValueAndResolveTokens("text-field",Fi,me,dn),Yo=mn.factory(is),Ds=this.hasRTLText=this.hasRTLText||x6(Yo);(!Ds||Dl.getRTLTextPluginStatus()==="unavailable"||Ds&&Dl.isParsed())&&(co=jm(Yo,Re,Fi))}if(pr){const is=Re.getValueAndResolveTokens("icon-image",Fi,me,dn);$o=is instanceof da?is:da.fromString(is)}if(!co&&!$o)continue;const hl=this.sortFeaturesByKey?br.evaluate(Fi,{},me):void 0;if(this.features.push({id:pa,text:co,icon:$o,index:oi,sourceLayerIndex:Ba,geometry:Fi.geometry,properties:Nn.properties,type:_6[Nn.type],sortKey:hl}),$o&&(Hr[$o.name]=!0),co){const is=We.evaluate(Fi,{},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 Ds of co.sections)if(Ds.image)Hr[Ds.image.name]=!0;else{const Ss=ns(co.toString()),bs=Ds.fontStack||is,Qi=Qr[bs]=Qr[bs]||{};this.calculateGlyphDependencies(Ds.text,Qi,Yo,this.allowVerticalPlacement,Ss)}}}Ve.get("symbol-placement")==="line"&&(this.features=(function(Nn){const pa={},oi={},Ba=[];let ei=0;function Fi(is){Ba.push(Nn[is]),ei++}function co(is,Yo,Ds){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(Ds[0]),Ss}function $o(is,Yo,Ds){const Ss=pa[Yo];return delete pa[Yo],pa[is]=Ss,Ba[Ss].geometry[0].shift(),Ba[Ss].geometry[0]=Ds[0].concat(Ba[Ss].geometry[0]),Ss}function hl(is,Yo,Ds){const Ss=Ds?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,pa)=>Nn.sortKey-pa.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 Y_,Z_;Na("SymbolBucket",qg,{omit:["layers","collisionBoxArray","features","compareText"]}),qg.MAX_GLYPHS=65535,qg.addDynamicAttributes=Xm;var Q3={get paint(){return Z_=Z_||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 Y_=Y_||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 hw 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,(Zt,pr)=>gt&&pr in gt?String(gt[pr]):"")})(Q.properties,Ve)}createBucket(D){return new qg(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of Q3.paint.overridableProperties){if(!hw.hasPaintOverride(this.layout,D))continue;const Q=this.paint.get(D),me=new n1(Q),Re=new zc(me,Q.property.specification);let Ve=null;Ve=Q.value.kind==="constant"||Q.value.kind==="source"?new kf("source",Re):new mc("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())&&hw.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 mn)We(me.value.value.sections);else if(me.value.kind==="source"){const gt=Zt=>{Ve||(Zt instanceof Mi&&Hn(Zt.value)===$r?We(Zt.value.sections):Zt instanceof ll?We(Zt.sections):Zt.eachChild(gt))},Rt=me.value;Rt._styleExpression&>(Rt._styleExpression.expression)}return Ve}}let eT;var gS={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 W_ extends oe{constructor(D){super(D,gS)}}let dw;var tT={get paint(){return dw=dw||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 b6 extends oe{constructor(D){super(D,tT)}}class yS 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 $_{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 A0{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 A0(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 A0)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new A0(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new A0(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 _S=2*Math.PI*rT;function vw(Y){return _S*Math.cos(Y*Math.PI/180)}function pw(Y){return(180+Y)/360}function xS(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function kp(Y,D){return Y/vw(D)}function nT(Y){return 360/Math.PI*Math.atan(Math.exp((180-360*Y)*Math.PI/180))-90}class K_{constructor(D,Q,me=0){this.x=+D,this.y=+Q,this.z=+me}static fromLngLat(D,Q=0){const me=A0.convert(D);return new K_(pw(me.lng),xS(me.lat),kp(Q,me.lat))}toLngLat(){return new A0(360*this.x-180,nT(this.y))}toAltitude(){return this.z*vw(nT(this.y))}meterInMercatorCoordinateUnits(){return 1/_S*(D=nT(this.y),1/Math.cos(D*Math.PI/180));var D}}function bS(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=bS(256*(Ve=this.x),256*(We=Math.pow(2,gt)-We-1),gt),Zt=bS(256*(Ve+1),256*(We+1),gt),Rt[0]+","+Rt[1]+","+Zt[0]+","+Zt[1]);var Ve,We,gt,Rt,Zt;const pr=(function(br,Hr,Qr){let dn,An="";for(let Nn=br;Nn>0;Nn--)dn=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 wS{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 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 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,Zt=-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 AS{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 SS{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 iu,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 Zt=0;Zt=0&&br[3]>=0&&Rt.insert(gt,br[0],br[1],br[2],br[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ca.VectorTile(new X3(this.rawTileData)).layers,this.sourceLayerCoder=new TS(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,Zt=D.queryPadding*We,pr=iT(Rt),br=this.grid.query(pr.minX-Zt,pr.minY-Zt,pr.maxX+Zt,pr.maxY+Zt),Hr=iT(D.cameraQueryGeometry),Qr=this.grid3D.query(Hr.minX-Zt,Hr.minY-Zt,Hr.maxX+Zt,Hr.maxY+Zt,(Nn,pa,oi,Ba)=>(function(ei,Fi,co,$o,hl){for(const Yo of ei)if(Fi<=Yo.x&&co<=Yo.y&&$o>=Yo.x&&hl>=Yo.y)return!0;const is=[new i(Fi,co),new i(Fi,hl),new i($o,hl),new i($o,co)];if(ei.length>2){for(const Yo of is)if(Ga(ei,Yo))return!0}for(let Yo=0;Yo(Ba||(Ba=mt(ei)),Fi.queryIntersectsFeature(Rt,ei,co,Ba,this.z,D.transform,We,D.pixelPosMatrix)))}return dn}loadMatchingFeature(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br){const Hr=this.bucketLayerIDs[Q];if(We&&!(function(Nn,pa){for(let oi=0;oi=0)return!0;return!1})(We,Hr))return;const Qr=this.sourceLayerCoder.decode(me),dn=this.vtLayers[Qr].feature(Re);if(Ve.needGeometry){const Nn=yr(dn,!0);if(!Ve.filter(new ml(this.tileID.overscaledZ),Nn,this.tileID.canonical))return}else if(!Ve.filter(new ml(this.tileID.overscaledZ),dn))return;const An=this.getId(dn,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 ES(Y,D){return D-Y}function kS(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",SS,{omit:["rawTileData","sourceLayerCoder"]});class Ym extends i{constructor(D,Q,me,Re){super(D,Q),this.angle=me,Re!==void 0&&(this.segment=Re)}clone(){return new Ym(this.x,this.y,this.angle,this.segment)}}function CS(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 Zt=0;for(;gtme;)Zt-=Rt.shift().angleDelta;if(Zt>Re)return!1;We++,gt+=pr.dist(br)}return!0}function LS(Y){let D=0;for(let Q=0;QZt){const dn=(Zt-Rt)/Qr,An=Mo.number(br.x,Hr.x,dn),Nn=Mo.number(br.y,Hr.y,dn),pa=new Ym(An,Nn,Hr.angleTo(br),pr);return pa._round(),!We||CS(Y,pa,gt,We,D)?pa:void 0}Rt+=Qr}}function T6(Y,D,Q,me,Re,Ve,We,gt,Rt){const Zt=PS(me,Ve,We),pr=RS(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&&Fi=0&&Hr+Zt<=pr){const co=new Ym(ei,Fi,oi,dn);co._round(),me&&!CS(Y,co,Ve,me,Re)||Qr.push(co)}}br+=pa}return gt||Qr.length||We||(Qr=Hg(Y,br/2,Q,me,Re,Ve,We,!0,Rt)),Qr}Na("Anchor",Ym);const i1=Jh;function IS(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 Zt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const pr=Ve.stretchX||[[0,gt]],br=Ve.stretchY||[[0,Rt]],Hr=(Qi,Gs)=>Qi+Gs[1]-Gs[0],Qr=pr.reduce(Hr,0),dn=br.reduce(Hr,0),An=gt-Qr,Nn=Rt-dn;let pa=0,oi=Qr,Ba=0,ei=dn,Fi=0,co=An,$o=0,hl=Nn;if(Ve.content&&me){const Qi=Ve.content,Gs=Qi[2]-Qi[0],zs=Qi[3]-Qi[1];(Ve.textFitWidth||Ve.textFitHeight)&&(Zt=vS(Y)),pa=o1(pr,0,Qi[0]),Ba=o1(br,0,Qi[1]),oi=o1(pr,Qi[0],Qi[2]),ei=o1(br,Qi[1],Qi[3]),Fi=Qi[0]-pa,$o=Qi[1]-Ba,co=Gs-oi,hl=zs-ei}const is=Zt.x1,Yo=Zt.y1,Ds=Zt.x2-is,Ss=Zt.y2-Yo,bs=(Qi,Gs,zs,Ll)=>{const lf=Wv(Qi.stretch-pa,oi,Ds,is),Jc=mw(Qi.fixed-Fi,co,Qi.stretch,Qr),hd=Wv(Gs.stretch-Ba,ei,Ss,Yo),Av=mw(Gs.fixed-$o,hl,Gs.stretch,dn),kh=Wv(zs.stretch-pa,oi,Ds,is),Qh=mw(zs.fixed-Fi,co,zs.stretch,Qr),vv=Wv(Ll.stretch-Ba,ei,Ss,Yo),pv=mw(Ll.fixed-$o,hl,Ll.stretch,dn),mv=new i(lf,hd),Jf=new i(kh,hd),dd=new i(kh,vv),iv=new i(lf,vv),Xd=new i(Jc/We,Av/We),gv=new i(Qh/We,pv/We),Pd=D*Math.PI/180;if(Pd){const Bu=Math.sin(Pd),Mc=Math.cos(Pd),Uc=[Mc,-Bu,Bu,Mc];mv._matMult(Uc),Jf._matMult(Uc),iv._matMult(Uc),dd._matMult(Uc)}const $v=Qi.stretch+Qi.fixed,bf=Gs.stretch+Gs.fixed;return{tl:mv,tr:Jf,bl:iv,br:dd,tex:{x:Ve.paddedRect.x+i1+$v,y:Ve.paddedRect.y+i1+bf,w:zs.stretch+zs.fixed-$v,h:Ll.stretch+Ll.fixed-bf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xd,pixelOffsetBR:gv,minFontScaleX:co/We/Ds,minFontScaleY:hl/We/Ss,isSDF:Q}};if(me&&(Ve.stretchX||Ve.stretchY)){const Qi=s1(pr,An,Qr),Gs=s1(br,Nn,dn);for(let zs=0;zs0&&(An=Math.max(10,An),this.circleDiameter=An)}else{const Hr=!((br=We.image)===null||br===void 0)&&br.content&&(We.image.textFitWidth||We.image.textFitHeight)?vS(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 dn=new i(Hr.x1,Hr.y1),An=new i(Hr.x2,Hr.y1),Nn=new i(Hr.x1,Hr.y2),pa=new i(Hr.x2,Hr.y2),oi=pr*Math.PI/180;dn._rotate(oi),An._rotate(oi),Nn._rotate(oi),pa._rotate(oi),Hr.x1=Math.min(dn.x,An.x,Nn.x,pa.x),Hr.x2=Math.max(dn.x,An.x,Nn.x,pa.x),Hr.y1=Math.min(dn.y,An.y,Nn.y,pa.y),Hr.y2=Math.max(dn.y,An.y,Nn.y,pa.y)}D.emplaceBack(Q.x,Q.y,Hr.x1,Hr.y1,Hr.x2,Hr.y2,me,Re,Ve)}this.boxEndIndex=D.length}}class A6{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 S6(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=dn.x),(!Qr||dn.y>We)&&(We=dn.y)}const Rt=Math.min(Ve-me,We-Re);let Zt=Rt/2;const pr=new A6([],M6);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||(Zt=Qr.h/2,pr.push(new S0(Qr.p.x-Zt,Qr.p.y-Zt,Zt,Y)),pr.push(new S0(Qr.p.x+Zt,Qr.p.y-Zt,Zt,Y)),pr.push(new S0(Qr.p.x-Zt,Qr.p.y+Zt,Zt,Y)),pr.push(new S0(Qr.p.x+Zt,Qr.p.y+Zt,Zt,Y)),Hr+=4)}return Q&&(console.log(`num probes: ${Hr}`),console.log(`best distance: ${br.d}`)),br.p}function M6(Y,D){return D.max-Y.max}function S0(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!=dn.y>Re.y&&Re.x<(dn.x-Qr.x)*(Re.y-Qr.y)/(dn.y-Qr.y)+Qr.x&&(We=!We),gt=Math.min(gt,Bi(Re,Qr,dn))}}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 Zm=7,oT=Number.POSITIVE_INFINITY;function DS(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-Zm;break;case"bottom-right":case"bottom-left":case"bottom":We=-Re+Zm}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-Zm;break;case"bottom-right":case"bottom-left":Ve=-We+Zm;break;case"bottom":Ve=-me+Zm;break;case"top":Ve=me-Zm}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 zS(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 Zt=0;ZtHr*vc);pr.startsWith("top")?br[1]-=Zm:pr.startsWith("bottom")&&(br[1]+=Zm),Rt[Zt+1]=br}return new ma(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)*vc,oT]:Re.get("text-offset").evaluate(D,{},Q).map(Zt=>Zt*vc);const Rt=[];for(const Zt of We)Rt.push(Zt,DS(Zt,gt));return new ma(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 E6(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,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),dn=FS(Q.horizontal),An=We/24,Nn=Y.tilePixelRatio*An,pa=Y.tilePixelRatio*br/24,oi=Y.tilePixelRatio*gt,Ba=Y.tilePixelRatio*Hr.get("symbol-spacing"),ei=Hr.get("text-padding")*Y.tilePixelRatio,Fi=(function(Qi,Gs,zs,Ll=1){const lf=Qi.get("icon-padding").evaluate(Gs,{},zs),Jc=lf&&lf.values;return[Jc[0]*Ll,Jc[1]*Ll,Jc[2]*Ll,Jc[3]*Ll]})(Hr,D,pr,Y.tilePixelRatio),co=Hr.get("text-max-angle")/180*Math.PI,$o=Hr.get("text-rotation-alignment")!=="viewport"&&Hr.get("symbol-placement")!=="point",hl=Hr.get("icon-rotation-alignment")==="map"&&Hr.get("symbol-placement")!=="point",is=Hr.get("symbol-placement"),Yo=Ba/2,Ds=Hr.get("icon-text-fit");let Ss;me&&Ds!=="none"&&(Y.allowVerticalPlacement&&Q.vertical&&(Ss=pS(me,Q.vertical,Ds,Hr.get("icon-text-fit-padding"),Qr,An)),dn&&(me=pS(me,dn,Ds,Hr.get("icon-text-fit-padding"),Qr,An)));const bs=(Qi,Gs)=>{Gs.x<0||Gs.x>=Kl||Gs.y<0||Gs.y>=Kl||(function(zs,Ll,lf,Jc,hd,Av,kh,Qh,vv,pv,mv,Jf,dd,iv,Xd,gv,Pd,$v,bf,Bu,Mc,Uc,Hf,wf,c1){const t0=zs.addToLineVertexArray(Ll,lf);let r0,ov,uf,Rd,Cp=0,Kv=0,yv=0,dT=0,vT=-1,bw=-1;const rm={};let pT=sa("");if(zs.allowVerticalPlacement&&Jc.vertical){const Yd=Qh.layout.get("text-rotate").evaluate(Mc,{},wf)+90;uf=new gw(vv,Ll,pv,mv,Jf,Jc.vertical,dd,iv,Xd,Yd),kh&&(Rd=new gw(vv,Ll,pv,mv,Jf,kh,Pd,$v,Xd,Yd))}if(hd){const Yd=Qh.layout.get("icon-rotate").evaluate(Mc,{}),Jv=Qh.layout.get("icon-text-fit")!=="none",Wm=IS(hd,Yd,Hf,Jv),n0=kh?IS(kh,Yd,Hf,Jv):void 0;ov=new gw(vv,Ll,pv,mv,Jf,hd,Pd,$v,!1,Yd),Cp=4*Wm.length;const Gg=zs.iconSizeData;let a0=null;Gg.kind==="source"?(a0=[T0*Qh.layout.get("icon-size").evaluate(Mc,{})],a0[0]>Gm&&y(`${zs.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)):Gg.kind==="composite"&&(a0=[T0*Uc.compositeIconSizes[0].evaluate(Mc,{},wf),T0*Uc.compositeIconSizes[1].evaluate(Mc,{},wf)],(a0[0]>Gm||a0[1]>Gm)&&y(`${zs.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)),zs.addSymbols(zs.icon,Wm,a0,Bu,bf,Mc,e.ah.none,Ll,t0.lineStartIndex,t0.lineLength,-1,wf),vT=zs.icon.placedSymbolArray.length-1,n0&&(Kv=4*n0.length,zs.addSymbols(zs.icon,n0,a0,Bu,bf,Mc,e.ah.vertical,Ll,t0.lineStartIndex,t0.lineLength,-1,wf),bw=zs.icon.placedSymbolArray.length-1)}const mT=Object.keys(Jc.horizontal);for(const Yd of mT){const Jv=Jc.horizontal[Yd];if(!r0){pT=sa(Jv.text);const n0=Qh.layout.get("text-rotate").evaluate(Mc,{},wf);r0=new gw(vv,Ll,pv,mv,Jf,Jv,dd,iv,Xd,n0)}const Wm=Jv.positionedLines.length===1;if(yv+=OS(zs,Ll,Jv,Av,Qh,Xd,Mc,gv,t0,Jc.vertical?e.ah.horizontal:e.ah.horizontalOnly,Wm?mT:[Yd],rm,vT,Uc,wf),Wm)break}Jc.vertical&&(dT+=OS(zs,Ll,Jc.vertical,Av,Qh,Xd,Mc,gv,t0,e.ah.vertical,["vertical"],rm,bw,Uc,wf));const gT=r0?r0.boxStartIndex:zs.collisionBoxArray.length,yT=r0?r0.boxEndIndex:zs.collisionBoxArray.length,k6=uf?uf.boxStartIndex:zs.collisionBoxArray.length,C6=uf?uf.boxEndIndex:zs.collisionBoxArray.length,L6=ov?ov.boxStartIndex:zs.collisionBoxArray.length,P6=ov?ov.boxEndIndex:zs.collisionBoxArray.length,qS=Rd?Rd.boxStartIndex:zs.collisionBoxArray.length,f1=Rd?Rd.boxEndIndex:zs.collisionBoxArray.length;let ed=-1;const h1=(Yd,Jv)=>Yd&&Yd.circleDiameter?Math.max(Yd.circleDiameter,Jv):Jv;ed=h1(r0,ed),ed=h1(uf,ed),ed=h1(ov,ed),ed=h1(Rd,ed);const _T=ed>-1?1:0;_T&&(ed*=c1/vc),zs.glyphOffsetArray.length>=qg.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Mc.sortKey!==void 0&&zs.addToSortKeyRanges(zs.symbolInstances.length,Mc.sortKey);const VS=zS(Qh,Mc,wf),[R6,HS]=(function(Yd,Jv){const Wm=Yd.length,n0=Jv?.values;if(n0?.length>0)for(let Gg=0;Gg=0?rm.right:-1,rm.center>=0?rm.center:-1,rm.left>=0?rm.left:-1,rm.vertical||-1,vT,bw,pT,gT,yT,k6,C6,L6,P6,qS,f1,pv,yv,dT,Cp,Kv,_T,0,dd,ed,R6,HS)})(Y,Gs,Qi,Q,me,Re,Ss,Y.layers[0],Y.collisionBoxArray,D.index,D.sourceLayerIndex,Y.index,Nn,[ei,ei,ei,ei],$o,Rt,oi,Fi,hl,Qr,D,Ve,Zt,pr,We)};if(is==="line")for(const Qi of kS(D.geometry,0,0,Kl,Kl)){const Gs=T6(Qi,Ba,co,Q.vertical||dn,me,24,pa,Y.overscaling,Kl);for(const zs of Gs)dn&&BS(Y,dn.text,Yo,zs)||bs(Qi,zs)}else if(is==="line-center"){for(const Qi of D.geometry)if(Qi.length>1){const Gs=w6(Qi,co,Q.vertical||dn,me,24,pa);Gs&&bs(Qi,Gs)}}else if(D.type==="Polygon")for(const Qi of Xc(D.geometry,0)){const Gs=S6(Qi,16);bs(Qi[0],new Ym(Gs.x,Gs.y,0))}else if(D.type==="LineString")for(const Qi of D.geometry)bs(Qi,new Ym(Qi[0].x,Qi[0].y,0));else if(D.type==="Point")for(const Qi of D.geometry)for(const Gs of Qi)bs([Gs],new Ym(Gs.x,Gs.y,0))}function OS(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn){const An=(function(oi,Ba,ei,Fi,co,$o,hl,is){const Yo=Fi.layout.get("text-rotate").evaluate($o,{})*Math.PI/180,Ds=[];for(const Ss of Ba.positionedLines)for(const bs of Ss.positionedGlyphs){if(!bs.rect)continue;const Qi=bs.rect||{};let Gs=Z3+1,zs=!0,Ll=1,lf=0;const Jc=(co||is)&&bs.vertical,hd=bs.metrics.advance*bs.scale/2;if(is&&Ba.verticalizable&&(lf=Ss.lineOffset/2-(bs.imageName?-(vc-bs.metrics.width*bs.scale)/2:(bs.scale-1)*vc)),bs.imageName){const Bu=hl[bs.imageName];zs=Bu.sdf,Ll=Bu.pixelRatio,Gs=Jh/Ll}const Av=co?[bs.x+hd,bs.y]:[0,0];let kh=co?[0,0]:[bs.x+hd+ei[0],bs.y+ei[1]-lf],Qh=[0,0];Jc&&(Qh=kh,kh=[0,0]);const vv=bs.metrics.isDoubleResolution?2:1,pv=(bs.metrics.left-Gs)*bs.scale-hd+kh[0],mv=(-bs.metrics.top-Gs)*bs.scale+kh[1],Jf=pv+Qi.w/vv*bs.scale/Ll,dd=mv+Qi.h/vv*bs.scale/Ll,iv=new i(pv,mv),Xd=new i(Jf,mv),gv=new i(pv,dd),Pd=new i(Jf,dd);if(Jc){const Bu=new i(-hd,hd-e1),Mc=-Math.PI/2,Uc=vc/2-hd,Hf=new i(5-e1-Uc,-(bs.imageName?Uc:0)),wf=new i(...Qh);iv._rotateAround(Mc,Bu)._add(Hf)._add(wf),Xd._rotateAround(Mc,Bu)._add(Hf)._add(wf),gv._rotateAround(Mc,Bu)._add(Hf)._add(wf),Pd._rotateAround(Mc,Bu)._add(Hf)._add(wf)}if(Yo){const Bu=Math.sin(Yo),Mc=Math.cos(Yo),Uc=[Mc,-Bu,Bu,Mc];iv._matMult(Uc),Xd._matMult(Uc),gv._matMult(Uc),Pd._matMult(Uc)}const $v=new i(0,0),bf=new i(0,0);Ds.push({tl:iv,tr:Xd,bl:gv,br:Pd,tex:Qi,writingMode:Ba.writingMode,glyphOffset:Av,sectionIndex:bs.sectionIndex,isSDF:zs,pixelOffsetTL:$v,pixelOffsetBR:bf,minFontScaleX:0,minFontScaleY:0})}return Ds})(0,Q,gt,Re,Ve,We,me,Y.allowVerticalPlacement),Nn=Y.textSizeData;let pa=null;Nn.kind==="source"?(pa=[T0*Re.layout.get("text-size").evaluate(We,{})],pa[0]>Gm&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)):Nn.kind==="composite"&&(pa=[T0*Qr.compositeTextSizes[0].evaluate(We,{},dn),T0*Qr.compositeTextSizes[1].evaluate(We,{},dn)],(pa[0]>Gm||pa[1]>Gm)&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)),Y.addSymbols(Y.text,An,pa,gt,Ve,We,Zt,D,Rt.lineStartIndex,Rt.lineLength,Hr,dn);for(const oi of pr)br[oi]=Y.text.placedSymbolArray.length-1;return 4*An.length}function FS(Y){for(const D in Y)return Y[D];return null}function BS(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=NS[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=NS.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],Zt=[];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 pa=We[2*Nn],oi=We[2*Nn+1];pa>=D&&pa<=me&&oi>=Q&&oi<=Re&&Zt.push(Ve[Nn])}continue}const Qr=Hr+br>>1,dn=We[2*Qr],An=We[2*Qr+1];dn>=D&&dn<=me&&An>=Q&&An<=Re&&Zt.push(Ve[Qr]),(pr===0?D<=dn:Q<=An)&&(Rt.push(Hr),Rt.push(Qr-1),Rt.push(1-pr)),(pr===0?me>=dn:Re>=An)&&(Rt.push(Qr+1),Rt.push(br),Rt.push(1-pr))}return Zt}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=[],Zt=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)<=Zt&&Rt.push(Re[Nn]);continue}const Qr=Hr+br>>1,dn=Ve[2*Qr],An=Ve[2*Qr+1];Gd(dn,An,D,Q)<=Zt&&Rt.push(Re[Qr]),(pr===0?D-me<=dn:Q-me<=An)&&(gt.push(Hr),gt.push(Qr-1),gt.push(1-pr)),(pr===0?D+me>=dn:Q+me>=An)&&(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;US(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 US(Y,D,Q,me,Re,Ve){for(;Re>me;){if(Re-me>600){const Zt=Re-me+1,pr=Q-me+1,br=Math.log(Zt),Hr=.5*Math.exp(2*br/3),Qr=.5*Math.sqrt(br*Hr*(Zt-Hr)/Zt)*(pr-Zt/2<0?-1:1);US(Y,D,Q,Math.max(me,Math.floor(Q-pr*Hr/Zt+Qr)),Math.min(Re,Math.floor(Q+(Zt-pr)*Hr/Zt+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){yw(Y,Q,me),yw(D,2*Q,2*me),yw(D,2*Q+1,2*me+1)}function yw(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 _w=null,u1=[];const fT=1e3/60,xw="loadTime",hT="fullLoadTime",jS={mark(Y){performance.mark(Y)},frame(Y){const D=Y;_w!=null&&u1.push(D-_w),_w=D},clearMetrics(){_w=null,u1=[],performance.clearMeasures(xw),performance.clearMeasures(hT);for(const Y in e.bg)performance.clearMarks(e.bg[Y])},getPerformanceMetrics(){performance.measure(xw,e.bg.create,e.bg.load),performance.measure(hT,e.bg.create,e.bg.fullLoad);const Y=performance.getEntriesByName(xw)[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 $_(()=>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,Zt,pr,br,Hr,Qr,dn,An=Q[0],Nn=Q[1],pa=Q[2];return D===Y?(Y[12]=D[0]*An+D[4]*Nn+D[8]*pa+D[12],Y[13]=D[1]*An+D[5]*Nn+D[9]*pa+D[13],Y[14]=D[2]*An+D[6]*Nn+D[10]*pa+D[14],Y[15]=D[3]*An+D[7]*Nn+D[11]*pa+D[15]):(Re=D[1],Ve=D[2],We=D[3],gt=D[4],Rt=D[5],Zt=D[6],pr=D[7],br=D[8],Hr=D[9],Qr=D[10],dn=D[11],Y[0]=me=D[0],Y[1]=Re,Y[2]=Ve,Y[3]=We,Y[4]=gt,Y[5]=Rt,Y[6]=Zt,Y[7]=pr,Y[8]=br,Y[9]=Hr,Y[10]=Qr,Y[11]=dn,Y[12]=me*An+gt*Nn+br*pa+D[12],Y[13]=Re*An+Rt*Nn+Hr*pa+D[13],Y[14]=Ve*An+Zt*Nn+Qr*pa+D[14],Y[15]=We*An+pr*Nn+dn*pa+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=qg,e.a7=Ah,e.a8=yr,e.a9=AS,e.aA=function(Y){if(Y.type==="custom")return new yS(Y);switch(Y.type){case"background":return new W_(Y);case"circle":return new Oa(Y);case"fill":return new fn(Y);case"fill-extrusion":return new Gv(Y);case"heatmap":return new tl(Y);case"hillshade":return new Ju(Y);case"line":return new Bg(Y);case"raster":return new b6(Y);case"symbol":return new hw(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,Zt){let pr;for(pr in gt=gt||{},We=We||{})Object.prototype.hasOwnProperty.call(We,pr)&&(Object.prototype.hasOwnProperty.call(gt,pr)||Ye(pr,Rt,Zt));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,Zt)):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 Zt=(We=We||[]).map(et),pr=gt.map(et),br=We.reduce(Pe,{}),Hr=gt.reduce(Pe,{}),Qr=Zt.slice(),dn=Object.create(null);let An,Nn,pa,oi,Ba;for(let ei=0,Fi=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],Zt=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+Zt*me,Y[1]=We*Re+pr*me,Y[2]=gt*Re+br*me,Y[3]=Rt*Re+Hr*me,Y[4]=Zt*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(fi.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/T0:Y.kind==="composite"?Mo.number(me/T0,Re/T0,Q):D},e.aj=Xm,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 Zt=(gt*(Y.y-Q.y)-We*(Y.x-Q.x))/Rt;return new i(Y.x+Zt*Ve,Y.y+Zt*Re)},e.al=kS,e.am=fa,e.an=oa,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=vc,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],Zt=D[7],pr=D[8],br=D[9],Hr=D[10],Qr=D[11],dn=D[12],An=D[13],Nn=D[14],pa=D[15],oi=Q*gt-me*We,Ba=Q*Rt-Re*We,ei=Q*Zt-Ve*We,Fi=me*Rt-Re*gt,co=me*Zt-Ve*gt,$o=Re*Zt-Ve*Rt,hl=pr*An-br*dn,is=pr*Nn-Hr*dn,Yo=pr*pa-Qr*dn,Ds=br*Nn-Hr*An,Ss=br*pa-Qr*An,bs=Hr*pa-Qr*Nn,Qi=oi*bs-Ba*Ss+ei*Ds+Fi*Yo-co*is+$o*hl;return Qi?(Y[0]=(gt*bs-Rt*Ss+Zt*Ds)*(Qi=1/Qi),Y[1]=(Re*Ss-me*bs-Ve*Ds)*Qi,Y[2]=(An*$o-Nn*co+pa*Fi)*Qi,Y[3]=(Hr*co-br*$o-Qr*Fi)*Qi,Y[4]=(Rt*Yo-We*bs-Zt*is)*Qi,Y[5]=(Q*bs-Re*Yo+Ve*is)*Qi,Y[6]=(Nn*ei-dn*$o-pa*Ba)*Qi,Y[7]=(pr*$o-Hr*ei+Qr*Ba)*Qi,Y[8]=(We*Ss-gt*Yo+Zt*hl)*Qi,Y[9]=(me*Yo-Q*Ss-Ve*hl)*Qi,Y[10]=(dn*co-An*ei+pa*oi)*Qi,Y[11]=(br*ei-pr*co-Qr*oi)*Qi,Y[12]=(gt*is-We*Ds-Rt*hl)*Qi,Y[13]=(Q*Ds-me*is+Re*hl)*Qi,Y[14]=(An*Ba-dn*Fi-Nn*oi)*Qi,Y[15]=(pr*Fi-br*Ba+Hr*oi)*Qi,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=Zi,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 hr{},e.be=rT,e.bf=jS,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*vc)}let is=We?"center":Q.get("text-justify").evaluate(Zt,{},Y.canonical);const Yo=Q.get("symbol-placement")==="point"?Q.get("text-max-width").evaluate(Zt,{},Y.canonical)*vc:1/0,Ds=()=>{Y.bucket.allowVerticalPlacement&&ns(ei)&&(dn.vertical=sw(An,Y.glyphMap,Y.glyphPositions,Y.imagePositions,pr,Yo,Ve,$o,"left",co,pa,e.ah.vertical,!0,Hr,br))};if(!We&&hl){const Ss=new Set;if(is==="auto")for(let Qi=0;Qit(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(v6,[])},e.o=Qo,e.p=ow,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 aa in Lt){const Un=je.layers[aa];if(!Un)continue;Un.version===1&&e.w(`Vector tile source "${this.source}" layer "${aa}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ka=ye.encode(aa),Va=[];for(let sr=0;sr=qt.maxzoom||qt.visibility!=="none"&&(n(sr,this.zoom,ke),(Xe[qt.id]=qt.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,aa=>Object.keys(aa).map(Number));this.inFlightDependencies.forEach(aa=>aa?.abort()),this.inFlightDependencies=[];let Ot=Promise.resolve({});if(Object.keys(Ct).length){const aa=new AbortController;this.inFlightDependencies.push(aa),Ot=xe.sendAsync({type:"GG",data:{stacks:Ct,source:this.source,tileID:this.tileID,type:"glyphs"}},aa)}const Kt=Object.keys(Qe.iconDependencies);let xr=Promise.resolve({});if(Kt.length){const aa=new AbortController;this.inFlightDependencies.push(aa),xr=xe.sendAsync({type:"GI",data:{icons:Kt,source:this.source,tileID:this.tileID,type:"icons"}},aa)}const mr=Object.keys(Qe.patternDependencies);let vr=Promise.resolve({});if(mr.length){const aa=new AbortController;this.inFlightDependencies.push(aa),vr=xe.sendAsync({type:"GI",data:{icons:mr,source:this.source,tileID:this.tileID,type:"patterns"}},aa)}const[Br,kn,Wn]=yield Promise.all([Ot,xr,vr]),Vn=new r(Br),na=new e.bo(kn,Wn);for(const aa in Xe){const Un=Xe[aa];Un instanceof e.a6?(n(Un.layers,this.zoom,ke),e.bp({bucket:Un,glyphMap:Br,glyphPositions:Vn.positions,imageMap:kn,imagePositions:na.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,na.patternPositions))}return this.status="done",{buckets:Object.values(Xe).filter(aa=>!aa.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Vn.image,imageAtlas:na,glyphMap:this.returnDependencies?Br: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[Br,kn]=vr.geometry.coordinates;Ot=ce(Br),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&&(Br+=Qe[Wn+j])}if(Br>vr&&Br>=Ee){let kn,Wn=Kt*vr,Vn=xr*vr,na=-1;const aa=((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];Wn+=Qe[ka]*Va,Vn+=Qe[ka+1]*Va,Qe[ka+4]=aa,ye&&(kn||(kn=this._map(Qe,Ot,!0),na=this.clusterProps.length,this.clusterProps.push(kn)),ye(kn,this._map(Qe,ka)))}Qe[Ot+4]=aa,Lt.push(Wn/Br,Vn/Br,1/0,aa,-1,Br),ye&&Lt.push(na)}else{for(let kn=0;kn1)for(const kn of mr){const Wn=kn*Ct;if(!(Qe[Wn+2]<=Je)){Qe[Wn+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 Br=[];ct(vr,Br,Je,ke,xe,!0),Br.length&&mr.push(Br)}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 Br=0;BrJe&&(Ct=Qe(Xe,kn,Wn,na,aa,Je),Ee&&(Xe.start=Ot+Lt*Ct)):Un>ke?ka=Je&&(Ct=Qe(Xe,kn,Wn,na,aa,Je),Va=!0),ka>ke&&Un<=ke&&(Ct=Qe(Xe,kn,Wn,na,aa,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,Br=.5+mr,kn=1+mr;let Wn=null,Vn=null,na=null,aa=null,Un=Fe(je,Ot,ke-mr,ke+Br,0,xr.minX,xr.maxX,Lt),ka=Fe(je,Ot,ke+vr,ke+kn,0,xr.minX,xr.maxX,Lt);je=null,Un&&(Wn=Fe(Un,Ot,xe-mr,xe+Br,1,xr.minY,xr.maxY,Lt),Vn=Fe(Un,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),Un=null),ka&&(na=Fe(ka,Ot,xe-mr,xe+Br,1,xr.minY,xr.maxY,Lt),aa=Fe(ka,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),ka=null),Ct>1&&console.timeEnd("clipping"),Qe.push(Wn||[],Je+1,2*ke,2*xe),Qe.push(Vn||[],Je+1,2*ke,2*xe+1),Qe.push(na||[],Je+1,2*ke+1,2*xe),Qe.push(aa||[],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=Mr(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=Mr(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=Er(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 Nr{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 Nr(self)),Nr}),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=Gt=>{const hr=Me++;return Ce[hr]=Gt,hr},Ue.removeThrottleControl=Gt=>{delete Ce[Gt],_t()},Ue.getImage=(Gt,hr,Ar=!0)=>new Promise((Lr,en)=>{s.supported&&(Gt.headers||(Gt.headers={}),Gt.headers.accept="image/webp,*/*"),t.e(Gt,{type:"image"}),P.push({abortController:hr,requestParameters:Gt,supportImageRefresh:Ar,state:"queued",onError:xn=>{en(xn)},onSuccess:xn=>{Lr(xn)}}),_t()});const Be=Gt=>t._(this,void 0,void 0,function*(){Gt.state="running";const{requestParameters:hr,supportImageRefresh:Ar,onError:Lr,onSuccess:en,abortController:xn}=Gt,Ze=Ar===!1&&!t.i(self)&&!t.g(hr.url)&&(!hr.headers||Object.keys(hr.headers).reduce((bt,zt)=>bt&&zt==="accept",!0));oe++;const tt=Ze?kt(hr,xn):t.m(hr,xn);try{const bt=yield tt;delete Gt.abortController,Gt.state="completed",bt.data instanceof HTMLImageElement||t.b(bt.data)?en(bt):bt.data&&en({data:yield(vt=bt.data,typeof createImageBitmap=="function"?t.d(vt):t.f(vt)),cacheControl:bt.cacheControl,expires:bt.expires})}catch(bt){delete Gt.abortController,Lr(bt)}finally{oe--,_t()}var vt}),_t=()=>{const Gt=(()=>{for(const hr of Object.keys(Ce))if(Ce[hr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let hr=oe;hr0;hr++){const Ar=P.shift();Ar.abortController.signal.aborted?hr--:Be(Ar)}},kt=(Gt,hr)=>new Promise((Ar,Lr)=>{const en=new Image,xn=Gt.url,Ze=Gt.credentials;Ze&&Ze==="include"?en.crossOrigin="use-credentials":(Ze&&Ze==="same-origin"||!t.s(xn))&&(en.crossOrigin="anonymous"),hr.signal.addEventListener("abort",()=>{en.src="",Lr(t.c())}),en.fetchPriority="high",en.onload=()=>{en.onerror=en.onload=null,Ar({data:en})},en.onerror=()=>{en.onerror=en.onload=null,hr.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."))},en.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: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)),_t)this.size=[Ce,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,Ce,Be,0,this.format,Gt.UNSIGNED_BYTE,P.data);else{const{x:hr,y:Ar}=Me||{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,hr,Ar,Gt.RGBA,Gt.UNSIGNED_BYTE,P):Gt.texSubImage2D(Gt.TEXTURE_2D,0,hr,Ar,Ce,Be,Gt.RGBA,Gt.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Gt.generateMipmap(Gt.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,Gt=_t.y+1,hr=this.getImage(Be).data,Ar=hr.width,Lr=hr.height;t.R.copy(hr,Ce,{x:0,y:0},{x:kt,y:Gt},{width:Ar,height:Lr}),t.R.copy(hr,Ce,{x:0,y:Lr-1},{x:kt,y:Gt-1},{width:Ar,height:1}),t.R.copy(hr,Ce,{x:0,y:0},{x:kt,y:Gt+Lr},{width:Ar,height:1}),t.R.copy(hr,Ce,{x:Ar-1,y:0},{x:kt-1,y:Gt},{width:1,height:Lr}),t.R.copy(hr,Ce,{x:0,y:0},{x:kt+Ar,y:Gt},{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,Gt){for(let hr=P;hr-1);Gt++,Be[Gt]=kt,_t[Gt]=hr,_t[Gt+1]=I}for(let kt=0,Gt=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 Gt={};for(const hr of t.n(kt.data))Gt[hr.id]=hr;return Gt})},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,Gt=this._createCanvas(kt),hr=this.ctx=Gt.getContext("2d",{willReadFrequently:!0});hr.font=`${_t} ${Be} ${Ue}px ${Ce}`,hr.textBaseline="alphabetic",hr.textAlign="left",hr.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))),Gt=Math.min(this.size-this.buffer,_t+Math.ceil(Me)),hr=kt+2*this.buffer,Ar=Gt+2*this.buffer,Lr=Math.max(hr*Ar,0),en=new Uint8ClampedArray(Lr),xn={data:en,width:hr,height:Ar,glyphWidth:kt,glyphHeight:Gt,glyphTop:_t,glyphLeft:0,glyphAdvance:P};if(kt===0||Gt===0)return xn;const{ctx:Ze,buffer:tt,gridInner:vt,gridOuter:bt}=this;Ze.clearRect(tt,tt,kt,Gt),Ze.fillText(Ue,tt,tt+_t);const zt=Ze.getImageData(tt,tt,kt,Gt);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,hr,Ar,hr,this.f,this.v,this.z),L(vt,tt,tt,kt,Gt,hr,this.f,this.v,this.z);for(let Et=0;Et1&&(Gt=P[++kt]);const Ar=Math.abs(hr-Gt.left),Lr=Math.abs(hr-Gt.right),en=Math.min(Ar,Lr);let xn;const Ze=Be/Me*(Ce+1);if(Gt.isDash){const tt=Ce-Math.abs(Ze);xn=Math.sqrt(en*en+tt*tt)}else xn=Ce-Math.sqrt(en*en+Ze*Ze);this.data[_t+hr]=Math.max(0,Math.min(255,xn+128))}}}addRegularDash(P){for(let kt=P.length-1;kt>=0;--kt){const Gt=P[kt],hr=P[kt+1];Gt.zeroLength?P.splice(kt,1):hr&&hr.isDash===Gt.isDash&&(hr.left=Gt.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 Gt=Math.abs(kt-_t.left),hr=Math.abs(kt-_t.right),Ar=Math.min(Gt,hr);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,en,xn){if(Lr)for(const Ze of Lr){const tt=en[Ze];if(tt&&tt.source===xn&&tt.type==="fill-extrusion")return!0}else for(const Ze in en){const tt=en[Ze];if(tt.source===xn&&tt.type==="fill-extrusion")return!0}return!1})(Ce&&Ce.layers,P,Ue.id),kt=Be.maxPitchScaleFactor(),Gt=Ue.tilesIn(Me,kt,_t);Gt.sort(H);const hr=[];for(const Lr of Gt)hr.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 en={},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=en[zt]=en[zt]||[];for(const Tr of Et)Ut[Tr.featureIndex]||(Ut[Tr.featureIndex]=!0,gr.push(Tr))}}return en})(hr);for(const Lr in Ar)Ar[Lr].forEach(en=>{const xn=en.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 Gt=yield P.actor.sendAsync({type:"LDT",data:kt});P.dem=Gt,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,Gt={};return Gt[new t.S(P.overscaledZ,Be,oe.z,Ce,oe.y).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,_t,oe.y).key]={backfilled:!1},oe.y>0&&(Gt[new t.S(P.overscaledZ,Be,oe.z,Ce,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,_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,Gt=-1/0;for(const en of Ce)Be=Math.min(Be,en.x),_t=Math.min(_t,en.y),kt=Math.max(kt,en.x),Gt=Math.max(Gt,en.y);const hr=Math.max(kt-Be,Gt-_t),Ar=Math.max(0,Math.floor(-Math.log(hr)/Math.LN2)),Lr=Math.pow(2,Ar);return new t.a1(Ar,Math.floor((Be+kt)/2*Lr),Math.floor((_t+Gt)/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 lt(){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(hr)).filter(Boolean);if(Gt.length!==0){kt.layers=Gt,kt.stateDependentLayerIds&&(kt.stateDependentLayers=kt.stateDependentLayerIds.map(hr=>Gt.filter(Ar=>Ar.id===hr)[0]));for(const hr of Gt)_t[hr.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,lt().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,Gt,hr,Ar){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ce,cameraQueryGeometry:Be,scale:_t,tileSize:this.tileSize,pixelPosMatrix:Ar,transform:Gt,params:kt,queryPadding:this.queryPadding*hr},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:Gt,x:hr,y:Ar}=this.tileID.canonical,Lr={z:Gt,x:hr,y:Ar};for(let en=0;en<_t.length;en++){const xn=_t.feature(en);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,Gt,hr,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 Gt=new(Pe(Be.type))(Ce,Be,_t,kt);if(Gt.id!==Ce)throw new Error(`Expected Source id to be ${Ce} instead of ${Gt.id}`);return Gt})(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),Gt=new t.P(_t.canonical.x,_t.canonical.y)._rotate(this.transform.angle);return Be.overscaledZ-_t.overscaledZ||Gt.y-kt.y||Gt.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+Gt)===1?_t+=Gt:Math.abs(_t-Gt)===1&&(_t-=Gt)),Be.dem&&Ce.dem&&(Ce.dem.backfillBorder(Be.dem,_t,kt),Ce.neighboringTiles&&Ce.neighboringTiles[hr]&&(Ce.neighboringTiles[hr].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 hr=_t.tileID.scaledTo(_t.tileID.overscaledZ-1);_t=this._tiles[hr.key],_t&&_t.hasData()&&(kt=hr)}let Gt=kt;for(;Gt.overscaledZ>oe;)if(Gt=Gt.scaledTo(Gt.overscaledZ-1),P[Gt.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={},Gt={},hr=Object.keys(P),Ar=i.now();for(const Lr of hr){const en=P[Lr],xn=this._tiles[Lr];if(!xn||xn.fadeEndTime!==0&&xn.fadeEndTime<=Ar)continue;const Ze=this.findLoadedParent(en,oe),tt=this.findLoadedSibling(en),vt=Ze||tt||null;vt&&(this._addTile(vt.tileID),kt[vt.tileID.key]=vt.tileID),Gt[Lr]=en}this._retainLoadedChildren(Gt,Ce,Me,P);for(const Lr in kt)P[Lr]||(this._coveredTiles[Lr]=!0,P[Lr]=kt[Lr]);if(_t){const Lr={},en={};for(const xn of Be)this._tiles[xn.key].hasData()?Lr[xn.key]=xn:en[xn.key]=xn;for(const xn in en){const Ze=en[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 en[xn])}for(const xn in en){const Ze=en[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 en=Lr.scaledTo(Lr.canonical.z-1);Ar[en.key]=en;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 Gt=this._updateRetainedTiles(Me,Ce);ar(this._source.type)&&this._updateCoveredAndRetainedTiles(Gt,Be,_t,Ce,Me,oe);for(const Ar in Gt)this._tiles[Ar].clearFadeHold();const hr=t.ab(this._tiles,Gt);for(const Ar of hr){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),Gt={};for(const hr of P){const Ar=this._addTile(hr);Ce[hr.key]=hr,Ar.hasData()||oethis._source.maxzoom){const en=hr.children(this._source.maxzoom)[0],xn=this.getTile(en);if(xn&&xn.hasData()){Ce[en.key]=en;continue}}else{const en=hr.children(this._source.maxzoom);if(Ce[en[0].key]&&Ce[en[1].key]&&Ce[en[2].key]&&Ce[en[3].key])continue}let Lr=Ar.wasRequested();for(let en=hr.overscaledZ-1;en>=_t;--en){const xn=hr.scaledTo(en);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)),Gt=_t.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),hr=this.getIds();let Ar=1/0,Lr=1/0,en=-1/0,xn=-1/0;for(const Ze of Gt)Ar=Math.min(Ar,Ze.x),Lr=Math.min(Lr,Ze.y),en=Math.max(en,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=Gt.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 Er{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-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 $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 Gt=[];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 hr=0;hr0}hitTestCircle(P,oe,Me,Ce,Be){const _t=P-Me,kt=P+Me,Gt=oe-Me,hr=oe+Me;if(kt<0||_t>this.width||hr<0||Gt>this.height)return!1;const Ar=[];return this._forEachCell(_t,Gt,kt,hr,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,Gt){const{seenUids:hr,hitTest:Ar,overlapMode:Lr}=kt,en=this.boxCells[Be];if(en!==null){const Ze=this.bboxes;for(const tt of en)if(!hr.box[tt]){hr.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]&&(!Gt||Gt(bt))&&(!Ar||!Mr(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(!hr.circle[tt]){hr.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)&&(!Gt||Gt(bt))&&(!Ar||!Mr(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,Gt){const{circle:hr,seenUids:Ar,overlapMode:Lr}=kt,en=this.boxCells[Be];if(en!==null){const Ze=this.bboxes;for(const tt of en)if(!Ar.box[tt]){Ar.box[tt]=!0;const vt=4*tt,bt=this.boxKeys[tt];if(this._circleAndRectCollide(hr.x,hr.y,hr.radius,Ze[vt+0],Ze[vt+1],Ze[vt+2],Ze[vt+3])&&(!Gt||Gt(bt))&&!Mr(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],hr.x,hr.y,hr.radius)&&(!Gt||Gt(bt))&&!Mr(Lr,bt.overlapMode))return _t.push(!0),!0}}}_forEachCell(P,oe,Me,Ce,Be,_t,kt,Gt){const hr=this._convertToXCellCoord(P),Ar=this._convertToYCellCoord(oe),Lr=this._convertToXCellCoord(Me),en=this._convertToYCellCoord(Ce);for(let xn=hr;xn<=Lr;xn++)for(let Ze=Ar;Ze<=en;Ze++)if(Be.call(this,P,oe,Me,Ce,this.xCellCount*Ze+xn,_t,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,Me,Ce,Be,_t){const kt=Ce-P,Gt=Be-oe,hr=Me+_t;return hr*hr>kt*kt+Gt*Gt}_circleAndRectCollide(P,oe,Me,Ce,Be,_t,kt){const Gt=(_t-Ce)/2,hr=Math.abs(P-(Ce+Gt));if(hr>Gt+Me)return!1;const Ar=(kt-Be)/2,Lr=Math.abs(oe-(Be+Ar));if(Lr>Ar+Me)return!1;if(hr<=Gt||Lr<=Ar)return!0;const en=hr-Gt,xn=Lr-Ar;return en*en+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 Nr(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,Gt,hr,Ar,Lr,en,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,Gt,hr,Ar){const Lr=oe/24,en=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,en,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,hr);if(gr)return gr}Ze=[zt.first];for(let gr=P.glyphStartIndex+1;gr0?Et.point:(function(Tr,Pr,Yr,on,En,Pn){return Xe(Tr,Pr,Yr,1,En,Pn)})(Ue.tileAnchorPoint,zt,vt,0,Be,Ue),gr=ye(P.writingMode,vt,Ut,hr);if(gr)return gr}const tt=Kt(Lr*kt.getoffsetX(P.glyphStartIndex),en,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(Gt,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,Gt=oe.sub(kt);return oe.add(Gt._mult(Me/Gt.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,Gt,hr,Ar,Lr){return Xe(kt,Gt,hr,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,Gt){if(kt.projectionCache.offsets[Ue])return kt.projectionCache.offsets[Ue];const hr=oe.add(P);if(Ue+Gt.direction=Ce)return kt.projectionCache.offsets[Ue]=hr,hr;const Ar=Qe(Ue+Gt.direction,kt,Gt),Lr=Ct(Ar.sub(oe),_t,Gt.direction),en=oe.add(Lr),xn=Ar.add(Lr);return kt.projectionCache.offsets[Ue]=t.ak(Be,hr,en,xn)||hr,kt.projectionCache.offsets[Ue]}function Kt(Ue,P,oe,Me,Ce,Be,_t,kt,Gt){const hr=Me?Ue-P:Ue+P;let Ar=hr>0?1:-1,Lr=0;Me&&(Ar*=-1,Lr=Math.PI),Ar<0&&(Lr+=Math.PI);let en,xn=Ar>0?Be+Ce:Be+Ce+1;kt.projectionCache.cachedAnchorPoint?en=kt.projectionCache.cachedAnchorPoint:(en=Lt(kt.tileAnchorPoint.x,kt.tileAnchorPoint.y,kt).point,kt.projectionCache.cachedAnchorPoint=en);let Ze,tt,vt=en,bt=en,zt=0,Et=0;const Ut=Math.abs(hr),gr=[];let Tr;for(;zt+Et<=Ut;){if(xn+=Ar,xn=_t)return null;zt+=Et,bt=vt,tt=Ze;const on={absOffsetX:Ut,direction:Ar,distanceFromAnchor:zt,previousVertex:bt};if(vt=Qe(xn,kt,on),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,on).sub(vt),oe,Ar):Ct(Pn,oe,Ar),tt||(tt=bt.add(En)),Ze=Ot(xn,En,vt,Be,_t,tt,oe,kt,on),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:Gt?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;ho--)ni.push(ri.path[ho]);for(let ho=1;hoWo.signedDistanceFromCamera<=0)?[]:ho.map(Wo=>Wo.point)}let To=[];if(ni.length>0){const ho=ni[0].clone(),Wo=ni[0].clone();for(let Js=1;Js=Pn.x&&Wo.x<=Xn.x&&ho.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 ho of To){Ta.reset(ho,.25*En);let Wo=0;Wo=Ta.length<=.5*En?1:Math.ceil(Ta.paddedLength/Wi)+1;for(let Js=0;JsMt(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+Br,Ar.y+Br);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)),Gt={},hr={};for(const Ar of kt){const Lr=Ar.key;if(Gt[Lr.bucketInstanceId]===void 0&&(Gt[Lr.bucketInstanceId]={}),Gt[Lr.bucketInstanceId][Lr.featureIndex])continue;const en=[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,en)&&(Gt[Lr.bucketInstanceId][Lr.featureIndex]=!0,hr[Lr.bucketInstanceId]===void 0&&(hr[Lr.bucketInstanceId]=[]),hr[Lr.bucketInstanceId].push(Lr.featureIndex))}return hr}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,Gt={bucketInstanceId:Ce,featureIndex:Be,collisionGroupID:_t,overlapMode:oe};for(let hr=0;hr=this.screenRightBoundary||Cethis.screenBottomBoundary}isInsideGrid(P,oe,Me,Ce){return Me>=0&&P=0&&oethis.projectAndGetPerspectiveRatio(Me,En.x,En.y,Ce,hr));Yr=on.some(En=>!En.isOccluded),Pr=on.map(En=>En.point)}else Yr=!0;return{box:t.ao(Pr),allPointsOccluded:!Yr}}}function Wn(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 na{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 aa{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 qt{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,Gt=Be.layers[0].layout,hr=Be.layers[0].paint,Ar=Math.pow(2,this.transform.zoom-Me.tileID.overscaledZ),Lr=Me.tileSize/t.X,en=Me.tileID.toUnwrapped(),xn=this.transform.calculatePosMatrix(en),Ze=Gt.get("text-pitch-alignment")==="map",tt=Gt.get("text-rotation-alignment")==="map",vt=Wn(Me,1,this.transform.zoom),bt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,hr.get("text-translate"),hr.get("text-translate-anchor")),zt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,hr.get("icon-translate"),hr.get("icon-translate-anchor")),Et=Sr(xn,Ze,tt,this.transform,vt);let Ut=null;if(Ze){const Tr=Nr(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:Gt,translationText:bt,translationIcon:zt,posMatrix:xn,unwrappedTileID:en,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:on}=Tr;P.push({sortKey:Pr,symbolInstanceStart:Yr,symbolInstanceEnd:on,parameters:gr})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Be.symbolInstances.length,parameters:gr})}attemptAnchorPlacement(P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,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,en,Gt,hr,Ar,kt,_t,vt,Lr.predicate,Et,Tr);if((!zt||this.collisionIndex.placeCollisionBox(zt,en,Gt,hr,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:Gt,unwrappedTileID:hr,textLabelPlaneMatrix:Ar,labelToScreenMatrix:Lr,textPixelRatio:en,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",on=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,Wi)=>{var To,ho;if(oe[Wa.crossTileID])return;if(xn)return void(this.placements[Wa.crossTileID]=new aa(!1,!1,!1));let Wo=!1,Js=!1,Qs=!0,Es=null,al={box:null,placeable:!1,offscreen:null},mu={placeable:!1},iu=null,ks=null,Cs=null,Ru=0,uc=0,Nc=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?(al=Zr(),mu=al):al=_r(),al&&al.placeable)break}else al=_r()},tr=Wa.textAnchorOffsetStartIndex,er=Wa.textAnchorOffsetEndIndex;if(er===tr){const _r=(Zr,Xr)=>{const hn=this.collisionIndex.placeCollisionBox(Zr,Et,en,Gt,hr,Yr,Pr,_t,vt.predicate,Ta);return hn&&hn.placeable&&(this.markUsedOrientation(Ce,Xr,Wa),this.placedOrientations[Wa.crossTileID]=Xr),hn};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(al&&al.placeable)}else{let _r=t.aq[(ho=(To=this.prevPlacement)===null||To===void 0?void 0:To.variableOffsets[Wa.crossTileID])===null||ho===void 0?void 0:ho.anchor];const Zr=(hn,Sn,Cn)=>{const La=hn.x2-hn.x1,zn=hn.y2-hn.y1,Qn=Wa.textBoxScale,la=on&&gr==="never"?Sn:null;let Sa=null,Ra=Et==="never"?1:2,sa="never";_r&&Ra++;for(let ai=0;aiZr(ge,ni.iconBox,t.ah.horizontal),()=>{const hn=ni.verticalTextBox;return Ce.allowVerticalPlacement&&(!al||!al.placeable)&&Wa.numVerticalGlyphVertices>0&&hn?Zr(hn,ni.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),al&&(Wo=al.placeable,Qs=al.offscreen);const Xr=St(al&&al.placeable);if(!Wo&&this.prevPlacement){const hn=this.prevPlacement.variableOffsets[Wa.crossTileID];hn&&(this.variableOffsets[Wa.crossTileID]=hn,this.markUsedJustification(Ce,hn.anchor,Wa,Xr))}}}if(iu=al,Wo=iu&&iu.placeable,Qs=iu&&iu.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,Gt,hr,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,Qs=Qs&&ks.offscreen}if(ni.iconFeatureIndex&&(Nc=ni.iconFeatureIndex),ni.iconBox){const St=It=>this.collisionIndex.placeCollisionBox(It,gr,en,Gt,hr,Yr,Pr,kt,vt.predicate,Ta,on&&Es?Es:void 0);mu&&mu.placeable&&ni.verticalIconBox?(Cs=St(ni.verticalIconBox),Js=Cs.placeable):(Cs=St(ni.iconBox),Js=Cs.placeable),Qs=Qs&&Cs.offscreen}const Oe=bt||Wa.numHorizontalGlyphVertices===0&&Wa.numVerticalGlyphVertices===0,rt=zt||Wa.numIconVertices===0;Oe||rt?rt?Oe||(Js=Js&&Wo):Wo=Js&&Wo:Js=Wo=Js&&Wo;const wt=Js&&Cs.placeable;if(Wo&&iu.placeable&&this.collisionIndex.insertCollisionBox(iu.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,Nc,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,Wi,ni,iu,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 aa(Wo||Pn,Js||Xn,Qs||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 Wi=Wa[ni];ri(Ce.symbolInstances.get(Wi),Ce.collisionArrays[Wi],Wi)}}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 Gt in this.placements){const hr=this.placements[Gt],Ar=Be[Gt];Ar?(this.opacities[Gt]=new na(Ar,Ce,hr.text,hr.icon),Me=Me||hr.text!==Ar.text.placed||hr.icon!==Ar.icon.placed):(this.opacities[Gt]=new na(null,Ce,hr.text,hr.icon,hr.skipFade),Me=Me||hr.text||hr.icon)}for(const Gt in Be){const hr=Be[Gt];if(!this.opacities[Gt]){const Ar=new na(hr,Ce,!1,!1);Ar.isHidden()||(this.opacities[Gt]=Ar,Me=Me||hr.text.placed||hr.icon.placed)}}for(const Gt in _t)this.variableOffsets[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.variableOffsets[Gt]=_t[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");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 na(null,0,!1,!1,!0),Gt=_t.get("text-allow-overlap"),hr=_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",en=_t.get("text-pitch-alignment")==="map",xn=_t.get("icon-text-fit")!=="none",Ze=new na(null,0,Gt&&(hr||!P.hasIconData()||_t.get("icon-optional")),hr&&(Gt||!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],on=Yr===t.ah.vertical,En=Yr===t.ah.horizontal||Yr===t.ah.horizontalOnly;if(Et>0||Ut>0){const Xn=da(Tr.text);tt(P.text,Et,on?_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||on?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=da(Tr.icon),Ta=!(xn&&zt.verticalPlacedIconSymbolIndex&&on);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(en?this.transform.angle:-this.transform.angle)):ri=!1}if(Xn.textBox||Xn.verticalTextBox){let Wa;Xn.textBox&&(Wa=on),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]-Br,kt=Me[1]-Br,Gt=Me[2]-Br,hr=Me[3]-Br;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,Gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,Gt,hr),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,_t,hr)}const ur=Math.pow(2,25),Gr=Math.pow(2,24),sn=Math.pow(2,17),mn=Math.pow(2,16),Tn=Math.pow(2,9),Jn=Math.pow(2,8),ma=Math.pow(2,1);function da(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*sn+P*mn+oe*Tn+P*Jn+oe*ma+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,Gt=!1){if(!_t[0]&&!_t[1])return[0,0];const hr=Gt?kt==="map"?Ce.angle:0:kt==="viewport"?-Ce.angle:0;if(hr){const Ar=Math.sin(hr),Lr=Math.cos(hr);_t=[_t[0]*Lr-_t[1]*Ar,_t[0]*Ar+_t[1]*Lr]}return[Gt?_t[0]:Wn(Be,_t[0],Ce.zoom),Gt?_t[1]:Wn(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-Gt.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,Gt){this.placement=new qt(P,Ca(),oe,_t,kt,Gt),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 Mi=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(Gt.anchorX*Mi),y:Math.floor(Gt.anchorY*Mi)})),crossTileIDs:_t.map(Gt=>Gt.crossTileID)};if(kt.positions.length>128){const Gt=new t.av(kt.positions.length,16,Uint16Array);for(const{x:hr,y:Ar}of kt.positions)Gt.add(hr,Ar);Gt.finish(),delete kt.positions,kt.index=Gt}this._symbolsByKey[Be]=kt}}getScaledCoordinates(P,oe){const{x:Me,y:Ce,z:Be}=this.tileID.canonical,{x:_t,y:kt,z:Gt}=oe.canonical,hr=Mi/Math.pow(2,Gt-Be),Ar=(kt*t.X+P.anchorY)*hr,Lr=Ce*t.X*Mi;return{x:Math.floor((_t*t.X+P.anchorX)*hr-Me*t.X*Mi),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 Gt=_t[kt];Gt.tileID.isChildOf(P)&&Gt.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()),lt().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,Gt){return t._(this,void 0,void 0,function*(){const hr=w(Be),Ar=kt>1?"@2x":"",Lr={},en={};for(const{id:xn,url:Ze}of hr){const tt=_t.transformRequest(m(Ze,Ar,".json"),"SpriteJSON");Lr[xn]=t.h(tt,Gt);const vt=_t.transformRequest(m(Ze,Ar,".png"),"SpriteImage");en[xn]=l.getImage(vt,Gt)}return yield Promise.all([...Object.values(Lr),...Object.values(en)]),(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:on,stretchX:En,stretchY:Pn,content:Xn,textFitWidth:Ta,textFitHeight:ri}=zt[Et];tt[vt][Et]={data:null,pixelRatio:on,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,en)})})(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(Gt=>!(Gt in Be)):[];for(const Gt of kt)this.imageManager.removeImage(Gt),this._changedImages[Gt]=!0;for(const Gt in Be[_t]){const hr=_t==="default"?Gt:`${_t}:${Gt}`;this._spritesImagesIds[_t].push(hr),hr in this.imageManager.images?this.imageManager.updateImage(hr,Be[_t][Gt],!1):this.imageManager.addImage(hr,Be[_t][Gt]),oe&&(this._changedImages[hr]=!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 Gt of P){const hr=Gt[kt];if(hr)for(const Ar of hr)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 Gt=Ce.length-1;Gt>=0;Gt--){const hr=Ce[Gt].feature;if(Me[hr.layer.id]<_t)break;Be.push(hr),Ce.pop()}else for(const Gt of P){const hr=Gt[kt];if(hr)for(const Ar of hr)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 Gt=this._layers[kt];if(!Gt)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[Gt.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,Gt,hr,Ar,Lr,en,xn){const Ze={},tt=en.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],Gt,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 on=Yr.indexOf(Tr.featureIndex);return Yr.indexOf(Pr.featureIndex)-on}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=hr[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(hr=>Ce.getTileByID(hr)),kt=[],Gt={};for(let hr=0;hr<_t.length;hr++){const Ar=_t[hr],Lr=Ar.tileID.canonical.key;Gt[Lr]||(Gt[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),lt().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 Gt={};for(const hr of this._order){const Ar=this._layers[hr];if(Ar.type!=="symbol")continue;if(!Gt[Ar.source]){const en=this.sourceCaches[Ar.source];Gt[Ar.source]=en.getRenderableIds(!0).map(xn=>en.getTileByID(xn)).sort((xn,Ze)=>Ze.tileID.overscaledZ-xn.tileID.overscaledZ||(xn.tileID.isLessThan(Ze.tileID)?-1:1))}const Lr=this.crossTileSymbolIndex.addLayer(Ar,Gt[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,Gt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),kt=!0),_t&&this.pauseablePlacement.placement.setStale()),kt||_t)for(const hr of this._order){const Ar=this._layers[hr];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 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 ln=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:At(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:At(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:At(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:At(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:At("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:At(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:At(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:At("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:At("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:At("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:At(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:At(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:At(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;gl_Position=u_matrix*vec4(a_pos,0,1);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;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:At(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:At(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:At(`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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),hillshadePrepare:At(`#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 +}`,"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;}"),hillshade:At(`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 +}`,"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;}"),line:At(`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 +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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 +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:At(`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() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:At(`#ifdef GL_ES +precision highp float; +#endif +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 +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:At(`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 +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:At(`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 +}`,"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;}"),symbolIcon:At(`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 +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;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=u_is_text ? size/24.0 : size;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*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:At(`#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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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;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=u_is_text ? size/24.0 : size;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+a_pxoffset)*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=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:At(`#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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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,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,(Gt,hr,Ar,Lr,en)=>(kt[en]=!0,hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +varying ${Ar} ${Lr} ${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`)),vertexSource:P=P.replace(oe,(Gt,hr,Ar,Lr,en)=>{const xn=Lr==="float"?"vec2":"vec4",Ze=en.match(/color/)?"color":xn;return kt[en]?hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +uniform lowp float u_${en}_t; +attribute ${Ar} ${xn} a_${en}; +varying ${Ar} ${Lr} ${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${en} + ${en} = a_${en}; +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${en} + ${en} = unpack_mix_${Ze}(a_${en}, u_${en}_t); +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +uniform lowp float u_${en}_t; +attribute ${Ar} ${xn} a_${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = a_${en}; +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = unpack_mix_${Ze}(a_${en}, u_${en}_t); +#else + ${Ar} ${Lr} ${en} = u_${en}; +#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,Gt,hr){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 un(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,Gt,hr,Ar,Lr,en,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),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 gr in this.terrainUniforms)this.terrainUniforms[gr].set(Gt[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 en.get()){const Tr=gr.vaos||(gr.vaos={});(Tr[hr]||(Tr[hr]=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/Wn(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 hr=new t.A(9);return t.A!=Float32Array&&(hr[1]=0,hr[2]=0,hr[3]=0,hr[5]=0,hr[6]=0,hr[7]=0),hr[0]=1,hr[4]=1,hr[8]=1,hr})();Ce.properties.get("anchor")==="viewport"&&(function(hr,Ar){var Lr=Math.sin(Ar),en=Math.cos(Ar);hr[0]=en,hr[1]=Lr,hr[2]=0,hr[3]=-Lr,hr[4]=en,hr[5]=0,hr[6]=0,hr[7]=0,hr[8]=1})(kt,-P.transform.angle),(function(hr,Ar,Lr){var en=Ar[0],xn=Ar[1],Ze=Ar[2];hr[0]=en*Lr[0]+xn*Lr[3]+Ze*Lr[6],hr[1]=en*Lr[1]+xn*Lr[4]+Ze*Lr[7],hr[2]=en*Lr[2]+xn*Lr[5]+Ze*Lr[8]})(_t,_t,kt);const Gt=Ce.properties.get("color");return{u_matrix:Ue,u_lightpos:_t,u_lightintensity:Ce.properties.get("intensity"),u_lightcolor:[Gt.r,Gt.g,Gt.b],u_vertical_gradient:+oe,u_opacity:Me}},cn=(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}),Hi=(Ue,P,oe,Me)=>{const Ce=Ue.transform;let Be,_t;if(Me.paint.get("circle-pitch-alignment")==="map"){const kt=Wn(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}),fi=(Ue,P,oe,Me)=>({u_matrix:Ue,u_extrude_scale:Wn(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/Wn(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/Wn(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),Gt=oe.layout.get("line-cap")==="round",hr=_t.getDash(Me.from,Gt),Ar=_t.getDash(Me.to,Gt),Lr=hr.width*Ce.fromScale,en=Ar.width*Ce.toScale;return t.e(Xs(Ue,P,oe,Be),{u_patternscale_a:[kt/Lr,-hr.height/2],u_patternscale_b:[kt/en,-Ar.height/2],u_sdfgamma:_t.width/(256*Math.min(Lr,en)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:hr.y,u_tex_y_b:Ar.y,u_mix:Ce.t})};function Ys(Ue,P){return 1/Wn(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 sl=(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,Gt,hr,Ar,Lr,en,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:Gt,u_coord_matrix:hr,u_is_text:+Lr,u_pitch_with_map:+Me,u_is_along_line:Ce,u_is_variable_anchor:Be,u_texsize:en,u_texture:0,u_translation:Ar,u_pitched_scale:xn}},vo=(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,xn,Ze)=>{const tt=_t.transform;return t.e(Zo(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,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,Gt,hr,Ar,Lr,en,xn)=>t.e(vo(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,!0,Lr,!0,xn),{u_texsize_icon:en,u_texture_icon:1}),ll=(Ue,P,oe)=>({u_matrix:Ue,u_opacity:P,u_color:oe}),kl=(Ue,P,oe,Me,Ce,Be)=>t.e((function(_t,kt,Gt,hr){const Ar=Gt.imageManager.getPattern(_t.from.toString()),Lr=Gt.imageManager.getPattern(_t.to.toString()),{width:en,height:xn}=Gt.imageManager.getPixelSize(),Ze=Math.pow(2,hr.tileID.overscaledZ),tt=hr.tileSize*Math.pow(2,Gt.transform.tileZoom)/Ze,vt=tt*(hr.tileID.canonical.x+hr.tileID.wrap*Ze),bt=tt*hr.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:[en,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/Wn(hr,1,Gt.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}),Pl={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 di={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),Gt.push({circleArray:gr,circleOffset:Ar,transform:zt.posMatrix,invTransform:Tr,coord:zt}),hr+=gr.length/4,Ar=hr}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||!Gt.length)return;const en=Ue.useProgram("collisionCircle"),xn=new t.aR;xn.resize(4*hr),xn._trim();let Ze=0;for(const bt of Gt)for(let zt=0;zt=0&&(bt[Et.associatedIconIndex]={shiftedAnchor:Wi,angle:To})}else mr(Et.numGlyphs,tt)}if(hr){vt.clear();const zt=Ue.icon.placedSymbolArray;for(let Et=0;EtUe.style.map.terrain.getElevation(Pn,Cn,La):null,Sn=oe.layout.get("text-rotation-alignment")==="map";ke(Ta,Pn.posMatrix,Ue,Ce,uc,ge,bt,hr,Sn,tt,Pn.toUnwrapped(),Ze.width,Ze.height,Oe,hn)}const St=Pn.posMatrix,It=Ce&&Yr||wt,tr=zt||It?Ou:uc,er=Nc,_r=ni&&oe.paint.get(Ce?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Zr;Zr=ni?Ta.iconsInText?hs(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Qs,iu,En):vo(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Qs,!0,En):Zo(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Qs,En);const Xr={program:ho,buffers:ri,uniformValues:Zr,atlasTexture:Es,atlasTextureIcon:ks,atlasInterpolation:al,atlasInterpolationIcon:mu,isSDF:ni,hasHalo:_r};if(gr&&Ta.canOverlap){Tr=!0;const hn=ri.segments.get();for(const Sn of hn)on.push({segments:new t.a0([Sn]),sortKey:Sn.sortKey,state:Xr,terrainData:Js})}else on.push({segments:ri.segments,sortKey:0,state:Xr,terrainData:Js})}Tr&&on.sort((Pn,Xn)=>Pn.sortKey-Xn.sortKey);for(const Pn of on){const Xn=Pn.state;if(en.activeTexture.set(xn.TEXTURE0),Xn.atlasTexture.bind(Xn.atlasInterpolation,xn.CLAMP_TO_EDGE),Xn.atlasTextureIcon&&(en.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,Gt,hr){const Ar=Me.context;Ce.draw(Ar,Ar.gl.TRIANGLES,Be,_t,kt,Oo.disabled,Gt,hr,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]),Gt=P.getBucket(oe);if(!Gt)return;const hr=Me.key;let Ar=oe.heatmapFbos.get(hr);Ar||(Ar=Fh(Ce,P.tileSize,P.tileSize),oe.heatmapFbos.set(hr,Ar)),Ce.bindFramebuffer.set(Ar.framebuffer),Ce.viewport.set([0,0,P.tileSize,P.tileSize]),Ce.clear({color:t.aM.transparent});const Lr=Gt.programConfigurations.get(oe.id),en=Ue.useProgram("heatmap",Lr),xn=Ue.style.map.terrain.getTerrainData(Me);en.draw(Ce,Be.TRIANGLES,Fs.disabled,_t,kt,Oo.disabled,fi(Me.posMatrix,P,Ue.transform.zoom,oe.paint.get("heatmap-intensity")),xn,oe.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.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,Gt=(Ce=Ue.RGBA16F)!==null&&Ce!==void 0?Ce:Be.RGBA;Be.texImage2D(Be.TEXTURE_2D,0,Gt,P,oe,0,Be.RGBA,kt,null);const hr=Ue.createFramebuffer(P,oe,!1,!1);return hr.colorAttachment.set(_t),hr}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 Gt=Ce.getPaintProperty(P);_t=Be[Gt],kt=Be[Gt]}_t&&kt&&Ue.setConstantPatternPositions(_t,kt)}function Gh(Ue,P,oe,Me,Ce,Be,_t){const kt=Ue.context.gl,Gt="fill-pattern",hr=oe.paint.get(Gt),Ar=hr&&hr.constantOr(1),Lr=oe.getCrossfadeParameters();let en,xn,Ze,tt,vt;_t?(xn=Ar&&!oe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",en=kt.LINES):(xn=Ar?"fillPattern":"fill",en=kt.TRIANGLES);const bt=hr.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,Gt,bt,Et,oe);const Yr=Pr?zt:null,on=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(on,Ue,Lr,Et,En):Ea(on,En)}else tt=Ut.indexBuffer,vt=Ut.segments,Ze=Ar?gi(on,Ue,Lr,Et):In(on);Tr.draw(Ue.context,en,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,Gt=kt.gl,hr="fill-extrusion-pattern",Ar=oe.paint.get(hr),Lr=Ar.constantOr(1),en=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(Gt.TEXTURE0),vt.imageAtlasTexture.bind(Gt.LINEAR,Gt.CLAMP_TO_EDGE),Et.updatePaintBuffers(en)),of(Et,hr,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?cn(gr,Ue,Tr,xn,tt,en,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,Gt=kt.gl,hr=oe.fbo;if(!hr)return;const Ar=Ue.useProgram("hillshade"),Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,hr.colorAttachment.get()),Ar.draw(kt,Gt.TRIANGLES,Ce,Be,_t,Oo.disabled,((en,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-=en.transform.angle);const Ut=!en.options.moving;return{u_matrix:tt?tt.posMatrix:en.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 Ku(Ue,P,oe,Me,Ce,Be){const _t=Ue.context,kt=_t.gl,Gt=P.dem;if(Gt&&Gt.data){const hr=Gt.dim,Ar=Gt.stride,Lr=Gt.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 en=P.fbo;if(!en){const xn=new u(_t,{width:hr,height:hr,data:null},kt.RGBA);xn.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),en=P.fbo=_t.createFramebuffer(hr,hr,!0,!1),en.colorAttachment.set(xn.texture)}_t.bindFramebuffer.set(en.framebuffer),_t.viewport.set([0,0,hr,hr]),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,Gt),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(),Gt=(kt-Ue.timeAdded)/_t,hr=P?(kt-P.timeAdded)/_t:-1,Ar=oe.getSource(),Lr=Ce.coveringZoomLevel({tileSize:Ar.tileSize,roundZoom:Ar.roundZoom}),en=!P||Math.abs(P.tileID.overscaledZ-Lr)>Math.abs(Ue.tileID.overscaledZ-Lr),xn=en&&Ue.refreshedUponExpiration?1:t.ac(en?Gt:1-hr,0,1);return Ue.refreshedUponExpiration&&Gt>=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),Bl=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){Dc(Ue,0,P+oe/2,Ue.transform.width,oe,Me)}function Yh(Ue,P,oe,Me){Dc(Ue,P-oe/2,0,oe,Ue.transform.height,Me)}function Dc(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,Gt=pl.disabled,hr=Ue.colorModeForRenderPass(),Ar="$debug",Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(oe);Me.activeTexture.set(Ce.TEXTURE0);const en=P.getTileByID(oe.key).latestRawTileData,xn=Math.floor((en&&en.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,Gt,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,Gt,hr,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"),Gt=P.getTerrainMesh();Me.bindFramebuffer.set(null),Me.viewport.set([0,0,Ue.width,Ue.height]);for(const hr of oe){const Ar=Ue.renderToTexture.getTexture(hr),Lr=P.getTerrainData(hr.tileID);Me.activeTexture.set(Ce.TEXTURE0),Ce.bindTexture(Ce.TEXTURE_2D,Ar.texture);const en=Ue.transform.calculatePosMatrix(hr.tileID.toUnwrapped()),xn=P.getMeshFrameDelta(Ue.transform.zoom),Ze=Ue.transform.calculateFogMatrix(hr.tileID.toUnwrapped()),tt=zr(en,xn,Ze,Ue.style.sky,Ue.transform.pitch);kt.draw(Me,Ce.TRIANGLES,_t,pl.disabled,Be,Oo.backCCW,tt,Lr,"terrain",Gt.vertexBuffer,Gt.indexBuffer,Gt.segments)}}class zc{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,ln.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,ln.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,ln.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 Gt=this.context.gl;this.stencilClearMode=new pl({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 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++,Gt=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),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 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}))(hr,Gt.style.map.transform,Gt.pixelRatio),xn=new Fs(Lr.LEQUAL,Fs.ReadWrite,[0,1]),Ze=pl.disabled,tt=Gt.colorModeForRenderPass(),vt=Gt.useProgram("sky");if(!hr.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),hr.mesh=new zc(Ar.createVertexBuffer(bt,ln.members),Ar.createIndexBuffer(zt),t.a0.simpleSegment(0,0,bt.length,zt.length))}vt.draw(Ar,Lr.TRIANGLES,xn,Ze,tt,Oo.disabled,en,void 0,"sky",hr.mesh.vertexBuffer,hr.mesh.indexBuffer,hr.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 Gt=this.style._layers[Me[this.currentLayer]],hr=Ce[Gt.source],Ar=Be[Gt.source];this._renderTileClippingMasks(Gt,Ar),this.renderLayer(this,hr,Gt,Ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayervt.source&&!vt.isHidden(Ar)?[hr.sourceCaches[vt.source]]:[]),xn=en.filter(vt=>vt.getSource().type==="vector"),Ze=en.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);Gt&&(function(hr,Ar,Lr){for(let en=0;en0),Ce&&(t.b0(oe,Me),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Be,_t){const kt=Be.context,Gt=kt.gl,hr=fu.unblended,Ar=new Fs(Gt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),en=_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 en){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,Gt.TRIANGLES,Ar,pl.disabled,hr,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,Gt=kt.gl,hr=fu.unblended,Ar=new Fs(Gt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),en=_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(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,en.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,Gt.TRIANGLES,Ar,pl.disabled,hr,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,Gt,hr){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(en,xn,Ze,tt,vt,bt,zt,Et,Ut){const gr=xn.transform,Tr=Ca(),Pr=vt==="map",Yr=bt==="map";for(const on of en){const En=tt.getTile(on),Pn=En.getBucket(Ze);if(!Pn||!Pn.text||!Pn.text.segments.get().length)continue;const Xn=t.ag(Pn.textSizeData,gr.zoom),Ta=Wn(En,1,xn.transform.zoom),ri=Sr(on.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),Wi=xn.style.map.terrain?(ho,Wo)=>xn.style.map.terrain.getElevation(on,ho,Wo):null,To=Tr.translatePosition(gr,En,zt,Et);uh(Pn,Pr,Yr,Ut,gr,ri,on.posMatrix,ni,Xn,Wa,Tr,To,on.toUnwrapped(),Wi)}}})(Gt,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"),hr),kt.paint.get("icon-opacity").constantOr(1)!==0&&fd(Be,_t,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,Lr),kt.paint.get("text-opacity").constantOr(1)!==0&&fd(Be,_t,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,Lr),_t.map.showCollisionBoxes&&(af(Be,_t,kt,Gt,!0),af(Be,_t,kt,Gt,!1))})(P,oe,Me,Ce,this.style.placement.variableOffsets);break;case"circle":(function(Be,_t,kt,Gt){if(Be.renderPass!=="translucent")return;const hr=kt.paint.get("circle-opacity"),Ar=kt.paint.get("circle-stroke-width"),Lr=kt.paint.get("circle-stroke-opacity"),en=!kt.layout.get("circle-sort-key").isConstant();if(hr.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:on}=Et.state;gr.draw(xn,Ze.TRIANGLES,tt,vt,bt,Oo.disabled,Yr,on,kt.id,Tr,Pr,Et.segments,kt.paint,Be.transform.zoom,Ut)}})(P,oe,Me,Ce);break;case"heatmap":(function(Be,_t,kt,Gt){if(kt.paint.get("heatmap-opacity")===0)return;const hr=Be.context;if(Be.style.map.terrain){for(const Ar of Gt){const Lr=_t.getTile(Ar);_t.hasRenderableParent(Ar)||(Be.renderPass==="offscreen"?ch(Be,Lr,kt,Ar):Be.renderPass==="translucent"&&Nf(Be,kt,Ar))}hr.viewport.set([0,0,Be.width,Be.height])}else Be.renderPass==="offscreen"?(function(Ar,Lr,en,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,en),Ze.clear({color:t.aM.transparent});for(let zt=0;zt20&&Ar.texParameterf(Ar.TEXTURE_2D,hr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,hr.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=sl(Ta,on||[0,0],Yr||1,Pr,kt);Lr instanceof st?en.draw(hr,Ar.TRIANGLES,Et,pl.disabled,xn,Oo.disabled,ri,Pn,kt.id,Lr.boundsBuffer,Be.quadTriangleIndexBuffer,Lr.boundsSegments):en.draw(hr,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,Gt){const hr=kt.paint.get("background-color"),Ar=kt.paint.get("background-opacity");if(Ar===0)return;const Lr=Be.context,en=Lr.gl,xn=Be.transform,Ze=xn.tileSize,tt=kt.paint.get("background-pattern");if(Be.isPatternMissing(tt))return;const vt=!tt&&hr.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=Gt||xn.coveringTiles({tileSize:Ze,terrain:Be.style.map.terrain});tt&&(Lr.activeTexture.set(en.TEXTURE0),Be.imageManager.bind(Be.context));const Tr=kt.getCrossfadeParameters();for(const Pr of gr){const Yr=Gt?Pr.posMatrix:Be.transform.calculatePosMatrix(Pr.toUnwrapped()),on=tt?kl(Yr,Ar,Be,tt,{tileID:Pr,tileSize:Ze},Tr):ll(Yr,Ar,hr),En=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Pr);Ut.draw(Lr,en.TRIANGLES,zt,bt,Et,Oo.disabled,on,En,kt.id,Be.tileExtentBuffer,Be.quadTriangleIndexBuffer,Be.tileExtentSegments)}})(P,0,Me,Ce);break;case"custom":(function(Be,_t,kt){const Gt=Be.context,hr=kt.implementation;if(Be.renderPass==="offscreen"){const Ar=hr.prerender;Ar&&(Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Ar.call(hr,Gt.gl,Be.transform.customLayerMatrix()),Gt.setDirty(),Be.setBaseState())}else if(Be.renderPass==="translucent"){Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Gt.setStencilMode(pl.disabled);const Ar=hr.renderingMode==="3d"?new Fs(Be.context.gl.LEQUAL,Fs.ReadWrite,Be.depthRangeFor3D):Be.depthModeForSublayer(0,Fs.ReadOnly);Gt.setDepthMode(Ar),hr.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,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 hr=Math.sin(_t),Ar=Math.cos(_t);Me=[Me[0]*Ar-Me[1]*hr,Me[0]*hr+Me[1]*Ar]}const kt=[Be?Me[0]:Wn(oe,Me[0],this.transform.zoom),Be?Me[1]:Wn(oe,Me[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()),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,Pl[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 Ql{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 Gt=1/(kt=t.af([],kt,P))[3]/oe*Ce;return t.b1(kt,kt,[Gt,Gt,1/kt[3],Gt])}),_t=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(kt=>{const Gt=(function(en,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)),en[0]=xn[0]*bt,en[1]=xn[1]*bt,en[2]=xn[2]*bt,en})([],(function(en,xn,Ze){var tt=xn[0],vt=xn[1],bt=xn[2],zt=Ze[0],Et=Ze[1],Ut=Ze[2];return en[0]=vt*Ut-bt*Et,en[1]=bt*zt-tt*Ut,en[2]=tt*Et-vt*zt,en})([],M([],Be[kt[0]],Be[kt[1]]),M([],Be[kt[2]],Be[kt[1]]))),hr=-((Ar=Gt)[0]*(Lr=Be[kt[1]])[0]+Ar[1]*Lr[1]+Ar[2]*Lr[2]);var Ar,Lr;return Gt.concat(hr)});return new Ql(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 mc{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 mc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Oc=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 mc,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],Gt=Ce[2],hr=Ce[3],Ar=Math.sin(Be),Lr=Math.cos(Be);Me[0]=_t*Lr+Gt*Ar,Me[1]=kt*Lr+hr*Ar,Me[2]=_t*-Ar+Gt*Lr,Me[3]=kt*-Ar+hr*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)),Gt=Math.floor(Math.max(Me.x,Ce.x,Be.x,_t.x)),hr=1;for(let Ar=kt-hr;Ar<=Gt+hr;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),Gt=Math.pow(2,Ce),hr=[Gt*_t.x,Gt*_t.y,0],Ar=[Gt*kt.x,Gt*kt.y,0],Lr=Ql.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ce);let en=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(en=Ce);const xn=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ze=Et=>({aabb:new kf([Et*Gt,0,0],[(Et+1)*Gt,Gt,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?hr:Ar,Yr=Et.aabb.distanceX(Pr),on=Et.aabb.distanceY(Pr),En=Math.max(Math.abs(Yr),Math.abs(on));if(Et.zoom===bt||En>xn+(1<=en){const Pn=bt-Et.zoom,Xn=hr[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),Wi=P.terrain.getMinMaxElevation(ni),To=(oe=Wi.minElevation)!==null&&oe!==void 0?oe:this.elevation,ho=(Me=Wi.maxElevation)!==null&&Me!==void 0?Me:this.elevation;Wa=new kf([Wa.min[0],Wa.min[1],To],[Wa.max[0],Wa.max[1],ho])}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,Oc);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),Gt=this.scaleZoom(kt/this.tileSize);this._elevation=Be,this._center=Ce,this.zoom=Gt}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 en=oe.pointCoordinate(P);if(en!=null)return en}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,Gt=Ce[1]/_t,hr=Me[2]/Be,Ar=Ce[2]/_t,Lr=hr===Ar?0:(0-hr)/(Ar-hr);return new t.Z(t.y.number(Me[0]/Be,Ce[0]/_t,Lr)/this.worldSize,t.y.number(kt,Gt,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,Oc])}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,Gt=0,hr=Be,Ar=0,Lr=0;const{x:en,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=(Gt+hr)/2;let Ut=Ze;this._renderWorldCopies&&(Ut=t.b3(Ze,Et-Be/2,Et+Be/2));const gr=en/2;Ut-grhr&&(vt=hr-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),Gt=_t<0?kt:Be,hr=Math.PI/2+this._pitch,Ar=this._fov*(.5+P.y/this.height),Lr=Math.sin(Ar)*Gt/Math.sin(t.ac(Math.PI-hr-Ar,.01,Math.PI-.01)),en=this.getHorizon(),xn=2*Math.atan(en/this.cameraToCenterDistance)*(.5+P.y/(2*en)),Ze=Math.sin(xn)*Gt/Math.sin(t.ac(Math.PI-hr-xn,.01,Math.PI-.01)),tt=Math.min(Lr,Ze);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*tt+Gt),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,Gt=this._map.getBearing(),hr=this._map.getPitch();let Ar="";if(Ar+=P?`/${_t}/${kt}/${Me}`:`${Me}/${kt}/${_t}`,(Gt||hr)&&(Ar+="/"+Math.round(10*Gt)/10),hr&&(Ar+=`/${Math.round(hr)}`),this._hashName){const Lr=this._hashName;let en=!1;const xn=window.location.hash.slice(1).split("&").map(Ze=>{const tt=Ze.split("=")[0];return tt===Lr?(en=!0,`${tt}=${Ar}`):Ze}).filter(Ze=>Ze);return en||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),ev=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,ev);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(Gt)),kt=Be.reduce((Gt,hr,Ar,Lr)=>Gt.add(hr.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 au{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 Fc{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 Fc(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 su(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 Fc(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()}},fc=({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 hr in Ce){const Ar=Ce[hr],Lr=this._touches[hr];Lr&&(Be._add(Ar),_t._add(Ar.sub(Lr)),kt++,Ce[hr]=Ar)}if(this._touches=Ce,this._shouldBePrevented(kt)||!_t.mag())return;const Gt=_t.div(kt);return this._sum._add(Gt),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 fr={panStep:100,bearingStep:15,pitchStep:10};class Rr{constructor(P){this._tr=new Fc(P);const oe=fr;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 Gt=this._tr;kt.easeTo({duration:300,easeId:"keyboardHandler",easing:vn,zoom:oe?Math.round(Gt.zoom)+oe*(P.shiftKey?2:1):Gt.zoom,bearing:Gt.bearing+Me*this._bearingStep,pitch:Gt.pitch+Ce*this._pitchStep,offset:[-Be*this._panStep,-_t*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 vn(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 Fc(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 Gt=this._type==="wheel"&&Math.abs(this._delta)>an?this._wheelZoomRate:this._defaultZoomRate;let hr=2/(1+Math.exp(-Math.abs(this._delta*Gt)));this._delta<0&&hr!==0&&(hr=1/hr);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*hr))),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 Gt=Math.min(kt/200,1),hr=Ce(Gt);Be=t.y.number(Me,oe,hr),Gt<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 Fc(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 ci{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 Xi(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},Gt={},hr={},Ar=Ce.touches,Lr=Ar?this._getMapTouches(Ar):void 0,en=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(hr,bt,tt)?vt.reset():vt[Be||Ce.type]&&(zt=vt[Be||Ce.type](Ce,en,Lr),this.mergeHandlerResult(kt,Gt,zt,tt,_t),zt&&zt.needsRenderFrame&&this._triggerRenderFrame()),(zt||vt.isActive())&&(hr[tt]=vt)}const xn={};for(const tt in this._previousActiveHandlers)hr[tt]||(xn[tt]=_t);this._previousActiveHandlers=hr,(Object.keys(xn).length||Xi(kt))&&(this._changes.push([kt,Gt,xn]),this._triggerRenderFrame()),(Object.keys(hr).length||Xi(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 Gt=new ti;this._add("tapDragZoom",Gt);const hr=oe.touchPitch=new jh(oe);this._add("touchPitch",hr),P.interactive&&P.touchPitch&&oe.touchPitch.enable(P.touchPitch);const Ar=fc(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 en=(({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 ci(Me,en,xn),this._add("mousePan",en),this._add("touchPan",xn,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&oe.dragPan.enable(P.dragPan);const Ze=new Vf,tt=new wc;oe.touchZoomRotate=new Ha(Me,tt,Ze,Gt),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 au(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(!(Xi(P)||_t&&this._terrainMovement))return this._fireEvents(oe,Me,!0);let{panDelta:kt,zoomDelta:Gt,bearingDelta:hr,pitchDelta:Ar,around:Lr,pinchAround:en}=P;en!==void 0&&(Lr=en),Ce._stop(!0),Lr=Lr||Ce.transform.centerPoint;const xn=Be.pointLocation(kt?Lr.sub(kt):Lr);hr&&(Be.bearing+=hr),Ar&&(Be.pitch+=Ar),Gt&&(Be.zoom+=Gt),_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:en}=P[Lr];this._eventsInProgress[Lr]||(_t[`${Lr}start`]=en),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:en}=P[Lr];this._fireEvent(Lr,en)}const kt={};let Gt;for(const Lr in this._eventsInProgress){const{handlerName:en,originalEvent:xn}=this._eventsInProgress[Lr];this._handlersById[en].isActive()||(delete this._eventsInProgress[Lr],Gt=oe[en]||xn,kt[`${Lr}end`]=Gt)}for(const Lr in kt)this._fireEvent(Lr,kt[Lr]);const hr=Qa(this._eventsInProgress),Ar=(Ce||Be)&&!hr;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),en=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,hr,Pr)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,Pr)),this._padding&&(Ce.interpolatePadding(Gt,Lr,Pr),xn=Ce.centerPoint.add(en)),this.terrain&&!P.freezeElevation&&this._updateElevation(Pr),Ut)Ce.setLocationAtPoint(Ut,gr);else{const Yr=Ce.zoomScale(Ce.zoom-Be),on=vt>Be?Math.min(2,Et):Math.max(.5,Et),En=Math.pow(on,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:Gt,bearing:hr,elevation:Ar}=Ce(Be);_t&&(Be.center=_t),kt!==void 0&&(Be.zoom=kt),Gt!==void 0&&(Be.pitch=Gt),hr!==void 0&&(Be.bearing=hr),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,Gt=Ce.padding,hr="bearing"in P?this._normalizeBearing(P.bearing,_t):_t,Ar="pitch"in P?+P.pitch:kt,Lr="padding"in P?P.padding:Ce.padding,en=t.P.convert(P.offset);let xn=Ce.centerPoint.add(en);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),Wi=gr/Ce.zoomScale(ni-Be);Ut=Math.sqrt(Wi/Pr*2)}const Yr=Ut*Ut;function on(ni){const Wi=(Tr*Tr-gr*gr+(ni?-1:1)*Yr*Yr*Pr*Pr)/(2*(ni?Tr:gr)*Yr*Pr);return Math.log(Math.sqrt(Wi*Wi+1)-Wi)}function En(ni){return(Math.exp(ni)-Math.exp(-ni))/2}function Pn(ni){return(Math.exp(ni)+Math.exp(-ni))/2}const Xn=on(!1);let Ta=function(ni){return Pn(Xn)/Pn(Xn+Ut*ni)},ri=function(ni){return gr*((Pn(Xn)*(En(Wi=Xn+Ut*ni)/Pn(Wi))-En(Xn))/Yr)/Pr;var Wi},Wa=(on(!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=Wi=>Math.exp(ni*Ut*Wi)}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!==hr,this._pitching=Ar!==kt,this._padding=!Ce.isPaddingEqual(Lr),this._prepareEase(oe,!1),this.terrain&&this._prepareElevation(tt),this._ease(ni=>{const Wi=ni*Wa,To=1/Ta(Wi);Ce.zoom=ni===1?vt:Be+Ce.scaleZoom(To),this._rotating&&(Ce.bearing=t.y.number(_t,hr,ni)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,ni)),this._padding&&(Ce.interpolatePadding(Gt,Lr,ni),xn=Ce.centerPoint.add(en)),this.terrain&&!P.freezeElevation&&this._updateElevation(ni);const ho=ni===1?tt:Ce.unproject(zt.add(Et.mult(ri(Wi))).mult(To));Ce.setLocationAtPoint(Ce.renderWorldCopies?ho.wrap():ho,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 Zi{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),Gt=Ce.canonical.y-(Ce.canonical.y>>_t<<_t),hr=t.X>>_t;t.aP(Be.posMatrix,0,hr,0,hr,0,1),t.J(Be.posMatrix,Be.posMatrix,[-kt*hr,-Gt*hr,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),Gt=P.canonical.y-(P.canonical.y>>_t<<_t),hr=t.X>>_t;t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),t.J(Be.posMatrix,Be.posMatrix,[kt*hr,Gt*hr,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 Gt=oe[0]+(oe[2]>>4<<8),hr=oe[1]+((15&oe[2])<<8),Ar=this.coordsIndex[255-oe[3]],Lr=Ar&&this.sourceCache.getTileByID(Ar);if(!Lr)return null;const en=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 hr=this.pool.getObjectForId(kt.rtt[Be].id);if(hr.stamp===kt.rtt[Be].stamp){this.pool.useObject(hr);continue}}const Gt=this.pool.getOrCreateFreeObject();this.pool.useObject(Gt),this.pool.stampObject(Gt),kt.rtt[Be]={id:Gt.id,stamp:Gt.stamp},Me.context.bindFramebuffer.set(Gt.fbo.framebuffer),Me.context.clear({color:t.aM.transparent,stencil:0}),Me.currentStencilSource=void 0;for(let hr=0;hr<_t.length;hr++){const Ar=Me.style._layers[_t[hr]],Lr=Ar.source?this._coordsDescendingInv[Ar.source][kt.tileID.key]:[kt.tileID];Me.context.viewport.set([0,0,Gt.fbo.width,Gt.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},Vl=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=fc({clickTolerance:Ce,enable:!0}),this.touchRotate=(({enable:_t,clickTolerance:kt,bearingDegreesPerPixelMoved:Gt=.8})=>{const hr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({bearingDelta:(Lr.x-Ar.x)*Gt}),moveStateManager:hr,enable:_t,assignEvents:Vl})})({clickTolerance:Ce,enable:!0}),this.map=P,Me&&(this.mousePitch=$h({clickTolerance:Be,enable:!0}),this.touchPitch=(({enable:_t,clickTolerance:kt,pitchDegreesPerPixelMoved:Gt=-.5})=>{const hr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({pitchDelta:(Lr.y-Ar.y)*Gt}),moveStateManager:hr,enable:_t,assignEvents:Vl})})({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 Dl;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 gc={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 yc(Ue,P,oe){const Me=Ue.classList;for(const Ce in gc)Me.remove(`maplibregl-${oe}-anchor-${Ce}`);Me.add(`maplibregl-${oe}-anchor-${P}`)}class Tc 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,`${gc[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 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 bt 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",bt.rx),zt.setAttributeNS(null,"ry",bt.ry),kt.appendChild(zt)}const hr=a.createNS("http://www.w3.org/2000/svg","g");hr.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"),hr.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 en=a.createNS("http://www.w3.org/2000/svg","path");en.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(en);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(hr),_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()}),yc(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,Gt=Math.sin(Ce.getPitch()*Math.PI/180)*kt,hr=Ce.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Ar=Ce.transform.lngLatToCameraDepth(this._lngLat,_t+Gt)-hr>.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 _c=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 Gt=3.2808*kt;Gt>5280?Xo(P,Me,Gt/5280,Ue._getUIString("ScaleControl.Miles")):Xo(P,Me,Gt,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(Gt){const hr=Math.pow(10,Math.ceil(-Math.log(Gt)/Math.LN10));return Math.round(Gt*hr)/hr})(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 Bc=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=ci,e.DragRotateHandler=Ni,e.EdgeInsets=mc,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 Tc({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Tc({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(Dl!==void 0&&!P)return Dl;if(window.navigator.permissions===void 0)return Dl=!!window.navigator.geolocation,Dl;try{Dl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Dl=!!window.navigator.geolocation}return Dl})})().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,_c=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":_c--,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"),_c++,_c>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=Zi,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 Zi,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 Gt=this._getClampedPixelRatio(Me,Ce);this._resizeCanvas(Me,Ce,Gt),this.painter.resize(Me,Ce,Gt)}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(Gt=>this.getLayer(Gt)),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(Gt=>this.getLayer(Gt));(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:Gt,textFitHeight:hr}=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:en}=P,xn=P;return this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},new Uint8Array(en)),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Gt,textFitHeight:hr,sdf:Ce,version:0,userImage:xn}),xn.onAdd&&xn.onAdd(this,Ue),this}}{const{width:Ar,height:Lr,data:en}=i.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},en),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Gt,textFitHeight:hr,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=Tc,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,Gt=this._container.offsetHeight;let hr;hr=Me.y+Be.bottom.ythis._map.transform.height-Gt?["bottom"]:[],Me.xthis._map.transform.width-kt/2&&hr.push("right"),Ce=hr.length===0?"bottom":hr.join("-")}let _t=Me.add(Be[Ce]);this.options.subpixelPositioning||(_t=_t.round()),a.setTransform(this._container,`${gc[Ce]} translate(${_t.x}px,${_t.y}px)`),yc(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=wc,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 lt().getRTLTextPluginStatus()},e.getVersion=function(){return Bc},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 lt().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){fe.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=h;return E})}}),M7=Ge({"src/plots/map/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=CL(),E=q_();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}}}),E7=Ge({"src/plots/map/map.js"(K,G){var h=S7(),b=_n(),S=B_(),E=Ro(),e=Ts(),t=lv(),r=Yf(),o=Up(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=q_(),v=M7();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}}}),I7=Ge({"src/traces/choroplethmap/index.js"(K,G){G.exports={attributes:LL(),supplyDefaults:P7(),colorbar:Am(),calc:CE(),plot:R7(),hoverPoints:PE(),eventData:RE(),selectPoints:IE(),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}}}),N7=Ge({"src/traces/densitymap/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]}}}}),U7=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}}}),j7=Ge({"src/traces/densitymap/index.js"(K,G){G.exports={attributes:RL(),supplyDefaults:z7(),colorbar:Am(),formatLabels:kL(),calc:O7(),plot:B7(),hoverPoints:N7(),eventData:U7(),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})}}}),G7=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})})}}),Z7=Ge({"node_modules/d3-force/dist/d3-force.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,G7(),KE(),X7(),Y7()):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})})}}),zL=Ge({"node_modules/d3-shape/dist/d3-shape.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,W7()):(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,un,Rn,qn,jn,cn){var In=zr-At,gi=un-lr,Ea=jn-Rn,Ci=cn-qn,Hi=Ci*In-Ea*gi;if(!(Hi*Hill*ll+kl*kl&&(Vs=fs,sl=Zo),{cx:Vs,cy:sl,x01:-Ea,y01:-Ci,x11:Vs*(Rn/Jo-1),y11:sl*(Rn/Jo-1)}}function w(){var At=T,lr=l,zr=S(0),un=null,Rn=g,qn=x,jn=A,cn=null;function In(){var gi,Ea,Ci=+At.apply(this,arguments),Hi=+lr.apply(this,arguments),so=Rn.apply(this,arguments)-f,io=qn.apply(this,arguments)-f,Mo=E(io-so),fi=io>so;if(cn||(cn=gi=b.path()),Hia))cn.moveTo(0,0);else if(Mo>c-a)cn.moveTo(Hi*t(so),Hi*n(so)),cn.arc(0,0,Hi,so,io,!fi),Ci>a&&(cn.moveTo(Ci*t(io),Ci*n(io)),cn.arc(0,0,Ci,io,so,fi));else{var ts=so,Ho=io,Xs=so,cs=io,Jo=Mo,Uo=Mo,Ys=jn.apply(this,arguments)/2,Vs=Ys>a&&(un?+un.apply(this,arguments):i(Ci*Ci+Hi*Hi)),sl=o(E(Hi-Ci)/2,+zr.apply(this,arguments)),fs=sl,Zo=sl,vo,hs;if(Vs>a){var ll=v(Vs/Ci*n(Ys)),kl=v(Vs/Hi*n(Ys));(Jo-=ll*2)>a?(ll*=fi?1:-1,Xs+=ll,cs-=ll):(Jo=0,Xs=cs=(so+io)/2),(Uo-=kl*2)>a?(kl*=fi?1:-1,ts+=kl,Ho-=kl):(Uo=0,ts=Ho=(so+io)/2)}var Pl=Hi*t(ts),Ms=Hi*n(ts),di=Ci*t(cs),to=Ci*n(cs);if(sl>a){var Cl=Hi*t(Ho),Ps=Hi*n(Ho),Fo=Ci*t(Xs),Rl=Ci*n(Xs),Zs;if(Moa?Zo>a?(vo=_(Fo,Rl,Pl,Ms,Hi,Zo,fi),hs=_(Cl,Ps,di,to,Hi,Zo,fi),cn.moveTo(vo.cx+vo.x01,vo.cy+vo.y01),Zoa)||!(Jo>a)?cn.lineTo(di,to):fs>a?(vo=_(di,to,Cl,Ps,Ci,-fs,fi),hs=_(Pl,Ms,Fo,Rl,Ci,-fs,fi),cn.lineTo(vo.cx+vo.x01,vo.cy+vo.y01),fs=Hi;--so)cn.point(Ho[so],Xs[so]);cn.lineEnd(),cn.areaEnd()}fi&&(Ho[Ci]=+At(Mo,Ci,Ea),Xs[Ci]=+zr(Mo,Ci,Ea),cn.point(lr?+lr(Mo,Ci,Ea):Ho[Ci],un?+un(Mo,Ci,Ea):Xs[Ci]))}if(ts)return cn=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),un=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?(un=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):un},In.lineX0=In.lineY0=function(){return gi().x(At).y(zr)},In.lineY1=function(){return gi().x(At).y(un)},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&&(cn=jn(qn)),In):jn},In.context=function(Ea){return arguments.length?(Ea==null?qn=cn=null:cn=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,un=S(0),Rn=S(c),qn=S(0);function jn(cn){var In,gi=cn.length,Ea,Ci,Hi=0,so=new Array(gi),io=new Array(gi),Mo=+un.apply(this,arguments),fi=Math.min(c,Math.max(-c,Rn.apply(this,arguments)-Mo)),ts,Ho=Math.min(Math.abs(fi)/gi,qn.apply(this,arguments)),Xs=Ho*(fi<0?-1:1),cs;for(In=0;In0&&(Hi+=cs);for(lr!=null?so.sort(function(Jo,Uo){return lr(io[Jo],io[Uo])}):zr!=null&&so.sort(function(Jo,Uo){return zr(cn[Jo],cn[Uo])}),In=0,Ci=Hi?(fi-gi*Xs)/Hi:0;In0?cs*Ci:0)+Xs,io[Ea]={data:cn[Ea],index:In,value:cs,startAngle:Mo,endAngle:ts,padAngle:Ho};return io}return jn.value=function(cn){return arguments.length?(At=typeof cn=="function"?cn:S(+cn),jn):At},jn.sortValues=function(cn){return arguments.length?(lr=cn,zr=null,jn):lr},jn.sort=function(cn){return arguments.length?(zr=cn,lr=null,jn):zr},jn.startAngle=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),jn):un},jn.endAngle=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),jn):Rn},jn.padAngle=function(cn){return arguments.length?(qn=typeof cn=="function"?cn:S(+cn),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,un=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(un())},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,un=d,Rn=y,qn=null;function jn(){var cn,In=le.call(arguments),gi=lr.apply(this,In),Ea=zr.apply(this,In);if(qn||(qn=cn=b.path()),At(qn,+un.apply(this,(In[0]=gi,In)),+Rn.apply(this,In),+un.apply(this,(In[0]=Ea,In)),+Rn.apply(this,In)),cn)return qn=null,cn+""||null}return jn.source=function(cn){return arguments.length?(lr=cn,jn):lr},jn.target=function(cn){return arguments.length?(zr=cn,jn):zr},jn.x=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),jn):un},jn.y=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),jn):Rn},jn.context=function(cn){return arguments.length?(qn=cn??null,jn):qn},jn}function ne(At,lr,zr,un,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr=(lr+un)/2,zr,lr,Rn,un,Rn)}function $(At,lr,zr,un,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr,zr=(zr+Rn)/2,un,zr,un,Rn)}function ue(At,lr,zr,un,Rn){var qn=fe(lr,zr),jn=fe(lr,zr=(zr+Rn)/2),cn=fe(un,zr),In=fe(un,Rn);At.moveTo(qn[0],qn[1]),At.bezierCurveTo(jn[0],jn[1],cn[0],cn[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),un=zr*Se;At.moveTo(0,-zr),At.lineTo(un,0),At.lineTo(0,zr),At.lineTo(-un,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),un=st*zr,Rn=ct*zr;At.moveTo(0,-zr),At.lineTo(un,Rn);for(var qn=1;qn<5;++qn){var jn=c*qn/5,cn=Math.cos(jn),In=Math.sin(jn);At.lineTo(In*zr,-cn*zr),At.lineTo(cn*un-In*Rn,In*un+cn*Rn)}At.closePath()}},et={draw:function(At,lr){var zr=Math.sqrt(lr),un=-zr/2;At.rect(un,un,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,lt=1/Math.sqrt(12),dt=(lt/2+1)*3,nt={draw:function(At,lr){var zr=Math.sqrt(lr/dt),un=zr/2,Rn=zr*lt,qn=un,jn=zr*lt+zr,cn=-qn,In=jn;At.moveTo(un,Rn),At.lineTo(qn,jn),At.lineTo(cn,In),At.lineTo(pe*un-Ne*Rn,Ne*un+pe*Rn),At.lineTo(pe*qn-Ne*jn,Ne*qn+pe*jn),At.lineTo(pe*cn-Ne*In,Ne*cn+pe*In),At.lineTo(pe*un+Ne*Rn,pe*Rn-Ne*un),At.lineTo(pe*qn+Ne*jn,pe*jn-Ne*qn),At.lineTo(pe*cn+Ne*In,pe*In-Ne*cn),At.closePath()}},Ft=[ie,de,Fe,et,at,Ae,nt];function Nt(){var At=S(ie),lr=S(64),zr=null;function un(){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 un.type=function(Rn){return arguments.length?(At=typeof Rn=="function"?Rn:S(Rn),un):At},un.size=function(Rn){return arguments.length?(lr=typeof Rn=="function"?Rn:S(+Rn),un):lr},un.context=function(Rn){return arguments.length?(zr=Rn??null,un):zr},un}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 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: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 Mr(At){return new Er(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 Nr(At){this._context=At}Nr.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,un=(this._y0+4*this._y1+lr)/6;this._line?this._context.lineTo(zr,un):this._context.moveTo(zr,un);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 Nr(At)}function je(At,lr){this._basis=new Er(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 un=At[0],Rn=lr[0],qn=At[zr]-un,jn=lr[zr]-Rn,cn=-1,In;++cn<=zr;)In=cn/zr,this._basis.point(this._beta*At[cn]+(1-this._beta)*(un+In*qn),this._beta*lr[cn]+(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(un){return lr===1?new Er(un):new je(un,lr)}return zr.beta=function(un){return At(+un)},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(un){return new xe(un,lr)}return zr.tension=function(un){return At(+un)},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(un){return new Ee(un,lr)}return zr.tension=function(un){return At(+un)},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(un){return new Qe(un,lr)}return zr.tension=function(un){return At(+un)},zr})(0);function Ct(At,lr,zr){var un=At._x1,Rn=At._y1,qn=At._x2,jn=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 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(un,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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+un*un,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(un){return lr?new Ot(un,lr):new xe(un,0)}return zr.alpha=function(un){return At(+un)},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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+un*un,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(un){return lr?new xr(un,lr):new Ee(un,0)}return zr.alpha=function(un){return At(+un)},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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+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,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 Br=(function At(lr){function zr(un){return lr?new vr(un,lr):new Qe(un,0)}return zr.alpha=function(un){return At(+un)},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 Wn(At){return new kn(At)}function Vn(At){return At<0?-1:1}function na(At,lr,zr){var un=At._x1-At._x0,Rn=lr-At._x1,qn=(At._y1-At._y0)/(un||Rn<0&&-0),jn=(zr-At._y1)/(Rn||un<0&&-0),cn=(qn*Rn+jn*un)/(un+Rn);return(Vn(qn)+Vn(jn))*Math.min(Math.abs(qn),Math.abs(jn),.5*Math.abs(cn))||0}function aa(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 un=At._x0,Rn=At._y0,qn=At._x1,jn=At._y1,cn=(qn-un)/3;At._context.bezierCurveTo(un+cn,Rn+cn*lr,qn-cn,jn-cn*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,aa(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,aa(this,zr=na(this,At,lr)),zr);break;default:Un(this,this._t0,zr=na(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,un,Rn,qn){this._context.bezierCurveTo(lr,At,un,zr,qn,Rn)}};function qt(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 un=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 Tn(At){return new mn(At,.5)}function Jn(At){return new mn(At,0)}function ma(At){return new mn(At,1)}function da(At,lr){if((jn=At.length)>1)for(var zr=1,un,Rn,qn=At[lr[0]],jn,cn=qn.length;zr=0;)zr[lr]=lr;return zr}function Ca(At,lr){return At[lr]}function Hn(){var At=S([]),lr=_a,zr=da,un=Ca;function Rn(qn){var jn=At.apply(this,arguments),cn,In=qn.length,gi=jn.length,Ea=new Array(gi),Ci;for(cn=0;cn0){for(var zr,un,Rn=0,qn=At[0].length,jn;Rn0)for(var zr,un=0,Rn,qn,jn,cn,In,gi=At[lr[0]].length;un0?(Rn[0]=jn,Rn[1]=jn+=qn):qn<0?(Rn[1]=cn,Rn[0]=cn+=qn):(Rn[0]=0,Rn[1]=qn)}function Dt(At,lr){if((Rn=At.length)>0){for(var zr=0,un=At[lr[0]],Rn,qn=un.length;zr0)||!((qn=(Rn=At[lr[0]]).length)>0))){for(var zr=0,un=1,Rn,qn,jn;unqn&&(qn=Rn,zr=lr);return zr}function Vr(At){var lr=At.map(Dr);return _a(At).sort(function(zr,un){return lr[zr]-lr[un]})}function Dr(At){for(var lr=0,zr=-1,un=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})})}}),K7=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"(K,G){var h=DL();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 Er(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 Mr(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)Br=vr.y1-vr.y0,vr.y0=ct/2-Br/2,vr.y1=ct/2+Br/2;else if(mr==Ot-1&&xr==1)Br=vr.y1-vr.y0,vr.y0=ct/2-Br/2,vr.y1=ct/2+Br/2;else{var kn=0,Wn=b.mean(vr.sourceLinks,g),Vn=b.mean(vr.targetLinks,l);Wn&&Vn?kn=(Wn+Vn)/2:kn=Wn||Vn;var na=(kn-T(vr))*Lt;vr.y0+=na,vr.y1+=na}})})}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 Nr(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,lt=pe.circularLinkType,dt=ze.links.filter(function(Nt){return Nt.source.column==Ne&&Nt.circularLinkType==lt});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==lt}),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 lt=Ae/(pe+1),dt=Math.pow(1-lt,3),nt=3*lt*Math.pow(1-lt,2),Ft=3*Math.pow(lt,2)*(1-lt),Nt=Math.pow(lt,3),Qt=dt*at.y0+nt*at.y0+Ft*at.y1+Nt*at.y1,ar=Qt-at.width/2,Er=Qt+at.width/2,Mr;ar>Ne.y0&&arNe.y0&&ErNe.y1&&H($r,Mr,Ye,st)})):arNe.y1&&(Mr=Er-Ne.y0+10,Ne=H(Ne,Mr,Ye,st),ze.nodes.forEach(function($r){w($r,ct)==w(Ne,ct)||$r.column!=Ne.column||$r.y0Ne.y1&&H($r,Mr,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 lt=$(Ne,pe);return pe.y1-lt}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 lt=Ne+1,dt=0;for(lt;lt1&&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,lt=st-Ye,dt=lt/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})})}}),OL=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"}}}}),Q7=Ge({"src/traces/sankey/render.js"(K,G){var h=Z7(),b=(ao(),ui(xi)).interpolateNumber,S=ki(),E=$7(),e=J7(),t=OL(),r=Is(),o=go(),n=As(),i=_n(),a=i.strTranslate,s=i.strRotate,f=Og(),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-Nr.y0,Mt>1e-6&&(Nr.y0+=Mt,Nr.y1+=Mt)),je=Nr.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}),Nr=[],Mt=-1,je,Je=-1/0,ke;for(Pe=0;PeJe+Se&&(Mt+=1,je=xe.x0),Je=xe.x0,Nr[Mt]||(Nr[Mt]=[]),Nr[Mt].push(xe),ke=je-xe.x0,xe.x0+=ke,xe.x1+=ke}return Nr}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}})}}}),e9=Ge({"src/traces/sankey/base_plot.js"(K){var G=Hc().overrideAll,h=Bd().getModuleCalcData,b=FL(),S=tc(),E=Np(),e=lv(),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,lt=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-lt-dt.bottom}else Ne=$.t+$.h/2-H/2-dt.bottom-lt;ee&&(Ne=de-(dt.top+dt.bottom)/2,pe=$.l-i.bulletPadding*$.w)}else Ne=fe._numbersTop-lt-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 lt=R.gauge.threshold.value;(lt||lt===0)&&et.push({range:[lt,lt],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 lt=te(R.number.valueformat,ct,N[0].lastY,N[0].y);return function(dt){pe.text(et+lt(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 lt(){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(){lt(),le&&le()}).each("interrupt",function(){lt(),le&&le()}):lt(),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}}}),l9=Ge({"src/traces/indicator/index.js"(K,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:a9(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:BL(),supplyDefaults:i9().supplyDefaults,calc:o9().calc,plot:s9(),meta:{}}}}),u9=Ge({"lib/indicator.js"(K,G){G.exports=l9()}}),UL=Ge({"src/traces/table/attributes.js"(K,G){var h=hm(),b=Ki().extendFlat,S=Hc().overrideAll,E=Ns(),e=kc().attributes,t=pc().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")}}),c9=Ge({"src/traces/table/defaults.js"(K,G){var h=_n(),b=UL(),S=kc().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"}}}}),h9=Ge({"src/traces/table/data_preparation_helper.js"(K,G){var h=jL(),b=Ki().extendFlat,S=Si(),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:[]}}}}),d9=Ge({"src/traces/table/data_split_helpers.js"(K){var G=Ki().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]}}}),qL=Ge({"src/traces/table/plot.js"(K,G){var h=jL(),b=ki(),S=_n(),E=S.numberFormat,e=Og(),t=As(),r=nc(),o=_n().raiseToTop,n=_n().strTranslate,i=_n().cancelTransition,a=h9(),s=d9(),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(Er){return(nt===Er?b.event.x:Er.x)+Er.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(Er){return Er.calcdata.key===nt.calcdata.key}),ar=Qt.sort(function(Er,Mr){return Nt(Er)-Nt(Mr)});ar.forEach(function(Er,Mr){Er.xIndex=Mr,Er.x=nt===Er?Er.x:Er.xScale(Er)}),ct.filter(function(Er){return nt!==Er}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(Er){return n(Er.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 lt=ct.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);lt.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),lt.attr("id",function(nt){return v(ie,nt)});var dt=lt.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,lt;Le.wrappingNeeded=!Le.wrapped&&!at&&!et&&(lt=L(Ne)),Le.cellHeightMayIncrease=ct||et||Le.mayHaveMarkup||(lt===void 0?L(Ne):lt),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,lt){Ye[lt].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(),lt=b.select(Ae.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),dt=Ae.transform.baseVal.consolidate(),nt=lt.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}}}}),T9=Ge({"src/traces/carpet/plot.js"(K,G){var h=ki(),b=As(),S=VL(),E=HL(),e=w9(),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()}}}),A9=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}))}}}}),E9=Ge({"src/traces/carpet/calc_labels.js"(K,G){var h=Ts(),b=Ki().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}}}),C9=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}}}),L9=Ge({"src/traces/carpet/constants.js"(K,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),P9=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)]]}}}),R9=Ge({"src/traces/carpet/compute_control_points.js"(K,G){var h=P9(),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}}}}),F9=Ge({"src/traces/carpet/calc.js"(K,G){var h=Ts(),b=_n().isArray1D,S=A9(),E=S9(),e=M9(),t=E9(),r=k9(),o=jx(),n=C9(),i=Ux(),a=O9();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]}}}),B9=Ge({"src/traces/carpet/index.js"(K,G){G.exports={attributes:JE(),supplyDefaults:b9(),plot:T9(),calc:F9(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:_h(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),N9=Ge({"lib/carpet.js"(K,G){G.exports=B9()}}),GL=Ge({"src/traces/scattercarpet/attributes.js"(K,G){var h=uv(),b=Gc(),S=Gl(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=zu(),o=Ki().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}}}),U9=Ge({"src/traces/scattercarpet/defaults.js"(K,G){var h=_n(),b=u0(),S=uu(),E=Kd(),e=Vp(),t=Jd(),r=op(),o=Nd(),n=GL();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}}}),G9=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}}}),X9=Ge({"src/traces/scattercarpet/index.js"(K,G){G.exports={attributes:GL(),supplyDefaults:U9(),colorbar:Zf(),formatLabels:j9(),calc:q9(),plot:V9(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:H9(),selectPoints:lg(),eventData:G9(),moduleType:"trace",name:"scattercarpet",basePlotModule:_h(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Y9=Ge({"lib/scattercarpet.js"(K,G){G.exports=X9()}}),XL=Ge({"src/traces/contourcarpet/attributes.js"(K,G){var h=bd(),b=W1(),S=zu(),E=Ki().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}))}}),YL=Ge({"src/traces/contourcarpet/defaults.js"(K,G){var h=_n(),b=bh(),S=XL(),E=B2(),e=tb(),t=$1();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")}}}),Z9=Ge({"src/traces/contourcarpet/calc.js"(K,G){var h=_d(),b=_n(),S=Ux(),E=jx(),e=qx(),t=Vx(),r=L2(),o=YL(),n=QE(),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]}}}),W9=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}}}),KL=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]),lt=ee.radius=ct/Fe,dt=ee.innerRadius=ee.getHole(V)*lt,nt=ee.cx=pe-lt*Le[0],Ft=ee.cy=Ne+lt*Le[3],Nt=ee.cxx=nt-pe,Qt=ee.cyy=Ft-Ne,ar=ue.side,Er;ar==="counterclockwise"?(Er=ar,ar="top"):ar==="clockwise"&&(Er=ar,ar="bottom"),ee.radialAxis=ee.mockAxis(ce,V,ue,{_id:"x",side:ar,_trueSide:Er,domain:[dt/$.w,lt/$.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 Mr=ee.pathSubplot();ee.clipPaths.forTraces.select("path").attr("d",Mr).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",Mr).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(lt){var dt=z(ee,y([lt.x,0]));return t(dt[0]-H,dt[1]-ae)}:function(lt){return t(Se.l2p(lt.x)+te,0)},Ye=Fe?function(lt){return L(ee,lt.x,-1/0,1/0)}:function(lt){return ee.pathArc(Se.r2p(lt.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(lt){return lt>=0}).map(function(lt){return i.tickText(Se,lt,!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,lt=(de.linewidth||1)/2;i.drawTicks(ne,de,{vals:Ae,layer:$["angular-axis"],path:"M"+Ne*lt+",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,lt=c.makeDragger($,"path","maindrag",ce.dragmode===!1?"none":"crosshair");h.select(lt).attr("d",V.pathSubplot()).attr("transform",t(de,Se)),lt.onmousemove=function(mr){v.hover(ne,mr,V.id),ne._fullLayout._lasthover=lt,ne._fullLayout._hoversubplot=V.id},lt.onmouseout=function(mr){ne._dragging||p.unhover(ne,mr)};var dt={element:lt,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,Er,Mr,$r,Sr;function Nr(mr,vr){return Math.sqrt(mr*mr+vr*vr)}function Mt(mr,vr){return Nr(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 Br=Ae/mr,kn=vr-Br,Wn=vr+Br,Vn=Math.max(0,Math.min(mr,ae)),na=Vn-Pe,aa=Vn+Pe;return"M"+Je(na,kn)+"A"+[na,na]+" 0,0,0 "+Je(na,Wn)+"L"+Je(aa,Wn)+"A"+[aa,aa]+" 0,0,1 "+Je(aa,kn)+"Z"}function xe(mr,vr,Br){if(mr===0)return V.pathSector(2*Pe);var kn=Je(mr,vr),Wn=Je(mr,Br),Vn=ct((kn[0]+Wn[0])/2),na=ct((kn[1]+Wn[1])/2),aa,Un;if(Vn&&na){var ka=na/Vn,Va=-1/ka,sr=at(Pe,ka,Vn,na);aa=at(Ae,Va,sr[0][0],sr[0][1]),Un=at(Ae,Va,sr[1][0],sr[1][1])}else{var qt,or;na?(qt=Ae,or=Pe):(qt=Pe,or=Ae),aa=[[Vn-qt,na-or],[Vn+qt,na-or]],Un=[[Vn-qt,na+or],[Vn+qt,na+or]]}return"M"+aa.join("L")+"L"+Un.reverse().join("L")+"Z"}function ye(){Nt=null,Qt=null,ar=V.pathSubplot(),Er=!1;var mr=ne._fullLayout[V.id];Mr=b(mr.bgcolor).getLuminance(),$r=c.makeZoombox(ue,Mr,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),Br.indexOf("event")>-1&&v.click(ne,vr,V.id)}dt.prepFn=function(mr,vr,Br){var kn=ne._fullLayout.dragmode,Wn=lt.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var Vn=ne._fullLayout._invTransform;pe=ne._fullLayout._invScaleX,Ne=ne._fullLayout._invScaleY;var na=E.apply3DTransform(Vn)(vr-Wn.left,Br-Wn.top);if(nt=na[0],Ft=na[1],Ye){var aa=u.findPolygonOffset(ae,ze[0],ze[1],Ye);nt+=Le+aa[0],Ft+=Fe+aa[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,Br,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}}}),r8=Ge({"src/plots/polar/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=kc().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"}}}),lO=Ge({"src/plots/polar/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=tg(),r=z0(),o=Op(),n=Pv(),i=zf(),a=Vu(),s=YT(),f=um(),c=r8(),p=QL(),v=t6(),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}}}),fO=Ge({"src/traces/scatterpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:n6(),categories:["polar","symbols","showLegend","scatter-like"],attributes:uS(),supplyDefaults:a6().supplyDefaults,colorbar:Zf(),formatLabels:i6(),calc:uO(),plot:cO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:o6().hoverPoints,selectPoints:lg(),meta:{}}}}),hO=Ge({"lib/scatterpolar.js"(K,G){G.exports=fO()}}),n8=Ge({"src/traces/scatterpolargl/attributes.js"(K,G){var h=uS(),{cliponaxis:b,hoveron:S}=h,E=eo(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=eS();G.exports=bo(Gi({},E),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),dO=Ge({"src/traces/scatterpolargl/defaults.js"(K,G){var h=_n(),b=uu(),S=a6().handleRThetaDefaults,E=Kd(),e=Vp(),t=op(),r=Nd(),o=u0().PTS_LINESONLY,n=n8();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}}),_O=Ge({"src/traces/scatterpolargl/index.js"(K,G){var h=gO();h.plot=yO(),G.exports=h}}),xO=Ge({"lib/scatterpolargl.js"(K,G){G.exports=_O()}}),a8=Ge({"src/traces/barpolar/attributes.js"(K,G){var{hovertemplateAttrs:h,templatefallbackAttrs:b}=Sl(),S=Ki().extendFlat,E=uS(),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}}}),i8=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"}}}}),bO=Ge({"src/traces/barpolar/defaults.js"(K,G){var h=_n(),b=a6().handleRThetaDefaults,S=h0(),E=a8();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)}}}),wO=Ge({"src/traces/barpolar/layout_defaults.js"(K,G){var h=_n(),b=i8();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)}}}}),AO=Ge({"src/traces/barpolar/hover.js"(K,G){var h=Yf(),b=_n(),S=Cc().getTraceColor,E=b.fillText,e=o6().makeHoverPointText,t=r6().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]}}}}),SO=Ge({"src/traces/barpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:n6(),categories:["polar","bar","showLegend"],attributes:a8(),layoutAttributes:i8(),supplyDefaults:bO(),supplyLayoutDefaults:wO(),calc:o8().calc,crossTraceCalc:o8().crossTraceCalc,plot:TO(),colorbar:Zf(),formatLabels:i6(),style:xd().style,styleOnSelect:xd().styleOnSelect,hoverPoints:AO(),selectPoints:wm(),meta:{}}}}),MO=Ge({"lib/barpolar.js"(K,G){G.exports=SO()}}),s8=Ge({"src/plots/smith/constants.js"(K,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),l8=Ge({"src/plots/smith/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=kc().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"}}}),EO=Ge({"src/plots/smith/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=Pv(),r=Op(),o=Vu(),n=rp(),i=l8(),a=s8(),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}}}),DO=Ge({"src/traces/scattersmith/index.js"(K,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:kO(),categories:["smith","symbols","showLegend","scatter-like"],attributes:u8(),supplyDefaults:CO(),colorbar:Zf(),formatLabels:LO(),calc:PO(),plot:RO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:IO().hoverPoints,selectPoints:lg(),meta:{}}}}),zO=Ge({"lib/scattersmith.js"(K,G){G.exports=DO()}}),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}}),OO=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}})}}),FO=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}}}),BO=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}}),NO=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}}),UO=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}}),jO=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}}),qO=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}}),VO=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}}),HO=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}}),GO=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}}),XO=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}}),YO=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}}),ZO=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}}),WO=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}}),$O=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]}}),KO=Ge({"src/components/calendars/calendars.js"(K,G){G.exports=Vv(),OO(),FO(),BO(),NO(),UO(),jO(),qO(),VO(),HO(),GO(),XO(),YO(),ZO(),WO(),$O()}}),JO=Ge({"src/components/calendars/index.js"(K,G){var h=KO(),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({x:ot.path.map((ut,Xt)=>Xt),y:ot.path.map(ut=>ut.value),type:"scatter",mode:"lines+markers",name:ot.label,line:{color:ot.color,width:2},marker:{color:ot.color,size:4},hovertemplate:"iteration %{x}
f = %{y:.4g}"}));return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("span",{className:"text-sm text-gray-700",children:"f at each iteration"}),ra.jsx("div",{className:"h-40",children:ra.jsx(Ek,{data:Ke,layout:{showlegend:!1,margin:{t:8,r:8,b:32,l:48},font:{size:11},xaxis:{title:{text:"iteration",standoff:4},rangemode:"tozero"},yaxis:{automargin:!0}},config:{displayModeBar:!1,responsive:!0},style:{width:"100%",height:"100%"}})})]})}const r4={scrollZoom:!0,displayModeBar:!0,doubleClick:!1,responsive:!0},n4={x:.02,y:.98,xanchor:"left",yanchor:"top",bgcolor:"rgba(255,255,255,0.8)"},HB="#1B2A4A";function GB({values:we,trajectories:Ke,xRange:ot,yRange:ut,onViewChange:Xt,onClick:$t,surface:cr,arrows:kr}){const tn=ru.useRef(null),[Ur,yn]=ru.useState(void 0),[Mn,ea]=ru.useState(null);xB(()=>tn.current?.el,cr?null:$t);const Bn=we!==null&&"y"in we,Gi=Ke.length>1;if(Bn&&cr){const li=[YB(we),...Ke.flatMap(wo=>a4(wo,!0))],Ge={uirevision:"surface",showlegend:Gi,legend:n4,margin:{t:20,r:20,b:20,l:20},scene:{camera:Ur,aspectmode:"cube",xaxis:{title:{text:"x"},range:[...ot.current]},yaxis:{title:{text:"y"},range:[...ut.current]},zaxis:{title:{text:"f(x, y)"}}}};return ra.jsx("div",{className:"flex-1 min-h-[320px]",onPointerDown:()=>{ea({data:li,layout:Ge}),window.addEventListener("pointerup",()=>setTimeout(()=>ea(null),50),{once:!0})},children:ra.jsx(Ek,{data:Mn?.data??li,layout:Mn?.layout??Ge,onRelayout:wo=>{const vl=wo["scene.camera"];vl&&yn(vl)},config:r4,style:{width:"100%",height:"100%"}},"surface")})}const bo=[];we&&"y"in we?(bo.push(XB(we)),kr&&bo.push(...ZB(we,ot.current,ut.current))):we&&bo.push({x:we.x,y:we.f,type:"scatter",mode:"lines",line:{color:HB,width:2},name:"f(x)",showlegend:!1,hovertemplate:"x = %{x:.4g}
f(x) = %{y:.4g}"}),bo.push(...Ke.flatMap(li=>a4(li,!1,Bn)));const eo={dragmode:"pan",uirevision:"view",showlegend:Gi,legend:n4,margin:{t:40,r:40,b:40,l:40},xaxis:{title:{text:"x"},range:[...ot.current]},yaxis:{title:{text:Bn?"y":"f(x)"},range:[...ut.current]}};return ra.jsx("div",{className:"flex-1 min-h-[320px]",children:ra.jsx(Ek,{ref:tn,data:bo,layout:eo,onRelayout:li=>{const Ge=tn.current?.el?._fullLayout,wo=Ge?.xaxis?.range??[li["xaxis.range[0]"],li["xaxis.range[1]"]],vl=Ge?.yaxis?.range??[li["yaxis.range[0]"],li["yaxis.range[1]"]];(wo[0]!==ot.current[0]||wo[1]!==ot.current[1]||vl[0]!==ut.current[0]||vl[1]!==ut.current[1])&&wo.every(Number.isFinite)&&vl.every(Number.isFinite)&&Xt([wo[0],wo[1]],[vl[0],vl[1]])},config:r4,style:{width:"100%",height:"100%",minWidth:0}},"flat")})}function XB(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 YB(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 a4(we,Ke,ot=!0){const ut=we.path.map(tn=>tn.position[0]),Xt=ot?we.path.map(tn=>tn.position[1]):we.path.map(tn=>tn.value),$t=we.path.map(tn=>tn.value),cr=ot?"x = %{x:.4g}, y = %{y:.4g}
f = %{customdata:.4g}%{fullData.name}":"x = %{x:.4g}
f(x) = %{y:.4g}%{fullData.name}",kr=we.path.length-1;return Ke?[{x:ut,y:Xt,z:$t,type:"scatter3d",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:we.color,width:5},marker:{color:we.color,size:2.5},hoverinfo:"skip"},{x:ut.slice(kr),y:Xt.slice(kr),z:$t.slice(kr),type:"scatter3d",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:we.color,size:6,line:{color:"white",width:1}},hoverinfo:"skip"}]:[{x:ut,y:Xt,customdata:$t,type:"scatter",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:we.color,width:2},marker:{color:we.color,size:7},hovertemplate:cr},{x:ut.slice(kr),y:Xt.slice(kr),customdata:$t.slice(kr),type:"scatter",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:we.color,size:14,line:{color:"white",width:2}},hovertemplate:cr}]}function ZB({arrows:we},[Ke,ot],[ut,Xt]){const $t=Math.sqrt(we.x.length),cr=we.u.map((eo,li)=>Math.hypot((eo??NaN)/(ot-Ke),(we.v[li]??NaN)/(Xt-ut))),kr=cr.filter(eo=>Number.isFinite(eo)&&eo>0).sort((eo,li)=>eo-li),tn=kr[Math.floor(.9*(kr.length-1))]??1,Ur=[],yn=[],Mn=[],ea=[],Bn=[],Gi=[];we.x.forEach((eo,li)=>{const Ge=we.u[li],wo=we.v[li];if(Ge===null||wo===null||!(cr[li]>0))return;const vl=.9*Math.min(1,cr[li]/tn)/(cr[li]*$t),Eo=Ge*vl,ui=wo*vl,mo=we.y[li];Ur.push(eo,eo+Eo,null),yn.push(mo,mo+ui,null),Mn.push(eo+Eo),ea.push(mo+ui),Bn.push(Math.atan2(Eo/(ot-Ke),ui/(Xt-ut))*180/Math.PI),Gi.push([eo,mo,Ge,wo])});const bo="rgba(255, 255, 255, 0.85)";return[{x:Ur,y:yn,type:"scatter",mode:"lines",line:{color:bo,width:1},hoverinfo:"skip",showlegend:!1},{x:Mn,y:ea,customdata:Gi,type:"scatter",mode:"markers",showlegend:!1,marker:{symbol:"triangle-up",size:6,color:bo,angle:Bn,angleref:"up"},hovertemplate:"x = %{customdata[0]:.3g}, y = %{customdata[1]:.3g}
∇f = (%{customdata[2]:.3g}, %{customdata[3]:.3g})"}]}const WB="text-sm text-ink-muted";function pP({editor:we,twoVariables:Ke,onResetStart:ot,onRandomStart:ut,hint:Xt}){const $t=dM(we.algorithm),[cr,kr]=ru.useState(!1),tn=ru.useId(),Ur=$t.params.length>0,yn=Object.keys(we.params).length>0;function Mn(Bn,Gi){we.changeParams({...we.params,[Bn]:Gi})}function ea(Bn){we.changeParams(Object.fromEntries(Object.entries(we.params).filter(([Gi])=>Gi!==Bn)))}return ra.jsxs(ra.Fragment,{children:[ra.jsxs("div",{className:"flex items-center gap-2",children:[ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(uP,{label:"Algorithm",hideLabel:!0,options:hM.map(Bn=>Bn.label),activeOption:$t.label,onChange:Bn=>we.changeAlgorithm(hM.find(Gi=>Gi.label===Bn).id)})}),ra.jsx(PT,{label:`About the ${$t.label} settings`,onClick:()=>kr(!0),disabled:!Ur,children:ra.jsx(sB,{size:16})}),ra.jsx(PT,{label:"Reset the settings to their defaults",onClick:()=>we.changeParams({}),disabled:!yn,children:ra.jsx(cM,{size:16})})]}),ra.jsx(kB,{model:$t,values:we.params,onChange:we.changeParams,inline:!0}),ra.jsx(Uk,{title:`${$t.label} settings`,open:cr,onClose:()=>kr(!1),wide:!0,children:ra.jsx(dP,{model:$t,values:we.params,onChange:Mn,onResetOne:ea,onReset:()=>we.changeParams({})})}),ra.jsxs("div",{className:"flex flex-col gap-2",children:[ra.jsxs("div",{role:"group","aria-labelledby":`${tn}-initial`,className:"flex flex-col gap-1",children:[ra.jsx("span",{id:`${tn}-initial`,className:"text-sm text-gray-700",children:"Initial point"}),ra.jsxs("div",{className:"flex items-center gap-2",children:[ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(wk,{label:"Initial x",hideLabel:!0,prefix:Ke?"x":void 0,value:we.startText[0],onChange:Bn=>we.changeStart(0,Bn),mono:!0})}),Ke&&ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(wk,{label:"Initial y",hideLabel:!0,prefix:"y",value:we.startText[1],onChange:Bn=>we.changeStart(1,Bn),mono:!0})}),ra.jsx(PT,{label:"Random initial point",onClick:ut,children:ra.jsx(iB,{size:16})}),ra.jsx(PT,{label:"Reset the initial point",onClick:ot,children:ra.jsx(cM,{size:16})})]})]}),!we.startValid&&ra.jsx("p",{className:"text-red-600 font-semibold",children:"The initial point must be numbers."}),Xt&&ra.jsx("p",{className:WB,children:Xt})]})]})}function $B(we,Ke){const ot={};return(we[we.length-1]===""?[...we,""]:we).join((ot.padRight?" ":"")+","+(ot.padLeft===!1?"":" ")).trim()}const KB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QB={};function i4(we,Ke){return(QB.jsx?JB:KB).test(we)}const eN=/[ \t\n\f\r]/g;function tN(we){return typeof we=="object"?we.type==="text"?o4(we.value):!1:o4(we)}function o4(we){return we.replace(eN,"")===""}class OT{constructor(Ke,ot,ut){this.normal=ot,this.property=Ke,ut&&(this.space=ut)}}OT.prototype.normal={};OT.prototype.property={};OT.prototype.space=void 0;function mP(we,Ke){const ot={},ut={};for(const Xt of we)Object.assign(ot,Xt.property),Object.assign(ut,Xt.normal);return new OT(ot,ut,Ke)}function kk(we){return we.toLowerCase()}class Ip{constructor(Ke,ot){this.attribute=ot,this.property=Ke}}Ip.prototype.attribute="";Ip.prototype.booleanish=!1;Ip.prototype.boolean=!1;Ip.prototype.commaOrSpaceSeparated=!1;Ip.prototype.commaSeparated=!1;Ip.prototype.defined=!1;Ip.prototype.mustUseProperty=!1;Ip.prototype.number=!1;Ip.prototype.overloadedBoolean=!1;Ip.prototype.property="";Ip.prototype.spaceSeparated=!1;Ip.prototype.space=void 0;let rN=0;const qu=nx(),Zd=nx(),Ck=nx(),Vo=nx(),mh=nx(),zw=nx(),o0=nx();function nx(){return 2**++rN}const Lk=Object.freeze(Object.defineProperty({__proto__:null,boolean:qu,booleanish:Zd,commaOrSpaceSeparated:o0,commaSeparated:zw,number:Vo,overloadedBoolean:Ck,spaceSeparated:mh},Symbol.toStringTag,{value:"Module"})),ok=Object.keys(Lk);class Vk extends Ip{constructor(Ke,ot,ut,Xt){let $t=-1;if(super(Ke,ot),s4(this,"space",Xt),typeof ut=="number")for(;++$t4&&ot.slice(0,4)==="data"&&sN.test(Ke)){if(Ke.charAt(4)==="-"){const $t=Ke.slice(5).replace(l4,cN);ut="data"+$t.charAt(0).toUpperCase()+$t.slice(1)}else{const $t=Ke.slice(4);if(!l4.test($t)){let cr=$t.replace(oN,uN);cr.charAt(0)!=="-"&&(cr="-"+cr),Ke="data"+cr}}Xt=Vk}return new Xt(ut,Ke)}function uN(we){return"-"+we.toLowerCase()}function cN(we){return we.charAt(1).toUpperCase()}const fN=mP([gP,nN,xP,bP,wP],"html"),Hk=mP([gP,aN,xP,bP,wP],"svg");function hN(we){return we.join(" ").trim()}var Rw={},sk,u4;function dN(){if(u4)return sk;u4=1;var we=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ke=/\n/g,ot=/^\s*/,ut=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xt=/^:\s*/,$t=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,cr=/^[;\s]*/,kr=/^\s+|\s+$/g,tn=` +`,Ur="/",yn="*",Mn="",ea="comment",Bn="declaration";function Gi(eo,li){if(typeof eo!="string")throw new TypeError("First argument must be a string");if(!eo)return[];li=li||{};var Ge=1,wo=1;function vl(Si){var Ii=Si.match(Ke);Ii&&(Ge+=Ii.length);var Ti=Si.lastIndexOf(tn);wo=~Ti?Si.length-Ti:wo+Si.length}function Eo(){var Si={line:Ge,column:wo};return function(Ii){return Ii.position=new ui(Si),ki(),Ii}}function ui(Si){this.start=Si,this.end={line:Ge,column:wo},this.source=li.source}ui.prototype.content=eo;function mo(Si){var Ii=new Error(li.source+":"+Ge+":"+wo+": "+Si);if(Ii.reason=Si,Ii.filename=li.source,Ii.line=Ge,Ii.column=wo,Ii.source=eo,!li.silent)throw Ii}function Rs(Si){var Ii=Si.exec(eo);if(Ii){var Ti=Ii[0];return vl(Ti),eo=eo.slice(Ti.length),Ii}}function ki(){Rs(ot)}function $s(Si){var Ii;for(Si=Si||[];Ii=Di();)Ii!==!1&&Si.push(Ii);return Si}function Di(){var Si=Eo();if(!(Ur!=eo.charAt(0)||yn!=eo.charAt(1))){for(var Ii=2;Mn!=eo.charAt(Ii)&&(yn!=eo.charAt(Ii)||Ur!=eo.charAt(Ii+1));)++Ii;if(Ii+=2,Mn===eo.charAt(Ii-1))return mo("End of comment missing");var Ti=eo.slice(2,Ii-2);return wo+=2,vl(Ti),eo=eo.slice(Ii),wo+=2,Si({type:ea,comment:Ti})}}function zo(){var Si=Eo(),Ii=Rs(ut);if(Ii){if(Di(),!Rs(Xt))return mo("property missing ':'");var Ti=Rs($t),So=Si({type:Bn,property:bo(Ii[0].replace(we,Mn)),value:Ti?bo(Ti[0].replace(we,Mn)):Mn});return Rs(cr),So}}function Nl(){var Si=[];$s(Si);for(var Ii;Ii=zo();)Ii!==!1&&(Si.push(Ii),$s(Si));return Si}return ki(),Nl()}function bo(eo){return eo?eo.replace(kr,Mn):Mn}return sk=Gi,sk}var c4;function vN(){if(c4)return Rw;c4=1;var we=Rw&&Rw.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(Rw,"__esModule",{value:!0}),Rw.default=ot;const Ke=we(dN());function ot(ut,Xt){let $t=null;if(!ut||typeof ut!="string")return $t;const cr=(0,Ke.default)(ut),kr=typeof Xt=="function";return cr.forEach(tn=>{if(tn.type!=="declaration")return;const{property:Ur,value:yn}=tn;kr?Xt(Ur,yn,tn):yn&&($t=$t||{},$t[Ur]=yn)}),$t}return Rw}var MT={},f4;function pN(){if(f4)return MT;f4=1,Object.defineProperty(MT,"__esModule",{value:!0}),MT.camelCase=void 0;var we=/^--[a-zA-Z0-9_-]+$/,Ke=/-([a-z])/g,ot=/^[^-]+$/,ut=/^-(webkit|moz|ms|o|khtml)-/,Xt=/^-(ms)-/,$t=function(Ur){return!Ur||ot.test(Ur)||we.test(Ur)},cr=function(Ur,yn){return yn.toUpperCase()},kr=function(Ur,yn){return"".concat(yn,"-")},tn=function(Ur,yn){return yn===void 0&&(yn={}),$t(Ur)?Ur:(Ur=Ur.toLowerCase(),yn.reactCompat?Ur=Ur.replace(Xt,kr):Ur=Ur.replace(ut,kr),Ur.replace(Ke,cr))};return MT.camelCase=tn,MT}var ET,h4;function mN(){if(h4)return ET;h4=1;var we=ET&&ET.__importDefault||function(Xt){return Xt&&Xt.__esModule?Xt:{default:Xt}},Ke=we(vN()),ot=pN();function ut(Xt,$t){var cr={};return!Xt||typeof Xt!="string"||(0,Ke.default)(Xt,function(kr,tn){kr&&tn&&(cr[(0,ot.camelCase)(kr,$t)]=tn)}),cr}return ut.default=ut,ET=ut,ET}var gN=mN();const yN=Nk(gN),TP=AP("end"),Gk=AP("start");function AP(we){return Ke;function Ke(ot){const ut=ot&&ot.position&&ot.position[we]||{};if(typeof ut.line=="number"&&ut.line>0&&typeof ut.column=="number"&&ut.column>0)return{line:ut.line,column:ut.column,offset:typeof ut.offset=="number"&&ut.offset>-1?ut.offset:void 0}}}function _N(we){const Ke=Gk(we),ot=TP(we);if(Ke&&ot)return{start:Ke,end:ot}}function RT(we){return!we||typeof we!="object"?"":"position"in we||"type"in we?d4(we.position):"start"in we||"end"in we?d4(we):"line"in we||"column"in we?Pk(we):""}function Pk(we){return v4(we&&we.line)+":"+v4(we&&we.column)}function d4(we){return Pk(we&&we.start)+"-"+Pk(we&&we.end)}function v4(we){return we&&typeof we=="number"?we:1}class ep extends Error{constructor(Ke,ot,ut){super(),typeof ot=="string"&&(ut=ot,ot=void 0);let Xt="",$t={},cr=!1;if(ot&&("line"in ot&&"column"in ot?$t={place:ot}:"start"in ot&&"end"in ot?$t={place:ot}:"type"in ot?$t={ancestors:[ot],place:ot.position}:$t={...ot}),typeof Ke=="string"?Xt=Ke:!$t.cause&&Ke&&(cr=!0,Xt=Ke.message,$t.cause=Ke),!$t.ruleId&&!$t.source&&typeof ut=="string"){const tn=ut.indexOf(":");tn===-1?$t.ruleId=ut:($t.source=ut.slice(0,tn),$t.ruleId=ut.slice(tn+1))}if(!$t.place&&$t.ancestors&&$t.ancestors){const tn=$t.ancestors[$t.ancestors.length-1];tn&&($t.place=tn.position)}const kr=$t.place&&"start"in $t.place?$t.place.start:$t.place;this.ancestors=$t.ancestors||void 0,this.cause=$t.cause||void 0,this.column=kr?kr.column:void 0,this.fatal=void 0,this.file="",this.message=Xt,this.line=kr?kr.line:void 0,this.name=RT($t.place)||"1:1",this.place=$t.place||void 0,this.reason=this.message,this.ruleId=$t.ruleId||void 0,this.source=$t.source||void 0,this.stack=cr&&$t.cause&&typeof $t.cause.stack=="string"?$t.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 Xk={}.hasOwnProperty,xN=new Map,bN=/[A-Z]/g,wN=new Set(["table","tbody","thead","tfoot","tr"]),TN=new Set(["td","th"]),SP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AN(we,Ke){if(!Ke||Ke.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const ot=Ke.filePath||void 0;let ut;if(Ke.development){if(typeof Ke.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");ut=RN(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");ut=PN(ot,Ke.jsx,Ke.jsxs)}const Xt={Fragment:Ke.Fragment,ancestors:[],components:Ke.components||{},create:ut,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"?Hk:fN,stylePropertyNameCase:Ke.stylePropertyNameCase||"dom",tableCellAlignToStyle:Ke.tableCellAlignToStyle!==!1},$t=MP(Xt,we,void 0);return $t&&typeof $t!="string"?$t:Xt.create(we,Xt.Fragment,{children:$t||void 0},void 0)}function MP(we,Ke,ot){if(Ke.type==="element")return SN(we,Ke,ot);if(Ke.type==="mdxFlowExpression"||Ke.type==="mdxTextExpression")return MN(we,Ke);if(Ke.type==="mdxJsxFlowElement"||Ke.type==="mdxJsxTextElement")return kN(we,Ke,ot);if(Ke.type==="mdxjsEsm")return EN(we,Ke);if(Ke.type==="root")return CN(we,Ke,ot);if(Ke.type==="text")return LN(we,Ke)}function SN(we,Ke,ot){const ut=we.schema;let Xt=ut;Ke.tagName.toLowerCase()==="svg"&&ut.space==="html"&&(Xt=Hk,we.schema=Xt),we.ancestors.push(Ke);const $t=kP(we,Ke.tagName,!1),cr=IN(we,Ke);let kr=Zk(we,Ke);return wN.has(Ke.tagName)&&(kr=kr.filter(function(tn){return typeof tn=="string"?!tN(tn):!0})),EP(we,cr,$t,Ke),Yk(cr,kr),we.ancestors.pop(),we.schema=ut,we.create(Ke,$t,cr,ot)}function MN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater){const ut=Ke.data.estree.body[0];return ut.type,we.evaluater.evaluateExpression(ut.expression)}zT(we,Ke.position)}function EN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater)return we.evaluater.evaluateProgram(Ke.data.estree);zT(we,Ke.position)}function kN(we,Ke,ot){const ut=we.schema;let Xt=ut;Ke.name==="svg"&&ut.space==="html"&&(Xt=Hk,we.schema=Xt),we.ancestors.push(Ke);const $t=Ke.name===null?we.Fragment:kP(we,Ke.name,!0),cr=DN(we,Ke),kr=Zk(we,Ke);return EP(we,cr,$t,Ke),Yk(cr,kr),we.ancestors.pop(),we.schema=ut,we.create(Ke,$t,cr,ot)}function CN(we,Ke,ot){const ut={};return Yk(ut,Zk(we,Ke)),we.create(Ke,we.Fragment,ut,ot)}function LN(we,Ke){return Ke.value}function EP(we,Ke,ot,ut){typeof ot!="string"&&ot!==we.Fragment&&we.passNode&&(Ke.node=ut)}function Yk(we,Ke){if(Ke.length>0){const ot=Ke.length>1?Ke:Ke[0];ot&&(we.children=ot)}}function PN(we,Ke,ot){return ut;function ut(Xt,$t,cr,kr){const Ur=Array.isArray(cr.children)?ot:Ke;return kr?Ur($t,cr,kr):Ur($t,cr)}}function RN(we,Ke){return ot;function ot(ut,Xt,$t,cr){const kr=Array.isArray($t.children),tn=Gk(ut);return Ke(Xt,$t,cr,kr,{columnNumber:tn?tn.column-1:void 0,fileName:we,lineNumber:tn?tn.line:void 0},void 0)}}function IN(we,Ke){const ot={};let ut,Xt;for(Xt in Ke.properties)if(Xt!=="children"&&Xk.call(Ke.properties,Xt)){const $t=zN(we,Xt,Ke.properties[Xt]);if($t){const[cr,kr]=$t;we.tableCellAlignToStyle&&cr==="align"&&typeof kr=="string"&&TN.has(Ke.tagName)?ut=kr:ot[cr]=kr}}if(ut){const $t=ot.style||(ot.style={});$t[we.stylePropertyNameCase==="css"?"text-align":"textAlign"]=ut}return ot}function DN(we,Ke){const ot={};for(const ut of Ke.attributes)if(ut.type==="mdxJsxExpressionAttribute")if(ut.data&&ut.data.estree&&we.evaluater){const $t=ut.data.estree.body[0];$t.type;const cr=$t.expression;cr.type;const kr=cr.properties[0];kr.type,Object.assign(ot,we.evaluater.evaluateExpression(kr.argument))}else zT(we,Ke.position);else{const Xt=ut.name;let $t;if(ut.value&&typeof ut.value=="object")if(ut.value.data&&ut.value.data.estree&&we.evaluater){const kr=ut.value.data.estree.body[0];kr.type,$t=we.evaluater.evaluateExpression(kr.expression)}else zT(we,Ke.position);else $t=ut.value===null?!0:ut.value;ot[Xt]=$t}return ot}function Zk(we,Ke){const ot=[];let ut=-1;const Xt=we.passKeys?new Map:xN;for(;++utXt?0:Xt+Ke:Ke=Ke>Xt?Xt:Ke,ot=ot>0?ot:0,ut.length<1e4)cr=Array.from(ut),cr.unshift(Ke,ot),we.splice(...cr);else for(ot&&we.splice(Ke,ot);$t0?(Jm(we,we.length,0,Ke),we):Ke}const g4={}.hasOwnProperty;function VN(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 Km=x1(/[A-Za-z]/),s0=x1(/[\dA-Za-z]/),XN=x1(/[#-'*+\--9=?A-Z^-~]/);function Rk(we){return we!==null&&(we<32||we===127)}const Ik=x1(/\d/),YN=x1(/[\dA-Fa-f]/),ZN=x1(/[!-/:-@[-`{-~]/);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 WN=x1(new RegExp("\\p{P}|\\p{S}","u")),$N=x1(/\s/);function x1(we){return Ke;function Ke(ot){return ot!==null&&ot>-1&&we.test(String.fromCharCode(ot))}}function Nw(we){const Ke=[];let ot=-1,ut=0,Xt=0;for(;++ot55295&&$t<57344){const kr=we.charCodeAt(ot+1);$t<56320&&kr>56319&&kr<57344?(cr=String.fromCharCode($t,kr),Xt=1):cr="�"}else cr=String.fromCharCode($t);cr&&(Ke.push(we.slice(ut,ot),encodeURIComponent(cr)),ut=ot+Xt+1,cr=""),Xt&&(ot+=Xt,Xt=0)}return Ke.join("")+we.slice(ut)}function gh(we,Ke,ot,ut){const Xt=ut?ut-1:Number.POSITIVE_INFINITY;let $t=0;return cr;function cr(tn){return Af(tn)?(we.enter(ot),kr(tn)):Ke(tn)}function kr(tn){return Af(tn)&&$t++cr))return;const mo=Ke.events.length;let Rs=mo,ki,$s;for(;Rs--;)if(Ke.events[Rs][0]==="exit"&&Ke.events[Rs][1].type==="chunkFlow"){if(ki){$s=Ke.events[Rs][1].end;break}ki=!0}for(li(ut),ui=mo;uiwo;){const Eo=ot[vl];Ke.containerState=Eo[1],Eo[0].exit.call(Ke,we)}ot.length=wo}function Ge(){Xt.write([null]),$t=void 0,Xt=void 0,Ke.containerState._closeFlow=void 0}}function tU(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 _4(we){if(we===null||Rp(we)||$N(we))return 1;if(WN(we))return 2}function $k(we,Ke,ot){const ut=[];let Xt=-1;for(;++Xt1&&we[ot][1].end.offset-we[ot][1].start.offset>1?2:1;const Mn={...we[ut][1].end},ea={...we[ot][1].start};x4(Mn,-tn),x4(ea,tn),cr={type:tn>1?"strongSequence":"emphasisSequence",start:Mn,end:{...we[ut][1].end}},kr={type:tn>1?"strongSequence":"emphasisSequence",start:{...we[ot][1].start},end:ea},$t={type:tn>1?"strongText":"emphasisText",start:{...we[ut][1].end},end:{...we[ot][1].start}},Xt={type:tn>1?"strong":"emphasis",start:{...cr.start},end:{...kr.end}},we[ut][1].end={...cr.start},we[ot][1].start={...kr.end},Ur=[],we[ut][1].end.offset-we[ut][1].start.offset&&(Ur=E0(Ur,[["enter",we[ut][1],Ke],["exit",we[ut][1],Ke]])),Ur=E0(Ur,[["enter",Xt,Ke],["enter",cr,Ke],["exit",cr,Ke],["enter",$t,Ke]]),Ur=E0(Ur,$k(Ke.parser.constructs.insideSpan.null,we.slice(ut+1,ot),Ke)),Ur=E0(Ur,[["exit",$t,Ke],["enter",kr,Ke],["exit",kr,Ke],["exit",Xt,Ke]]),we[ot][1].end.offset-we[ot][1].start.offset?(yn=2,Ur=E0(Ur,[["enter",we[ot][1],Ke],["exit",we[ot][1],Ke]])):yn=0,Jm(we,ut-1,ot-ut+3,Ur),ot=ut+Ur.length-yn-2;break}}for(ot=-1;++ot0&&Af(ui)?gh(we,Ge,"linePrefix",$t+1)(ui):Ge(ui)}function Ge(ui){return ui===null||yu(ui)?we.check(b4,bo,vl)(ui):(we.enter("codeFlowValue"),wo(ui))}function wo(ui){return ui===null||yu(ui)?(we.exit("codeFlowValue"),Ge(ui)):(we.consume(ui),wo)}function vl(ui){return we.exit("codeFenced"),Ke(ui)}function Eo(ui,mo,Rs){let ki=0;return $s;function $s(Ii){return ui.enter("lineEnding"),ui.consume(Ii),ui.exit("lineEnding"),Di}function Di(Ii){return ui.enter("codeFencedFence"),Af(Ii)?gh(ui,zo,"linePrefix",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ii):zo(Ii)}function zo(Ii){return Ii===kr?(ui.enter("codeFencedFenceSequence"),Nl(Ii)):Rs(Ii)}function Nl(Ii){return Ii===kr?(ki++,ui.consume(Ii),Nl):ki>=cr?(ui.exit("codeFencedFenceSequence"),Af(Ii)?gh(ui,Si,"whitespace")(Ii):Si(Ii)):Rs(Ii)}function Si(Ii){return Ii===null||yu(Ii)?(ui.exit("codeFencedFence"),mo(Ii)):Rs(Ii)}}}function dU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return cr===null?ot(cr):(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),$t)}function $t(cr){return ut.parser.lazy[ut.now().line]?ot(cr):Ke(cr)}}const uk={name:"codeIndented",tokenize:pU},vU={partial:!0,tokenize:mU};function pU(we,Ke,ot){const ut=this;return Xt;function Xt(Ur){return we.enter("codeIndented"),gh(we,$t,"linePrefix",5)(Ur)}function $t(Ur){const yn=ut.events[ut.events.length-1];return yn&&yn[1].type==="linePrefix"&&yn[2].sliceSerialize(yn[1],!0).length>=4?cr(Ur):ot(Ur)}function cr(Ur){return Ur===null?tn(Ur):yu(Ur)?we.attempt(vU,cr,tn)(Ur):(we.enter("codeFlowValue"),kr(Ur))}function kr(Ur){return Ur===null||yu(Ur)?(we.exit("codeFlowValue"),cr(Ur)):(we.consume(Ur),kr)}function tn(Ur){return we.exit("codeIndented"),Ke(Ur)}}function mU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return ut.parser.lazy[ut.now().line]?ot(cr):yu(cr)?(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),Xt):gh(we,$t,"linePrefix",5)(cr)}function $t(cr){const kr=ut.events[ut.events.length-1];return kr&&kr[1].type==="linePrefix"&&kr[2].sliceSerialize(kr[1],!0).length>=4?Ke(cr):yu(cr)?Xt(cr):ot(cr)}}const gU={name:"codeText",previous:_U,resolve:yU,tokenize:xU};function yU(we){let Ke=we.length-4,ot=3,ut,Xt;if((we[ot][1].type==="lineEnding"||we[ot][1].type==="space")&&(we[Ke][1].type==="lineEnding"||we[Ke][1].type==="space")){for(ut=ot;++ut=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-ut+this.left.length,this.right.length-Ke+this.left.length).reverse():this.left.slice(Ke).concat(this.right.slice(this.right.length-ut+this.left.length).reverse())}splice(Ke,ot,ut){const Xt=ot||0;this.setCursor(Math.trunc(Ke));const $t=this.right.splice(this.right.length-Xt,Number.POSITIVE_INFINITY);return ut&&kT(this.left,ut),$t.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(cr):we.interrupt(ut.parser.constructs.flow,ot,Ke)(cr)}}function zP(we,Ke,ot,ut,Xt,$t,cr,kr,tn){const Ur=tn||Number.POSITIVE_INFINITY;let yn=0;return Mn;function Mn(li){return li===60?(we.enter(ut),we.enter(Xt),we.enter($t),we.consume(li),we.exit($t),ea):li===null||li===32||li===41||Rk(li)?ot(li):(we.enter(ut),we.enter(cr),we.enter(kr),we.enter("chunkString",{contentType:"string"}),bo(li))}function ea(li){return li===62?(we.enter($t),we.consume(li),we.exit($t),we.exit(Xt),we.exit(ut),Ke):(we.enter(kr),we.enter("chunkString",{contentType:"string"}),Bn(li))}function Bn(li){return li===62?(we.exit("chunkString"),we.exit(kr),ea(li)):li===null||li===60||yu(li)?ot(li):(we.consume(li),li===92?Gi:Bn)}function Gi(li){return li===60||li===62||li===92?(we.consume(li),Bn):Bn(li)}function bo(li){return!yn&&(li===null||li===41||Rp(li))?(we.exit("chunkString"),we.exit(kr),we.exit(cr),we.exit(ut),Ke(li)):yn999||Bn===null||Bn===91||Bn===93&&!tn||Bn===94&&!kr&&"_hiddenFootnoteSupport"in cr.parser.constructs?ot(Bn):Bn===93?(we.exit($t),we.enter(Xt),we.consume(Bn),we.exit(Xt),we.exit(ut),Ke):yu(Bn)?(we.enter("lineEnding"),we.consume(Bn),we.exit("lineEnding"),yn):(we.enter("chunkString",{contentType:"string"}),Mn(Bn))}function Mn(Bn){return Bn===null||Bn===91||Bn===93||yu(Bn)||kr++>999?(we.exit("chunkString"),yn(Bn)):(we.consume(Bn),tn||(tn=!Af(Bn)),Bn===92?ea:Mn)}function ea(Bn){return Bn===91||Bn===92||Bn===93?(we.consume(Bn),kr++,Mn):Mn(Bn)}}function FP(we,Ke,ot,ut,Xt,$t){let cr;return kr;function kr(ea){return ea===34||ea===39||ea===40?(we.enter(ut),we.enter(Xt),we.consume(ea),we.exit(Xt),cr=ea===40?41:ea,tn):ot(ea)}function tn(ea){return ea===cr?(we.enter(Xt),we.consume(ea),we.exit(Xt),we.exit(ut),Ke):(we.enter($t),Ur(ea))}function Ur(ea){return ea===cr?(we.exit($t),tn(cr)):ea===null?ot(ea):yu(ea)?(we.enter("lineEnding"),we.consume(ea),we.exit("lineEnding"),gh(we,Ur,"linePrefix")):(we.enter("chunkString",{contentType:"string"}),yn(ea))}function yn(ea){return ea===cr||ea===null||yu(ea)?(we.exit("chunkString"),Ur(ea)):(we.consume(ea),ea===92?Mn:yn)}function Mn(ea){return ea===cr||ea===92?(we.consume(ea),yn):yn(ea)}}function IT(we,Ke){let ot;return ut;function ut(Xt){return yu(Xt)?(we.enter("lineEnding"),we.consume(Xt),we.exit("lineEnding"),ot=!0,ut):Af(Xt)?gh(we,ut,ot?"linePrefix":"lineSuffix")(Xt):Ke(Xt)}}const kU={name:"definition",tokenize:LU},CU={partial:!0,tokenize:PU};function LU(we,Ke,ot){const ut=this;let Xt;return $t;function $t(Bn){return we.enter("definition"),cr(Bn)}function cr(Bn){return OP.call(ut,we,kr,ot,"definitionLabel","definitionLabelMarker","definitionLabelString")(Bn)}function kr(Bn){return Xt=Ow(ut.sliceSerialize(ut.events[ut.events.length-1][1]).slice(1,-1)),Bn===58?(we.enter("definitionMarker"),we.consume(Bn),we.exit("definitionMarker"),tn):ot(Bn)}function tn(Bn){return Rp(Bn)?IT(we,Ur)(Bn):Ur(Bn)}function Ur(Bn){return zP(we,yn,ot,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Bn)}function yn(Bn){return we.attempt(CU,Mn,Mn)(Bn)}function Mn(Bn){return Af(Bn)?gh(we,ea,"whitespace")(Bn):ea(Bn)}function ea(Bn){return Bn===null||yu(Bn)?(we.exit("definition"),ut.parser.defined.push(Xt),Ke(Bn)):ot(Bn)}}function PU(we,Ke,ot){return ut;function ut(kr){return Rp(kr)?IT(we,Xt)(kr):ot(kr)}function Xt(kr){return FP(we,$t,ot,"definitionTitle","definitionTitleMarker","definitionTitleString")(kr)}function $t(kr){return Af(kr)?gh(we,cr,"whitespace")(kr):cr(kr)}function cr(kr){return kr===null||yu(kr)?Ke(kr):ot(kr)}}const RU={name:"hardBreakEscape",tokenize:IU};function IU(we,Ke,ot){return ut;function ut($t){return we.enter("hardBreakEscape"),we.consume($t),Xt}function Xt($t){return yu($t)?(we.exit("hardBreakEscape"),Ke($t)):ot($t)}}const DU={name:"headingAtx",resolve:zU,tokenize:OU};function zU(we,Ke){let ot=we.length-2,ut=3,Xt,$t;return we[ut][1].type==="whitespace"&&(ut+=2),ot-2>ut&&we[ot][1].type==="whitespace"&&(ot-=2),we[ot][1].type==="atxHeadingSequence"&&(ut===ot-1||ot-4>ut&&we[ot-2][1].type==="whitespace")&&(ot-=ut+1===ot?2:4),ot>ut&&(Xt={type:"atxHeadingText",start:we[ut][1].start,end:we[ot][1].end},$t={type:"chunkText",start:we[ut][1].start,end:we[ot][1].end,contentType:"text"},Jm(we,ut,ot-ut+1,[["enter",Xt,Ke],["enter",$t,Ke],["exit",$t,Ke],["exit",Xt,Ke]])),we}function OU(we,Ke,ot){let ut=0;return Xt;function Xt(yn){return we.enter("atxHeading"),$t(yn)}function $t(yn){return we.enter("atxHeadingSequence"),cr(yn)}function cr(yn){return yn===35&&ut++<6?(we.consume(yn),cr):yn===null||Rp(yn)?(we.exit("atxHeadingSequence"),kr(yn)):ot(yn)}function kr(yn){return yn===35?(we.enter("atxHeadingSequence"),tn(yn)):yn===null||yu(yn)?(we.exit("atxHeading"),Ke(yn)):Af(yn)?gh(we,kr,"whitespace")(yn):(we.enter("atxHeadingText"),Ur(yn))}function tn(yn){return yn===35?(we.consume(yn),tn):(we.exit("atxHeadingSequence"),kr(yn))}function Ur(yn){return yn===null||yn===35||Rp(yn)?(we.exit("atxHeadingText"),kr(yn)):(we.consume(yn),Ur)}}const FU=["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"],T4=["pre","script","style","textarea"],BU={concrete:!0,name:"htmlFlow",resolveTo:jU,tokenize:qU},NU={partial:!0,tokenize:HU},UU={partial:!0,tokenize:VU};function jU(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 qU(we,Ke,ot){const ut=this;let Xt,$t,cr,kr,tn;return Ur;function Ur(Kn){return yn(Kn)}function yn(Kn){return we.enter("htmlFlow"),we.enter("htmlFlowData"),we.consume(Kn),Mn}function Mn(Kn){return Kn===33?(we.consume(Kn),ea):Kn===47?(we.consume(Kn),$t=!0,bo):Kn===63?(we.consume(Kn),Xt=3,ut.interrupt?Ke:ba):Km(Kn)?(we.consume(Kn),cr=String.fromCharCode(Kn),eo):ot(Kn)}function ea(Kn){return Kn===45?(we.consume(Kn),Xt=2,Bn):Kn===91?(we.consume(Kn),Xt=5,kr=0,Gi):Km(Kn)?(we.consume(Kn),Xt=4,ut.interrupt?Ke:ba):ot(Kn)}function Bn(Kn){return Kn===45?(we.consume(Kn),ut.interrupt?Ke:ba):ot(Kn)}function Gi(Kn){const vs="CDATA[";return Kn===vs.charCodeAt(kr++)?(we.consume(Kn),kr===vs.length?ut.interrupt?Ke:zo:Gi):ot(Kn)}function bo(Kn){return Km(Kn)?(we.consume(Kn),cr=String.fromCharCode(Kn),eo):ot(Kn)}function eo(Kn){if(Kn===null||Kn===47||Kn===62||Rp(Kn)){const vs=Kn===47,Is=cr.toLowerCase();return!vs&&!$t&&T4.includes(Is)?(Xt=1,ut.interrupt?Ke(Kn):zo(Kn)):FU.includes(cr.toLowerCase())?(Xt=6,vs?(we.consume(Kn),li):ut.interrupt?Ke(Kn):zo(Kn)):(Xt=7,ut.interrupt&&!ut.parser.lazy[ut.now().line]?ot(Kn):$t?Ge(Kn):wo(Kn))}return Kn===45||s0(Kn)?(we.consume(Kn),cr+=String.fromCharCode(Kn),eo):ot(Kn)}function li(Kn){return Kn===62?(we.consume(Kn),ut.interrupt?Ke:zo):ot(Kn)}function Ge(Kn){return Af(Kn)?(we.consume(Kn),Ge):$s(Kn)}function wo(Kn){return Kn===47?(we.consume(Kn),$s):Kn===58||Kn===95||Km(Kn)?(we.consume(Kn),vl):Af(Kn)?(we.consume(Kn),wo):$s(Kn)}function vl(Kn){return Kn===45||Kn===46||Kn===58||Kn===95||s0(Kn)?(we.consume(Kn),vl):Eo(Kn)}function Eo(Kn){return Kn===61?(we.consume(Kn),ui):Af(Kn)?(we.consume(Kn),Eo):wo(Kn)}function ui(Kn){return Kn===null||Kn===60||Kn===61||Kn===62||Kn===96?ot(Kn):Kn===34||Kn===39?(we.consume(Kn),tn=Kn,mo):Af(Kn)?(we.consume(Kn),ui):Rs(Kn)}function mo(Kn){return Kn===tn?(we.consume(Kn),tn=null,ki):Kn===null||yu(Kn)?ot(Kn):(we.consume(Kn),mo)}function Rs(Kn){return Kn===null||Kn===34||Kn===39||Kn===47||Kn===60||Kn===61||Kn===62||Kn===96||Rp(Kn)?Eo(Kn):(we.consume(Kn),Rs)}function ki(Kn){return Kn===47||Kn===62||Af(Kn)?wo(Kn):ot(Kn)}function $s(Kn){return Kn===62?(we.consume(Kn),Di):ot(Kn)}function Di(Kn){return Kn===null||yu(Kn)?zo(Kn):Af(Kn)?(we.consume(Kn),Di):ot(Kn)}function zo(Kn){return Kn===45&&Xt===2?(we.consume(Kn),Ti):Kn===60&&Xt===1?(we.consume(Kn),So):Kn===62&&Xt===4?(we.consume(Kn),qa):Kn===63&&Xt===3?(we.consume(Kn),ba):Kn===93&&Xt===5?(we.consume(Kn),bu):yu(Kn)&&(Xt===6||Xt===7)?(we.exit("htmlFlowData"),we.check(NU,ro,Nl)(Kn)):Kn===null||yu(Kn)?(we.exit("htmlFlowData"),Nl(Kn)):(we.consume(Kn),zo)}function Nl(Kn){return we.check(UU,Si,ro)(Kn)}function Si(Kn){return we.enter("lineEnding"),we.consume(Kn),we.exit("lineEnding"),Ii}function Ii(Kn){return Kn===null||yu(Kn)?Nl(Kn):(we.enter("htmlFlowData"),zo(Kn))}function Ti(Kn){return Kn===45?(we.consume(Kn),ba):zo(Kn)}function So(Kn){return Kn===47?(we.consume(Kn),cr="",ws):zo(Kn)}function ws(Kn){if(Kn===62){const vs=cr.toLowerCase();return T4.includes(vs)?(we.consume(Kn),qa):zo(Kn)}return Km(Kn)&&cr.length<8?(we.consume(Kn),cr+=String.fromCharCode(Kn),ws):zo(Kn)}function bu(Kn){return Kn===93?(we.consume(Kn),ba):zo(Kn)}function ba(Kn){return Kn===62?(we.consume(Kn),qa):Kn===45&&Xt===2?(we.consume(Kn),ba):zo(Kn)}function qa(Kn){return Kn===null||yu(Kn)?(we.exit("htmlFlowData"),ro(Kn)):(we.consume(Kn),qa)}function ro(Kn){return we.exit("htmlFlow"),Ke(Kn)}}function VU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return yu(cr)?(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),$t):ot(cr)}function $t(cr){return ut.parser.lazy[ut.now().line]?ot(cr):Ke(cr)}}function HU(we,Ke,ot){return ut;function ut(Xt){return we.enter("lineEnding"),we.consume(Xt),we.exit("lineEnding"),we.attempt(xM,Ke,ot)}}const GU={name:"htmlText",tokenize:XU};function XU(we,Ke,ot){const ut=this;let Xt,$t,cr;return kr;function kr(ba){return we.enter("htmlText"),we.enter("htmlTextData"),we.consume(ba),tn}function tn(ba){return ba===33?(we.consume(ba),Ur):ba===47?(we.consume(ba),Eo):ba===63?(we.consume(ba),wo):Km(ba)?(we.consume(ba),Rs):ot(ba)}function Ur(ba){return ba===45?(we.consume(ba),yn):ba===91?(we.consume(ba),$t=0,Gi):Km(ba)?(we.consume(ba),Ge):ot(ba)}function yn(ba){return ba===45?(we.consume(ba),Bn):ot(ba)}function Mn(ba){return ba===null?ot(ba):ba===45?(we.consume(ba),ea):yu(ba)?(cr=Mn,So(ba)):(we.consume(ba),Mn)}function ea(ba){return ba===45?(we.consume(ba),Bn):Mn(ba)}function Bn(ba){return ba===62?Ti(ba):ba===45?ea(ba):Mn(ba)}function Gi(ba){const qa="CDATA[";return ba===qa.charCodeAt($t++)?(we.consume(ba),$t===qa.length?bo:Gi):ot(ba)}function bo(ba){return ba===null?ot(ba):ba===93?(we.consume(ba),eo):yu(ba)?(cr=bo,So(ba)):(we.consume(ba),bo)}function eo(ba){return ba===93?(we.consume(ba),li):bo(ba)}function li(ba){return ba===62?Ti(ba):ba===93?(we.consume(ba),li):bo(ba)}function Ge(ba){return ba===null||ba===62?Ti(ba):yu(ba)?(cr=Ge,So(ba)):(we.consume(ba),Ge)}function wo(ba){return ba===null?ot(ba):ba===63?(we.consume(ba),vl):yu(ba)?(cr=wo,So(ba)):(we.consume(ba),wo)}function vl(ba){return ba===62?Ti(ba):wo(ba)}function Eo(ba){return Km(ba)?(we.consume(ba),ui):ot(ba)}function ui(ba){return ba===45||s0(ba)?(we.consume(ba),ui):mo(ba)}function mo(ba){return yu(ba)?(cr=mo,So(ba)):Af(ba)?(we.consume(ba),mo):Ti(ba)}function Rs(ba){return ba===45||s0(ba)?(we.consume(ba),Rs):ba===47||ba===62||Rp(ba)?ki(ba):ot(ba)}function ki(ba){return ba===47?(we.consume(ba),Ti):ba===58||ba===95||Km(ba)?(we.consume(ba),$s):yu(ba)?(cr=ki,So(ba)):Af(ba)?(we.consume(ba),ki):Ti(ba)}function $s(ba){return ba===45||ba===46||ba===58||ba===95||s0(ba)?(we.consume(ba),$s):Di(ba)}function Di(ba){return ba===61?(we.consume(ba),zo):yu(ba)?(cr=Di,So(ba)):Af(ba)?(we.consume(ba),Di):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),Xt=ba,Nl):yu(ba)?(cr=zo,So(ba)):Af(ba)?(we.consume(ba),zo):(we.consume(ba),Si)}function Nl(ba){return ba===Xt?(we.consume(ba),Xt=void 0,Ii):ba===null?ot(ba):yu(ba)?(cr=Nl,So(ba)):(we.consume(ba),Nl)}function Si(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),Si)}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",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ba):bu(ba)}function bu(ba){return we.enter("htmlTextData"),cr(ba)}}const Kk={name:"labelEnd",resolveAll:$U,resolveTo:KU,tokenize:JU},YU={tokenize:QU},ZU={tokenize:ej},WU={tokenize:tj};function $U(we){let Ke=-1;const ot=[];for(;++Ke=3&&(Ur===null||yu(Ur))?(we.exit("thematicBreak"),Ke(Ur)):ot(Ur)}function tn(Ur){return Ur===Xt?(we.consume(Ur),ut++,tn):(we.exit("thematicBreakSequence"),Af(Ur)?gh(we,kr,"whitespace")(Ur):kr(Ur))}}const Pp={continuation:{tokenize:fj},exit:dj,name:"list",tokenize:cj},lj={partial:!0,tokenize:vj},uj={partial:!0,tokenize:hj};function cj(we,Ke,ot){const ut=this,Xt=ut.events[ut.events.length-1];let $t=Xt&&Xt[1].type==="linePrefix"?Xt[2].sliceSerialize(Xt[1],!0).length:0,cr=0;return kr;function kr(Bn){const Gi=ut.containerState.type||(Bn===42||Bn===43||Bn===45?"listUnordered":"listOrdered");if(Gi==="listUnordered"?!ut.containerState.marker||Bn===ut.containerState.marker:Ik(Bn)){if(ut.containerState.type||(ut.containerState.type=Gi,we.enter(Gi,{_container:!0})),Gi==="listUnordered")return we.enter("listItemPrefix"),Bn===42||Bn===45?we.check(lM,ot,Ur)(Bn):Ur(Bn);if(!ut.interrupt||Bn===49)return we.enter("listItemPrefix"),we.enter("listItemValue"),tn(Bn)}return ot(Bn)}function tn(Bn){return Ik(Bn)&&++cr<10?(we.consume(Bn),tn):(!ut.interrupt||cr<2)&&(ut.containerState.marker?Bn===ut.containerState.marker:Bn===41||Bn===46)?(we.exit("listItemValue"),Ur(Bn)):ot(Bn)}function Ur(Bn){return we.enter("listItemMarker"),we.consume(Bn),we.exit("listItemMarker"),ut.containerState.marker=ut.containerState.marker||Bn,we.check(xM,ut.interrupt?ot:yn,we.attempt(lj,ea,Mn))}function yn(Bn){return ut.containerState.initialBlankLine=!0,$t++,ea(Bn)}function Mn(Bn){return Af(Bn)?(we.enter("listItemPrefixWhitespace"),we.consume(Bn),we.exit("listItemPrefixWhitespace"),ea):ot(Bn)}function ea(Bn){return ut.containerState.size=$t+ut.sliceSerialize(we.exit("listItemPrefix"),!0).length,Ke(Bn)}}function fj(we,Ke,ot){const ut=this;return ut.containerState._closeFlow=void 0,we.check(xM,Xt,$t);function Xt(kr){return ut.containerState.furtherBlankLines=ut.containerState.furtherBlankLines||ut.containerState.initialBlankLine,gh(we,Ke,"listItemIndent",ut.containerState.size+1)(kr)}function $t(kr){return ut.containerState.furtherBlankLines||!Af(kr)?(ut.containerState.furtherBlankLines=void 0,ut.containerState.initialBlankLine=void 0,cr(kr)):(ut.containerState.furtherBlankLines=void 0,ut.containerState.initialBlankLine=void 0,we.attempt(uj,Ke,cr)(kr))}function cr(kr){return ut.containerState._closeFlow=!0,ut.interrupt=void 0,gh(we,we.attempt(Pp,Ke,ot),"linePrefix",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(kr)}}function hj(we,Ke,ot){const ut=this;return gh(we,Xt,"listItemIndent",ut.containerState.size+1);function Xt($t){const cr=ut.events[ut.events.length-1];return cr&&cr[1].type==="listItemIndent"&&cr[2].sliceSerialize(cr[1],!0).length===ut.containerState.size?Ke($t):ot($t)}}function dj(we){we.exit(this.containerState.type)}function vj(we,Ke,ot){const ut=this;return gh(we,Xt,"listItemPrefixWhitespace",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function Xt($t){const cr=ut.events[ut.events.length-1];return!Af($t)&&cr&&cr[1].type==="listItemPrefixWhitespace"?Ke($t):ot($t)}}const A4={name:"setextUnderline",resolveTo:pj,tokenize:mj};function pj(we,Ke){let ot=we.length,ut,Xt,$t;for(;ot--;)if(we[ot][0]==="enter"){if(we[ot][1].type==="content"){ut=ot;break}we[ot][1].type==="paragraph"&&(Xt=ot)}else we[ot][1].type==="content"&&we.splice(ot,1),!$t&&we[ot][1].type==="definition"&&($t=ot);const cr={type:"setextHeading",start:{...we[ut][1].start},end:{...we[we.length-1][1].end}};return we[Xt][1].type="setextHeadingText",$t?(we.splice(Xt,0,["enter",cr,Ke]),we.splice($t+1,0,["exit",we[ut][1],Ke]),we[ut][1].end={...we[$t][1].end}):we[ut][1]=cr,we.push(["exit",cr,Ke]),we}function mj(we,Ke,ot){const ut=this;let Xt;return $t;function $t(Ur){let yn=ut.events.length,Mn;for(;yn--;)if(ut.events[yn][1].type!=="lineEnding"&&ut.events[yn][1].type!=="linePrefix"&&ut.events[yn][1].type!=="content"){Mn=ut.events[yn][1].type==="paragraph";break}return!ut.parser.lazy[ut.now().line]&&(ut.interrupt||Mn)?(we.enter("setextHeadingLine"),Xt=Ur,cr(Ur)):ot(Ur)}function cr(Ur){return we.enter("setextHeadingLineSequence"),kr(Ur)}function kr(Ur){return Ur===Xt?(we.consume(Ur),kr):(we.exit("setextHeadingLineSequence"),Af(Ur)?gh(we,tn,"lineSuffix")(Ur):tn(Ur))}function tn(Ur){return Ur===null||yu(Ur)?(we.exit("setextHeadingLine"),Ke(Ur)):ot(Ur)}}const gj={tokenize:yj};function yj(we){const Ke=this,ot=we.attempt(xM,ut,we.attempt(this.parser.constructs.flowInitial,Xt,gh(we,we.attempt(this.parser.constructs.flow,Xt,we.attempt(TU,Xt)),"linePrefix")));return ot;function ut($t){if($t===null){we.consume($t);return}return we.enter("lineEndingBlank"),we.consume($t),we.exit("lineEndingBlank"),Ke.currentConstruct=void 0,ot}function Xt($t){if($t===null){we.consume($t);return}return we.enter("lineEnding"),we.consume($t),we.exit("lineEnding"),Ke.currentConstruct=void 0,ot}}const _j={resolveAll:NP()},xj=BP("string"),bj=BP("text");function BP(we){return{resolveAll:NP(we==="text"?wj:void 0),tokenize:Ke};function Ke(ot){const ut=this,Xt=this.parser.constructs[we],$t=ot.attempt(Xt,cr,kr);return cr;function cr(yn){return Ur(yn)?$t(yn):kr(yn)}function kr(yn){if(yn===null){ot.consume(yn);return}return ot.enter("data"),ot.consume(yn),tn}function tn(yn){return Ur(yn)?(ot.exit("data"),$t(yn)):(ot.consume(yn),tn)}function Ur(yn){if(yn===null)return!0;const Mn=Xt[yn];let ea=-1;if(Mn)for(;++ea-1){const kr=cr[0];typeof kr=="string"?cr[0]=kr.slice(ut):cr.shift()}$t>0&&cr.push(we[Xt].slice(0,$t))}return cr}function zj(we,Ke){let ot=-1;const ut=[];let Xt;for(;++ot0){const tp=nu.tokenStack[nu.tokenStack.length-1];(tp[1]||M4).call(nu,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&&(ut.className=["language-"+Xt[0]]);let $t={type:"element",tagName:"code",properties:ut,children:[{type:"text",value:ot}]};return Ke.meta&&($t.data={meta:Ke.meta}),we.patch(Ke,$t),$t=we.applyData(Ke,$t),$t={type:"element",tagName:"pre",properties:{},children:[$t]},we.patch(Ke,$t),$t}function Wj(we,Ke){const ot={type:"element",tagName:"del",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function $j(we,Ke){const ot={type:"element",tagName:"em",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function Kj(we,Ke){const ot=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",ut=String(Ke.identifier).toUpperCase(),Xt=Nw(ut.toLowerCase()),$t=we.footnoteOrder.indexOf(ut);let cr,kr=we.footnoteCounts.get(ut);kr===void 0?(kr=0,we.footnoteOrder.push(ut),cr=we.footnoteOrder.length):cr=$t+1,kr+=1,we.footnoteCounts.set(ut,kr);const tn={type:"element",tagName:"a",properties:{href:"#"+ot+"fn-"+Xt,id:ot+"fnref-"+Xt+(kr>1?"-"+kr:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(cr)}]};we.patch(Ke,tn);const Ur={type:"element",tagName:"sup",properties:{},children:[tn]};return we.patch(Ke,Ur),we.applyData(Ke,Ur)}function Jj(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 Qj(we,Ke){if(we.options.allowDangerousHtml){const ot={type:"raw",value:Ke.value};return we.patch(Ke,ot),we.applyData(Ke,ot)}}function qP(we,Ke){const ot=Ke.referenceType;let ut="]";if(ot==="collapsed"?ut+="[]":ot==="full"&&(ut+="["+(Ke.label||Ke.identifier)+"]"),Ke.type==="imageReference")return[{type:"text",value:"!["+Ke.alt+ut}];const Xt=we.all(Ke),$t=Xt[0];$t&&$t.type==="text"?$t.value="["+$t.value:Xt.unshift({type:"text",value:"["});const cr=Xt[Xt.length-1];return cr&&cr.type==="text"?cr.value+=ut:Xt.push({type:"text",value:ut}),Xt}function eq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),ut=we.definitionById.get(ot);if(!ut)return qP(we,Ke);const Xt={src:Nw(ut.url||""),alt:Ke.alt};ut.title!==null&&ut.title!==void 0&&(Xt.title=ut.title);const $t={type:"element",tagName:"img",properties:Xt,children:[]};return we.patch(Ke,$t),we.applyData(Ke,$t)}function tq(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 ut={type:"element",tagName:"img",properties:ot,children:[]};return we.patch(Ke,ut),we.applyData(Ke,ut)}function rq(we,Ke){const ot={type:"text",value:Ke.value.replace(/\r?\n|\r/g," ")};we.patch(Ke,ot);const ut={type:"element",tagName:"code",properties:{},children:[ot]};return we.patch(Ke,ut),we.applyData(Ke,ut)}function nq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),ut=we.definitionById.get(ot);if(!ut)return qP(we,Ke);const Xt={href:Nw(ut.url||"")};ut.title!==null&&ut.title!==void 0&&(Xt.title=ut.title);const $t={type:"element",tagName:"a",properties:Xt,children:we.all(Ke)};return we.patch(Ke,$t),we.applyData(Ke,$t)}function aq(we,Ke){const ot={href:Nw(Ke.url)};Ke.title!==null&&Ke.title!==void 0&&(ot.title=Ke.title);const ut={type:"element",tagName:"a",properties:ot,children:we.all(Ke)};return we.patch(Ke,ut),we.applyData(Ke,ut)}function iq(we,Ke,ot){const ut=we.all(Ke),Xt=ot?oq(ot):VP(Ke),$t={},cr=[];if(typeof Ke.checked=="boolean"){const yn=ut[0];let Mn;yn&&yn.type==="element"&&yn.tagName==="p"?Mn=yn:(Mn={type:"element",tagName:"p",properties:{},children:[]},ut.unshift(Mn)),Mn.children.length>0&&Mn.children.unshift({type:"text",value:" "}),Mn.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Ke.checked,disabled:!0},children:[]}),$t.className=["task-list-item"]}let kr=-1;for(;++kr1}function sq(we,Ke){const ot={},ut=we.all(Ke);let Xt=-1;for(typeof Ke.start=="number"&&Ke.start!==1&&(ot.start=Ke.start);++Xt0){const cr={type:"element",tagName:"tbody",properties:{},children:we.wrap(ot,!0)},kr=Gk(Ke.children[1]),tn=TP(Ke.children[Ke.children.length-1]);kr&&tn&&(cr.position={start:kr,end:tn}),Xt.push(cr)}const $t={type:"element",tagName:"table",properties:{},children:we.wrap(Xt,!0)};return we.patch(Ke,$t),we.applyData(Ke,$t)}function hq(we,Ke,ot){const ut=ot?ot.children:void 0,$t=(ut?ut.indexOf(Ke):1)===0?"th":"td",cr=ot&&ot.type==="table"?ot.align:void 0,kr=cr?cr.length:Ke.children.length;let tn=-1;const Ur=[];for(;++tn0,!0),ut[0]),Xt=ut.index+ut[0].length,ut=ot.exec(Ke);return $t.push(C4(Ke.slice(Xt),Xt>0,!1)),$t.join("")}function C4(we,Ke,ot){let ut=0,Xt=we.length;if(Ke){let $t=we.codePointAt(ut);for(;$t===E4||$t===k4;)ut++,$t=we.codePointAt(ut)}if(ot){let $t=we.codePointAt(Xt-1);for(;$t===E4||$t===k4;)Xt--,$t=we.codePointAt(Xt-1)}return Xt>ut?we.slice(ut,Xt):""}function pq(we,Ke){const ot={type:"text",value:vq(String(Ke.value))};return we.patch(Ke,ot),we.applyData(Ke,ot)}function mq(we,Ke){const ot={type:"element",tagName:"hr",properties:{},children:[]};return we.patch(Ke,ot),we.applyData(Ke,ot)}const gq={blockquote:Xj,break:Yj,code:Zj,delete:Wj,emphasis:$j,footnoteReference:Kj,heading:Jj,html:Qj,imageReference:eq,image:tq,inlineCode:rq,linkReference:nq,link:aq,listItem:iq,list:sq,paragraph:lq,root:uq,strong:cq,table:fq,tableCell:dq,tableRow:hq,text:pq,thematicBreak:mq,toml:rM,yaml:rM,definition:rM,footnoteDefinition:rM};function rM(){}const HP=-1,bM=0,DT=1,vM=2,Jk=3,Qk=4,eC=5,tC=6,GP=7,XP=8,L4=typeof self=="object"?self:globalThis,yq=(we,Ke)=>{const ot=(Xt,$t)=>(we.set($t,Xt),Xt),ut=Xt=>{if(we.has(Xt))return we.get(Xt);const[$t,cr]=Ke[Xt];switch($t){case bM:case HP:return ot(cr,Xt);case DT:{const kr=ot([],Xt);for(const tn of cr)kr.push(ut(tn));return kr}case vM:{const kr=ot({},Xt);for(const[tn,Ur]of cr)kr[ut(tn)]=ut(Ur);return kr}case Jk:return ot(new Date(cr),Xt);case Qk:{const{source:kr,flags:tn}=cr;return ot(new RegExp(kr,tn),Xt)}case eC:{const kr=ot(new Map,Xt);for(const[tn,Ur]of cr)kr.set(ut(tn),ut(Ur));return kr}case tC:{const kr=ot(new Set,Xt);for(const tn of cr)kr.add(ut(tn));return kr}case GP:{const{name:kr,message:tn}=cr;return ot(new L4[kr](tn),Xt)}case XP:return ot(BigInt(cr),Xt);case"BigInt":return ot(Object(BigInt(cr)),Xt);case"ArrayBuffer":return ot(new Uint8Array(cr).buffer,cr);case"DataView":{const{buffer:kr}=new Uint8Array(cr);return ot(new DataView(kr),cr)}}return ot(new L4[$t](cr),Xt)};return ut},P4=we=>yq(new Map,we)(0),Iw="",{toString:_q}={},{keys:xq}=Object,CT=we=>{const Ke=typeof we;if(Ke!=="object"||!we)return[bM,Ke];const ot=_q.call(we).slice(8,-1);switch(ot){case"Array":return[DT,Iw];case"Object":return[vM,Iw];case"Date":return[Jk,Iw];case"RegExp":return[Qk,Iw];case"Map":return[eC,Iw];case"Set":return[tC,Iw];case"DataView":return[DT,ot]}return ot.includes("Array")?[DT,ot]:ot.includes("Error")?[GP,ot]:[vM,ot]},nM=([we,Ke])=>we===bM&&(Ke==="function"||Ke==="symbol"),bq=(we,Ke,ot,ut)=>{const Xt=(cr,kr)=>{const tn=ut.push(cr)-1;return ot.set(kr,tn),tn},$t=cr=>{if(ot.has(cr))return ot.get(cr);let[kr,tn]=CT(cr);switch(kr){case bM:{let yn=cr;switch(tn){case"bigint":kr=XP,yn=cr.toString();break;case"function":case"symbol":if(we)throw new TypeError("unable to serialize "+tn);yn=null;break;case"undefined":return Xt([HP],cr)}return Xt([kr,yn],cr)}case DT:{if(tn){let ea=cr;return tn==="DataView"?ea=new Uint8Array(cr.buffer):tn==="ArrayBuffer"&&(ea=new Uint8Array(cr)),Xt([tn,[...ea]],cr)}const yn=[],Mn=Xt([kr,yn],cr);for(const ea of cr)yn.push($t(ea));return Mn}case vM:{if(tn)switch(tn){case"BigInt":return Xt([tn,cr.toString()],cr);case"Boolean":case"Number":case"String":return Xt([tn,cr.valueOf()],cr)}if(Ke&&"toJSON"in cr)return $t(cr.toJSON());const yn=[],Mn=Xt([kr,yn],cr);for(const ea of xq(cr))(we||!nM(CT(cr[ea])))&&yn.push([$t(ea),$t(cr[ea])]);return Mn}case Jk:return Xt([kr,cr.toISOString()],cr);case Qk:{const{source:yn,flags:Mn}=cr;return Xt([kr,{source:yn,flags:Mn}],cr)}case eC:{const yn=[],Mn=Xt([kr,yn],cr);for(const[ea,Bn]of cr)(we||!(nM(CT(ea))||nM(CT(Bn))))&&yn.push([$t(ea),$t(Bn)]);return Mn}case tC:{const yn=[],Mn=Xt([kr,yn],cr);for(const ea of cr)(we||!nM(CT(ea)))&&yn.push($t(ea));return Mn}}const{message:Ur}=cr;return Xt([kr,{name:tn,message:Ur}],cr)};return $t},R4=(we,{json:Ke,lossy:ot}={})=>{const ut=[];return bq(!(Ke||ot),!!Ke,new Map,ut)(we),ut},pM=typeof structuredClone=="function"?(we,Ke)=>Ke&&("json"in Ke||"lossy"in Ke)?P4(R4(we,Ke)):structuredClone(we):(we,Ke)=>P4(R4(we,Ke));function wq(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 Tq(we,Ke){return"Back to reference "+(we+1)+(Ke>1?"-"+Ke:"")}function Aq(we){const Ke=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",ot=we.options.footnoteBackContent||wq,ut=we.options.footnoteBackLabel||Tq,Xt=we.options.footnoteLabel||"Footnotes",$t=we.options.footnoteLabelTagName||"h2",cr=we.options.footnoteLabelProperties||{className:["sr-only"]},kr=[];let tn=-1;for(;++tn0&&Gi.push({type:"text",value:" "});let Ge=typeof ot=="string"?ot:ot(tn,Bn);typeof Ge=="string"&&(Ge={type:"text",value:Ge}),Gi.push({type:"element",tagName:"a",properties:{href:"#"+Ke+"fnref-"+ea+(Bn>1?"-"+Bn:""),dataFootnoteBackref:"",ariaLabel:typeof ut=="string"?ut:ut(tn,Bn),className:["data-footnote-backref"]},children:Array.isArray(Ge)?Ge:[Ge]})}const eo=yn[yn.length-1];if(eo&&eo.type==="element"&&eo.tagName==="p"){const Ge=eo.children[eo.children.length-1];Ge&&Ge.type==="text"?Ge.value+=" ":eo.children.push({type:"text",value:" "}),eo.children.push(...Gi)}else yn.push(...Gi);const li={type:"element",tagName:"li",properties:{id:Ke+"fn-"+ea},children:we.wrap(yn,!0)};we.patch(Ur,li),kr.push(li)}if(kr.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:$t,properties:{...pM(cr),id:"footnote-label"},children:[{type:"text",value:Xt}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:we.wrap(kr,!0)},{type:"text",value:` +`}]}}const YP=(function(we){if(we==null)return kq;if(typeof we=="function")return wM(we);if(typeof we=="object")return Array.isArray(we)?Sq(we):Mq(we);if(typeof we=="string")return Eq(we);throw new Error("Expected function, string, or object as test")});function Sq(we){const Ke=[];let ot=-1;for(;++ot":""))+")"})}return ea;function ea(){let Bn=ZP,Gi,bo,eo;if((!Ke||$t(tn,Ur,yn[yn.length-1]||void 0))&&(Bn=Iq(ot(tn,yn)),Bn[0]===I4))return Bn;if("children"in tn&&tn.children){const li=tn;if(li.children&&Bn[0]!==Pq)for(bo=(ut?li.children.length:-1)+cr,eo=yn.concat(li);bo>-1&&bo0&&ot.push({type:"text",value:` +`}),ot}function D4(we){let Ke=0,ot=we.charCodeAt(Ke);for(;ot===9||ot===32;)Ke++,ot=we.charCodeAt(Ke);return we.slice(Ke)}function z4(we,Ke){const ot=zq(we,Ke),ut=ot.one(we,void 0),Xt=Aq(ot),$t=Array.isArray(ut)?{type:"root",children:ut}:ut||{type:"root",children:[]};return Xt&&$t.children.push({type:"text",value:` +`},Xt),$t}function Uq(we,Ke){return we&&"run"in we?async function(ot,ut){const Xt=z4(ot,{file:ut,...Ke});await we.run(Xt,ut)}:function(ot,ut){return z4(ot,{file:ut,...we||Ke})}}function O4(we){if(we)throw we}var fk,F4;function jq(){if(F4)return fk;F4=1;var we=Object.prototype.hasOwnProperty,Ke=Object.prototype.toString,ot=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,Xt=function(Ur){return typeof Array.isArray=="function"?Array.isArray(Ur):Ke.call(Ur)==="[object Array]"},$t=function(Ur){if(!Ur||Ke.call(Ur)!=="[object Object]")return!1;var yn=we.call(Ur,"constructor"),Mn=Ur.constructor&&Ur.constructor.prototype&&we.call(Ur.constructor.prototype,"isPrototypeOf");if(Ur.constructor&&!yn&&!Mn)return!1;var ea;for(ea in Ur);return typeof ea>"u"||we.call(Ur,ea)},cr=function(Ur,yn){ot&&yn.name==="__proto__"?ot(Ur,yn.name,{enumerable:!0,configurable:!0,value:yn.newValue,writable:!0}):Ur[yn.name]=yn.newValue},kr=function(Ur,yn){if(yn==="__proto__")if(we.call(Ur,yn)){if(ut)return ut(Ur,yn).value}else return;return Ur[yn]};return fk=function tn(){var Ur,yn,Mn,ea,Bn,Gi,bo=arguments[0],eo=1,li=arguments.length,Ge=!1;for(typeof bo=="boolean"&&(Ge=bo,bo=arguments[1]||{},eo=2),(bo==null||typeof bo!="object"&&typeof bo!="function")&&(bo={});eocr.length;let tn;kr&&cr.push(Xt);try{tn=we.apply(this,cr)}catch(Ur){const yn=Ur;if(kr&&ot)throw yn;return Xt(yn)}kr||(tn&&tn.then&&typeof tn.then=="function"?tn.then($t,Xt):tn instanceof Error?Xt(tn):$t(tn))}function Xt(cr,...kr){ot||(ot=!0,Ke(cr,...kr))}function $t(cr){Xt(null,cr)}}const $m={basename:Gq,dirname:Xq,extname:Yq,join:Zq,sep:"/"};function Gq(we,Ke){if(Ke!==void 0&&typeof Ke!="string")throw new TypeError('"ext" argument must be a string');FT(we);let ot=0,ut=-1,Xt=we.length,$t;if(Ke===void 0||Ke.length===0||Ke.length>we.length){for(;Xt--;)if(we.codePointAt(Xt)===47){if($t){ot=Xt+1;break}}else ut<0&&($t=!0,ut=Xt+1);return ut<0?"":we.slice(ot,ut)}if(Ke===we)return"";let cr=-1,kr=Ke.length-1;for(;Xt--;)if(we.codePointAt(Xt)===47){if($t){ot=Xt+1;break}}else cr<0&&($t=!0,cr=Xt+1),kr>-1&&(we.codePointAt(Xt)===Ke.codePointAt(kr--)?kr<0&&(ut=Xt):(kr=-1,ut=cr));return ot===ut?ut=cr:ut<0&&(ut=we.length),we.slice(ot,ut)}function Xq(we){if(FT(we),we.length===0)return".";let Ke=-1,ot=we.length,ut;for(;--ot;)if(we.codePointAt(ot)===47){if(ut){Ke=ot;break}}else ut||(ut=!0);return Ke<0?we.codePointAt(0)===47?"/":".":Ke===1&&we.codePointAt(0)===47?"//":we.slice(0,Ke)}function Yq(we){FT(we);let Ke=we.length,ot=-1,ut=0,Xt=-1,$t=0,cr;for(;Ke--;){const kr=we.codePointAt(Ke);if(kr===47){if(cr){ut=Ke+1;break}continue}ot<0&&(cr=!0,ot=Ke+1),kr===46?Xt<0?Xt=Ke:$t!==1&&($t=1):Xt>-1&&($t=-1)}return Xt<0||ot<0||$t===0||$t===1&&Xt===ot-1&&Xt===ut+1?"":we.slice(Xt,ot)}function Zq(...we){let Ke=-1,ot;for(;++Ke0&&we.codePointAt(we.length-1)===47&&(ot+="/"),Ke?"/"+ot:ot}function $q(we,Ke){let ot="",ut=0,Xt=-1,$t=0,cr=-1,kr,tn;for(;++cr<=we.length;){if(cr2){if(tn=ot.lastIndexOf("/"),tn!==ot.length-1){tn<0?(ot="",ut=0):(ot=ot.slice(0,tn),ut=ot.length-1-ot.lastIndexOf("/")),Xt=cr,$t=0;continue}}else if(ot.length>0){ot="",ut=0,Xt=cr,$t=0;continue}}Ke&&(ot=ot.length>0?ot+"/..":"..",ut=2)}else ot.length>0?ot+="/"+we.slice(Xt+1,cr):ot=we.slice(Xt+1,cr),ut=cr-Xt-1;Xt=cr,$t=0}else kr===46&&$t>-1?$t++:$t=-1}return ot}function FT(we){if(typeof we!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(we))}const Kq={cwd:Jq};function Jq(){return"/"}function Fk(we){return!!(we!==null&&typeof we=="object"&&"href"in we&&we.href&&"protocol"in we&&we.protocol&&we.auth===void 0)}function Qq(we){if(typeof we=="string")we=new URL(we);else if(!Fk(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 eV(we)}function eV(we){if(we.hostname!==""){const ut=new TypeError('File URL host must be "localhost" or empty on darwin');throw ut.code="ERR_INVALID_FILE_URL_HOST",ut}const Ke=we.pathname;let ot=-1;for(;++ot0){let[Bn,...Gi]=yn;const bo=ut[ea][1];Ok(bo)&&Ok(Bn)&&(Bn=hk(!0,bo,Bn)),ut[ea]=[Ur,Bn,...Gi]}}}}const aV=new rC().freeze();function mk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `parser`")}function gk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `compiler`")}function yk(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 N4(we){if(!Ok(we)||typeof we.type!="string")throw new TypeError("Expected node, got `"+we+"`")}function U4(we,Ke,ot){if(!ot)throw new Error("`"+we+"` finished async. Use `"+Ke+"` instead")}function aM(we){return iV(we)?we:new $P(we)}function iV(we){return!!(we&&typeof we=="object"&&"message"in we&&"messages"in we)}function oV(we){return typeof we=="string"||sV(we)}function sV(we){return!!(we&&typeof we=="object"&&"byteLength"in we&&"byteOffset"in we)}const lV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",j4=[],q4={allowDangerousHtml:!0},uV=/^(https?|ircs?|mailto|xmpp)$/i,cV=[{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 fV(we){const Ke=hV(we),ot=dV(we);return vV(Ke.runSync(Ke.parse(ot),ot),we)}function hV(we){const Ke=we.rehypePlugins||j4,ot=we.remarkPlugins||j4,ut=we.remarkRehypeOptions?{...we.remarkRehypeOptions,...q4}:q4;return aV().use(Gj).use(ot).use(Uq,ut).use(Ke)}function dV(we){const Ke=we.children||"",ot=new $P;return typeof Ke=="string"&&(ot.value=Ke),ot}function vV(we,Ke){const ot=Ke.allowedElements,ut=Ke.allowElement,Xt=Ke.components,$t=Ke.disallowedElements,cr=Ke.skipHtml,kr=Ke.unwrapDisallowed,tn=Ke.urlTransform||pV;for(const yn of cV)Object.hasOwn(Ke,yn.from)&&(""+yn.from+(yn.to?"use `"+yn.to+"` instead":"remove it")+lV+yn.id,void 0);return WP(we,Ur),AN(we,{Fragment:ra.Fragment,components:Xt,ignoreInvalidStyle:!0,jsx:ra.jsx,jsxs:ra.jsxs,passKeys:!0,passNode:!0});function Ur(yn,Mn,ea){if(yn.type==="raw"&&ea&&typeof Mn=="number")return cr?ea.children.splice(Mn,1):ea.children[Mn]={type:"text",value:yn.value},Mn;if(yn.type==="element"){let Bn;for(Bn in lk)if(Object.hasOwn(lk,Bn)&&Object.hasOwn(yn.properties,Bn)){const Gi=yn.properties[Bn],bo=lk[Bn];(bo===null||bo.includes(yn.tagName))&&(yn.properties[Bn]=tn(String(Gi||""),Bn,yn))}}if(yn.type==="element"){let Bn=ot?!ot.includes(yn.tagName):$t?$t.includes(yn.tagName):!1;if(!Bn&&ut&&typeof Mn=="number"&&(Bn=!ut(yn,Mn,ea)),Bn&&ea&&typeof Mn=="number")return kr&&yn.children?ea.children.splice(Mn,1,...yn.children):ea.children.splice(Mn,1),Mn}}}function pV(we){const Ke=we.indexOf(":"),ot=we.indexOf("?"),ut=we.indexOf("#"),Xt=we.indexOf("/");return Ke===-1||Xt!==-1&&Ke>Xt||ot!==-1&&Ke>ot||ut!==-1&&Ke>ut||uV.test(we.slice(0,Ke))?we:""}const mV="Watch an optimiser walk downhill on a function you choose, one iteration at a time.\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. **Optimiser:** 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, 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\nThe **Metrics** tab shows the current point with f, the gradient and the Hessian (or f′ and f″ with one variable), and a chart of f at each iteration. 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). Tick **Gradient field** to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. **Surface** shows f in 3D; drag to turn it.\n\n## Compare\n\nIn the **Compare** tab, press **+ Add optimiser** for another run on the same function. Click a run to open it and change its algorithm, settings and initial point; every run steps together, from the start again after a change. Click a run's colour to pick another, or × to remove it. Run 1 is the main run from Configure: editing it here changes it there too.\n\n## Plot\n\nDrag to pan and scroll to zoom. The function is redrawn for the new view.\n";function gV(){return ra.jsx("div",{className:"prose leading-loose",children:ra.jsx(fV,{components:{h2:({children:we})=>ra.jsx("h2",{className:"text-xl font-semibold mt-12 mb-2 first:mt-4",children:we}),p:({children:we})=>ra.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:we}),ol:({children:we})=>ra.jsx("ol",{className:"list-decimal pl-5 mb-3",children:we}),li:({children:we})=>ra.jsx("li",{className:"mb-1",children:we}),code:({children:we})=>ra.jsx("code",{className:"bg-gray-200 px-1 py-0.5 rounded",children:we})},children:mV})})}const KP=Symbol("Comlink.proxy"),yV=Symbol("Comlink.endpoint"),_V=Symbol("Comlink.releaseProxy"),_k=Symbol("Comlink.finalizer"),uM=Symbol("Comlink.thrown"),JP=we=>typeof we=="object"&&we!==null||typeof we=="function",xV={canHandle:we=>JP(we)&&we[KP],serialize(we){const{port1:Ke,port2:ot}=new MessageChannel;return eR(we,Ke),[ot,[ot]]},deserialize(we){return we.start(),rR(we)}},bV={canHandle:we=>JP(we)&&uM 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}},QP=new Map([["proxy",xV],["throw",bV]]);function wV(we,Ke){for(const ot of we)if(Ke===ot||ot==="*"||ot instanceof RegExp&&ot.test(Ke))return!0;return!1}function eR(we,Ke=globalThis,ot=["*"]){Ke.addEventListener("message",function ut(Xt){if(!Xt||!Xt.data)return;if(!wV(ot,Xt.origin)){console.warn(`Invalid origin '${Xt.origin}' for comlink proxy`);return}const{id:$t,type:cr,path:kr}=Object.assign({path:[]},Xt.data),tn=(Xt.data.argumentList||[]).map(rx);let Ur;try{const yn=kr.slice(0,-1).reduce((ea,Bn)=>ea[Bn],we),Mn=kr.reduce((ea,Bn)=>ea[Bn],we);switch(cr){case"GET":Ur=Mn;break;case"SET":yn[kr.slice(-1)[0]]=rx(Xt.data.value),Ur=!0;break;case"APPLY":Ur=Mn.apply(yn,tn);break;case"CONSTRUCT":{const ea=new Mn(...tn);Ur=kV(ea)}break;case"ENDPOINT":{const{port1:ea,port2:Bn}=new MessageChannel;eR(we,Bn),Ur=EV(ea,[ea])}break;case"RELEASE":Ur=void 0;break;default:return}}catch(yn){Ur={value:yn,[uM]:0}}Promise.resolve(Ur).catch(yn=>({value:yn,[uM]:0})).then(yn=>{const[Mn,ea]=yM(yn);Ke.postMessage(Object.assign(Object.assign({},Mn),{id:$t}),ea),cr==="RELEASE"&&(Ke.removeEventListener("message",ut),tR(Ke),_k in we&&typeof we[_k]=="function"&&we[_k]())}).catch(yn=>{const[Mn,ea]=yM({value:new TypeError("Unserializable return value"),[uM]:0});Ke.postMessage(Object.assign(Object.assign({},Mn),{id:$t}),ea)})}),Ke.start&&Ke.start()}function TV(we){return we.constructor.name==="MessagePort"}function tR(we){TV(we)&&we.close()}function rR(we,Ke){const ot=new Map;return we.addEventListener("message",function(Xt){const{data:$t}=Xt;if(!$t||!$t.id)return;const cr=ot.get($t.id);if(cr)try{cr($t)}finally{ot.delete($t.id)}}),Bk(we,ot,[],Ke)}function iM(we){if(we)throw new Error("Proxy has been released and is not useable")}function nR(we){return Dw(we,new Map,{type:"RELEASE"}).then(()=>{tR(we)})}const mM=new WeakMap,gM="FinalizationRegistry"in globalThis&&new FinalizationRegistry(we=>{const Ke=(mM.get(we)||0)-1;mM.set(we,Ke),Ke===0&&nR(we)});function AV(we,Ke){const ot=(mM.get(Ke)||0)+1;mM.set(Ke,ot),gM&&gM.register(we,Ke,we)}function SV(we){gM&&gM.unregister(we)}function Bk(we,Ke,ot=[],ut=function(){}){let Xt=!1;const $t=new Proxy(ut,{get(cr,kr){if(iM(Xt),kr===_V)return()=>{SV($t),nR(we),Ke.clear(),Xt=!0};if(kr==="then"){if(ot.length===0)return{then:()=>$t};const tn=Dw(we,Ke,{type:"GET",path:ot.map(Ur=>Ur.toString())}).then(rx);return tn.then.bind(tn)}return Bk(we,Ke,[...ot,kr])},set(cr,kr,tn){iM(Xt);const[Ur,yn]=yM(tn);return Dw(we,Ke,{type:"SET",path:[...ot,kr].map(Mn=>Mn.toString()),value:Ur},yn).then(rx)},apply(cr,kr,tn){iM(Xt);const Ur=ot[ot.length-1];if(Ur===yV)return Dw(we,Ke,{type:"ENDPOINT"}).then(rx);if(Ur==="bind")return Bk(we,Ke,ot.slice(0,-1));const[yn,Mn]=V4(tn);return Dw(we,Ke,{type:"APPLY",path:ot.map(ea=>ea.toString()),argumentList:yn},Mn).then(rx)},construct(cr,kr){iM(Xt);const[tn,Ur]=V4(kr);return Dw(we,Ke,{type:"CONSTRUCT",path:ot.map(yn=>yn.toString()),argumentList:tn},Ur).then(rx)}});return AV($t,we),$t}function MV(we){return Array.prototype.concat.apply([],we)}function V4(we){const Ke=we.map(yM);return[Ke.map(ot=>ot[0]),MV(Ke.map(ot=>ot[1]))]}const aR=new WeakMap;function EV(we,Ke){return aR.set(we,Ke),we}function kV(we){return Object.assign(we,{[KP]:!0})}function yM(we){for(const[Ke,ot]of QP)if(ot.canHandle(we)){const[ut,Xt]=ot.serialize(we);return[{type:"HANDLER",name:Ke,value:ut},Xt]}return[{type:"RAW",value:we},aR.get(we)||[]]}function rx(we){switch(we.type){case"HANDLER":return QP.get(we.name).deserialize(we.value);case"RAW":return we.value}}function Dw(we,Ke,ot,ut){return new Promise(Xt=>{const $t=CV();Ke.set($t,Xt),we.start&&we.start(),we.postMessage(Object.assign({id:$t},ot),ut)})}function CV(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function LV(we){const Ke=rR(we),ot=new Set;let ut="loading";Ke.init().then(()=>Xt("ready"),$t=>{console.error("Python failed to load:",$t),Xt("failed")});function Xt($t){ut=$t,ot.forEach(cr=>cr())}return{call:($t,...cr)=>Ke.call($t,cr[0]),getStatus:()=>ut,subscribe($t){return ot.add($t),()=>ot.delete($t)}}}function PV(we){return ru.useSyncExternalStore(we.subscribe,we.getStatus)}const LT=LV(new Worker(new URL("/assets/pyodide.worker-CoStWDaX.js",import.meta.url),{type:"module"})),H4=500,RV=200,IV=_1.length;function DV(we){const Ke=we.filter($t=>$t!==null&&Number.isFinite($t));if(Ke.length===0)return null;const ot=Math.min(...Ke),ut=Math.max(...Ke),Xt=ut>ot?.1*(ut-ot):1;return[ot-Xt,ut+Xt]}function xk([we,Ke],ot){const ut=Math.max(0,2-Math.floor(Math.log10(Math.abs(Ke-we))));return String(Number(ot.toFixed(ut)))}function G4(we){return{algorithm:"gradient_descent",params:{},startText:we.map(String)}}function X4(we,Ke,ot){const ut=we.startText.map($t=>$t.trim()===""?NaN:Number($t)),Xt={algorithm:we.algorithm,start:ut,params:we.params};return{algorithm:we.algorithm,params:we.params,startText:we.startText,startValid:ut.every(Number.isFinite),settings:Xt,setStartText($t){Ke(cr=>({...cr,startText:$t}))},changeAlgorithm($t){Ke(cr=>({...cr,algorithm:$t,params:{}}))},changeParams($t){ot(),Ke(cr=>({...cr,params:$t}))},changeStart($t,cr){ot(),Ke(kr=>({...kr,startText:kr.startText.map((tn,Ur)=>Ur===$t?cr:tn)}))}}}function zV(){const we=PV(LT),Ke=Fw[1][0],[ot,ut]=ru.useState(Ke.expression),Xt=W8(ot),[$t,cr]=ru.useState(()=>G4(Ke.start)),[kr,tn]=ru.useState([]),Ur=ru.useRef(2),[yn,Mn]=ru.useState(!1),[ea,Bn]=ru.useState(!1),[Gi,bo]=ru.useState(null),[eo,li]=ru.useState(null),[Ge,wo]=ru.useState(null),[vl,Eo]=ru.useState([]),ui=ru.useRef(Ke.x),mo=ru.useRef([-1,1]),Rs=ru.useRef(!0),ki=ru.useRef(0),$s=()=>{ki.current=H4},Di=X4($t,cr,$s),zo=kr.map(qs=>X4(qs,Ul=>tn(lu=>lu.map(Vc=>Vc.id===qs.id?{...Vc,...Ul(Vc)}:Vc)),$s)),Nl=ru.useRef(null),Si=ru.useRef(0),Ii=ru.useRef([]),Ti=[{id:1,settings:Di.settings,color:_1[0].value,label:`1 · ${dM(Di.algorithm).label}`},...kr.map((qs,Ul)=>({id:qs.id,settings:zo[Ul].settings,color:qs.color,label:`${qs.id} · ${dM(qs.algorithm).label}`}))],So=Ti.map(qs=>qs.settings),ws=Di.startValid&&zo.every(qs=>qs.startValid),bu=ru.useCallback(async qs=>{const Ul=Si.current,lu=await LT.call("handle_state",{iteration:qs});if(!lu.ok)throw new Error(lu.error.message);return lu.data&&Ul===Si.current&&(Ii.current[qs]=lu.data),lu.data},[]),ba=wB(bu,{intervalMs:RV}),{stepper:qa}=ba;async function ro(){const qs=await LT.call("handle_function_values",{x_range:ui.current,y_range:mo.current});if(!qs.ok){console.error(`Python ${qs.error.kind} error: ${qs.error.message}`);return}const Ul=qs.data;Ul&&!("y"in Ul)&&Rs.current&&(mo.current=DV(Ul.f)??mo.current),Rs.current=!1,wo(Ul)}async function Kn(qs,Ul){const lu=++Si.current;if(qa.pause(),qs!==Nl.current){Nl.current=null;const Wd=await LT.call("handle_set_function",{variables:Xt,expression:ot});if(lu!==Si.current)return;if(bo(Wd.ok?null:Wd.error.message),!Wd.ok){wo(null),Eo([]),Ii.current=[],await qa.restart();return}if(Nl.current=qs,Rs.current=!0,await ro(),lu!==Si.current)return}const Vc=await LT.call("handle_set_runs",{runs:Ul.map(Wd=>Wd.settings)});lu===Si.current&&(li(Vc.ok?null:Vc.error.message),Ii.current=[],Eo(Vc.ok?Ul:[]),await qa.restart())}const vs=`${Xt} +${ot}`,Is=JSON.stringify(So);ru.useEffect(()=>{if(!ws)return;const qs=setTimeout(()=>Kn(vs,Ti),ki.current);return ki.current=0,()=>clearTimeout(qs)},[vs,Is]);function Ki(qs,Ul){const lu=W8(qs);if(ut(qs),lu!==Xt&&(Eo([]),wo(null),!Ul)){const Vc=Wd=>lu===2?[Wd[0],"0"]:[Wd[0]];Di.setStartText(Vc(Di.startText)),tn(Wd=>Wd.map($g=>({...$g,startText:Vc($g.startText)}))),lu===2&&(mo.current=ui.current)}Ul&&(Di.setStartText(Ul.start.map(String)),tn(Vc=>Vc.map(Wd=>({...Wd,startText:Ul.start.map(String)}))),ui.current=Ul.x,Ul.y&&(mo.current=Ul.y))}function Ns(qs){Ki(qs.expression,qs)}function ff(qs){ki.current=H4,Ki(qs)}function tc(qs,Ul,lu){qs.setStartText(Xt===1?[xk(ui.current,Ul)]:[xk(ui.current,Ul),xk(mo.current,lu)])}function Od(qs){const Ul=([lu,Vc])=>lu+(.05+.9*Math.random())*(Vc-lu);tc(qs,Ul(ui.current),Ul(mo.current))}function Gl(){return(Mk.find(qs=>qs.expression===ot)??Fw[Xt][0]).start}function pp(qs){qs.setStartText(Gl().map(String))}function Xf(){const qs=new Set([_1[0].value,...kr.map(Vc=>Vc.color)]),Ul=_1.find(Vc=>!qs.has(Vc.value))?.value??_1[1].value,lu=Ur.current++;return tn([...kr,{id:lu,color:Ul,...G4(Gl())}]),lu}function go(qs){const Ul=kr.filter(lu=>lu.id!==qs);Ul.length===0&&(Ur.current=2),tn(Ul)}function kv(qs,Ul){ui.current=qs,mo.current=Ul,ro()}const mp=Ii.current.slice(0,ba.iteration+1),Wg=vl.map((qs,Ul)=>({...qs,color:kr.find(lu=>lu.id===qs.id)?.color??qs.color,path:mp.map(lu=>lu?.runs[Ul]?.point).filter(lu=>!!lu),stopped:ba.state?.runs[Ul]?.stopped??null}));return{pythonStatus:we,variables:Xt,expression:ot,changeExpression:ff,choosePreset:Ns,functionError:Gi,surface:yn,setSurface:Mn,showArrows:ea,setShowArrows:Bn,main:Di,setStartAt:(qs,Ul)=>tc(Di,qs,Ul),randomStart:Od,resetStart:pp,runError:eo,comparisons:kr.map((qs,Ul)=>({id:qs.id,color:qs.color,editor:zo[Ul]})),canAddComparison:kr.length+1tn(lu=>lu.map(Vc=>Vc.id===qs?{...Vc,color:Ul}:Vc)),values:Ge,xRange:ui,yRange:mo,handleViewChange:kv,trajectories:Wg,step:ba}}const OV=[{label:"Univariate: f(x)",options:Fw[1].map(we=>we.name)},{label:"Bivariate: f(x, y)",options:Fw[2].map(we=>we.name)}],FV=[{value:"contour",label:"Contour"},{value:"surface",label:"Surface"}],oM="text-sm text-ink-muted";function BV(){const we=zV(),Ke=Mk.find(kr=>kr.expression===we.expression),ot=we.variables===2,ut=we.trajectories[0],Xt=ut?.path[ut.path.length-1],[$t,cr]=ru.useState(null);return ra.jsx(vB,{title:"Optimisation",usage:ra.jsx(gV,{}),examples:ra.jsx("p",{children:"Examples are coming soon."}),tabs:[{label:"Configure",content:ra.jsxs(ra.Fragment,{children:[ra.jsxs(W6,{label:"Function",children:[ra.jsx(uP,{label:"Function",hideLabel:!0,options:Ke?[]:[Z8],groupedOptions:OV,activeOption:Ke?.name??Z8,onChange:kr=>{const tn=Mk.find(Ur=>Ur.name===kr);tn&&we.choosePreset(tn)}}),ra.jsx(wk,{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}),ot&&ra.jsxs("div",{className:"grid grid-cols-3 items-center",children:[ra.jsx("div",{className:"col-span-2",children:ra.jsx(_B,{label:"Plot",options:FV,value:we.surface?"surface":"contour",onChange:kr=>we.setSurface(kr==="surface")})}),ra.jsxs("label",{title:we.surface?"Only on the contour plot":void 0,className:`flex items-center justify-end gap-1.5 whitespace-nowrap text-sm text-gray-700 ${we.surface?"opacity-50":"cursor-pointer"}`,children:[ra.jsx("input",{type:"checkbox",checked:we.showArrows,disabled:we.surface,onChange:kr=>we.setShowArrows(kr.target.checked),className:"size-4 accent-ink"}),"Gradient field"]})]})]}),ra.jsx(H8,{}),ra.jsx(W6,{label:"Optimiser",children:ra.jsx(pP,{editor:we.main,twoVariables:ot,onResetStart:()=>we.resetStart(we.main),onRandomStart:()=>we.randomStart(we.main),hint:ot&&we.surface?void 0:"Or click the plot to move the initial point."})})]})},{label:"Compare",content:ra.jsxs(ra.Fragment,{children:[ra.jsx("p",{className:oM,children:"Add optimisers to compare trajectories"}),ra.jsxs("ul",{className:"flex flex-col gap-2",children:[ra.jsx(Y4,{id:1,color:_1[0].value,editor:we.main,trajectory:ut,note:"Also set in Configure",open:$t===1,onToggle:()=>cr($t===1?null:1),twoVariables:ot,onResetStart:()=>we.resetStart(we.main),onRandomStart:()=>we.randomStart(we.main)}),we.comparisons.map(kr=>ra.jsx(Y4,{id:kr.id,color:kr.color,editor:kr.editor,trajectory:we.trajectories.find(tn=>tn.id===kr.id),taken:[_1[0].value,...we.comparisons.map(tn=>tn.color)],open:$t===kr.id,onToggle:()=>cr($t===kr.id?null:kr.id),onColorChange:tn=>we.setComparisonColor(kr.id,tn),onRemove:()=>we.removeComparison(kr.id),twoVariables:ot,onResetStart:()=>we.resetStart(kr.editor),onRandomStart:()=>we.randomStart(kr.editor)},kr.id))]}),ra.jsx(fM,{label:"+ Add optimiser",onClick:()=>cr(we.addComparison()),disabled:!we.canAddComparison})]})},{label:"Metrics",content:Xt?ra.jsxs(ra.Fragment,{children:[ra.jsx(LB,{title:"Current point",items:NV(Xt)}),ra.jsx(H8,{}),ra.jsx(W6,{label:"History",children:ra.jsx(VB,{trajectories:we.trajectories})})]}):ra.jsx("p",{className:oM,children:"Step the optimiser to see the current point and its history."})}],footer:ra.jsxs(ra.Fragment,{children:[we.pythonStatus==="loading"&&ra.jsx("p",{className:oM,children:"Loading Python… actions will run once it is ready."}),we.pythonStatus==="failed"&&ra.jsx("p",{className:"text-red-600 font-semibold",children:"Python failed to load. Try reloading the page."}),we.runError&&ra.jsx("p",{className:"text-red-600 font-semibold",children:we.runError}),ra.jsx(AB,{stepper:we.step}),we.trajectories.filter(kr=>kr.stopped).map(kr=>ra.jsxs("p",{className:oM,children:[kr.label," stopped at iteration ",kr.path.length-1,". ",kr.stopped]},kr.label))]}),children:ra.jsx(GB,{values:we.values,trajectories:we.trajectories,xRange:we.xRange,yRange:we.yRange,onViewChange:we.handleViewChange,onClick:we.setStartAt,surface:we.surface,arrows:we.showArrows})})}function NV(we){return we.position.length===1?[{name:"x",kind:"scalar",value:we.position[0]},{name:"f(x)",kind:"scalar",value:we.value},{name:"f′(x)",kind:"scalar",value:we.gradient[0]},{name:"f″(x)",kind:"scalar",value:we.hessian[0][0]}]:[{name:"Position",kind:"vector",value:{labels:["x","y"],values:we.position}},{name:"f(x, y)",kind:"scalar",value:we.value},{name:"Gradient ∇f",kind:"vector",value:{labels:["∂f/∂x","∂f/∂y"],values:we.gradient}},{name:"Hessian",kind:"matrix",value:{rows:["x","y"],columns:["x","y"],values:we.hessian}}]}function UV({trajectory:we}){const Ke=we?.path[we.path.length-1];return Ke?ra.jsxs("span",{className:"shrink-0 font-mono text-ink",children:["f = ",Number(Ke.value.toPrecision(3))]}):null}function Y4({id:we,color:Ke,editor:ot,trajectory:ut,note:Xt,open:$t,onToggle:cr,onColorChange:kr,onRemove:tn,taken:Ur=[],twoVariables:yn,onResetStart:Mn,onRandomStart:ea}){const Bn=`${we} · ${dM(ot.algorithm).label}`;return ra.jsxs("li",{className:"rounded-md border-[1.5px] border-grid",children:[ra.jsxs("div",{className:"flex items-center gap-2 py-1 pl-1 pr-1",children:[kr?ra.jsx(yB,{label:`Colour of run ${we}`,colors:_1,value:Ke,onChange:kr,taken:Ur}):ra.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center",title:`Run ${we}'s colour is fixed`,children:ra.jsx("span",{"aria-hidden":!0,className:"block size-6 rounded-full border-2 border-white ring-[1.5px] ring-grid",style:{backgroundColor:Ke}})}),ra.jsxs("button",{type:"button",onClick:cr,"aria-expanded":$t,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 self-stretch rounded px-1 text-left text-sm text-gray-700 hover:bg-paper",children:[ra.jsxs("span",{className:"min-w-0 flex-1",children:[ra.jsx("span",{className:"block truncate",children:Bn}),Xt&&ra.jsx("span",{className:"block text-xs text-ink-muted",children:Xt}),!ot.startValid&&ra.jsx("span",{className:"block text-xs font-semibold text-red-600",children:"Check the initial point"})]}),ra.jsx(UV,{trajectory:ut}),ra.jsx(aB,{size:16,"aria-hidden":!0,className:`shrink-0 text-ink-muted transition-transform ${$t?"rotate-180":""}`})]}),tn&&ra.jsx(PT,{label:`Remove run ${we}`,onClick:tn,children:ra.jsx(oP,{size:16})})]}),$t&&ra.jsx("div",{className:"flex flex-col gap-4 border-t border-grid p-3",children:ra.jsx(pP,{editor:ot,twoVariables:yn,onResetStart:Mn,onRandomStart:ea})})]})}XF.createRoot(document.getElementById("root")).render(ra.jsx(ru.StrictMode,{children:ra.jsx(BV,{})})); diff --git a/dist/assets/index-CkwIAi5p.js b/dist/assets/index-CkwIAi5p.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1b03bc201080f4e940c5750d7e577d695e9535 --- /dev/null +++ b/dist/assets/index-CkwIAi5p.js @@ -0,0 +1,3811 @@ +(function(){const Ke=document.createElement("link").relList;if(Ke&&Ke.supports&&Ke.supports("modulepreload"))return;for(const Xt of document.querySelectorAll('link[rel="modulepreload"]'))ut(Xt);new MutationObserver(Xt=>{for(const $t of Xt)if($t.type==="childList")for(const cr of $t.addedNodes)cr.tagName==="LINK"&&cr.rel==="modulepreload"&&ut(cr)}).observe(document,{childList:!0,subtree:!0});function ot(Xt){const $t={};return Xt.integrity&&($t.integrity=Xt.integrity),Xt.referrerPolicy&&($t.referrerPolicy=Xt.referrerPolicy),Xt.crossOrigin==="use-credentials"?$t.credentials="include":Xt.crossOrigin==="anonymous"?$t.credentials="omit":$t.credentials="same-origin",$t}function ut(Xt){if(Xt.ep)return;Xt.ep=!0;const $t=ot(Xt);fetch(Xt.href,$t)}})();function Nk(we){return we&&we.__esModule&&Object.prototype.hasOwnProperty.call(we,"default")?we.default:we}var q6={exports:{}},AT={};var R8;function FF(){if(R8)return AT;R8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.fragment");function ot(ut,Xt,$t){var cr=null;if($t!==void 0&&(cr=""+$t),Xt.key!==void 0&&(cr=""+Xt.key),"key"in Xt){$t={};for(var kr in Xt)kr!=="key"&&($t[kr]=Xt[kr])}else $t=Xt;return Xt=$t.ref,{$$typeof:we,type:ut,key:cr,ref:Xt!==void 0?Xt:null,props:$t}}return AT.Fragment=Ke,AT.jsx=ot,AT.jsxs=ot,AT}var I8;function BF(){return I8||(I8=1,q6.exports=FF()),q6.exports}var ra=BF(),V6={exports:{}},ku={};var D8;function NF(){if(D8)return ku;D8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.portal"),ot=Symbol.for("react.fragment"),ut=Symbol.for("react.strict_mode"),Xt=Symbol.for("react.profiler"),$t=Symbol.for("react.consumer"),cr=Symbol.for("react.context"),kr=Symbol.for("react.forward_ref"),tn=Symbol.for("react.suspense"),Ur=Symbol.for("react.memo"),yn=Symbol.for("react.lazy"),Mn=Symbol.for("react.activity"),ea=Symbol.iterator;function Bn(qa){return qa===null||typeof qa!="object"?null:(qa=ea&&qa[ea]||qa["@@iterator"],typeof qa=="function"?qa:null)}var Gi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bo=Object.assign,eo={};function li(qa,ro,Kn){this.props=qa,this.context=ro,this.refs=eo,this.updater=Kn||Gi}li.prototype.isReactComponent={},li.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")},li.prototype.forceUpdate=function(qa){this.updater.enqueueForceUpdate(this,qa,"forceUpdate")};function Ge(){}Ge.prototype=li.prototype;function wo(qa,ro,Kn){this.props=qa,this.context=ro,this.refs=eo,this.updater=Kn||Gi}var vl=wo.prototype=new Ge;vl.constructor=wo,bo(vl,li.prototype),vl.isPureReactComponent=!0;var Eo=Array.isArray;function ui(){}var mo={H:null,A:null,T:null,S:null},Rs=Object.prototype.hasOwnProperty;function ki(qa,ro,Kn){var vs=Kn.ref;return{$$typeof:we,type:qa,key:ro,ref:vs!==void 0?vs:null,props:Kn}}function $s(qa,ro){return ki(qa.type,ro,qa.props)}function Di(qa){return typeof qa=="object"&&qa!==null&&qa.$$typeof===we}function zo(qa){var ro={"=":"=0",":":"=2"};return"$"+qa.replace(/[=:]/g,function(Kn){return ro[Kn]})}var Nl=/\/+/g;function Si(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(ui,ui):(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,Kn,vs,Is){var Ki=typeof qa;(Ki==="undefined"||Ki==="boolean")&&(qa=null);var Ns=!1;if(qa===null)Ns=!0;else switch(Ki){case"bigint":case"string":case"number":Ns=!0;break;case"object":switch(qa.$$typeof){case we:case Ke:Ns=!0;break;case yn:return Ns=qa._init,Ti(Ns(qa._payload),ro,Kn,vs,Is)}}if(Ns)return Is=Is(qa),Ns=vs===""?"."+Si(qa,0):vs,Eo(Is)?(Kn="",Ns!=null&&(Kn=Ns.replace(Nl,"$&/")+"/"),Ti(Is,ro,Kn,"",function(Od){return Od})):Is!=null&&(Di(Is)&&(Is=$s(Is,Kn+(Is.key==null||qa&&qa.key===Is.key?"":(""+Is.key).replace(Nl,"$&/")+"/")+Ns)),ro.push(Is)),1;Ns=0;var ff=vs===""?".":vs+":";if(Eo(qa))for(var tc=0;tc>>1,ba=Ti[bu];if(0>>1;buXt(Kn,ws))vsXt(Is,Kn)?(Ti[bu]=Is,Ti[vs]=ws,bu=vs):(Ti[bu]=Kn,Ti[ro]=ws,bu=ro);else if(vsXt(Is,ws))Ti[bu]=Is,Ti[vs]=ws,bu=vs;else break e}}return So}function Xt(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 $t=performance;we.unstable_now=function(){return $t.now()}}else{var cr=Date,kr=cr.now();we.unstable_now=function(){return cr.now()-kr}}var tn=[],Ur=[],yn=1,Mn=null,ea=3,Bn=!1,Gi=!1,bo=!1,eo=!1,li=typeof setTimeout=="function"?setTimeout:null,Ge=typeof clearTimeout=="function"?clearTimeout:null,wo=typeof setImmediate<"u"?setImmediate:null;function vl(Ti){for(var So=ot(Ur);So!==null;){if(So.callback===null)ut(Ur);else if(So.startTime<=Ti)ut(Ur),So.sortIndex=So.expirationTime,Ke(tn,So);else break;So=ot(Ur)}}function Eo(Ti){if(bo=!1,vl(Ti),!Gi)if(ot(tn)!==null)Gi=!0,ui||(ui=!0,zo());else{var So=ot(Ur);So!==null&&Ii(Eo,So.startTime-Ti)}}var ui=!1,mo=-1,Rs=5,ki=-1;function $s(){return eo?!0:!(we.unstable_now()-kiTi&&$s());){var bu=Mn.callback;if(typeof bu=="function"){Mn.callback=null,ea=Mn.priorityLevel;var ba=bu(Mn.expirationTime<=Ti);if(Ti=we.unstable_now(),typeof ba=="function"){Mn.callback=ba,vl(Ti),So=!0;break t}Mn===ot(tn)&&ut(tn),vl(Ti)}else ut(tn);Mn=ot(tn)}if(Mn!==null)So=!0;else{var qa=ot(Ur);qa!==null&&Ii(Eo,qa.startTime-Ti),So=!1}}break e}finally{Mn=null,ea=ws,Bn=!1}So=void 0}}finally{So?zo():ui=!1}}}var zo;if(typeof wo=="function")zo=function(){wo(Di)};else if(typeof MessageChannel<"u"){var Nl=new MessageChannel,Si=Nl.port2;Nl.port1.onmessage=Di,zo=function(){Si.postMessage(null)}}else zo=function(){li(Di,0)};function Ii(Ti,So){mo=li(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(Ur,Ti),ot(tn)===null&&Ti===ot(Ur)&&(bo?(Ge(mo),mo=-1):bo=!0,Ii(Eo,ws-bu))):(Ti.sortIndex=ba,Ke(tn,Ti),Gi||Bn||(Gi=!0,ui||(ui=!0,zo()))),Ti},we.unstable_shouldYield=$s,we.unstable_wrapCallback=function(Ti){var So=ea;return function(){var ws=ea;ea=So;try{return Ti.apply(this,arguments)}finally{ea=ws}}}})(X6)),X6}var F8;function jF(){return F8||(F8=1,G6.exports=UF()),G6.exports}var Y6={exports:{}},Qv={};var B8;function qF(){if(B8)return Qv;B8=1;var we=_M();function Ke(tn){var Ur="https://react.dev/errors/"+tn;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(we)}catch(Ke){console.error(Ke)}}return we(),Y6.exports=qF(),Y6.exports}var U8;function HF(){if(U8)return ST;U8=1;var we=jF(),Ke=_M(),ot=VF();function ut(O){var W="https://react.dev/errors/"+O;if(1ba||(O.current=bu[ba],bu[ba]=null,ba--)}function Kn(O,W){ba++,bu[ba]=O.current,O.current=W}var vs=qa(null),Is=qa(null),Ki=qa(null),Ns=qa(null);function ff(O,W){switch(Kn(Ki,W),Kn(Is,O),Kn(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),Kn(vs,O)}function tc(){ro(vs),ro(Is),ro(Ki)}function Od(O){O.memoizedState!==null&&Kn(Ns,O);var W=vs.current,ve=b3(W,O.type);W!==ve&&(Kn(Is,O),Kn(vs,ve))}function Gl(O){Is.current===O&&(ro(vs),ro(Is)),Ns.current===O&&(ro(Ns),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 Wg(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 qs(O){try{var W="",ve=null;do W+=Wg(O,ve),ve=O,O=O.return;while(O);return W}catch(Ie){return` +Error generating stack: `+Ie.message+` +`+Ie.stack}}var Ul=Object.prototype.hasOwnProperty,lu=we.unstable_scheduleCallback,Vc=we.unstable_cancelCallback,Wd=we.unstable_shouldYield,$g=we.unstable_requestPaint,bv=we.unstable_now,Uw=we.unstable_getCurrentPriorityLevel,oo=we.unstable_ImmediatePriority,us=we.unstable_UserBlockingPriority,nu=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:TM,nm=Math.log,Dp=Math.LN2;function TM(O){return O>>>=0,O===0?32:31-(nm(O)/Dp|0)|0}var ax=256,ix=262144,ox=4194304;function Qm(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 sx(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 wn=Ie&134217727;return wn!==0?(Ie=wn&~Pt,Ie!==0?ht=Qm(Ie):(Ir&=wn,Ir!==0?ht=Qm(Ir):ve||(ve=wn&~O,ve!==0&&(ht=Qm(ve))))):(wn=Ie&~Pt,wn!==0?ht=Qm(wn):Ir!==0?ht=Qm(Ir):ve||(ve=Ie&~O,ve!==0&&(ht=Qm(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 b1(O,W){return(O.pendingLanes&~(O.suspendedLanes&~O.pingedLanes)&W)===0}function AM(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 BT(){var O=ox;return ox<<=1,(ox&62914560)===0&&(ox=4194304),O}function jw(O){for(var W=[],ve=0;31>ve;ve++)W.push(O);return W}function w1(O,W){O.pendingLanes|=W,W!==268435456&&(O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0)}function SM(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 wn=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 S1=/[\n"\\]/g;function yp(O){return O.replace(S1,function(W){return"\\"+W.charCodeAt(0).toString(16)+" "})}function fx(O,W,ve,Ie,ht,Pt,Ir,wn){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"),wn!=null&&typeof wn!="function"&&typeof wn!="symbol"&&typeof wn!="boolean"?O.name=""+gp(wn):O.removeAttribute("name")}function ry(O,W,ve,Ie,ht,Pt,Ir,wn){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)){cx(O);return}ve=ve!=null?""+gp(ve):"",W=W!=null?""+gp(W):ve,wn||W===O.value||(O.value=W),O.defaultValue=W}Ie=Ie??ht,Ie=typeof Ie!="function"&&typeof Ie!="symbol"&&!!Ie,O.checked=wn?O.checked:!!Ie,O.defaultChecked=!!Ie,Ir!=null&&typeof Ir!="function"&&typeof Ir!="symbol"&&typeof Ir!="boolean"&&(O.name=Ir),cx(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(l0)try{var Op={};Object.defineProperty(Op,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Op,Op),window.removeEventListener("test",Op,Op)}catch{yd=!1}var Pv=null,dx=null,yh=null;function XT(){if(yh)return yh;var O,W=dx,ve=W.length,Ie,ht="value"in Pv?Pv.value:Pv.textContent,Pt=ht.length;for(O=0;O=k1),C1=" ",mx=!1;function gx(O,W){switch(O){case"keyup":return FM.indexOf(W.keyCode)!==-1;case"keydown":return W.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yx(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 yx(W);case"keypress":return W.which!==32?null:(mx=!0,C1);case"textInput":return O=W.data,O===C1&&mx?null:O;default:return null}}function n5(O,W){if(_p)return O==="compositionend"||!Jw&&gx(O,W)?(O=XT(),yh=dx=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=s5(ve)}}function u5(O,W){return O&&W?O===W?!0:O&&O.nodeType===3?!1:W&&W.nodeType===3?u5(O,W.parentNode):"contains"in O?O.contains(W):O.compareDocumentPosition?!!(O.compareDocumentPosition(W)&16):!1:!1}function c5(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 jM=l0&&"documentMode"in document&&11>=document.documentMode,ay=null,bx=null,fm=null,hm=!1;function u0(O,W,ve){var Ie=ve.window===ve?ve.document:ve.nodeType===9?ve:ve.ownerDocument;hm||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}),fm&&P1(fm,Ie)||(fm=Ie,Ie=g_(bx,"onSelect"),0>=Ir,ht-=Ir,Zf=1<<32-If(W)+ht|ve<xu?(Xu=Us,Us=null):Xu=Us.sibling;var Rc=Pi(si,Us,xi[xu],ao);if(Rc===null){Us===null&&(Us=Xu);break}O&&Us&&Rc.alternate===null&&W(si,Us),Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc,Us=Xu}if(xu===xi.length)return ve(si,Us),Vu&&Ph(si,xu),bl;if(Us===null){for(;xuxu?(Xu=Us,Us=null):Xu=Us.sibling;var Bm=Pi(si,Us,Rc.value,ao);if(Bm===null){Us===null&&(Us=Xu);break}O&&Us&&Bm.alternate===null&&W(si,Us),Xa=Pt(Bm,Xa,xu),xc===null?bl=Bm:xc.sibling=Bm,xc=Bm,Us=Xu}if(Rc.done)return ve(si,Us),Vu&&Ph(si,xu),bl;if(Us===null){for(;!Rc.done;xu++,Rc=xi.next())Rc=uo(si,Rc.value,ao),Rc!==null&&(Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc);return Vu&&Ph(si,xu),bl}for(Us=Ie(Us);!Rc.done;xu++,Rc=xi.next())Rc=Ui(Us,si,xu,Rc.value,ao),Rc!==null&&(O&&Rc.alternate!==null&&Us.delete(Rc.key===null?xu:Rc.key),Xa=Pt(Rc,Xa,xu),xc===null?bl=Rc:xc.sibling=Rc,xc=Rc);return O&&Us.forEach(function(gE){return W(si,gE)}),Vu&&Ph(si,xu),bl}function Sf(si,Xa,xi,ao){if(typeof xi=="object"&&xi!==null&&xi.type===bo&&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===bo){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===Rs&&dg(bl)===Xa.type){ve(si,Xa.sibling),ao=ht(Xa,xi.props),U1(ao,xi),ao.return=si,si=ao;break e}ve(si,Xa);break}else W(si,Xa);Xa=Xa.sibling}xi.type===bo?(ao=dm(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),U1(ao,xi),ao.return=si,si=ao)}return Ir(si);case Gi: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 Rs:return xi=dg(xi),Sf(si,Xa,xi,ao)}if(Ii(xi))return Ks(si,Xa,xi,ao);if(zo(xi)){if(bl=zo(xi),typeof bl!="function")throw Error(ut(150));return xi=bl.call(xi),jl(si,Xa,xi,ao)}if(typeof xi.then=="function")return Sf(si,Xa,Rx(xi),ao);if(xi.$$typeof===wo)return Sf(si,Xa,Ex(si,xi),ao);kc(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{N1=0;var bl=Sf(si,Xa,xi,ao);return dy=null,bl}catch(Us){if(Us===gm||Us===hy)throw Us;var xc=Jd(29,Us,null,si.mode);return xc.lanes=ao,xc.return=si,xc}}}var ym=y2(!0),T5=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 _m(O){return{lane:O,tag:0,payload:null,callback:null,next:null}}function xm(O,W,ve){var Ie=O.updateQueue;if(Ie===null)return null;if(Ie=Ie.shared,(Lc&2)!==0){var ht=Ie.pending;return ht===null?W.next=W:(W.next=ht.next,ht.next=W),Ie.pending=W,W=Sx(O),qp(O,null,ve),W}return Ax(O,Ie,W,ve),Sx(O)}function j1(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 q1(){if(w2){var O=fy;if(O!==null)throw O}}function V1(O,W,ve,Ie){w2=!1;var ht=O.updateQueue;U0=!1;var Pt=ht.firstBaseUpdate,Ir=ht.lastBaseUpdate,wn=ht.shared.pending;if(wn!==null){ht.shared.pending=null;var Ma=wn,Ai=Ma.next;Ma.next=null,Ir===null?Pt=Ai:Ir.next=Ai,Ir=Ma;var no=O.alternate;no!==null&&(no=no.updateQueue,wn=no.lastBaseUpdate,wn!==Ir&&(wn===null?no.firstBaseUpdate=Ai:wn.next=Ai,no.lastBaseUpdate=Ma))}if(Pt!==null){var uo=ht.baseState;Ir=0,no=Ai=Ma=null,wn=Pt;do{var Pi=wn.lane&-536870913,Ui=Pi!==wn.lane;if(Ui?(ic&Pi)===Pi:(Ie&Pi)===Pi){Pi!==0&&Pi===hg&&(w2=!0),no!==null&&(no=no.next={lane:0,tag:wn.tag,payload:wn.payload,callback:null,next:null});e:{var Ks=O,jl=wn;Pi=W;var Sf=ve;switch(jl.tag){case 1:if(Ks=jl.payload,typeof Ks=="function"){uo=Ks.call(Sf,uo,Pi);break e}uo=Ks;break e;case 3:Ks.flags=Ks.flags&-65537|128;case 0:if(Ks=jl.payload,Pi=typeof Ks=="function"?Ks.call(Sf,uo,Pi):Ks,Pi==null)break e;uo=Mn({},uo,Pi);break e;case 2:U0=!0}}Pi=wn.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:wn.tag,payload:wn.payload,callback:wn.callback,next:null},no===null?(Ai=no=Ui,Ma=uo):no=no.next=Ui,Ir|=Pi;if(wn=wn.next,wn===null){if(wn=ht.shared.pending,wn===null)break;Ui=wn,wn=Ui.next,Ui.next=null,ht.lastBaseUpdate=Ui,ht.shared.pending=null}}while(!0);no===null&&(Ma=uo),ht.baseState=Ma,ht.firstBaseUpdate=Ai,ht.lastBaseUpdate=no,Pt===null&&(ht.shared.lanes=0),Z0|=Ir,O.lanes=Ir,O.memoizedState=uo}}function A5(O,W){if(typeof O!="function")throw Error(ut(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,wn={};Ti.T=wn,J1(O,!1,W,ve);try{var Ma=ht(),Ai=Ti.S;if(Ai!==null&&Ai(wn,Ma),Ma!==null&&typeof Ma=="object"&&typeof Ma.then=="function"){var no=YM(Ma,Ie);_y(O,W,no,fv(O))}else _y(O,W,Ie,fv(O))}catch(uo){_y(O,W,{then:function(){},status:"rejected",reason:uo},fv())}finally{So.p=Pt,Ir!==null&&wn.types!==null&&(Ir.types=wn.types),Ti.T=Ir}}function rb(){}function nb(O,W,ve,Ie){if(O.tag!==5)throw Error(ut(476));var ht=K1(O).queue;D2(O,ht,W,ws,ve===null?rb:function(){return z2(O),ve(Ie)})}function K1(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:d0,lastRenderedState:ws},next:null};var ve={};return W.next={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:ve},next:null},O.memoizedState=W,O=O.alternate,O!==null&&(O.memoizedState=W),W}function z2(O){var W=K1(O);W.next===null&&(W=O.alternate.memoizedState),_y(O,W.next.queue,{},fv())}function ab(){return jd(qy)}function z5(){return bh().memoizedState}function O2(){return bh().memoizedState}function O5(O){for(var W=O.return;W!==null;){switch(W.tag){case 24:case 3:var ve=fv();O=_m(ve);var Ie=xm(W,O,ve);Ie!==null&&(Nv(Ie,W,ve),j1(Ie,W,ve)),W={cache:p2()},O.payload=W;return}W=W.return}}function F5(O,W,ve){var Ie=fv();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),B5(ve,W,Ie)))}function ib(O,W,ve){var Ie=fv();_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,wn=Pt(Ir,ve);if(ht.hasEagerState=!0,ht.eagerState=wn,np(wn,Ir))return Ax(O,W,ht,0),Of===null&&I1(),!1}catch{}if(ve=l2(O,W,ht,Ie),ve!==null)return Nv(ve,O,Ie),B5(ve,W,Ie),!0}return!1}function J1(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(ut(479))}else W=l2(O,ve,Ie,2),W!==null&&Nv(W,O,2)}function xy(O){var W=O.alternate;return O===ou||W!==null&&W===ou}function F2(O,W){my=wm=!0;var ve=O.pending;ve===null?W.next=W:(W.next=ve.next,ve.next=W),O.pending=W}function B5(O,W,ve){if((ve&4194048)!==0){var Ie=W.lanes;Ie&=O.pendingLanes,ve|=Ie,W.lanes=ve,qw(O,ve)}}var Q1={readContext:jd,use:Ox,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};Q1.useEffectEvent=xh;var B2={readContext:jd,use:Ox,useCallback:function(O,W){return bd().memoizedState=[O,W===void 0?null:W],O},useContext:jd,useEffect:Kx,useImperativeHandle:function(O,W,ve){ve=ve!=null?ve.concat([O]):null,Wx(4194308,4,Qx.bind(null,W,O),ve)},useLayoutEffect:function(O,W){return Wx(4194308,4,O,W)},useInsertionEffect:function(O,W){Wx(4,2,O,W)},useMemo:function(O,W){var ve=bd();W=W===void 0?null:W;var Ie=O();if(pg){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(pg){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=F5.bind(null,ou,O),[Ie.memoizedState,O]},useRef:function(O){var W=bd();return O={current:O},W.memoizedState=O},useState:function(O){O=Y1(O);var W=O.queue,ve=ib.bind(null,ou,W);return W.dispatch=ve,[O.memoizedState,ve]},useDebugValue:eb,useDeferredValue:function(O,W){var ve=bd();return $1(ve,O,W)},useTransition:function(){var O=Y1(!1);return O=D2.bind(null,ou,O.queue,!0,!1),bd().memoizedState=O,[!1,O]},useSyncExternalStore:function(O,W,ve){var Ie=ou,ht=bd();if(Vu){if(ve===void 0)throw Error(ut(407));ve=ve()}else{if(ve=W(),Of===null)throw Error(ut(349));(ic&127)!==0||Ux(Ie,W,ve)}ht.memoizedState=ve;var Pt={value:ve,getSnapshot:W};return ht.queue=Pt,Kx(qx.bind(null,Ie,Pt,O),[O]),Ie.flags|=2048,yy(9,{destroy:void 0},jx.bind(null,Ie,Pt,ve,W),null),ve},useId:function(){var O=bd(),W=Of.identifierPrefix;if(Vu){var ve=bp,Ie=Zf;ve=(Ie&~(1<<32-If(Ie)-1)).toString(32)+ve,W="_"+W+"R_"+ve,ve=mg++,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[sv]=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&&v0(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&&v0(W);else{if(typeof Ie!="string"&&W.stateNode===null)throw Error(ut(166));if(O=Ki.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||Mb(O.nodeValue,ve)),O||vm(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(ut(318));if(O=W.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(ut(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(ut(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(ut(318));if(ht=W.memoizedState,ht=ht!==null?ht.dehydrated:null,!ht)throw Error(ut(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),db(W,W.updateQueue),eh(W),null);case 4:return tc(),O===null&&Fy(W.stateNode.containerInfo),eh(W),null;case 10:return Xp(W.type),eh(W),null;case 19:if(ro(cc),Ie=W.memoizedState,Ie===null)return eh(W),null;if(ht=(W.flags&128)!==0,Pt=Ie.rendering,Pt===null)if(ht)t_(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,t_(Ie,!1),O=Pt.updateQueue,W.updateQueue=O,db(W,O),W.subtreeFlags=0,O=ve,ve=W.child;ve!==null;)v5(ve,O),ve=ve.sibling;return Kn(cc,cc.current&1|2),Vu&&Ph(W,Ie.treeForkCount),W.child}O=O.sibling}Ie.tail!==null&&bv()>mb&&(W.flags|=128,ht=!0,t_(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,db(W,O),t_(Ie,!0),Ie.tail===null&&Ie.tailMode==="hidden"&&!Pt.alternate&&!Vu)return eh(W),null}else 2*bv()-Ie.renderingStartTime>mb&&ve!==536870912&&(W.flags|=128,ht=!0,t_(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=bv(),O.sibling=null,ve=cc.current,Kn(cc,ht?ve&1|2:ve&1),Vu&&Ph(W,Ie.treeForkCount),O):(eh(W),null);case 22:case 23:return cp(W),bm(),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&&db(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(mm),null;case 24:return ve=null,O!==null&&(ve=O.memoizedState.cache),W.memoizedState.cache!==ve&&(W.flags|=2048),Xp(od),eh(W),null;case 25:return null;case 30:return null}throw Error(ut(156,W.tag))}function eE(O,W){switch(lg(W),W.tag){case 1:return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 3:return Xp(od),tc(),O=W.flags,(O&65536)!==0&&(O&128)===0?(W.flags=O&-65537|128,W):null;case 26:case 27:case 5:return Gl(W),null;case 31:if(W.memoizedState!==null){if(cp(W),W.alternate===null)throw Error(ut(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(ut(340));B0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 19:return ro(cc),null;case 4:return tc(),null;case 10:return Xp(W.type),null;case 22:case 23:return cp(W),bm(),O!==null&&ro(mm),O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 24:return Xp(od),null;case 25:return null;default:return null}}function nA(O,W){switch(lg(W),W.tag){case 3:Xp(od),tc();break;case 26:case 27:case 5:Gl(W);break;case 4:tc();break;case 31:W.memoizedState!==null&&cp(W);break;case 13:cp(W);break;case 19:ro(cc);break;case 10:Xp(W.type);break;case 22:case 23:cp(W),bm(),O!==null&&ro(mm);break;case 24:Xp(od)}}function r_(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(wn){hf(W,W.return,wn)}}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,wn=Ir.destroy;if(wn!==void 0){Ir.destroy=void 0,ht=W;var Ma=ve,Ai=wn;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 aA(O,W,ve){ve.props=yg(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 Zp(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 iA(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[sv]=W}catch(ht){hf(O,O.return,ht)}}function _g(O){return O.tag===5||O.tag===3||O.tag===26||O.tag===27&&x0(O.type)||O.tag===4}function n_(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||_g(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&&x0(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=pc));else if(Ie!==4&&(Ie===27&&x0(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 a_(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&&x0(O.type)&&(ve=O.stateNode),O=O.child,O!==null))for(a_(O,W,ve),O=O.sibling;O!==null;)a_(O,W,ve),O=O.sibling}function oA(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[sv]=ve}catch(Pt){hf(O,O.return,Pt)}}var H0=!1,ld=!1,r3=!1,n3=typeof WeakSet=="function"?WeakSet:Set,Rh=null;function tE(O,W){if(O=O.containerInfo,K0=L_,O=c5(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,wn=-1,Ma=-1,Ai=0,no=0,uo=O,Pi=null;t:for(;;){for(var Ui;uo!==ve||ht!==0&&uo.nodeType!==3||(wn=Ir+ht),uo!==Pt||Ie!==0&&uo.nodeType!==3||(Ma=Ir+Ie),uo.nodeType===3&&(Ir+=uo.nodeValue.length),(Ui=uo.firstChild)!==null;)Pi=uo,uo=Ui;for(;;){if(uo===O)break t;if(Pi===ve&&++Ai===ht&&(wn=Ir),Pi===Pt&&++no===Ie&&(Ma=Ir),(Ui=uo.nextSibling)!==null)break;uo=Pi,Pi=uo.parentNode}uo=Ui}ve=wn===-1||Ma===-1?null:{start:wn,end:Ma}}else ve=null}ve=ve||{start:0,end:0}}else ve=null;for(Im={focusedElem:O,selectionRange:ve},L_=!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=qA("link","href",ht).get(Ie+(ve.href||""));if(Ir){for(var wn=0;wnSf&&(Ir=Sf,Sf=jl,jl=Ir);var si=l5(wn,jl),Xa=l5(wn,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=uo.createRange();xi.setStart(si.node,si.offset),Ui.removeAllRanges(),jl>Sf?(Ui.addRange(xi),Ui.extend(Xa.node,Xa.offset)):(xi.setEnd(Xa.node,Xa.offset),Ui.addRange(xi))}}}}for(uo=[],Ui=wn;Ui=Ui.parentNode;)Ui.nodeType===1&&uo.push({element:Ui,left:Ui.scrollLeft,top:Ui.scrollTop});for(typeof wn.focus=="function"&&wn.focus(),wn=0;wnve?32:ve,Ti.T=null,ve=u3,u3=null;var Pt=Cm,Ir=W0;if(ud=0,wg=Cm=null,W0=0,(Lc&6)!==0)throw Error(ut(331));var wn=Lc;if(Lc|=4,Sy(Pt.current),dA(Pt,Pt.current,Ir,ve),Lc=wn,c_(0,!1),pd&&typeof pd.onPostCommitFiberRoot=="function")try{pd.onPostCommitFiberRoot(wv,Pt)}catch{}return!0}finally{So.p=ht,Ti.T=Ie,LA(O,W)}}function RA(O,W,ve){W=Lh(ve,W),W=q0(O.stateNode,W,2),O=xm(O,W,2),O!==null&&(w1(O,2),y0(O))}function hf(O,W,ve){if(O.tag===3)RA(O,O,ve);else for(;W!==null;){if(W.tag===3){RA(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=G5(2),Ie=xm(W,ve,2),Ie!==null&&(X5(ve,Ie,W,O),w1(Ie,2),y0(Ie));break}}W=W.return}}function h3(O,W,ve){var Ie=O.pingCache;if(Ie===null){Ie=O.pingCache=new mA;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)||(Em=!0,ht.add(ve),O=lE.bind(null,O,W,ve),W.then(O,O))}function lE(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>bv()-s_?(Lc&2)===0&&ky(O,0):l3|=ve,km===ic&&(km=0)),y0(O)}function IA(O,W){W===0&&(W=BT()),O=jp(O,W),O!==null&&(w1(O,W),y0(O))}function Ly(O){var W=O.memoizedState,ve=0;W!==null&&(ve=W.retryLane),IA(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(ut(314))}Ie!==null&&Ie.delete(W),IA(O,ve)}function d3(O,W){return lu(O,W)}var Tb=null,g0=null,v3=!1,Ry=!1,p3=!1,Pm=0;function y0(O){O!==g0&&O.next===null&&(g0===null?Tb=g0=O:g0=g0.next=O),Ry=!0,v3||(v3=!0,cE())}function c_(O,W){if(!p3&&Ry){p3=!0;do for(var ve=!1,Ie=Tb;Ie!==null;){if(O!==0){var ht=Ie.pendingLanes;if(ht===0)var Pt=0;else{var Ir=Ie.suspendedLanes,wn=Ie.pingedLanes;Pt=(1<<31-If(42|O)+1)-1,Pt&=ht&~(Ir&~wn),Pt=Pt&201326741?Pt&201326741|1:Pt?Pt|2:0}Pt!==0&&(ve=!0,DA(Ie,Pt))}else Pt=ic,Pt=sx(Ie,Ie===Of?Pt:0,Ie.cancelPendingCommit!==null||Ie.timeoutHandle!==-1),(Pt&3)===0||b1(Ie,Pt)||(ve=!0,DA(Ie,Pt));Ie=Ie.next}while(ve);p3=!1}}function uE(){m3()}function m3(){Ry=v3=!1;var O=0;Pm!==0&&BA()&&(O=Pm);for(var W=bv(),ve=null,Ie=Tb;Ie!==null;){var ht=Ie.next,Pt=f_(Ie,W);Pt===0?(Ie.next=null,ve===null?Tb=ht:ve.next=ht,ht===null&&(g0=ve)):(ve=Ie,(O!==0||(Pt&3)!==0)&&(Ry=!0)),Ie=ht}ud!==0&&ud!==5||c_(O),Pm!==0&&(Pm=0)}function f_(O,W){for(var ve=O.suspendedLanes,Ie=O.pingedLanes,ht=O.expirationTimes,Pt=O.pendingLanes&-62914561;0wn)break;var no=Ma.transferSize,uo=Ma.initiatorType;no&&$0(uo)&&(Ma=Ma.responseEnd,Ir+=no*(Ma"u"?null:document;function Db(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+'"]'),Ib.has(ht)||(Ib.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 Eg(O){Jp.D(O),Db("dns-prefetch",O,null)}function C3(O,W){Jp.C(O,W),Db("preconnect",O,W)}function zb(O,W,ve){Jp.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=Dm(O);break;case"script":Pt=Cg(O)}qv.has(Pt)||(O=Mn({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(w_(Pt))||W==="script"&&Ie.querySelector(Lg(Pt))||(W=Ie.createElement("link"),cd(W,"link",O),Fd(W),Ie.head.appendChild(W)))}}function Ob(O,W){Jp.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=Cg(O)}if(!qv.has(Pt)&&(O=Mn({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(Lg(Pt)))return}Ie=ve.createElement("link"),cd(Ie,"link",O),Fd(Ie),ve.head.appendChild(Ie)}}}function b_(O,W,ve){Jp.S(O,W,ve);var Ie=Ny;if(Ie&&O){var ht=ey(Ie).hoistableStyles,Pt=Dm(O);W=W||"default";var Ir=ht.get(Pt);if(!Ir){var wn={loading:0,preload:null};if(Ir=Ie.querySelector(w_(Pt)))wn.loading=5;else{O=Mn({rel:"stylesheet",href:O,"data-precedence":W},ve),(ve=qv.get(Pt))&&Pg(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(){wn.loading|=1}),Ma.addEventListener("error",function(){wn.loading|=2}),wn.loading|=4,T_(Ir,W,Ie)}Ir={type:"stylesheet",instance:Ir,count:1,state:wn},ht.set(Pt,Ir)}}}function Uy(O,W){Jp.X(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Cg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Lg(ht)),Pt||(O=Mn({src:O,async:!0},W),(W=qv.get(ht))&&Bb(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){Jp.M(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Cg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Lg(ht)),Pt||(O=Mn({src:O,async:!0,type:"module"},W),(W=qv.get(ht))&&Bb(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 Fb(O,W,ve,Ie){var ht=(ht=Ki.current)?w0(ht):null;if(!ht)throw Error(ut(446));switch(O){case"meta":case"title":return null;case"style":return typeof ve.precedence=="string"&&typeof ve.href=="string"?(W=Dm(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=Dm(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(w_(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||jA(ht,O,ve,Ir.state))),W&&Ie===null)throw Error(ut(528,""));return Ir}if(W&&Ie!==null)throw Error(ut(529,""));return null;case"script":return W=ve.async,ve=ve.src,typeof ve=="string"&&W&&typeof W!="function"&&typeof W!="symbol"?(W=Cg(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(ut(444,O))}}function Dm(O){return'href="'+yp(O)+'"'}function w_(O){return'link[rel="stylesheet"]['+O+"]"}function kg(O){return Mn({},O,{"data-precedence":O.precedence,precedence:null})}function jA(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 Cg(O){return'[src="'+yp(O)+'"]'}function Lg(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=Mn({},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),T_(Ie,ve.precedence,O),W.instance=Ie;case"stylesheet":ht=Dm(ve.href);var Pt=O.querySelector(w_(ht));if(Pt)return W.state.loading|=4,W.instance=Pt,Fd(Pt),Pt;Ie=kg(ve),(ht=qv.get(ht))&&Pg(Ie,ht),Pt=(O.ownerDocument||O).createElement("link"),Fd(Pt);var Ir=Pt;return Ir._p=new Promise(function(wn,Ma){Ir.onload=wn,Ir.onerror=Ma}),cd(Pt,"link",Ie),W.state.loading|=4,T_(Pt,ve.precedence,O),W.instance=Pt;case"script":return Pt=Cg(ve.src),(ht=O.querySelector(Lg(Pt)))?(W.instance=ht,Fd(ht),ht):(Ie=ve,(ht=qv.get(Pt))&&(Ie=Mn({},ve),Bb(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(ut(443,W.type))}else W.type==="stylesheet"&&(W.state.loading&4)===0&&(Ie=W.instance,W.state.loading|=4,T_(Ie,ve.precedence,O));return W.instance}function T_(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 vE(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=Dm(Ie.href),Pt=W.querySelector(w_(ht));if(Pt){W=Pt._p,W!==null&&typeof W=="object"&&typeof W.then=="function"&&(O.count++,O=M_.bind(O),W.then(O,O)),ve.state.loading|=4,ve.instance=Pt,Fd(Pt);return}Pt=W.ownerDocument||W,Ie=kg(Ie),(ht=qv.get(ht))&&Pg(Ie,ht),Pt=Pt.createElement("link"),Fd(Pt);var Ir=Pt;Ir._p=new Promise(function(wn,Ma){Ir.onload=wn,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=M_.bind(O),W.addEventListener("load",ve),W.addEventListener("error",ve))}}var Nb=0;function Ub(O,W){return O.stylesheets&&O.count===0&&k_(O,O.stylesheets),0Nb?50:800)+W);return O.unsuspend=ve,function(){O.unsuspend=null,clearTimeout(Ie),clearTimeout(ht)}}:null}function M_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)k_(this,this.stylesheets);else if(this.unsuspend){var O=this.unsuspend;this.unsuspend=null,O()}}}var E_=null;function k_(O,W){O.stylesheets=null,O.unsuspend!==null&&(O.count++,E_=new Map,W.forEach(R3,O),E_=null,M_.call(O))}function R3(O,W){if(!(W.state.loading&4)){var ve=E_.get(O);if(ve)var Ie=ve.get(null);else{ve=new Map,E_.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(),H6.exports=HF(),H6.exports}var XF=GF();const YF=we=>we?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ZF(we,Ke,ot=[]){if(Ke==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:YF(we),size:24,node:Ke,...ot.length>0?{aliases:ot}:{}}}const WF=we=>{let Ke="",ot=!1;for(const ut of we){if(ut==="-"||ut==="_"||ut<=" "){ot=Ke.length>0;continue}Ke.length===0?Ke+=ut.toLowerCase():Ke+=ot?ut.toUpperCase():ut,ot=!1}return Ke};const $F=we=>{const Ke=WF(we);return Ke.charAt(0).toUpperCase()+Ke.slice(1)};const bk=(...we)=>we.filter((Ke,ot,ut)=>!!Ke&&Ke.trim()!==""&&ut.indexOf(Ke)===ot).join(" ").trim();const tx={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 Z6(we){return we!=null}function KF(we,Ke={}){const ot=Ke.attributeNames??{},ut=ea=>ot[ea]??ea,Xt=we.size??we.width??tx.width,$t=we.size??we.height??tx.height,cr=we.aliases?.filter(ea=>typeof ea=="string"&&ea.trim()!=="").map(ea=>`lucide-${ea}`)??[],kr=[...we.name?[`lucide-${we.name}`]:[],...cr],tn=Ke.className?.split(" ").filter(Boolean)??[],Ur=Ke.includeDefaultClasses===!1?bk(...tn):bk("lucide",...kr,...tn),yn=Ke.absoluteStrokeWidth?Number(Ke.strokeWidth??tx["stroke-width"])*Number(we.size??we.width??tx.width)/Number(Ke.size??Ke.width??tx.width):Ke.strokeWidth??tx["stroke-width"];return["svg",{...Object.entries(tx).reduce((ea,[Bn,Gi])=>(ea[ut(Bn)]=Gi,ea),{}),..."color"in Ke&&Ke.color&&{[ut("stroke")]:Ke.color},..."size"in Ke&&Z6(Ke.size)&&{[ut("width")]:Ke.size,[ut("height")]:Ke.size},..."width"in Ke&&Z6(Ke.width)&&{[ut("width")]:Ke.width},..."height"in Ke&&Z6(Ke.height)&&{[ut("height")]:Ke.height},[ut("stroke-width")]:yn,...Ur&&{[ut("class")]:Ur},[ut("viewBox")]:`0 0 ${Xt} ${$t}`,...Ke.hasA11yProp===!1?{[ut("aria-hidden")]:"true"}:{},..."attributes"in Ke&&Ke.attributes},we.node.map(ea=>{const[Bn,Gi,bo]=ea,eo=Ke.nonScalingStroke?{[ut("vector-effect")]:"non-scaling-stroke",...Gi}:Gi;return bo?[Bn,eo,bo]:[Bn,eo]})]}function JF(we,Ke={}){return KF(we,{...Ke,attributeNames:{...Ke.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const QF=we=>{for(const Ke in we)if(Ke.startsWith("aria-")||Ke==="role"||Ke==="title")return!0;return!1},eB=ru.createContext({}),tB=()=>ru.useContext(eB),rB=ru.forwardRef(({color:we,size:Ke,width:ot,height:ut,strokeWidth:Xt,absoluteStrokeWidth:$t,nonScalingStroke:cr,className:kr="",children:tn,iconNode:Ur=[],icon:yn={node:Ur,aliases:[],size:24},...Mn},ea)=>{const{size:Bn=24,strokeWidth:Gi=2,absoluteStrokeWidth:bo=!1,nonScalingStroke:eo=!1,color:li="currentColor",className:Ge=""}=tB()??{},wo=!!tn||QF(Mn),[vl,Eo,ui=[]]=JF(yn,{color:we??li,width:ot??Ke??Bn,height:ut??Ke??Bn,strokeWidth:Xt??Gi,absoluteStrokeWidth:$t??bo,nonScalingStroke:cr??eo,className:bk(Ge,kr),hasA11yProp:wo,attributes:Mn});return ru.createElement(vl,{ref:ea,...Eo},[...ui.map(([mo,Rs])=>ru.createElement(mo,Rs)),...Array.isArray(tn)?tn:[tn]])});function k0(we,Ke=[],ot=[]){const ut=typeof we=="string"?ZF(we,Ke,ot):we,Xt=ru.forwardRef(({className:$t,...cr},kr)=>ru.createElement(rB,{ref:kr,icon:ut,className:$t,...cr}));return ut.name&&(Xt.displayName=$F(ut.name)),Xt}const Z4={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"}]]};Z4.node;const nB=k0(Z4);const W4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};W4.node;const aB=k0(W4);const $4={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"}]]};$4.node;const iB=k0($4);const K4={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"]};K4.node;const oB=k0(K4);const J4={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"}]]};J4.node;const sB=k0(J4);const Q4={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"}]]};Q4.node;const lB=k0(Q4);const eP={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"}]]};eP.node;const uB=k0(eP);const tP={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"}]]};tP.node;const cB=k0(tP);const rP={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"}]]};rP.node;const cM=k0(rP);const nP={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"}]]};nP.node;const fB=k0(nP);const aP={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"}]]};aP.node;const hB=k0(aP);const iP={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};iP.node;const oP=k0(iP);function Uk({title:we,open:Ke,onClose:ot,wide:ut=!1,children:Xt}){const $t=ru.useRef(null);return ru.useEffect(()=>{const cr=$t.current;Ke&&!cr?.open?cr?.showModal():!Ke&&cr?.open&&cr.close()},[Ke]),ra.jsxs("dialog",{ref:$t,"aria-label":we,onClose:ot,onClick:cr=>cr.target===$t.current&&ot(),className:`m-auto ${ut?"w-[min(72rem,calc(100vw-2rem))]":"w-[min(48rem,calc(100vw-2rem))]"} max-h-[85dvh] p-0 bg-white border-[1.5px] border-ink rounded-md text-ink backdrop:bg-ink/40`,children:[ra.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-grid bg-white pl-5 pr-2 py-1",children:[ra.jsx("h2",{className:"text-lg font-semibold",children:we}),ra.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:ra.jsx(oP,{size:18,"aria-hidden":!0})})]}),ra.jsx("div",{className:"p-5",children:Xt})]})}const dB="https://huggingface.co/spaces/elvis-hf/homepage",q8="bg-white border-[1.5px] border-ink rounded-md",sP="flex items-center gap-2 h-11 px-3.5 text-sm font-medium bg-white border-[1.5px] border-ink rounded cursor-pointer hover:bg-paper";function vB({title:we,tabs:Ke,panel:ot,footer:ut,usage:Xt,examples:$t,homeUrl:cr=dB,children:kr}){const[tn,Ur]=ru.useState(0);return ru.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[tn]),ra.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:[ra.jsxs("header",{className:"flex flex-wrap items-center gap-3",children:[ra.jsxs("h1",{className:"mr-auto flex items-baseline gap-3 text-2xl lg:text-3xl font-bold tracking-tight",children:[ra.jsx("span",{className:"px-1 bg-[linear-gradient(transparent_58%,var(--color-marker)_58%,var(--color-marker)_92%,transparent_92%)]",children:"ELVIS"}),ra.jsx("span",{className:"font-normal text-ink-muted",children:"—"}),ra.jsx("span",{className:"font-semibold",children:we})]}),Xt&&ra.jsx(V8,{label:"Usage",icon:nB,children:Xt}),$t&&ra.jsx(V8,{label:"Examples",icon:lB,children:$t}),ra.jsxs("a",{href:cr,target:"_blank",rel:"noopener noreferrer",className:sP,children:[ra.jsx(oB,{size:16,"aria-hidden":!0}),"Home"]})]}),ra.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_24rem] gap-5 flex-1 min-h-0",children:[ra.jsx("main",{className:`${q8} flex flex-col min-h-[320px] lg:min-h-0 p-4`,children:kr}),ra.jsxs("aside",{"aria-label":"Controls",className:`${q8} flex flex-col min-h-0`,children:[Ke?ra.jsx(pB,{tabs:Ke,active:tn,onSelect:Ur}):ra.jsx("div",{className:lP,children:ot}),ut&&ra.jsx("div",{className:"flex shrink-0 flex-col gap-3 border-t-[1.5px] border-ink p-4",children:ut})]})]})]})}const lP="flex flex-1 flex-col gap-6 min-h-0 overflow-auto p-4";function pB({tabs:we,active:Ke,onSelect:ot}){return ra.jsxs(ra.Fragment,{children:[ra.jsx("div",{role:"tablist",className:"flex gap-1 pt-2 px-2 border-b-[1.5px] border-ink",children:we.map(({label:ut},Xt)=>ra.jsx("button",{type:"button",role:"tab","aria-selected":Xt===Ke,onClick:()=>ot(Xt),className:`flex-1 h-11 px-3 text-sm cursor-pointer rounded-t border-[1.5px] ${Xt===Ke?"-mb-[1.5px] font-semibold border-ink border-b-white bg-white":"font-medium border-transparent text-ink-muted hover:bg-paper"}`,children:ut},ut))}),we.map(({label:ut,content:Xt},$t)=>ra.jsx("div",{role:"tabpanel",className:$t===Ke?lP:"hidden",children:Xt},ut))]})}function V8({label:we,icon:Ke,children:ot}){const[ut,Xt]=ru.useState(!1);return ra.jsxs(ra.Fragment,{children:[ra.jsxs("button",{type:"button",onClick:()=>Xt(!0),className:sP,children:[ra.jsx("span",{"aria-hidden":!0,children:ra.jsx(Ke,{size:16})}),we]}),ra.jsx(Uk,{title:we,open:ut,onClose:()=>Xt(!1),children:ot})]})}const mB="px-4 rounded bg-white 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",gB={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 fM({label:we,onClick:Ke,variant:ot="secondary",disabled:ut=!1}){return ra.jsx("button",{type:"button",onClick:Ke,disabled:ut,className:`${mB} ${gB[ot]}`,children:we})}function PT({label:we,onClick:Ke,disabled:ot=!1,children:ut}){return ra.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-white 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:ra.jsx("span",{"aria-hidden":!0,children:ut})})}function yB({label:we,colors:Ke,value:ot,onChange:ut,taken:Xt=[]}){const[$t,cr]=ru.useState(!1),kr=ru.useRef(null),tn=Ke.find(Ur=>Ur.value===ot);return ru.useEffect(()=>{if(!$t)return;function Ur(Mn){kr.current?.contains(Mn.target)||cr(!1)}function yn(Mn){Mn.key==="Escape"&&cr(!1)}return document.addEventListener("pointerdown",Ur),document.addEventListener("keydown",yn),()=>{document.removeEventListener("pointerdown",Ur),document.removeEventListener("keydown",yn)}},[$t]),ra.jsxs("div",{ref:kr,className:"relative shrink-0",children:[ra.jsx("button",{type:"button","aria-label":`${we}: ${tn?.name??ot}`,title:`${we}: ${tn?.name??ot}`,"aria-expanded":$t,onClick:()=>cr(!$t),className:"flex size-9 items-center justify-center rounded cursor-pointer hover:bg-paper focus-visible:outline-2 focus-visible:outline-ink",children:ra.jsx("span",{"aria-hidden":!0,className:"block size-6 rounded-full border-2 border-white ring-[1.5px] ring-grid",style:{backgroundColor:ot}})}),$t&&ra.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-white p-2",children:Ke.map(Ur=>{const yn=Ur.value!==ot&&Xt.includes(Ur.value);return ra.jsx("button",{type:"button","aria-label":Ur.name,"aria-pressed":Ur.value===ot,title:yn?`${Ur.name} (used by another run)`:Ur.name,disabled:yn,onClick:()=>{ut(Ur.value),cr(!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:ra.jsx("span",{"aria-hidden":!0,className:`block size-6 rounded-full border-2 border-white ${Ur.value===ot?"ring-[3px] ring-ink":"ring-[1.5px] ring-grid"}`,style:{backgroundColor:Ur.value}})},Ur.value)})})]})}function H8(){return ra.jsx("div",{className:"h-px shrink-0 bg-grid"})}function uP({label:we,hideLabel:Ke=!1,options:ot=[],groupedOptions:ut=[],activeOption:Xt,onChange:$t}){return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("label",{className:Ke?"sr-only":"text-gray-700 text-sm",children:we}),ra.jsxs("select",{"aria-label":we,value:Xt,onChange:cr=>$t(cr.target.value),className:"p-2 rounded bg-white border border-gray-300",children:[ot.map(cr=>ra.jsx("option",{value:cr,children:cr},cr)),ut.map(cr=>ra.jsx("optgroup",{label:cr.label,children:cr.options.map(kr=>ra.jsx("option",{value:kr,children:kr},kr))},cr.label))]})]})}function wk({label:we,value:Ke,onChange:ot,readonly:ut=!1,rows:Xt,error:$t,mono:cr=!1,prefix:kr,hideLabel:tn=!1}){const Ur=ru.useId(),yn=!!Xt&&Xt>1,Mn=[yn?"items-start":"items-center","flex w-full rounded border text-sm text-ink focus-within:outline-2 focus-within:outline-ink",cr?"font-mono":"",ut?"bg-paper":"bg-white",$t?"border-red-600 focus-within:outline-red-600":"border-gray-300"].join(" "),ea="min-w-0 flex-1 bg-transparent px-2 outline-none";return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("label",{htmlFor:Ur,className:tn?"sr-only":"text-gray-700 text-sm",children:we}),ra.jsxs("div",{className:Mn,children:[kr&&ra.jsx("span",{"aria-hidden":!0,className:`shrink-0 select-none pl-2 text-ink-muted ${yn?"py-1.5":""}`,children:kr}),yn?ra.jsx("textarea",{id:Ur,value:Ke,rows:Xt,readOnly:ut,spellCheck:!1,"aria-invalid":!!$t,onChange:Bn=>ot&&ot(Bn.target.value),className:`${ea} py-1.5 resize-none`}):ra.jsx("input",{id:Ur,type:"text",value:Ke,readOnly:ut,spellCheck:!1,"aria-invalid":!!$t,onChange:Bn=>ot&&ot(Bn.target.value),className:`${ea} h-9`})]}),$t&&ra.jsx("p",{className:"text-red-600 font-semibold text-sm",children:$t})]})}function W6({label:we,children:Ke}){return ra.jsxs("section",{className:"flex flex-col gap-4",children:[ra.jsx("div",{className:"flex items-center gap-3",children:ra.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-ink-muted",children:we})}),Ke]})}function _B({label:we,options:Ke,value:ot,onChange:ut}){return ra.jsx("div",{role:"group","aria-label":we,className:"grid rounded border-[1.5px] border-ink overflow-hidden",style:{gridTemplateColumns:`repeat(${Ke.length}, minmax(0, 1fr))`},children:Ke.map(Xt=>ra.jsx("button",{type:"button","aria-pressed":ot===Xt.value,onClick:()=>ot!==Xt.value&&ut(Xt.value),className:`h-8 px-1 text-xs font-medium cursor-pointer border-l-[1.5px] border-ink first:border-l-0 ${ot===Xt.value?"bg-ink text-white":"bg-white hover:bg-paper"}`,children:Xt.label},Xt.value))})}function xB(we,Ke){ru.useEffect(()=>{const ot=we();if(!ot||!Ke)return;function ut(Xt){const $t=ot._fullLayout;if(!$t)return;const cr=ot.getBoundingClientRect(),kr=$t.xaxis.p2c(Xt.clientX-cr.left-$t.xaxis._offset),tn=$t.yaxis.p2c(Xt.clientY-cr.top-$t.yaxis._offset);G8(kr,$t.xaxis.range)&&G8(tn,$t.yaxis.range)&&Ke(kr,tn)}return ot.addEventListener("click",ut),()=>ot.removeEventListener("click",ut)})}function G8(we,[Ke,ot]){return Number.isFinite(we)&&we>=Math.min(Ke,ot)&&we<=Math.max(Ke,ot)}class bB{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=ut=>(this.listeners.add(ut),()=>this.listeners.delete(ut)),this.setStepSize=ut=>this.set({stepSize:Math.max(1,Math.round(ut))}),this.setAnimate=ut=>this.set({animate:ut}),this.start=async()=>{const ut=this.generation;this.set({busy:!0});const Xt=await this.get(0,ut);ut===this.generation&&this.set({busy:!1,...Xt!==null&&{state:Xt,iteration:0}})},this.step=async()=>{if(this.current.busy||this.current.running&&!this.playing)return!1;const{stepSize:ut,animate:Xt}=this.current;Xt&&ut>1&&!this.playing&&this.set({running:!0});const $t=await this.advance(ut,Xt,this.generation);return!this.playing&&this.current.running&&this.set({running:!1}),$t},this.back=()=>{if(this.current.busy)return;const ut=Math.max(0,this.current.iteration-this.current.stepSize);this.states.has(ut)&&this.set({iteration:ut,state:this.states.get(ut)})},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=(ut=this.options)=>(this.pause(),this.options=ut,this.generation++,this.states.clear(),this.set({iteration:0,state:void 0,lastIteration:ut.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,ut){const Xt=this.current.iteration;let $t=Xt,cr=this.current.state;this.set({busy:!0,error:null});for(let kr=0;krsetTimeout(Ur,this.interval())),ut!==this.generation))return!1}return this.set({busy:!1,iteration:$t,state:cr}),$t!==Xt}async get(Ke,ot){const ut=this.states.get(Ke);if(ut!==void 0)return ut;try{const Xt=await this.fetchState(Ke);return ot!==this.generation?null:Xt===null?(this.set({lastIteration:Math.max(Ke-1,0)}),null):(this.states.set(Ke,Xt),Xt)}catch(Xt){return ot===this.generation&&this.set({error:Xt instanceof Error?Xt.message:String(Xt)}),null}}atEnd(Ke=this.current.iteration){return this.current.lastIteration!==null&&Ke>=this.current.lastIteration}interval(){return this.options.intervalMs??400}set(Ke){this.current={...this.current,...Ke},this.listeners.forEach(ot=>ot())}}function wB(we,Ke){const[ot]=ru.useState(()=>new bB(we,Ke));return ot.setFetchState(we),ru.useEffect(()=>(ot.start(),()=>ot.pause()),[ot]),{...ru.useSyncExternalStore(ot.subscribe,ot.getSnapshot),stepper:ot}}const TB="flex size-11 shrink-0 items-center justify-center rounded border-[1.5px] border-ink bg-white 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 AB({stepper:we}){const{stepper:Ke,iteration:ot,lastIteration:ut,running:Xt,busy:$t,stepSize:cr}=we,[kr,tn]=ru.useState(String(cr)),Ur=/^[1-9]\d*$/.test(kr.trim()),yn=ot===0,Mn=ut!==null&&ot>=ut;return ra.jsxs("section",{className:"flex flex-col gap-3",children:[ra.jsxs("div",{className:"flex gap-2",children:[ra.jsx($6,{label:"Reset to iteration 0",onClick:Ke.reset,disabled:yn&&!Xt,children:ra.jsx(cM,{size:18})}),ra.jsx($6,{label:`Step back ${cr}`,onClick:Ke.back,disabled:yn||Xt||$t,children:ra.jsx(fB,{size:18})}),ra.jsxs("button",{type:"button",onClick:Xt?Ke.pause:Ke.play,disabled:!Xt&&Mn,className:"flex h-11 flex-1 items-center justify-center gap-2 rounded border-2 border-ink bg-ink text-sm font-semibold text-white 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:[ra.jsx("span",{"aria-hidden":!0,children:Xt?ra.jsx(uB,{size:16}):ra.jsx(cB,{size:16})}),Xt?"Pause":"Play"]}),ra.jsx($6,{label:`Step forward ${cr}`,onClick:Ke.step,disabled:Mn||Xt||$t,children:ra.jsx(hB,{size:18})}),ra.jsxs("label",{title:"Iterations per step",className:"flex shrink-0 items-center gap-1 font-mono text-sm text-ink-muted",children:["×",ra.jsx("input",{type:"number",min:1,step:1,inputMode:"numeric","aria-label":"Iterations per step","aria-invalid":!Ur,value:kr,onChange:ea=>{tn(ea.target.value),/^[1-9]\d*$/.test(ea.target.value.trim())&&Ke.setStepSize(Number(ea.target.value))},className:`h-11 w-14 rounded border-[1.5px] bg-white px-1.5 text-center text-ink ${Ur?"border-ink":"border-red-600 outline-red-600"}`})]})]}),ra.jsxs("p",{className:"font-mono text-sm text-ink-muted","aria-live":"polite",children:["iteration ",ot,ut!==null?` / ${ut}`:""]}),we.error&&ra.jsx("p",{className:"text-red-600 font-semibold",children:we.error})]})}function $6({label:we,onClick:Ke,disabled:ot,children:ut}){return ra.jsx("button",{type:"button","aria-label":we,title:we,onClick:Ke,disabled:ot,className:TB,children:ra.jsx("span",{"aria-hidden":!0,children:ut})})}const Tk="h-9 shrink-0 rounded border border-gray-300 bg-white px-2 font-mono text-sm text-ink",K6="\0none",J6="\0number";function Ak({param:we,value:Ke,onChange:ot,fill:ut=!1}){const Xt=$t=>ut?"w-full min-w-0":$t;switch(we.kind){case"boolean":return ra.jsx("input",{type:"checkbox",checked:Ke===!0,onChange:$t=>ot($t.target.checked),className:"size-4 accent-ink cursor-pointer"});case"choice":return ra.jsx("select",{value:Ke,onChange:$t=>ot($t.target.value),className:`${Tk} ${Xt("w-28")} font-sans`,children:we.options.map($t=>ra.jsx("option",{value:$t.value,children:$t.label},$t.value))});case"mixed":{const $t=we.number,cr=typeof Ke=="number";return ra.jsxs("span",{className:`flex gap-1 ${ut?"w-full":""}`,children:[ra.jsxs("select",{value:cr?J6:Ke===null?K6:String(Ke),onChange:kr=>{const tn=kr.target.value;ot(tn===J6?MB($t):tn===K6?null:tn)},className:`${Tk} ${ut?"min-w-0 flex-1":cr?"w-24":"w-28"} font-sans`,children:[we.options.map(kr=>ra.jsx("option",{value:kr.value??K6,children:kr.label},kr.label)),$t&&ra.jsx("option",{value:J6,children:"Number…"})]}),cr&&ra.jsx(X8,{range:$t,value:Ke,onChange:ot,className:ut?"min-w-0 flex-1":"w-20"})]})}default:return ra.jsx(X8,{range:{...we,integer:we.kind==="integer"},nullable:we.nullable,value:Ke,onChange:ot,className:Xt("w-28")})}}function X8({range:we,nullable:Ke,value:ot,onChange:ut,className:Xt}){const[$t,cr]=ru.useState(Y8(ot)),kr=Q6(we,Ke,$t)!==void 0;return ru.useEffect(()=>{Q6(we,Ke,$t)!==ot&&cr(Y8(ot))},[ot]),ra.jsx("input",{type:"number",inputMode:"decimal",min:we.min,max:we.max,step:we.integer?1:"any",placeholder:Ke,value:$t,"aria-invalid":!kr,title:kr?void 0:SB(we),onChange:tn=>{cr(tn.target.value);const Ur=Q6(we,Ke,tn.target.value);Ur!==void 0&&ut(Ur)},className:`${Tk} ${Xt} ${kr?"":"border-red-600 outline-red-600"}`})}function Y8(we){return we===null?"":String(we)}function Q6(we,Ke,ot){if(ot.trim()==="")return Ke?null:void 0;const ut=Number(ot);return Number.isFinite(ut)&&cP(we,ut)?ut:void 0}function cP({integer:we,min:Ke,max:ot,minExclusive:ut,maxExclusive:Xt},$t){return!(we&&!Number.isInteger($t)||Ke!==void 0&&(ut?$t<=Ke:$t=ot:$t>ot))}function SB({integer:we,min:Ke,max:ot,minExclusive:ut,maxExclusive:Xt}){const $t=Ke===void 0?null:`${ut?"more than":"at least"} ${Ke}`,cr=ot===void 0?null:`${Xt?"less than":"at most"} ${ot}`;return[Ke!==void 0&&ot!==void 0&&!ut&&!Xt?`${Ke} to ${ot}`:[$t,cr].filter(Boolean).join(" and "),we?"a whole number":null].filter(Boolean).join(", ")||"a number"}function MB(we){return cP(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 jk(we,Ke){return Object.fromEntries(we.map(ot=>[ot.name,ot.name in Ke?Ke[ot.name]:ot.default]))}function qk(we,Ke){return Object.entries(we.when??{}).every(([ot,ut])=>ut.includes(String(Ke[ot])))}function fP(we,Ke){return we.name in Ke&&Ke[we.name]!==we.default}function hP(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 Sk(we){return we.kind==="integer"||we.kind==="mixed"&&!!we.number?.integer}function EB(we,Ke){if(!we.estimator)return null;const ot=jk(we.params,Ke),ut=new Map(Object.entries(we.fixed??{}).map(([cr,kr])=>[cr,[kr,!0]]));for(const cr of we.params)qk(cr,ot)&&ut.set(cr.name,[ot[cr.name],Sk(cr)]);for(const cr of we.otherParams??[])cr.name in Ke&&ut.set(cr.name,[Ke[cr.name],Sk(cr)]);const Xt=we.libraryDefaults??{},$t=[...ut].filter(([cr,[kr]])=>!(cr in Xt)||Xt[cr]!==kr);return`${we.estimator}(${$t.map(([cr,[kr,tn]])=>`${cr}=${hP(kr,tn)}`).join(", ")})`}function dP({model:we,values:Ke,onChange:ot,onResetOne:ut,onReset:Xt}){const $t=[...we.params,...we.otherParams??[]],cr=jk($t,Ke);return ra.jsxs("div",{className:"flex flex-col gap-3",children:[ra.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[ra.jsxs("p",{className:"text-sm text-ink-muted",children:["Every setting of ",ra.jsx("code",{className:"font-mono text-ink",children:we.estimator??we.label}),". Changed settings are highlighted."]}),ra.jsx(fM,{label:"Reset all",onClick:Xt})]}),ra.jsx("div",{className:"overflow-auto max-h-[65dvh] rounded border-[1.5px] border-ink",children:ra.jsxs("table",{className:"w-full border-collapse text-sm",children:[ra.jsx("thead",{className:"sticky top-0 z-10 bg-white",children:ra.jsxs("tr",{className:"border-b-[1.5px] border-ink text-left text-xs uppercase tracking-widest text-ink-muted",children:[ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Setting"}),ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Value"}),ra.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Default"}),ra.jsx("th",{scope:"col",className:"w-11",children:ra.jsx("span",{className:"sr-only",children:"Reset"})})]})}),ra.jsx("tbody",{children:$t.map(kr=>{const tn=fP(kr,Ke),Ur=qk(kr,cr);return ra.jsxs("tr",{className:`border-t border-grid align-top ${tn?"bg-marker-soft":""}`,children:[ra.jsxs("td",{className:`px-3 py-2 ${Ur?"":"opacity-50"}`,children:[ra.jsxs("div",{children:[ra.jsx("span",{className:"font-medium",children:kr.label})," ",kr.label!==kr.name&&ra.jsx("code",{className:"font-mono text-xs text-ink-muted",children:kr.name})]}),kr.description&&ra.jsx("p",{className:"mt-0.5 max-w-prose text-xs text-ink-muted",children:kr.description}),!Ur&&ra.jsx("p",{className:"mt-0.5 text-xs italic text-ink-muted",children:"Not used with the current settings."})]}),ra.jsx("td",{className:"px-3 py-2",children:ra.jsx("label",{className:"flex min-h-9 items-center","aria-label":kr.label,children:ra.jsx(Ak,{param:kr,value:cr[kr.name],onChange:yn=>ot(kr.name,yn)})})}),ra.jsx("td",{className:"px-3 py-2 pt-3.5 font-mono text-xs text-ink-muted whitespace-nowrap",children:hP(kr.default,Sk(kr))}),ra.jsx("td",{className:"py-1 pr-1",children:kr.name in Ke&&ra.jsx("button",{type:"button",onClick:()=>ut(kr.name),"aria-label":`Reset ${kr.label}`,title:"Reset to default",className:"flex size-9 items-center justify-center rounded text-ink-muted cursor-pointer hover:bg-paper",children:ra.jsx(cM,{size:16,"aria-hidden":!0})})})]},kr.name)})})]})})]})}function kB({model:we,values:Ke,onChange:ot,showQuickSettings:ut=!0,inline:Xt=!1}){const[$t,cr]=ru.useState(!1),kr=we.otherParams??[],tn=[...we.params,...kr],Ur=jk(tn,Ke),yn=Object.keys(Ke).map(eo=>kr.find(li=>li.name===eo)).filter(eo=>eo!==void 0).slice(-3).reverse(),Mn=ut?[...we.params.filter(eo=>qk(eo,Ur)),...yn]:[],ea=tn.filter(eo=>fP(eo,Ke)).length,Bn=EB(we,Ke);function Gi(eo,li){const{[eo]:Ge,...wo}=Ke;ot({...wo,[eo]:li})}function bo(eo){const{[eo]:li,...Ge}=Ke;ot(Ge)}return Xt?ra.jsxs("div",{className:"flex min-h-15 gap-2",children:[Mn.length===0&&ra.jsxs("p",{className:"self-center text-sm text-ink-muted",children:[we.label," has no settings."]}),Mn.map(eo=>ra.jsxs("label",{title:[`${eo.label} (${eo.name})`,eo.description].filter(Boolean).join(": "),className:"flex min-w-0 flex-1 flex-col gap-1",children:[ra.jsx("span",{"aria-hidden":!0,className:"text-sm text-gray-700",children:eo.symbol??eo.label}),ra.jsx("span",{className:"sr-only",children:eo.label}),ra.jsx(Ak,{param:eo,value:Ur[eo.name],onChange:li=>Gi(eo.name,li),fill:!0})]},eo.name))]}):ra.jsxs("div",{className:"flex flex-col gap-2",children:[Mn.map(eo=>ra.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-700",children:[ra.jsxs("span",{className:"min-w-0",children:[eo.label," ",eo.label!==eo.name&&ra.jsx("code",{className:"font-mono text-xs text-ink-muted",children:eo.name})]}),ra.jsx(Ak,{param:eo,value:Ur[eo.name],onChange:li=>Gi(eo.name,li)})]},eo.name)),kr.length>0||!ut&&tn.length>0?ra.jsx(fM,{label:`Customise settings${ea>0?` · ${ea} changed`:""}`,onClick:()=>cr(!0)}):Mn.length>0&&ra.jsx(fM,{label:"Reset to defaults",onClick:()=>ot({})}),Bn&&ra.jsx("code",{title:"The code these settings make",className:"block rounded bg-paper px-2 py-1.5 font-mono text-xs text-ink break-words",children:Bn}),ra.jsx(Uk,{title:`${we.label} settings`,open:$t,onClose:()=>cr(!1),wide:!0,children:ra.jsx(dP,{model:we,values:Ke,onChange:Gi,onResetOne:bo,onReset:()=>ot({})})})]})}const CB="text-xs font-semibold uppercase tracking-widest text-ink-muted";function LB({title:we,items:Ke}){return Ke.length===0?null:ra.jsxs("section",{className:"flex flex-col gap-2",children:[ra.jsx("h3",{className:CB,children:we}),ra.jsx("div",{className:"flex flex-col gap-2 text-sm text-gray-700",children:Ke.map(ot=>ra.jsx(PB,{item:ot},ot.name))})]})}function PB({item:we}){switch(we.kind){case"scalar":return typeof we.value=="number"?ra.jsxs("div",{className:"flex justify-between gap-3",children:[ra.jsx("span",{children:we.name}),ra.jsx("span",{className:"font-mono text-ink",children:ek(we.value)})]}):ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("div",{className:"break-words font-mono text-xs text-ink",children:we.value})]});case"vector":return ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("dl",{className:"mt-0.5 flex flex-col pl-3 font-mono text-xs",children:we.value.labels.map((Ke,ot)=>ra.jsxs("div",{className:"flex justify-between gap-3",children:[ra.jsx("dt",{className:"min-w-0 truncate text-ink-muted",title:Ke,children:Ke}),ra.jsx("dd",{className:"text-ink",children:ek(we.value.values[ot])})]},Ke))})]});case"matrix":return ra.jsxs("div",{children:[ra.jsx("span",{children:we.name}),ra.jsx("div",{className:"mt-0.5 overflow-x-auto",children:ra.jsxs("table",{className:"w-max border-collapse font-mono text-xs",children:[ra.jsx("thead",{children:ra.jsxs("tr",{children:[ra.jsx("th",{}),we.value.columns.map(Ke=>ra.jsx("th",{scope:"col",className:"px-1.5 text-right font-normal text-ink-muted",children:Ke},Ke))]})}),ra.jsx("tbody",{children:we.value.rows.map((Ke,ot)=>ra.jsxs("tr",{className:"border-t border-grid",children:[ra.jsx("th",{scope:"row",className:"pr-1.5 text-left font-normal text-ink-muted",children:Ke}),we.value.values[ot].map((ut,Xt)=>ra.jsx("td",{className:"px-1.5 text-right text-ink",children:ek(ut)},Xt))]},Ke))})]})})]});case"text":return ra.jsxs("details",{children:[ra.jsx("summary",{className:"cursor-pointer",children:we.name}),ra.jsx("pre",{className:"mt-1 max-h-60 overflow-auto rounded bg-paper p-2 font-mono text-[11px] text-ink",children:we.value})]})}}function ek(we){return Number.isInteger(we)?String(we):we!==0&&Math.abs(we)<.001?we.toExponential(2):String(Number(we.toPrecision(3)))}const RB=[{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 the denominator 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 the denominator 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 the denominator 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."}]}],IB={algorithms:RB},hM=IB.algorithms;function dM(we){return hM.find(Ke=>Ke.id===we)??hM[0]}const _1=[{name:"Black",value:"#000000"},{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"}],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]}]},Mk=[...Fw[1],...Fw[2]],Z8="Custom",DB=/asin|acos|atan|sin|cos|tan|sqrt|abs|exp|log|ln|pi/g;function W8(we){return/y/.test(we.replace(DB,""))?2:1}var tk={},rk={},nk={exports:{}},ak,$8;function zB(){if($8)return ak;$8=1;var we="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ak=we,ak}var ik,K8;function OB(){if(K8)return ik;K8=1;var we=zB();function Ke(){}function ot(){}return ot.resetWarningCache=Ke,ik=function(){function ut(cr,kr,tn,Ur,yn,Mn){if(Mn!==we){var ea=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 ea.name="Invariant Violation",ea}}ut.isRequired=ut;function Xt(){return ut}var $t={array:ut,bigint:ut,bool:ut,func:ut,number:ut,object:ut,string:ut,symbol:ut,any:ut,arrayOf:Xt,element:ut,elementType:ut,instanceOf:Xt,node:ut,objectOf:Xt,oneOf:Xt,oneOfType:Xt,shape:Xt,exact:Xt,checkPropTypes:ot,resetWarningCache:Ke};return $t.PropTypes=$t,$t},ik}var J8;function FB(){return J8||(J8=1,nk.exports=OB()()),nk.exports}var Q8;function BB(){return Q8||(Q8=1,(function(we){function Ke(Eo){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ui){return typeof ui}:function(ui){return ui&&typeof Symbol=="function"&&ui.constructor===Symbol&&ui!==Symbol.prototype?"symbol":typeof ui},Ke(Eo)}Object.defineProperty(we,"__esModule",{value:!0}),we.default=vl;var ot=cr(_M()),ut=Xt(FB());function Xt(Eo){return Eo&&Eo.__esModule?Eo:{default:Eo}}function $t(Eo){if(typeof WeakMap!="function")return null;var ui=new WeakMap,mo=new WeakMap;return($t=function(ki){return ki?mo:ui})(Eo)}function cr(Eo,ui){if(Eo&&Eo.__esModule)return Eo;if(Eo===null||Ke(Eo)!=="object"&&typeof Eo!="function")return{default:Eo};var mo=$t(ui);if(mo&&mo.has(Eo))return mo.get(Eo);var Rs={},ki=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $s in Eo)if($s!=="default"&&Object.prototype.hasOwnProperty.call(Eo,$s)){var Di=ki?Object.getOwnPropertyDescriptor(Eo,$s):null;Di&&(Di.get||Di.set)?Object.defineProperty(Rs,$s,Di):Rs[$s]=Eo[$s]}return Rs.default=Eo,mo&&mo.set(Eo,Rs),Rs}function kr(Eo,ui){if(!(Eo instanceof ui))throw new TypeError("Cannot call a class as a function")}function tn(Eo,ui){for(var mo=0;mo"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 eo(Eo){return eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(mo){return mo.__proto__||Object.getPrototypeOf(mo)},eo(Eo)}var li=["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"],wo=typeof window<"u";function vl(Eo){var ui=(function(mo){yn(ki,mo);var Rs=ea(ki);function ki($s){var Di;return kr(this,ki),Di=Rs.call(this,$s),Di.p=Promise.resolve(),Di.resizeHandler=null,Di.handlers={},Di.syncWindowResize=Di.syncWindowResize.bind(Gi(Di)),Di.syncEventHandlers=Di.syncEventHandlers.bind(Gi(Di)),Di.attachUpdateEvents=Di.attachUpdateEvents.bind(Gi(Di)),Di.getRef=Di.getRef.bind(Gi(Di)),Di.handleUpdate=Di.handleUpdate.bind(Gi(Di)),Di.figureCallback=Di.figureCallback.bind(Gi(Di)),Di.updatePlotly=Di.updatePlotly.bind(Gi(Di)),Di}return Ur(ki,[{key:"updatePlotly",value:function(Di,zo,Nl){var Si=this;this.p=this.p.then(function(){if(!Si.unmounting){if(!Si.el)throw new Error("Missing element reference");return Eo.react(Si.el,{data:Si.props.data,layout:Si.props.layout,config:Si.props.config,frames:Si.props.frames})}}).then(function(){Si.unmounting||(Si.syncWindowResize(Di),Si.syncEventHandlers(),Si.figureCallback(zo),Nl&&Si.attachUpdateEvents())}).catch(function(Ii){Si.props.onError&&Si.props.onError(Ii)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(Di){this.unmounting=!1;var zo=Di.frames&&Di.frames.length?Di.frames.length:0,Nl=this.props.frames&&this.props.frames.length?this.props.frames.length:0,Si=!(Di.layout===this.props.layout&&Di.data===this.props.data&&Di.config===this.props.config&&Nl===zo),Ii=Di.revision!==void 0,Ti=Di.revision!==this.props.revision;!Si&&(!Ii||Ii&&!Ti)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&wo&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Eo.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var Di=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Di.el.on(zo,Di.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var Di=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Di.el.removeListener(zo,Di.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(Di){if(typeof Di=="function"){var zo=this.el,Nl=zo.data,Si=zo.layout,Ii=this.el._transitionData?this.el._transitionData._frames:null,Ti={data:Nl,layout:Si,frames:Ii};Di(Ti,this.el)}}},{key:"syncWindowResize",value:function(Di){var zo=this;wo&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Eo.Plots.resize(zo.el)},window.addEventListener("resize",this.resizeHandler),Di&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(Di){this.el=Di,this.props.debug&&wo&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var Di=this;li.forEach(function(zo){var Nl=Di.props["on"+zo],Si=Di.handlers[zo],Ii=!!Si;Nl&&!Ii?Di.addEventHandler(zo,Nl):!Nl&&Ii?Di.removeEventHandler(zo):Nl&&Ii&&Nl!==Si&&(Di.removeEventHandler(zo),Di.addEventHandler(zo,Nl))})}},{key:"addEventHandler",value:function(Di,zo){this.handlers[Di]=zo,this.el.on(this.getPlotlyEventName(Di),this.handlers[Di])}},{key:"removeEventHandler",value:function(Di){this.el.removeListener(this.getPlotlyEventName(Di),this.handlers[Di]),delete this.handlers[Di]}},{key:"getPlotlyEventName",value:function(Di){return"plotly_"+Di.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 ui.propTypes={data:ut.default.arrayOf(ut.default.object),config:ut.default.object,layout:ut.default.object,frames:ut.default.arrayOf(ut.default.object),revision:ut.default.number,onInitialized:ut.default.func,onPurge:ut.default.func,onError:ut.default.func,onUpdate:ut.default.func,debug:ut.default.bool,style:ut.default.object,className:ut.default.string,useResizeHandler:ut.default.bool,divId:ut.default.string},li.forEach(function(mo){ui.propTypes["on"+mo]=ut.default.func}),ui.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},ui}})(rk)),rk}var sM={exports:{}},NB=sM.exports,e4;function UB(){return e4||(e4=1,(function(we){var Ke={};(function(ot,ut){we.exports?we.exports=ut():ot.moduleName=ut()})(typeof self<"u"?self:NB,()=>{var ot=(()=>{var ut=Object.create,Xt=Object.defineProperty,$t=Object.defineProperties,cr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,Ur=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,Bn=(K,G,h)=>G in K?Xt(K,G,{enumerable:!0,configurable:!0,writable:!0,value:h}):K[G]=h,Gi=(K,G)=>{for(var h in G||(G={}))Mn.call(G,h)&&Bn(K,h,G[h]);if(Ur)for(var h of Ur(G))ea.call(G,h)&&Bn(K,h,G[h]);return K},bo=(K,G)=>$t(K,kr(G)),eo=(K,G)=>{var h={};for(var b in K)Mn.call(K,b)&&G.indexOf(b)<0&&(h[b]=K[b]);if(K!=null&&Ur)for(var b of Ur(K))G.indexOf(b)<0&&ea.call(K,b)&&(h[b]=K[b]);return h},li=(K,G)=>function(){return K&&(G=(0,K[tn(K)[0]])(K=0)),G},Ge=(K,G)=>function(){return G||(0,K[tn(K)[0]])((G={exports:{}}).exports,G),G.exports},wo=(K,G)=>{for(var h in G)Xt(K,h,{get:G[h],enumerable:!0})},vl=(K,G,h,b)=>{if(G&&typeof G=="object"||typeof G=="function")for(let S of tn(G))!Mn.call(K,S)&&S!==h&&Xt(K,S,{get:()=>G[S],enumerable:!(b=cr(G,S))||b.enumerable});return K},Eo=(K,G,h)=>(h=K!=null?ut(yn(K)):{},vl(Xt(h,"default",{value:K,enumerable:!0}),K)),ui=K=>vl(Xt({},"__esModule",{value:!0}),K),mo=Ge({"src/version.js"(K){K.version="3.3.1"}}),Rs=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,hn=_r.length,Sn=Oe[Zr++],Cn,La,zn,Qn=new A,la;++Xr=Oe.length)return er;var Zr=[],Xr=rt[_r++];return er.forEach(function(hn,Sn){Zr.push({key:hn,values:tr(Sn,_r)})}),Xr?Zr.sort(function(hn,Sn){return Xr(hn.key,Sn.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=Er);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)+"$"),hn;for(var Sn in this)if(hn=Sn.match(Xr)){var Cn=this[Sn];this.removeEventListener(hn[1],Cn,Cn.$),delete this[Sn]}}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 Er(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 Mr,$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(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(tr){if(wt.on(Oe,null),Mr&&(St[Mr]=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 Nr=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(Nr<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();Nr=!(It.f||It.e),rt.remove()}}return Nr?(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,Br=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,hn,Sn;if(Xr0&&(lo=lo.transition().duration(tr)),lo.call(Ra.event)}function _o(){Qn&&Qn.domain(zn.range().map(function(lo){return(lo-ge.x)/ge.k}).map(zn.invert)),Sa&&Sa.domain(la.range().map(function(lo){return(lo-ge.y)/ge.k}).map(la.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),el=0,$l=h.select(t(lo)).on(Zr,El).on(Xr,Kl),zl=sa(h.mouse(lo)),Ac=Sr(lo);Ta.call(lo),ko(Ls);function El(){el=1,zi(h.mouse(lo),zl),Ws(Ls)}function Kl(){$l.on(Zr,null).on(Xr,null),Ac(el),Po(Ls)}}function nl(){var lo=this,Ls=La.of(lo,arguments),el={},$l=0,zl,Ac=".zoom-"+h.event.changedTouches[0].identifier,El="touchmove"+Ac,Kl="touchend"+Ac,Kc=[],Pu=h.select(lo),mt=Sr(lo);wr(),ko(Ls),Pu.on(_r,null).on(Sn,wr);function yr(){var gn=h.touches(lo);return zl=ge.k,gn.forEach(function(pn){pn.identifier in el&&(el[pn.identifier]=sa(pn))}),gn}function wr(){var gn=h.event.target;h.select(gn).on(El,Ln).on(Kl,fa),Kc.push(gn);for(var pn=h.event.changedTouches,za=0,Ia=pn.length;za1){var Bi=Da[0],yi=Da[1],Ga=Bi[0]-yi[0],ga=Bi[1]-yi[1];$l=Ga*Ga+ga*ga}}function Ln(){var gn=h.touches(lo),pn,za,Ia,Da;Ta.call(lo);for(var Za=0,Bi=gn.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?da(ge.l,ge.a,ge.b):da((ge=Dr((ge=h.rgb(ge)).r,ge.g,ge.b)).l,ge.a,ge.b):new sr(ge,Oe,rt)}var qt=sr.prototype=new aa;qt.brighter=function(ge){return new sr(this.h,this.c,Math.min(100,this.l+Gr*(arguments.length?ge:1)))},qt.darker=function(ge){return new sr(this.h,this.c,Math.max(0,this.l-Gr*(arguments.length?ge:1)))},qt.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,sn=.95047,mn=1,Tn=1.08883,Jn=ur.prototype=new aa;Jn.brighter=function(ge){return new ur(Math.min(100,this.l+Gr*(arguments.length?ge:1)),this.a,this.b)},Jn.darker=function(ge){return new ur(Math.max(0,this.l-Gr*(arguments.length?ge:1)),this.a,this.b)},Jn.rgb=function(){return ma(this.l,this.a,this.b)};function ma(ge,Oe,rt){var wt=(ge+16)/116,St=wt+Oe/500,It=wt-rt/200;return St=_a(St)*sn,wt=_a(wt)*mn,It=_a(It)*Tn,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 da(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 Mi(ge){return new pi(ge>>16,ge>>8&255,ge&255)}function Dt(ge){return Mi(ge)+""}var xt=pi.prototype=new aa;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)/sn),St=Ca((.2126729*ge+.7151522*Oe+.072175*rt)/mn),It=Ca((.0193339*ge+.119192*Oe+.9503041*rt)/Tn);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 ln(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,Mi(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,hn;if(!Xr&&Rn(er)||Xr>=200&&Xr<300||Xr===304){try{hn=rt.call(St,er)}catch(Sn){It.error.call(St,Sn);return}It.load.call(St,hn)}else It.error.call(St,er)}return er.onprogress=function(Xr){var hn=h.event;h.event=Xr;try{It.progress.call(St,er)}finally{h.event=hn}},St.header=function(Xr,hn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?tr[Xr]:(hn==null?delete tr[Xr]:tr[Xr]=hn+"",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,hn,Sn){if(arguments.length===2&&typeof hn=="function"&&(Sn=hn,hn=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),Sn!=null&&St.on("error",Sn).on("load",function(La){Sn(null,La)}),It.beforesend.call(St,er),er.send(hn??null),St},St.abort=function(){return er.abort(),St},h.rebind(St,It,"on"),wt==null?St:St.get(un(wt))}function un(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,hn){arguments.length<3&&(hn=Xr,Xr=null);var Sn=zr(Zr,Oe,Xr==null?It:tr(Xr),hn);return Sn.row=function(Cn){return arguments.length?Sn.response((Xr=Cn)==null?It:tr(Cn)):Xr},Sn}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 hn;return St.parseRows(Zr,function(Sn,Cn){if(hn)return hn(Sn,Cn-1);var La=function(zn){for(var Qn={},la=Sn.length,Sa=0;Sa=La)return Sn;if(Sa)return Sa=!1,hn;var ai=zn;if(Zr.charCodeAt(ai)===34){for(var Yi=ai;Yi++24?(isFinite(Oe)&&(clearTimeout(In),In=setTimeout(Ci,Oe)),cn=0):(cn=1,gi(Ci))}h.timer.flush=function(){Hi(),so()};function Hi(){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[hn[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=ll(ge);if(Vs.insert(wt,_r),!(!wt&&!St)){if(wt===St){ul(wt),St=ll(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}ul(wt),ul(St);var Zr=wt.site,Xr=Zr.x,hn=Zr.y,Sn=ge.x-Xr,Cn=ge.y-hn,La=St.site,zn=La.x-Xr,Qn=La.y-hn,la=2*(Sn*Qn-Cn*zn),Sa=Sn*Sn+Cn*Cn,Ra=zn*zn+Qn*Qn,sa={x:(Qn*Sa-Cn*Ra)/la+Xr,y:(Sn*Ra-zn*Sa)/la+hn};Io(St.edge,Zr,La,sa),_r.edge=Xl(Zr,ge,null,sa),St.edge=Xl(ge,La,null,sa),Zs(wt),Zs(St)}}function di(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,hn=1/It-1/Zr,Sn=Xr/Zr;return hn?(-Sn+Math.sqrt(Sn*Sn-2*hn*(Xr*Xr/(-2*Zr)-_r+Zr/2+St-It/2)))/hn+wt:(wt+er)/2}function to(ge,Oe){var rt=ge.N;if(rt)return di(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,hn,Sn,Cn,La,zn,Qn;Xr--;)if(hn=Zr[Xr],!(!hn||!hn.prepare()))for(Cn=hn.edges,La=Cn.length,Sn=0;SnJe||l(_r-tr)>Je)&&(Cn.splice(Sn,0,new cu(Yl(hn.site,Qn,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 Sn=_r*_r+Zr*Zr,Cn=Xr*Xr+Qn*Qn,La=(Qn*Sn-Zr*Cn)/hn,zn=(_r*Cn-Xr*Sn)/hn,Qn=zn+er,la=vo.pop()||new Rl;la.arc=ge,la.site=St,la.x=La+tr,la.y=Qn+Math.sqrt(La*La+zn*zn),la.cy=Qn,ge.circle=la;for(var Sa=null,Ra=Zo._;Ra;)if(la.y0)){if(zn/=Cn,Cn<0){if(zn0){if(zn>Sn)return;zn>hn&&(hn=zn)}if(zn=rt-er,!(!Cn&&zn<0)){if(zn/=Cn,Cn<0){if(zn>Sn)return;zn>hn&&(hn=zn)}else if(Cn>0){if(zn0)){if(zn/=La,La<0){if(zn0){if(zn>Sn)return;zn>hn&&(hn=zn)}if(zn=wt-_r,!(!La&&zn<0)){if(zn/=La,La<0){if(zn>Sn)return;zn>hn&&(hn=zn)}else if(La>0){if(zn0&&(St.a={x:er+hn*Cn,y:_r+hn*La}),Sn<1&&(St.b={x:er+Sn*Cn,y:_r+Sn*La}),St}}}}}}function Ji(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>Sn){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>Sn){if(!wt)wt={x:(tr-la)/Qn,y:tr};else if(wt.y>=er)return;rt={x:(er-la)/Qn,y:er}}else{if(!wt)wt={x:(er-la)/Qn,y:er};else if(wt.y=It)return;rt={x:It,y:Qn*It+la}}else{if(!wt)wt={x:It,y:Qn*It+la};else if(wt.x=Xr&&la.x<=Sn&&la.y>=hn&&la.y<=Cn?[[Xr,Cn],[Sn,Cn],[Sn,hn],[Xr,hn]]:[];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 Yu(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 Yu(er(_r)).cells.forEach(function(Xr,hn){for(var Sn=Xr.site,Cn=Xr.edges.sort(Fo),La=-1,zn=Cn.length,Qn,la=Cn[zn-1].edge,Sa=la.l===Sn?la.r:la.l;++LaRa&&(Ra=Xr.x),Xr.y>sa&&(sa=Xr.y),Cn.push(Xr.x),La.push(Xr.y);else for(zn=0;znRa&&(Ra=ai),Yi>sa&&(sa=Yi),Cn.push(ai),La.push(Yi)}var zi=Ra-la,Vi=sa-Sa;zi>Vi?sa=Sa+zi:Ra=la+Vi;function _o(Po,os,nl,Iu,eu,lo,Ls,el){if(!(isNaN(nl)||isNaN(Iu)))if(Po.leaf){var $l=Po.x,zl=Po.y;if($l!=null)if(l($l-nl)+l(zl-Iu)<.01)ko(Po,os,nl,Iu,eu,lo,Ls,el);else{var Ac=Po.point;Po.x=Po.y=Po.point=null,ko(Po,Ac,$l,zl,eu,lo,Ls,el),ko(Po,os,nl,Iu,eu,lo,Ls,el)}else Po.x=nl,Po.y=Iu,Po.point=os}else ko(Po,os,nl,Iu,eu,lo,Ls,el)}function ko(Po,os,nl,Iu,eu,lo,Ls,el){var $l=(eu+Ls)*.5,zl=(lo+el)*.5,Ac=nl>=$l,El=Iu>=zl,Kl=El<<1|Ac;Po.leaf=!1,Po=Po.nodes[Kl]||(Po.nodes[Kl]=Tl()),Ac?eu=$l:Ls=$l,El?lo=zl:el=zl,_o(Po,os,nl,Iu,eu,lo,Ls,el)}var Ws=Tl();if(Ws.add=function(Po){_o(Ws,Po,+hn(Po,++zn),+Sn(Po,zn),la,Sa,Ra,sa)},Ws.visit=function(Po){Ic(Po,Ws,la,Sa,Ra,sa)},Ws.find=function(Po){return zh(Ws,Po[0],Po[1],la,Sa,Ra,sa)},zn=-1,Oe==null){for(;++znIt||Sn>tr||Cn=ai,Vi=rt>=Yi,_o=Vi<<1|zi,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=Wu.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 aa?oc:Array.isArray(Oe)?Il:rt==="object"&&isNaN(Oe)?Zu:sc)(ge,Oe)}],h.interpolateArray=Il;function Il(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=bc.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 $u(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 ma(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 Bl(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),Ku(ge.translate,Oe.translate,rt,wt),Wf(ge.rotate,Oe.rotate,rt,wt),Nh(ge.skew,Oe.skew,rt,wt),Bl(ge.scale,Oe.scale,rt,wt),ge=Oe=null,function(St){for(var It=-1,tr=wt.length,er;++It0?It=sa:(rt.c=null,rt.t=NaN,rt=null,Oe.end({type:"end",alpha:It=0})):sa>0&&(Oe.start({type:"start",alpha:It=sa}),rt=Ea(ge.tick)),ge):It},ge.start=function(){var sa,ai=Cn.length,Yi=La.length,zi=wt[0],Vi=wt[1],_o,ko;for(sa=0;sa=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(hn){var Sn,Cn;ge&&(Sn=hn.children)&&Sn.sort(ge),rt&&(Cn=hn.parent)&&(Cn.value+=hn.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=ev,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 Fc(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,Sn){for(var er=[],_r=It.map(Oe,this),Zr=rt.call(this,_r,Sn),Xr=wt.call(this,Zr,_r,Sn),hn,Sn=-1,Cn=_r.length,La=Xr.length-1,zn=ge?1:1/Cn,Qn;++Sn0)for(Sn=-1;++Sn=Zr[0]&&Qn<=Zr[1]&&(hn=er[h.bisect(Xr,Qn,1,La)-1],hn.y+=zn,hn.push(It[Sn]));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 su(tr,It)}:At(It),St):wt},St.frequency=function(It){return arguments.length?(ge=!!It,St):ge},St};function Uh(ge,Oe){return su(ge,Math.ceil(Math.log(Oe.length)/Math.LN2+1))}function su(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],hn=wt==null?Math.sqrt:typeof wt=="function"?wt:function(){return wt};if(_r.x=_r.y=0,pf(_r,function(Cn){Cn.r=+hn(Cn.value)}),pf(_r,vh),Oe){var Sn=Oe*(wt?1:Math.max(2*_r.r/Zr,2*_r.r/Xr))/2;pf(_r,function(Cn){Cn.r+=Sn}),pf(_r,vh),pf(_r,function(Cn){Cn.r-=Sn})}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)||!(Sn=Oe.length))return;var Oe,rt=1/0,wt=-1/0,St=1/0,It=-1/0,tr,er,_r,Zr,Xr,hn,Sn;function Cn(sa){rt=Math.min(sa.x-sa.r,rt),wt=Math.max(sa.x+sa.r,wt),St=Math.min(sa.y-sa.r,St),It=Math.max(sa.y+sa.r,It)}if(Oe.forEach(kd),tr=Oe[0],tr.x=-tr.r,tr.y=0,Cn(tr),Sn>1&&(er=Oe[1],er.x=er.r,er.y=0,Cn(er),Sn>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;ZrQn.x&&(Qn=ai),ai.depth>la.depth&&(la=ai)});var Sa=Oe(zn,Qn)/2-zn.x,Ra=rt[0]/(Qn.x+Oe(Qn,zn)/2+Sa),sa=rt[1]/(la.depth||1);rh(Cn,function(ai){ai.x=(ai.x+Sa)*Ra,ai.y=ai.depth*sa})}return Sn}function It(Xr){for(var hn={A:null,children:[Xr]},Sn=[hn],Cn;(Cn=Sn.pop())!=null;)for(var La=Cn.children,zn,Qn=0,la=La.length;Qn0&&(wc(Vf(zn,Xr,Sn),Xr,ai),la+=ai,Sa+=ai),Ra+=zn.m,la+=Cn.m,sa+=Qn.m,Sa+=La.m;zn&&!Su(La)&&(La.t=zn,La.m+=Ra-Sa),Cn&&!gf(Qn)&&(Qn.t=Cn,Qn.m+=la-sa,Sn=Xr)}return Sn}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 wc(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 Qn=zn.children;Qn&&Qn.length?(zn.x=jh(Qn),zn.y=yf(Qn)):(zn.x=Zr?Xr+=Oe(zn,Zr):0,zn.y=0,Zr=zn)});var hn=fr(_r),Sn=Rr(_r),Cn=hn.x-Oe(hn,Sn)/2,La=Sn.x+Oe(Sn,hn)/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 fr(ge){var Oe=ge.children;return Oe&&Oe.length?fr(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=vn,It=!1,tr,er="squarify",_r=.5*(1+Math.sqrt(5));function Zr(zn,Qn){for(var la=-1,Sa=zn.length,Ra,sa;++la0;)Sa.push(sa=Ra[Vi-1]),Sa.area+=sa.area,er!=="squarify"||(Yi=Sn(Sa,zi))<=ai?(Ra.pop(),ai=Yi):(Sa.area-=Sa.pop().area,Cn(Sa,zi,la,!1),zi=Math.min(la.dx,la.dy),Sa.length=Sa.area=0,ai=1/0);Sa.length&&(Cn(Sa,zi,la,!0),Sa.length=Sa.area=0),Qn.forEach(Xr)}}function hn(zn){var Qn=zn.children;if(Qn&&Qn.length){var la=St(zn),Sa=Qn.slice(),Ra,sa=[];for(Zr(Sa,la.dx*la.dy/zn.value),sa.area=0;Ra=Sa.pop();)sa.push(Ra),sa.area+=Ra.area,Ra.z!=null&&(Cn(sa,Ra.z?la.dx:la.dy,la,!Sa.length),sa.length=sa.area=0);Qn.forEach(hn)}}function Sn(zn,Qn){for(var la=zn.area,Sa,Ra=0,sa=1/0,ai=-1,Yi=zn.length;++aiRa&&(Ra=Sa));return la*=la,Qn*=Qn,la?Math.max(Qn*Ra*_r/la,la/(Qn*sa*_r)):1/0}function Cn(zn,Qn,la,Sa){var Ra=-1,sa=zn.length,ai=la.x,Yi=la.y,zi=Qn?Oe(zn.area/Qn):0,Vi;if(Qn==la.dx){for((Sa||zi>la.dy)&&(zi=la.dy);++Rala.dx)&&(zi=la.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,ci(Xi(ge,Oe)[2])),ti(ge,ci(Xi(ge,Oe)[2])),ge}function Xi(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,Xi(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],hn=Math.floor(St(Zr)),Sn=Math.ceil(St(Xr)),Cn=Oe%1?2:Oe;if(isFinite(Sn-hn)){if(rt){for(;hn0;La--)_r.push(It(hn)*La);for(hn=0;_r[hn]Xr;Sn--);_r=_r.slice(hn,Sn)}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=Zi(Oe),St=Zi(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=Zi(Oe=tr),St=Zi(1/Oe),ge.domain(rt.map(wt)),It):Oe},It.copy=function(){return jo(ge.copy(),Oe,rt)},Qa(It,ge)}function Zi(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],ItSn?0:1;if(Xr=Ee)return _r(Xr,La)+(Zr?_r(Zr,1-La):"")+"Z";var zn,Qn,la,Sa,Ra=0,sa=0,ai,Yi,zi,Vi,_o,ko,Ws,Po,os=[];if((Sa=(+tr.apply(this,arguments)||0)/2)&&(la=wt===Vl?Math.sqrt(Zr*Zr+Xr*Xr):+wt.apply(this,arguments),La||(sa*=-1),Xr&&(sa=Ot(la/Xr*Math.sin(Sa))),Zr&&(Ra=Ot(la/Zr*Math.sin(Sa)))),Xr){ai=Xr*Math.cos(hn+sa),Yi=Xr*Math.sin(hn+sa),zi=Xr*Math.cos(Sn-sa),Vi=Xr*Math.sin(Sn-sa);var nl=Math.abs(Sn-hn-2*sa)<=xe?0:1;if(sa&&yc(ai,Yi,zi,Vi)===La^nl){var Iu=(hn+Sn)/2;ai=Xr*Math.cos(Iu),Yi=Xr*Math.sin(Iu),zi=Vi=null}}else ai=Yi=0;if(Zr){_o=Zr*Math.cos(Sn-Ra),ko=Zr*Math.sin(Sn-Ra),Ws=Zr*Math.cos(hn+Ra),Po=Zr*Math.sin(hn+Ra);var eu=Math.abs(hn-Sn+2*Ra)<=xe?0:1;if(Ra&&yc(_o,ko,Ws,Po)===1-La^eu){var lo=(hn+Sn)/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){Qn=Zr0?0:1}function Tc(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,hn=ge[1]+Zr,Sn=Oe[0]+_r,Cn=Oe[1]+Zr,La=(Xr+Sn)/2,zn=(hn+Cn)/2,Qn=Sn-Xr,la=Cn-hn,Sa=Qn*Qn+la*la,Ra=rt-wt,sa=Xr*Cn-Sn*hn,ai=(la<0?-1:1)*Math.sqrt(Math.max(0,Ra*Ra*Sa-sa*sa)),Yi=(sa*la-Qn*ai)/Sa,zi=(-sa*Qn-la*ai)/Sa,Vi=(sa*la+Qn*ai)/Sa,_o=(-sa*Qn+la*ai)/Sa,ko=Yi-La,Ws=zi-zn,Po=Vi-La,os=_o-zn;return ko*ko+Ws*Ws>Po*Po+os*os&&(Yi=Vi,zi=_o),[[Yi-_r,zi-Zr],[Yi*rt/Ra,zi*rt/Ra]]}function $f(){return!0}function _c(ge){var Oe=io,rt=Mo,wt=$f,St=Lu,It=St.key,tr=.7;function er(_r){var Zr=[],Xr=[],hn=-1,Sn=_r.length,Cn,La=At(Oe),zn=At(rt);function Qn(){Zr.push("M",St(ge(Xr),tr))}for(;++hn1?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=_c(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 "+hn}function Zr(Xr,hn,Sn,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))||on)(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 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 En=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*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=To||++Wi,rt=Qs(ge),wt=[],St,It,tr=ho||{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,hn=Zr.length;++Xr0;)hn[--Sa].call(ge,la);if(Qn>=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(Sn,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=al,rt=6,wt=6,St=3,It=[10],tr=null,er;function _r(Zr){Zr.each(function(){var Xr=h.select(this),hn=this.__chart__||ge,Sn=this.__chart__=ge.copy(),Cn=tr??(Sn.ticks?Sn.ticks.apply(Sn,It):Sn.domain()),La=er??(Sn.tickFormat?Sn.tickFormat.apply(Sn,It):F),zn=Xr.selectAll(".tick").data(Cn,Sn),Qn=zn.enter().insert("g",".domain").attr("class","tick").style("opacity",Je),la=h.transition(zn.exit()).style("opacity",Je).remove(),Sa=h.transition(zn.order()).style("opacity",1),Ra=Math.max(rt,0)+St,sa,ai=Aa(Sn),Yi=Xr.selectAll(".domain").data([0]),zi=(Yi.enter().append("path").attr("class","domain"),h.transition(Yi));Qn.append("line"),Qn.append("text");var Vi=Qn.select("line"),_o=Sa.select("line"),ko=zn.select("text").text(La),Ws=Qn.select("text"),Po=Sa.select("text"),os=Oe==="top"||Oe==="left"?-1:1,nl,Iu,eu,lo;if(Oe==="bottom"||Oe==="top"?(sa=iu,nl="x",eu="y",Iu="x2",lo="y2",ko.attr("dy",os<0?"0em":".71em").style("text-anchor","middle"),zi.attr("d","M"+ai[0]+","+os*wt+"V0H"+ai[1]+"V"+os*wt)):(sa=ks,nl="y",eu="x",Iu="y2",lo="x2",ko.attr("dy",".32em").style("text-anchor",os<0?"end":"start"),zi.attr("d","M"+os*wt+","+ai[0]+"H0V"+ai[1]+"H"+os*wt)),Vi.attr(lo,os*rt),Ws.attr(eu,os*Ra),_o.attr(Iu,0).attr(lo,os*rt),Po.attr(nl,0).attr(eu,os*Ra),Sn.rangeBand){var Ls=Sn,el=Ls.rangeBand()/2;hn=Sn=function($l){return Ls($l)+el}}else hn.rangeBand?hn=Sn:la.call(sa,Sn,hn);Qn.call(sa,hn,Sn),Sa.call(sa,Sn,Sn)})}return _r.scale=function(Zr){return arguments.length?(ge=Zr,_r):ge},_r.orient=function(Zr){return arguments.length?(Oe=Zr in mu?Zr+"":al,_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 al="bottom",mu={top:1,right:1,bottom:1,left:1};function iu(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 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),la=Qn.selectAll(".background").data([0]);la.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 Sa=Qn.selectAll(".resize").data(Zr,F);Sa.exit().remove(),Sa.enter().append("g").attr("class",function(Yi){return"resize "+Yi}).style("cursor",function(Yi){return Cs[Yi]}).append("rect").attr("x",function(Yi){return/[ew]$/.test(Yi)?-3:null}).attr("y",function(Yi){return/^[ns]/.test(Yi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Sa.style("display",Xr.empty()?"none":null);var Ra=h.transition(Qn),sa=h.transition(la),ai;Oe&&(ai=Aa(Oe),sa.attr("x",ai[0]).attr("width",ai[1]-ai[0]),Sn(Ra)),rt&&(ai=Aa(rt),sa.attr("y",ai[0]).attr("height",ai[1]-ai[0]),Cn(Ra)),hn(Ra)})}Xr.event=function(zn){zn.each(function(){var Qn=ge.of(this,arguments),la={x:wt,y:St,i:It,j:tr},Sa=this.__chart__||la;this.__chart__=la,To?h.select(this).transition().each("start.brush",function(){It=Sa.i,tr=Sa.j,wt=Sa.x,St=Sa.y,Qn({type:"brushstart"})}).tween("brush:brush",function(){var Ra=Il(wt,la.x),sa=Il(St,la.y);return It=tr=null,function(ai){wt=la.x=Ra(ai),St=la.y=sa(ai),Qn({type:"brush",mode:"resize"})}}).each("end.brush",function(){It=la.i,tr=la.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("+wt[+/e$/.test(Qn)]+","+St[+/^s/.test(Qn)]+")"})}function Sn(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,Qn=h.select(h.event.target),la=ge.of(zn,arguments),Sa=h.select(zn),Ra=Qn.datum(),sa=!/^(n|s)$/.test(Ra)&&Oe,ai=!/^(e|w)$/.test(Ra)&&rt,Yi=Qn.classed("extent"),zi=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",eu).on("touchend.brush",Ls):Ws.on("mousemove.brush",eu).on("mouseup.brush",Ls),Sa.interrupt().selectAll("*").interrupt(),Yi)_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",Qn.style("cursor")),la({type:"brushstart"}),eu();function nl(){h.event.keyCode==32&&(Yi||(Vi=null,_o[0]-=wt[1],_o[1]-=St[1],Yi=2),re())}function Iu(){h.event.keyCode==32&&Yi==2&&(_o[0]+=wt[1],_o[1]+=St[1],Yi=0,re())}function eu(){var el=h.mouse(zn),$l=!1;ko&&(el[0]+=ko[0],el[1]+=ko[1]),Yi||(h.event.altKey?(Vi||(Vi=[(wt[0]+wt[1])/2,(St[0]+St[1])/2]),_o[0]=wt[+(el[0]0))return ar;do ar.push(Er=new Date(+Ft)),Ne(Ft,Qt),pe(Ft);while(Er=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););})},lt&&(nt.count=function(Ft,Nt){return b.setTime(+Ft),S.setTime(+Nt),pe(b),pe(S),Math.floor(lt(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,lt){Ne.setTime(+Ne+lt*pe)},function(Ne,lt){return(lt-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,lt){Ne.setDate(Ne.getDate()+lt*7)},function(Ne,lt){return(lt-Ne-(lt.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,lt){Ne.setFullYear(Ne.getFullYear()+lt*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,lt){Ne.setUTCDate(Ne.getUTCDate()+lt*7)},function(Ne,lt){return(lt-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,lt){Ne.setUTCFullYear(Ne.getUTCFullYear()+lt*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})})}}),Di=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,$s()):(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),Br=f(Qe),kn=c(Qe),Wn=f(Lt),Vn=c(Lt),na={a:ma,A:da,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},aa={a:Mi,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:lt,Y:dt,Z:nt,"%":Ft},Un={a:or,A:ur,b:Gr,B:sn,c:mn,d:m,e:m,f:z,H:d,I:d,j:u,L,m:w,M:y,p:qt,q:_,Q:N,s:B,S:I,u:v,U:T,V:l,w:p,W:g,x:Tn,X:Jn,y:A,Y:x,Z:M,"%":F};na.x=ka(ke,na),na.X=ka(xe,na),na.c=ka(Je,na),aa.x=ka(ke,aa),aa.X=ka(xe,aa),aa.c=ka(Je,aa);function ka(Dr,qr){return function(ln){var Jr=[],At=-1,lr=0,zr=Dr.length,un,Rn,qn;for(ln instanceof Date||(ln=new Date(+ln));++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,ln,Jr){for(var At=0,lr=qr.length,zr=ln.length,un,Rn;At=zr)return-1;if(un=qr.charCodeAt(At++),un===37){if(un=qr.charAt(At++),Rn=Un[un in r?qr.charAt(At++):un],!Rn||(Jr=Rn(Dr,ln,Jr))<0)return-1}else if(un!=ln.charCodeAt(Jr++))return-1}return Jr}function qt(Dr,qr,ln){var Jr=Ct.exec(qr.slice(ln));return Jr?(Dr.p=Ot[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function or(Dr,qr,ln){var Jr=mr.exec(qr.slice(ln));return Jr?(Dr.w=vr[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function ur(Dr,qr,ln){var Jr=Kt.exec(qr.slice(ln));return Jr?(Dr.w=xr[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function Gr(Dr,qr,ln){var Jr=Wn.exec(qr.slice(ln));return Jr?(Dr.m=Vn[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function sn(Dr,qr,ln){var Jr=Br.exec(qr.slice(ln));return Jr?(Dr.m=kn[Jr[0].toLowerCase()],ln+Jr[0].length):-1}function mn(Dr,qr,ln){return sr(Dr,Je,qr,ln)}function Tn(Dr,qr,ln){return sr(Dr,ke,qr,ln)}function Jn(Dr,qr,ln){return sr(Dr,xe,qr,ln)}function ma(Dr){return Xe[Dr.getDay()]}function da(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 Mi(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+="",na);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+="",aa);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 lt(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;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 ar=t(je),h.timeFormat=ar.format,h.timeParse=ar.parse,h.utcFormat=ar.utcFormat,h.utcParse=ar.utcParse,ar}var Mr="%Y-%m-%dT%H:%M:%S.%LZ";function $r(je){return je.toISOString()}var Sr=Date.prototype.toISOString?$r:h.utcFormat(Mr);function Nr(je){var Je=new Date(je);return isNaN(Je)?null:Je}var Mt=+new Date("2000-01-01T00:00:00.000Z")?Nr:h.utcParse(Mr);h.isoFormat=Sr,h.isoParse=Mt,h.timeFormatDefaultLocale=Er,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})})}}),Nl=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}}}),Si=Ge({"node_modules/fast-isnumeric/index.js"(K,G){var h=Nl();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}}}),Kn=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}}}),Is=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)}}),Ki=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)}}}),Wg=Ge({"src/lib/coerce.js"(K){var G=Si(),h=Is(),b=Ki().extendFlat,S=Gl(),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")}}}}),Vc=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;eGi({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),K.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>Gi({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})}}),sv=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=Gl(),S=Ns(),E=md().dash,e=Ki().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=sv();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=Ki().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}}}}),T1=Ge({"src/plots/layout_attributes.js"(K,G){var h=Ns(),b=Jg(),S=Xf(),E=Qg(),e=Vw(),t=Hw(),r=Ki().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"})}}}),UT=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=lu(),h=Vc(),b=Wd(),S=So(),E=Kg().addStyleRule,e=Ki(),t=Gl(),r=T1(),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;K.incrementMonth=function(F,N,B){B=v(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},K.findExactDates=function(F,N){for(var B=0,R=0,U=0,j=0,Z,re,fe=v(N)&&a.getComponentMethod("calendars","getCal")(N),le=0;le1?(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}}}),qT=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)}}}),MM=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}}}),VT=Ge({"src/lib/preserve_drawing_buffer.js"(K,G){var h=Si(),b=MM();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}}}),HT=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}}}),EM=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}}}),A1=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=Si(),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=Di().utcFormat,S=zo().format,E=Si(),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=Kn();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=Wg();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=am();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=zp();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=lx();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=jT();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=qT();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=Ki();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var M=lu();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=VT(),n.makeTraceGroups=HT(),n._=EM(),n.notifier=Ul(),n.filterUnique=A1(),n.filterVisible=ux(),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=Vc(),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(bo(Gi({},te),{opts:U}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=te=>ce(bo(Gi({},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(bo(Gi({},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]}}}),kM=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}}),cx=Ge({"node_modules/is-browser/client.js"(K,G){G.exports=!0}}),Xw=Ge({"node_modules/has-hover/index.js"(K,G){var h=cx(),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=Di().timeFormatLocale,S=zo().formatLocale,E=Si(),e=Ti(),t=Ro(),r=ry(),o=_u(),n=_n(),i=go(),a=Ii().BADNUM,s=Df(),f=im().clearOutline,c=om(),p=Jg(),v=fx(),T=Bd().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,x=G.exports={};n.extendFlat(x,t),x.attributes=Gl(),x.attributes.type.values=x.allTypes,x.fontAttrs=Ns(),x.layoutAttributes=T1();var A=GT();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),lt=Object.keys(Ae.y);if(Ne.length>1&<.length>1){for(t.getComponentMethod("grid","sizeDefaults")(te,ue),Le=0;Le15&<.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")),Er=Qt,Mr=ar;Er&&!Mr?$._bgLayer.remove():Mr&&!Er&&(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={},Nr;for(Nr in $r)Sr[Nr]="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 lt in Fe)lt!=="base"&&E(Fe[lt][pe].size)&&(Ne=Fe[lt][pe].size>Ne?Fe[lt][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,Er=Nt.val,Mr=Nt.size,$r=ne-H.r-H.l,Sr=$-H.t-H.b;for(var Nr in Fe){if(E(ar)&&Fe[Nr].r){var Mt=Fe[Nr].r.val,je=Fe[Nr].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(Mr)&&Fe[Nr].t){var xe=Fe[Nr].t.val,ye=Fe[Nr].t.size;if(xe>Er){var Ee=(Mr*xe+(ye-Sr)*Er)/(xe-Er),Xe=(ye*(1-Er)+(Mr-Sr)*(1-xe))/(xe-Er);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)}}}}),Ec=Ge({"src/components/colorscale/index.js"(K,G){var h=pp(),b=gd();G.exports={moduleType:"component",name:"colorscale",attributes:zu(),layoutAttributes:eg(),supplyLayoutDefaults:XT(),handleDefaults:yh(),crossTraceDefaults:vx(),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))}}}}),Fp=Ge({"src/traces/scatter/make_bubble_size_func.js"(K,G){var h=Si();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}}}}),$d=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 lt=Pe%100;return l.symbolFuncs[lt](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,lt,dt){var nt=I[Ne];return L(Pe,Ae,pe,nt.type,lt,dt,nt.start,nt.stop,!1,nt.reversed)};function L(Pe,Ae,pe,Ne,lt,dt,nt,Ft,Nt,Qt){var ar=lt.length,Er;Ne==="linear"?Er={node:"linearGradient",attrs:{x1:nt.x,y1:nt.y,x2:Ft.x,y2:Ft.y,gradientUnits:Nt?"userSpaceOnUse":"objectBoundingBox"},reversed:Qt}:Ne==="radial"&&(Er={node:"radialGradient",reversed:Qt});for(var Mr=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),Er=ae(Pe,pe);Ae.attr("d",d(Qt,Nt,ar,Er))}var Mr=!1,$r,Sr,Nr;if(Pe.so)Nr=Ft.outlierwidth,Sr=Ft.outliercolor,$r=nt.outliercolor;else{var Mt=(Ft||{}).width;Nr=(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,Mr=!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":(Nr||1)+"px",fill:"none"});else{Ae.style("stroke-width",(Pe.isBlank?0:Nr)+"px");var je=nt.gradient,Je=Pe.mgt;Je?Mr=!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?Mr=!0:Ee=je.color;var Xe=pe.uid;Mr&&(Xe+="-"+Pe.i),l.gradient(Ae,lt,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",lt,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);Nr&&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||{},lt=Pe.marker||{},dt=pe.marker||{},nt=Ne.marker||{},Ft=lt.opacity,Nt=dt.opacity,Qt=nt.opacity,ar=Nt!==void 0,Er=Qt!==void 0;(b.isArrayOrTypedArray(Ft)||ar||Er)&&(Ae.selectedOpacityFn=function(xe){var ye=xe.mo===void 0?lt.opacity:xe.mo;return xe.selected?ar?Nt:ye:Er?Qt:c*ye});var Mr=lt.color,$r=dt.color,Sr=nt.color;($r||Sr)&&(Ae.selectedColorFn=function(xe){var ye=xe.mcc||Mr;return xe.selected?$r||ye:Sr||ye});var Nr=lt.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||Nr/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||{},lt=Pe.textfont||{},dt=pe.textfont||{},nt=Ne.textfont||{},Ft=lt.color,Nt=dt.color,Qt=nt.color;return Ae.selectedTextColorFn=function(ar){var Er=ar.tc||Ft;return ar.selected?Nt||Er:Qt||(Nt?Er:r.addOpacity(Er,c))},Ae},l.selectedPointStyle=function(Pe,Ae){if(!(!Pe.size()||!Ae.selectedpoints)){var pe=l.makeSelectedPointStyleFns(Ae),Ne=Ae.marker||{},lt=[];pe.selectedOpacityFn&<.push(function(dt,nt){dt.style("opacity",pe.selectedOpacityFn(nt))}),pe.selectedColorFn&<.push(function(dt,nt){r.fill(dt,pe.selectedColorFn(nt))}),pe.selectedSizeFn&<.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}),lt.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 lt=l.makeSelectedTextStyleFns(Ae);Ne=lt.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,Er=ar?ar(Ft,Ae,nt):{},Mr={};T(Mr,Ae,Ft.i),Qt=b.texttemplateString({data:[Mr,Ft,Ae._meta],fallback:Ae.texttemplatefallback,labels:Er,locale:nt._d3locale,template:Qt})}var $r=Ft.tp||Ae.textposition,Sr=N(Ft,Ae),Nr=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:Nr}).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 lt=h.select(this),dt=pe.selectedTextColorFn(Ne),nt=Ne.tp||Ae.textposition,Ft=N(Ne,Ae);r.fill(lt,dt);var Nt=t.traceIs(Ae,"bar-like");F(lt,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=[],lt;for(lt=1;lt=Nt||xe>=ar&&xe<=Nt)&&(ye<=Er&&ye>=Qt||ye>=Er&&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 lt=Pe.childNodes[0];if(pe=$(lt),pe){var dt=+lt.getAttribute("x")||0,nt=+lt.getAttribute("y")||0,Ft=lt.getAttribute("transform");if(!Ft){var Nt=l.bBox(lt,!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 Er=Qt.getBoundingClientRect(),Mr=l.testref.node().getBoundingClientRect();Ae||ar.removeChild(Qt);var $r={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]=$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")||"",lt=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+lt[0]||0,y:+lt[1]||0}},l.setTranslate=function(Pe,Ae,pe){var Ne=/(\btranslate\(.*?\);?)/,lt=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[lt]("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")||"",lt=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+lt[0]||1,y:+lt[1]||1}},l.setScale=function(Pe,Ae,pe){var Ne=/(\bscale\(.*?\);?)/,lt=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[lt]("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 lt=(this.getAttribute("transform")||"").replace(te,"");lt+=Ne,lt=lt.trim(),this.setAttribute("transform",lt)})}};var H=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Pe,Ae,pe){Pe&&Pe.each(function(){var Ne,lt=h.select(this),dt=lt.select("text");if(dt.node()){var nt=parseFloat(dt.attr("x")||0),Ft=parseFloat(dt.attr("y")||0),Nt=(lt.attr("transform")||"").match(H);Ae===1&&pe===1?Ne=[]:Ne=[n(nt,Ft),"scale("+Ae+","+pe+")",n(-nt,-Ft)],Nt&&Ne.push(Nt),lt.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,lt,dt=Ae.marker.angleref;if(dt==="previous"||dt==="north"){if(Ae._geo){var nt=Ae._geo.project(Pe.lonlat);Ne=nt[0],lt=nt[1]}else{var Ft=Ae._xA,Nt=Ae._yA;if(Ft&&Nt)Ne=Ft.c2p(Pe.x),lt=Nt.c2p(Pe.y);else return 90}if(Ae._geo){var Qt=Pe.lonlat[0],ar=Pe.lonlat[1],Er=Ae._geo.project([Qt,ar+1e-5]),Mr=Ae._geo.project([Qt+1e-5,ar]),$r=ie(Mr[1]-lt,Mr[0]-Ne),Sr=ie(Er[1]-lt,Er[0]-Ne),Nr;if(dt==="north")Nr=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);Nr=-ie(ye,Ee)-Math.PI,Fe=Qt,ze=ar}var Xe=Le($r,[de(Nr),0]),Qe=Le(Sr,[Se(Nr),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(lt)){var Lt=Ne-Ye,Ct=lt-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=lt,ct=Pe.i,at=Ae.uid,pe}l.getMarkerAngle=et}}),lm=Ge({"src/components/titles/index.js"(K,G){var h=ki(),b=Si(),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(Mr,$r){return Mr===void 0||$r===void 0?!1:Mr.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,lt=T+"-subtitle",dt=$||at;if(V&&(Ne=d.selectAll("text."+lt).data(dt?[0]:[]),Ne.enter().append("text"),Ne.text($).attr("class",lt),Ne.exit().remove()),!Pe)return d;function nt(Mr,$r){e.syncOrAsync([Ft,Nt],{title:Mr,subtitle:$r})}function Ft(Mr){var $r=Mr.title,Sr=Mr.subtitle,Nr;!u&&Ae&&(u={}),u?(Nr="",u.rotate&&(Nr+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||Ae)&&(Nr+=t(0,(u.offset||0)-(Ae||0)))):Nr=null,$r.attr("transform",Nr);function Mt(Ee){if(Ee){var Xe=h.select(Ee.node().parentNode).select("."+lt);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",Nr),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(Mr){var $r=Mr.title,Sr=h.select($r.node().parentNode);if(w&&w.selection&&w.side&&L){Sr.attr("transform",null);var Nr=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[Nr])+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(Mr,$r){Mr.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(Mr){_!==void 0?E.call("_guiRestyle",v,A,Mr,_):E.call("_guiRelayout",v,A,Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).on("input",function(Mr){this.text(Mr||" ").call(n.positionText,m.x,m.y)}),V)){if(V&&!L){var ar=pe.node().getBBox(),Er=ar.y+ar.height+c*ie;Ne.attr("y",Er)}$?Ne.on(".opacity",null):(Qt(Ne,ee),ue=!0),Ne.call(n.makeEditable,{gd:v}).on("edit",function(Mr){E.call("_guiRelayout",v,"title.subtitle.text",Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).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),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=Di().utcFormat,S=_n(),E=S.numberFormat,e=Si(),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),lt=!1)}lt&&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])}}}),Bp=Ge({"src/plots/cartesian/autorange.js"(K,G){var h=ki(),b=Si(),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=Si(),S=ef(),E=Ro(),e=_n(),t=e.strTranslate,r=nc(),o=lm(),n=go(),i=As(),a=id(),s=hx(),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 $=um(),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=Bp();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),ln=Cr._fullLayout._subplots[qr+"axis"],Jr=jr+"ref",At={};return Vr||(Vr=ln[0]||(typeof Dr=="string"?Dr:Dr[0])),Dr||(Dr=Vr),ln=ln.concat(ln.map(function(lr){return lr+" domain"})),At[Jr]={valType:"enumerated",values:ln.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,ln,Jr=ne.getRefType(jr);if(Jr!=="range")qr=e.ensureNumber,ln=Cr(Vr,Dr);else{var At=ne.getFromId(xt,jr);Dr=At.fraction2r(Dr),ln=Cr(Vr,Dr),qr=At.cleanPos}Dt[Vr]=qr(ln)},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,ln){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 un=Cr.dtick/2;Dt+=Dt+unqr){var ln=Number(Cr.slice(1));Dr.exactYears>qr&&ln%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 ln=b(xt.dtick),Jr=b(Dt.dtick),At=ln?xt.dtick:+xt.dtick.substring(1),lr=Jr?Dt.dtick:+Dt.dtick.substring(1);ln&&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 ln=Dt[Dr].value,Jr=Dt[qr].value,At=Math.abs(Jr-ln),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 un;zr>=At&&(zr=At,un=!0);var Rn=Vr+zr;if(xt.rangebreaks&&zr>0){for(var qn=84,jn=0,cn=0;cn_&&(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",ln=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 Hi=!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(Hi?ne.prepMinorTicks(so,xt,Cr):ne.prepTicks(so,Cr),so.tickmode==="array"){Ci?(cn=[],qn=Ne(xt,!Hi)):(In=[],jn=Ne(xt,!Hi));continue}if(so.tickmode==="sync"){cn=[],qn=pe(xt);continue}var io=de(At),Mo=io[0],fi=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=fi:Jo<=fi;Jo=ne.tickIncrement(Jo,Vs,lr,Vr)){if(Ci&&Uo++,so.rangebreaks&&!lr){if(Jo=un)break}if(cn.length>Rn||Jo===cs)break;cs=Jo;var sl={value:Jo};Ci?(Ho&&Jo!==(Jo|0)&&(sl.simpleLabel=!0),Dr>1&&Uo%Dr&&(sl.skipLabel=!0),cn.push(sl)):(sl.minor=!0,In.push(sl))}}if(!In||In.length<2)Jr=!1;else{var fs=(In[1].value-In[0].value)*(ln?-1:1);Mi(fs,xt.tickformat)||(Jr=!1)}if(!Jr)gi=cn;else{var Zo=cn.concat(In);qr&&cn.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 vo=Zo.map(function(Io,cu){return Io.minor===void 0&&!Io.skipLabel?cu:null}).filter(function(Io){return Io!==null});vo.forEach(function(Io){Jr.map(function(cu){var vu=Io+cu;vu>=0&&vu-1;Ps--){if(cn[Ps].drop){cn.splice(Ps,1);continue}cn[Ps].value=da(cn[Ps].value,xt);var ul=xt.c2p(cn[Ps].value);(Fo?Zs>ul-Rl:Zsun||Osun&&(vu.periodX=un),OsVr&&unp)xt/=p,jr=Vr(10),Dt.dtick="M"+12*Er(xt,jr,lt);else if(Dr>A)xt/=A,Dt.dtick="M"+Er(xt,1,dt);else if(Dr>w){if(Dt.dtick=Er(xt,w,Dt._hasDayOfWeekBreaks?[1,2,7,14]:Ft),!Cr){var qr=ne.getTickFormat(Dt),ln=Dt.ticklabelmode==="period";ln&&(Dt._rawTick0=Dt.tick0),/%[uVW]/.test(qr)?Dt.tick0=e.dateTick0(Dt.calendar,2):Dt.tick0=e.dateTick0(Dt.calendar,1),ln&&(Dt._dowTick0=Dt.tick0)}}else Dr>u?Dt.dtick=Er(xt,u,dt):Dr>d?Dt.dtick=Er(xt,d,nt):Dr>y?Dt.dtick=Er(xt,y,nt):(jr=Vr(10),Dt.dtick=Er(xt,jr,lt))}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"+Er(xt,jr,lt)}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))):ma(Dt)?(Dt.tick0=0,jr=1,Dt.dtick=Er(xt,jr,ar)):(Dt.tick0=0,jr=Vr(10),Dt.dtick=Er(xt,jr,lt));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 Mr(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 ln=Math.max(Math.abs(qr[0]),Math.abs(qr[1])),Jr=Math.floor(Math.log(ln)/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 ln=xt==="D2"?Qt:Nt,Jr=Dt+Vr*.01,At=e.roundUp(e.mod(Jr,1),ln,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?cn:null};if(Dr&&e.isArrayOrTypedArray(Dt.ticktext)){var zr=e.simpleMap(Dt.range,Dt.r2l),un=(Math.abs(zr[1]-zr[0])-(Dt._lBreaks||0))/1e4;for(At=0;At"+ln;else{var At=_a(Dt),lr=Dt._trueSide||Dt.side;(!At&&lr==="top"||At&&lr==="bottom")&&(qr+="
")}xt.text=qr}function Nr(Dt,xt,Cr,jr,Vr){var Dr=Dt.dtick,qr=xt.x,ln=Dt.tickformat,Jr=typeof Dr=="string"&&Dr.charAt(0);if(Vr==="never"&&(Vr=""),jr&&Jr!=="L"&&(Dr="L3",Jr="L"),ln||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],un=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],un>0&&(xt.text+="x10"),xt.text==="1x10"&&(xt.text="10"),zr!==0&&zr!==1&&(xt.text+=""+(zr>0?"":z)+un+""),xt.fontSize*=1.25):(Rn==="e"||Rn==="E")&&un>2?xt.text=lr[0]+Rn+(zr>0?"+":z)+un:(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 ln=xt.x<0;qr[1]===1?qr[0]===1?xt.text="π":xt.text=qr[0]+"π":xt.text=["",qr[0],"","⁄","",qr[1],"","π"].join(""),ln&&(xt.text=z+xt.text)}}}else xt.text=Ot(xt.x,Dt,Vr,jr)}function xe(Dt){function xt(ln,Jr){return Math.abs(ln-Jr)<=1e-6}function Cr(ln,Jr){return xt(Jr,0)?ln:Cr(Jr,ln%Jr)}function jr(ln){for(var Jr=1;!xt(Math.round(ln*Jr)/Jr,ln);)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",ln=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]};Mr(lr),Dr=(Number(lr._tickround)||0)+4,ln=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"&&(ln=0),Dt=Math.abs(Dt),Dt"+qn+"":qr==="B"&&ln===9?Dt+="B":Xe(qr)&&(Dt+=qr==="SI extended"?Ee[ln/3+10]:ye[ln/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)),un=lr.indexOf(At.charAt(0));return zr===un?Number(Jr.replace(/(L|D)/g,""))-Number(At.replace(/(L|D)/g,"")):zr-un}else return typeof Jr=="number"?1:-1}function Vr(Jr,At,lr){var zr=lr||function(qn){return qn},un=At[0],Rn=At[1];return(!un&&typeof un!="number"||zr(un)<=zr(Jr))&&(!Rn&&typeof Rn!="number"||zr(Rn)>=zr(Jr))}function Dr(Jr,At){var lr=At[0]===null,zr=At[1]===null,un=jr(Jr,At[0])>=0,Rn=jr(Jr,At[1])<=0;return(lr||un)&&(zr||Rn)}var qr,ln;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 ln={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=ln,Cr.overlayingShiftedAx=qr;var lr=ne.drawOne(Dt,At,Cr);return At._shiftPusher&&Hn(At,At._fullDepth||0,ln,!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,ln;xt.setScale();var Jr=Dt._fullLayout,At=xt._id,lr=At.charAt(0),zr=ne.counterLetter(At),un=Jr._plots[xt._mainSubplot],Rn=xt.zerolinelayer==="above traces";if(!un)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=un[lr+"axislayer"],cn=xt._mainLinePosition,In=cn+=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 Yu=0,df=0;if(xt._shiftPusher&&(Yu=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+=aa(xt))),xt._fullDepth=Math.max(Yu,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 Ic=xt._offset-Os.top;Ic>0&&(wl.yt=1,wl.t=Ic)}wl[zr]=xt.anchor==="free"?xt.position:xt._anchorAxis.domain[Xc[0]],xt.title.text!==Jr._dfltTitle[lr]&&(wl[Yl]+=aa(xt)+(xt.title.standoff||0)),xt.mirror&&xt.anchor!=="free"&&(Fl={x:0,y:0,r:0,l:0,t:0,b:0},Fl[Io]=xt.linewidth,xt.mirror&&xt.mirror!==!0&&(Fl[Io]+=vu),xt.mirror===!0||xt.mirror==="ticks"?Fl[zr]=xt._anchorAxis.domain[Xc[1]]:(xt.mirror==="all"||xt.mirror==="allticks")&&(Fl[zr]=[xt._counterDomainMin,xt._counterDomainMax][Xc[1]]))}Xl&&(ql=E.getComponentMethod("rangeslider","autoMarginOpts")(Dt,xt)),typeof xt.automargin=="string"&&(Kt(wl,xt.automargin),Kt(Fl,xt.automargin)),S.autoMargin(Dt,or(xt),wl),S.autoMargin(Dt,ur(xt),Fl),S.autoMargin(Dt,Gr(xt),ql)}),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 ln=Dr.xbnd[qr];ln!==null&&Cr.push(e.extendFlat({},Dr,{x:ln}))};if(xt.length){for(jr=0;jrDt.range[1],ln=Dt.ticklabelposition&&Dt.ticklabelposition.indexOf("inside")!==-1,Jr=!ln;if(Cr){var At=qr?-1:1;Cr=Cr*At}if(jr){var lr=Dt.side,zr=ln&&(lr==="top"||lr==="left")||Jr&&(lr==="bottom"||lr==="right")?1:-1;jr=jr*zr}return Dt._id.charAt(0)==="x"?function(un){return t(Vr+Dt._offset+Dt.l2p(kn(un))+Cr,Dr+jr)}:function(un){return t(Dr+jr,Vr+Dt._offset+Dt.l2p(kn(un))+Cr)}};function kn(Dt){return Dt.periodX!==void 0?Dt.periodX:Dt.x}function Wn(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"),ln=jr("bottom"),Jr=jr("inside"),At=Cr!=="boundaries"&&(ln||Dr||Vr||qr);if(!At&&!Jr)return[0,0];var lr=Dt.side,zr=At?(Dt.tickwidth||0)/2:0,un=ee,Rn=Dt.tickfont?Dt.tickfont.size:12;return(ln||Vr)&&(zr+=Rn*le,un+=(Dt.linewidth||0)/2),(Dr||qr)&&(zr+=(Dt.linewidth||0)/2,un+=ee),Jr&&lr==="top"&&(un-=Rn*(1-le)),(Dr||Vr)&&(zr=-zr),(lr==="bottom"||lr==="right")&&(un=-un),[At?zr:0,Jr?un: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),ln=(Dt.linewidth||1)/2;return qr==="x"?"M0,"+(xt+ln*Cr)+"v"+Dr*Cr:"M"+(xt+ln*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"),ln=Dr("left"),Jr=Dr("right"),At=Dr("bottom"),lr=Vr!=="boundaries"&&(At||ln||qr||Jr),zr=Dr("inside"),un=jr==="inside"&&Dt.ticks==="inside"||!zr&&Dt.ticks==="outside"&&Vr!=="boundaries",Rn=0,qn=0,jn=un?Dt.ticklen:0;if(zr?jn*=-1:lr&&(jn=0),un&&(Rn+=jn,Cr)){var cn=e.deg2rad(Cr);Rn=jn*Math.cos(cn)+1,qn=jn*Math.sin(cn)}Dt.showticklabels&&(un||Dt.showline)&&(Rn+=.2*Dt.tickfont.size),Rn+=(Dt.linewidth||1)/2*(zr?-1:1);var In={labelStandoff:Rn,labelShift:qn},gi,Ea,Ci,Hi,so=0,io=Dt.side,Mo=Dt._id.charAt(0),fi=Dt.tickangle,ts;if(Mo==="x")ts=!zr&&io==="bottom"||zr&&io==="top",Hi=ts?1:-1,zr&&(Hi*=-1),gi=qn*Hi,Ea=xt+Rn*Hi,Ci=ts?1:-.2,Math.abs(fi)===90&&(zr?Ci+=fe:fi===-90&&io==="bottom"?Ci=le:fi===90&&io==="top"?Ci=fe:Ci=.5,so=fe/2*(fi/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(ln)return"end";if(Jr)return"start"}return!b(Jo)||Jo===0||Jo===180?"middle":Jo*Hi<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",Hi=ts?1:-1,zr&&(Hi*=-1),gi=Rn,Ea=qn*Hi,Ci=0,!zr&&Math.abs(fi)===90&&(fi===-90&&io==="left"||fi===90&&io==="right"?Ci=le:Ci=.5),zr){var Ho=b(fi)?+fi:0;if(Ho!==0){var Xs=e.deg2rad(Ho);so=Math.abs(Math.sin(Xs))*le*Hi,Ci=0}}In.xFn=function(cs){return cs.dx+xt-(gi+cs.fontSize*Ci)*Hi+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}):[],ln=Cr.counterAxis;if(ln&&ne.shouldShowZeroLine(Dt,xt,ln))for(var Jr=xt.tickmode==="array",At=0;At=0;qn--){var jn=qn?un:Rn;if(jn){var cn=jn.selectAll("path."+jr).data(qn?qr:Dr,Vn);cn.exit().remove(),cn.enter().append("path").classed(jr,1).classed("crisp",Cr.crisp!==!1),cn.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"&&cn.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,ln){return te(qr.id,ln.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",ln=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?ln:[],Vn),un=[];zr.enter().append("g").classed(qr,1).append("text").attr("text-anchor","middle").each(function(fs){var Zo=h.select(this),vo=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[vo]?un.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(vo){var hs=h.select(this),ll=hs.select(".text-math-group"),kl=Jr.anchorFn(vo,Zo),Pl=Cr.transFn.call(hs.node(),vo)+(b(Zo)&&+Zo!=0?" rotate("+Zo+","+Jr.xFn(vo)+","+(Jr.yFn(vo)-vo.fontSize/2)+")":""),Ms=r.lineCount(hs),di=ce*vo.fontSize,to=Jr.heightFn(vo,b(Zo)?+Zo:0,(Ms-1)*di);if(to&&(Pl+=t(0,to)),ll.empty()){var Cl=hs.select("text");Cl.attr({transform:Pl,"text-anchor":kl}),Cl.style("display",null),xt._adjustTickLabelsOverflow&&xt._adjustTickLabelsOverflow()}else{var Ps=i.bBox(ll.node()).width,Fo=Ps*{end:-.5,start:.5}[kl];ll.attr("transform",Pl+t(Fo,0))}})}xt._adjustTickLabelsOverflow=function(){var fs=xt.ticklabeloverflow;if(!(!fs||fs==="allow")){var Zo=fs.indexOf("hide")!==-1,vo=xt._id.charAt(0)==="x",hs=0,ll=vo?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,ll=xt.l2p(kl[1])+xt._offset}var Pl=Math.min(hs,ll),Ms=Math.max(hs,ll),di=xt.side,to=1/0,Cl=-1/0;zr.each(function(Zs){var ul=h.select(this),Au=ul.select(".text-math-group");if(Au.empty()){var Ji=i.bBox(ul.node()),gs=0;vo?(Ji.right>Ms||Ji.leftMs||Ji.top+(xt.tickangle?0:Zs.fontSize/4)xt["_visibleLabelMin_"+kl._id]?ul.style("display","none"):Ms.K==="tick"&&!Pl&&ul.node().style.display!=="none"&&ul.style("display",null)})})})})},Rn(zr,lr+1?lr:At);function qn(){return un.length&&Promise.all(un)}var jn=null;function cn(){if(Rn(zr,At),ln.length&&xt.autotickangles&&(xt.type!=="log"||String(xt.dtick).charAt(0)!=="D")){jn=xt.autotickangles[0];var fs=0,Zo=[],vo,hs=1;zr.each(function(wl){fs=Math.max(fs,wl.fontSize);var Fl=xt.l2p(wl.x),ql=qt(this),Yu=i.bBox(ql.node());hs=Math.max(hs,r.lineCount(ql)),Zo.push({top:0,bottom:10,height:10,left:Fl-Yu.width/2,right:Fl+Yu.width/2+2,width:Yu.width+2})});var ll=(xt.tickson==="boundaries"||xt.showdividers)&&!Cr.secondary,kl=ln.length,Pl=Math.abs((ln[kl-1].x-ln[0].x)*xt._m)/(kl-1),Ms=ll?Pl/2:Pl,di=ll?xt.ticklen:fs*1.25*hs,to=Math.sqrt(Math.pow(Ms,2)+Math.pow(di,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,Fl){return Math.abs(Math.cos(wl))Ys*Uo&&(Xs=Uo,fi[Mo]=ts[Mo]=cs[Mo])}var Vs=Math.abs(Xs-Ho);Vs-Hi>0?(Vs-=Hi,Hi*=1+Hi/Vs):Hi=0,xt._id.charAt(0)!=="y"&&(Hi=-Hi),fi[io]=Ea.p2r(Ea.r2p(ts[io])+so*Hi),Ea.autorange==="min"||Ea.autorange==="max reversed"?(fi[0]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0):(Ea.autorange==="max"||Ea.autorange==="min reversed")&&(fi[1]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0),jr._insideTickLabelsUpdaterange[Ea._name+".range"]=fi}var sl=e.syncOrAsync(In);return sl&&sl.then&&Dt._promises.push(sl),sl};function na(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 aa(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,ln=(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+ln*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,un,Rn;Vr==="x"?(un=xt._offset+xt._length/2,Rn=xt.side==="top"?lr-qr:lr+qr):(Rn=xt._offset+xt._length/2,un=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 cn=i.getTranslate(jn.node().parentNode);qn.offsetLeft=cn.x,qn.offsetTop=cn.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:un,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}}}),YT=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")}}}),ZT=Ge({"src/plots/cartesian/range_defaults.js"(K,G){var h=YT();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=cx();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()}}),LM=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}}}),PM=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]}}}),RM=Ge({"src/components/dragelement/unhover.js"(K,G){var h=S1(),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}))}}}),lv=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=LM(),t.getCursor=PM();var r=RM();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)}}}),Np=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)}}}),IM=Ge({"src/lib/override_cursor.js"(K,G){var h=Np(),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 lt="legendfill-"+de.uid;e.gradient(Ne,M,lt,T(Ye),ze,"fill")}},ct=function(Ne){if(Ne.size()){var lt="legendline-"+de.uid;e.lineGroupStyle(Ne),e.gradient(Ne,M,lt,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 lt=S.nestedProperty(ae,Pe).get(),dt=S.isArrayOrTypedArray(lt)&&Ae?Ae(lt):lt;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,lt=g(at.size,8,10),dt=g(at.solidity,.5,1),nt="legend-"+$.uid;Se.call(e.pattern,"legend",M,nt,Pe,lt,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}}}),e5=Ge({"src/components/legend/draw.js"(K,G){var h=ki(),b=_n(),S=ef(),E=Ro(),e=S1(),t=lv(),r=As(),o=go(),n=nc(),i=Kw(),a=KT(),s=ad(),f=s.LINE_SPACING,c=s.FROM_TL,p=s.FROM_BR,v=DM(),T=QT(),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 lt=F(U,fe,pe,Ne);if(lt)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,Er=Qt/ar,Mr=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+Mr}),r.setClipUrl(Le,le,U),xe(Mr,Nt,Er),ie.on("wheel",function(){Mr=b.constrain(Z._scrollY+h.event.deltaY/ar*Qt,0,ar),xe(Mr,Nt,Er),Mr!==0&&Mr!==ar&&h.event.preventDefault()});var $r,Sr,Nr,Mt=function(Lt,Ct,Ot){var Kt=(Ot-Ct)/Er+Lt;return b.constrain(Kt,0,ar)},je=function(Lt,Ct,Ot){var Kt=(Ct-Ot)/Er+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,Nr=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(Nr,$r,Sr),xe(Mr,Nt,Er))});Ye.call(Je);var ke=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"&&($r=Lt.changedTouches[0].clientY,Nr=Mr)}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.type==="touchmove"&&(Sr=Lt.changedTouches[0].clientY,Mr=je(Nr,$r,Sr),xe(Mr,Nt,Er))});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",lt=Se||de,dt=fe.width/2;re._maxWidth=Math.max(pe?lt&&Ae==="left"?ce.l+ce.w:dt:Ne?lt&&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,Er=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,Er+=Qt+Le,Qt=ye):Qt=Math.max(Qt,ye),r.setTranslate(this,ar,Er),ar+=Ee}),re._width=Math.max(Nt,ar)+$,re._height=Er+Qt+ae}else{var Mr=Z.size(),$r=Ft+ue+(Mr-1)*te=re._maxWidth&&(Nt=Math.max(Nt,je),Nr=0,Mt+=Sr,re._height+=Sr,Sr=0),r.setTranslate(this,Pe[0]+$+Nr,Pe[1]+$+Mt+ye/2+te),je=Nr+Ee+te,Nr+=Xe,Sr=Math.max(Sr,ye)}),$r?(re._width=Nr+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"}}}),t5=Ge({"src/components/fx/hover.js"(K){var G=ki(),h=Si(),b=Is(),S=_n(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=S1(),o=nc(),n=IM(),i=As(),a=go(),s=lv(),f=Ts(),c=sh().zindexSeparator,p=Ro(),v=$d(),T=ff(),l=$T(),g=e5(),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 lt=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(lt,dt),ar=Math.max(lt,dt),Er=Math.min(nt,Ft),Mr=Math.max(nt,Ft),$r=Ne.trace;if(p.traceIs($r,"gl3d")){var Sr=Se._fullLayout[$r.scene]._scene.container,Nr=Sr.offsetLeft,Mt=Sr.offsetTop;Qt+=Nr,ar+=Nr,Er+=Mt,Mr+=Mt}Nt.bbox={x0:Qt+Fe,x1:ar+Fe,y0:Er+Le,y1:Mr+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,lt){return Ne.y0-lt.y0}).each(function(Ne,lt){var dt=Ne.y0-Ne.by/2;dt-atar[0]._length||aa<0||aa>Er[0]._length)return s.unhoverRaw(H,ae)}if(ae.pointerX=na+ar[0]._offset,ae.pointerY=aa+Er[0]._offset,"xval"in ae?ke=v.flat(Le,ae.xval):ke=v.p2c(ar,na),"yval"in ae?xe=v.flat(Le,ae.yval):xe=v.p2c(Er,aa),!h(ke[0])||!h(xe[0]))return S.warn("Fx.hover failed",ae,H),s.unhoverRaw(H,ae)}var Va=1/0;function sr(fi,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(vo){return vo.spikeDistance<=Mt})),Uo&&Uo.length){var Ys,Vs=Uo.filter(function(vo){return vo.xa.showspikes&&vo.xa.spikesnap!=="hovered data"});if(Vs.length){var sl=Vs[0];h(sl.x0)&&h(sl.y0)&&(Ys=or(sl),(!Br.vLinePoint||Br.vLinePoint.spikeDistance>Ys.spikeDistance)&&(Br.vLinePoint=Ys))}var fs=Uo.filter(function(vo){return vo.ya.showspikes&&vo.ya.spikesnap!=="hovered data"});if(fs.length){var Zo=fs[0];h(Zo.x0)&&h(Zo.y0)&&(Ys=or(Zo),(!Br.hLinePoint||Br.hLinePoint.spikeDistance>Ys.spikeDistance)&&(Br.hLinePoint=Ys))}}}}}sr();function qt(fi,ts,Ho){for(var Xs=null,cs=1/0,Jo,Uo=0;Uofi.trace.index===Hn.trace.index):je=[Hn];var pi=je.length,Mi=ne("x",Hn,ze),Dt=ne("y",Hn,ze);sr(Mi,Dt);var xt=[],Cr={},jr=0,Vr=function(fi){var ts=d[fi.trace.type]?z(fi):fi.trace.index;if(!Cr[ts])jr++,Cr[ts]=jr,xt.push(fi);else{var Ho=Cr[ts]-1,Xs=xt[Ho];Ho>0&&Math.abs(fi.distance)pi-1;Dr--)Vr(je[Dr]);je=xt,sn()}var qr=H._hoverdata,ln=[],Jr=$(H),At=ue(H);for(const fi of je){var lr=v.makeEventData(fi,fi.trace,fi.cd);if(fi.hovertemplate!==!1){var zr=!1;fi.cd[fi.index]&&fi.cd[fi.index].ht&&(zr=fi.cd[fi.index].ht),fi.hovertemplate=zr||fi.trace.hovertemplate||!1}if(fi.xa&&fi.ya){var un=fi.x0+fi.xa._offset,Rn=fi.x1+fi.xa._offset,qn=fi.y0+fi.ya._offset,jn=fi.y1+fi.ya._offset,cn=Math.min(un,Rn),In=Math.max(un,Rn),gi=Math.min(qn,jn),Ea=Math.max(qn,jn);lr.bbox={x0:cn+At,x1:In+At,y0:gi+Jr,y1:Ea+Jr}}fi.eventData=[lr],ln.push(lr)}H._hoverdata=ln;var Ci=et==="y"&&(Je.length>1||je.length>1)||et==="closest"&&kn&&je.length>1,Hi=a.combine(ze.plot_bgcolor||a.background,ze.paper_bgcolor),so=N(je,{gd:H,hovermode:et,rotateLabels:Ci,bgColor:Hi,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,ln);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:Er,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,lt=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 Er=0;Erde.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=ln-(u*2+Dr.height),Ee.maxY=ln-u):(Ee.minY=ln+u,Ee.maxY=ln+(u*2+Dr.height))}else{var zr,un,Rn;Ft.side==="right"?(zr="start",un=1,Rn="",qr=nt._offset+nt._length):(zr="end",un=-1,Rn="-",qr=nt._offset),ln=Ft._offset+(dt.y0+dt.y1)/2,Mi.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=ln-(u+Dr.height/2),Ee.maxY=ln+(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,cn="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?da=mn:Tn+ka=0?da=Tn:Jn+ka=0?_a=Gr:sn+Va=0?_a=sn:ma+Va=0,(Hn.idealAlign==="top"||!Ci)&&Hi?(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=un+qn/2+Ea<=Sr,Hi=un-qn/2-Ea>=0,(Hn.idealAlign==="left"||!Ci)&&Hi)un-=qn/2,Hn.anchor="end";else if(Ci)un+=qn/2,Hn.anchor="start";else{Hn.anchor="middle";var so=Ea/2,io=un+so-Sr,Mo=un-so;io>0&&(un-=io),Mo<0&&(un+=-Mo)}Hn.crossPos=un}ln.attr("text-anchor",Hn.anchor),At&&Jr.attr("text-anchor",Hn.anchor),pi.attr("transform",e(un,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),Br=vr+pe(Kt*ke.bx);xr=ke.crossPos+Math.min(vr,Br),mr=ke.crossPos+Math.max(vr,Br)}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 lt,dt,nt,Ft,Nt,Qt,ar;function Er(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;lt=!1}if(!(nt<.01)){if(dt<-.01){for(Nt=ke.length-1;Nt>=0;Nt--)ke[Nt].dp-=nt;lt=!1}if(lt){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(;!lt&&Fe<=Ye;){for(Fe++,lt=!0,Ft=0;Ft.01){for(Nt=$r.length-1;Nt>=0;Nt--)$r[Nt].dp+=dt;for(Mr.push.apply(Mr,$r),st.splice(Ft+1,1),ar=0,Nt=Mr.length-1;Nt>=0;Nt--)ar+=Mr[Nt].dp;for(nt=ar/Mr.length,Nt=Mr.length-1;Nt>=0;Nt--)Mr[Nt].dp-=nt;lt=!1}else Ft++}st.forEach(Er)}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,lt;pe?lt="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?lt="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":lt="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",lt);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,lt=ct.spikemode,dt=ct.spikethickness,nt=ct.spikecolor||Ne,Ft=f.getPxPosition(H,ct),Nt,Qt;if(lt.indexOf("toaxis")!==-1||lt.indexOf("across")!==-1){if(lt.indexOf("toaxis")!==-1&&(Nt=Ft,Qt=Pe),lt.indexOf("across")!==-1){var ar=ct._counterDomainMin,Er=ct._counterDomainMax;ct.anchor==="free"&&(ar=Math.min(ar,ct.position),Er=Math.max(Er,ct.position)),Nt=Le.l+ar*Le.w,Qt=Le.l+Er*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)}lt.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 Mr=ae.vLinePoint,$r,Sr;st=Mr&&Mr.xa,ct=Mr&&Mr.ya;var Nr=st.spikesnap;Nr==="cursor"?($r=Fe.pointerX,Sr=Fe.pointerY):($r=st._offset+Mr.x,Sr=ct._offset+Mr.y);var Mt=b.readability(Mr.color,at)<1.5?a.contrast(at):Mr.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)}}}}),px=Ge({"src/components/fx/hoverlabel_defaults.js"(K,G){var h=_n(),b=go(),S=$d().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)}}}),zM=Ge({"src/components/fx/layout_global_defaults.js"(K,G){var h=_n(),b=px(),S=tc();G.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}b(e,t,r)}}}),OM=Ge({"src/components/fx/defaults.js"(K,G){var h=_n(),b=Od(),S=px();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)}}}),r5=Ge({"src/components/fx/hovermode_defaults.js"(K,G){var h=_n(),b=tc();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")}}}),FM=Ge({"src/components/fx/layout_defaults.js"(K,G){var h=_n(),b=tc(),S=r5(),E=px();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("")}}}}),gx=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)}}}),yx=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=sm(),h=gx(),b=h.CIRCLE_SIDES,S=h.SQRT2,E=yx(),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=cm(),r=t.getPathString,o=sv(),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 Mr(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"),Er(xe),je(z,I),ke(y,I,d),Ft.moveFn=Nt==="move"?Nr: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 Nr(xe,ye){if(I.type==="path"){var Ee=function(Lt){return Lt},Xe=Ee,Qe=Ee;R?re("xanchor",I.xanchor=lt(ee+xe)):(Xe=function(Ct){return lt(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=lt(ee+xe)):(re("x0",I.x0=lt(fe+xe)),re("x1",I.x1=lt(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=lt(ee+xe)):(Xe=function(ka){return lt(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:lt(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:lt(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"),Br=xr("w"),kn=xr("e"),Wn=mr?$+ye:$,Vn=vr?ue+ye:ue,na=Br?te+xe:te,aa=kn?H+xe:H;U&&(mr&&(Wn=$-ye),vr&&(Vn=ue-ye)),(!U&&Vn-Wn>B||U&&Wn-Vn>B)&&(re(ae,I[ae]=U?Wn:dt(Wn)),re(ie,I[ie]=U?Vn:dt(Vn))),aa-na>N&&(re(de,I[de]=R?na:lt(na)),re(Se,I[Se]=R?aa:lt(aa)))}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))}}}}),BM=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}}),NM=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}}),UM=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=UM();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=lx().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}}}}),jM=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=u5(),b=c5(),S=Ro(),E=As().dashStyle,e=go(),t=Yf(),r=$d().makeEventData,o=Up(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=cm(),p=_x(),v=ng(),T=im().clearOutline,l=_p(),g=l.handleEllipse,x=l.readPaths,A=Qw().newShapes,M=n5(),_=o5().activateLastSelection,w=_n(),m=w.sorterAsc,u=ny(),d=R0(),y=Df().getFromId,I=C1(),L=xx().redrawReglTraces,z=jM(),F=z.MINSELECT,N=u.filter,B=u.tester,R=yx(),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,Br=vr._fullLayout,kn=Ot&&Br.newselection.mode==="immediate"&&Ee,Wn=Br._zoomlayer,Vn=xe.element.getBoundingClientRect(),na=xe.plotinfo,aa=Z(na),Un=Je-Vn.left,ka=ke-Vn.top;Br._calcInverseTransform(vr);var Va=w.apply3DTransform(Br._invTransform)(Un,ka);Un=Va[0],ka=Va[1];var sr=Br._invScaleX,qt=Br._invScaleY,or=Un,ur=ka,Gr="M"+Un+","+ka,sn=xe.xaxes[0],mn=xe.yaxes[0],Tn=sn._length,Jn=mn._length,ma=je.altKey&&!(a(ye)&&Lt),da,_a,Ca,Hn,pi,Mi,Dt;$(je,vr,xe),Xe&&(da=N([[Un,ka]],z.BENDPX));var xt=Wn.selectAll("path.select-outline-"+na.id).data([1]),Cr=Ct?Br.newshape:Br.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-"+na.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",aa).attr("d",Gr+"Z");var Dr=Wn.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",aa).attr("d","M0,0Z");if(Ct&&xe.hasText){var qr=Wn.select(".label-temp");qr.empty()&&(qr=Wn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ln=Br._uid+z.SELECTID,Jr=[],At=ie(vr,xe.xaxes,xe.yaxes,xe.subplot);kn&&!je.shiftKey&&(xe._clearSubplotSelections=function(){if(Ee){var zr=sn._id,un=mn._id;dt(vr,zr,un,At);for(var Rn=(vr.layout||{}).selections||[],qn=[],jn=!1,cn=0;cn=0){vr._fullLayout._deactivateShape(vr);return}if(!Ct){var Rn=Br.clickmode;d.done(ln).then(function(){if(d.clear(ln),zr===2){for(xt.remove(),pi=0;pi-1&&le(un,vr,xe.xaxes,xe.yaxes,xe.subplot,xe,xt),Rn==="event"&&Nr(vr,void 0);t.click(vr,un,na.id)}).catch(w.error)}},xe.doneFn=function(){Dr.remove(),d.done(ln).then(function(){d.clear(ln),!kn&&Hn&&xe.selectionDefs&&(Hn.subtract=ma,xe.selectionDefs.push(Hn),xe.mergedPolygons.length=0,[].push.apply(xe.mergedPolygons,Ca)),(kn||Ct)&&H(xe,kn),xe.doneFnCompleted&&xe.doneFnCompleted(Jr),Ot&&Nr(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,Br,kn,Wn,Vn,na,aa,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 un=zr[0].xref,Rn=zr[0].yref;if(un&&Rn){var qn=ar(zr),jn=Mr([y(je,un,"x"),y(je,Rn,"y")]);jn(Jr,qn)}}je._fullLayout._noEmitSelectedAtStart?je._fullLayout._noEmitSelectedAtStart=!1:lr&&Nr(je,Jr),xr._reselect=!1}if(!Xe&&xr._deselect){var cn=xr._deselect;Qe=cn.xref,Lt=cn.yref,lt(Qe,Lt,Ot)||dt(je,Qe,Lt,xe),lr&&(Jr.points.length?Nr(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,ln=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 un=Dr.d2r(zr);un!==void 0&&t.call("_guiRelayout",jr,ln,un)})}}c.init(Ot);var mr,vr,Br,kn,Wn,Vn,na,aa,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],Br={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(),Wn="M0,0H"+Qt+"V"+ar+"H0V0",Vn=!1,na="xy",ka=!1,aa=fe(at,kn,Ft,Nt,Wn),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);Br.l=Math.min(mr,jr),Br.r=Math.max(mr,jr),Br.t=Math.min(vr,Vr),Br.b=Math.max(vr,Vr);function ln(){na="",Br.r=Br.l,Br.t=Br.b,Un.attr("d","M0,0Z")}if(Er.isSubplotConstrained)Dr>I||qr>I?(na="xy",Dr/Qt>qr/ar?(qr=Dr*ar/Qt,vr>Vr?Br.t=vr-qr:Br.b=vr+qr):(Dr=qr*Qt/ar,mr>jr?Br.l=mr-Dr:Br.r=mr+Dr),Un.attr("d",te(Br))):ln();else if(Mr.isSubplotConstrained)if(Dr>I||qr>I){na="xy";var Jr=Math.min(Br.l/Qt,(ar-Br.b)/ar),At=Math.max(Br.r/Qt,(ar-Br.t)/ar);Br.l=Jr*Qt,Br.r=At*Qt,Br.b=(1-Jr)*ar,Br.t=(1-At)*ar,Un.attr("d",te(Br))}else ln();else!Sr||qr0){var zr;if(Mr.isSubplotConstrained||!$r&&Sr.length===1){for(zr=0;zr1&&(ln.maxallowed!==void 0&&Mt===(ln.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,lt=0;lt1&&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}}),Tx=Ge({"src/plot_api/plot_api.js"(K){var G=ki(),h=Si(),b=Xw(),S=_n(),E=S.nestedProperty,e=S1(),t=yp(),r=Ro(),o=ry(),n=ef(),i=Ts(),a=ZT(),s=id(),f=As(),c=go(),p=h5().initInteractions,v=Lv(),T=Qf().clearOutline,l=qs().dfltConfig,g=VM(),x=d5(),A=xx(),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[sn]!="string";)sn--;var mn=or.parts[sn],Tn=or.parts[sn-1]+"."+mn,Jn=or.parts.slice(0,sn).join("."),ma=E(ke.layout,Jn).get(),da=E(Ee,Jn).get(),_a=or.get();if(ur!==void 0){na[qt]=ur,aa[qt]=mn==="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(qt,Hn),Ca.impliedEdits[Hn]);if(["width","height"].indexOf(qt)!==-1)if(ur){Un("autosize",null);var pi=qt==="height"?"width":"height";Un(pi,Ee[pi])}else Ee[qt]=ke._initialAutoSize[qt];else if(qt==="autosize")Un("width",ur?null:Ee.width),Un("height",ur?null:Ee.height);else if(Tn.match(ze))sr(Tn),E(Ee,Jn+"._inputRange").set(null);else if(Tn.match(Ye)){sr(Tn),E(Ee,Jn+"._inputRange").set(null);var Mi=E(Ee,Jn).get();Mi._inputDomain&&(Mi._input.domain=Mi._inputDomain.slice())}else Tn.match(st)&&E(Ee,Jn+"._inputDomain").set(null);if(mn==="type"){Va=ma;var Dt=da.type==="linear"&&ur==="log",xt=da.type==="log"&&ur==="linear";if(Dt||xt){if(!Va||!Va.range)Un(Jn+".autorange",!0);else if(da.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(Jn+".autorange",!0),Cr<=0?Cr=jr/1e6:jr<=0&&(jr=Cr/1e6),Un(Jn+".range[0]",Math.log(Cr)/Math.LN10),Un(Jn+".range[1]",Math.log(jr)/Math.LN10)):(Un(Jn+".range[0]",Math.pow(10,Cr)),Un(Jn+".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,da,ur,Un),r.getComponentMethod("images","convertCoords")(ke,da,ur,Un)}else Un(Jn+".autorange",!0),Un(Jn+".range",null);E(Ee,Jn+"._inputRange").set(null)}else if(mn.match(_)){var Vr=E(Ee,qt).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(qt);if(qr){xr=qr.array,mr=qr.index;var ln=qr.property,Jr=Ca||{editType:"calc"};mr!==""&&ln===""&&(g.isAddVal(ur)?aa[qt]=null:g.isRemoveVal(ur)?aa[qt]=(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[ln]=ur,delete xe[qt]}else mn==="reverse"?(ma.range?ma.range.reverse():(Un(Jn+".autorange",!0),ma.range=[1,0]),da.autorange?Vn.calc=!0:Vn.plot=!0):(qt==="dragmode"&&(ur===!1&&_a!==!1||ur!==!1&&_a===!1)||Ee._has("scatter-like")&&Ee._has("regl")&&qt==="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 un=Va&&Va._constraintGroup;if(un){Vn.calc=!0;for(var Rn in un)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[Jn,ke._ev.listeners(Jn)]);Qe=K.newPlot(ke,xe,ye,Ee).then(()=>{for(const[Jn,ma]of Tn)ma.forEach(da=>ke.on(Jn,da));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,Br=vr.datarevision===void 0,kn=vr.transition,Wn=Er(ke,Ot,vr,Br,kn),Vn=Wn.newDataRevision,na=ar(ke,Ct,mr,Br,kn,Vn);if(at(ke)&&(Wn.layoutReplot=!0),na.calc||Wn.calc){ke.calcdata=void 0;for(var aa=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(Br){var kn=o.getTraceValObject(Kt,Br);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 mn=Ee._frameQueue.pop();mn.onInterrupt&&mn.onInterrupt()}ke.emit("plotly_animationinterrupted",[])}}function vr(mn){if(mn.length!==0){for(var Tn=0;TnEe._timeToNext&&kn()};mn()}var Vn=0;function na(mn){return Array.isArray(Xe)?Vn>=Xe.length?mn.transitionOpts=Xe[Vn]:mn.transitionOpts=Xe[0]:mn.transitionOpts=Xe,Vn++,mn}var aa,Un,ka=[],Va=xe==null,sr=Array.isArray(xe),qt=!Va&&!sr&&S.isPlainObject(xe);if(qt)ka.push({type:"object",data:na(S.extendFlat({},xe))});else if(Va||["string","number"].indexOf(typeof xe)!==-1)for(aa=0;aa0&&GrGr)&&sn.push(Un);ka=sn}}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,Br=(Ot[vr]||mr[vr]||{}).name,kn=xe[Ee].name,Wn=Ot[Br]||mr[Br];Br&&kn&&typeof kn=="number"&&Wn&&wor.index?-1:qt.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=Nr,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}}),c0=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=om();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)}}}),Hp=Ge({"src/plots/cartesian/align_period.js"(K,G){var h=Si(),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"}))}}}),f0=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,Br=.5-Ct,kn=.5-Ot,Wn=mr*mr+vr*vr,Vn=mr*Br+vr*kn;if(Vn>0&&Vn1||Math.abs(Br.y-Kt[0][1])>1)&&(Br=[Br.x,Br.y],xr&&Le(Br,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),Br=nt(mr),kn=[];if(vr&&Br&&Ft(vr,Br))return kn;vr&&kn.push(vr),Br&&kn.push(Br);var Wn=2*r.constrain((xr[Ct]+mr[Ct])/2,Ot,Kt)-((vr||xr)[Ct]+(Br||mr)[Ct]);if(Wn){var Vn;vr&&Br?Vn=Wn>0==vr[Ct]>Br[Ct]?vr:Br:Vn=vr||Br,Vn[Ct]+=Wn}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 Er(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 Mr(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],Br=Kt===z[F-2][1];xr&&(Ot===ze||Ot===Ye)&&vr?Br?F--:z[F-1]=Ct:mr&&(Kt===st||Kt===ct)&&Br?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]&&Mr([Ae,pe]),Mr(Ct),Ne=null,Ae=pe=0}var Sr=r.isArrayOrTypedArray(M);function Nr(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 lt=ar(z[F-1],Ct)[0],z[F++]=lt;var Kt=z[F-1];et&&Pe&&(Kt[0]!==et||Kt[1]!==Pe)?(Ne&&(Ae!==et&&pe!==Pe?Mr(Ae&&pe?Er(Ne,Ct):[Ae||et,pe||Pe]):Ae&&pe&&Mr([Ae,pe])),Mr([et,Pe])):Ae-et&&pe-Pe&&Mr([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;Nr(Z),B=Z}}Ne&&Mr([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(Mr){return _?Mr.transition():Mr}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(Mr){var $r=Mr[Mr.length-1];return Mr.length>1&&Mr[0][0]===$r[0]&&Mr[0][1]===$r[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: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]}}}}}),lg=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()))}}}}),Vu=Ge({"src/plots/cartesian/line_grid_defaults.js"(K,G){var h=Is().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)}}}}),Gp=Ge({"src/plots/cartesian/axis_defaults.js"(K,G){var h=Si(),b=Ro(),S=_n(),E=_u(),e=yd(),t=id(),r=tg(),o=z0(),n=Op(),i=Pv(),a=zf(),s=Vu(),f=ZT(),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=$d().isUnifiedHover,E=r5(),e=_u(),t=T1(),r=id(),o=Ud(),n=Gp(),i=ig(),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=p5(),K.layoutAttributes=id(),K.supplyLayoutDefaults=c2(),K.transitionAxes=vm(),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 lt=!1,dt=["x","y"],nt=0;nt1)&&(Qt===Nt?(Qe=ar.r2fraction(x["a"+Ft]),(Qe<0||Qe>1)&&(lt=!0)):lt=!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=Mr*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,Nr),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(lt){ce.remove();return}var vr=0,Br=0;if(x.align!=="left"&&(vr=(et-ct)*(x.align==="center"?.5:1)),x.valign!=="top"&&(Br=(Pe-at)*(x.valign==="middle"?.5:1)),Ye)ze.select("svg").attr({x:ne+vr-1,y:ne+Br}).call(o.setClipUrl,ue?B:null,g);else{var kn=ne+Br-st.top,Wn=ne+vr-st.left;ie.call(i.positionText,Wn,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(aa,Un){j.selectAll(".annotation-arrow-g").remove();var ka=R.x.head,Va=R.y.head,sr=R.x.tail+aa,qt=R.y.tail+Un,or=R.x.text+aa,ur=R.y.text+Un,Gr=E.rotationXYMatrix(U,or,ur),sn=E.apply2DTransform(Gr),mn=E.apply2DTransform2(Gr),Tn=+$.attr("width"),Jn=+$.attr("height"),ma=or-.5*Tn,da=ma+Tn,_a=ur-.5*Jn,Ca=_a+Jn,Hn=[[ma,_a,ma,Ca],[ma,Ca,da,Ca],[da,Ca,da,_a],[da,_a,ma,_a]].map(mn);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,qt,ka,Va,At[0],At[1],At[2],At[3]);lr&&(sr=lr.x,qt=lr.y)});var pi=x.arrowwidth,Mi=x.arrowcolor,Dt=x.arrowside,xt=j.append("g").style({opacity:r.opacity(Mi)}).classed("annotation-arrow-g",!0),Cr=xt.append("path").attr("d","M"+sr+","+qt+"L"+ka+","+Va).style("stroke-width",pi+"px").call(r.stroke,r.rgb(Mi));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-qt,2));jr+=x.standoff*(sr-ka)/Dr,Vr+=x.standoff*(qt-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)+","+(qt-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)"),ln,Jr;s.init({element:qr.node(),gd:g,prepFn:function(){var At=o.getTranslate(ce);ln=At.x,Jr=At.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(At,lr){var zr=sn(ln,Jr),un=zr[0]+At,Rn=zr[1]+lr;ce.call(o.setTranslate,un,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+","+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&&Vn(0,0),re){var na;s.init({element:ce.node(),gd:g,prepFn:function(){na=Z.attr("transform")},moveFn:function(aa,Un){var ka="pointer";if(x.showarrow)x.axref===x.xref?F("ax",T(_,aa,"ax",u,x)):F("ax",x.ax+aa),x.ayref===x.yref?F("ay",T(w,Un,"ay",u.w,x)):F("ay",x.ay+Un),Vn(aa,Un);else{if(M)return;var Va,sr;if(_)Va=T(_,aa,"x",u,x);else{var qt=x._xsize/u.w,or=x.x+(x._xshift-x.xshift)/u.w-qt/2;Va=s.align(or+aa/u.w,qt,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(aa,Un)+na}),a(ce,ka)},clickFn:function(aa,Un){x.captureevents&&g.emit("plotly_clickannotation",le(Un))},doneFn:function(){a(ce),b.call("_guiRelayout",g,N());var aa=document.querySelector(".js-notes-box-panel");aa&&aa.redraw(aa.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))}}}}),fg=Ge({"src/components/annotations3d/index.js"(K,G){var h=Ro(),b=_n();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Xp()}}},layoutAttributes:Xp(),handleDefaults:d2(),includeBasePlot:S,convert:v2(),draw:Mx()};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]}}}}),GM=Ge({"src/components/shapes/index.js"(K,G){var h=ag();G.exports={moduleType:"component",name:"shapes",layoutAttributes:jd(),supplyLayoutDefaults:Ex(),supplyDrawNewShapeDefaults:g5(),includeBasePlot:R1()("shapes"),calcAutorange:HM(),draw:h.draw,drawOne:h.drawOne}}}),y5=Ge({"src/components/images/attributes.js"(K,G){var h=sh(),b=_u().templatedArray;fm(),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=y5(),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"))}}}),XM=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)}}}}),_5=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=F1(),i=XM();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)}}}),x5=Ge({"src/components/sliders/index.js"(K,G){var h=B1();G.exports={moduleType:"component",name:h.name,layoutAttributes:mm(),supplyLayoutDefaults:m2(),draw:kx()}}}),gm=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"}}}),Cx=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}}}),Lx=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}}}),_m=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)})}}}),xm=Ge({"src/components/errorbars/index.js"(K,G){var h=_n(),b=Hc().overrideAll,S=ym(),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:T5(),calc:_2(),makeComputeError:U0(),plot:x2(),style:_m(),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))}}}),j1=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=Is(),S=ef(),E=Ro(),e=Ts(),t=lv(),r=_n(),o=r.strTranslate,n=Ki().extendFlat,i=Np(),a=As(),s=go(),f=lm(),c=nc(),p=gd().flipScale,v=Gp(),T=Rv(),l=id(),g=ad(),x=g.LINE_SPACING,A=g.FROM_TL,M=g.FROM_BR,_=j1().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&&(Mr.tick0=0)}Mr.dtick=Sr}Mr.domain=N?[ar+ee/ae.h,ar+Ne-ee/ae.h]:[ar+V/ae.w,ar+Ne-V/ae.w],Mr.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=Mr.ticklabelposition,xe=Mr.title.font.size,ye=L.select("."+_.cbaxis),Ee,Xe=0,Qe=0;function Lt(mr,vr){var Br={propContainer:Mr,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(Br,vr||{}))}function Ct(){if(N&&$r||!N&&!$r){var mr,vr;Le==="top"&&(mr=V+ae.l+lt*ne,vr=ee+ae.t+dt*(1-ar-Ne)+3+xe*.75),Le==="bottom"&&(mr=V+ae.l+lt*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+lt*ar),Lt(Mr._id+"title",{attributes:{x:mr,y:vr,"text-anchor":N?"start":"middle"}})}}function Ot(){if(N&&!$r||!N&&$r){var mr=Mr.position||0,vr=Mr._offset+Mr._length/2,Br,kn;if(Le==="right")kn=vr,Br=ae.l+lt*mr+10+xe*(Mr.showticklabels?1:.5);else if(Br=vr,Le==="bottom"&&(kn=ae.t+dt*mr+10+(ke.indexOf("inside")===-1?Mr.tickfont.size:0)+(Mr.ticks!=="inside"&&z.ticklen||0)),Le==="top"){var Wn=Se.text.split("
").length;kn=ae.t+dt*mr+10-Pe-x*xe*Wn}Lt((N?"h":"v")+Mr._id+"title",{avoid:{selection:h.select(F).selectAll("g."+Mr._id+"tick"),side:Le,offsetTop:N?0:ae.t,offsetLeft:N?ae.l:0,maxShift:N?H.width:H.height},attributes:{x:Br,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"),Br=[-Z/2,Z/2],kn=mr.select(".h"+Mr._id+"title-math-group").node(),Wn=15.6;vr.node()&&(Wn=parseInt(vr.node().style.fontSize,10)*x);var Vn;if(kn?(Vn=a.bBox(kn),Qe=Vn.width,Xe=Vn.height,Xe>Wn&&(Br[1]-=(Xe-Wn)/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")Mr.domain[1]-=Xe/ae.h,Br[1]*=-1;else{Mr.domain[0]+=Xe/ae.h;var na=c.lineCount(vr);Br[1]+=(1-na)*Wn}mr.attr("transform",o(Br[0],Br[1])),Mr.setScale()}}else Qe&&(Le==="right"&&(Mr.domain[0]+=(Qe+xe/2)/ae.w),mr.attr("transform",o(Br[0],Br[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 aa=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(at);aa.enter().append("rect").classed(_.cbfill,!0).attr("style",""),aa.exit().remove();var Un=Fe.map(Mr.c2p).map(Math.round).sort(function(or,ur){return or-ur});aa.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(Mr.c2p).map(Math.round);N&&(Gr[1]=r.constrain(Gr[1]+(Gr[1]>Gr[0])?1:-1,Un[0],Un[1]));var sn=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(sn,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var mn=Ye(or).replace("e-","");sn.attr("fill",b(mn).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(Mr.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."+Mr._id+"tick,path").remove();var Va=nt+Pe+(Z||0)/2-(z.ticks==="outside"?1:0),sr=e.calcTicks(Mr),qt=e.getTickSigns(Mr)[2];return e.drawTicks(F,Mr,{vals:Mr.ticks==="inside"?e.clipEnds(Mr,sr):sr,layer:ye,path:e.makeTickPath(Mr,Va,qt),transFn:e.makeTransTickFn(Mr)}),e.drawLabels(F,Mr,{vals:sr,layer:ye,transFn:e.makeTransTickLabelFn(Mr),labelFns:e.makeLabelFns(Mr,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 Br=0,kn=N&&Le==="top",Wn=!N&&Le==="right",Vn=0;if(Ee.node()&&!Ee.classed(_.jsPlaceholder)){var na,aa=Je.select(".h"+Mr._id+"title-math-group").node();aa&&(N&&$r||!N&&!$r)?(mr=a.bBox(aa),Br=mr.width,na=mr.height):(mr=a.bBox(Je.node()),Br=mr.right-ae.l-(N?nt:Er),na=mr.bottom-ae.t-(N?Er:nt),!N&&Le==="top"&&(vr+=mr.height,Vn=mr.height)),Wn&&(Ee.attr("transform",o(Br/2+xe/2,0)),Br*=2),vr=Math.max(vr,N?Br:na)}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:Er)-Va/2-(N?V:0),qt=(N?Er:nt)-(N?pe:ee+Vn-ka);L.select("."+_.cbbg).attr("x",sr).attr("y",qt).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=Wn?Math.max(Br-10,0):0;L.selectAll("."+_.cboutline).attr("x",(N?nt:Er+V)+or).attr("y",(N?Er+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 sn=ye.selectAll("text"),mn=sn[0].length,Tn=L.select("."+_.cbbg).node(),Jn=a.bBox(Tn),ma=a.getTranslate(L),da=2;sn.each(function(Vr,Dr){var qr=0,ln=mn-1;if(Dr===qr||Dr===ln){var Jr=a.bBox(this),At=a.getTranslate(this),lr;if(Dr===ln){var zr=Jr.right+At.x,un=Jn.right+ma.x+Er-re-da+ne;lr=un-zr,lr>0&&(lr=0)}else if(Dr===qr){var Rn=Jr.left+At.x,qn=Jn.left+ma.x+Er+re+da;lr=qn-Rn,lr<0&&(lr=0)}lr&&(mn<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],Mi=M[ce],Dt=Un-Pe;N?(R==="pixels"?(_a.y=$,_a.t=pe*pi,_a.b=pe*Mi):(_a.t=_a.b=0,_a.yt=$+B*pi,_a.yb=$-B*Mi),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*Mi):(_a.t=Dt*pi,_a.b=Dt*Mi,_a.yt=$-U*pi,_a.yb=$+U*Mi));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-qt-Gr,t:qt+_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)}}}),Yp=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}}}),ou=Ge({"src/traces/bar/plot.js"(K,G){var h=ki(),b=Si(),S=_n(),E=nc(),e=go(),t=As(),r=Ro(),o=Ts().tickText,n=cc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=xd(),f=py(),c=bm(),p=qh(),v=p.text,T=p.textposition,l=$d().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(lt,dt){var nt=h.select(this),Ft=w(lt,ne,$,at),Nt=Ft[0][0],Qt=Ft[0][1],ar=Ft[1][0],Er=Ft[1][1],Mr=(at?Qt-Nt:Er-ar)===0;Mr&&st&&f.getLineWidth(de,lt)&&(Mr=!1),Mr||(Mr=!b(Nt)||!b(Qt)||!b(ar)||!b(Er)),lt.isBlank=Mr,Mr&&(at?Qt=Nt:Er=ar),ct&&!Mr&&(at?(Nt-=_(Nt,Qt)*ct,Qt+=_(Nt,Qt)*ct):(ar-=_(ar,Er)*ct,Er+=_(ar,Er)*ct));var $r,Sr;if(de.type==="waterfall"){if(!Mr){var Nr=de[lt.dir].marker;$r=Nr.line.width,Sr=Nr.color}}else $r=f.getLineWidth(de,lt),Sr=lt.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,qt){return qt&&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,Er,!at),Er=ke(Er,ar,!at));var xe=at?ne.c2p:$.c2p,ye;lt.s0>0?ye=lt._sMax:lt.s0<0?ye=lt._sMin:ye=lt.s1>0?lt._sMax:lt._sMin;function Ee(Va,sr){if(!Va)return 0;var qt=Math.abs(at?Er-ar:Qt-Nt),or=Math.abs(at?Qt-Nt:Er-ar),ur=ke(Math.abs(xe(ye,!0)-xe(0,!0))),Gr=lt.hasB?Math.min(qt/2,or/2):Math.min(qt/2,ur),sn;if(sr==="%"){var mn=Math.min(50,Va);sn=qt*(mn/100)}else sn=Va;return ke(Math.max(Math.min(sn,Gr),0))}var Xe=Ye||ze?Ee(Se.cornerradiusvalue,Se.cornerradiusform):0,Qe,Lt,Ct="M"+Nt+","+ar+"V"+Er+"H"+Qt+"V"+ar+"Z",Ot=0;if(Xe&<.s){var Kt=M(lt.s0)===0||M(lt.s)===M(lt.s0)?lt.s1:lt.s0;if(Ot=ke(lt.hasB?0:Math.abs(xe(ye,!0)-xe(Kt,!0))),Ot0?Math.sqrt(Ot*(2*Xe-Ot)):0,Wn=xr>0?Math.max:Math.min;Qe="M"+Nt+","+ar+"V"+(Er-Br*mr)+"H"+Wn(Qt-(Xe-Ot)*xr,Nt)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(Er-Xe*mr-kn)+"V"+(ar+Xe*mr+kn)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Wn(Qt-(Xe-Ot)*xr,Nt)+","+(ar+Br*mr)+"Z"}else if(lt.hasB)Qe="M"+(Nt+Xe*xr)+","+ar+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Nt+","+(ar+Xe*mr)+"V"+(Er-Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr)+","+Er+"H"+(Qt-Xe*xr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(Er-Xe*mr)+"V"+(ar+Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Xe*xr)+","+ar+"Z";else{Lt=Math.abs(Er-ar)+Ot;var Vn=Lt0?Math.sqrt(Ot*(2*Xe-Ot)):0,aa=mr>0?Math.max:Math.min;Qe="M"+(Nt+Vn*xr)+","+ar+"V"+aa(Er-(Xe-Ot)*mr,ar)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr-na)+","+Er+"H"+(Qt-Xe*xr+na)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Vn*xr)+","+aa(Er-(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)*(Er-ar))||Mr&&re._context.staticPlot?"M0,0Z":Qe).call(t.setClipUrl,fe.layerClipId,re),!ue.uniformtext.mode&&et){var ka=t.makePointStyleFns(de);t.singlePointStyle(lt,Un,de,ka,re)}y(re,fe,nt,ae,dt,Nt,Qt,ar,Er,Xe,Ot,V,ee),fe.layerClipId&&t.hideOutsideRangePoint(lt,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,lt=s.getBarColor(ce[V],Ye),dt=s.getInsideTextFont(Ye,V,Ne,lt),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(Er-2*te,Mr,Nr,Mt,st)||I(Er,Mr-2*te,Nr,Mt,st):st?ke=I(Er-(te-H),Mr,Nr,Mt,st)||I(Er,Mr-2*(te-H),Nr,Mt,st):ke=I(Er,Mr-(te-H),Nr,Mt,st)||I(Er-2*(te-H),Mr,Nr,Mt,st):ke=I(Er,Mr,Nr,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()),Nr=Sr.width,Mt=Sr.height,$r.attr("transform",xe),Nr<=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 lt=N(re,fe,le,ce,Ae,Fe,ze,ne,Le);pe=lt.scale,Ne=lt.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 Er=(ne?Ae.x:Ae.y)/2;Fe&&(H||Le)&&(et+=Ne);var Mr=ne?_(re,fe):_(le,ce);ne?ae?(Ft=re+Mr*et,Qt=-Mr*Er):(Ft=fe-Mr*et,Qt=Mr*Er):ae?(Nt=le+Mr*et,ar=-Mr*Er):(Nt=ce-Mr*et,ar=Mr*Er)}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}}}),Cc=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}}}),wm=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(Mr){return L.d2c((M[Mr]||[])[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 Er=g(le,ee);le.ln=le.med-Er,le.un=le.med+Er,lt=Math.min(lt,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([lt,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}}}),Dx=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}}}),Nx=Ge({"src/traces/histogram/calc.js"(K,G){var h=Si(),b=_n(),S=Ro(),E=Ts(),{hasColorscale:e}=gd(),t=_d(),r=Yp(),o=Fx(),n=d0(),i=X1(),a=Bx();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}}}),M5=Ge({"src/traces/histogram2d/calc.js"(K,G){var h=_n(),b=Ts(),S=Fx(),E=d0(),e=X1(),t=Bx(),r=Nx().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}}}),Vx=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,lt;Le==="fast"?(Ne=ee?function(In){return V-1-In}:t.identity,lt=ne?function(In){return ce-1-In}:t.identity):(Ne=function(In){return t.constrain(Math.round(d.c2p(U[In])-$),0,ze)},lt=function(In){return t.constrain(Math.round(y.c2p(j[In])-H),0,Ye)});var dt=lt(0),nt=[dt,dt],Ft=ee?0:1,Nt=ne?0:1,Qt=0,ar=0,Er=0,Mr=0,$r,Sr,Nr,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,Er+=Ea[1]*gi,Mr+=Ea[2]*gi,Ea}return[0,0,0,0]}function ke(In,gi,Ea,Ci){var Hi=In[Ea.bin0];if(Hi===void 0)return Je(void 0,1);var so=In[Ea.bin1],io=gi[Ea.bin0],Mo=gi[Ea.bin1],fi=so-Hi||0,ts=io-Hi||0,Ho;return so===void 0?Mo===void 0?Ho=0:io===void 0?Ho=2*(Mo-Hi):Ho=(2*Mo-io-Hi)*2/3:Mo===void 0?io===void 0?Ho=0:Ho=(2*Hi-so-io)*2/3:io===void 0?Ho=(2*Mo-so-Hi)*2/3:Ho=Mo+Hi-so-io,Je(Hi+Ea.frac*fi+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;iema||ma>y._length))for(de=sn;de_a||_a>d._length)){var Ca=o({x:da,y:Jn},F,_._fullLayout);Ca.x=da,Ca.y=Jn;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 Mi=t.texttemplateString({data:[Ca,F._meta],fallback:F.texttemplatefallback,labels:Ca,locale:_._fullLayout._d3locale,template:ka});if(Mi){var Dt=Mi.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:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),W1=Ge({"src/traces/contour/attributes.js"(K,G){var h=bd(),b=Gc(),S=pc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=zu(),r=md().dash,o=Ns(),n=Ki().extendFlat,i=Qx(),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"}))}}),eb=Ge({"src/traces/histogram2dcontour/attributes.js"(K,G){var h=Kx(),b=W1(),S=zu(),E=pc().axisHoverFormat,e=Ki().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"}))}}),tb=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")}}}),$1=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)}}}),D5=Ge({"src/traces/histogram2dcontour/defaults.js"(K,G){var h=_n(),b=Jx(),S=tb(),E=$1(),e=gg(),t=eb();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}}}),rb=Ge({"src/traces/contour/end_plus.js"(K,G){G.exports=function(b){return b.end+b.size/1e6}}}),nb=Ge({"src/traces/contour/calc.js"(K,G){var h=Ec(),b=Y1(),S=D2(),E=rb();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}}}),K1=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=K1();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}}}),ab=Ge({"src/traces/contour/find_all_paths.js"(K,G){var h=_n(),b=K1();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]}}}}),z5=Ge({"src/traces/contour/constraint_mapping.js"(K,G){var h=Qx(),b=Si();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=z5(),S=rb();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}}}),O5=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}}}}),ib=Ge({"src/traces/contour/plot.js"(K){var G=ki(),h=_n(),b=As(),S=Ec(),E=nc(),e=Ts(),t=rp(),r=Gx(),o=z2(),n=ab(),i=O2(),a=O5(),s=F5(),f=K1(),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=qp(),E=B2(),e=tb(),t=$1(),r=gg(),o=W1();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")}}}),N5=Ge({"src/traces/contour/index.js"(K,G){G.exports={attributes:W1(),supplyDefaults:N2(),calc:nb(),plot:ib().plot,style:J1(),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=N5()}}),ob=Ge({"src/traces/scatterternary/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=Gc(),t=Gl(),r=zu(),o=md().dash,n=Ki().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()}}}),U5=Ge({"src/traces/scatterternary/defaults.js"(K,G){var h=_n(),b=u0(),S=uu(),E=Kd(),e=Vp(),t=Jd(),r=op(),o=Nd(),n=ob();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}}}),H5=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}}}),sb=Ge({"src/plots/ternary/ternary.js"(K,G){var h=ki(),b=Is(),S=Ro(),E=_n(),e=E.strTranslate,t=E._,r=go(),o=As(),n=rp(),i=Ki().extendFlat,a=ef(),s=Ts(),f=lv(),c=Yf(),p=Up(),v=p.freeMode,T=p.rectMode,l=lm(),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 lt=j._fullLayout._invTransform,dt=E.apply3DTransform(lt)(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,lt=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=(lt/2+nt)*R.w,Nt=(1-lt/2-dt)*R.w,Qt=(Ft+Nt)/2,ar=Nt-Ft,Er=(1-lt)*R.h,Mr=Er-ar/u;ar<_.MINZOOM?(ne=V,H.attr("d",ue),ae.attr("d","M0,0Z")):(ne={a:V.a+lt*ee,b:V.b+dt*ee,c:V.c+nt*ee},H.attr("d",ue+"M"+Ft+","+Er+"H"+Nt+"L"+Qt+","+Mr+"L"+Ft+","+Er+"Z"),ae.attr("d","M"+le+","+ce+F+"M"+Ft+","+Er+I+"M"+Nt+","+Er+L+"M"+Qt+","+Mr+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 lt=[ne.a,ne.b,ne.c].sort(E.sorterAsc),dt={a:lt.indexOf(ne.a),b:lt.indexOf(ne.b),c:lt.indexOf(ne.c)};lt[0]<0&&(lt[1]+lt[0]/2<0?(lt[2]+=lt[0]+lt[1],lt[0]=lt[1]=0):(lt[2]+=lt[0]/2,lt[1]+=lt[0]/2,lt[0]=0),ne={a:lt[dt.a],b:lt[dt.b],c:lt[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=kc().attributes,S=id(),E=Hc().overrideAll,e=Ki().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=kc().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")}}}),X5=Ge({"src/plots/ternary/index.js"(K){var G=sb(),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=G5(),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=Cc().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}}}),Q5=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:J5(),plot:$2(),style:fb().style,hoverPoints:K2(),eventData:Q5(),selectPoints:wm(),moduleType:"trace",name:"funnel",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),eA=Ge({"lib/funnel.js"(K,G){G.exports=J2()}}),V0=Ge({"src/traces/waterfall/constants.js"(K,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),hb=Ge({"src/traces/waterfall/attributes.js"(K,G){var h=qh(),b=Gc().line,S=Gl(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=V0(),n=Ki().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}}}),tA=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:"▼"}}}}),v0=Ge({"src/traces/waterfall/defaults.js"(K,G){var h=_n(),b=O0(),S=Dv().handleText,E=jp(),e=qp(),t=hb(),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}}}),QM=Ge({"src/traces/waterfall/hover.js"(K,G){var h=Ts().hoverLabelText,b=go().opacity,S=Cc().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}}}),eE=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}}}),nA=Ge({"src/traces/waterfall/index.js"(K,G){G.exports={attributes:hb(),layoutAttributes:tA(),supplyDefaults:v0().supplyDefaults,crossTraceDefaults:v0().crossTraceDefaults,supplyLayoutDefaults:Q2(),calc:rA(),crossTraceCalc:db(),plot:t_(),style:eh().style,hoverPoints:QM(),eventData:eE(),selectPoints:wm(),moduleType:"trace",name:"waterfall",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),r_=Ge({"lib/waterfall.js"(K,G){G.exports=nA()}}),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=Gl(),b=Gc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=Ki().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}}}),_g=Ge({"node_modules/buffer/index.js"(K){var G=iA(),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 lt=p(Pe);if(lt)return lt;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 lt=Ne.write(Pe,Ae);return lt!==pe&&(Ne=Ne.slice(0,lt)),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,lt=pe.length;for(let dt=0,nt=Math.min(Ne,lt);dtlt.length?(t.isBuffer(nt)||(nt=t.from(nt)),nt.copy(lt,dt)):Uint8Array.prototype.set.call(lt,nt,dt);else if(t.isBuffer(nt))nt.copy(lt,dt);else throw new TypeError('"list" argument must be an Array of Buffers');dt+=nt.length}return lt};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 lt=!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(lt)return Ne?-1:de(Pe).length;Ae=(""+Ae).toLowerCase(),lt=!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,lt,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),lt===void 0&&(lt=0),dt===void 0&&(dt=this.length),pe<0||Ne>Ae.length||lt<0||dt>this.length)throw new RangeError("out of range index");if(lt>=dt&&pe>=Ne)return 0;if(lt>=dt)return-1;if(pe>=Ne)return 1;if(pe>>>=0,Ne>>>=0,lt>>>=0,dt>>>=0,this===Ae)return 0;let nt=dt-lt,Ft=Ne-pe;const Nt=Math.min(nt,Ft),Qt=this.slice(lt,dt),ar=Ae.slice(pe,Ne);for(let Er=0;Er2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),pe=+pe,st(pe)&&(pe=lt?0:Pe.length-1),pe<0&&(pe=Pe.length+pe),pe>=Pe.length){if(lt)return-1;pe=Pe.length-1}else if(pe<0)if(lt)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,lt);if(typeof Ae=="number")return Ae=Ae&255,typeof Uint8Array.prototype.indexOf=="function"?lt?Uint8Array.prototype.indexOf.call(Pe,Ae,pe):Uint8Array.prototype.lastIndexOf.call(Pe,Ae,pe):M(Pe,[Ae],pe,Ne,lt);throw new TypeError("val must be string, number or Buffer")}function M(Pe,Ae,pe,Ne,lt){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,Er){return dt===1?ar[Er]:ar.readUInt16BE(Er*dt)}let Qt;if(lt){let ar=-1;for(Qt=pe;Qtnt&&(pe=nt-Ft),Qt=pe;Qt>=0;Qt--){let ar=!0;for(let Er=0;Erlt&&(Ne=lt)):Ne=lt;const dt=Ae.length;Ne>dt/2&&(Ne=dt/2);let nt;for(nt=0;nt>>0,isFinite(Ne)?(Ne=Ne>>>0,lt===void 0&&(lt="utf8")):(lt=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");lt||(lt="utf8");let nt=!1;for(;;)switch(lt){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: "+lt);lt=(""+lt).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 lt=Ae;for(;lt239?4:dt>223?3:dt>191?2:1;if(lt+Ft<=pe){let Nt,Qt,ar,Er;switch(Ft){case 1:dt<128&&(nt=dt);break;case 2:Nt=Pe[lt+1],(Nt&192)===128&&(Er=(dt&31)<<6|Nt&63,Er>127&&(nt=Er));break;case 3:Nt=Pe[lt+1],Qt=Pe[lt+2],(Nt&192)===128&&(Qt&192)===128&&(Er=(dt&15)<<12|(Nt&63)<<6|Qt&63,Er>2047&&(Er<55296||Er>57343)&&(nt=Er));break;case 4:Nt=Pe[lt+1],Qt=Pe[lt+2],ar=Pe[lt+3],(Nt&192)===128&&(Qt&192)===128&&(ar&192)===128&&(Er=(dt&15)<<18|(Nt&63)<<12|(Qt&63)<<6|ar&63,Er>65535&&Er<1114112&&(nt=Er))}}nt===null?(nt=65533,Ft=1):nt>65535&&(nt-=65536,Ne.push(nt>>>10&1023|55296),nt=56320|nt&1023),Ne.push(nt),lt+=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 lt="";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 lt=this[Ae],dt=1,nt=0;for(;++nt>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=this[Ae+--pe],dt=1;for(;pe>0&&(dt*=256);)lt+=this[Ae+--pe]*dt;return lt},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 lt=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(lt)+(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 lt=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(lt)<>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=this[Ae],dt=1,nt=0;for(;++nt=dt&&(lt-=Math.pow(2,8*pe)),lt},t.prototype.readIntBE=function(Ae,pe,Ne){Ae=Ae>>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let lt=pe,dt=1,nt=this[Ae+--lt];for(;lt>0&&(dt*=256);)nt+=this[Ae+--lt]*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 lt=this[Ae+4]+this[Ae+5]*2**8+this[Ae+6]*2**16+(Ne<<24);return(BigInt(lt)<>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const lt=(pe<<24)+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae];return(BigInt(lt)<>>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,lt,dt){if(!t.isBuffer(Pe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ae>lt||AePe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(Ae,pe,Ne,lt){if(Ae=+Ae,pe=pe>>>0,Ne=Ne>>>0,!lt){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,!lt){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,lt){ue(Ae,Ne,lt,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,lt){ue(Ae,Ne,lt,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,lt){if(Ae=+Ae,pe=pe>>>0,!lt){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,lt){if(Ae=+Ae,pe=pe>>>0,!lt){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,lt,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,lt){return Ae=+Ae,pe=pe>>>0,lt||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,lt){return Ae=+Ae,pe=pe>>>0,lt||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,lt){if(!t.isBuffer(Ae))throw new TypeError("argument should be a Buffer");if(Ne||(Ne=0),!lt&<!==0&&(lt=this.length),pe>=Ae.length&&(pe=Ae.length),pe||(pe=0),lt>0&<=this.length)throw new RangeError("Index out of range");if(lt<0)throw new RangeError("sourceEnd out of bounds");lt>this.length&&(lt=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?lt=ne(String(pe)):typeof pe=="bigint"&&(lt=String(pe),(pe>BigInt(2)**BigInt(32)||pe<-(BigInt(2)**BigInt(32)))&&(lt=ne(lt)),lt+="n"),Ne+=` It must be ${Ae}. Received ${lt}`,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,lt,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,lt,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 lt=null;const dt=[];for(let nt=0;nt55295&&pe<57344){if(!lt){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}lt=pe;continue}if(pe<56320){(Ae-=3)>-1&&dt.push(239,191,189),lt=pe;continue}pe=(lt-55296<<10|pe-56320)+65536}else lt&&(Ae-=3)>-1&&dt.push(239,191,189);if(lt=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,lt=pe%256,dt.push(lt),dt.push(Ne);return dt}function Fe(Pe){return G.toByteArray(ie(Pe))}function ze(Pe,Ae,pe,Ne){let lt;for(lt=0;lt=Ae.length||lt>=Pe.length);++lt)Ae[lt+pe]=Pe[lt];return lt}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 lt=0;lt<16;++lt)Ae[Ne+lt]=Pe[pe]+Pe[lt]}return Ae})();function at(Pe){return typeof BigInt>"u"?et:Pe}function et(){throw new Error("BigInt not supported")}}}),n_=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=n_();G.exports=function(){return h()&&!!Symbol.toStringTag}}}),a_=Ge({"node_modules/es-object-atoms/index.js"(K,G){G.exports=Object}}),oA=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}}),tE=Ge({"node_modules/es-errors/uri.js"(K,G){G.exports=URIError}}),sA=Ge({"node_modules/math-intrinsics/abs.js"(K,G){G.exports=Math.abs}}),lA=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}}),uA=Ge({"node_modules/math-intrinsics/round.js"(K,G){G.exports=Math.round}}),cA=Ge({"node_modules/math-intrinsics/isNaN.js"(K,G){G.exports=Number.isNaN||function(b){return b!==b}}}),fA=Ge({"node_modules/math-intrinsics/sign.js"(K,G){var h=cA();G.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),rE=Ge({"node_modules/gopd/gOPD.js"(K,G){G.exports=Object.getOwnPropertyDescriptor}}),X0=Ge({"node_modules/gopd/index.js"(K,G){var h=rE();if(h)try{h([],"length")}catch{h=null}G.exports=h}}),Qd=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}}),Wp=Ge({"node_modules/has-symbols/index.js"(K,G){var h=typeof Symbol<"u"&&Symbol,b=n_();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=a_();G.exports=h.getPrototypeOf||null}}),hA=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=i_(),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=Qd(),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=Qd(),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}}),vA=Ge({"node_modules/set-function-length/index.js"(K,G){var h=xg(),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}}}),Sm=Ge({"node_modules/call-bind/index.js"(K,G){var h=fp(),b=xg(),S=vA(),E=Rh(),e=b("%Function.prototype.apply%"),t=b("%Function.prototype.call%"),r=b("%Reflect.apply%",!0)||h.call(t,e),o=Qd(),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=xg(),b=Sm(),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}}}),vb=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}}),pA=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}}}),nE=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)}}}),mA=Ge({"node_modules/for-each/index.js"(K,G){var h=nE(),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}}),Lc=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=mA(),b=Lc(),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=vb(),h=pA(),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($){return" "+$}).join(` +`).slice(2):ee=` +`+ee.split(` +`).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]}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;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})()}}),bg=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}}}),Em=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}}),m0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(K,G){var h=Em().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=Zp(),e=_g().Buffer,t=window.Uint8Array||function(){};function r(V){return e.from(V)}function o(V){return e.isBuffer(V)||V instanceof t}var n=bg(),i=m0(),a=i.getHighWaterMark,s=Em().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):""}}}),km=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(K,G){var h=Em().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=o_()),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}}),gb=Ge({"node_modules/stream-browserify/index.js"(K,G){G.exports=S;var h=D0().EventEmitter,b=Tp();b(S,h),S.Readable=pb(),S.Writable=Z0(),S.Duplex=Ap(),S.Transform=s_(),S.PassThrough=gA(),S.finished=km(),S.pipeline=mb(),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($){return" "+$}).join(` +`).slice(2):ee=` +`+ee.split(` +`).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]}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}}),Cm=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($[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(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(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(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(d,"+").concat(I," ").concat(at),re+=` +`.concat(y,"-").concat(I," ").concat(ct),Fe+=2):(fe+=re,re="",(st===1||ue===0)&&(fe+=` + `.concat(at),Fe++))}if(Fe>20&&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="",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($)),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=$,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}}),wg=Ge({"node_modules/object-keys/isArguments.js"(K,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}}}),W0=Ge({"node_modules/object-keys/implementation.js"(K,G){var h;Object.keys||(b=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=wg(),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,lt=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+)/)}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{}}}}),wA=Ge({"node_modules/stream-parser/index.js"(K,G){var h=Ey(),b=bA()("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}}}}),Pc=Ge({"node_modules/probe-image-size/lib/common.js"(K){var G=gb().Transform,h=wA();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}}}}),iE=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().readUInt32BE,E=xb(),e=u_(),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}}}}}}}}),oE=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),sE=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),TA=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"(K,G){var h=Pc().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"}}}}}),AA=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(K,G){var h=Pc().readUInt16BE,b=Pc().str2arr,S=Pc().sliceEq,E=u_(),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=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),bb=Ge({"node_modules/probe-image-size/lib/parse_sync/psd.js"(K,G){var h=Pc().str2arr,b=Pc().sliceEq,S=Pc().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"}}}}),SA=Ge({"node_modules/probe-image-size/lib/parse_sync/svg.js"(K,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):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}}}}}),kA=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"(K,G){G.exports={avif:iE(),bmp:oE(),gif:sE(),ico:TA(),jpeg:AA(),png:Cy(),psd:bb(),svg:SA(),tiff:MA(),webp:EA()}}}),CA=Ge({"node_modules/probe-image-size/sync.js"(K,G){var h=kA();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)})}}}),RA=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}}}),lE=Ge({"src/traces/image/index.js"(K,G){G.exports={attributes:e3(),supplyDefaults:aA(),calc:wb(),plot:PA(),style:RA(),hoverPoints:hf(),eventData:h3(),moduleType:"trace",name:"image",basePlotModule:_h(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),IA=Ge({"lib/image.js"(K,G){G.exports=lE()}}),Ly=Ge({"src/traces/pie/attributes.js"(K,G){var h=Gl(),b=kc().attributes,S=Ns(),E=Xf(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Ki().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=Si(),b=_n(),S=Ly(),E=kc().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"}}}}),Tb=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")}}}),g0=Ge({"src/traces/pie/calc.js"(K,G){var h=Si(),b=Is(),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&&(lt+=Nt*pe.pxmid[0],dt+=Nt*pe.pxmid[1])}pe.cxFinal=lt,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 Er="M"+(lt+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"+(lt+ar*pe.px0[0])+","+(dt+ar*pe.px0[1])+Qt(pe.px0,pe.pxmid,!1,ar)+Qt(pe.pxmid,pe.px0,!1,ar)+"Z"+Er):Ft.attr("d",Er)}else{var Mr=Qt(pe.px0,pe.px1,!0,1);if(ar){var $r=1-ar;Ft.attr("d","M"+(lt+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]+Mr+"Z")}else Ft.attr("d","M"+lt+","+dt+"l"+pe.px0[0]+","+pe.px0[1]+Mr+"Z")}ce(ee,pe,de);var Sr=c.castOption(Se.textposition,pe.pts),Nr=nt.selectAll("g.slicetext").data(pe.text&&Sr!=="none"?[0]:[]);Nr.enter().append("g").classed("slicetext",!0),Nr.exit().remove(),Nr.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=lt+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 lt;Se.title.position==="middle center"?lt=F(de):lt=N(de,te),pe.attr("transform",o(lt.x,lt.y)+r(Math.min(1,lt.scale))+o(lt.tx,lt.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,lt=0;lt=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),lt=ue?Ae.yLabelMin:Ae.yLabelMax,dt=ue?Ae.yLabelMax:Ae.yLabelMin,nt=Ae.cyFinal+ae(Ae.px0[1],Ae.px1[1]),Ft=Ne-lt,Nt,Qt,ar,Er,Mr,$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?(Er=ar.cyFinal+ae(ar.px0[1],ar.px1[1]),Ft=Er-lt-Ae.labelExtraY,Ft*de>0&&(Ae.labelExtraY+=Ft)):(dt+Ae.labelExtraY-nt)*de>0&&(Nt=3*ie*Math.abs(Qt-Fe.indexOf(Ae)),Mr=ar.cxFinal+H(ar.px0[0],ar.px1[0]),$r=Mr+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=E1(),S=cc().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)})})}}}),Pm=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)}}}),y0=Ge({"src/traces/pie/index.js"(K,G){G.exports={attributes:Ly(),supplyDefaults:Py().supplyDefaults,supplyLayoutDefaults:Tb(),layoutAttributes:d3(),calc:g0().calc,crossTraceCalc:g0().crossTraceCalc,plot:Ry().plot,style:p3(),styleOne:E1(),moduleType:"trace",name:"pie",basePlotModule:Pm(),categories:["pie-like","pie","showLegend"],meta:{}}}}),c_=Ge({"lib/pie.js"(K,G){G.exports=y0()}}),uE=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"]}}}),f_=Ge({"src/traces/sunburst/attributes.js"(K,G){var h=Gl(),{hovertemplateAttrs:b,texttemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=zu(),t=kc().attributes,r=Ly(),o=m3(),n=Ki().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"}}}}),DA=Ge({"src/traces/sunburst/defaults.js"(K,G){var h=_n(),b=f_(),S=kc().defaults,E=Dv().handleText,e=Py().handleMarkerDefaults,t=Ec(),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}}}),cE=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 Br=vr.children;Br?(vr.x=S(Br),vr.y=e(Br)):(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 lt(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,Br=Kt;Kt.eachBefore(function(aa){aa.xvr.x&&(vr=aa),aa.depth>Br.depth&&(Br=aa)});var kn=mr===vr?1:ke(mr,vr)/2,Wn=kn-mr.x,Vn=xe/(vr.x+kn+Wn),na=ye/(Br.depth||1);Kt.eachBefore(function(aa){aa.x=(aa.x+Wn)*Vn,aa.y=aa.depth*na})}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 Br=(xr[0].z+xr[xr.length-1].z)/2;vr?(Kt.z=vr.z+ke(Kt._,vr._),Kt.m=Kt.z-Br):Kt.z=Br}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,Br=Kt,kn=xr,Wn=vr.parent.children[0],Vn=vr.m,na=Br.m,aa=kn.m,Un=Wn.m,ka;kn=lt(kn),vr=Ne(vr),kn&&vr;)Wn=Ne(Wn),Br=lt(Br),Br.a=Kt,ka=kn.z+aa-vr.z-Vn+ke(kn._,vr._),ka>0&&(dt(Ft(kn,Kt,mr),Kt,ka),Vn+=ka,na+=ka),aa+=kn.m,Vn+=vr.m,Un+=Wn.m,na+=Br.m;kn&&!lt(Br)&&(Br.t=kn,Br.m+=aa-na),vr&&!Ne(Wn)&&(Wn.t=vr,Wn.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 Er(ke,xe,ye,Ee,Xe){for(var Qe=ke.children,Lt,Ct=-1,Ot=Qe.length,Kt=ke.value&&(Xe-ye)/ke.value;++Ctaa&&(aa=Kt),sr=Vn*Vn*Va,Un=Math.max(aa/sr,sr/na),Un>ka){Vn-=Kt;break}ka=Un}Lt.push(Ot={value:Vn,dice:Br1?Ee:1)},ye})(Mr);function Nr(){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 Br=Xe[vr.depth],kn=vr.x0+Br,Wn=vr.y0+Br,Vn=vr.x1-Br,na=vr.y1-Br;Vn=vr-1){var aa=Qe[mr];aa.x0=kn,aa.y0=Wn,aa.x1=Vn,aa.y1=na;return}for(var Un=Kt[mr],ka=Br/2+Un,Va=mr+1,sr=vr-1;Va>>1;Kt[qt]na-Wn){var Gr=(kn*ur+Vn*or)/Br;xr(mr,Va,or,kn,Wn,Gr,na),xr(Va,vr,ur,Gr,Wn,Vn,na)}else{var sn=(Wn*ur+na*or)/Br;xr(mr,Va,or,kn,Wn,Vn,sn),xr(Va,vr,ur,kn,sn,Vn,na)}}}function je(ke,xe,ye,Ee,Xe){(ke.depth&1?Er: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,Br,kn=Ot.length,Wn=Ee.value;++vr1?Ee:1)},ye})(Mr);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=Nr,h.treemapBinary=Mt,h.treemapDice=ze,h.treemapResquarify=Je,h.treemapSlice=Er,h.treemapSliceDice=je,h.treemapSquarify=Sr,Object.defineProperty(h,"__esModule",{value:!0})})}}),h_=Ge({"src/traces/sunburst/calc.js"(K){var G=Iy(),h=Si(),b=_n(),S=Ec().makeColorScaleFuncFromTrace,E=g0().makePullColorFn,e=g0().generateExtendedColors,t=Ec().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?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=kb.exec(K))?new wd(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=Cb.exec(K))?zy(G[1],G[2],G[3],G[4]):(G=BA.exec(K))?zy(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=w3.exec(K))?FA(G[1],G[2]/100,G[3]/100,1):(G=NA.exec(K))?FA(G[1],G[2]/100,G[3]/100,G[4]):Lb.hasOwnProperty(K)?Hu(Lb[K]):K==="transparent"?new wd(NaN,NaN,NaN,0):null}function Hu(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 _0||(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 Ab(){return`#${Ag(this.r)}${Ag(this.g)}${Ag(this.b)}`}function m_(){return`#${Ag(this.r)}${Ag(this.g)}${Ag(this.b)}${Ag((isNaN(this.opacity)?1:this.opacity)*255)}`}function g_(){const K=Sb(this.opacity);return`${K===1?"rgb(":"rgba("}${Rm(this.r)}, ${Rm(this.g)}, ${Rm(this.b)}${K===1?")":`, ${K})`}`}function Sb(K){return isNaN(K)?1:Math.max(0,Math.min(1,K))}function Rm(K){return Math.max(0,Math.min(255,Math.round(K)||0))}function Ag(K){return K=Rm(K),(K<16?"0":"")+K.toString(16)}function FA(K,G,h,b){return b<=0?K=G=h=NaN:h<=0||h>=1?K=G=NaN:G<=0&&(K=NaN),new Gu(K,G,h,b)}function y3(K){if(K instanceof Gu)return new Gu(K.h,K.s,K.l,K.opacity);if(K instanceof _0||(K=Dy(K)),!K)return new Gu;if(K instanceof Gu)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 Gu(e,t,r,K.opacity)}function Mb(K,G,h,b){return arguments.length===1?y3(K):new Gu(K,G,h,b??1)}function Gu(K,G,h,b){this.h=+K,this.s=+G,this.l=+h,this.opacity=+b}function Eb(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,Sg,K0,Im,Uv,x3,b3,kb,Cb,BA,w3,NA,Lb,T3=li({"node_modules/d3-color/src/color.js"(){v_(),$0=.7,Sg=1/$0,K0="\\s*([+-]?\\d+)\\s*",Im="\\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}\\)$`),kb=new RegExp(`^rgb\\(${Uv},${Uv},${Uv}\\)$`),Cb=new RegExp(`^rgba\\(${K0},${K0},${K0},${Im}\\)$`),BA=new RegExp(`^rgba\\(${Uv},${Uv},${Uv},${Im}\\)$`),w3=new RegExp(`^hsl\\(${Im},${Uv},${Uv}\\)$`),NA=new RegExp(`^hsla\\(${Im},${Uv},${Uv},${Im}\\)$`),Lb={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},Tg(_0,Dy,{copy(K){return Object.assign(new this.constructor,this,K)},displayable(){return this.rgb().displayable()},hex:zA,formatHex:zA,formatHex8:fE,formatHsl:p_,formatRgb:OA,toString:OA}),Tg(wd,Fy,d_(_0,{brighter(K){return K=K==null?Sg:Math.pow(Sg,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(Rm(this.r),Rm(this.g),Rm(this.b),Sb(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:Ab,formatHex:Ab,formatHex8:m_,formatRgb:g_,toString:g_})),Tg(Gu,Mb,d_(_0,{brighter(K){return K=K==null?Sg:Math.pow(Sg,K),new Gu(this.h,this.s,this.l*K,this.opacity)},darker(K){return K=K==null?$0:Math.pow($0,K),new Gu(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 Gu(Eb(this.h),cd(this.s),cd(this.l),Sb(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=Sb(this.opacity);return`${K===1?"hsl(":"hsla("}${Eb(this.h)}, ${cd(this.s)*100}%, ${cd(this.l)*100}%${K===1?")":`, ${K})`}`}}))}}),A3,x0,S3=li({"node_modules/d3-color/src/math.js"(){A3=Math.PI/180,x0=180/Math.PI}});function M3(K){if(K instanceof b0)return new b0(K.l,K.a,K.b,K.opacity);if(K instanceof Kp)return k3(K);K instanceof wd||(K=Oy(K));var G=x_(K.r),h=x_(K.g),b=x_(K.b),S=E3((.2225045*G+.7168786*h+.0606169*b)/Mg),E,e;return G===h&&h===b?E=e=S:(E=E3((.4360747*G+.3850649*h+.1430804*b)/Rb),e=E3((.0139322*G+.0971045*h+.7141733*b)/qv)),new b0(116*S-16,500*(E-S),200*(S-e),K.opacity)}function y_(K,G,h,b){return arguments.length===1?M3(K):new b0(K,G,h,b??1)}function b0(K,G,h,b){this.l=+K,this.a=+G,this.b=+h,this.opacity=+b}function E3(K){return K>UA?Math.pow(K,.3333333333333333):K/Jp+Ib}function Pb(K){return K>w0?K*K*K:Jp*(K-Ib)}function __(K){return 255*(K<=.0031308?12.92*K:1.055*Math.pow(K,.4166666666666667)-.055)}function x_(K){return(K/=255)<=.04045?K/12.92:Math.pow((K+.055)/1.055,2.4)}function hE(K){if(K instanceof Kp)return new Kp(K.h,K.c,K.l,K.opacity);if(K instanceof b0||(K=M3(K)),K.a===0&&K.b===0)return new Kp(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 A_(K,G){return function(h){return K+h*G}}function qA(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 S_(K,G){var h=G-K;return h?A_(K,h>180||h<-180?h-360*Math.round(h/360):h):Pg(isNaN(K)?G:K)}function vE(K){return(K=+K)==1?Td:function(G,h){return h-G?qA(G,h,K):Pg(isNaN(G)?h:G)}}function Td(K,G){var h=G-K;return h?A_(K,h):Pg(isNaN(K)?G:K)}var jy=li({"node_modules/d3-interpolate/src/color.js"(){Bb()}});function Nb(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:Qp(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:Qp(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:Qp(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:Qp(o,i)},{i:c-2,x:Qp(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:()=>VA,interpolateBasis:()=>Cg,interpolateBasisClosed:()=>P3,interpolateCubehelix:()=>Pi,interpolateCubehelixLong:()=>Ui,interpolateDate:()=>O3,interpolateDiscrete:()=>zm,interpolateHcl:()=>Ma,interpolateHclLong:()=>Ai,interpolateHsl:()=>ve,interpolateHslLong:()=>Ie,interpolateHue:()=>P_,interpolateLab:()=>Pt,interpolateNumber:()=>Qp,interpolateNumberArray:()=>R3,interpolateObject:()=>L_,interpolateRgb:()=>Ub,interpolateRgbBasis:()=>M_,interpolateRgbBasisClosed:()=>E_,interpolateRound:()=>Fm,interpolateString:()=>qb,interpolateTransformCss:()=>U3,interpolateTransformSvg:()=>Dg,interpolateZoom:()=>D_,piecewise:()=>jl,quantize:()=>si});var ao=li({"node_modules/d3-interpolate/src/index.js"(){e0(),z3(),Lg(),T_(),jb(),Om(),R_(),C_(),I3(),HA(),mE(),B3(),YA(),O(),k_(),ht(),Ir(),no(),Ks(),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)}}}),xc=Ge({"src/traces/sunburst/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=cc().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}}}),Us=Ge({"src/traces/sunburst/helpers.js"(K){var G=_n(),h=go(),b=Np(),S=rg();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=$d().appendArrayPointValue,E=Yf(),e=_n(),t=S1(),r=Us(),o=rg(),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;lt={x0:nt,x1:nt}}else lt={rpx0:le,rpx1:le},E.extendFlat(lt,Ae(pe));else lt={rpx0:0,rpx1:0};else lt={x0:ae,x1:ae};return b(lt,dt)}function Pe(pe){var Ne=ne[T.getPtId(pe)],lt,dt=pe.transform;if(Ne)lt=Ne;else if(lt={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;lt.x0=lt.x1=nt}else E.extendFlat(lt,Ae(pe));else lt.x0=lt.x1=ae;else lt.x0=lt.x1=ae;var Ft=b(lt.transform.textPosAngle,pe.transform.textPosAngle),Nt=b(lt.rpx1,pe.rpx1),Qt=b(lt.x0,pe.x0),ar=b(lt.x1,pe.x1),Er=b(lt.transform.scale,dt.scale),Mr=b(lt.transform.rotate,dt.rotate),$r=dt.rCenter===0?3:lt.transform.rCenter===0?1/3:1,Sr=b(lt.transform.rCenter,dt.rCenter),Nr=function(Mt){return Sr(Math.pow(Mt,$r))};return function(Mt){var je=Nt(Mt);Qt(Mt),ar(Mt);var Je=Nr(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:Er(Mt),rotate:Mr(Mt),rCenter:Je}}}}function Ae(pe){var Ne=pe.parent,lt=ne[T.getPtId(Ne)],dt={};if(lt){var nt=Ne.children,Ft=nt.indexOf(pe),Nt=nt.length,Qt=b(lt.x0,lt.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)]}}}),Rc=Ge({"src/traces/sunburst/index.js"(K,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:uE(),categories:[],animatable:!0,attributes:f_(),layoutAttributes:g3(),supplyDefaults:DA(),supplyLayoutDefaults:cE(),calc:h_().calc,crossTraceCalc:h_().crossTraceCalc,plot:Xu().plot,style:xc().style,colorbar:Zf(),meta:{}}}}),Bm=Ge({"lib/sunburst.js"(K,G){G.exports=Rc()}}),gE=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)}}}),Wb=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}}}),yE=Ge({"src/traces/treemap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=kc().attributes,t=Ly(),r=f_(),o=Wb(),n=Ki().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"})}}}),nC=Ge({"src/traces/treemap/layout_attributes.js"(K,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),iR=Ge({"src/traces/treemap/defaults.js"(K,G){var h=_n(),b=yE(),S=go(),E=kc().defaults,e=Dv().handleText,t=bm().TEXTPAD,r=Py().handleMarkerDefaults,o=Ec(),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}}}),oR=Ge({"src/traces/treemap/layout_defaults.js"(K,G){var h=_n(),b=nC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),aC=Ge({"src/traces/treemap/calc.js"(K){var G=h_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("treemap",h)}}}),iC=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))})}}}),lR=Ge({"src/traces/treemap/plot_one.js"(K,G){var h=ki(),b=(ao(),ui(xi)).interpolate,S=Us(),E=_n(),e=bm().TEXTPAD,t=ou(),r=t.toMoveInsideBar,o=cc(),n=o.recordMinTextSize,i=Wb(),a=sR();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,Nr,Mt){var je=A.tiling.pad,Je=function(Ee){return Ee-je<=Nr.x0},ke=function(Ee){return Ee+je>=Nr.x1},xe=function(Ee){return Ee-je<=Nr.y0},ye=function(Ee){return Ee+je>=Nr.y1};return Sr.x0===Nr.x0&&Sr.x1===Nr.x1&&Sr.y0===Nr.y0&&Sr.y1===Nr.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,Nr){return Nr?ee[s(Sr)]:ne[s(Sr)]},te=function(Sr,Nr,Mt,je){if(Nr)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,Nr){return Sr+","+Nr}var st=Fe(0),ct=function(Sr){Sr.x=Math.max(st,Sr.x)},at=A.pathbar.edgeshape,et=function(Sr){var Nr=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=Nr,ye.x=Mt,xe.y=ye.y=(je+Je)/2;var Ee={x:Nr,y:je},Xe={x:Mt,y:je},Qe={x:Mt,y:Je},Lt={x:Nr,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"),lt=Ae("right"),dt=Ae("bottom"),nt=function(Sr){var Nr=ie(Sr.x0),Mt=ie(Sr.x1),je=de(Sr.y0),Je=de(Sr.y1),ke=Mt-Nr,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)),lt&&(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(Nr,je+Ee)+Xe(Ee,-Ee)+"L"+Ye(Mt-Ee,je)+Xe(Ee,Ee)+"L"+Ye(Mt,Je-Ee)+Xe(-Ee,Ee)+"L"+Ye(Nr+Ee,Je)+Xe(-Ee,-Ee)+"Z"},Ft=function(Sr,Nr){var Mt=Sr.x0,je=Sr.x1,Je=Sr.y0,ke=Sr.y1,xe=Sr.textBB,ye=pe||Nr.isHeader&&!dt,Ee=ye?"start":dt?"end":"middle",Xe=Ae("right"),Qe=Ae("left")||Nr.onPathbar,Lt=Qe?-1:Xe?1:0;if(Nr.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}}}),cR=Ge({"src/traces/treemap/plot.js"(K,G){var h=sC(),b=uR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"treemap",drawDescendants:b})}}}),fR=Ge({"src/traces/treemap/index.js"(K,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:gE(),categories:[],animatable:!0,attributes:yE(),layoutAttributes:nC(),supplyDefaults:iR(),supplyLayoutDefaults:oR(),calc:aC().calc,crossTraceCalc:aC().crossTraceCalc,plot:cR(),style:_E().style,colorbar:Zf(),meta:{}}}}),hR=Ge({"lib/treemap.js"(K,G){G.exports=fR()}}),dR=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)}}}),lC=Ge({"src/traces/icicle/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=kc().attributes,t=Ly(),r=f_(),o=yE(),n=Wb(),i=Ki().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"})}}}),uC=Ge({"src/traces/icicle/layout_attributes.js"(K,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),vR=Ge({"src/traces/icicle/defaults.js"(K,G){var h=_n(),b=lC(),S=go(),E=kc().defaults,e=Dv().handleText,t=bm().TEXTPAD,r=Py().handleMarkerDefaults,o=Ec(),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}}}),pR=Ge({"src/traces/icicle/layout_defaults.js"(K,G){var h=_n(),b=uC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),cC=Ge({"src/traces/icicle/calc.js"(K){var G=h_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("icicle",h)}}}),mR=Ge({"src/traces/icicle/partition.js"(K,G){var h=Iy(),b=iC();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}}}),fC=Ge({"src/traces/icicle/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=cc().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}}}),gR=Ge({"src/traces/icicle/draw_descendants.js"(K,G){var h=ki(),b=_n(),S=As(),E=nc(),e=mR(),t=fC().styleOne,r=Wb(),o=Us(),n=xu(),i=Xu().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}}}),yR=Ge({"src/traces/icicle/plot.js"(K,G){var h=sC(),b=gR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"icicle",drawDescendants:b})}}}),_R=Ge({"src/traces/icicle/index.js"(K,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:dR(),categories:[],animatable:!0,attributes:lC(),layoutAttributes:uC(),supplyDefaults:vR(),supplyLayoutDefaults:pR(),calc:cC().calc,crossTraceCalc:cC().crossTraceCalc,plot:yR(),style:fC().style,colorbar:Zf(),meta:{}}}}),xR=Ge({"lib/icicle.js"(K,G){G.exports=_R()}}),bR=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)}}}),hC=Ge({"src/traces/funnelarea/attributes.js"(K,G){var h=Ly(),b=Gl(),S=kc().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Ki().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"}}}}),dC=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"}}}}),wR=Ge({"src/traces/funnelarea/defaults.js"(K,G){var h=_n(),b=hC(),S=kc().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")}}}),TR=Ge({"src/traces/funnelarea/layout_defaults.js"(K,G){var h=_n(),b=dC();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")}}}),vC=Ge({"src/traces/funnelarea/calc.js"(K,G){var h=g0();function b(E,e){return h.calc(E,e)}function S(E){h.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:b,crossTraceCalc:S}}}),AR=Ge({"src/traces/funnelarea/plot.js"(K,G){var h=ki(),b=As(),S=_n(),E=S.strScale,e=S.strTranslate,t=nc(),r=ou(),o=r.toMoveInsideBar,n=cc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=rg(),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}}}}),SR=Ge({"src/traces/funnelarea/style.js"(K,G){var h=ki(),b=E1(),S=cc().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)})})}}}),MR=Ge({"src/traces/funnelarea/index.js"(K,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:bR(),categories:["pie-like","funnelarea","showLegend"],attributes:hC(),layoutAttributes:dC(),supplyDefaults:wR(),supplyLayoutDefaults:TR(),calc:vC().calc,crossTraceCalc:vC().crossTraceCalc,plot:AR(),style:SR(),styleOne:E1(),meta:{}}}}),ER=Ge({"lib/funnelarea.js"(K,G){G.exports=MR()}}),hv=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;R 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * (view * conePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);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; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),a=o([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);e.exports=function(s){return n(s,i,a,null,[{name:"position",type:"vec2"}])}}),811:(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}}),840:(function(e,t,r){var o=r(3236),n=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +vec4 project(vec3 p) { + return projection * (view * (model * vec4(p, 1.0))); +} + +void main() { + gl_Position = project(position); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * vec4(position , 1.0); + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + f_color = color; + f_data = position; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),a=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_color = color; + f_data = position; + f_uv = uv; +}`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),f=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),p=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_id = id; + f_position = position; +}`]),v=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),T=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),l=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); +}`]),g=o([`precision highp float; +#define GLSLIFY 1 + +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:v,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:v,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),v=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),g=o.mallocDouble(s*8);function x(d){var y=n.nextPow2(d);f.length>>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;Ye max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + if ( + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) + ) discard; + + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color — in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; +} +`]),s=n([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute float f; + +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); + + vec4 clipPosition = projection * (view * worldPosition); + clipPosition.z += zOffset; + + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; + + vColor = texture2D(colormap, vec2(value, value)); + + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); +} +`]),f=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec2 shape; +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} + +void main() { + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; + + vec2 ux = splitFloat(planeCoordinate.x / shape.x); + vec2 uy = splitFloat(planeCoordinate.y / shape.y); + gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); +} +`]);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) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform vec4 highlightId; +uniform float highlightScale; +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = 1.0; + if(distance(highlightId, id) < 0.0001) { + scale = highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1); + vec4 viewPosition = view * worldPosition; + viewPosition = viewPosition / viewPosition.w; + vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),a=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float highlightScale, pixelRatio; +uniform vec4 highlightId; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = pixelRatio; + if(distance(highlightId.bgr, id.bgr) < 0.001) { + scale *= highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1.0); + vec4 viewPosition = view * worldPosition; + vec4 clipPosition = projection * viewPosition; + clipPosition /= clipPosition.w; + + gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),s=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform float highlightScale; +uniform vec4 highlightId; +uniform vec3 axes[2]; +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float scale, pixelRatio; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float lscale = pixelRatio * scale; + if(distance(highlightId, id) < 0.0001) { + lscale *= highlightScale; + } + + vec4 clipCenter = projection * (view * (model * vec4(position, 1))); + vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; + vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = dataPosition; + } +} +`]),f=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float opacity; + +varying vec4 interpColor; +varying vec3 dataCoordinate; + +void main() { + if ( + outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || + interpColor.a * opacity == 0. + ) discard; + gl_FragColor = interpColor * opacity; +} +`]),c=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float pickGroup; + +varying vec4 pickId; +varying vec3 dataCoordinate; + +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"}],v={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(_,v)},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]),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: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;v HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +} +`]),f=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(v){return n(v,s,f,null,[{name:"position",type:"vec3"}])};var c=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),p=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);t.bg=function(v){return n(v,c,p,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),1888:(function(e,t,r){var o=r(8828),n=r(1338),i=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:n([32,0]),UINT16:n([32,0]),UINT32:n([32,0]),BIGUINT64:n([32,0]),INT8:n([32,0]),INT16:n([32,0]),INT32:n([32,0]),BIGINT64:n([32,0]),FLOAT:n([32,0]),DOUBLE:n([32,0]),DATA:n([32,0]),UINT8C:n([32,0]),BUFFER:n([32,0])});var a=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",f=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=n([32,0])),c.BIGUINT64||(c.BIGUINT64=n([32,0])),c.BIGINT64||(c.BIGINT64=n([32,0])),c.BUFFER||(c.BUFFER=n([32,0]));var p=c.DATA,v=c.BUFFER;t.free=function(B){if(i.isBuffer(B))v[o.log2(B.length)].push(B);else{if(Object.prototype.toString.call(B)!=="[object ArrayBuffer]"&&(B=B.buffer),!B)return;var R=B.length||B.byteLength,U=o.log2(R)|0;p[U].push(B)}};function T(N){if(N){var B=N.length||N.byteLength,R=o.log2(B);p[R].push(N)}}function l(N){T(N.buffer)}t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=l,t.freeArrayBuffer=T,t.freeBuffer=function(B){v[o.log2(B.length)].push(B)},t.malloc=function(B,R){if(R===void 0||R==="arraybuffer")return g(B);switch(R){case"uint8":return x(B);case"uint16":return A(B);case"uint32":return M(B);case"int8":return _(B);case"int16":return w(B);case"int32":return m(B);case"float":case"float32":return u(B);case"double":case"float64":return d(B);case"uint8_clamped":return y(B);case"bigint64":return L(B);case"biguint64":return I(B);case"buffer":return F(B);case"data":case"dataview":return z(B);default:return null}return null};function g(B){var B=o.nextPow2(B),R=o.log2(B),U=p[R];return U.length>0?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 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; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),a=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) 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,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,Er=Ft[Qt],Mr=Ft[ar],$r=Nt[Qt],Sr=Nt[ar];if(Er>0&&Sr>0){Pe(Qt);return}else if(Er>0&&Sr<0){Pe(Qt);return}else if(Er<0&&Sr>0){Pe(Qt);return}else if(Er<0&&Sr<0){Pe(Qt);return}else if(Mr>0&&$r>0){Pe(ar);return}else if(Mr>0&&$r<0){Pe(ar);return}else if(Mr<0&&$r>0){Pe(ar);return}else if(Mr<0&&$r<0){Pe(ar);return}}for(var $=0;$<3;++$){for(var pe=ue[$].primalMinor,Ne=ue[$].mirrorMinor,lt=l(I,ue[$].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[$]&&(lt[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)lt[ie]+=ne*pe[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks($,this.tickSize[$],this.tickAngle[$],lt,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)lt[ie]+=ne*pe[ie]*this.labelPad[ie]/F[5*ie];lt[$]+=.5*(R[0][$]+R[1][$]),this._text.drawLabel($,this.labelSize[$],this.labelAngle[$],lt,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 lt=d.style;lt.position=lt.position||"absolute",lt.left="0px",lt.top="0px",lt.width=Pe+"px",lt.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(Nr(xe,ArrayBuffer)||xe&&Nr(xe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nr(xe,SharedArrayBuffer)||xe&&Nr(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(Nr(ye,Uint8Array)&&(ye=d.from(ye,ye.offset,ye.byteLength)),Nr(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)||Nr(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(Nr(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,Wn){return Lt===1?kn[Wn]:kn.readUInt16BE(Wn*Lt)}var xr;if(Qe){var mr=-1;for(xr=Ee;xrCt&&(Ee=Ct-Ot),xr=Ee;xr>=0;xr--){for(var vr=!0,Br=0;BrQe&&(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 lt(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)}lt(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 Er(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 Nr(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;w 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * (view * tubePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}}),6743:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=i+i,p=a+a,v=s+s,T=i*c,l=i*p,g=i*v,x=a*p,A=a*v,M=s*v,_=f*c,w=f*p,m=f*v;return r[0]=1-(x+M),r[1]=l+m,r[2]=g-w,r[3]=0,r[4]=l-m,r[5]=1-(T+M),r[6]=A+_,r[7]=0,r[8]=g+w,r[9]=A-_,r[10]=1-(T+x),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}}),6760:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=o[4],p=o[5],v=o[6],T=o[7],l=o[8],g=o[9],x=o[10],A=o[11],M=o[12],_=o[13],w=o[14],m=o[15],u=n[0],d=n[1],y=n[2],I=n[3];return r[0]=u*i+d*c+y*l+I*M,r[1]=u*a+d*p+y*g+I*_,r[2]=u*s+d*v+y*x+I*w,r[3]=u*f+d*T+y*A+I*m,u=n[4],d=n[5],y=n[6],I=n[7],r[4]=u*i+d*c+y*l+I*M,r[5]=u*a+d*p+y*g+I*_,r[6]=u*s+d*v+y*x+I*w,r[7]=u*f+d*T+y*A+I*m,u=n[8],d=n[9],y=n[10],I=n[11],r[8]=u*i+d*c+y*l+I*M,r[9]=u*a+d*p+y*g+I*_,r[10]=u*s+d*v+y*x+I*w,r[11]=u*f+d*T+y*A+I*m,u=n[12],d=n[13],y=n[14],I=n[15],r[12]=u*i+d*c+y*l+I*M,r[13]=u*a+d*p+y*g+I*_,r[14]=u*s+d*v+y*x+I*w,r[15]=u*f+d*T+y*A+I*m,r}}),6768:(function(e,t,r){var o=r(6859);e.exports=n;function n(i){return new o(i)}}),6803:(function(e,t,r){r(8828),r(1755);function o(n,i){var a=n.length,s=n.length-i.length,f=Math.min;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-i[0];case 2:var l=n[0]+n[1]-i[0]-i[1];return l||f(n[0],n[1])-f(i[0],i[1]);case 3:var c=n[0]+n[1],p=i[0]+i[1];if(l=c+n[2]-(p+i[2]),l)return l;var v=f(n[0],n[1]),T=f(i[0],i[1]),l=f(v,n[2])-f(T,i[2]);return l||f(v+n[2],c)-f(T+i[2],p);default:var g=n.slice(0);g.sort();var x=i.slice(0);x.sort();for(var A=0;A0?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,lt=Z[7]|0,dt=lt&8191,nt=lt>>>13,Ft=Z[8]|0,Nt=Ft&8191,Qt=Ft>>>13,ar=Z[9]|0,Er=ar&8191,Mr=ar>>>13,$r=re[0]|0,Sr=$r&8191,Nr=$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,Br=vr&8191,kn=vr>>>13,Wn=re[7]|0,Vn=Wn&8191,na=Wn>>>13,aa=re[8]|0,Un=aa&8191,ka=aa>>>13,Va=re[9]|0,sr=Va&8191,qt=Va>>>13;j.negative=R.negative^U.negative,j.length=19,ce=Math.imul($,Sr),V=Math.imul($,Nr),V=V+Math.imul(ue,Sr)|0,ee=Math.imul(ue,Nr);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,Nr),V=V+Math.imul(ae,Sr)|0,ee=Math.imul(ae,Nr),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,Nr),V=V+Math.imul(Se,Sr)|0,ee=Math.imul(Se,Nr),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,Nr),V=V+Math.imul(ze,Sr)|0,ee=Math.imul(ze,Nr),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 sn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(sn>>>26)|0,sn&=67108863,ce=Math.imul(st,Sr),V=Math.imul(st,Nr),V=V+Math.imul(ct,Sr)|0,ee=Math.imul(ct,Nr),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 mn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(mn>>>26)|0,mn&=67108863,ce=Math.imul(et,Sr),V=Math.imul(et,Nr),V=V+Math.imul(Pe,Sr)|0,ee=Math.imul(Pe,Nr),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 Tn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,ce=Math.imul(pe,Sr),V=Math.imul(pe,Nr),V=V+Math.imul(Ne,Sr)|0,ee=Math.imul(Ne,Nr),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($,Br)|0,V=V+Math.imul($,kn)|0,V=V+Math.imul(ue,Br)|0,ee=ee+Math.imul(ue,kn)|0;var Jn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,ce=Math.imul(dt,Sr),V=Math.imul(dt,Nr),V=V+Math.imul(nt,Sr)|0,ee=Math.imul(nt,Nr),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,Br)|0,V=V+Math.imul(H,kn)|0,V=V+Math.imul(ae,Br)|0,ee=ee+Math.imul(ae,kn)|0,ce=ce+Math.imul($,Vn)|0,V=V+Math.imul($,na)|0,V=V+Math.imul(ue,Vn)|0,ee=ee+Math.imul(ue,na)|0;var ma=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ma>>>26)|0,ma&=67108863,ce=Math.imul(Nt,Sr),V=Math.imul(Nt,Nr),V=V+Math.imul(Qt,Sr)|0,ee=Math.imul(Qt,Nr),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,Br)|0,V=V+Math.imul(de,kn)|0,V=V+Math.imul(Se,Br)|0,ee=ee+Math.imul(Se,kn)|0,ce=ce+Math.imul(H,Vn)|0,V=V+Math.imul(H,na)|0,V=V+Math.imul(ae,Vn)|0,ee=ee+Math.imul(ae,na)|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 da=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(da>>>26)|0,da&=67108863,ce=Math.imul(Er,Sr),V=Math.imul(Er,Nr),V=V+Math.imul(Mr,Sr)|0,ee=Math.imul(Mr,Nr),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,Br)|0,V=V+Math.imul(Fe,kn)|0,V=V+Math.imul(ze,Br)|0,ee=ee+Math.imul(ze,kn)|0,ce=ce+Math.imul(de,Vn)|0,V=V+Math.imul(de,na)|0,V=V+Math.imul(Se,Vn)|0,ee=ee+Math.imul(Se,na)|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($,qt)|0,V=V+Math.imul(ue,sr)|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,Je),V=V+Math.imul(Mr,je)|0,ee=Math.imul(Mr,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,Br)|0,V=V+Math.imul(st,kn)|0,V=V+Math.imul(ct,Br)|0,ee=ee+Math.imul(ct,kn)|0,ce=ce+Math.imul(Fe,Vn)|0,V=V+Math.imul(Fe,na)|0,V=V+Math.imul(ze,Vn)|0,ee=ee+Math.imul(ze,na)|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,qt)|0,V=V+Math.imul(ae,sr)|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,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,Br)|0,V=V+Math.imul(et,kn)|0,V=V+Math.imul(Pe,Br)|0,ee=ee+Math.imul(Pe,kn)|0,ce=ce+Math.imul(st,Vn)|0,V=V+Math.imul(st,na)|0,V=V+Math.imul(ct,Vn)|0,ee=ee+Math.imul(ct,na)|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,qt)|0,V=V+Math.imul(Se,sr)|0,ee=ee+Math.imul(Se,qt)|0;var Hn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,ce=Math.imul(Er,Xe),V=Math.imul(Er,Qe),V=V+Math.imul(Mr,Xe)|0,ee=Math.imul(Mr,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,Br)|0,V=V+Math.imul(pe,kn)|0,V=V+Math.imul(Ne,Br)|0,ee=ee+Math.imul(Ne,kn)|0,ce=ce+Math.imul(et,Vn)|0,V=V+Math.imul(et,na)|0,V=V+Math.imul(Pe,Vn)|0,ee=ee+Math.imul(Pe,na)|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,qt)|0,V=V+Math.imul(ze,sr)|0,ee=ee+Math.imul(ze,qt)|0;var pi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pi>>>26)|0,pi&=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,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,Br)|0,V=V+Math.imul(dt,kn)|0,V=V+Math.imul(nt,Br)|0,ee=ee+Math.imul(nt,kn)|0,ce=ce+Math.imul(pe,Vn)|0,V=V+Math.imul(pe,na)|0,V=V+Math.imul(Ne,Vn)|0,ee=ee+Math.imul(Ne,na)|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,qt)|0,V=V+Math.imul(ct,sr)|0,ee=ee+Math.imul(ct,qt)|0;var Mi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,ce=Math.imul(Er,xr),V=Math.imul(Er,mr),V=V+Math.imul(Mr,xr)|0,ee=Math.imul(Mr,mr),ce=ce+Math.imul(Nt,Br)|0,V=V+Math.imul(Nt,kn)|0,V=V+Math.imul(Qt,Br)|0,ee=ee+Math.imul(Qt,kn)|0,ce=ce+Math.imul(dt,Vn)|0,V=V+Math.imul(dt,na)|0,V=V+Math.imul(nt,Vn)|0,ee=ee+Math.imul(nt,na)|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,qt)|0,V=V+Math.imul(Pe,sr)|0,ee=ee+Math.imul(Pe,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,Br),V=Math.imul(Er,kn),V=V+Math.imul(Mr,Br)|0,ee=Math.imul(Mr,kn),ce=ce+Math.imul(Nt,Vn)|0,V=V+Math.imul(Nt,na)|0,V=V+Math.imul(Qt,Vn)|0,ee=ee+Math.imul(Qt,na)|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,qt)|0,V=V+Math.imul(Ne,sr)|0,ee=ee+Math.imul(Ne,qt)|0;var xt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(xt>>>26)|0,xt&=67108863,ce=Math.imul(Er,Vn),V=Math.imul(Er,na),V=V+Math.imul(Mr,Vn)|0,ee=Math.imul(Mr,na),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,qt)|0,V=V+Math.imul(nt,sr)|0,ee=ee+Math.imul(nt,qt)|0;var Cr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,ce=Math.imul(Er,Un),V=Math.imul(Er,ka),V=V+Math.imul(Mr,Un)|0,ee=Math.imul(Mr,ka),ce=ce+Math.imul(Nt,sr)|0,V=V+Math.imul(Nt,qt)|0,V=V+Math.imul(Qt,sr)|0,ee=ee+Math.imul(Qt,qt)|0;var jr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(jr>>>26)|0,jr&=67108863,ce=Math.imul(Er,sr),V=Math.imul(Er,qt),V=V+Math.imul(Mr,sr)|0,ee=Math.imul(Mr,qt);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]=sn,fe[4]=mn,fe[5]=Tn,fe[6]=Jn,fe[7]=ma,fe[8]=da,fe[9]=_a,fe[10]=Ca,fe[11]=Hn,fe[12]=pi,fe[13]=Mi,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,lt,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=lt,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);ie max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),f=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(c){return n(c,i,a,null,f)},t.createPickShader=function(c){return n(c,i,s,null,f)}}),7352:(function(e,t,r){var o=r(5721),n=r(4750),i=r(2690);e.exports=a;function a(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var c=s[0].length;return c===0?[]:c===1?o(s):c===2?n(s):i(s,c)}}),7399:(function(e){e.exports=t;function t(r,o){var n=o[0],i=o[1],a=o[2],s=o[3],f=n+n,c=i+i,p=a+a,v=n*f,T=i*f,l=i*c,g=a*f,x=a*c,A=a*p,M=s*f,_=s*c,w=s*p;return r[0]=1-l-A,r[1]=T+w,r[2]=g-_,r[3]=0,r[4]=T-w,r[5]=1-v-A,r[6]=x+M,r[7]=0,r[8]=g+_,r[9]=x-M,r[10]=1-v-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7417:(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}}),7442:(function(e,t,r){var o=r(6658),n=r(7182),i=r(2652),a=r(9921),s=r(8648),f=T(),c=T(),p=T();e.exports=v;function v(x,A,M,_){if(a(A)===0||a(M)===0)return!1;var w=i(A,f.translate,f.scale,f.skew,f.perspective,f.quaternion),m=i(M,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!w||!m?!1:(o(p.translate,f.translate,c.translate,_),o(p.skew,f.skew,c.skew,_),o(p.scale,f.scale,c.scale,_),o(p.perspective,f.perspective,c.perspective,_),s(p.quaternion,f.quaternion,c.quaternion,_),n(x,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:g(),quaternion:g()}}function l(x){return[x||0,x||0,x||0]}function g(){return[0,0,0,1]}}),7507:(function(e,t){t.byteLength=c,t.toByteArray=v,t.fromByteArray=g;for(var r=[],o=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)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,lt,dt,nt,Ft,Nt,Qt,ar,Er=d,Mr=T(Er),$r=T(Er);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&&(lt=lt.replace(ze(),"?px "),de*=Math.pow(.75,Nt-Ft),lt=lt.replace("?px ",ze())),ie+=.25*V*(Nt-Ft)}if(U.superscripts===!0){var Qt=pe.indexOf(g),ar=Ne.indexOf(g),Er=Qt>-1?parseInt(pe[1+Qt]):0,Mr=ar>-1?parseInt(Ne[1+ar]):0;Er!==Mr&&(lt=lt.replace(ze(),"?px "),de*=Math.pow(.75,Mr-Er),lt=lt.replace("?px ",ze())),ie-=.25*V*(Mr-Er)}if(U.bolds===!0){var $r=pe.indexOf(p)>-1,Sr=Ne.indexOf(p)>-1;!$r&&Sr&&(Nr?lt=lt.replace("italic ","italic bold "):lt="bold "+lt),$r&&!Sr&&(lt=lt.replace("bold ",""))}if(U.italics===!0){var Nr=pe.indexOf(T)>-1,Mt=Ne.indexOf(T)>-1;!Nr&&Mt&&(lt="italic "+lt),Nr&&!Mt&&(lt=lt.replace("italic ",""))}F.font=lt}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 lt=o.create();return o.lerp(lt,pe,Ne,ne),lt},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 lt=M(Fe,Le,Se,U(L,pe)),dt=M(Fe,Le,Se,U(z,Ne));if(Math.abs(lt[1])>Math.abs(dt[1])){var nt=lt;lt=dt,dt=nt,nt=pe,pe=Ne,Ne=nt;var Ft=Pe;Pe=Ae,Ae=Ft}lt[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 Nr=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],Wn=Ft.cells||[],Vn=Ft.positions||[],dt=0;dt=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 lt=this._pickResult.level,dt=0;dt<3;++dt)if(lt[dt]=x.le(this.contourLevels[dt],Ye[dt]),lt[dt]<0)this.contourLevels[dt].length>0&&(lt[dt]=0);else if(lt[dt]Math.abs(Ft-Ye[dt])&&(lt[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 da=0;da<5;++da)mr.pop();ke-=1}continue e}}}Wn.push(ke)}this._contourOffsets[vr]=kn,this._contourCounts[vr]=Wn}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})()}}),pC=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]}}}),kR=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"(K,G){var h=pC();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}}}}),CR=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"(K,G){var h=kR();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}}}),$A=Ge({"node_modules/clamp/index.js"(K,G){G.exports=h;function h(b,S,E){return SE?E:b:bS?S:b}}}),xE=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}}}}),z_=Ge({"node_modules/color-normalize/index.js"(K,G){var h=CR(),b=$A(),S=xE();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=z_();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=Si(),b=Is(),S=z_(),E=Ec(),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}}),gC=Ge({"src/traces/scatter3d/attributes.js"(K,G){var h=Gc(),b=Ns(),S=zu(),E=pc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Gl(),n=mC(),i=bE(),a=Ki().extendFlat,s=Hc().overrideAll,f=zp(),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"}}),RR=Ge({"src/traces/scatter3d/defaults.js"(K,G){var h=Ro(),b=_n(),S=uu(),E=Kd(),e=Vp(),t=op(),r=gC();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}}}),IR=Ge({"src/traces/scatter3d/calc.js"(K,G){var h=f0(),b=sp();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),b(E,e),t}}}),DR=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)}}}),NR=Ge({"src/plots/gl3d/scene.js"(K,G){var h=hv().gl_plot3d,b=h.createCamera,S=h.createScene,E=zR(),e=Ww(),t=Ro(),r=_n(),o=r.preserveDrawingBuffer(),n=Ts(),i=Yf(),a=Gy(),s=yC(),f=cg(),c=OR(),p=FR(),v=BR(),T=Bp().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 lt=B.container.style;lt.position="absolute",lt.left=Ne.l+pe.x[0]*Ne.w+"px",lt.top=Ne.t+(1-pe.y[1])*Ne.h+"px",lt.width=Ne.w*(pe.x[1]-pe.x[0])+"px",lt.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}}),UR=Ge({"src/plots/gl3d/layout/attributes.js"(K,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),_C=Ge({"src/plots/gl3d/layout/axis_attributes.js"(K,G){var h=go(),b=id(),S=Ki().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")}}),xC=Ge({"src/plots/gl3d/layout/layout_attributes.js"(K,G){var h=_C(),b=kc().attributes,S=Ki().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"}}}),jR=Ge({"src/plots/gl3d/layout/axis_defaults.js"(K,G){var h=Is().mix,b=_n(),S=_u(),E=_C(),e=Ud(),t=Gp(),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"))}}}),O_=Ge({"src/plots/gl3d/index.js"(K){var G=Hc().overrideAll,h=tc(),b=NR(),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=UR(),K.layoutAttributes=xC(),K.baseLayoutAttrOverrides=G({hoverlabel:h.hoverlabel},"plot","nested"),K.supplyLayoutDefaults=qR(),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}}}),TE=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&&(Wn.push(aa.id),Ct==="x"?Vn.push([aa.distRatio,0,0]):Ct==="y"?Vn.push([0,aa.distRatio,0]):Vn.push([0,0,aa.distRatio]))}else Ct==="x"?kn=$r(1,u-1):Ct==="y"?kn=$r(1,d-1):kn=$r(1,y-1);Wn.length>0&&(Ct==="x"?Ot[xr]=ar(Mt,Wn,mr,vr,Vn,Ot[xr]):Ct==="y"?Ot[xr]=Er(Mt,Wn,mr,vr,Vn,Ot[xr]):Ot[xr]=Mr(Mt,Wn,mr,vr,Vn,Ot[xr]),xr++),kn.length>0&&(Ct==="x"?Ot[xr]=lt(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]=lt(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 Nr(),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}}}),WR=Ge({"src/traces/isosurface/index.js"(K,G){G.exports={attributes:wE(),supplyDefaults:wC().supplyDefaults,calc:TC(),colorbar:{min:"cmin",max:"cmax"},plot:AE().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),$R=Ge({"lib/isosurface.js"(K,G){G.exports=WR()}}),AC=Ge({"src/traces/volume/attributes.js"(K,G){var h=zu(),b=wE(),S=KA(),E=Gl(),e=Ki().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"}}),KR=Ge({"src/traces/volume/defaults.js"(K,G){var h=_n(),b=AC(),S=wC().supplyIsoDefaults,E=bC().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)}}}),JR=Ge({"src/traces/volume/convert.js"(K,G){var h=hv().gl_mesh3d,b=Xy().parseColorScale,S=_n().isArrayOrTypedArray,E=Gy(),e=Ec().extractOpts,t=q3(),r=AE().findNearestOnAxis,o=AE().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}}),QR=Ge({"src/traces/volume/index.js"(K,G){G.exports={attributes:AC(),supplyDefaults:KR(),calc:TC(),colorbar:{min:"cmin",max:"cmax"},plot:JR(),moduleType:"trace",name:"volume",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),eI=Ge({"lib/volume.js"(K,G){G.exports=QR()}}),tI=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}}}),rI=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"})}}}),nI=Ge({"src/traces/mesh3d/convert.js"(K,G){var h=hv().gl_mesh3d,b=hv().delaunay_triangulate,S=hv().alpha_shape,E=hv().convex_hull,e=Xy().parseColorScale,t=_n().isArrayOrTypedArray,r=Gy(),o=Ec().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}}),aI=Ge({"src/traces/mesh3d/index.js"(K,G){G.exports={attributes:j3(),supplyDefaults:tI(),calc:rI(),colorbar:{min:"cmin",max:"cmax"},plot:nI(),moduleType:"trace",name:"mesh3d",basePlotModule:O_(),categories:["gl3d","showLegend"],meta:{}}}}),iI=Ge({"lib/mesh3d.js"(K,G){G.exports=aI()}}),SC=Ge({"src/traces/cone/attributes.js"(K,G){var h=zu(),b=pc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=j3(),t=Gl(),r=Ki().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}}),oI=Ge({"src/traces/cone/defaults.js"(K,G){var h=_n(),b=yh(),S=SC();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}}}),sI=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}}),kE=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=EE();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}}),_I=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=EE(),h=kE();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}}),xI=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=kE();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")}}}),wI=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}}}),TI=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:fr<0?-1:0},m=Math.sqrt,u=Math.tan;function d(fr){return fr>1?0:fr<-1?n:Math.acos(fr)}function y(fr){return fr>1?i:fr<-1?-i:Math.asin(fr)}function I(fr){return(fr=_(fr/2))*fr}function L(){}function z(fr,Rr){fr&&N.hasOwnProperty(fr.type)&&N[fr.type](fr,Rr)}var F={Feature:function(fr,Rr){z(fr.geometry,Rr)},FeatureCollection:function(fr,Rr){for(var vn=fr.features,an=-1,On=vn.length;++an=0?1:-1,On=an*vn,Aa=l(Rr),xa=_(Rr),ti=V*xa,ci=ce*Aa+ti*l(On),Ni=ti*an*_(On);j.add(T(Ni,ci)),le=fr,ce=Aa,V=xa}function H(fr){return Z.reset(),U(fr,ee),Z*2}function ae(fr){return[T(fr[1],fr[0]),y(fr[2])]}function ie(fr){var Rr=fr[0],vn=fr[1],an=l(vn);return[an*l(Rr),an*_(Rr),_(vn)]}function de(fr,Rr){return fr[0]*Rr[0]+fr[1]*Rr[1]+fr[2]*Rr[2]}function Se(fr,Rr){return[fr[1]*Rr[2]-fr[2]*Rr[1],fr[2]*Rr[0]-fr[0]*Rr[2],fr[0]*Rr[1]-fr[1]*Rr[0]]}function Le(fr,Rr){fr[0]+=Rr[0],fr[1]+=Rr[1],fr[2]+=Rr[2]}function Fe(fr,Rr){return[fr[0]*Rr,fr[1]*Rr,fr[2]*Rr]}function ze(fr){var Rr=m(fr[0]*fr[0]+fr[1]*fr[1]+fr[2]*fr[2]);fr[0]/=Rr,fr[1]/=Rr,fr[2]/=Rr}var Ye,st,ct,at,et,Pe,Ae,pe,Ne=S(),lt,dt,nt={point:Ft,lineStart:Qt,lineEnd:ar,polygonStart:function(){nt.point=Er,nt.lineStart=Mr,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(fr,Rr){lt.push(dt=[Ye=fr,ct=fr]),Rrat&&(at=Rr)}function Nt(fr,Rr){var vn=ie([fr*c,Rr*c]);if(pe){var an=Se(pe,vn),On=[an[1],-an[0],0],Aa=Se(On,an);ze(Aa),Aa=ae(Aa);var xa=fr-et,ti=xa>0?1:-1,ci=Aa[0]*f*ti,Ni,Ha=p(xa)>180;Ha^(ti*etat&&(at=Ni)):(ci=(ci+360)%360-180,Ha^(ti*etat&&(at=Rr))),Ha?frSr(Ye,ct)&&(ct=fr):Sr(fr,ct)>Sr(Ye,ct)&&(Ye=fr):ct>=Ye?(frct&&(ct=fr)):fr>et?Sr(Ye,fr)>Sr(Ye,ct)&&(ct=fr):Sr(fr,ct)>Sr(Ye,ct)&&(Ye=fr)}else lt.push(dt=[Ye=fr,ct=fr]);Rrat&&(at=Rr),pe=vn,et=fr}function Qt(){nt.point=Nt}function ar(){dt[0]=Ye,dt[1]=ct,nt.point=Ft,pe=null}function Er(fr,Rr){if(pe){var vn=fr-et;Ne.add(p(vn)>180?vn+(vn>0?360:-360):vn)}else Pe=fr,Ae=Rr;ee.point(fr,Rr),Nt(fr,Rr)}function Mr(){ee.lineStart()}function $r(){Er(Pe,Ae),ee.lineEnd(),p(Ne)>r&&(Ye=-(ct=180)),dt[0]=Ye,dt[1]=ct,pe=null}function Sr(fr,Rr){return(Rr-=fr)<0?Rr+360:Rr}function Nr(fr,Rr){return fr[0]-Rr[0]}function Mt(fr,Rr){return fr[0]<=fr[1]?fr[0]<=Rr&&Rr<=fr[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,vn=Aa.length-1,Rr=0,an=Aa[vn];Rr<=vn;an=On,++Rr)On=Aa[Rr],(ti=Sr(an[1],On[0]))>xa&&(xa=ti,Ye=On[0],ct=an[1])}return lt=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,Br,kn,Wn={sphere:L,point:Vn,lineStart:aa,lineEnd:Va,polygonStart:function(){Wn.lineStart=sr,Wn.lineEnd=qt},polygonEnd:function(){Wn.lineStart=aa,Wn.lineEnd=Va}};function Vn(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr);na(vn*l(fr),vn*_(fr),_(Rr))}function na(fr,Rr,vn){++Je,xe+=(fr-xe)/Je,ye+=(Rr-ye)/Je,Ee+=(vn-Ee)/Je}function aa(){Wn.point=Un}function Un(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr);vr=vn*l(fr),Br=vn*_(fr),kn=_(Rr),Wn.point=ka,na(vr,Br,kn)}function ka(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr),an=vn*l(fr),On=vn*_(fr),Aa=_(Rr),xa=T(m((xa=Br*Aa-kn*On)*xa+(xa=kn*an-vr*Aa)*xa+(xa=vr*On-Br*an)*xa),vr*an+Br*On+kn*Aa);ke+=xa,Xe+=xa*(vr+(vr=an)),Qe+=xa*(Br+(Br=On)),Lt+=xa*(kn+(kn=Aa)),na(vr,Br,kn)}function Va(){Wn.point=Vn}function sr(){Wn.point=or}function qt(){ur(xr,mr),Wn.point=Vn}function or(fr,Rr){xr=fr,mr=Rr,fr*=c,Rr*=c,Wn.point=ur;var vn=l(Rr);vr=vn*l(fr),Br=vn*_(fr),kn=_(Rr),na(vr,Br,kn)}function ur(fr,Rr){fr*=c,Rr*=c;var vn=l(Rr),an=vn*l(fr),On=vn*_(fr),Aa=_(Rr),xa=Br*Aa-kn*On,ti=kn*an-vr*Aa,ci=vr*On-Br*an,Ni=m(xa*xa+ti*ti+ci*ci),Ha=y(Ni),bi=Ni&&-Ha/Ni;Ct+=bi*xa,Ot+=bi*ti,Kt+=bi*ci,ke+=Ha,Xe+=Ha*(vr+(vr=an)),Qe+=Ha*(Br+(Br=On)),Lt+=Ha*(kn+(kn=Aa)),na(vr,Br,kn)}function Gr(fr){Je=ke=xe=ye=Ee=Xe=Qe=Lt=Ct=Ot=Kt=0,U(fr,Wn);var Rr=Ct,vn=Ot,an=Kt,On=Rr*Rr+vn*vn+an*an;return Onn?fr+Math.round(-fr/s)*s:fr,Rr]}Tn.invert=Tn;function Jn(fr,Rr,vn){return(fr%=s)?Rr||vn?mn(da(fr),_a(Rr,vn)):da(fr):Rr||vn?_a(Rr,vn):Tn}function ma(fr){return function(Rr,vn){return Rr+=fr,[Rr>n?Rr-s:Rr<-n?Rr+s:Rr,vn]}}function da(fr){var Rr=ma(fr);return Rr.invert=ma(-fr),Rr}function _a(fr,Rr){var vn=l(fr),an=_(fr),On=l(Rr),Aa=_(Rr);function xa(ti,ci){var Ni=l(ci),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(ci),Na=Qa*vn+Ha*an;return[T(bi*On-Na*Aa,Ha*vn-Qa*an),y(Na*On+bi*Aa)]}return xa.invert=function(ti,ci){var Ni=l(ci),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(ci),Na=Qa*On-bi*Aa;return[T(bi*On+Qa*Aa,Ha*vn+Na*an),y(Na*vn-Ha*an)]},xa}function Ca(fr){fr=Jn(fr[0]*c,fr[1]*c,fr.length>2?fr[2]*c:0);function Rr(vn){return vn=fr(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn}return Rr.invert=function(vn){return vn=fr.invert(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn},Rr}function Hn(fr,Rr,vn,an,On,Aa){if(vn){var xa=l(Rr),ti=_(Rr),ci=an*vn;On==null?(On=Rr+an*s,Aa=Rr-ci/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&&fr.push(fr.pop().concat(fr.shift()))},result:function(){var vn=fr;return fr=[],Rr=null,vn}}}function xt(fr,Rr){return p(fr[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(fr){if(Rr=fr.length){for(var Rr,vn=0,an=fr[0],On;++vn=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>=vn^Zi>=vn){var Cu=Se(ie(Qa),ie(jo));ze(Cu);var Mu=Se(Aa,Cu);ze(Mu);var Vl=(Wl^Al>=0?-1:1)*y(Mu[2]);(an>Vl||an===Vl&&(Cu[0]||Cu[1]))&&(ti+=Wl^Al>=0?1:-1)}}return(xa<-r||xa0){for(ci||(On.polygonStart(),ci=!0),On.lineStart(),Bs=0;Bs1&&Li&2&&ns.push(ns.pop().concat(ns.shift())),Ha.push(ns.filter(At))}}return Qa}}function At(fr){return fr.length>1}function lr(fr,Rr){return((fr=fr.x)[0]<0?fr[1]-i-r:i-fr[1])-((Rr=Rr.x)[0]<0?Rr[1]-i-r:i-Rr[1])}var zr=Jr(function(){return!0},un,qn,[-n,-i]);function un(fr){var Rr=NaN,vn=NaN,an=NaN,On;return{lineStart:function(){fr.lineStart(),On=1},point:function(Aa,xa){var ti=Aa>0?n:-n,ci=p(Aa-Rr);p(ci-n)0?i:-i),fr.point(an,vn),fr.lineEnd(),fr.lineStart(),fr.point(ti,vn),fr.point(Aa,vn),On=0):an!==ti&&ci>=n&&(p(Rr-an)r?v((_(Rr)*(Aa=l(an))*_(vn)-_(an)*(On=l(Rr))*_(fr))/(On*Aa*xa)):(Rr+an)/2}function qn(fr,Rr,vn,an){var On;if(fr==null)On=vn*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(fr[0]-Rr[0])>r){var Aa=fr[0]0,On=p(Rr)>r;function Aa(Ha,bi,Qa,Na){Hn(Na,fr,vn,Qa,Ha,bi)}function xa(Ha,bi){return l(Ha)*l(bi)>Rr}function ti(Ha){var bi,Qa,Na,Xi,No;return{lineStart:function(){Xi=Na=!1,No=1},point:function(Do,Go){var jo=[Do,Go],Zi,Li=xa(Do,Go),ns=an?Li?0:Ni(Do,Go):Li?Ni(Do+(Do<0?n:-n),Go):0;if(!bi&&(Xi=Na=Li)&&Ha.lineStart(),Li!==Na&&(Zi=ci(bi,jo),(!Zi||xt(bi,Zi)||xt(jo,Zi))&&(jo[2]=1)),Li!==Na)No=0,Li?(Ha.lineStart(),Zi=ci(jo,bi),Ha.point(Zi[0],Zi[1])):(Zi=ci(bi,jo),Ha.point(Zi[0],Zi[1],2),Ha.lineEnd()),bi=Zi;else if(On&&bi&&an^Li){var Bs;!(ns&Qa)&&(Bs=ci(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|(Xi&&Na)<<1}}}function ci(Ha,bi,Qa){var Na=ie(Ha),Xi=ie(bi),No=[1,0,0],Do=Se(Na,Xi),Go=de(Do,Do),jo=Do[0],Zi=Go-jo*jo;if(!Zi)return!Qa&&Ha;var Li=Rr*Go/Zi,ns=-Rr*jo/Zi,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),Vl=Fe(Ml,(-Wl-Mu)/rl);if(Le(Vl,Al),Vl=ae(Vl),!Qa)return Vl;var yo=Ha[0],ys=bi[0],Dl=Ha[1],ml=bi[1],gc;ys0^Vl[1]<(p(Vl[0]-yo)n^(yo<=Vl[0]&&Vl[0]<=ys)){var _c=Fe(Ml,(-Wl+Mu)/rl);return Le(_c,Al),[Vl,ae(_c)]}}}function Ni(Ha,bi){var Qa=an?fr:n-fr,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,-fr]:[-n,fr-n])}function cn(fr,Rr,vn,an,On,Aa){var xa=fr[0],ti=fr[1],ci=Rr[0],Ni=Rr[1],Ha=0,bi=1,Qa=ci-xa,Na=Ni-ti,Xi;if(Xi=vn-xa,!(!Qa&&Xi>0)){if(Xi/=Qa,Qa<0){if(Xi0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}if(Xi=On-xa,!(!Qa&&Xi<0)){if(Xi/=Qa,Qa<0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}else if(Qa>0){if(Xi0)){if(Xi/=Na,Na<0){if(Xi0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}if(Xi=Aa-ti,!(!Na&&Xi<0)){if(Xi/=Na,Na<0){if(Xi>bi)return;Xi>Ha&&(Ha=Xi)}else if(Na>0){if(Xi0&&(fr[0]=xa+Ha*Qa,fr[1]=ti+Ha*Na),bi<1&&(Rr[0]=xa+bi*Qa,Rr[1]=ti+bi*Na),!0}}}}}var In=1e9,gi=-In;function Ea(fr,Rr,vn,an){function On(Ni,Ha){return fr<=Ni&&Ni<=vn&&Rr<=Ha&&Ha<=an}function Aa(Ni,Ha,bi,Qa){var Na=0,Xi=0;if(Ni==null||(Na=xa(Ni,bi))!==(Xi=xa(Ha,bi))||ci(Ni,Ha)<0^bi>0)do Qa.point(Na===0||Na===3?fr:vn,Na>1?an:Rr);while((Na=(Na+bi+4)%4)!==Xi);else Qa.point(Ha[0],Ha[1])}function xa(Ni,Ha){return p(Ni[0]-fr)0?0:3:p(Ni[0]-vn)0?2:1:p(Ni[1]-Rr)0?1:0:Ha>0?3:2}function ti(Ni,Ha){return ci(Ni.x,Ha.x)}function ci(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,Xi,No,Do,Go,jo,Zi,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,Dl=Na.length;ysan&&(Lf-$f)*(an-_c)>(Lu-_c)*(fr-$f)&&++yo:Lu<=an&&(Lf-$f)*(an-_c)<(Lu-_c)*(fr-$f)&&--yo;return yo}function Wl(){Ha=bi,Qa=[],Na=[],Bs=!0}function rl(){var yo=Ml(),ys=Bs&&yo,Dl=(Qa=b.merge(Qa)).length;(ys||Dl)&&(Ni.polygonStart(),ys&&(Ni.lineStart(),Aa(null,null,1,Ni),Ni.lineEnd()),Dl&&jr(Qa,ti,yo,Aa,Ni),Ni.polygonEnd()),Ha=Ni,Qa=Na=Xi=null}function Cu(){Al.point=Vl,Na&&Na.push(Xi=[]),ns=!0,Li=!1,jo=Zi=NaN}function Mu(){Qa&&(Vl(No,Do),Go&&Li&&bi.rejoin(),Qa.push(bi.result())),Al.point=Zl,Li&&Ha.lineEnd()}function Vl(yo,ys){var Dl=On(yo,ys);if(Na&&Xi.push([yo,ys]),ns)No=yo,Do=ys,Go=Dl,ns=!1,Dl&&(Ha.lineStart(),Ha.point(yo,ys));else if(Dl&&Li)Ha.point(yo,ys);else{var ml=[jo=Math.max(gi,Math.min(In,jo)),Zi=Math.max(gi,Math.min(In,Zi))],gc=[yo=Math.max(gi,Math.min(In,yo)),ys=Math.max(gi,Math.min(In,ys))];cn(ml,gc,fr,Rr,vn,an)?(Li||(Ha.lineStart(),Ha.point(ml[0],ml[1])),Ha.point(gc[0],gc[1]),Dl||Ha.lineEnd(),Bs=!1):Dl&&(Ha.lineStart(),Ha.point(yo,ys),Bs=!1)}jo=yo,Zi=ys,Li=Dl}return Al}}function Ci(){var fr=0,Rr=0,vn=960,an=500,On,Aa,xa;return xa={stream:function(ti){return On&&Aa===ti?On:On=Ea(fr,Rr,vn,an)(Aa=ti)},extent:function(ti){return arguments.length?(fr=+ti[0][0],Rr=+ti[0][1],vn=+ti[1][0],an=+ti[1][1],On=Aa=null,xa):[[fr,Rr],[vn,an]]}}}var Hi=S(),so,io,Mo,fi={sphere:L,point:L,lineStart:ts,lineEnd:L,polygonStart:L,polygonEnd:L};function ts(){fi.point=Xs,fi.lineEnd=Ho}function Ho(){fi.point=fi.lineEnd=L}function Xs(fr,Rr){fr*=c,Rr*=c,so=fr,io=_(Rr),Mo=l(Rr),fi.point=cs}function cs(fr,Rr){fr*=c,Rr*=c;var vn=_(Rr),an=l(Rr),On=p(fr-so),Aa=l(On),xa=_(On),ti=an*xa,ci=Mo*vn-io*an*Aa,Ni=io*vn+Mo*an*Aa;Hi.add(T(m(ti*ti+ci*ci),Ni)),so=fr,io=vn,Mo=an}function Jo(fr){return Hi.reset(),U(fr,fi),+Hi}var Uo=[null,null],Ys={type:"LineString",coordinates:Uo};function Vs(fr,Rr){return Uo[0]=fr,Uo[1]=Rr,Jo(Ys)}var sl={Feature:function(fr,Rr){return Zo(fr.geometry,Rr)},FeatureCollection:function(fr,Rr){for(var vn=fr.features,an=-1,On=vn.length;++an0&&(On=Vs(fr[Aa],fr[Aa-1]),On>0&&vn<=On&&an<=On&&(vn+an-On)*(1-Math.pow((vn-an)/On,2))r}).map(Qa)).concat(b.range(g(Aa/Ni)*Ni,On,Ni).filter(function(Zi){return p(Zi%bi)>r}).map(Na))}return Go.lines=function(){return jo().map(function(Zi){return{type:"LineString",coordinates:Zi}})},Go.outline=function(){return{type:"Polygon",coordinates:[Xi(an).concat(No(xa).slice(1),Xi(vn).reverse().slice(1),No(ti).reverse().slice(1))]}},Go.extent=function(Zi){return arguments.length?Go.extentMajor(Zi).extentMinor(Zi):Go.extentMinor()},Go.extentMajor=function(Zi){return arguments.length?(an=+Zi[0][0],vn=+Zi[1][0],ti=+Zi[0][1],xa=+Zi[1][1],an>vn&&(Zi=an,an=vn,vn=Zi),ti>xa&&(Zi=ti,ti=xa,xa=Zi),Go.precision(Do)):[[an,ti],[vn,xa]]},Go.extentMinor=function(Zi){return arguments.length?(Rr=+Zi[0][0],fr=+Zi[1][0],Aa=+Zi[0][1],On=+Zi[1][1],Rr>fr&&(Zi=Rr,Rr=fr,fr=Zi),Aa>On&&(Zi=Aa,Aa=On,On=Zi),Go.precision(Do)):[[Rr,Aa],[fr,On]]},Go.step=function(Zi){return arguments.length?Go.stepMajor(Zi).stepMinor(Zi):Go.stepMinor()},Go.stepMajor=function(Zi){return arguments.length?(Ha=+Zi[0],bi=+Zi[1],Go):[Ha,bi]},Go.stepMinor=function(Zi){return arguments.length?(ci=+Zi[0],Ni=+Zi[1],Go):[ci,Ni]},Go.precision=function(Zi){return arguments.length?(Do=+Zi,Qa=di(Aa,On,90),Na=to(Rr,fr,Do),Xi=di(ti,xa,90),No=to(an,vn,Do),Go):Do},Go.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ps(){return Cl()()}function Fo(fr,Rr){var vn=fr[0]*c,an=fr[1]*c,On=Rr[0]*c,Aa=Rr[1]*c,xa=l(an),ti=_(an),ci=l(Aa),Ni=_(Aa),Ha=xa*l(vn),bi=xa*_(vn),Qa=ci*l(On),Na=ci*_(On),Xi=2*y(m(I(Aa-an)+xa*ci*I(On-vn))),No=_(Xi),Do=Xi?function(Go){var jo=_(Go*=Xi)/No,Zi=_(Xi-Go)/No,Li=Zi*Ha+jo*Qa,ns=Zi*bi+jo*Na,Bs=Zi*ti+jo*Ni;return[T(ns,Li)*f,T(Bs,m(Li*Li+ns*ns))*f]}:function(){return[vn*f,an*f]};return Do.distance=Xi,Do}function Rl(fr){return fr}var Zs=S(),ul=S(),Au,Ji,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(ul)),ul.reset()},result:function(){var fr=Zs/2;return Zs.reset(),fr}};function Yl(){Xl.point=Io}function Io(fr,Rr){Xl.point=cu,Au=gs=fr,Ji=rs=Rr}function cu(fr,Rr){ul.add(rs*fr-gs*Rr),gs=fr,rs=Rr}function vu(){cu(Au,Ji)}var Os=1/0,wl=Os,Fl=-Os,ql=Fl,Yu={point:df,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var fr=[[Os,wl],[Fl,ql]];return Fl=ql=-(wl=Os=1/0),fr}};function df(fr,Rr){frFl&&(Fl=fr),Rrql&&(ql=Rr)}var Xc=0,rf=0,Dh=0,wh=0,Tl=0,Ic=0,zh=0,oc=0,Zu=0,sc,nf,Jl,Wu,Hs={point:Il,lineStart:Mf,lineEnd:fu,polygonStart:function(){Hs.lineStart=Sd,Hs.lineEnd=Fs},polygonEnd:function(){Hs.point=Il,Hs.lineStart=Mf,Hs.lineEnd=fu},result:function(){var fr=Zu?[zh/Zu,oc/Zu]:Ic?[wh/Ic,Tl/Ic]:Dh?[Xc/Dh,rf/Dh]:[NaN,NaN];return Xc=rf=Dh=wh=Tl=Ic=zh=oc=Zu=0,fr}};function Il(fr,Rr){Xc+=fr,rf+=Rr,++Dh}function Mf(){Hs.point=bc}function bc(fr,Rr){Hs.point=Ff,Il(Jl=fr,Wu=Rr)}function Ff(fr,Rr){var vn=fr-Jl,an=Rr-Wu,On=m(vn*vn+an*an);wh+=On*(Jl+fr)/2,Tl+=On*(Wu+Rr)/2,Ic+=On,Il(Jl=fr,Wu=Rr)}function fu(){Hs.point=Il}function Sd(){Hs.point=Vd}function Fs(){pl(sc,nf)}function Vd(fr,Rr){Hs.point=pl,Il(sc=Jl=fr,nf=Wu=Rr)}function pl(fr,Rr){var vn=fr-Jl,an=Rr-Wu,On=m(vn*vn+an*an);wh+=On*(Jl+fr)/2,Tl+=On*(Wu+Rr)/2,Ic+=On,On=Wu*fr-Jl*Rr,zh+=On*(Jl+fr),oc+=On*(Wu+Rr),Zu+=On*3,Il(Jl=fr,Wu=Rr)}function Oo(fr){this._context=fr}Oo.prototype={_radius:4.5,pointRadius:function(fr){return this._radius=fr,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(fr,Rr){switch(this._point){case 0:{this._context.moveTo(fr,Rr),this._point=1;break}case 1:{this._context.lineTo(fr,Rr);break}default:{this._context.moveTo(fr+this._radius,Rr),this._context.arc(fr,Rr,this._radius,0,s);break}}},result:L};var th=S(),af,Ou,Oh,Bf,uh,$u={point:L,lineStart:function(){$u.point=fd},lineEnd:function(){af&&Hh(Ou,Oh),$u.point=L},polygonStart:function(){af=!0},polygonEnd:function(){af=null},result:function(){var fr=+th;return th.reset(),fr}};function fd(fr,Rr){$u.point=Hh,Ou=Bf=fr,Oh=uh=Rr}function Hh(fr,Rr){Bf-=fr,uh-=Rr,th.add(m(Bf*Bf+uh*uh)),Bf=fr,uh=Rr}function ch(){this._string=[]}ch.prototype={_radius:4.5,_circle:Nf(4.5),pointRadius:function(fr){return(fr=+fr)!==this._radius&&(this._radius=fr,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(fr,Rr){switch(this._point){case 0:{this._string.push("M",fr,",",Rr),this._point=1;break}case 1:{this._string.push("L",fr,",",Rr);break}default:{this._circle==null&&(this._circle=Nf(this._radius)),this._string.push("M",fr,",",Rr,this._circle);break}}},result:function(){if(this._string.length){var fr=this._string.join("");return this._string=[],fr}else return null}};function Nf(fr){return"m0,"+fr+"a"+fr+","+fr+" 0 1,1 0,"+-2*fr+"a"+fr+","+fr+" 0 1,1 0,"+2*fr+"z"}function Fh(fr,Rr){var vn=4.5,an,On;function Aa(xa){return xa&&(typeof vn=="function"&&On.pointRadius(+vn.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($u)),$u.result()},Aa.bounds=function(xa){return U(xa,an(Yu)),Yu.result()},Aa.centroid=function(xa){return U(xa,an(Hs)),Hs.result()},Aa.projection=function(xa){return arguments.length?(an=xa==null?(fr=null,Rl):(fr=xa).stream,Aa):fr},Aa.context=function(xa){return arguments.length?(On=xa==null?(Rr=null,new ch):new Oo(Rr=xa),typeof vn!="function"&&On.pointRadius(vn),Aa):Rr},Aa.pointRadius=function(xa){return arguments.length?(vn=typeof xa=="function"?xa:(On.pointRadius(+xa),+xa),Aa):vn},Aa.projection(fr).context(Rr)}function Bh(fr){return{stream:of(fr)}}function of(fr){return function(Rr){var vn=new Gh;for(var an in fr)vn[an]=fr[an];return vn.stream=Rr,vn}}function Gh(){}Gh.prototype={constructor:Gh,point:function(fr,Rr){this.stream.point(fr,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(fr,Rr,vn){var an=fr.clipExtent&&fr.clipExtent();return fr.scale(150).translate([0,0]),an!=null&&fr.clipExtent(null),U(vn,fr.stream(Yu)),Rr(Yu.result()),an!=null&&fr.clipExtent(an),fr}function vf(fr,Rr,vn){return Ef(fr,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,ci=+Rr[0][1]+(Aa-xa*(an[1][1]+an[0][1]))/2;fr.scale(150*xa).translate([ti,ci])},vn)}function Ku(fr,Rr,vn){return vf(fr,[[0,0],Rr],vn)}function Wf(fr,Rr,vn){return Ef(fr,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];fr.scale(150*Aa).translate([xa,ti])},vn)}function Nh(fr,Rr,vn){return Ef(fr,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;fr.scale(150*Aa).translate([xa,ti])},vn)}var Bl=16,Th=l(30*c);function Md(fr,Rr){return+Rr?fh(fr,Rr):Xh(fr)}function Xh(fr){return of({point:function(Rr,vn){Rr=fr(Rr,vn),this.stream.point(Rr[0],Rr[1])}})}function fh(fr,Rr){function vn(an,On,Aa,xa,ti,ci,Ni,Ha,bi,Qa,Na,Xi,No,Do){var Go=Ni-an,jo=Ha-On,Zi=Go*Go+jo*jo;if(Zi>4*Rr&&No--){var Li=xa+Qa,ns=ti+Na,Bs=ci+Xi,Al=m(Li*Li+ns*ns+Bs*Bs),Zl=y(Bs/=Al),Ml=p(p(Bs)-1)Rr||p((Go*Mu+jo*Vl)/Zi-.5)>.3||xa*Qa+ti*Na+ci*Xi2?yo[2]%360*c:0,Mu()):[ti*f,ci*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),Vl()):m(ns)},rl.fitExtent=function(yo,ys){return vf(rl,yo,ys)},rl.fitSize=function(yo,ys){return Ku(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(vn,0,0,Qa,Na,bi).apply(null,Rr(Aa,xa)),ys=(bi?wu:Zh)(vn,an-yo[0],On-yo[1],Qa,Na,bi);return Ha=Jn(ti,ci,Ni),Al=mn(Rr,ys),Zl=mn(Ha,Al),Bs=Md(Al,ns),Vl()}function Vl(){return Ml=Wl=null,rl}return function(){return Rr=fr.apply(this,arguments),rl.invert=Rr.invert&&Cu,Mu()}}function Ql(fr){var Rr=0,vn=n/3,an=Uf(fr),On=an(Rr,vn);return On.parallels=function(Aa){return arguments.length?an(Rr=Aa[0]*c,vn=Aa[1]*c):[Rr*f,vn*f]},On}function kf(fr){var Rr=l(fr);function vn(an,On){return[an*Rr,_(On)/Rr]}return vn.invert=function(an,On){return[an/Rr,y(On*Rr)]},vn}function mc(fr,Rr){var vn=_(fr),an=(vn+_(Rr))/2;if(p(an)=.12&&Do<.234&&No>=-.425&&No<-.214?On:Do>=.166&&Do<.234&&No>=-.214&&No<-.115?xa:vn).invert(Qa)},Ha.stream=function(Qa){return fr&&Rr===Qa?fr:fr=rh([vn.stream(Rr=Qa),On.stream(Qa),xa.stream(Qa)])},Ha.precision=function(Qa){return arguments.length?(vn.precision(Qa),On.precision(Qa),xa.precision(Qa),bi()):vn.precision()},Ha.scale=function(Qa){return arguments.length?(vn.scale(Qa),On.scale(Qa*.35),xa.scale(Qa),Ha.translate(vn.translate())):vn.scale()},Ha.translate=function(Qa){if(!arguments.length)return vn.translate();var Na=vn.scale(),Xi=+Qa[0],No=+Qa[1];return an=vn.translate(Qa).clipExtent([[Xi-.455*Na,No-.238*Na],[Xi+.455*Na,No+.238*Na]]).stream(Ni),Aa=On.translate([Xi-.307*Na,No+.201*Na]).clipExtent([[Xi-.425*Na+r,No+.12*Na+r],[Xi-.214*Na-r,No+.234*Na-r]]).stream(Ni),ti=xa.translate([Xi-.205*Na,No+.212*Na]).clipExtent([[Xi-.214*Na+r,No+.166*Na+r],[Xi-.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 Ku(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 fr=Rr=null,Ha}return Ha.scale(1070)}function jf(fr){return function(Rr,vn){var an=l(Rr),On=l(vn),Aa=fr(an*On);return[Aa*On*_(Rr),Aa*_(vn)]}}function Ah(fr){return function(Rr,vn){var an=m(Rr*Rr+vn*vn),On=fr(an),Aa=_(On),xa=l(On);return[T(Rr*Aa,an*xa),y(an&&vn*Aa/an)]}}var Ed=jf(function(fr){return m(2/(1+fr))});Ed.invert=Ah(function(fr){return 2*y(fr/2)});function ev(){return zc(Ed).scale(124.75).clipAngle(180-.001)}var nh=jf(function(fr){return(fr=d(fr))&&fr/_(fr)});nh.invert=Ah(function(fr){return fr});function Sh(){return zc(nh).scale(79.4188).clipAngle(180-.001)}function Yc(fr,Rr){return[fr,A(u((i+Rr)/2))]}Yc.invert=function(fr,Rr){return[fr,2*v(x(Rr))-i]};function Mh(){return lc(Yc).scale(961/s)}function lc(fr){var Rr=zc(fr),vn=Rr.center,an=Rr.scale,On=Rr.translate,Aa=Rr.clipExtent,xa=null,ti,ci,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?(vn(bi),Ha()):vn()},Rr.clipExtent=function(bi){return arguments.length?(bi==null?xa=ti=ci=Ni=null:(xa=+bi[0][0],ti=+bi[0][1],ci=+bi[1][0],Ni=+bi[1][1]),Ha()):xa==null?null:[[xa,ti],[ci,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]]:fr===Yc?[[Math.max(Qa[0]-bi,xa),ti],[Math.min(Qa[0]+bi,ci),Ni]]:[[xa,Math.max(Qa[1]-bi,ti)],[ci,Math.min(Qa[1]+bi,Ni)]])}return Ha()}function ah(fr){return u((i+fr)/2)}function Wh(fr,Rr){var vn=l(fr),an=fr===Rr?_(fr):A(vn/l(Rr))/A(ah(Rr)/ah(fr)),On=vn*M(ah(fr),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 ci=On/M(ah(ti),an);return[ci*_(an*xa),On-ci*l(an*xa)]}return Aa.invert=function(xa,ti){var ci=On-ti,Ni=w(an)*m(xa*xa+ci*ci),Ha=T(xa,p(ci))*w(ci);return ci*an<0&&(Ha-=n*w(xa)*w(ci)),[Ha/an,2*v(M(On/Ni,1/an))-i]},Aa}function ih(){return Ql(Wh).scale(109.5).parallels([30,30])}function au(fr,Rr){return[fr,Rr]}au.invert=au;function Fc(){return zc(au).scale(152.63)}function sf(fr,Rr){var vn=l(fr),an=fr===Rr?_(fr):(vn-l(Rr))/(Rr-fr),On=vn/an+fr;if(p(an)r&&--an>0);return[fr/(.8707+(Aa=vn*vn)*(-.131979+Aa*(-.013791+Aa*Aa*Aa*(.003971-.001529*Aa)))),vn]};function gf(){return zc(Cf).scale(175.295)}function Su(fr,Rr){return[l(Rr)*_(fr),_(Rr)]}Su.invert=Ah(y);function wc(){return zc(Su).scale(249.5).clipAngle(90+r)}function pu(fr,Rr){var vn=l(Rr),an=1+l(fr)*vn;return[vn*_(fr)/an,_(Rr)/an]}pu.invert=Ah(function(fr){return 2*v(fr)});function Vf(){return zc(pu).scale(250).clipAngle(142)}function yf(fr,Rr){return[A(u((i+Rr)/2)),-fr]}yf.invert=function(fr,Rr){return[-Rr,2*v(x(fr))-i]};function jh(){var fr=lc(yf),Rr=fr.center,vn=fr.rotate;return fr.center=function(an){return arguments.length?Rr([-an[1],an[0]]):(an=Rr(),[an[1],-an[0]])},fr.rotate=function(an){return arguments.length?vn([an[0],an[1],an.length>2?an[2]+90:90]):(an=vn(),[an[0],an[1],an[2]-90])},vn([0,0,90]).scale(159.155)}h.geoAlbers=hu,h.geoAlbersUsa=pf,h.geoArea=H,h.geoAzimuthalEqualArea=ev,h.geoAzimuthalEqualAreaRaw=Ed,h.geoAzimuthalEquidistant=Sh,h.geoAzimuthalEquidistantRaw=nh,h.geoBounds=je,h.geoCentroid=Gr,h.geoCircle=Mi,h.geoClipAntimeridian=zr,h.geoClipCircle=jn,h.geoClipExtent=Ci,h.geoClipRectangle=Ea,h.geoConicConformal=ih,h.geoConicConformalRaw=Wh,h.geoConicEqualArea=Oc,h.geoConicEqualAreaRaw=mc,h.geoConicEquidistant=Uh,h.geoConicEquidistantRaw=sf,h.geoContains=Ms,h.geoDistance=Vs,h.geoEqualEarth=kd,h.geoEqualEarthRaw=vh,h.geoEquirectangular=Fc,h.geoEquirectangularRaw=au,h.geoGnomonic=$h,h.geoGnomonicRaw=fc,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=wc,h.geoOrthographicRaw=Su,h.geoPath=Fh,h.geoProjection=zc,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})})}}),AI=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,LC(),QA()):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,on=r(Yr),En=v(Yr),Pn=En/on,Xn=-i(E(on));gr-=Pr=(2/Pn*Xn-vt*Pn-Ut)/(-Xn/(En*En)+1-vt/(2*on*on))*(on<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),on=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,Wi=ri*(En*Pn+Ta*Pr*gr*on),To=ri*(.5*Et*Yr-Ta*2*Tr*Ut),ho=ri*.25*(Yr*Ut-Ta*Tr*En*Et),Wo=ri*(on*gr+Ta*Pn*Pr),Js=To*ho-Wo*Wi;if(!Js)break;var Qs=(ni*To-Wa*Wo)/Js,Es=(Wa*ho-ni*Wi)/Js;vt-=Qs,bt-=Es}while((E(Qs)>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,on=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,Wi=ri*En/2,To=-Pn*Ta,ho=tt*ri*Pn/2,Wo=vt*Xn+tt*En*Ta,Js=To*ho-Wo*Wi,Qs=(ni*To-Wa*Wo)/Js/2,Es=(Wa*ho-ni*Wi)/Js;E(Es)>2&&(Es/=2),Pr-=Qs,Yr-=Es}while((E(Qs)>l||E(Es)>l)&&--on>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 on=tt*-180;tt*on<180;on+=tt*90)Pr.point(on,tt*90);if(Ze)for(;tt*(on-=3*tt*Yr)>=-180;)Pr.point(on,tt*-t(r(on*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 on=0,En=360/Ze,Pn=2*x/Ze,Xn=90-180/Ze,Ta=A;on0&&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),Wi=(Wa[0]-on[0])/Ta,To=(Wa[1]-on[1])/Ta,ho=(ni[0]-on[0])/ri,Wo=(ni[1]-on[1])/ri,Js=Wo*Wi-To*ho,Qs=(E(Js)<.5?.5:1)/Js;if(Tr=(Pn*ho-En*Wo)*Qs,Pr=(En*To-Pn*Wi)*Qs,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 lt(){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 Er(){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 Mr=at(1,4/x,x);function $r(){return b.geoProjection(Mr).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 Nr(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=Nr(bt[0].v[0],bt[2].v[0],bt[1].v[0]),Tr=Nr(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 on(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 Wi=Yr.slice();for(Wa=0;Wa<3;++Wa){var To=Wa==2?0:Wa+1,ho=Nr(bt[Wa].v[0],ri[Wa][0],ri[To][0]);ri[Wa][1]<0&&(ho=-ho),Wa?Wa==1?(ho=Tr-ho,Wi[0]-=ri[Wa][0]*r(ho),Wi[1]-=ri[Wa][0]*v(ho)):(ho=Pr-ho,Wi[0]+=ri[Wa][0]*r(ho),Wi[1]+=ri[Wa][0]*v(ho)):(Wi[0]+=ri[Wa][0]*r(ho),Wi[1]-=ri[Wa][0]*v(ho))}return Wi[0]/=3,Wi[1]/=3,Wi}return on}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 Br(Ze,tt){var vt=F(8/(3*x));return[vt*Ze*(1-E(tt)/x),vt*tt]}Br.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(Br).scale(165.664)}function Wn(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)]}Wn.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(Wn).scale(165.664)}function na(Ze,tt){var vt=F(x*(4+x));return[2/vt*Ze*(1+F(1-4*tt*tt/(x*x))),4/vt*tt]}na.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 aa(){return b.geoProjection(na).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 qt(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]}qt.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(qt).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),on=r(gr),En=r(bt),Pn=F(En),Xn=Yr/(on+w*Pr*Pn),Ta=Xn*Xn,ri=F(2/(1+Ta)),Wa=w*on+(Pr+Tr)*Pn,ni=w*on+(Pr-Tr)*Pn,Wi=Wa/ni,To=F(Wi),ho=To-1/To,Wo=To+1/To,Js=ri*ho-2*i(To)-Ze,Qs=ri*Xn*Wo-2*e(Xn)-tt,Es=Yr&&_*Pn*Tr*Ta/Yr,al=(w*Pr*on+Pn)/(2*(on+w*Pr*Pn)*(on+w*Pr*Pn)*Pn),mu=-.5*Xn*ri*ri*ri,iu=mu*Es,ks=mu*al,Cs=(Cs=2*on+w*Pn*(Pr-Tr))*Cs*To,Ru=(w*Pr*on*Pn+En)/Cs,uc=-(w*Tr*Yr)/(Pn*Cs),Nc=ho*iu-2*Ru/To+ri*(Ru+Ru/Wi),ge=ho*ks-2*uc/To+ri*(uc+uc/Wi),Oe=Xn*Wo*iu-2*Es/(1+Ta)+ri*Wo*Es+ri*Xn*(Ru-Ru/Wi),rt=Xn*Wo*ks-2*al/(1+Ta)+ri*Wo*al+ri*Xn*(uc-uc/Wi),wt=ge*Oe-rt*Nc;if(!wt)break;var St=(Qs*ge-Js*rt)/wt,It=(Js*Oe-Qs*Nc)/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 on=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=on;var Wi=50,To;do Tr-=To=(Ze+Cr(Wa,Ta,Tr)*ni-on)/(Wa(Tr)*ni);while(E(To)>l&&--Wi>0);Pr=Xn*v(Tr),Trbt){var Tr=F(gr),Pr=t(Ut,Et),Yr=vt*c(Pr/vt),on=Pr-Yr;Et=Tr*r(on),Ut=Tr*v(on);for(var En=Et-A,Pn=v(Et),Xn=Ut/Pn,Ta=Etl||E(Xn)>l)&&--Ta>0);return[on,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 ln=Vr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return b.geoProjection(ln).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 un(){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 cn(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}cn.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,on=F(Yr),En=Yr*Et,Pn=F(En),Xn=on*gr,Ta,ri;if(Ze===0)return[0,-(Xn+bt*Pn)];var Wa=r(tt),ni=1/Wa,Wi=2*vt*Wa,To=(-3*bt+Tr*Ut)*Wi,ho=(-Pr*Wa-(1-vt)*To)/(Pr*Pr),Wo=.5*ho/on,Js=gr*Wo-2*bt*on*Wi,Qs=bt*Et*ho+Yr*Ut*Wi,Es=-ni*Wi,al=-ni*Qs,mu=-2*ni*Js,iu=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),Nc=Ta*(mu+Es*uc)+al*L(Ta/Pn)-iu;if(!Nc)break;Nc<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+al*L(Ta/Pn)-iu,St=rt+(al-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,on=F(Yr),En=Yr*(1+Ut),Pn=on*(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),Wi=1/ni,To=2*gr*ni,ho=(-3*zt+Tr*(1+3*Ut))*To,Wo=(-Pr*ni-(1-gr)*ho)/(Pr*Pr),Js=.5*Wo/on,Qs=(1-Ut)*Js-2*zt*on*To,Es=-2*Wi*Qs,al=-Wi*To,mu=-Wi*(zt*(1+Ut)*Wo+Yr*(1+3*Ut)*To);return[x/4*(Ze*(Es+al*Ta)+mu*L(Ze/F(En))),Wa]}function Ea(){return b.geoProjection(jn(cn)).scale(239.75)}function Ci(Ze,tt,vt){var bt,zt,Et;return Ze?(bt=Hi(Ze,vt),tt?(zt=Hi(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=Hi(tt,1-vt),[[0,zt[0]/zt[1]],[1/zt[1],0],[zt[2]/zt[1],0]])}function Hi(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=fi(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 fi(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),on=z(tt*Tr+vt*Pr*Yr),En=v(on),Pn=E(En)>l?on/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,on=-Ut*Tr,En=gr*tt,Pn=F(Yr*Yr+on*on-En*En),Xn=t(Yr*En+on*Pn,on*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,on;for(Ut.lineStart();++Yr=0;)Ut.point((on=Tr[Yr])[0],on[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 sl(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,on){var En,Pn=E(on);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,on<0&&(En[1]=-En[1])}else En=Vs(Yr,on);return En[0]*=gr,En[1]/=Tr,En}return Pr.invert=function(Yr,on){Yr/=gr,on*=Tr;var En=E(on);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,on<0&&(Xn[1]=-Xn[1]),Xn}return Vs.invert(Yr,on)},Pr}function fs(Ze,tt){return[Ze,tt&1?90-l:Ys]}function Zo(Ze,tt){return[Ze,tt&1?-90+l:-Ys]}function vo(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(vo):tt]}}function ll(){var Ze=4,tt=b.geoProjectionMutator(sl),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,on){var En=1-v(on),Pn,Xn;if(En&&En<2){var Ta=A-on,ri=25,Wa;do{var ni=v(Ta),Wi=r(Ta),To=bt+t(ni,tt-Wi),ho=1+Tr-2*tt*Wi;Ta-=Wa=(Ta-gr*bt-tt*ni+ho*To-.5*En*Et)/(2*tt*ni*To)}while(E(Wa)>g&&--ri>0);Pn=zt*F(ho),Xn=Yr*To/x}else Pn=zt*(Ze+En),Xn=Yr*bt/x;return[Pn*v(Xn),Ut-Pn*r(Xn)]}return Pr.invert=function(Yr,on){var En=Yr*Yr+(on-=Ut)*on,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 Pl(){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,di=.0528035274542;function to(Ze,tt){return tt>-Ms?(Ze=et(Ze,tt),Ze[1]+=di,Ze):nt(Ze,tt)}to.invert=function(Ze,tt){return tt>-Ms?et.invert(Ze,tt-di):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?di:-di,Ze):nt(Ze,tt)}Ps.invert=function(Ze,tt){return E(tt)>Ms?et.invert(Ze,tt+(tt>0?di:-di)):nt.invert(Ze,tt)};function Fo(){return b.geoProjection(Ps).scale(152.63)}function Rl(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(on){return F(1+Ze*r(2*on)+tt*r(4*on))}function Tr(on){var En=on*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(on){return gr(on)*v(on)}var Yr=function(on,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*on/x*r(Pn),Xn/Et*v(Pn)]};return Yr.invert=function(on,En){var Pn=Fe(Pr,En*Et/zt);return[on*x/(r(Pn)*zt*Et*gr(Pn)),L(vt*Tr(Pn/vt)/Ut)]},vt===0&&(zt=F(bt/x),Yr=function(on,En){return[on*zt,v(En)/zt]},Yr.invert=function(on,En){return[on/zt,L(En*zt)]}),Yr}function Zs(){var Ze=1,tt=0,vt=45*y,bt=2,zt=b.geoProjectionMutator(Rl),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 ul(Ze,tt,vt,bt,zt,Et,Ut,gr,Tr,Pr,Yr){if(Yr.nanEncountered)return NaN;var on,En,Pn,Xn,Ta,ri,Wa,ni,Wi,To;if(on=vt-tt,En=Ze(tt+on*.25),Pn=Ze(vt-on*.25),isNaN(En)){Yr.nanEncountered=!0;return}if(isNaN(Pn)){Yr.nanEncountered=!0;return}return Xn=on*(bt+4*En+zt)/12,Ta=on*(zt+4*Pn+Et)/12,ri=Xn+Ta,To=(ri-Ut)/15,Pr>Tr?(Yr.maxDepthCount++,ri+To):Math.abs(To)>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 on=2*Yr(1)/x*Et/vt,En=function(Pn,Xn){var Ta=Yr(E(v(Xn))),ri=bt(Ta)*Pn;return Ta/=on,[ri,Xn>=0?Ta:-Ta]};return En.invert=function(Pn,Xn){var Ta;return Xn*=on,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(Ji),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,on=tt[+(Pr<0)],En=0,Pn=on.length-1;Enon[En][2][0];++En);var Xn=Ze(Tr-on[En][1][0],Pr);return Xn[0]+=Ze(on[En][1][0],Yr*Pr>Yr*on[En][0][1]?on[En][0][1]:Pr)[0],Xn}vt?Et.invert=vt(Et):Ze.invert&&(Et.invert=function(Tr,Pr){for(var Yr=zt[+(Pr<0)],on=tt[+(Pr<0)],En=0,Pn=Yr.length;EnXn&&(Ta=Pn,Pn=Xn,Xn=Ta),[[on,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 Fl=[[[[-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 ql(){return Io(et,Fl).scale(169.529)}var Yu=[[[[-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,Yu).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 Ic(){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 Zu=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 Wu(){return b.geoProjection(Jl).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 Il(){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],on=Yr[0]+gr*(Pn=on)-Tr*En,En=Yr[1]+gr*En+Tr*Pn;return on=gr*(Pn=on)-Tr*En,En=gr*En+Tr*Pn,[on,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],on=Pr[1],En=0,Pn=0,Xn;--Tr>=0;)Pr=Ze[Tr],En=Yr+Ut*(Xn=En)-gr*Pn,Pn=on+Ut*Pn+gr*Xn,Yr=Pr[0]+Ut*(Xn=Yr)-gr*on,on=Pr[1]+Ut*on+gr*Xn;En=Yr+Ut*(Xn=En)-gr*Pn,Pn=on+Ut*Pn+gr*Xn,Yr=Ut*(Xn=Yr)-gr*on-bt,on=Ut*on+gr*Xn-zt;var Ta=En*En+Pn*Pn,ri,Wa;Ut-=ri=(Yr*En+on*Pn)/Ta,gr-=Wa=(on*En-Yr*Pn)/Ta}while(E(ri)+E(Wa)>l*l&&--Et>0);if(Et){var ni=F(Ut*Ut+gr*gr),Wi=2*e(ni*.5),To=v(Wi);return[t(Ut*To,ni*r(Wi)),ni?L(gr*To/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 $u(Fs,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ou(){return $u(Vd,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Oh(){return $u(pl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Bf(){return $u(Oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function uh(){return $u(th,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function $u(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 Ku(Ze,tt){return[Ze*(1+r(tt))/2,2*(tt-T(tt/2))]}Ku.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(Ku).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 Bl(){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,on=1+Pr/Tr,En=(Et*vt/gr-Et/2)/Yr,Pn=(Pr*vt/Tr+gr/2)/on,Xn=En*En+bt*bt/Yr,Ta=Pn*Pn-(Pr*vt*vt/Tr+gr*vt-1)/on;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,Dc=.02406,Zh=Xh,wu=5*fh,zc=7*Yh,Uf=9*Dc,Ql=1.790857183;function kf(Ze,tt){var vt=tt*tt;return[Ze,tt*(Xh+vt*vt*(fh+vt*(Yh+Dc*vt)))]}kf.invert=function(Ze,tt){tt>Ql?tt=Ql:tt<-Ql&&(tt=-Ql);var vt=tt,bt;do{var zt=vt*vt;vt-=bt=(vt*(Xh+zt*zt*(fh+zt*(Yh+Dc*zt)))-tt)/(Zh+zt*zt*(wu+zt*(zc+Uf*zt)))}while(E(bt)>l);return[Ze,vt]};function mc(){return b.geoProjection(kf).scale(139.319)}function Oc(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 fc(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=[],wc=[],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&&(wc.push(Su),Su=[])},result:function(){var Ze=wc.length?wc.length<2?{type:"LineString",coordinates:wc[0]}:{type:"MultiLineString",coordinates:wc}:null;return wc=[],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);wc.push(Su),Su=[]}},polygonEnd:mf,result:function(){if(!wc.length)return null;var Ze=[],tt=[];return wc.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])}),wc=[],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,on=-Pr*zt+(Et>0?1:-1)*Tr;Et=(-Yr-on)*_,Ut=(Yr-on)*_}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 fr(){return jh(cn).scale(176.423)}function Rr(){return jh(Mo).scale(111.48)}function vn(Ze,tt){if(!(0<=(tt=+tt)&&tt<=20))throw new Error("invalid digits");function vt(Pr){var Yr=Pr.length,on=2,En=new Array(Yr);for(En[0]=+Pr[0].toFixed(tt),En[1]=+Pr[1].toFixed(tt);on2||Pn[0]!=Yr[0]||Pn[1]!=Yr[1])&&(on.push(Pn),Yr=Pn)}return on.length===1&&Pr.length>1&&on.push(vt(Pr[Pr.length-1])),on}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,on=2*(E(vt)-gr)/Pr,En=Yr/Pr,Pn=on*(1-En*on*(1-2*En*on));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 ci(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=ci(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,Xi=Na+bi,No=180,Do=No-bi,Go=-90,jo=Go+bi,Zi=90,Li=Zi-bi;function ns(Ze){return Ze.length>0}function Bs(Ze){return Math.floor(Ze*Qa)/Qa}function Al(Ze){return Ze===Go||Ze===Zi?[0,Ze]:[Na,Bs(Ze)]}function Zl(Ze){var tt=Ze[0],vt=Ze[1],bt=!1;return tt<=Xi?(tt=Na,bt=!0):tt>=Do&&(tt=No,bt=!0),vt<=jo?(vt=Go,bt=!0):vt>=Li&&(vt=Zi,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 on=Ut+1;onXi&&Pnjo&&Xn=gr)break;vt.push({index:-1,polygon:tt,ring:Et=Et.slice(on-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),on=Pr.center;return delete Pr.rotate,Pr.center=function(En){return arguments.length?on(Yr(En)):Yr.invert(on())},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 gc(){return yc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function yc(Ze,tt){return Dl(ml,Ze,tt)}function Tc(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)),on=Tr<0?-1:1;return Pr*=Pr,Yr*=Yr,[(Pr-Yr)/(2*Ze),on*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)),on=r(F(Pr+(En=gr+vt)*En)),En,Pn;return[t(Pn=Yr-on,En=(Yr+on)*zt),(Tr<0?-1:1)*z(F(En*En+Pn*Pn)*Et)]},Ut}function $f(){return _c([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function _c(Ze,tt){return Dl(Tc,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 Bc(){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),on=2*L(Yr/2);return[t(Ut*T(on),Ze*Yr)/zt,Yr&&L(gr*v(on)/(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)),on=Yr/F(Pr*Tr*gr),En=1/(Yr*F(Pr*Tr*gr));return Ue(on,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 Gt(Ze,tt){return[Ze*F(1-3*tt*tt/(x*x)),tt]}Gt.invert=function(Ze,tt){return[Ze/F(1-3*tt*tt/(x*x)),tt]};function hr(){return b.geoProjection(Gt).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 en(Ze,tt){var vt=fe(Ze,tt);return[(vt[0]+Ze/A)/2,(vt[1]+tt)/2]}en.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),on=r(vt/2),En=v(vt/2),Pn=En*En,Xn=1-Pr*on*on,Ta=Xn?z(Et*on)*F(ri=1/Xn):ri=0,ri,Wa=.5*(2*Ta*Et*En+vt/A)-Ze,ni=.5*(Ta*Ut+bt)-tt,Wi=.5*ri*(Pr*Pn+Ta*Et*on*Tr)+.5/A,To=ri*(Yr*gr/4-Ta*Ut*En),ho=.125*ri*(gr*En-Ta*Ut*Pr*Yr),Wo=.5*ri*(Tr*on+Ta*Pn*Et)+.5,Js=To*ho-Wo*Wi,Qs=(ni*To-Wa*Wo)/Js,Es=(Wa*ho-ni*Wi)/Js;vt-=Qs,bt-=Es}while((E(Qs)>l||E(Es)>l)&&--zt>0);return[vt,bt]};function xn(){return b.geoProjection(en).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=lt,h.geoBoggsRaw=Ne,h.geoBonne=Qt,h.geoBonneRaw=Nt,h.geoBottomley=Er,h.geoBottomleyRaw=ar,h.geoBromley=$r,h.geoBromleyRaw=Mr,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=Br,h.geoEckert2=Vn,h.geoEckert2Raw=Wn,h.geoEckert3=aa,h.geoEckert3Raw=na,h.geoEckert4=ka,h.geoEckert4Raw=Un,h.geoEckert5=sr,h.geoEckert5Raw=Va,h.geoEckert6=or,h.geoEckert6Raw=qt,h.geoEisenlohr=sn,h.geoEisenlohrRaw=Gr,h.geoFahey=Jn,h.geoFaheyRaw=Tn,h.geoFoucaut=da,h.geoFoucautRaw=ma,h.geoFoucautSinusoidal=Ca,h.geoFoucautSinusoidalRaw=_a,h.geoGilbert=Mi,h.geoGingery=jr,h.geoGingeryRaw=Dt,h.geoGinzburg4=qr,h.geoGinzburg4Raw=Dr,h.geoGinzburg5=Jr,h.geoGinzburg5Raw=ln,h.geoGinzburg6=lr,h.geoGinzburg6Raw=At,h.geoGinzburg8=un,h.geoGinzburg8Raw=zr,h.geoGinzburg9=qn,h.geoGinzburg9Raw=Rn,h.geoGringorten=Ea,h.geoGringortenRaw=cn,h.geoGuyou=Ho,h.geoGuyouRaw=Mo,h.geoHammer=Le,h.geoHammerRaw=de,h.geoHammerRetroazimuthal=Jo,h.geoHammerRetroazimuthalRaw=Xs,h.geoHealpix=ll,h.geoHealpixRaw=sl,h.geoHill=Pl,h.geoHillRaw=kl,h.geoHomolosine=Fo,h.geoHomolosineRaw=Ps,h.geoHufnagel=Zs,h.geoHufnagelRaw=Rl,h.geoHyperelliptical=gs,h.geoHyperellipticalRaw=Ji,h.geoInterrupt=Io,h.geoInterruptedBoggs=vu,h.geoInterruptedHomolosine=wl,h.geoInterruptedMollweide=ql,h.geoInterruptedMollweideHemispheres=df,h.geoInterruptedSinuMollweide=rf,h.geoInterruptedSinusoidal=wh,h.geoKavrayskiy7=Ic,h.geoKavrayskiy7Raw=Tl,h.geoLagrange=oc,h.geoLagrangeRaw=zh,h.geoLarrivee=nf,h.geoLarriveeRaw=sc,h.geoLaskowski=Wu,h.geoLaskowskiRaw=Jl,h.geoLittrow=Il,h.geoLittrowRaw=Hs,h.geoLoximuthal=bc,h.geoLoximuthalRaw=Mf,h.geoMiller=fu,h.geoMillerRaw=Ff,h.geoModifiedStereographic=$u,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=Ku,h.geoInterruptedQuarticAuthalic=Bl,h.geoNicolosi=Md,h.geoNicolosiRaw=Th,h.geoPatterson=mc,h.geoPattersonRaw=kf,h.geoPolyconic=hu,h.geoPolyconicRaw=Oc,h.geoPolyhedral=nh,h.geoPolyhedralButterfly=au,h.geoPolyhedralCollignon=Uh,h.geoPolyhedralWaterman=su,h.geoProject=fc,h.geoGringortenQuincuncial=fr,h.geoPeirceQuincuncial=Rr,h.geoPierceQuincuncial=Rr,h.geoQuantize=vn,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=Vl,h.geoTimes=ys,h.geoTimesRaw=yo,h.geoTwoPointAzimuthal=yc,h.geoTwoPointAzimuthalRaw=ml,h.geoTwoPointAzimuthalUsa=gc,h.geoTwoPointEquidistant=_c,h.geoTwoPointEquidistantRaw=Tc,h.geoTwoPointEquidistantUsa=$f,h.geoVanDerGrinten=Lu,h.geoVanDerGrintenRaw=Lf,h.geoVanDerGrinten2=Xo,h.geoVanDerGrinten2Raw=Pf,h.geoVanDerGrinten3=Rf,h.geoVanDerGrinten3Raw=as,h.geoVanDerGrinten4=Bc,h.geoVanDerGrinten4Raw=$c,h.geoWagner=oe,h.geoWagner7=Me,h.geoWagnerRaw=P,h.geoWagner4=kt,h.geoWagner4Raw=_t,h.geoWagner6=hr,h.geoWagner6Raw=Gt,h.geoWiechel=Lr,h.geoWiechelRaw=Ar,h.geoWinkel3=xn,h.geoWinkel3Raw=en,Object.defineProperty(h,"__esModule",{value:!0})})}}),SI=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]]]}}}}),PC=Ge({"src/plots/geo/layout_attributes.js"(K,G){var h=Xf(),b=kc().attributes,S=md().dash,E=JA(),e=Hc().overrideAll,t=zp(),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"}}}),EI=Ge({"src/plots/geo/layout_defaults.js"(K,G){var h=_n(),b=q0(),S=Bd().getSubplotData,E=JA(),e=PC(),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))}}}),RC=Ge({"src/plots/geo/index.js"(K,G){var h=Bd().getSubplotCalcData,b=_n().counterRegex,S=MI(),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")}}}}),RE=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}}}),IE=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}}}),II=Ge({"src/traces/scattergl/defaults.js"(K,G){var h=_n(),b=Ro(),S=zE(),E=eS(),e=u0(),t=uu(),r=jp(),o=qp(),n=Kd(),i=Vp(),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)}}}}),zg=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}}}),Kb=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]}}}),zC=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))}}}),qI=Ge({"node_modules/svg-path-bounds/index.js"(K,G){var h=sm(),b=DC(),S=jI(),E=zC(),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}}}),VI=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}}}),Qb=Ge({"src/traces/scattergl/convert.js"(K,G){var h=Si(),b=XI(),S=z_(),E=Ro(),e=_n(),t=e.isArrayOrTypedArray,r=As(),o=Df(),n=Xy().formatColor,i=uu(),a=Fp(),s=zE(),f=N_(),c=kv().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=$d().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}}}),OC=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))),_}}}),FC=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);I 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),le.vert=v([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = (size + borderSize) * pointSizeScale; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); + fragColor = color; + fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; + fragWidth = 1. / gl_PointSize; +} +`]),x&&(le.frag=le.frag.replace("smoothstep","smoothStep"),fe.frag=fe.frag.replace("smoothstep","smoothStep")),this.drawCircle=d(le)}w.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var d=this,y=arguments.length,I=new Array(y),L=0;LAe)?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"}),lt({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=[],lt=0,dt=Math.min(at.length,et.count);lt=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}}}),QI=Ge({"node_modules/array-normalize/index.js"(K,G){var h=Kb();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}}}),XC=Ge({"node_modules/es5-ext/string/#/contains/index.js"(K,G){G.exports=hD()()?String.prototype.contains:dD()}}),Zy=Ge({"node_modules/d/index.js"(K,G){var h=ew(),b=HC(),S=UE(),E=GC(),e=XC(),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}}}),tS=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}}}),rS=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}}}),vD=Ge({"node_modules/ext/global-this/is-implemented.js"(K,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),pD=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__}})()}}),nS=Ge({"node_modules/ext/global-this/index.js"(K,G){G.exports=vD()()?globalThis:pD()}}),mD=Ge({"node_modules/es6-symbol/is-implemented.js"(K,G){var h=nS(),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])}}}),gD=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}}}),YC=Ge({"node_modules/es6-symbol/validate-symbol.js"(K,G){var h=gD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not a symbol");return b}}}),yD=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}}}),_D=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(K,G){var h=Zy(),b=nS().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"))})}}}),xD=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(K,G){var h=Zy(),b=YC(),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})})}}}),bD=Ge({"node_modules/es6-symbol/polyfill.js"(K,G){var h=Zy(),b=YC(),S=nS().Symbol,E=yD(),e=_D(),t=xD(),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]))}}),j_=Ge({"node_modules/es6-symbol/index.js"(K,G){G.exports=mD()()?nS().Symbol:bD()}}),wD=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}}}),TD=Ge({"node_modules/type/string/coerce.js"(K,G){var h=ew(),b=NE(),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}}}}),AD=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}}}}}),SD=Ge({"node_modules/type/lib/to-short-string.js"(K,G){var h=AD(),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)}}}),ZC=Ge({"node_modules/type/lib/resolve-exception.js"(K,G){var h=ew(),b=NE(),S=TD(),E=SD(),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))}}}),MD=Ge({"node_modules/type/value/ensure.js"(K,G){var h=ZC(),b=ew();G.exports=function(S){return b(S)?S:h(S,"Cannot use %v",arguments[1])}}}),ED=Ge({"node_modules/type/plain-function/ensure.js"(K,G){var h=ZC(),b=HC();G.exports=function(S){return b(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),kD=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"))}}}),CD=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))}}}),LD=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}}}),PD=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}}}),RD=Ge({"node_modules/es5-ext/math/sign/index.js"(K,G){G.exports=LD()()?Math.sign:PD()}}),ID=Ge({"node_modules/es5-ext/number/to-integer.js"(K,G){var h=RD(),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)))}}}),DD=Ge({"node_modules/es5-ext/number/to-pos-integer.js"(K,G){var h=ID(),b=Math.max;G.exports=function(S){return b(0,h(S))}}}),zD=Ge({"node_modules/es5-ext/array/from/shim.js"(K,G){var h=j_().iterator,b=tS(),S=CD(),E=DD(),e=G3(),t=Yy(),r=U_(),o=rS(),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}))}}),qD=Ge({"node_modules/es6-iterator/array.js"(K,G){var h=BE(),b=XC(),S=Zy(),E=j_(),e=WC(),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"))}}),VD=Ge({"node_modules/es6-iterator/string.js"(K,G){var h=BE(),b=Zy(),S=j_(),E=WC(),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"))}}),HD=Ge({"node_modules/es6-iterator/is-iterable.js"(K,G){var h=tS(),b=U_(),S=rS(),E=j_().iterator,e=Array.isArray;G.exports=function(t){return b(t)?e(t)||S(t)||h(t)?!0:typeof t[E]=="function":!1}}}),GD=Ge({"node_modules/es6-iterator/valid-iterable.js"(K,G){var h=HD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not iterable");return b}}}),$C=Ge({"node_modules/es6-iterator/get.js"(K,G){var h=tS(),b=rS(),S=qD(),E=VD(),e=GD(),t=j_().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)}}}),XD=Ge({"node_modules/es6-iterator/for-of.js"(K,G){var h=tS(),b=G3(),S=rS(),E=$C(),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()}}}}),YD=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]"})()}}),ZD=Ge({"node_modules/es6-weak-map/polyfill.js"(K,G){var h=U_(),b=BE(),S=nD(),E=Yy(),e=aD(),t=Zy(),r=$C(),o=XD(),n=j_().toStringTag,i=YD(),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"))}}),KC=Ge({"node_modules/es6-weak-map/index.js"(K,G){G.exports=eD()()?WeakMap:ZD()}}),WD=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;t 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`,l=` +precision highp float; + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`;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}}}),$D=Ge({"node_modules/regl-error2d/index.js"(K,G){var h=Kb(),b=z_(),S=NC(),E=zg(),e=Ad(),t=Jb(),{float32:r,fract32:o}=FE();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; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + 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:(d,y)=>[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()}}}}),KD=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):""}}}),QC=Ge({"node_modules/css-global-keywords/index.json"(K,G){G.exports=["inherit","initial","unset"]}}),eL=Ge({"node_modules/css-system-font-keywords/index.json"(K,G){G.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),tL=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"]}}),rL=Ge({"node_modules/css-font-style-keywords/index.json"(K,G){G.exports=["normal","italic","oblique"]}}),nL=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"]}}),JD=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}}),QD=Ge({"node_modules/string-split-by/index.js"(K,G){var h=JD();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 fa=mt.split(".");if(fa.length===1)return['"'+r(mt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Za=!1,Bi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(gn=yr,fa=gn.canvas):("gl"in yr?gn=yr.gl:"canvas"in yr?fa=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(pn=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&&(Bi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?fa=wr:Ln=wr),!gn){if(!fa){var ga=T(Ln||document.body,yi,Da);if(!ga)return null;fa=ga.canvas,Ga=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(fa,pn)}return gn?{gl:gn,canvas:fa,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Bi,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(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var fa=0;fa65535)<<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(gn){var pn=N(gn),za=mt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){mt[B(gn.byteLength)>>2].push(gn)}function Ln(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(yr(pn),0,pn);break;case d:za=new Uint8Array(yr(pn),0,pn);break;case y:za=new Int16Array(yr(2*pn),0,pn);break;case I:za=new Uint16Array(yr(2*pn),0,pn);break;case L:za=new Int32Array(yr(4*pn),0,pn);break;case z:za=new Uint32Array(yr(4*pn),0,pn);break;case F:za=new Float32Array(yr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function fa(gn){wr(gn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:fa}}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,lt=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,Er=36064,Mr=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,fa=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),fa=mt.getParameter(Pe));var gn=!!yr.oes_texture_float;if(gn){var pn=mt.createTexture();mt.bindTexture(pe,pn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,Er,pe,pn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)gn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Mr);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?gn=!1:(mt.deleteFramebuffer(za),mt.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)),Za=!0;if(!Da){var Bi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Bi),mt.texImage2D(lt,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Bi),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:fa,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:gn,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 Nr(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 oa=1,Yn=1;Yn0){if(typeof oa[0]=="number"){var $a=U.allocType(ia.dtype,oa.length);Gr($a,oa),Ua($a,ii),U.freeType($a)}else if(Array.isArray(oa[0])||Sr(oa[0])){Dn=Un(oa);var Oa=aa(oa,Dn,ia.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Nr(oa)){Dn=oa.shape;var Oi=oa.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=Oi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=Oi[0],Ya=Oi[1]);var Ao=Array.isArray(oa.data)?ia.dtype:ur(oa.data),qo=U.allocType(Ao,Lo*_i);sn(qo,oa.data,Lo,_i,ji,Ya,oa.offset),Ua(qo,ii),U.freeType(qo)}return hi}return ta||hi(nn),hi._reglType="buffer",hi._buffer=ia,hi.subdata=Ri,wr.profile&&(hi.stats=ia.stats),hi.destroy=function(){yi(ia)},hi}function ga(){Mt(gn).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(gn).forEach(function(Fn){nn+=gn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof pn?nn._buffer:null},restore:ga,_initBuffer:Bi}}var Tn=0,Jn=0,ma=1,da=1,_a=4,Ca=4,Hn={points:Tn,point:Jn,lines:ma,line:da,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Mi=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,ln=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var fa={},gn=0,pn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(pn.uint32=qr);function za(ga){this.id=gn++,fa[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 nn=Ia.pop();return nn||(nn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(nn,ga,Jr,-1,-1,0,0),nn}function Za(ga){Ia.push(ga)}function Bi(ga,nn,Fn,ta,ya,ia,hi){ga.buffer.bind();var Ua;if(nn){var Ri=hi;!hi&&(!Sr(nn)||Nr(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ga.buffer,nn,Fn,Ri,3)}else mt.bufferData(ln,ia,Fn),ga.buffer.dtype=Ua||Cr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=ia;if(Ua=hi,!hi){switch(ga.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ga.buffer.dtype=Ua}ga.type=Ua;var oa=ya;oa<0&&(oa=ga.buffer.byteLength,Ua===Vr?oa>>=1:Ua===qr&&(oa>>=2)),ga.vertCount=oa;var Yn=ta;if(ta<0){Yn=Dt;var ii=ga.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Mi),ii===3&&(Yn=Dt)}ga.primType=Yn}function yi(ga){Ln.elementsCount--,delete fa[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ga(ga,nn){var Fn=wr.create(null,ln,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(ia){if(!ia)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof ia=="number")Fn(ia),ta.primType=Dt,ta.vertCount=ia|0,ta.type=Cr;else{var hi=null,Ua=At,Ri=-1,oa=-1,Yn=0,ii=0;Array.isArray(ia)||Sr(ia)||Nr(ia)?hi=ia:("data"in ia&&(hi=ia.data),"usage"in ia&&(Ua=na[ia.usage]),"primitive"in ia&&(Ri=Hn[ia.primitive]),"count"in ia&&(oa=ia.count|0),"type"in ia&&(ii=pn[ia.type]),"length"in ia?Yn=ia.length|0:(Yn=oa,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Bi(ta,hi,Ua,Ri,oa,Yn,ii)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ta,ya.subdata=function(ia,hi){return Fn.subdata(ia,hi),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(fa).forEach(yi)}}}var zr=new Float32Array(1),un=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,gn=(Ln<<1>>>24)-127,pn=Ln>>13&1023;if(gn<-24)yr[wr]=fa;else if(gn<-14){var za=-14-gn;yr[wr]=fa+(pn+1024>>za)}else gn>15?yr[wr]=fa+31744:yr[wr]=fa+(gn+15<<10)+pn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var cn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Hi=6406,so=6407,io=6409,Mo=6410,fi=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,sl=35904,fs=35906,Zo=36193,vo=33776,hs=33777,ll=33778,kl=33779,Pl=35986,Ms=35987,di=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Rl=36196,Zs=5121,ul=5123,Au=5125,Ji=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Fl=9984,ql=9985,Yu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Ic=3317,zh=37440,oc=37441,Zu=37443,sc=37444,nf=33984,Jl=[Fl,Yu,ql,df],Wu=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Hi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[sl]=3,Hs[Ci]=Hs[fs]=4;function Il(mt){return"[object "+mt+"]"}var Mf=Il("HTMLCanvasElement"),bc=Il("OffscreenCanvas"),Ff=Il("CanvasRenderingContext2D"),fu=Il("ImageBitmap"),Sd=Il("HTMLImageElement"),Fs=Il("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,bc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Ji]=4,pl[Zo]=2,pl[ul]=2,pl[Au]=4;var Oo=[];Oo[fi]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[vo]=.5,Oo[hs]=.5,Oo[ll]=1,Oo[kl]=1,Oo[Pl]=.5,Oo[Ms]=1,Oo[di]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Rl]=.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)===bc}function uh(mt){return Ou(mt)===Ff}function $u(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)||Nr(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 ul:case Au:case Ji: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?Ji: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,fa,gn){for(var pn=mt.width,za=mt.height,Ia=mt.channels,Da=pn*za*Ia,Za=Bh(mt,Da),Bi=0,yi=0;yi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Ln}function vf(mt,yr,wr,Ln,fa,gn,pn){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":Fl,"linear mipmap nearest":ql,"nearest mipmap linear":Yu,"linear mipmap linear":df},Da),Bi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Hi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:fi,"rgb5 a1":ts,rgb565:Ho},ga={};yr.ext_srgb&&(Ga.srgb=sl,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Ji),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:ul,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":vo,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Pl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":di}),yr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Rl);var nn=Array.prototype.slice.call(mt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[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 ia=[];Object.keys(Da).forEach(function(q){var he=Da[q];ia[he]=q});var hi=[];Object.keys(Za).forEach(function(q){var he=Za[q];hi[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===Hi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===sl||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function oa(){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=Bi[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 ga&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==Wu[q.format]&&(q.format=q.internalformat=Wu[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Zu,q.colorSpace),mt.pixelStorei(Ic,q.unpackAlignment)}function $a(){oa.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=fa.viewportWidth,qe=fa.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(Nr(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,Wt,Vt,Jt,ir;pt.length===3?(Wt=pt[2],ir=$e[2]):(Wt=1,ir=1),it=pt[0],Tt=pt[1],Vt=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=Wt,q.format=q.internalformat=Wu[Wt],q.needsFree=!0,Gh(q,ft,Vt,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($u(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,Yt=q.channels;jn(J[0][0])?Yt=Yt||J[0][0].length:Yt=Yt||1;for(var Ht=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=Fl)}}function Ju(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,tu={},du=wr.maxTextureUnits,fo=Array(du).map(function(){return null});function Qu(q){oa.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,pn.profile&&(this.stats={size:0})}function js(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Ol(){var q=fo[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function hc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),fo[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete tu[q.id],gn.textureCount--}h(Qu.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}fo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Jt)-Wt,ir.height=ir.height||(J.height>>Jt)-Vt,js(J),Lo(ir,In,Wt,Vt,Jt),Ol(),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,js(J);for(var Wt=0;J.mipmask>>Wt;++Wt){var Vt=it>>Wt,Jt=Tt>>Wt;if(!Vt||!Jt)break;mt.texImage2D(In,Wt,J.format,Vt,Jt,0,J.format,J.type,null)}return Ol(),pn.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,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new Qu(gi);tu[pt.id]=pt,gn.cubeCount++;var $e=new Array(6);function it(Vt,Jt,ir,rr,Bt,Yt){var Ht,Or=pt.texInfo;for(gu.call(Or),Ht=0;Ht<6;++Ht)$e[Ht]=Eu();if(typeof Vt=="number"||!Vt){var Wr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo($e[Ht],Wr,Wr)}else if(typeof Vt=="object")if(Jt)Qo($e[0],Vt),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Yt);else if(Fu(Or,Vt),ii(pt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Yn($e[Ht],pt),Qo($e[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo($e[Ht],Vt);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,js(pt),Ht=0;Ht<6;++Ht)cl($e[Ht],Ea+Ht);for(Ju(Or,gi),Ol(),pn.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=ia[Or.magFilter],it.min=hi[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Ht=0;Ht<6;++Ht)tl($e[Ht]);return it}function Tt(Vt,Jt,ir,rr,Bt){var Yt=ir|0,Ht=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)-Yt,Wr.height=Wr.height||(pt.height>>Or)-Ht,js(pt),Lo(Wr,Ea+Vt,Yt,Ht,Or),Ol(),Ya(Wr),it}function Wt(Vt){var Jt=Vt|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,js(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 Ol(),pn.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=Wt,it._reglType="textureCube",it._texture=pt,pn.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);Ju(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(tl)>=0&&(Eu=!1))),("depthTexture"in fo||"depthStencilTexture"in fo)&&(du=!!(fo.depthTexture||fo.depthStencilTexture)),"depth"in fo&&(typeof fo.depth=="boolean"?Qo=fo.depth:(Ju=fo.depth,cl=!1)),"stencil"in fo&&(typeof fo.stencil=="boolean"?cl=fo.stencil:(_f=fo.stencil,Qo=!1)),"depthStencil"in fo&&(typeof fo.depthStencil=="boolean"?Qo=cl=fo.depthStencil:(tu=fo.depthStencil,Qo=!1,cl=!1))}var js=null,Ol=null,hc=null,dc=null;if(Array.isArray(es))js=es.map(Ga);else if(es)js=[Ga(es)];else for(js=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]=oa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=Ao.byteLength?qo.subdata(Ao):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=fa.create(ji,ih,!1,!0)),Ya.buffer=fa.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,Oi[_i]=1}else fa.getBuffer(ji)?(Ya.buffer=fa.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):fa.getBuffer(ji.buffer)?(Ya.buffer=fa.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 ga(){fa={},gn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,fa;++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 wc(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 fr(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 vn(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),fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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 ci(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],fa=[],gn=[];function pn(ga,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ga.push(ya,"="),ga.push.apply(ga,ti(arguments)),ga.push(";")),ya}return h(nn,{def:ta,toString:function(){return ci([Fn.length>0?"var "+Fn.join(",")+";":"",ci(ga)])}})}function Ia(){var ga=za(),nn=za(),Fn=ga.toString,ta=nn.toString;function ya(ia,hi){nn(ia,hi,"=",ga.def(ia,hi),";")}return h(function(){ga.apply(ga,ti(arguments))},{def:ga.def,entry:ga,exit:nn,save:ya,set:function(ia,hi,Ua){ya(ia,hi),ga(ia,hi,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ga=ci(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 ia=ya();return ia&&(ia="else{"+ia+"}"),ci(["if(",ga,"){",ta(),"}",ia])}})}var Za=za(),Bi={};function yi(ga,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},la={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)||Nr(mt)}function sa(mt){return mt.sort(function(yr,wr){return yr===Bc?-1:wr===Bc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var fa=mt.data;return new ai(fa.thisDep,fa.contextDep,fa.propDep,yr)}else{if(wr===Zi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(gn,pn,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,fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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,ia=wr.webgl_draw_buffers,hi=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},oa=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var Wt=Dn($e);oa.push($e),Ri[Wt]=Ua[Wt]=!!Tt,Yn[Wt]=it}function Oa($e,it,Tt){var Wt=Dn($e);oa.push($e),Array.isArray(Tt)?(Ua[Wt]=Tt.slice(),Ri[Wt]=Tt.slice()):Ua[Wt]=Ri[Wt]=Tt,ii[Wt]=it}function Oi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Sn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Vl,Vl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(Dl,Dl,St),Oa(ml,ml,1),$a(gc,Xn),Oa(yc,"polygonOffset",[0,0]),$a(Tc,Ta),$a($f,ri),Oa(_c,"sampleCoverage",[1,!1]),$a(Lf,on),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(Bc,Bc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Bi,elements:gn,buffer:fa,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ta,stencilOps:la,glTypes:kn,orientationType:Sa};ia&&(_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:ga}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var Wt=it(Lo),Vt=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Yt){Vt[Yt]=Tt.def(Wt,".",Yt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Yt){Array.isArray(Ua[Yt])&&(Jt[Yt]=Tt.def(Vt.next,".",Yt),ir[Yt]=Tt.def(Vt.current,".",Yt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Yt){rr[Yt]=Tt.def(JSON.stringify(_i[Yt]))}),$e.invoke=function(Yt,Ht){switch(Ht.type){case Xi:var Or=["this",Vt.context,Vt.props,$e.batchId];return Yt.def(it(Ht.data),".call(",Or.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Yt.def(Vt.props,Ht.data);case Do:return Yt.def(Vt.context,Ht.data);case Go:return Yt.def("this",Ht.data);case jo:return Ht.data.append($e,Yt),Ht.data.ref;case Zi:return Ht.data.toString();case Li:return Ht.data.map(function(Wr){return $e.invoke(Yt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Yt){var Ht=yr.id(Yt);if(Ht in Bt)return Bt[Ht];var Or=Da.scope[Ht];Or||(Or=Da.scope[Ht]=new Fn);var Wr=Bt[Ht]=it(Or);return Wr},$e}function Ao($e){var it=$e.static,Tt=$e.dynamic,Wt;if(Ue in it){var Vt=!!it[Ue];Wt=zi(function(ir,rr){return Vt}),Wt.enable=Vt}else if(Ue in Tt){var Jt=Tt[Ue];Wt=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return Wt}function qo($e,it){var Tt=$e.static,Wt=$e.dynamic;if(P in Tt){var Vt=Tt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(ir,rr){var Bt=ir.link(Vt),Yt=ir.shared;rr.set(Yt.framebuffer,".next",Bt);var Ht=Yt.context;return rr.set(Ht,"."+en,Bt+".width"),rr.set(Ht,"."+xn,Bt+".height"),Bt})):zi(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Yt=Bt.context;return rr.set(Yt,"."+en,Yt+"."+bt),rr.set(Yt,"."+xn,Yt+"."+zt),"null"})}else if(P in Wt){var Jt=Wt[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Yt=ir.shared,Ht=Yt.framebuffer,Or=rr.def(Ht,".getFramebuffer(",Bt,")");rr.set(Ht,".next",Or);var Wr=Yt.context;return rr.set(Wr,"."+en,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var Wt=$e.static,Vt=$e.dynamic;function Jt(Bt){if(Bt in Wt){var Yt=Wt[Bt],Ht=!0,Or=Yt.x|0,Wr=Yt.y|0,fn,ua;return"width"in Yt?fn=Yt.width|0:Ht=!1,"height"in Yt?ua=Yt.height|0:Ht=!1,new ai(!Ht&&it&&it.thisDep,!Ht&&it&&it.contextDep,!Ht&&it&&it.propDep,function(ca,va){var Pa=ca.shared.context,ha=fn;"width"in Yt||(ha=va.def(Pa,".",en,"-",Or));var Fa=ua;return"height"in Yt||(Fa=va.def(Pa,".",xn,"-",Wr)),[Or,Wr,ha,Fa]})}else if(Bt in Vt){var Zn=Vt[Bt],Gn=Vi(Zn,function(ca,va){var Pa=ca.invoke(va,Zn),ha=ca.shared.context,Fa=va.def(Pa,".x|0"),Ka=va.def(Pa,".y|0"),wi=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ha,".",en,"-",Fa,")"),qi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ha,".",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(ca,va){var Pa=ca.shared.context;return[0,0,va.def(Pa,".",en),va.def(Pa,".",xn)]}):null}var ir=Jt(Bc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Yt){var Ht=rr.append(Bt,Yt),Or=Bt.shared.context;return Yt.set(Or,"."+Ze,Ht[2]),Yt.set(Or,"."+tt,Ht[3]),Ht})}return{viewport:ir,scissor_box:Jt($c)}}function cl($e,it){var Tt=$e.static,Wt=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if(Wt){if(Object.keys(it.dynamic).length>0)return null;var Vt=it.static,Jt=Object.keys(Vt);if(Jt.length>0&&typeof Vt[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",ca,"=",ua,".createStream(",Ut,",",Ht,".buffer);","}else{",ca,"=",ua,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Wr.glTypes,"[",Ht,".type]:",ca,".dtype;",Zn.normalized,"=!!",Ht,".normalized;");function Pa(ha){Yt(Zn[ha],"=",Ht,".",ha,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Yt("}}"),Yt.exit("if(",Zn.isStream,"){",ua,".destroyStream(",ca,");","}"),Zn}Vt[Jt]=Vi(ir,rr)}),Vt}function Ju($e){var it=$e.static,Tt=$e.dynamic,Wt={};return Object.keys(it).forEach(function(Vt){var Jt=it[Vt];Wt[Vt]=zi(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Vt){var Jt=Tt[Vt];Wt[Vt]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),Wt}function _f($e,it,Tt,Wt,Vt){$e.static,$e.dynamic;var Jt=cl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Yt=tl($e),Ht=es($e,Vt,Jt);function Or(ca){var va=rr[ca];va&&(Yt[ca]=va)}Or(Bc),Or(Dn($c));var Wr=Object.keys(Yt).length>0,fn={framebuffer:ir,draw:Bt,shader:Ht,state:Yt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Ao($e),fn.uniforms=gu(Tt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var ua=!0,Zn=Ht.program.attributes.map(function(ca){var va=it.static[ca];return ua=ua&&!!va,va});if(ua&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));fn.drawVAO=new ai(null,null,null,function(ca,va){return ca.link(Gn)}),fn.useVAO=!0}}return Jt?fn.useVAO=!0:fn.attributes=Fu(it),fn.context=Ju(Wt),fn}function tu($e,it,Tt){var Wt=$e.shared,Vt=Wt.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Vt,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Vt,".",ir,"=[",Bt.join(),"];"):Jt(Vt,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,Wt){var Vt=$e.shared,Jt=Vt.gl,ir=Vt.framebuffer,rr;ia&&(rr=it.def(Vt.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Yt=Bt.drawBuffer,Ht=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),Wt||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),ia&&it(rr,".drawBuffersWEBGL(",Yt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),ia&&it(rr,".drawBuffersWEBGL(",Ht,");"),it("}",ir,".cur=",Or,";"),Wt||it("}")}function fo($e,it,Tt){var Wt=$e.shared,Vt=Wt.gl,Jt=$e.current,ir=$e.next,rr=Wt.current,Bt=Wt.next,Yt=$e.cond(rr,".dirty");oa.forEach(function(Ht){var Or=Dn(Ht);if(!(Or in Tt.state)){var Wr,fn;if(Or in ir){Wr=ir[Or],fn=Jt[Or];var ua=m(Ua[Or].length,function(Gn){return Yt.def(Wr,"[",Gn,"]")});Yt($e.cond(ua.map(function(Gn,ca){return Gn+"!=="+fn+"["+ca+"]"}).join("||")).then(Vt,".",ii[Or],"(",ua,");",ua.map(function(Gn,ca){return fn+"["+ca+"]="+Gn}).join(";"),";"))}else{Wr=Yt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Yt(Zn),Or in Yn?Zn($e.cond(Wr).then(Vt,".enable(",Yn[Or],");").else(Vt,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Vt,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Yt(rr,".dirty=false;"),it(Yt)}function Qu($e,it,Tt,Wt){var Vt=$e.shared,Jt=$e.current,ir=Vt.current,rr=Vt.gl,Bt;sa(Object.keys(Tt)).forEach(function(Yt){var Ht=Tt[Yt];if(!(Wt&&!Wt(Ht))){var Or=Ht.append($e,it);if(Yn[Yt]){var Wr=Yn[Yt];Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Or,";"))}else if(jn(Or)){var fn=Jt[Yt];it(rr,".",ii[Yt],"(",Or,");",Or.map(function(ua,Zn){return fn+"["+Zn+"]="+ua}).join(";"),";")}else Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Yt],"(",Bt,");",ir,".",Yt,"=",Bt,";")):it(rr,".",ii[Yt],"(",Or,");",ir,".",Yt,"=",Or,";")}})}function js($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Ol($e,it,Tt,Wt,Vt){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Yt=Tt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function fn(Pa){Or=it.def(),Pa(Or,"=",Ht(),";"),typeof Vt=="string"?Pa(ir,".count+=",Vt,";"):Pa(ir,".count++;"),Ga&&(Wt?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function ua(Pa){Pa(ir,".cpuTime+=",Ht(),"-",Or,";"),Ga&&(Wt?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var ha=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",ha,";")}var Gn;if(Yt){if(Yi(Yt)){Yt.enable?(fn(it),ua(it.exit),Zn("true")):Zn("false");return}Gn=Yt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ca=$e.block();fn(ca),it("if(",Gn,"){",ca,"}");var va=$e.block();ua(va),it.exit("if(",Gn,"){",va,"}")}function hc($e,it,Tt,Wt,Vt){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case al:return 2;case Wi:case Js:case mu:return 3;case To:case Qs:case iu:return 4;default:return 1}}function rr(Bt,Yt,Ht){var Or=Jt.gl,Wr=it.def(Bt,".location"),fn=it.def(Jt.attributes,"[",Wr,"]"),ua=Ht.state,Zn=Ht.buffer,Gn=[Ht.x,Ht.y,Ht.z,Ht.w],ca=["buffer","normalized","offset","stride"];function va(){it("if(!",fn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var ha=Ht.type,Fa;if(Ht.size?Fa=it.def(Ht.size,"||",Yt):Fa=Yt,it("if(",fn,".type!==",ha,"||",fn,".size!==",Fa,"||",ca.map(function(wi){return fn+"."+wi+"!=="+Ht[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,ha,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ha,";",fn,".size=",Fa,";",ca.map(function(wi){return fn+"."+wi+"="+Ht[wi]+";"}).join(""),"}"),ya){var Ka=Ht.divisor;it("if(",fn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",fn,".divisor=",Ka,";}")}}function Pa(){it("if(",fn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",fn,".buffer=null;","}if(",Ha.map(function(ha,Fa){return fn+"."+ha+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(ha,Fa){return fn+"."+ha+"="+Gn[Fa]+";"}).join(""),"}")}ua===Qa?va():ua===Na?Pa():(it("if(",ua,"===",Qa,"){"),va(),it("}else{"),Pa(),it("}"))}Wt.forEach(function(Bt){var Yt=Bt.name,Ht=Tt.attributes[Yt],Or;if(Ht){if(!Vt(Ht))return;Or=Ht.append($e,it)}else{if(!Vt(_o))return;var Wr=$e.scopeAttrib(Yt);Or={},Object.keys(new Fn).forEach(function(fn){Or[fn]=it.def(Wr,".",fn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function dc($e,it,Tt,Wt,Vt,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Yt=0;Yt1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,fn,ua,Zn],");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function ha(){function Fa(){Tt(Jt+".drawElements("+[Wr,ua,ca,fn+"<<(("+ca+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,fn,ua]+");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),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){"),ha(),Tt("}")):Pa():ha()}function ds($e,it,Tt,Wt,Vt){var Jt=Ya(),ir=Jt.proc("body",Vt);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,Wt),Jt.compile().body}function _s($e,it,Tt,Wt){js($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);"),hc($e,it,Tt,Wt.attributes,function(){return!0})),dc($e,it,Tt,Wt.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);js($e,Tt),tu($e,Tt,it.context),du($e,Tt,it.framebuffer),fo($e,Tt,it),Qu($e,Tt,it.state),Ol($e,Tt,it,!1,!0);var Wt=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Wt,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Vt=$e.global.def("{}"),Jt=Tt.def(Wt,".id"),ir=Tt.def(Vt,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Vt,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",Wt,");",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,Wt){$e.batchId="a1",js($e,it);function Vt(){return!0}hc($e,it,Tt,Wt.attributes,Vt),dc($e,it,Tt,Wt.uniforms,Vt,!1),Co($e,it,it,Tt)}function he($e,it,Tt,Wt){js($e,it);var Vt=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Yt=$e.scope(),Ht=$e.scope();it(Yt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Ht,"}",Yt.exit);function Or(ca){return ca.contextDep&&Vt||ca.propDep}function Wr(ca){return!Or(ca)}if(Tt.needsContext&&tu($e,Ht,Tt.context),Tt.needsFramebuffer&&du($e,Ht,Tt.framebuffer),Qu($e,Ht,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Ol($e,Ht,Tt,!1,!0),Wt)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Ht($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Ht),");"):Yt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Yt),");"):Yt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Yt($e.shared.vao,".setVAO(null);"),hc($e,Yt,Tt,Wt.attributes,Wr),hc($e,Ht,Tt,Wt.attributes,Or)),dc($e,Yt,Tt,Wt.uniforms,Wr,!1),dc($e,Ht,Tt,Wt.uniforms,Or,!0),Co($e,Yt,Ht,Tt);else{var fn=$e.global.def("{}"),ua=Tt.shader.progVar.append($e,Ht),Zn=Ht.def(ua,".id"),Gn=Ht.def(fn,"[",Zn,"]");Ht($e.shared.gl,".useProgram(",ua,".program);","if(!",Gn,"){",Gn,"=",fn,"[",Zn,"]=",$e.link(function(ca){return ds(q,$e,Tt,ca,2)}),"(",ua,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",js($e,Tt);var Wt=!1,Vt=!0;Object.keys(it.context).forEach(function(fn){Wt=Wt||it.context[fn].propDep}),Wt||(tu($e,Tt,it.context),Vt=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?Wt=ir=!0:Jt.contextDep&&Wt&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&(Wt=!0);function rr(fn){return fn.contextDep&&Wt||fn.propDep}fo($e,Tt,it),Qu($e,Tt,it.state,function(fn){return!rr(fn)}),(!it.profile||!rr(it.profile))&&Ol($e,Tt,it,!1,"a1"),it.contextDep=Wt,it.needsContext=Vt,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&Wt||Bt.propDep)he($e,Tt,it,null);else{var Yt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Yt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Or=Tt.def(Yt,".id"),Wr=Tt.def(Ht,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Ht,"[",Or,"]=",$e.link(function(fn){return ds(he,$e,it,fn,2)}),"(",Yt,");",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 Wt=$e.shared,Vt=Wt.current;if(tu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),sa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Yt=Bt.append($e,Tt);jn(Yt)?Yt.forEach(function(Ht,Or){Oi(Ht)?Tt.set($e.next[rr],"["+Or+"]",Ht):Tt.set($e.next[rr],"["+Or+"]",$e.link(Ht,{stable:!0}))}):Yi(Bt)?Tt.set(Wt.next,"."+rr,$e.link(Yt,{stable:!0})):Tt.set(Wt.next,"."+rr,Yt)}),Ol($e,Tt,it,!0,!0),[Ce,kt,_t,Gt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.draw,"."+rr,Yt):Tt.set(Wt.draw,"."+rr,$e.link(Yt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Yt){return Oi(Yt)?Yt:$e.link(Yt,{stable:!0})})+"]"),Tt.set(Wt.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Yt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Ht){Tt.set(Yt,"."+Ht,Bt[Ht])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);Oi(Jt)?Tt.set(Wt.vao,".targetVAO",Jt):Tt.set(Wt.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.shader,"."+rr,Yt):Tt.set(Wt.shader,"."+rr,$e.link(Yt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Vt,".dirty=true;"),Tt.exit(Vt,".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=Oi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&Oi.length>0&&(Ya=c.next(Ao))}function Qo(){Ya&&(c.cancel(Ao),Ya=null)}function cl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),fa.restore(),Ua.restore(),ta.restore(),Ri.restore(),oa.restore(),Yn.restore(),ia.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,cl,!1),Oa.addEventListener(zl,es,!1));function Eu(){Oi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,cl),Oa.removeEventListener(zl,es)),Ua.clear(),Yn.clear(),oa.clear(),ia.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ds(Vt){var Jt=h({},Vt);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(Yt){Jt[rr+"."+Yt]=Bt[Yt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Vt&&(Jt.vao=Vt.vao),Jt}function _s(Vt,Jt){var ir={},rr={};return Object.keys(Vt).forEach(function(Bt){var Yt=Vt[Bt];if(f.isDynamic(Yt)){rr[Bt]=f.unbox(Yt,Bt);return}else if(Jt&&Array.isArray(Yt)){for(var Ht=0;Ht0)return pt.call(this,Tt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return pt.call(this,Vt,Vt.length)}else return ft.call(this,Vt)}return h(Wt,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=tl({framebuffer:f.define.call(null,Ac,"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|=eu),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Ju(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){Oi.push(Co);function ds(){var _s=Kc(Oi,Co);function be(){var q=Kc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&Qo()}Oi[_s]=be}return qo(),{cancel:ds}}function tu(){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=Qu(),tu(),ii.procs.poll()}function fo(){Ri.refresh(),tu(),ii.procs.refresh(),Da&&Da.update()}function Qu(){return(p()-Za)/1e3}fo();function js(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 Ol(){return za}function hc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var dc=h(tl,{clear:Ju,prop:f.define.bind(null,Ac),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:tl({}),buffer:function(Co){return ta.create(Co,el,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:oa.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:ia.createVAO,attributes:Ln,frame:_f,on:js,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:fo,poll:function(){du(),Da&&Da.update()},now:Qu,stats:pn,getCachedCode:Ol,preloadCachedCode:hc});return yr.onDone(null,dc),dc}return Pu})}}),az=Ge({"node_modules/gl-util/context.js"(K,G){var h=zg();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}}}),iz=Ge({"node_modules/font-atlas/index.js"(K,G){var h=iL(),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}}}),oL=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}}}),oz=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}}),sz=Ge({"node_modules/typedarray-pool/pool.js"(K){var G=oL(),h=oz(),b=_g().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}}}),lz=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({}))}}}),sL=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}}}),uz=Ge({"node_modules/to-px/topx.js"(K,G){var h=sL();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}}}),cz=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)}}}),hz=Ge({"node_modules/gl-text/dist.js"(K,G){var h=rz(),b=zg(),S=nz(),E=az(),e=KC(),t=z_(),r=iz(),o=sz(),n=H3(),i=lz(),a=sL(),s=uz(),f=cz(),c=Ad(),p=fz(),v=Jb(),T=oL(),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; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > halfCharStep + halfCharWidth || + floor(uv.x) < halfCharStep - halfCharWidth) return; + + uv += charId * charStep; + uv = uv / atlasSize; + + vec4 color = fontColor; + vec4 mask = texture2D(atlas, uv); + + float maskY = lightness(mask); + // float colorY = lightness(color); + color.a *= maskY; + color.a *= opacity; + + // color.a += .1; + + // antialiasing, see yiq color space y-channel formula + // color.rgb += (1. - color.rgb) * (1. - mask.rgb); + + gl_FragColor = color; + }`}),d={};return{regl:m,draw:u,atlas:d}},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=v(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 d=!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 lt=pe.style,dt=pe.weight,nt=pe.stretch,Ft=pe.variant;pe=h.parse(h.stringify(pe)),lt&&(pe.style=lt),dt&&(pe.weight=dt),nt&&(pe.stretch=nt),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}),Qt=a(pe.size),ar=Math.round(Qt[0]*s(Qt[1]));if(ar!==u.fontSize[Ne]&&(y=!0,u.fontSize[Ne]=ar),(!u.font[Ne]||Nt!=u.font[Ne].baseString)&&(d=!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]}}),(d||y)&&this.font.forEach(function(pe,Ne){var lt=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[lt],!u.fontAtlas[Ne]){var dt=pe.metrics;u.shader.atlas[lt]=u.fontAtlas[Ne]={fontString:lt,step:Math.ceil(u.fontSize[Ne]*dt.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 lt=="number")return lt;switch(lt){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 lt=(u.font[Ne]||u.font[0]).metrics,dt=0;return dt+=lt.bottom*.5,typeof pe=="number"?dt+=pe-lt.baseline:dt+=-lt[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}}),dz=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 fa=mt.split(".");if(fa.length===1)return['"'+r(mt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Za=!1,Bi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(gn=yr,fa=gn.canvas):("gl"in yr?gn=yr.gl:"canvas"in yr?fa=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(pn=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&&(Bi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?fa=wr:Ln=wr),!gn){if(!fa){var ga=T(Ln||document.body,yi,Da);if(!ga)return null;fa=ga.canvas,Ga=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(fa,pn)}return gn?{gl:gn,canvas:fa,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Bi,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(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var fa=0;fa65535)<<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(gn){var pn=N(gn),za=mt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){mt[B(gn.byteLength)>>2].push(gn)}function Ln(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(yr(pn),0,pn);break;case d:za=new Uint8Array(yr(pn),0,pn);break;case y:za=new Int16Array(yr(2*pn),0,pn);break;case I:za=new Uint16Array(yr(2*pn),0,pn);break;case L:za=new Int32Array(yr(4*pn),0,pn);break;case z:za=new Uint32Array(yr(4*pn),0,pn);break;case F:za=new Float32Array(yr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function fa(gn){wr(gn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:fa}}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,lt=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,Er=36064,Mr=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,fa=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),fa=mt.getParameter(Pe));var gn=!!yr.oes_texture_float;if(gn){var pn=mt.createTexture();mt.bindTexture(pe,pn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,Er,pe,pn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)gn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Mr);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?gn=!1:(mt.deleteFramebuffer(za),mt.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)),Za=!0;if(!Da){var Bi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Bi),mt.texImage2D(lt,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Bi),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:fa,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:gn,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 Nr(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 oa=1,Yn=1;Yn0){if(typeof oa[0]=="number"){var $a=U.allocType(ia.dtype,oa.length);Gr($a,oa),Ua($a,ii),U.freeType($a)}else if(Array.isArray(oa[0])||Sr(oa[0])){Dn=Un(oa);var Oa=aa(oa,Dn,ia.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Nr(oa)){Dn=oa.shape;var Oi=oa.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=Oi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=Oi[0],Ya=Oi[1]);var Ao=Array.isArray(oa.data)?ia.dtype:ur(oa.data),qo=U.allocType(Ao,Lo*_i);sn(qo,oa.data,Lo,_i,ji,Ya,oa.offset),Ua(qo,ii),U.freeType(qo)}return hi}return ta||hi(nn),hi._reglType="buffer",hi._buffer=ia,hi.subdata=Ri,wr.profile&&(hi.stats=ia.stats),hi.destroy=function(){yi(ia)},hi}function ga(){Mt(gn).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(gn).forEach(function(Fn){nn+=gn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof pn?nn._buffer:null},restore:ga,_initBuffer:Bi}}var Tn=0,Jn=0,ma=1,da=1,_a=4,Ca=4,Hn={points:Tn,point:Jn,lines:ma,line:da,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Mi=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,ln=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var fa={},gn=0,pn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(pn.uint32=qr);function za(ga){this.id=gn++,fa[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 nn=Ia.pop();return nn||(nn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(nn,ga,Jr,-1,-1,0,0),nn}function Za(ga){Ia.push(ga)}function Bi(ga,nn,Fn,ta,ya,ia,hi){ga.buffer.bind();var Ua;if(nn){var Ri=hi;!hi&&(!Sr(nn)||Nr(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ga.buffer,nn,Fn,Ri,3)}else mt.bufferData(ln,ia,Fn),ga.buffer.dtype=Ua||Cr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=ia;if(Ua=hi,!hi){switch(ga.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ga.buffer.dtype=Ua}ga.type=Ua;var oa=ya;oa<0&&(oa=ga.buffer.byteLength,Ua===Vr?oa>>=1:Ua===qr&&(oa>>=2)),ga.vertCount=oa;var Yn=ta;if(ta<0){Yn=Dt;var ii=ga.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Mi),ii===3&&(Yn=Dt)}ga.primType=Yn}function yi(ga){Ln.elementsCount--,delete fa[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ga(ga,nn){var Fn=wr.create(null,ln,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(ia){if(!ia)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof ia=="number")Fn(ia),ta.primType=Dt,ta.vertCount=ia|0,ta.type=Cr;else{var hi=null,Ua=At,Ri=-1,oa=-1,Yn=0,ii=0;Array.isArray(ia)||Sr(ia)||Nr(ia)?hi=ia:("data"in ia&&(hi=ia.data),"usage"in ia&&(Ua=na[ia.usage]),"primitive"in ia&&(Ri=Hn[ia.primitive]),"count"in ia&&(oa=ia.count|0),"type"in ia&&(ii=pn[ia.type]),"length"in ia?Yn=ia.length|0:(Yn=oa,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Bi(ta,hi,Ua,Ri,oa,Yn,ii)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ta,ya.subdata=function(ia,hi){return Fn.subdata(ia,hi),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(fa).forEach(yi)}}}var zr=new Float32Array(1),un=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,gn=(Ln<<1>>>24)-127,pn=Ln>>13&1023;if(gn<-24)yr[wr]=fa;else if(gn<-14){var za=-14-gn;yr[wr]=fa+(pn+1024>>za)}else gn>15?yr[wr]=fa+31744:yr[wr]=fa+(gn+15<<10)+pn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var cn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Hi=6406,so=6407,io=6409,Mo=6410,fi=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,sl=35904,fs=35906,Zo=36193,vo=33776,hs=33777,ll=33778,kl=33779,Pl=35986,Ms=35987,di=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Rl=36196,Zs=5121,ul=5123,Au=5125,Ji=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Fl=9984,ql=9985,Yu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Ic=3317,zh=37440,oc=37441,Zu=37443,sc=37444,nf=33984,Jl=[Fl,Yu,ql,df],Wu=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Hi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[sl]=3,Hs[Ci]=Hs[fs]=4;function Il(mt){return"[object "+mt+"]"}var Mf=Il("HTMLCanvasElement"),bc=Il("OffscreenCanvas"),Ff=Il("CanvasRenderingContext2D"),fu=Il("ImageBitmap"),Sd=Il("HTMLImageElement"),Fs=Il("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,bc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Ji]=4,pl[Zo]=2,pl[ul]=2,pl[Au]=4;var Oo=[];Oo[fi]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[vo]=.5,Oo[hs]=.5,Oo[ll]=1,Oo[kl]=1,Oo[Pl]=.5,Oo[Ms]=1,Oo[di]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Rl]=.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)===bc}function uh(mt){return Ou(mt)===Ff}function $u(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)||Nr(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 ul:case Au:case Ji: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?Ji: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,fa,gn){for(var pn=mt.width,za=mt.height,Ia=mt.channels,Da=pn*za*Ia,Za=Bh(mt,Da),Bi=0,yi=0;yi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Ln}function vf(mt,yr,wr,Ln,fa,gn,pn){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":Fl,"linear mipmap nearest":ql,"nearest mipmap linear":Yu,"linear mipmap linear":df},Da),Bi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Hi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:fi,"rgb5 a1":ts,rgb565:Ho},ga={};yr.ext_srgb&&(Ga.srgb=sl,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Ji),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:ul,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":vo,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Pl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":di}),yr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Rl);var nn=Array.prototype.slice.call(mt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[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 ia=[];Object.keys(Da).forEach(function(q){var he=Da[q];ia[he]=q});var hi=[];Object.keys(Za).forEach(function(q){var he=Za[q];hi[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===Hi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===sl||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function oa(){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=Bi[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 ga&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==Wu[q.format]&&(q.format=q.internalformat=Wu[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Zu,q.colorSpace),mt.pixelStorei(Ic,q.unpackAlignment)}function $a(){oa.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=fa.viewportWidth,qe=fa.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(Nr(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,Wt,Vt,Jt,ir;pt.length===3?(Wt=pt[2],ir=$e[2]):(Wt=1,ir=1),it=pt[0],Tt=pt[1],Vt=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=Wt,q.format=q.internalformat=Wu[Wt],q.needsFree=!0,Gh(q,ft,Vt,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($u(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,Yt=q.channels;jn(J[0][0])?Yt=Yt||J[0][0].length:Yt=Yt||1;for(var Ht=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=Fl)}}function Ju(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,tu={},du=wr.maxTextureUnits,fo=Array(du).map(function(){return null});function Qu(q){oa.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,pn.profile&&(this.stats={size:0})}function js(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Ol(){var q=fo[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function hc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),fo[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete tu[q.id],gn.textureCount--}h(Qu.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}fo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Jt)-Wt,ir.height=ir.height||(J.height>>Jt)-Vt,js(J),Lo(ir,In,Wt,Vt,Jt),Ol(),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,js(J);for(var Wt=0;J.mipmask>>Wt;++Wt){var Vt=it>>Wt,Jt=Tt>>Wt;if(!Vt||!Jt)break;mt.texImage2D(In,Wt,J.format,Vt,Jt,0,J.format,J.type,null)}return Ol(),pn.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,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new Qu(gi);tu[pt.id]=pt,gn.cubeCount++;var $e=new Array(6);function it(Vt,Jt,ir,rr,Bt,Yt){var Ht,Or=pt.texInfo;for(gu.call(Or),Ht=0;Ht<6;++Ht)$e[Ht]=Eu();if(typeof Vt=="number"||!Vt){var Wr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo($e[Ht],Wr,Wr)}else if(typeof Vt=="object")if(Jt)Qo($e[0],Vt),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Yt);else if(Fu(Or,Vt),ii(pt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Yn($e[Ht],pt),Qo($e[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo($e[Ht],Vt);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,js(pt),Ht=0;Ht<6;++Ht)cl($e[Ht],Ea+Ht);for(Ju(Or,gi),Ol(),pn.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=ia[Or.magFilter],it.min=hi[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Ht=0;Ht<6;++Ht)tl($e[Ht]);return it}function Tt(Vt,Jt,ir,rr,Bt){var Yt=ir|0,Ht=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)-Yt,Wr.height=Wr.height||(pt.height>>Or)-Ht,js(pt),Lo(Wr,Ea+Vt,Yt,Ht,Or),Ol(),Ya(Wr),it}function Wt(Vt){var Jt=Vt|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,js(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 Ol(),pn.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=Wt,it._reglType="textureCube",it._texture=pt,pn.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);Ju(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(tl)>=0&&(Eu=!1))),("depthTexture"in fo||"depthStencilTexture"in fo)&&(du=!!(fo.depthTexture||fo.depthStencilTexture)),"depth"in fo&&(typeof fo.depth=="boolean"?Qo=fo.depth:(Ju=fo.depth,cl=!1)),"stencil"in fo&&(typeof fo.stencil=="boolean"?cl=fo.stencil:(_f=fo.stencil,Qo=!1)),"depthStencil"in fo&&(typeof fo.depthStencil=="boolean"?Qo=cl=fo.depthStencil:(tu=fo.depthStencil,Qo=!1,cl=!1))}var js=null,Ol=null,hc=null,dc=null;if(Array.isArray(es))js=es.map(Ga);else if(es)js=[Ga(es)];else for(js=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]=oa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=Ao.byteLength?qo.subdata(Ao):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=fa.create(ji,ih,!1,!0)),Ya.buffer=fa.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,Oi[_i]=1}else fa.getBuffer(ji)?(Ya.buffer=fa.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):fa.getBuffer(ji.buffer)?(Ya.buffer=fa.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 ga(){fa={},gn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,fa;++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 wc(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 fr(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 vn(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),fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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 ci(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],fa=[],gn=[];function pn(ga,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ga.push(ya,"="),ga.push.apply(ga,ti(arguments)),ga.push(";")),ya}return h(nn,{def:ta,toString:function(){return ci([Fn.length>0?"var "+Fn.join(",")+";":"",ci(ga)])}})}function Ia(){var ga=za(),nn=za(),Fn=ga.toString,ta=nn.toString;function ya(ia,hi){nn(ia,hi,"=",ga.def(ia,hi),";")}return h(function(){ga.apply(ga,ti(arguments))},{def:ga.def,entry:ga,exit:nn,save:ya,set:function(ia,hi,Ua){ya(ia,hi),ga(ia,hi,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ga=ci(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 ia=ya();return ia&&(ia="else{"+ia+"}"),ci(["if(",ga,"){",ta(),"}",ia])}})}var Za=za(),Bi={};function yi(ga,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},la={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)||Nr(mt)}function sa(mt){return mt.sort(function(yr,wr){return yr===Bc?-1:wr===Bc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var fa=mt.data;return new ai(fa.thisDep,fa.contextDep,fa.propDep,yr)}else{if(wr===Zi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(gn,pn,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,fa,gn,pn,za,Ia,Da,Za,Bi,yi,Ga,ga,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,ia=wr.webgl_draw_buffers,hi=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},oa=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var Wt=Dn($e);oa.push($e),Ri[Wt]=Ua[Wt]=!!Tt,Yn[Wt]=it}function Oa($e,it,Tt){var Wt=Dn($e);oa.push($e),Array.isArray(Tt)?(Ua[Wt]=Tt.slice(),Ri[Wt]=Tt.slice()):Ua[Wt]=Ri[Wt]=Tt,ii[Wt]=it}function Oi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Sn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Vl,Vl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(Dl,Dl,St),Oa(ml,ml,1),$a(gc,Xn),Oa(yc,"polygonOffset",[0,0]),$a(Tc,Ta),$a($f,ri),Oa(_c,"sampleCoverage",[1,!1]),$a(Lf,on),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(Bc,Bc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Bi,elements:gn,buffer:fa,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ta,stencilOps:la,glTypes:kn,orientationType:Sa};ia&&(_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:ga}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var Wt=it(Lo),Vt=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Yt){Vt[Yt]=Tt.def(Wt,".",Yt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Yt){Array.isArray(Ua[Yt])&&(Jt[Yt]=Tt.def(Vt.next,".",Yt),ir[Yt]=Tt.def(Vt.current,".",Yt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Yt){rr[Yt]=Tt.def(JSON.stringify(_i[Yt]))}),$e.invoke=function(Yt,Ht){switch(Ht.type){case Xi:var Or=["this",Vt.context,Vt.props,$e.batchId];return Yt.def(it(Ht.data),".call(",Or.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Yt.def(Vt.props,Ht.data);case Do:return Yt.def(Vt.context,Ht.data);case Go:return Yt.def("this",Ht.data);case jo:return Ht.data.append($e,Yt),Ht.data.ref;case Zi:return Ht.data.toString();case Li:return Ht.data.map(function(Wr){return $e.invoke(Yt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Yt){var Ht=yr.id(Yt);if(Ht in Bt)return Bt[Ht];var Or=Da.scope[Ht];Or||(Or=Da.scope[Ht]=new Fn);var Wr=Bt[Ht]=it(Or);return Wr},$e}function Ao($e){var it=$e.static,Tt=$e.dynamic,Wt;if(Ue in it){var Vt=!!it[Ue];Wt=zi(function(ir,rr){return Vt}),Wt.enable=Vt}else if(Ue in Tt){var Jt=Tt[Ue];Wt=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return Wt}function qo($e,it){var Tt=$e.static,Wt=$e.dynamic;if(P in Tt){var Vt=Tt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(ir,rr){var Bt=ir.link(Vt),Yt=ir.shared;rr.set(Yt.framebuffer,".next",Bt);var Ht=Yt.context;return rr.set(Ht,"."+en,Bt+".width"),rr.set(Ht,"."+xn,Bt+".height"),Bt})):zi(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Yt=Bt.context;return rr.set(Yt,"."+en,Yt+"."+bt),rr.set(Yt,"."+xn,Yt+"."+zt),"null"})}else if(P in Wt){var Jt=Wt[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Yt=ir.shared,Ht=Yt.framebuffer,Or=rr.def(Ht,".getFramebuffer(",Bt,")");rr.set(Ht,".next",Or);var Wr=Yt.context;return rr.set(Wr,"."+en,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var Wt=$e.static,Vt=$e.dynamic;function Jt(Bt){if(Bt in Wt){var Yt=Wt[Bt],Ht=!0,Or=Yt.x|0,Wr=Yt.y|0,fn,ua;return"width"in Yt?fn=Yt.width|0:Ht=!1,"height"in Yt?ua=Yt.height|0:Ht=!1,new ai(!Ht&&it&&it.thisDep,!Ht&&it&&it.contextDep,!Ht&&it&&it.propDep,function(ca,va){var Pa=ca.shared.context,ha=fn;"width"in Yt||(ha=va.def(Pa,".",en,"-",Or));var Fa=ua;return"height"in Yt||(Fa=va.def(Pa,".",xn,"-",Wr)),[Or,Wr,ha,Fa]})}else if(Bt in Vt){var Zn=Vt[Bt],Gn=Vi(Zn,function(ca,va){var Pa=ca.invoke(va,Zn),ha=ca.shared.context,Fa=va.def(Pa,".x|0"),Ka=va.def(Pa,".y|0"),wi=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ha,".",en,"-",Fa,")"),qi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ha,".",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(ca,va){var Pa=ca.shared.context;return[0,0,va.def(Pa,".",en),va.def(Pa,".",xn)]}):null}var ir=Jt(Bc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Yt){var Ht=rr.append(Bt,Yt),Or=Bt.shared.context;return Yt.set(Or,"."+Ze,Ht[2]),Yt.set(Or,"."+tt,Ht[3]),Ht})}return{viewport:ir,scissor_box:Jt($c)}}function cl($e,it){var Tt=$e.static,Wt=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if(Wt){if(Object.keys(it.dynamic).length>0)return null;var Vt=it.static,Jt=Object.keys(Vt);if(Jt.length>0&&typeof Vt[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",ca,"=",ua,".createStream(",Ut,",",Ht,".buffer);","}else{",ca,"=",ua,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Wr.glTypes,"[",Ht,".type]:",ca,".dtype;",Zn.normalized,"=!!",Ht,".normalized;");function Pa(ha){Yt(Zn[ha],"=",Ht,".",ha,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Yt("}}"),Yt.exit("if(",Zn.isStream,"){",ua,".destroyStream(",ca,");","}"),Zn}Vt[Jt]=Vi(ir,rr)}),Vt}function Ju($e){var it=$e.static,Tt=$e.dynamic,Wt={};return Object.keys(it).forEach(function(Vt){var Jt=it[Vt];Wt[Vt]=zi(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Vt){var Jt=Tt[Vt];Wt[Vt]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),Wt}function _f($e,it,Tt,Wt,Vt){$e.static,$e.dynamic;var Jt=cl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Yt=tl($e),Ht=es($e,Vt,Jt);function Or(ca){var va=rr[ca];va&&(Yt[ca]=va)}Or(Bc),Or(Dn($c));var Wr=Object.keys(Yt).length>0,fn={framebuffer:ir,draw:Bt,shader:Ht,state:Yt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Ao($e),fn.uniforms=gu(Tt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var ua=!0,Zn=Ht.program.attributes.map(function(ca){var va=it.static[ca];return ua=ua&&!!va,va});if(ua&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));fn.drawVAO=new ai(null,null,null,function(ca,va){return ca.link(Gn)}),fn.useVAO=!0}}return Jt?fn.useVAO=!0:fn.attributes=Fu(it),fn.context=Ju(Wt),fn}function tu($e,it,Tt){var Wt=$e.shared,Vt=Wt.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Vt,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Vt,".",ir,"=[",Bt.join(),"];"):Jt(Vt,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,Wt){var Vt=$e.shared,Jt=Vt.gl,ir=Vt.framebuffer,rr;ia&&(rr=it.def(Vt.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Yt=Bt.drawBuffer,Ht=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),Wt||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),ia&&it(rr,".drawBuffersWEBGL(",Yt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),ia&&it(rr,".drawBuffersWEBGL(",Ht,");"),it("}",ir,".cur=",Or,";"),Wt||it("}")}function fo($e,it,Tt){var Wt=$e.shared,Vt=Wt.gl,Jt=$e.current,ir=$e.next,rr=Wt.current,Bt=Wt.next,Yt=$e.cond(rr,".dirty");oa.forEach(function(Ht){var Or=Dn(Ht);if(!(Or in Tt.state)){var Wr,fn;if(Or in ir){Wr=ir[Or],fn=Jt[Or];var ua=m(Ua[Or].length,function(Gn){return Yt.def(Wr,"[",Gn,"]")});Yt($e.cond(ua.map(function(Gn,ca){return Gn+"!=="+fn+"["+ca+"]"}).join("||")).then(Vt,".",ii[Or],"(",ua,");",ua.map(function(Gn,ca){return fn+"["+ca+"]="+Gn}).join(";"),";"))}else{Wr=Yt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Yt(Zn),Or in Yn?Zn($e.cond(Wr).then(Vt,".enable(",Yn[Or],");").else(Vt,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Vt,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Yt(rr,".dirty=false;"),it(Yt)}function Qu($e,it,Tt,Wt){var Vt=$e.shared,Jt=$e.current,ir=Vt.current,rr=Vt.gl,Bt;sa(Object.keys(Tt)).forEach(function(Yt){var Ht=Tt[Yt];if(!(Wt&&!Wt(Ht))){var Or=Ht.append($e,it);if(Yn[Yt]){var Wr=Yn[Yt];Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Yt,"=",Or,";"))}else if(jn(Or)){var fn=Jt[Yt];it(rr,".",ii[Yt],"(",Or,");",Or.map(function(ua,Zn){return fn+"["+Zn+"]="+ua}).join(";"),";")}else Yi(Ht)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Yt],"(",Bt,");",ir,".",Yt,"=",Bt,";")):it(rr,".",ii[Yt],"(",Or,");",ir,".",Yt,"=",Or,";")}})}function js($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Ol($e,it,Tt,Wt,Vt){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Yt=Tt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function fn(Pa){Or=it.def(),Pa(Or,"=",Ht(),";"),typeof Vt=="string"?Pa(ir,".count+=",Vt,";"):Pa(ir,".count++;"),Ga&&(Wt?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function ua(Pa){Pa(ir,".cpuTime+=",Ht(),"-",Or,";"),Ga&&(Wt?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var ha=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",ha,";")}var Gn;if(Yt){if(Yi(Yt)){Yt.enable?(fn(it),ua(it.exit),Zn("true")):Zn("false");return}Gn=Yt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ca=$e.block();fn(ca),it("if(",Gn,"){",ca,"}");var va=$e.block();ua(va),it.exit("if(",Gn,"){",va,"}")}function hc($e,it,Tt,Wt,Vt){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case al:return 2;case Wi:case Js:case mu:return 3;case To:case Qs:case iu:return 4;default:return 1}}function rr(Bt,Yt,Ht){var Or=Jt.gl,Wr=it.def(Bt,".location"),fn=it.def(Jt.attributes,"[",Wr,"]"),ua=Ht.state,Zn=Ht.buffer,Gn=[Ht.x,Ht.y,Ht.z,Ht.w],ca=["buffer","normalized","offset","stride"];function va(){it("if(!",fn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var ha=Ht.type,Fa;if(Ht.size?Fa=it.def(Ht.size,"||",Yt):Fa=Yt,it("if(",fn,".type!==",ha,"||",fn,".size!==",Fa,"||",ca.map(function(wi){return fn+"."+wi+"!=="+Ht[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,ha,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ha,";",fn,".size=",Fa,";",ca.map(function(wi){return fn+"."+wi+"="+Ht[wi]+";"}).join(""),"}"),ya){var Ka=Ht.divisor;it("if(",fn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",fn,".divisor=",Ka,";}")}}function Pa(){it("if(",fn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",fn,".buffer=null;","}if(",Ha.map(function(ha,Fa){return fn+"."+ha+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(ha,Fa){return fn+"."+ha+"="+Gn[Fa]+";"}).join(""),"}")}ua===Qa?va():ua===Na?Pa():(it("if(",ua,"===",Qa,"){"),va(),it("}else{"),Pa(),it("}"))}Wt.forEach(function(Bt){var Yt=Bt.name,Ht=Tt.attributes[Yt],Or;if(Ht){if(!Vt(Ht))return;Or=Ht.append($e,it)}else{if(!Vt(_o))return;var Wr=$e.scopeAttrib(Yt);Or={},Object.keys(new Fn).forEach(function(fn){Or[fn]=it.def(Wr,".",fn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function dc($e,it,Tt,Wt,Vt,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Yt=0;Yt1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,fn,ua,Zn],");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function ha(){function Fa(){Tt(Jt+".drawElements("+[Wr,ua,ca,fn+"<<(("+ca+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,fn,ua]+");")}Ht&&Ht!=="null"?va?Fa():(Tt("if(",Ht,"){"),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){"),ha(),Tt("}")):Pa():ha()}function ds($e,it,Tt,Wt,Vt){var Jt=Ya(),ir=Jt.proc("body",Vt);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,Wt),Jt.compile().body}function _s($e,it,Tt,Wt){js($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);"),hc($e,it,Tt,Wt.attributes,function(){return!0})),dc($e,it,Tt,Wt.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);js($e,Tt),tu($e,Tt,it.context),du($e,Tt,it.framebuffer),fo($e,Tt,it),Qu($e,Tt,it.state),Ol($e,Tt,it,!1,!0);var Wt=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Wt,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Vt=$e.global.def("{}"),Jt=Tt.def(Wt,".id"),ir=Tt.def(Vt,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Vt,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",Wt,");",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,Wt){$e.batchId="a1",js($e,it);function Vt(){return!0}hc($e,it,Tt,Wt.attributes,Vt),dc($e,it,Tt,Wt.uniforms,Vt,!1),Co($e,it,it,Tt)}function he($e,it,Tt,Wt){js($e,it);var Vt=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Yt=$e.scope(),Ht=$e.scope();it(Yt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Ht,"}",Yt.exit);function Or(ca){return ca.contextDep&&Vt||ca.propDep}function Wr(ca){return!Or(ca)}if(Tt.needsContext&&tu($e,Ht,Tt.context),Tt.needsFramebuffer&&du($e,Ht,Tt.framebuffer),Qu($e,Ht,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Ol($e,Ht,Tt,!1,!0),Wt)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Ht($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Ht),");"):Yt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Yt),");"):Yt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Yt($e.shared.vao,".setVAO(null);"),hc($e,Yt,Tt,Wt.attributes,Wr),hc($e,Ht,Tt,Wt.attributes,Or)),dc($e,Yt,Tt,Wt.uniforms,Wr,!1),dc($e,Ht,Tt,Wt.uniforms,Or,!0),Co($e,Yt,Ht,Tt);else{var fn=$e.global.def("{}"),ua=Tt.shader.progVar.append($e,Ht),Zn=Ht.def(ua,".id"),Gn=Ht.def(fn,"[",Zn,"]");Ht($e.shared.gl,".useProgram(",ua,".program);","if(!",Gn,"){",Gn,"=",fn,"[",Zn,"]=",$e.link(function(ca){return ds(q,$e,Tt,ca,2)}),"(",ua,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",js($e,Tt);var Wt=!1,Vt=!0;Object.keys(it.context).forEach(function(fn){Wt=Wt||it.context[fn].propDep}),Wt||(tu($e,Tt,it.context),Vt=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?Wt=ir=!0:Jt.contextDep&&Wt&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&(Wt=!0);function rr(fn){return fn.contextDep&&Wt||fn.propDep}fo($e,Tt,it),Qu($e,Tt,it.state,function(fn){return!rr(fn)}),(!it.profile||!rr(it.profile))&&Ol($e,Tt,it,!1,"a1"),it.contextDep=Wt,it.needsContext=Vt,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&Wt||Bt.propDep)he($e,Tt,it,null);else{var Yt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Yt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Or=Tt.def(Yt,".id"),Wr=Tt.def(Ht,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Ht,"[",Or,"]=",$e.link(function(fn){return ds(he,$e,it,fn,2)}),"(",Yt,");",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 Wt=$e.shared,Vt=Wt.current;if(tu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),sa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Yt=Bt.append($e,Tt);jn(Yt)?Yt.forEach(function(Ht,Or){Oi(Ht)?Tt.set($e.next[rr],"["+Or+"]",Ht):Tt.set($e.next[rr],"["+Or+"]",$e.link(Ht,{stable:!0}))}):Yi(Bt)?Tt.set(Wt.next,"."+rr,$e.link(Yt,{stable:!0})):Tt.set(Wt.next,"."+rr,Yt)}),Ol($e,Tt,it,!0,!0),[Ce,kt,_t,Gt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.draw,"."+rr,Yt):Tt.set(Wt.draw,"."+rr,$e.link(Yt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Yt){return Oi(Yt)?Yt:$e.link(Yt,{stable:!0})})+"]"),Tt.set(Wt.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Yt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Ht){Tt.set(Yt,"."+Ht,Bt[Ht])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);Oi(Jt)?Tt.set(Wt.vao,".targetVAO",Jt):Tt.set(Wt.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Yt=Bt.append($e,Tt);Oi(Yt)?Tt.set(Wt.shader,"."+rr,Yt):Tt.set(Wt.shader,"."+rr,$e.link(Yt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Vt,".dirty=true;"),Tt.exit(Vt,".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=Oi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&Oi.length>0&&(Ya=c.next(Ao))}function Qo(){Ya&&(c.cancel(Ao),Ya=null)}function cl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),fa.restore(),Ua.restore(),ta.restore(),Ri.restore(),oa.restore(),Yn.restore(),ia.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,cl,!1),Oa.addEventListener(zl,es,!1));function Eu(){Oi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,cl),Oa.removeEventListener(zl,es)),Ua.clear(),Yn.clear(),oa.clear(),ia.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ds(Vt){var Jt=h({},Vt);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(Yt){Jt[rr+"."+Yt]=Bt[Yt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Vt&&(Jt.vao=Vt.vao),Jt}function _s(Vt,Jt){var ir={},rr={};return Object.keys(Vt).forEach(function(Bt){var Yt=Vt[Bt];if(f.isDynamic(Yt)){rr[Bt]=f.unbox(Yt,Bt);return}else if(Jt&&Array.isArray(Yt)){for(var Ht=0;Ht0)return pt.call(this,Tt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return pt.call(this,Vt,Vt.length)}else return ft.call(this,Vt)}return h(Wt,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=tl({framebuffer:f.define.call(null,Ac,"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|=eu),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Ju(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){Oi.push(Co);function ds(){var _s=Kc(Oi,Co);function be(){var q=Kc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&Qo()}Oi[_s]=be}return qo(),{cancel:ds}}function tu(){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=Qu(),tu(),ii.procs.poll()}function fo(){Ri.refresh(),tu(),ii.procs.refresh(),Da&&Da.update()}function Qu(){return(p()-Za)/1e3}fo();function js(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 Ol(){return za}function hc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var dc=h(tl,{clear:Ju,prop:f.define.bind(null,Ac),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:tl({}),buffer:function(Co){return ta.create(Co,el,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:oa.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:ia.createVAO,attributes:Ln,frame:_f,on:js,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:fo,poll:function(){du(),Da&&Da.update()},now:Qu,stats:pn,getCachedCode:Ol,preloadCachedCode:hc});return yr.onDone(null,dc),dc}return Pu})}}),jE=Ge({"src/lib/prepare_regl.js"(K,G){var h=yC(),b=dz();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}}}),lL=Ge({"src/traces/scattergl/plot.js"(f,G){var h=UC(),b=JC(),S=$D(),E=hz(),e=_n(),t=Up().selectMode,r=jE(),o=uu(),n=up(),i=FC().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]}}}}),Tz=Ge({"src/traces/splom/plot.js"(K,G){var h=wz(),b=_n(),S=Df(),E=Up().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}}}),Pz=Ge({"src/traces/parcoords/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=kc().defaults,e=yd(),t=Ts(),r=fL(),o=hL(),n=aS().maxDimensionCount,i=qE();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")}}}),Rz=Ge({"src/traces/parcoords/calc.js"(K,G){var h=_n().isArrayOrTypedArray,b=Ec(),S=Og().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(),VE.default[K])S=VE.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(HE[a]!==void 0)return HE[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 VE,dL,HE,Dz=li({"node_modules/color-parse/index.js"(){VE=Eo(pC()),dL=Iz,HE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),iS,vL=li({"node_modules/color-space/rgb.js"(){iS={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),oS,zz=li({"node_modules/color-space/hsl.js"(){vL(),oS={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}},iS.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]}}}),pL={};wo(pL,{default:()=>Oz});function Oz(K){Array.isArray(K)&&K.raw&&(K=String.raw(...arguments)),K instanceof Number&&(K=+K);var G,h=dL(K);if(!h.space)return[];const b=h.space[0]==="h"?oS.min:iS.min,S=h.space[0]==="h"?oS.max:iS.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=oS.rgb(G)),G.push(Math.min(Math.max(h.alpha,0),1)),G}var Fz=li({"node_modules/color-rgba/index.js"(){Dz(),vL(),zz()}}),mL=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)}}}),Bz=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=aS().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 lt=1;lt=Nt||Mr>=Qt)return;var $r=nt.lineLayer.readPixel(Er,Qt-1-Mr),Sr=$r[3]!==0,Nr=Sr?$r[2]+256*($r[1]+256*$r[0]):null,Mt={x:Er,y:Mr,clientX:Ft.clientX,clientY:Ft.clientY,dataIndex:nt.model.key,curveNumber:Nr};Nr!==Le&&(Sr?ee.hover(Mt):ee.unhover&&ee.unhover(Mt),Le=Nr)}}),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 lt=Ae.selectAll("."+T.cn.axisExtentBottom).data(c,f);lt.enter().append("g").classed(T.cn.axisExtentBottom,!0),lt.attr("transform",function(nt){return o(0,nt.model.height+T.axisExtentOffset)});var dt=lt.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)}}}),gL=Ge({"src/traces/parcoords/plot.js"(r,G){var h=Nz(),b=jE(),S=mL().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}}),Uz=Ge({"src/traces/parcoords/base_plot.js"(K){var G=ki(),h=Bd().getModuleCalcData,b=gL(),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)}}}),jz=Ge({"src/traces/parcoords/base_index.js"(K,G){G.exports={attributes:fL(),supplyDefaults:Pz(),calc:Rz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Uz(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),qz=Ge({"src/traces/parcoords/index.js"(K,G){var h=jz();h.plot=gL(),G.exports=h}}),Vz=Ge({"lib/parcoords.js"(K,G){G.exports=qz()}}),yL=Ge({"src/traces/parcats/attributes.js"(K,G){var h=Ki().extendFlat,b=Gl(),S=Ns(),E=zu(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=kc().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}}}),Hz=Ge({"src/traces/parcats/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=kc().defaults,e=yd(),t=yL(),r=qE(),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)}})}}}),Gz=Ge({"src/traces/parcats/calc.js"(K,G){var h=Og().wrap,b=gd().hasColorscale,S=_d(),E=A1(),e=As(),t=_n(),r=Si();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}}}),Xz=Ge({"src/traces/parcats/parcats.js"(K,G){var h=ki(),b=(ao(),ui(xi)).interpolateNumber,S=Tx(),E=Yf(),e=_n(),t=e.strTranslate,r=As(),o=Is(),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,lt=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): "+lt.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]}),Nr=de.map(function(Mt){return Sr[Mt]});return Nr}Fe.sort(function($r,Sr){var Nr=Ye($r),Mt=Ye(Sr);return $.sortpaths==="backward"&&(Nr.reverse(),Mt.reverse()),Nr.push($r.valueInds[0]),Mt.push(Sr.valueInds[0]),$.bundlecolors&&(Nr.unshift($r.rawColor),Mt.unshift(Sr.rawColor)),NrMt?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,lt=(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:lt,bands:[],parcatsViewModel:$},lt=lt+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}}}}),_L=Ge({"src/traces/parcats/plot.js"(K,G){var h=Xz();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)}}}),Yz=Ge({"src/traces/parcats/base_plot.js"(K){var G=Bd().getModuleCalcData,h=_L(),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()}}}),Zz=Ge({"src/traces/parcats/index.js"(K,G){G.exports={attributes:yL(),supplyDefaults:Hz(),calc:Gz(),plot:_L(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:Yz(),categories:["noOpacity"],meta:{}}}}),Wz=Ge({"lib/parcats.js"(K,G){G.exports=Zz()}}),Wy=Ge({"src/plots/mapbox/constants.js"(K,G){var h=zp(),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')`}}}}),sS=Ge({"src/plots/mapbox/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=kc().attributes,E=Ns(),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"}}}),GE=Ge({"src/traces/scattermapbox/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=$b(),t=Gc(),r=sS(),o=Gl(),n=zu(),i=Ki().extendFlat,a=Hc().overrideAll,s=sS(),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")}}),xL=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}}}}),$z=Ge({"src/traces/scattermapbox/defaults.js"(K,G){var h=_n(),b=uu(),S=Kd(),E=Vp(),e=op(),t=Nd(),r=GE(),o=xL().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}}}),bL=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}}}),wL=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}}}}),Kz=Ge({"src/traces/scattermapbox/convert.js"(K,G){var h=Si(),b=_n(),S=Ii().BADNUM,E=F_(),e=Ec(),t=As(),r=Fp(),o=uu(),n=xL().isSupportedFont,i=wL(),a=$d().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}}}),Jz=Ge({"src/traces/scattermapbox/plot.js"(K,G){var h=_n(),b=Kz(),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}}}),Qz=Ge({"src/traces/scattermapbox/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),e7=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(jt,nr){jt&&(De=jt),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 jt=He||yt;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){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 jt=this._customAccessToken||Ft(se.params)||Le.ACCESS_TOKEN;return Le.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/",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(jt){return!jt.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 lt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function dt(k){return lt.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},jt=X?_(yt,X):yt,nr={url:ar(He),headers:{"Content-Type":"text/plain"},body:JSON.stringify([jt])};this.pendingRequest=Tn(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(jt){jt||He&&(Te.success[He]=!0)},se))}},C})($r),Nr=(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=Mr(Le.ACCESS_TOKEN),He=De?De.u:Le.ACCESS_TOKEN,yt=He!==this.eventData.tokenU;I(this.anonId)||(this.anonId=d(),yt=!0);var jt=this.queue.shift();if(this.eventData.lastSuccess){var nr=new Date(this.eventData.lastSuccess),dr=new Date(jt),Fr=(jt-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(jt,{"enabled.telemetry":!1},function(rn){rn||(Te.eventData.lastSuccess=jt,Te.eventData.tokenU=He)},se)}},C})($r),Mt=new Nr,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 Br=1/0;function kn(k){Br++,Br>Ee&&(k.getActor().send("enforceCacheSizeLimit",ye),Br=0)}function Wn(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(!qt(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)},sn=function(k,C){return Gr(_(k,{type:"json"}),C)},mn=function(k,C){return Gr(_(k,{type:"arrayBuffer"}),C)},Tn=function(k,C){return Gr(_(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 ma="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function da(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=ma})},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):ma}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 Mi=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,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"}},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:"*"}},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"}},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"}}},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"],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"}},Hi={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"}},fi={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"}},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"}},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"}},vo={"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"}},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"}},Pl={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ms={"*":{type:"string"}},di={$version:qr,$root:ln,sources:Jr,source:At,source_vector:lr,source_raster:zr,source_raster_dem:un,source_geojson:Rn,source_video:qn,source_image:jn,layer:cn,layout:In,layout_background:gi,layout_fill:Ea,layout_circle:Ci,layout_heatmap:Hi,"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:fi,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:sl,paint_circle:fs,paint_heatmap:Zo,paint_symbol:vo,paint_raster:hs,paint_hillshade:ll,paint_background:kl,transition:Pl,"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 Yu=[Au,Ji,gs,rs,Xl,Os,Yl,Fl(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=Yu;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 jt(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),$n=dr.substr(rn+1,Kr-(rn+1)).split(","),ja=1;switch(bn){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 wa=(parseFloat($n[0])%360+360)%360/360,mi=He($n[1]),Ja=He($n[2]),vi=Ja<=.5?Ja*(mi+1):Ja+mi-Ja*mi,Ei=Ja*2-vi;return[se(yt(Ei,vi,wa+1/3)*255),se(yt(Ei,vi,wa)*255),se(yt(Ei,vi,wa-1/3)*255),ja];default:return null}}return null}try{C.parseCSSColor=jt}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 Ic=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"})};Ic.prototype.compare=function(C,X){return this.collator.compare(C,X)},Ic.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 Ic)return!0;if(k instanceof oc)return!0;if(k instanceof Zu)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 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++}Te=Fl(He,jt)}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 jt=null;if(yt["font-scale"]&&(jt=X.parse(yt["font-scale"],1,Ji),!jt))return null;var nr=null;if(yt["text-font"]&&(nr=X.parse(yt["text-font"],1,Fl(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=jt,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 Jl(Te)===wl?new zh("",Te,null,null,null):new zh(Wu(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":Ji,"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 Il(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,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,jt=k;yt=0)return!1;var X=!0;return k.eachChild(function(se){X&&!zc(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 Ql=function(C,X,se,Te,De){X===void 0&&(X=[]),Te===void 0&&(Te=new ul),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};Ql.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)},Ql.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 bc(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,jt=He.type;if((yt.kind==="string"||yt.kind==="number"||yt.kind==="boolean"||yt.kind==="object"||yt.kind==="array")&&jt.kind==="value")He=se(He,yt,X.typeAnnotation||"assert");else if((yt.kind==="color"||yt.kind==="formatted"||yt.kind==="resolvedImage")&&(jt.kind==="value"||jt.kind==="string"))He=se(He,yt,X.typeAnnotation||"coerce");else if(this.checkSubtype(yt,jt))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.")},Ql.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 Ql(this.registry,Te,X||null,De,this.errors)},Ql.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))},Ql.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 Dc)return!1;var C=k instanceof Fs||k instanceof bc,X=!0;return k.eachChild(function(se){C?X=X&&kf(se):X=X&&se instanceof Hs}),X?Zh(k)&&zc(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function mc(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 Il("Input is not a number.");return 0}var Oc=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(jt,dr,De);if(!Fr)return null;De=De||Fr.type,Te.push([yt,Fr])}return new Oc(De,se,Te)},Oc.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=mc(X,Te);return se[He].evaluate(C)},Oc.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,ev=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 au(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Fc(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function sf(k){var C=Fc(k.r),X=Fc(k.g),se=Fc(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)/ev);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=ev*ih(se),new Tl(au(3.2404542*X-1.5371385*C-.4985314*se),au(-.969266*X+1.8760108*C+.041556*se),au(.0556434*X-.2040259*C+1.0572252*se),k.alpha)}function su(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:su},vh={forward:hh,reverse:qf,interpolate:dh},kd=Object.freeze({__proto__:null,lab:mf,hcl:vh}),fc=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:jt}}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,Ji),!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,$n,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 "+ql(dr)+" is not interpolatable."):new fc(dr,se,Te,De,nr)},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=mc(X,Te),yt=X[He],jt=X[He+1],nr=fc.interpolationFactor(this.interpolation,Te,yt,jt),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))},fc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X=se.length)throw new Il("Array index out of bounds: "+X+" > "+(se.length-1)+".");if(X!==Math.floor(X))throw new Il("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,Ji,Au,Io])?new Su(se,Te):X.error("Expected first argument to be of type boolean, string, number or null, but found "+ql(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 Il("Expected first argument to be of type boolean, string, number or null, but found "+ql(Jl(X))+" instead.");if(!rf(se,["string","array"]))throw new Il("Expected second argument to be of type array or string, but found "+ql(Jl(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 wc=function(C,X,se){this.type=Ji,this.needle=C,this.haystack=X,this.fromIndex=se};wc.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,Ji,Au,Io]))return X.error("Expected first argument to be of type boolean, string, number or null, but found "+ql(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ji);return De?new wc(se,Te,De):null}else return new wc(se,Te)},wc.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!rf(X,["boolean","string","number","null"]))throw new Il("Expected first argument to be of type boolean, string, number or null, but found "+ql(Jl(X))+" instead.");if(!rf(se,["string","array"]))throw new Il("Expected second argument to be of type array or string, but found "+ql(Jl(se))+" instead.");if(this.fromIndex){var Te=this.fromIndex.evaluate(C);return se.indexOf(X,Te)}return se.indexOf(X)},wc.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},wc.prototype.outputDefined=function(){return!1},wc.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=Jl(Kr);else if(dr.checkSubtype(se,Jl(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 $n=X.parse(C[1],1,Io);if(!$n)return null;var ja=X.parse(C[C.length-1],C.length-1,Te);return!ja||$n.type.kind!=="value"&&X.concat(1).checkSubtype(se,$n.type)?null:new pu(se,Te,$n,De,He,ja)},pu.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=Jl(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,Ji);if(!se||!Te)return null;if(!Xc(se.type,[Fl(Io),gs,Io]))return X.error("Expected first argument to be of type array or string, but found "+ql(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ji);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 Il("Expected first argument to be of type array or string, but found "+ql(Jl(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 fr(k,C,X){return C===X}function Rr(k,C,X){return C!==X}function vn(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 ci(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 jt=He[0],nr=yt.parse(He[1],1,Io);if(!nr)return null;if(!jh(jt,nr.type))return yt.concat(1).error('"'+jt+`" comparisons are not supported for type '`+ql(nr.type)+"'.");var dr=yt.parse(He[2],2,Io);if(!dr)return null;if(!jh(jt,dr.type))return yt.concat(2).error('"'+jt+`" comparisons are not supported for type '`+ql(dr.type)+"'.");if(nr.type.kind!==dr.type.kind&&nr.type.kind!=="value"&&dr.type.kind!=="value")return yt.error("Cannot compare types '"+ql(nr.type)+"' and '"+ql(dr.type)+"'.");se&&(nr.type.kind==="value"&&dr.type.kind!=="value"?nr=new bc(dr.type,[nr]):nr.type.kind!=="value"&&dr.type.kind==="value"&&(dr=new bc(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),jt=this.rhs.evaluate(He);if(se&&this.hasUntypedArgument){var nr=Jl(yt),dr=Jl(jt);if(nr.kind!==dr.kind||!(nr.kind==="string"||nr.kind==="number"))throw new Il('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=Jl(yt),rn=Jl(jt);if(Fr.kind!=="string"||rn.kind!=="string")return C(He,yt,jt)}return this.collator?X(He,yt,jt,this.collator.evaluate(He)):C(He,yt,jt)},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("==",fr,xa),Xi=Qa("!=",Rr,ti),No=Qa("<",vn,ci),Do=Qa(">",an,Ni),Go=Qa("<=",On,Ha),jo=Qa(">=",Aa,bi),Zi=function(C,X,se,Te,De){this.type=gs,this.number=C,this.locale=X,this.currency=se,this.minFractionDigits=Te,this.maxFractionDigits=De};Zi.parse=function(C,X){if(C.length!==3)return X.error("Expected two arguments.");var se=X.parse(C[1],1,Ji);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,Ji),!yt))return null;var jt=null;return Te["max-fraction-digits"]&&(jt=X.parse(Te["max-fraction-digits"],1,Ji),!jt)?null:new Zi(se,De,He,yt,jt)},Zi.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))},Zi.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)},Zi.prototype.outputDefined=function(){return!1},Zi.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=Ji,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 "+ql(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 Il("Expected value to be of type string or array, but found "+ql(Jl(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,"!=":Xi,">":Do,"<":No,">=":jo,"<=":Go,array:bc,at:gf,boolean:bc,case:Vf,coalesce:Wc,collator:af,format:Ff,image:fu,in:Su,"index-of":wc,interpolate:fc,"interpolate-hcl":fc,"interpolate-lab":fc,length:Li,let:Cf,literal:Hs,match:pu,number:bc,"number-format":Zi,object:bc,slice:yf,step:Oc,string:bc,"to-boolean":Fs,"to-color":Fs,"to-number":Fs,"to-string":Fs,var:Uf,within:Dc};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 Il(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 Il(X.evaluate(k))}],typeof:[gs,[Io],function(k,C){var X=C[0];return ql(Jl(X.evaluate(k)))}],"to-rgba":[Fl(Ji,4),[Xl],function(k,C){var X=C[0];return X.evaluate(k).toArray()}],rgb:[Xl,[Ji,Ji,Ji],Bs],rgba:[Xl,[Ji,Ji,Ji,Ji],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:[Ji,[],function(k){return k.globals.zoom}],"heatmap-density":[Ji,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Ji,[],function(k){return k.globals.lineProgress||0}],accumulated:[Io,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Ji,Wl(Ji),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,[Fl(gs)],function(k,C){var X=C[0];return X.value.indexOf(k.geometryType())>=0}],"filter-id-in":[rs,[Fl(Io)],function(k,C){var X=C[0];return X.value.indexOf(k.id())>=0}],"filter-in-small":[rs,[gs,Fl(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,Fl(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 Dl(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function ml(k){return k}function gc(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(po){return[po[0],Tl.parse(po[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,jt,nr;if(He==="exponential")yt=_c;else if(He==="interval")yt=$f;else if(He==="categorical"){yt=Tc,jt=Object.create(null);for(var dr=0,Fr=k.stops;dr=k.stops[se-1][0])return k.stops[se-1][1];var Te=mc(k.stops.map(function(De){return De[0]}),X);return k.stops[Te][1]}function _c(k,C,X){var se=k.base!==void 0?k.base:1;if(ys(X)!=="number")return yc(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=mc(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],jt=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),$n=jt.evaluate.apply(void 0,rn);if(!(bn===void 0||$n===void 0))return nr(bn,$n,He)}}:nr(yt,jt,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=Zu.fromString(X.toString()):ys(X)!==C.type&&(C.type!=="enum"||!C.values[X])&&(X=void 0),yc(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 Il("Expected value to be one of "+Object.keys(this._enumValues).map(function(jt){return JSON.stringify(jt)}).join(", ")+", but found "+JSON.stringify(yt)+" instead.");return yt}catch(jt){return this._warningHistory[jt.message]||(this._warningHistory[jt.message]=!0,typeof console<"u"&&console.warn(jt.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 Ql(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?fc.interpolationFactor(this.interpolationType,C,X,se):0};function Bc(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=zc(X,["zoom"]);if(!Te&&!Vl(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 fc&&!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 fc?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,gc(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(Dl(k))return new Ue(k,C);if(Xo(k)){var X=Bc(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 Gt(k){var C=k.valueSpec,X=Fo(k.value.type),se,Te={},De,He,yt=X!=="categorical"&&k.value.property===void 0,jt=!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&&(jt&&!Mu(k.valueSpec)?dr.push(new to(k.key,k.value,"property functions not supported")):yt&&!Vl(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($n){if(X==="identity")return[new to($n.key,$n.value,'identity function may not have a "stops" property')];var ja=[],wa=$n.value;return ja=ja.concat(_t({key:$n.key,value:wa,valueSpec:$n.valueSpec,style:$n.style,styleSpec:$n.styleSpec,arrayElementValidator:rn})),ys(wa)==="array"&&wa.length===0&&ja.push(new to($n.key,wa,"array must have at least one stop")),ja}function rn($n){var ja=[],wa=$n.value,mi=$n.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:$n.style,styleSpec:$n.styleSpec,objectElementValidators:{zoom:kt,value:Kr}}))}else ja=ja.concat(Kr({key:mi+"[0]",value:wa[0],style:$n.style,styleSpec:$n.styleSpec},wa));return Xo(Rl(wa[1]))?ja.concat([new to(mi+"[1]",wa[1],"expressions are not allowed in function stops.")]):ja.concat(Qs({key:mi+"[1]",value:wa[1],valueSpec:C,style:$n.style,styleSpec:$n.styleSpec}))}function Kr($n,ja){var wa=ys($n.value),mi=Fo($n.value),Ja=$n.value!==null?$n.value:ja;if(!se)se=wa;else if(wa!==se)return[new to($n.key,Ja,wa+" stop domain type must match previous stop domain type "+se)];if(wa!=="number"&&wa!=="string"&&wa!=="boolean")return[new to($n.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($n.key,Ja,vi)]}return X==="categorical"&&wa==="number"&&(!isFinite(mi)||Math.floor(mi)!==mi)?[new to($n.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(Rl(k.value))?hr(Ps({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):on(k)}function on(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(en({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 jt=this._convertToCellCoord(k),nr=this._convertToCellCoord(C),dr=this._convertToCellCoord(X),Fr=this._convertToCellCoord(se),rn=jt;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[jt].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 jt!=="Object"&&(nr.$name=jt),nr}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||_r(k)||Zr(k)||ArrayBuffer.isView(k)||k instanceof wt)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 Te=Object.create(se.prototype),De=0,He=Object.keys(k);De=0?jt:hn(jt)}}return Te}throw new Error("can't deserialize object of type "+typeof k)}var Sn=function(){this.first=!0};Sn.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 sa(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 Yi(k){return k>=1424&&k<=2303||Cn["Arabic Presentation Forms-A"](k)||Cn["Arabic Presentation Forms-B"](k)}function zi(k,C){return!(!C&&Yi(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(){eu.fire(new jr("pluginStateChange",{pluginStatus:Po,pluginURL:os}))}var eu=new Dr,lo=function(){return Po},Ls=function(k){return k({pluginStatus:Po,pluginURL:os}),eu.on("pluginStateChange",k),k},el=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&&mn({url:os},function(k){k?nl(k):(Po=ko.loaded,Iu())})},zl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Po===ko.loaded||zl.applyArabicShaping!=null},isLoading:function(){return Po===ko.loading},setState:function(C){Po=C.pluginStatus,os=C.pluginURL},isParsed:function(){return zl.applyArabicShaping!=null&&zl.processBidirectionalText!=null&&zl.processStyledBidirectionalText!=null},getPluginURL:function(){return os}},Ac=function(){!zl.isLoading()&&!zl.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 Sn,this.transition={})};El.prototype.isSupportedScript=function(C){return _o(C,zl.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})(pn),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",pn),tr("DataConstantProperty",gn),tr("CrossFadedDataDrivenProperty",za),tr("CrossFadedProperty",Ia),tr("ColorRampProperty",Da);var Bi="-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 fa(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,Bi)?this._transitionablePaint.getTransition(se.slice(0,-Bi.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,Bi))return this._transitionablePaint.setTransition(se.slice(0,-Bi.length),Te||void 0),!1;var yt=this._transitionablePaint._values[se],jt=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||jt||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:Nc(this,se.call(ks,{key:Te,layerType:this.type,objectKey:De,value:He,styleSpec:di,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},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},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=ia(He.type),jt=X=hi(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:jt}}),De=hi(X,Math.max(se,C));return{members:Te,size:De,alignment:C}}function ia(k){return Ga[k].BYTES_PER_ELEMENT}function hi(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 jt=se*4;return this.int16[jt+0]=Te,this.int16[jt+1]=De,this.int16[jt+2]=He,this.int16[jt+3]=yt,se},C})(ta);Ri.prototype.bytesPerElement=8,tr("StructArrayLayout4i8",Ri);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.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,this.int16[dr+5]=nr,se},C})(ta);oa.prototype.bytesPerElement=12,tr("StructArrayLayout2i4i12",oa);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,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt,nr,dr,Fr,rn){var Kr=this.length;return this.resize(Kr+1),this.emplace(Kr,se,Te,De,He,yt,jt,nr,dr,Fr,rn)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt,nr,dr,Fr,rn,Kr,bn){var $n=this.length;return this.resize($n+1),this.emplace($n,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n){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]=jt,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]=$n,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 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 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);Oi.prototype.bytesPerElement=4,tr("StructArrayLayout1ul4",Oi);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,jt,nr,dr,Fr){var rn=this.length;return this.resize(rn+1),this.emplace(rn,se,Te,De,He,yt,jt,nr,dr,Fr)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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,jt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,jt)},C.prototype.emplace=function(se,Te,De,He,yt,jt,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]=jt,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 jt=this.length;return this.resize(jt+1),this.emplace(jt,se,Te,De,He,yt)},C.prototype.emplace=function(se,Te,De,He,yt,jt){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]=jt,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 jt=se*12,nr=se*3;return this.uint8[jt+0]=Te,this.uint8[jt+1]=De,this.float32[nr+1]=He,this.float32[nr+2]=yt,se},C})(ta);Ya.prototype.bytesPerElement=12,tr("StructArrayLayout2ub2f12",Ya);var Ao=(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);Ao.prototype.bytesPerElement=6,tr("StructArrayLayout3ui6",Ao);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,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja){var vi=this.length;return this.resize(vi+1),this.emplace(vi,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi){var Ei=se*24,$i=se*12,xo=se*48;return this.int16[Ei+0]=Te,this.int16[Ei+1]=De,this.uint16[Ei+2]=He,this.uint16[Ei+3]=yt,this.uint32[$i+2]=jt,this.uint32[$i+3]=nr,this.uint32[$i+4]=dr,this.uint16[Ei+10]=Fr,this.uint16[Ei+11]=rn,this.uint16[Ei+12]=Kr,this.float32[$i+7]=bn,this.float32[$i+8]=$n,this.uint8[xo+36]=ja,this.uint8[xo+37]=wa,this.uint8[xo+38]=mi,this.uint32[$i+10]=Ja,this.int16[Ei+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,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms){var Hl=this.length;return this.resize(Hl+1),this.emplace(Hl,se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms)},C.prototype.emplace=function(se,Te,De,He,yt,jt,nr,dr,Fr,rn,Kr,bn,$n,ja,wa,mi,Ja,vi,Ei,$i,xo,po,ss,Bo,Ko,dl,ls,ms,Hl){var il=se*34,Nu=se*17;return this.int16[il+0]=Te,this.int16[il+1]=De,this.int16[il+2]=He,this.int16[il+3]=yt,this.int16[il+4]=jt,this.int16[il+5]=nr,this.int16[il+6]=dr,this.int16[il+7]=Fr,this.uint16[il+8]=rn,this.uint16[il+9]=Kr,this.uint16[il+10]=bn,this.uint16[il+11]=$n,this.uint16[il+12]=ja,this.uint16[il+13]=wa,this.uint16[il+14]=mi,this.uint16[il+15]=Ja,this.uint16[il+16]=vi,this.uint16[il+17]=Ei,this.uint16[il+18]=$i,this.uint16[il+19]=xo,this.uint16[il+20]=po,this.uint16[il+21]=ss,this.uint16[il+22]=Bo,this.uint32[Nu+12]=Ko,this.float32[Nu+13]=dl,this.float32[Nu+14]=ls,this.float32[Nu+15]=ms,this.float32[Nu+16]=Hl,se},C})(ta);Qo.prototype.bytesPerElement=68,tr("StructArrayLayout8i15ui1ul4f68",Qo);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 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);cl.prototype.bytesPerElement=4,tr("StructArrayLayout1f4",cl);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,jt=se*4;return this.uint32[yt+0]=Te,this.uint16[jt+2]=De,this.uint16[jt+3]=He,se},C})(ta);Eu.prototype.bytesPerElement=8,tr("StructArrayLayout1ul2ui8",Eu);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,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);tl.prototype.bytesPerElement=4,tr("StructArrayLayout2ui4",tl);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 jt=se*4;return this.float32[jt+0]=Te,this.float32[jt+1]=De,this.float32[jt+2]=He,this.float32[jt+3]=yt,se},C})(ta);Fu.prototype.bytesPerElement=16,tr("StructArrayLayout4f16",Fu);var Ju=(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);Ju.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 Ju(this,se)},C})(Lo);tr("CollisionBoxArray",_f);var tu=(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);tu.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 tu(this,se)},C})(qo);tr("PlacedSymbolArray",du);var fo=(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);fo.prototype.size=68;var Qu=(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 fo(this,se)},C})(Qo);tr("SymbolInstanceArray",Qu);var js=(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);tr("GlyphOffsetArray",js);var Ol=(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",Ol);var hc=(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);hc.prototype.size=8;var dc=(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 hc(this,se)},C})(Eu);tr("FeatureIndexArray",dc);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)*jt&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)*jt+(((dr>>>16)*jt&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],jt=this.positions[3*se+1],nr=this.positions[3*se+2];He.push({index:yt,start:jt,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;Wt(k,De,He),Wt(C,3*De,3*He),Wt(C,3*De+1,3*He+1),Wt(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 xl(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?fl(k):[]}}function _l(k,C,X,se,Te){k.emplaceBack(C*2+(se+1)/2,X*2+(Te+1)/2)}var ec=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 Ao,this.segments=new _s,this.programConfigurations=new ha(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};ec.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,jt=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",ec,{omit:["layers"]});function ol(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 rv(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 jt=[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=jt;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 nv(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 s6(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function l6(k,C,X){var se=C[0],Te=C[1],De=C[2],He=X[0],yt=X[1],jt=X[2];return k[0]=Te*jt-De*yt,k[1]=De*He-se*jt,k[2]=se*yt-Te*He,k}function u6(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 c6=Vm;(function(){var k=qm();return function(C,X,se,Te,De,He){var yt,jt;for(X||(X=3),se||(se=0),Te?jt=Math.min(Te*X+se,C.length):jt=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,jt=0;jt80*X){yt=nr=k[0],jt=dr=k[1];for(var bn=X;bnnr&&(nr=Fr),rn>dr&&(dr=rn);Kr=Math.max(nr-yt,dr-jt),Kr=Kr!==0?1/Kr:0}return jg(De,He,X,yt,jt,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=gS(De,k[De],k[De+1],He);return He&&r1(He,He.next)&&(W_(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(W_(X),X=C=X.prev,X===X.next)break;se=!0}else X=X.next;while(se||X!==C);return C}function jg(k,C,X,se,Te,De,He){if(k){!He&&De&&K3(k,se,Te,De);for(var yt=k,jt,nr;k.prev!==k.next;){if(jt=k.prev,nr=k.next,De?g6(k,se,Te,De):$3(k)){C.push(jt.i/X),C.push(k.i/X),C.push(nr.i/X),W_(k),k=nr.next,yt=nr.next;continue}if(k=nr,k===yt){He?He===1?(k=y6(tm(k),C,X),jg(k,C,X,se,Te,De,2)):He===2&&vS(k,C,X,se,Te,De):jg(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(Xm(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 g6(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,jt,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&&Xm(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&&Xm(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&&Xm(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&&Xm(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 y6(k,C,X){var se=k;do{var Te=se.prev,De=se.next.next;!r1(Te,De)&&qg(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),W_(se),W_(se.next),se=k=De),se=se.next}while(se!==k);return tm(se)}function vS(k,C,X,se,Te,De){var He=k;do{for(var yt=He.next.next;yt!==He.prev;){if(He.i!==yt.i&&x6(He,yt)){var jt=eT(He,yt);He=tm(He,He.next),jt=tm(jt,jt.next),jg(He,C,X,se,Te,De),jg(jt,C,X,se,Te,De);return}yt=yt.next}He=He.next}while(He!==k)}function pS(k,C,X,se){var Te=[],De,He,yt,jt,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&&Xm(TeHe.x||X.x===He.x&&mS(He,X)))&&(He=X,Fr=rn)),X=X.next;while(X!==jt);return He}function mS(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,_6(Te)}function _6(k){var C,X,se,Te,De,He,yt,jt,nr=1;do{for(X=k,k=null,De=null,He=0;X;){for(He++,se=X,yt=0,C=0;C0||jt>0&&se;)yt!==0&&(jt===0||!se||X.z<=se.z)?(Te=X,X=X.nextZ,yt--):(Te=se,se=se.nextZ,jt--),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 fw(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 x6(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Q3(k,C)&&(n1(k,C)&&n1(C,k)&&hw(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 qg(k,C,X,se){var Te=Z_(oh(k,C,X)),De=Z_(oh(k,C,se)),He=Z_(oh(X,se,k)),yt=Z_(oh(X,se,C));return!!(Te!==De&&He!==yt||Te===0&&Y_(k,X,C)||De===0&&Y_(k,se,C)||He===0&&Y_(X,k,se)||yt===0&&Y_(X,C,se))}function Y_(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 Z_(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&&qg(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 hw(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 dw(k.i,k.x,k.y),se=new dw(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 gS(k,C,X,se){var Te=new dw(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 W_(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 dw(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}cw.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,jt=C.length;yt0&&(se+=k[Te-1].length,X.holes.push(se))}return X},uw.default=dS;function b6(k,C,X,se,Te){yS(k,C,X,se||k.length-1,Te||rT)}function yS(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),jt=.5*Math.exp(2*yt/3),nr=.5*Math.sqrt(yt*jt*(De-jt)/De)*(He-De/2<0?-1:1),dr=Math.max(X,Math.floor(C-He*jt/De+nr)),Fr=Math.min(se,Math.floor(C+(De-He)*jt/De+nr));yS(k,C,dr,Fr,Te)}var rn=k[C],Kr=X,bn=se;for($_(k,X,C),Te(k[se],rn)>0&&$_(k,X,se);Kr0;)bn--}Te(k[X],rn)===0?$_(k,X,bn):(bn++,$_(k,bn,se)),bn<=C&&(X=bn+1),C<=bn&&(se=bn-1)}}function $_(k,C,X){var se=k[C];k[C]=k[X],k[X]=se}function rT(k,C){return kC?1:0}function A0(k,C){var X=k.length;if(X<=1)return[k];for(var se=[],Te,De,He=0;He1)for(var jt=0;jt>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},Vg.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,jt=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,jt,yt,nr]},Vg.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=Vg.types[this.type],jt,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}ES.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 CS=LS;function LS(k,C){this.layers=k.readFields(PS,{},C)}function PS(k,C,X){if(k===3){var se=new iT(X,X.readVarint()+X.pos);se.length&&(C[se.name]=se)}}var RS=CS,w6=a1,T6=iT,Hg={VectorTile:RS,VectorTileFeature:w6,VectorTileLayer:T6},i1=Hg.VectorTileFeature.types,IS=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 oa,this.indexArray=new Ao,this.programConfigurations=new ha(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=vw("fill-extrusion",this.layers,X);for(var Te=0,De=C;Te=1){var vi=ja[mi-1];if(!mw(Ja,vi)){Kr.vertexLength+4>_s.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Ei=Ja.sub(vi)._perp()._unit(),$i=vi.dist(Ja);wa+$i>32768&&(wa=0),s1(this.layoutVertexArray,Ja.x,Ja.y,Ei.x,Ei.y,0,0,wa),s1(this.layoutVertexArray,Ja.x,Ja.y,Ei.x,Ei.y,0,1,wa),wa+=$i,s1(this.layoutVertexArray,vi.x,vi.y,Ei.x,Ei.y,0,0,wa),s1(this.layoutVertexArray,vi.x,vi.y,Ei.x,Ei.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 po=[],ss=[],Bo=Kr.vertexLength,Ko=0,dl=jt;Koqi)||k.y===C.y&&(k.y<0||k.y>qi)}function gw(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 A6=new Za({"fill-extrusion-opacity":new gn(di["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new pn(di["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gn(di["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gn(di["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new za(di["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new pn(di["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new pn(di["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gn(di["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),S6={paint:A6},M6=(function(k){function C(X){k.call(this,X,S6)}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,jt,nr,dr){var Fr=dp(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,nr),rn=this.paint.get("fill-extrusion-height").evaluate(Te,De),Kr=this.paint.get("fill-extrusion-base").evaluate(Te,De),bn=DS(Fr,dr,jt,0),$n=oT(He,Kr,rn,dr),ja=$n[0],wa=$n[1];return Zm(ja,wa,bn)},C})(yi);function S0(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(po&&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 dl=bn&&$n,ls=dl?se:jt?"butt":Te;if(dl&&ls==="round"&&($iDe&&(ls="bevel"),ls==="bevel"&&($i>2&&(ls="flipbevel"),$i100)Ja=wa.mult(-1);else{var ms=$i*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 Hl=-Math.sqrt($i*$i-1),il=ss?Hl:0,Nu=ss?0:Hl;if(bn&&this.addCurrentVertex(Kr,ja,il,Nu,rn),ls==="fakeround")for(var qc=Math.round(xo*180/Math.PI/uT),Uu=1;Uu2*Fr){var nd=Kr.add($n.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,jt=X.y-X.x*se,nr=-X.x+X.y*Te,dr=-X.y-X.x*Te;this.addHalfVertex(C,yt,jt,He,!1,se,De),this.addHalfVertex(C,nr,dr,He,!0,-Te,De),this.distance>yw/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 jt=C.x,nr=C.y,dr=this.lineClips?this.scaledDistance*(yw-1):this.scaledDistance,Fr=dr*l1;if(this.layoutVertexArray.emplaceBack((jt<<1)+(Te?1:0),(nr<<1)+(De?1:0),Math.round(BS*X)+128,Math.round(BS*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 $n=yt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,$n),yt.primitiveLength++),De?this.e2=$n:this.e1=$n},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 gn(di.layout_line["line-cap"]),"line-join":new pn(di.layout_line["line-join"]),"line-miter-limit":new gn(di.layout_line["line-miter-limit"]),"line-round-limit":new gn(di.layout_line["line-round-limit"]),"line-sort-key":new pn(di.layout_line["line-sort-key"])}),_w=new Za({"line-opacity":new pn(di.paint_line["line-opacity"]),"line-color":new pn(di.paint_line["line-color"]),"line-translate":new gn(di.paint_line["line-translate"]),"line-translate-anchor":new gn(di.paint_line["line-translate-anchor"]),"line-width":new pn(di.paint_line["line-width"]),"line-gap-width":new pn(di.paint_line["line-gap-width"]),"line-offset":new pn(di.paint_line["line-offset"]),"line-blur":new pn(di.paint_line["line-blur"]),"line-dasharray":new Ia(di.paint_line["line-dasharray"]),"line-pattern":new za(di.paint_line["line-pattern"]),"line-gradient":new Da(di.paint_line["line-gradient"])}),u1={paint:_w,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})(pn),xw=new fT(u1.paint.properties["line-width"].specification);xw.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 Oc,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"]=xw.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=jS(nv("line-width",this,Te),nv("line-gap-width",this,Te)),He=nv("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,jt,nr){var dr=dp(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,nr),Fr=nr/2*jS(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 jS(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===jt)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,jt,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,$n=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*(jt=Math.pow(2,-He))<1&&(He--,jt*=2),He+Fr>=1?C+=rn/jt:C+=rn*Math.pow(2,1-Fr),C*jt>=2&&(He++,jt/=2),He+Fr>=dr?(yt=0,He=dr):He+Fr>=1?(yt=(C*jt-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]|=$n*128},dn={read:Hr,write:Qr},An=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 pa=65536*65536,oi=1/pa,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)*pa;return this.pos+=8,k},readSFixed64:function(){var k=Av(this.buf,this.pos)+Qh(this.buf,this.pos+4)*pa;return this.pos+=8,k},readFloat:function(){var k=dn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=dn.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&&ei?pv(this.buf,C,k):vv(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=co(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){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=mv(this.buf,k,this.pos);var X=this.pos-C;X>=128&&Ds(C,X,this),this.pos=C-1,this.writeVarint(X),this.pos+=X},writeFloat:function(k){this.realloc(4),dn.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),dn.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&&Ds(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,zs,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Qi,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Gs,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Ll,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 Fi(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 co(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 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),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 Ds(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 vv(k,C,X){for(var se="",Te=C;Te239?4:De>223?3:De>191?2:1;if(Te+yt>X)break;var jt,nr,dr;yt===1?De<128&&(He=De):yt===2?(jt=k[Te+1],(jt&192)===128&&(He=(De&31)<<6|jt&63,He<=127&&(He=null))):yt===3?(jt=k[Te+1],nr=k[Te+2],(jt&192)===128&&(nr&192)===128&&(He=(De&15)<<12|(jt&63)<<6|nr&63,(He<=2047||He>=55296&&He<=57343)&&(He=null))):yt===4&&(jt=k[Te+1],nr=k[Te+2],dr=k[Te+3],(jt&192)===128&&(nr&192)===128&&(dr&192)===128&&(He=(De&15)<<18|(jt&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 pv(k,C,X){return ei.decode(k.subarray(C,X))}function mv(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(iv,C)}function iv(k,C,X){if(k===3){var se=X.readMessage(Xd,{}),Te=se.id,De=se.bitmap,He=se.width,yt=se.height,jt=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:jt,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 gv(k){return new An(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),jt=Math.max(jt,rn.x+rn.w),rn.w===bn.w&&rn.h===bn.h){var $n=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(ov.forText(C.scale,C.fontStack||X));for(var se=this.sections.length-1,Te=0;Te=r0?null:++this.imageSectionID:(this.imageSectionID=t0,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)il=Du.rect,Hl=Du.metrics;else{var cf=C[Ko.fontStack],Tf=cf&&cf[ls];if(!Tf)continue;Hl=Tf.metrics}ms=(Ei-Ko.scale)*br}Uu?(k.verticalizable=!0,po.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:dl,metrics:Hl,rect:il}),rn+=qc*Ko.scale+nr):(po.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:dl,metrics:Hl,rect:il}),rn+=Hl.advance*Ko.scale+nr)}if(po.length!==0){var _v=rn-nr;bn=Math.max(_v,bn),C6(po,0,po.length-1,ja,ss)}rn=0;var xv=De*Ei+ss;xo.lineOffset=Math.max(ss,$i),Kr+=xv,$n=Math.max(xv,$n),++wa}var zd=Kr-wf,Sv=yT(He),Mv=Sv.horizontalAlign,vd=Sv.verticalAlign;L6(k.positionedLines,ja,Mv,vd,bn,$n,De,zd,Te.length),k.top+=-vd*zd,k.bottom=k.top+zd,k.left+=-Mv*bn,k.right=k.left+bn}function C6(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,jt=C;jt<=X;jt++)k[jt].x-=yt,k[jt].y+=Te}function L6(k,C,X,se,Te,De,He,yt,jt){var nr=(C-X)*Te,dr=0;De!==He?dr=-yt*se-wf:dr=(-se*jt+.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 jt=[],nr=0;ytse;)nr-=jt.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-jt)/Kr,$n=hu(Fr.x,rn.x,bn),ja=hu(Fr.y,rn.y,bn),wa=new f1($n,ja,rn.angleTo(Fr),dr);return wa._round(),!He||HS(k,wa,yt,He,C)?wa:void 0}jt+=Kr}}function Gg(k,C,X,se,Te,De,He,yt,jt){var nr=Jv(se,De,He),dr=Wm(se,Te),Fr=dr*He,rn=k[0].x===0||k[0].x===jt||k[0].y===0||k[0].y===jt;C-Fr=0&&vi=0&&Ei=0&&rn+nr<=dr){var $i=new f1(vi,Ei,mi,bn);$i._round(),(!se||HS(k,$i,De,se,Te))&&Kr.push($i)}}Fr+=wa}return!yt&&!Kr.length&&!He&&(Kr=a0(k,Fr/2,X,se,Te,De,He,!0,jt)),Kr}function c8(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()),(!jt||!dr.equals(jt[jt.length-1]))&&(jt=[dr],De.push(jt)),jt.push(Fr)))))}return De}var ww=bf;function f8(k,C,X,se){var Te=[],De=k.image,He=De.pixelRatio,yt=De.paddedRect.w-2*ww,jt=De.paddedRect.h-2*ww,nr=k.right-k.left,dr=k.bottom-k.top,Fr=De.stretchX||[[0,yt]],rn=De.stretchY||[[0,jt]],Kr=function(ju,Du){return ju+Du[1]-Du[0]},bn=Fr.reduce(Kr,0),$n=rn.reduce(Kr,0),ja=yt-bn,wa=jt-$n,mi=0,Ja=bn,vi=0,Ei=$n,$i=0,xo=ja,po=0,ss=wa;if(De.content&&se){var Bo=De.content;mi=GS(Fr,0,Bo[0]),vi=GS(rn,0,Bo[1]),Ja=GS(Fr,Bo[0],Bo[2]),Ei=GS(rn,Bo[1],Bo[3]),$i=Bo[0]-mi,po=Bo[1]-vi,xo=Bo[2]-Bo[0]-Ja,ss=Bo[3]-Bo[1]-Ei}var Ko=function(ju,Du,cf,Tf){var ph=XS(ju.stretch-mi,Ja,nr,k.left),Ch=YS(ju.fixed-$i,xo,ju.stretch,bn),Dd=XS(Du.stretch-vi,Ei,dr,k.top),nd=YS(Du.fixed-po,ss,Du.stretch,$n),_v=XS(cf.stretch-mi,Ja,nr,k.left),xv=YS(cf.fixed-$i,xo,cf.stretch,bn),zd=XS(Tf.stretch-vi,Ei,dr,k.top),Sv=YS(Tf.fixed-po,ss,Tf.stretch,$n),Mv=new i(ph,Dd),vd=new i(_v,Dd),Ev=new i(_v,zd),Lp=new i(ph,zd),Zg=new i(Ch/He,nd/He),p1=new i(xv/He,Sv/He),m1=C*Math.PI/180;if(m1){var g1=Math.sin(m1),Lw=Math.cos(m1),M0=[Lw,-g1,g1,Lw];Mv._matMult(M0),vd._matMult(M0),Lp._matMult(M0),Ev._matMult(M0)}var QS=ju.stretch+ju.fixed,U6=cf.stretch+cf.fixed,eM=Du.stretch+Du.fixed,j6=Tf.stretch+Tf.fixed,i0={x:De.paddedRect.x+ww+QS,y:De.paddedRect.y+ww+eM,w:U6-QS,h:j6-eM},Pw=xo/He/nr,tM=ss/He/dr;return{tl:Mv,tr:vd,bl:Lp,br:Ev,tex:i0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Zg,pixelOffsetBR:p1,minFontScaleX:Pw,minFontScaleY:tM,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:jt+1}));else for(var dl=h8(Fr,ja,bn),ls=h8(rn,wa,$n),ms=0;ms0&&(bn=Math.max(10,bn),this.circleDiameter=bn)}else{var $n=He.top*yt-jt,ja=He.bottom*yt+jt,wa=He.left*yt-jt,mi=He.right*yt+jt,Ja=He.collisionPadding;if(Ja&&(wa-=Ja[0]*yt,$n-=Ja[1]*yt,mi+=Ja[2]*yt,ja+=Ja[3]*yt),dr){var vi=new i(wa,$n),Ei=new i(mi,$n),$i=new i(wa,ja),xo=new i(mi,ja),po=dr*Math.PI/180;vi._rotate(po),Ei._rotate(po),$i._rotate(po),xo._rotate(po),wa=Math.min(vi.x,Ei.x,$i.x,xo.x),mi=Math.max(vi.x,Ei.x,$i.x,xo.x),$n=Math.min(vi.y,Ei.y,$i.y,xo.y),ja=Math.max(vi.y,Ei.y,$i.y,xo.y)}C.emplaceBack(X.x,X.y,wa,$n,mi,ja,se,Te,De)}this.boxEndIndex=C.length},Tw=function(C,X){if(C===void 0&&(C=[]),X===void 0&&(X=rF),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)};Tw.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},Tw.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}},Tw.prototype.peek=function(){return this.data[0]},Tw.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},Tw.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]=jt,C=yt}se[C]=He};function rF(k,C){return kC?1:0}function nF(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],jt=0;jtDe)&&(De=nr.x),(!jt||nr.y>He)&&(He=nr.y)}var dr=De-se,Fr=He-Te,rn=Math.min(dr,Fr),Kr=rn/2,bn=new Tw([],aF);if(rn===0)return new i(se,Te);for(var $n=se;$nwa.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 Aw(Ja.p.x-Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Aw(Ja.p.x+Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Aw(Ja.p.x-Kr,Ja.p.y+Kr,Kr,k)),bn.push(new Aw(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 aF(k,C){return C.max-k.max}function Aw(k,C,X,se){this.p=new i(k,C),this.h=X,this.d=iF(this.p,se),this.max=this.d+this.h*Math.SQRT2}function iF(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 oF(k){for(var C=0,X=0,se=0,Te=k[0],De=0,He=Te.length,yt=He-1;De=qi||M0.y<0||M0.y>=qi||uF(k,M0,Lw,X,se,Te,ls,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,wa,Ei,po,jt,Ja,$i,ss,Kr,C,De,nr,dr,He)};if(Bo==="line")for(var Hl=0,il=c8(C.geometry,0,0,qi,qi);Hl1){var Dd=n0(Ch,xo,X.vertical||bn,se,$n,mi);Dd&&ms(Ch,Dd)}}else if(C.type==="Polygon")for(var nd=0,_v=A0(C.geometry,0);nd<_v.length;nd+=1){var xv=_v[nd],zd=nF(xv,16);ms(xv[0],new f1(zd.x,zd.y,0))}else if(C.type==="LineString")for(var Sv=0,Mv=C.geometry;Svd1&&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,$n,wa,yt,De,He,nr,C,jt.lineStartIndex,jt.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*Ei.compositeIconSizes[0].evaluate(vi,{},xo),ed*Ei.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&&(il=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 Zg=yt.layout.get("text-rotate").evaluate(vi,{},xo);Ko=new ZS(jt,C,nr,dr,Fr,Lp,rn,Kr,bn,Zg)}var p1=Lp.positionedLines.length===1;if(Nu+=v8(k,C,Lp,De,yt,bn,vi,$n,Bo,se.vertical?Hf.horizontal:Hf.horizontalOnly,p1?Object.keys(se.horizontal):[Ev],Du,Uu,Ei,xo),p1)break}se.vertical&&(qc+=v8(k,C,se.vertical,De,yt,bn,vi,$n,Bo,Hf.vertical,["vertical"],Du,ju,Ei,xo));var m1=Ko?Ko.boxStartIndex:k.collisionBoxArray.length,g1=Ko?Ko.boxEndIndex:k.collisionBoxArray.length,Lw=ls?ls.boxStartIndex:k.collisionBoxArray.length,M0=ls?ls.boxEndIndex:k.collisionBoxArray.length,QS=dl?dl.boxStartIndex:k.collisionBoxArray.length,U6=dl?dl.boxEndIndex:k.collisionBoxArray.length,eM=ms?ms.boxStartIndex:k.collisionBoxArray.length,j6=ms?ms.boxEndIndex:k.collisionBoxArray.length,i0=-1,Pw=function(TT,P8){return TT&&TT.circleDiameter?Math.max(TT.circleDiameter,P8):P8};i0=Pw(Ko,i0),i0=Pw(ls,i0),i0=Pw(dl,i0),i0=Pw(ms,i0);var tM=i0>-1?1:0;tM&&(i0*=po/br),k.glyphOffsetArray.length>=jc.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,Lw,M0,QS,U6,eM,j6,nr,Nu,qc,Hl,il,tM,0,rn,Tf,ph,i0)}function cF(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=jt.value.kind!=="constant"||!!jt.value.value||Object.keys(jt.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,$n=new El(this.zoom),ja=0,wa=C;ja=0;for(var qc=0,Uu=ss.sections;qc=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 nr=0;nr0},jc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},jc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},jc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},jc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},jc.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)===jt&&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",jc,{omit:["layers","collisionBoxArray","features","compareText"]}),jc.MAX_GLYPHS=65535,jc.addDynamicAttributes=z6;function vF(k,C){return C.replace(/{([^{}]+)}/g,function(X,se){return se in k?String(k[se]):""})}var pF=new Za({"symbol-placement":new gn(di.layout_symbol["symbol-placement"]),"symbol-spacing":new gn(di.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gn(di.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new pn(di.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gn(di.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gn(di.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gn(di.layout_symbol["icon-ignore-placement"]),"icon-optional":new gn(di.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gn(di.layout_symbol["icon-rotation-alignment"]),"icon-size":new pn(di.layout_symbol["icon-size"]),"icon-text-fit":new gn(di.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gn(di.layout_symbol["icon-text-fit-padding"]),"icon-image":new pn(di.layout_symbol["icon-image"]),"icon-rotate":new pn(di.layout_symbol["icon-rotate"]),"icon-padding":new gn(di.layout_symbol["icon-padding"]),"icon-keep-upright":new gn(di.layout_symbol["icon-keep-upright"]),"icon-offset":new pn(di.layout_symbol["icon-offset"]),"icon-anchor":new pn(di.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gn(di.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gn(di.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gn(di.layout_symbol["text-rotation-alignment"]),"text-field":new pn(di.layout_symbol["text-field"]),"text-font":new pn(di.layout_symbol["text-font"]),"text-size":new pn(di.layout_symbol["text-size"]),"text-max-width":new pn(di.layout_symbol["text-max-width"]),"text-line-height":new gn(di.layout_symbol["text-line-height"]),"text-letter-spacing":new pn(di.layout_symbol["text-letter-spacing"]),"text-justify":new pn(di.layout_symbol["text-justify"]),"text-radial-offset":new pn(di.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gn(di.layout_symbol["text-variable-anchor"]),"text-anchor":new pn(di.layout_symbol["text-anchor"]),"text-max-angle":new gn(di.layout_symbol["text-max-angle"]),"text-writing-mode":new gn(di.layout_symbol["text-writing-mode"]),"text-rotate":new pn(di.layout_symbol["text-rotate"]),"text-padding":new gn(di.layout_symbol["text-padding"]),"text-keep-upright":new gn(di.layout_symbol["text-keep-upright"]),"text-transform":new pn(di.layout_symbol["text-transform"]),"text-offset":new pn(di.layout_symbol["text-offset"]),"text-allow-overlap":new gn(di.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gn(di.layout_symbol["text-ignore-placement"]),"text-optional":new gn(di.layout_symbol["text-optional"])}),mF=new Za({"icon-opacity":new pn(di.paint_symbol["icon-opacity"]),"icon-color":new pn(di.paint_symbol["icon-color"]),"icon-halo-color":new pn(di.paint_symbol["icon-halo-color"]),"icon-halo-width":new pn(di.paint_symbol["icon-halo-width"]),"icon-halo-blur":new pn(di.paint_symbol["icon-halo-blur"]),"icon-translate":new gn(di.paint_symbol["icon-translate"]),"icon-translate-anchor":new gn(di.paint_symbol["icon-translate-anchor"]),"text-opacity":new pn(di.paint_symbol["text-opacity"]),"text-color":new pn(di.paint_symbol["text-color"],{runtimeType:Xl,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new pn(di.paint_symbol["text-halo-color"]),"text-halo-width":new pn(di.paint_symbol["text-halo-width"]),"text-halo-blur":new pn(di.paint_symbol["text-halo-blur"]),"text-translate":new gn(di.paint_symbol["text-translate"]),"text-translate-anchor":new gn(di.paint_symbol["text-translate-anchor"])}),O6={paint:mF,layout:pF},Ew=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Au,this.defaultValue=C};Ew.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},Ew.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var X=this.defaultValue.value;C(X._styleExpression.expression)}},Ew.prototype.outputDefined=function(){return!1},Ew.prototype.serialize=function(){return null},tr("FormatSectionOverride",Ew,{omit:["defaultValue"]});var gF=(function(k){function C(X){k.call(this,X,O6)}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,jt=De;yt",targetMapId:Te,sourceMapId:He.mapId})}}},kw.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)},kw.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)}},kw.prototype.processTask=function(C,X){var se=this;if(X.type===""){var Te=this.callbacks[C];delete this.callbacks[C],Te&&(X.error?Te(hn(X.error)):Te(null,hn(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},jt=null,nr=hn(X.data);if(this.parent[X.type])jt=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);jt=Fr[dr[1]](nr,yt)}else yt(new Error("Could not find function "+X.type));!De&&jt&&jt.cancel&&(this.cancelCallbacks[C]=jt.cancel)}},kw.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function kF(k,C,X){C=Math.pow(2,X)-C-1;var se=x8(k*256,C*256,X),Te=x8((k+1)*256,(C+1)*256,X);return se[0]+","+se[1]+","+Te[0]+","+Te[1]}function x8(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 b8=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=b8*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 w8=2*Math.PI*b8;function T8(k){return w8*Math.cos(k*Math.PI/180)}function A8(k){return(180+k)/360}function S8(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function M8(k,C){return k/T8(C)}function CF(k){return k*360-180}function B6(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function LF(k,C){return k*T8(B6(C))}function PF(k){return 1/Math.cos(k*Math.PI/180)}var Q_=function(C,X,se){se===void 0&&(se=0),this.x=+C,this.y=+X,this.z=+se};Q_.fromLngLat=function(C,X){X===void 0&&(X=0);var se=Gf.convert(C);return new Q_(A8(se.lng),S8(se.lat),M8(X,se.lat))},Q_.prototype.toLngLat=function(){return new Gf(CF(this.x),B6(this.y))},Q_.prototype.toAltitude=function(){return LF(this.z,this.y)},Q_.prototype.meterInMercatorCoordinateUnits=function(){return 1/w8*PF(B6(this.y))};var ex=function(C,X,se){this.z=C,this.x=X,this.y=se,this.key=wT(0,C,C,X,se)};ex.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},ex.prototype.url=function(C,X){var se=kF(this.x,this.y,this.z),Te=RF(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)},ex.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)},ex.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var E8=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 ex(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)},Xg.prototype._unpackMapbox=function(C,X,se){return(C*256*256+X*256+se)/10-1e4},Xg.prototype._unpackTerrarium=function(C,X,se){return C*256+X+se/256-32768},Xg.prototype.getPixels=function(){return new Hd({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Xg.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 jt=-X*this.dim,nr=-se*this.dim,dr=He;dr=0&&Fr[3]>=0&&jt.insert(yt,Fr[0],Fr[1],Fr[2],Fr[3])}},Yg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Hg.VectorTile(new An(this.rawTileData)).layers,this.sourceLayerCoder=new KS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yg.prototype.query=function(C,X,se,Te){var De=this;this.loadVTLayers();for(var He=C.params||{},yt=qi/C.tileSize/C.scale,jt=tt(He.filter),nr=C.queryGeometry,dr=C.queryPadding*yt,Fr=C8(nr),rn=this.grid.query(Fr.minX-dr,Fr.minY-dr,Fr.maxX+dr,Fr.maxY+dr),Kr=C8(C.cameraQueryGeometry),bn=this.grid3D.query(Kr.minX-dr,Kr.minY-dr,Kr.maxX+dr,Kr.maxY+dr,function($i,xo,po,ss){return Ep(C.cameraQueryGeometry,$i-dr,xo-dr,po+dr,ss+dr)}),$n=0,ja=bn;$nTe)De=!1;else if(!X)De=!0;else if(this.expirationTime=qr.maxzoom)&&qr.visibility!=="none"){f(Dr,this.zoom,ur);var ln=ma[qr.id]=qr.createBucket({index:Jn.bucketLayerIDs.length,layers:Dr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pi,sourceID:this.source});ln.populate(Mi,da,this.tileID.canonical),Jn.bucketLayerIDs.push(Dr.map(function(cn){return cn.id}))}}}}var Jr,At,lr,zr,un=e.mapObject(da.glyphDependencies,function(cn){return Object.keys(cn).map(Number)});Object.keys(un).length?Gr.send("getGlyphs",{uid:this.uid,stacks:un},function(cn,In){Jr||(Jr=cn,At=In,jn.call(mn))}):At={};var Rn=Object.keys(da.iconDependencies);Rn.length?Gr.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(cn,In){Jr||(Jr=cn,lr=In,jn.call(mn))}):lr={};var qn=Object.keys(da.patternDependencies);qn.length?Gr.send("getImages",{icons:qn,source:this.source,tileID:this.tileID,type:"patterns"},function(cn,In){Jr||(Jr=cn,zr=In,jn.call(mn))}):zr={},jn.call(this);function jn(){if(Jr)return sn(Jr);if(At&&lr&&zr){var cn=new a(At),In=new e.ImageAtlas(lr,zr);for(var gi in ma){var Ea=ma[gi];Ea instanceof e.SymbolBucket?(f(Ea.layers,this.zoom,ur),e.performSymbolLayout(Ea,At,cn.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(da,this.tileID.canonical,In.patternPositions))}this.status="done",sn(null,{buckets:e.values(ma).filter(function(Ci){return!Ci.isEmpty()}),featureIndex:Jn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:cn.image,imageAtlas:In,glyphMap:this.returnDependencies?At:null,iconMap:this.returnDependencies?lr:null,glyphPositions:this.returnDependencies?cn.positions:null})}}};function f(sr,qt,or){for(var ur=new e.EvaluationParameters(qt),Gr=0,sn=sr;Gr=0!=!!qt&&sr.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=[],or=0,ur=this._feature.geometry;or"u"&&(ur.push(Tn),Jn=ur.length-1,sn[Tn]=Jn),qt.writeVarint(Jn);var ma=or.properties[Tn],da=typeof ma;da!=="string"&&da!=="boolean"&&da!=="number"&&(ma=JSON.stringify(ma));var _a=da+":"+ma,Ca=mn[_a];typeof Ca>"u"&&(Gr.push(ma),Ca=Gr.length-1,mn[_a]=Ca),qt.writeVarint(Ca)}}function re(sr,qt){return(qt<<3)+(sr&7)}function fe(sr){return sr<<1^sr>>31}function le(sr,qt){for(var or=sr.loadGeometry(),ur=sr.type,Gr=0,sn=0,mn=or.length,Tn=0;Tn>1;ee(sr,qt,mn,ur,Gr,sn%2),V(sr,qt,or,ur,mn-1,sn+1),V(sr,qt,or,mn+1,Gr,sn+1)}}function ee(sr,qt,or,ur,Gr,sn){for(;Gr>ur;){if(Gr-ur>600){var mn=Gr-ur+1,Tn=or-ur+1,Jn=Math.log(mn),ma=.5*Math.exp(2*Jn/3),da=.5*Math.sqrt(Jn*ma*(mn-ma)/mn)*(Tn-mn/2<0?-1:1),_a=Math.max(ur,Math.floor(or-Tn*ma/mn+da)),Ca=Math.min(Gr,Math.floor(or+(mn-Tn)*ma/mn+da));ee(sr,qt,or,_a,Ca,sn)}var Hn=qt[2*or+sn],pi=ur,Mi=Gr;for(ne(sr,qt,ur,or),qt[2*Gr+sn]>Hn&&ne(sr,qt,ur,Gr);piHn;)Mi--}qt[2*ur+sn]===Hn?ne(sr,qt,ur,Mi):(Mi++,ne(sr,qt,Mi,Gr)),Mi<=or&&(ur=Mi+1),or<=Mi&&(Gr=Mi-1)}}function ne(sr,qt,or,ur){$(sr,or,ur),$(qt,2*or,2*ur),$(qt,2*or+1,2*ur+1)}function $(sr,qt,or){var ur=sr[qt];sr[qt]=sr[or],sr[or]=ur}function ue(sr,qt,or,ur,Gr,sn,mn){for(var Tn=[0,sr.length-1,0],Jn=[],ma,da;Tn.length;){var _a=Tn.pop(),Ca=Tn.pop(),Hn=Tn.pop();if(Ca-Hn<=mn){for(var pi=Hn;pi<=Ca;pi++)ma=qt[2*pi],da=qt[2*pi+1],ma>=or&&ma<=Gr&&da>=ur&&da<=sn&&Jn.push(sr[pi]);continue}var Mi=Math.floor((Hn+Ca)/2);ma=qt[2*Mi],da=qt[2*Mi+1],ma>=or&&ma<=Gr&&da>=ur&&da<=sn&&Jn.push(sr[Mi]);var Dt=(_a+1)%2;(_a===0?or<=ma:ur<=da)&&(Tn.push(Hn),Tn.push(Mi-1),Tn.push(Dt)),(_a===0?Gr>=ma:sn>=da)&&(Tn.push(Mi+1),Tn.push(Ca),Tn.push(Dt))}return Jn}function te(sr,qt,or,ur,Gr,sn){for(var mn=[0,sr.length-1,0],Tn=[],Jn=Gr*Gr;mn.length;){var ma=mn.pop(),da=mn.pop(),_a=mn.pop();if(da-_a<=sn){for(var Ca=_a;Ca<=da;Ca++)H(qt[2*Ca],qt[2*Ca+1],or,ur)<=Jn&&Tn.push(sr[Ca]);continue}var Hn=Math.floor((_a+da)/2),pi=qt[2*Hn],Mi=qt[2*Hn+1];H(pi,Mi,or,ur)<=Jn&&Tn.push(sr[Hn]);var Dt=(ma+1)%2;(ma===0?or-Gr<=pi:ur-Gr<=Mi)&&(mn.push(_a),mn.push(Hn-1),mn.push(Dt)),(ma===0?or+Gr>=pi:ur+Gr>=Mi)&&(mn.push(Hn+1),mn.push(da),mn.push(Dt))}return Tn}function H(sr,qt,or,ur){var Gr=sr-or,sn=qt-ur;return Gr*Gr+sn*sn}var ae=function(sr){return sr[0]},ie=function(sr){return sr[1]},de=function(qt,or,ur,Gr,sn){or===void 0&&(or=ae),ur===void 0&&(ur=ie),Gr===void 0&&(Gr=64),sn===void 0&&(sn=Float64Array),this.nodeSize=Gr,this.points=qt;for(var mn=qt.length<65536?Uint16Array:Uint32Array,Tn=this.ids=new mn(qt.length),Jn=this.coords=new sn(qt.length*2),ma=0;ma=Gr;da--){var _a=+Date.now();Jn=this._cluster(Jn,da),this.trees[da]=new de(Jn,pe,Ne,mn,Float32Array),ur&&console.log("z%d: %d clusters in %dms",da,Jn.length,+Date.now()-_a)}return ur&&console.timeEnd("total time"),this},Le.prototype.getClusters=function(qt,or){var ur=((qt[0]+180)%360+360)%360-180,Gr=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)ur=-180,sn=180;else if(ur>sn){var Tn=this.getClusters([ur,Gr,180,mn],or),Jn=this.getClusters([-180,Gr,sn,mn],or);return Tn.concat(Jn)}for(var ma=this.trees[this._limitZoom(or)],da=ma.range(ct(ur),at(mn),ct(sn),at(Gr)),_a=[],Ca=0,Hn=da;Caor&&(Mi+=jr.numPoints||1)}if(Mi>=Jn){for(var Vr=_a.x*pi,Dr=_a.y*pi,qr=Tn&&pi>1?this._map(_a,!0):null,ln=(da<<5)+(or+1)+this.points.length,Jr=0,At=Hn;Jr1)for(var Rn=0,qn=Hn;Rn>5},Le.prototype._getOriginZoom=function(qt){return(qt-this.points.length)%32},Le.prototype._map=function(qt,or){if(qt.numPoints)return or?Ae({},qt.properties):qt.properties;var ur=this.points[qt.index].properties,Gr=this.options.map(ur);return or&&Gr===ur?Ae({},Gr):Gr};function Fe(sr,qt,or,ur,Gr){return{x:sr,y:qt,zoom:1/0,id:or,parentId:-1,numPoints:ur,properties:Gr}}function ze(sr,qt){var or=sr.geometry.coordinates,ur=or[0],Gr=or[1];return{x:ct(ur),y:at(Gr),zoom:1/0,index:qt,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 qt=sr.numPoints,or=qt>=1e4?Math.round(qt/1e3)+"k":qt>=1e3?Math.round(qt/100)/10+"k":qt;return Ae(Ae({},sr.properties),{cluster:!0,cluster_id:sr.id,point_count:qt,point_count_abbreviated:or})}function ct(sr){return sr/360+.5}function at(sr){var qt=Math.sin(sr*Math.PI/180),or=.5-.25*Math.log((1+qt)/(1-qt))/Math.PI;return or<0?0:or>1?1:or}function et(sr){return(sr-.5)*360}function Pe(sr){var qt=(180-sr*360)*Math.PI/180;return 360*Math.atan(Math.exp(qt))/Math.PI-90}function Ae(sr,qt){for(var or in qt)sr[or]=qt[or];return sr}function pe(sr){return sr.x}function Ne(sr){return sr.y}function lt(sr,qt,or,ur){for(var Gr=ur,sn=or-qt>>1,mn=or-qt,Tn,Jn=sr[qt],ma=sr[qt+1],da=sr[or],_a=sr[or+1],Ca=qt+3;CaGr)Tn=Ca,Gr=Hn;else if(Hn===Gr){var pi=Math.abs(Ca-sn);piur&&(Tn-qt>3&<(sr,qt,Tn,ur),sr[Tn+2]=Gr,or-Tn>3&<(sr,Tn,or,ur))}function dt(sr,qt,or,ur,Gr,sn){var mn=Gr-or,Tn=sn-ur;if(mn!==0||Tn!==0){var Jn=((sr-or)*mn+(qt-ur)*Tn)/(mn*mn+Tn*Tn);Jn>1?(or=Gr,ur=sn):Jn>0&&(or+=mn*Jn,ur+=Tn*Jn)}return mn=sr-or,Tn=qt-ur,mn*mn+Tn*Tn}function nt(sr,qt,or,ur){var Gr={id:typeof sr>"u"?null:sr,type:qt,geometry:or,tags:ur,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ft(Gr),Gr}function Ft(sr){var qt=sr.geometry,or=sr.type;if(or==="Point"||or==="MultiPoint"||or==="LineString")Nt(sr,qt);else if(or==="Polygon"||or==="MultiLineString")for(var ur=0;ur0&&(ur?mn+=(Gr*ma-Jn*sn)/2:mn+=Math.sqrt(Math.pow(Jn-Gr,2)+Math.pow(ma-sn,2))),Gr=Jn,sn=ma}var da=qt.length-3;qt[2]=1,lt(qt,0,da,or),qt[da+2]=1,qt.size=Math.abs(mn),qt.start=0,qt.end=qt.size}function $r(sr,qt,or,ur){for(var Gr=0;Gr1?1:or}function Mt(sr,qt,or,ur,Gr,sn,mn,Tn){if(or/=qt,ur/=qt,sn>=or&&mn=ur)return null;for(var Jn=[],ma=0;ma=or&&pi=ur)continue;var Mi=[];if(Ca==="Point"||Ca==="MultiPoint")je(_a,Mi,or,ur,Gr);else if(Ca==="LineString")Je(_a,Mi,or,ur,Gr,!1,Tn.lineMetrics);else if(Ca==="MultiLineString")xe(_a,Mi,or,ur,Gr,!1);else if(Ca==="Polygon")xe(_a,Mi,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&&Mi.push(xt)}if(Mi.length){if(Tn.lineMetrics&&Ca==="LineString"){for(Dt=0;Dt=or&&mn<=ur&&(qt.push(sr[sn]),qt.push(sr[sn+1]),qt.push(sr[sn+2]))}}function Je(sr,qt,or,ur,Gr,sn,mn){for(var Tn=ke(sr),Jn=Gr===0?Ee:Xe,ma=sr.start,da,_a,Ca=0;Caor&&(_a=Jn(Tn,Hn,pi,Dt,xt,or),mn&&(Tn.start=ma+da*_a)):Cr>ur?jr=or&&(_a=Jn(Tn,Hn,pi,Dt,xt,or),Vr=!0),jr>ur&&Cr<=ur&&(_a=Jn(Tn,Hn,pi,Dt,xt,ur),Vr=!0),!sn&&Vr&&(mn&&(Tn.end=ma+da*_a),qt.push(Tn),Tn=ke(sr)),mn&&(ma+=da)}var Dr=sr.length-3;Hn=sr[Dr],pi=sr[Dr+1],Mi=sr[Dr+2],Cr=Gr===0?Hn:pi,Cr>=or&&Cr<=ur&&ye(Tn,Hn,pi,Mi),Dr=Tn.length-3,sn&&Dr>=3&&(Tn[Dr]!==Tn[0]||Tn[Dr+1]!==Tn[1])&&ye(Tn,Tn[0],Tn[1],Tn[2]),Tn.length&&qt.push(Tn)}function ke(sr){var qt=[];return qt.size=sr.size,qt.start=sr.start,qt.end=sr.end,qt}function xe(sr,qt,or,ur,Gr,sn){for(var mn=0;mnmn.maxX&&(mn.maxX=da),_a>mn.maxY&&(mn.maxY=_a)}return mn}function mr(sr,qt,or,ur){var Gr=qt.geometry,sn=qt.type,mn=[];if(sn==="Point"||sn==="MultiPoint")for(var Tn=0;Tn0&&qt.size<(Gr?mn:ur)){or.numPoints+=qt.length/3;return}for(var Tn=[],Jn=0;Jnmn)&&(or.numSimplified++,Tn.push(qt[Jn]),Tn.push(qt[Jn+1])),or.numPoints++;Gr&&Br(Tn,sn),sr.push(Tn)}function Br(sr,qt){for(var or=0,ur=0,Gr=sr.length,sn=Gr-2;ur0===qt)for(ur=0,Gr=sr.length;ur24)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 ur=Qt(sr,qt);this.tiles={},this.tileCoords=[],or&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ur=Qe(ur,qt),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)))}Wn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Wn.prototype.splitTile=function(sr,qt,or,ur,Gr,sn,mn){for(var Tn=[sr,qt,or,ur],Jn=this.options,ma=Jn.debug;Tn.length;){ur=Tn.pop(),or=Tn.pop(),qt=Tn.pop(),sr=Tn.pop();var da=1<1&&console.time("creation"),Ca=this.tiles[_a]=xr(sr,qt,or,ur,Jn),this.tileCoords.push({z:qt,x:or,y:ur}),ma)){ma>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,or,ur,Ca.numFeatures,Ca.numPoints,Ca.numSimplified),console.timeEnd("creation"));var Hn="z"+qt;this.stats[Hn]=(this.stats[Hn]||0)+1,this.total++}if(Ca.source=sr,Gr){if(qt===Jn.maxZoom||qt===Gr)continue;var pi=1<1&&console.time("clipping");var Mi=.5*Jn.buffer/Jn.extent,Dt=.5-Mi,xt=.5+Mi,Cr=1+Mi,jr,Vr,Dr,qr,ln,Jr;jr=Vr=Dr=qr=null,ln=Mt(sr,da,or-Mi,or+xt,0,Ca.minX,Ca.maxX,Jn),Jr=Mt(sr,da,or+Dt,or+Cr,0,Ca.minX,Ca.maxX,Jn),sr=null,ln&&(jr=Mt(ln,da,ur-Mi,ur+xt,1,Ca.minY,Ca.maxY,Jn),Vr=Mt(ln,da,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Jn),ln=null),Jr&&(Dr=Mt(Jr,da,ur-Mi,ur+xt,1,Ca.minY,Ca.maxY,Jn),qr=Mt(Jr,da,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Jn),Jr=null),ma>1&&console.timeEnd("clipping"),Tn.push(jr||[],qt+1,or*2,ur*2),Tn.push(Vr||[],qt+1,or*2,ur*2+1),Tn.push(Dr||[],qt+1,or*2+1,ur*2),Tn.push(qr||[],qt+1,or*2+1,ur*2+1)}}},Wn.prototype.getTile=function(sr,qt,or){var ur=this.options,Gr=ur.extent,sn=ur.debug;if(sr<0||sr>24)return null;var mn=1<1&&console.log("drilling down to z%d-%d-%d",sr,qt,or);for(var Jn=sr,ma=qt,da=or,_a;!_a&&Jn>0;)Jn--,ma=Math.floor(ma/2),da=Math.floor(da/2),_a=this.tiles[Vn(Jn,ma,da)];return!_a||!_a.source?null:(sn>1&&console.log("found parent tile z%d-%d-%d",Jn,ma,da),sn>1&&console.time("drilling down"),this.splitTile(_a.source,Jn,ma,da,sr,qt,or),sn>1&&console.timeEnd("drilling down"),this.tiles[Tn]?Ot(this.tiles[Tn],Gr):null)};function Vn(sr,qt,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,Wt){pt=null,qe||(qe=Tt,J=Wt,it())}),$e=e.getImage(q.transformRequest(q.normalizeSpriteURL(be,ft,".png"),e.ResourceType.SpriteImage),function(Tt,Wt){$e=null,qe||(qe=Tt,_e=Wt,it())});function it(){if(qe)he(qe);else if(J&&_e){var Tt=e.browser.getImageData(_e),Wt={};for(var Vt in J){var Jt=J[Vt],ir=Jt.width,rr=Jt.height,Bt=Jt.x,Yt=Jt.y,Ht=Jt.sdf,Or=Jt.pixelRatio,Wr=Jt.stretchX,fn=Jt.stretchY,ua=Jt.content,Zn=new e.RGBAImage({width:ir,height:rr});e.RGBAImage.copy(Tt,Zn,{x:Bt,y:Yt},{x:0,y:0},{width:ir,height:rr}),Wt[Vt]={data:Zn,pixelRatio:Or,sdf:Ht,stretchX:Wr,stretchY:fn,content:ua}}he(null,Wt)}}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:Wt,id:Vt,glyph:ir});return}var Bt=Jt.requests[rr];Bt||(Bt=Jt.requests[rr]=[],d.loadGlyphRange(Wt,rr,J.url,J.requestManager,function(Yt,Ht){if(Ht){for(var Or in Ht)J._doesCharSupportLocalGlyph(+Or)||(Jt.glyphs[+Or]=Ht[+Or]);Jt.ranges[rr]=!0}for(var Wr=0,fn=Bt;Wr1&&(it=q[++$e]);var Wt=Math.abs(Tt-it.left),Vt=Math.abs(Tt-it.right),Jt=Math.min(Wt,Vt),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 Wt=Math.abs(Tt-it.left),Vt=Math.abs(Tt-it.right),Jt=Math.min(Wt,Vt),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,Wt=$e;Ttthis.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(Wt)>1&&(Math.abs(Wt+Jt)===1?Wt+=Jt:Math.abs(Wt-Jt)===1&&(Wt-=Jt)),!(!Tt.dem||!it.dem)&&(it.dem.backfillBorder(Tt.dem,Wt,Vt),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 Wt=it;Wt.overscaledZ>_e;)if(Wt=Wt.scaledTo(Wt.overscaledZ-1),J[Wt.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 Wt in this._timers)clearTimeout(this._timers[Wt]),delete this._timers[Wt];for(var Vt in this._tiles){var Jt=this._tiles[Vt];this._setTileReloadTimer(Vt,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(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 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(Jn(this._source.type)){for(var Tt={},Wt={},Vt=Object.keys(it),Jt=0,ir=Vt;Jtthis._source.maxzoom){var Ht=Bt.children(this._source.maxzoom)[0],Or=this.getTile(Ht);if(Or&&Or.hasData()){qe[Ht.key]=Ht;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 fn=Yt.wasRequested(),ua=Bt.overscaledZ-1;ua>=pt;--ua){var Zn=Bt.scaledTo(ua);if(ft[Zn.key]||(ft[Zn.key]=!0,Yt=this.getTile(Zn),!Yt&&fn&&(Yt=this._addTile(Zn)),Yt&&(qe[Zn.key]=Zn,fn=Yt.wasRequested(),Yt.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(ua){return $e.pointCoordinate(ua)}),Wt=it.map(function(ua){return $e.pointCoordinate(ua)}),Vt=this.getIds(),Jt=1/0,ir=1/0,rr=-1/0,Bt=-1/0,Yt=0,Ht=Wt;Yt=0&&Pa[1].y+va>=0){var ha=Tt.map(function(Ka){return Gn.getTilePoint(Ka)}),Fa=Wt.map(function(Ka){return Gn.getTilePoint(Ka)});pt.push({tile:Zn,tileID:Gn,queryGeometry:ha,cameraQueryGeometry:Fa,scale:ca})}}},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 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);mn.maxOverzooming=10,mn.maxUnderzooming=3;function Tn(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 ma(){return new e.window.Worker(_s.workerUrl)}var da="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 ma);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[da]},_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 Mi(){var be=pi();be.acquire(da)}function Dt(){var be=Hn;be&&(be.isPreloaded()&&be.numActive()===1?(be.release(da),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 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 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}},cn.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=[],Wt={hitTest:_e,circle:{x:q,y:he,radius:J},seenUids:{box:{},circle:{}}};return this._forEachCell(ft,$e,pt,it,this._queryCellCircle,Tt,Wt,qe),_e?Tt.length>0:Tt},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,ft,pt,$e){var it=pt.seenUids,Tt=this.boxCells[qe];if(Tt!==null)for(var Wt=this.bboxes,Vt=0,Jt=Tt;Vt=Wt[rr+0]&&_e>=Wt[rr+1]&&(!$e||$e(this.boxKeys[ir]))){if(pt.hitTest)return ft.push(!0),!0;ft.push({key:this.boxKeys[ir],x1:Wt[rr],y1:Wt[rr+1],x2:Wt[rr+2],y2:Wt[rr+3]})}}}var Bt=this.circleCells[qe];if(Bt!==null)for(var Yt=this.circles,Ht=0,Or=Bt;Htpt*pt+$e*$e},cn.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,Wt=Math.abs(he-(qe+Tt));if(Wt>Tt+J)return!1;if(it<=$e||Wt<=Tt)return!0;var Vt=it-$e,Jt=Wt-Tt;return Vt*Vt+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 Hi(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],Wt=J?be.text.dynamicLayoutVertexArray:be.icon.dynamicLayoutVertexArray;Wt.clear();for(var Vt=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 fi(be,q,he,J,_e,qe,ft,pt,$e,it,Tt,Wt,Vt,Jt){var ir=q/24,rr=be.lineOffsetX*ir,Bt=be.lineOffsetY*ir,Yt;if(be.numGlyphs>1){var Ht=be.glyphStartIndex+be.numGlyphs,Or=be.lineStartIndex,Wr=be.lineStartIndex+be.lineLength,fn=io(ir,pt,rr,Bt,he,Tt,Wt,be,$e,qe,Vt);if(!fn)return{notEnoughRoom:!0};var ua=Ea(fn.first.point,ft).point,Zn=Ea(fn.last.point,ft).point;if(J&&!he){var Gn=Mo(be.writingMode,ua,Zn,Jt);if(Gn)return Gn}Yt=[fn.first];for(var ca=be.glyphStartIndex+1;ca0?Fa.point:ts(Wt,ha,va,1,_e),wi=Mo(be.writingMode,va,Ka,Jt);if(wi)return wi}var qi=Ho(ir*pt.getoffsetX(be.glyphStartIndex),rr,Bt,he,Tt,Wt,be.segment,be.lineStartIndex,be.lineStartIndex+be.lineLength,$e,qe,Vt);if(!qi)return{notEnoughRoom:!0};Yt=[qi]}for(var xs=0,ps=Yt;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,Yt=_e,Ht=0,Or=0,Wr=Math.abs(Vt),fn=[];Ht+Or<=Wr;){if(rr+=Jt,rr=$e)return null;if(Yt=Bt,fn.push(Bt),Bt=Wt[rr],Bt===void 0){var ua=new e.Point(it.getx(rr),it.gety(rr)),Zn=Ea(ua,Tt);if(Zn.signedDistanceFromCamera>0)Bt=Wt[rr]=Zn.point;else{var Gn=rr-Jt,ca=Ht===0?qe:new e.Point(it.getx(Gn),it.gety(Gn));Bt=ts(ca,ua,Yt,Wr-Ht+1,Tt)}}Ht+=Or,Or=Yt.dist(Bt)}var va=(Wr-Ht)/Or,Pa=Bt.sub(Yt),ha=Pa.mult(va)._add(Yt);ha._add(Pa._unit()._perp()._mult(he*Jt));var Fa=ir+Math.atan2(Bt.y-Yt.y,Bt.x-Yt.x);return fn.push(ha),{point:ha,angle:Fa,path:fn}}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 fl=1;fl0){for(var ol=ps[0].clone(),Tu=ps[0].clone(),Kf=1;Kf=Fa.x&&Tu.x<=Ka.x&&ol.y>=Fa.y&&Tu.y<=Ka.y?ec=[ps]:Tu.xKa.x||Tu.yKa.y?ec=[]:ec=e.clipLine([ps],Fa.x,Fa.y,Ka.x,Ka.y)}for(var Eh=0,Hv=ec;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[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID].text&&(Wr=this.prevPlacement.variableOffsets[Vt.crossTileID].anchor),this.variableOffsets[Vt.crossTileID]={textOffset:Bt,width:J,height:_e,anchor:q,textBoxScale:qe,prevAnchor:Wr},this.markUsedJustification(Jt,q,Vt,ir),Jt.allowVerticalPlacement&&(this.markUsedOrientation(Jt,ir,Vt),this.placedOrientations[Vt.crossTileID]=ir),{shift:Yt,placedGlyphBoxes:Ht}}},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,Wt=qe.textPixelRatio,Vt=qe.holdingForFade,Jt=qe.collisionBoxArray,ir=qe.partiallyEvaluatedTextSize,rr=qe.collisionGroup,Bt=pt.get("text-optional"),Yt=pt.get("icon-optional"),Ht=pt.get("text-allow-overlap"),Or=pt.get("icon-allow-overlap"),Wr=pt.get("text-rotation-alignment")==="map",fn=pt.get("text-pitch-alignment")==="map",ua=pt.get("icon-text-fit")!=="none",Zn=pt.get("symbol-z-order")==="viewport-y",Gn=Ht&&(Or||!ft.hasIconData()||Yt),ca=Or&&(Ht||!ft.hasTextData()||Bt);!ft.collisionArrays&&Jt&&ft.deserializeCollisionBoxes(Jt);var va=function(qi,xs){if(!he[qi.crossTileID]){if(Vt){_e.placements[qi.crossTileID]=new Zo(!1,!1,!1);return}var ps=!1,yl=!1,fl=!0,xl=null,_l={box:null,offscreen:null},ec={box:null},ol=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 tv=xs.textBox;if(tv){var hp=function(xf){var vc=e.WritingMode.horizontal;if(ft.allowVerticalPlacement&&!xf&&_e.prevPlacement){var av=_e.prevPlacement.placedOrientations[qi.crossTileID];av&&(_e.placedOrientations[qi.crossTileID]=av,vc=av,_e.markUsedOrientation(ft,vc,qi))}return vc},J0=function(xf,vc){if(ft.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&xs.verticalTextBox)for(var av=0,Ug=ft.writingModes;av0&&(dv=dv.filter(function(xf){return xf!==nv.anchor}),dv.unshift(nv.anchor))}var Xv=function(xf,vc,av){for(var Ug=xf.x2-xf.x1,Jy=xf.y2-xf.y1,Sc=qi.textBoxScale,V_=ua&&!Or?vc:null,qm={box:[],offscreen:!1},tw=Ht?dv.length*2:dv.length,Zv=0;Zv=dv.length,H_=_e.attemptAnchorPlacement(Vm,xf,Ug,Jy,Sc,Wr,fn,Wt,$e,rr,rw,qi,ft,av,V_);if(H_&&(qm=H_.placedGlyphBoxes,qm&&qm.box&&qm.box.length)){ps=!0,xl=H_.shift;break}}return qm},dp=function(){return Xv(tv,xs.iconBox,e.WritingMode.horizontal)},Yv=function(){var xf=xs.verticalTextBox,vc=_l&&_l.box&&_l.box.length;return ft.allowVerticalPlacement&&!vc&&qi.numVerticalGlyphVertices>0&&xf?Xv(xf,xs.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};J0(dp,Yv),_l&&(ps=_l.box,fl=_l.offscreen);var Fg=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,Fg))}}else{var Mp=function(xf,vc){var av=_e.collisionIndex.placeCollisionBox(xf,Ht,Wt,$e,rr.predicate);return av&&av.box&&av.box.length&&(_e.markUsedOrientation(ft,vc,qi),_e.placedOrientations[qi.crossTileID]=vc),av},rv=function(){return Mp(tv,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(rv,Ep),hp(_l&&_l.box&&_l.box.length)}}if(ol=_l,ps=ol&&ol.box&&ol.box.length>0,fl=ol&&ol.offscreen,qi.useRuntimeCollisionCircles){var Kh=ft.text.placedSymbolArray.get(qi.centerJustifiedTextSymbolIndex),em=e.evaluateSizeForFeature(ft.textSizeData,ir,Kh),Bg=pt.get("text-padding"),Cd=qi.collisionCircleDiameter;Tu=_e.collisionIndex.placeCollisionCircles(Ht,Kh,ft.lineVertexArray,ft.glyphOffsetArray,em,$e,it,Tt,J,fn,rr.predicate,Cd,Bg),ps=Ht||Tu.circles.length>0&&!Tu.collisionDetected,fl=fl&&Tu.offscreen}if(xs.iconFeatureIndex&&(Gv=xs.iconFeatureIndex),xs.iconBox){var Nm=function(xf){var vc=ua&&xl?Pl(xf,xl.x,xl.y,Wr,fn,_e.transform.angle):xf;return _e.collisionIndex.placeCollisionBox(vc,Or,Wt,$e,rr.predicate)};ec&&ec.box&&ec.box.length&&xs.verticalIconBox?(Kf=Nm(xs.verticalIconBox),yl=Kf.box.length>0):(Kf=Nm(xs.iconBox),yl=Kf.box.length>0),fl=fl&&Kf.offscreen}var $y=Bt||qi.numHorizontalGlyphVertices===0&&qi.numVerticalGlyphVertices===0,Ky=Yt||qi.numIconVertices===0;if(!$y&&!Ky?yl=ps=yl&&ps:Ky?$y||(yl=yl&&ps):ps=yl&&ps,ps&&ol&&ol.box&&(ec&&ec.box&&Hv?_e.collisionIndex.insertCollisionBox(ol.box,pt.get("text-ignore-placement"),ft.bucketInstanceId,Hv,rr.ID):_e.collisionIndex.insertCollisionBox(ol.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 Ng=ft.bucketInstanceId,Um=_e.collisionCircleArrays[Ng];Um===void 0&&(Um=_e.collisionCircleArrays[Ng]=new vo);for(var jm=0;jm=0;--ha){var Fa=Pa[ha];va(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 Wt in qe){var Vt=qe[Wt];if(!this.opacities[Wt]){var Jt=new fs(Vt,_e,!1,!1);Jt.isHidden()||(this.opacities[Wt]=Jt,J=J||Vt.text.placed||Vt.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||fn>0,va=Or.numIconVertices>0,Pa=_e.placedOrientations[Or.crossTileID],ha=Pa===e.WritingMode.vertical,Fa=Pa===e.WritingMode.horizontal||Pa===e.WritingMode.horizontalOnly;if(ca){var Ka=Au(Gn.text),wi=ha?Ji:Ka;ir(q.text,Wr,wi);var qi=Fa?Ji:Ka;ir(q.text,fn,qi);var xs=Gn.text.isHidden();[Or.rightJustifiedTextSymbolIndex,Or.centerJustifiedTextSymbolIndex,Or.leftJustifiedTextSymbolIndex].forEach(function(Gv){Gv>=0&&(q.text.placedSymbolArray.get(Gv).hidden=xs||ha?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(va){var fl=Au(Gn.icon),xl=!(Vt&&Or.verticalPlacedIconSymbolIndex&&ha);if(Or.placedIconSymbolIndex>=0){var _l=xl?fl:Ji;ir(q.icon,Or.numIconVertices,_l),q.icon.placedSymbolArray.get(Or.placedIconSymbolIndex).hidden=Gn.icon.isHidden()}if(Or.verticalPlacedIconSymbolIndex>=0){var ec=xl?Ji:fl;ir(q.icon,Or.numVerticalIconVertices,ec),q.icon.placedSymbolArray.get(Or.verticalPlacedIconSymbolIndex).hidden=Gn.icon.isHidden()}}if(q.hasIconCollisionBoxData()||q.hasTextCollisionBoxData()){var ol=q.collisionArrays[Ht];if(ol){var Tu=new e.Point(0,0);if(ol.textBox||ol.verticalTextBox){var Kf=!0;if(it){var Eh=_e.variableOffsets[ua];Eh?(Tu=kl(Eh.anchor,Eh.width,Eh.height,Eh.textOffset,Eh.textBoxScale),Tt&&Tu._rotate(Wt?_e.transform.angle:-_e.transform.angle)):Kf=!1}ol.textBox&&di(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||ha,Tu.x,Tu.y),ol.verticalTextBox&&di(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||Fa,Tu.x,Tu.y)}var Hv=!!(!Fa&&ol.verticalIconBox);ol.iconBox&&di(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,Hv,Vt?Tu.x:0,Vt?Tu.y:0),ol.verticalIconBox&&di(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,!Hv,Vt?Tu.x:0,Vt?Tu.y:0)}}},Bt=0;Btq},Ms.prototype.setStale=function(){this.stale=!0};function di(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),Rl=Math.pow(2,9),Zs=Math.pow(2,8),ul=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*Rl+q*Zs+he*ul+q}var Ji=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 Wt=q.scaledTo(Number(pt)),Vt=$e[Wt.key];Vt&&Vt.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 mn(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,Wt=J;Tt=0;Ht--){var Or=this._order[Ht];if(qe(Or))for(var Wr=pt.length-1;Wr>=0;Wr--){var fn=pt[Wr].feature;if(ft[fn.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;}`,$u=`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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;}`,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 +}`,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 +}`,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 +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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);}`,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() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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);}`,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 +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ku=` +#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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#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;}`,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 +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#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);}`,Bl=`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 +}`,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 +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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));}`,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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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);}`,Dc=`#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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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);}`,wu=su(Xc,rf),zc=su(Dh,wh),Uf=su(Tl,Ic),Ql=su(zh,oc),kf=su(Zu,sc),mc=su(nf,Jl),Oc=su(Wu,Hs),hu=su(Il,Mf),rh=su(bc,Ff),pf=su(fu,Sd),jf=su(Fs,Vd),Ah=su(pl,Oo),Ed=su(th,af),ev=su(Ou,Oh),nh=su(Bf,uh),Sh=su($u,fd),Yc=su(Hh,ch),Mh=su(Nf,Fh),lc=su(Bh,of),ah=su(Gh,Ef),Wh=su(vf,Ku),ih=su(Wf,Nh),au=su(Bl,Th),Fc=su(Md,Xh),sf=su(fh,Yh),Uh=su(Dc,Zh);function su(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,Wt,Vt){return pt[Vt]=!0,it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +varying `+Tt+" "+Wt+" "+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`}),q=q.replace(he,function($e,it,Tt,Wt,Vt){var Jt=Wt==="float"?"vec2":"vec4",ir=Vt.match(/color/)?"color":Jt;return pt[Vt]?it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+Tt+" "+Jt+" a_"+Vt+`; +varying `+Tt+" "+Wt+" "+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = a_"+Vt+`; +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = unpack_mix_"+ir+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:it==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+Tt+" "+Jt+" a_"+Vt+`; +#else +uniform `+Tt+" "+Wt+" u_"+Vt+`; +#endif +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = a_"+Vt+`; +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Tt+" "+Wt+" "+Vt+" = unpack_mix_"+ir+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+Tt+" "+Wt+" "+Vt+" = u_"+Vt+`; +#endif +`}),{fragmentSource:be,vertexSource:q,staticAttributes:J,staticUniforms:ft}}var hh=Object.freeze({__proto__:null,prelude:wu,background:zc,backgroundPattern:Uf,circle:Ql,clippingMask:kf,heatmap:mc,heatmapTexture:Oc,collisionBox:hu,collisionCircle:rh,debug:pf,fill:jf,fillOutline:Ah,fillOutlinePattern:Ed,fillPattern:ev,fillExtrusion:nh,fillExtrusionPattern:Sh,hillshadePrepare:Yc,hillshade:Mh,line:lc,lineGradient:ah,linePattern:Wh,lineSDF:ih,raster:au,symbolIcon:Fc,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 Wt=!this.vao||this.boundProgram!==he||this.boundLayoutVertexBuffer!==J||it||this.boundIndexBuffer!==qe||this.boundVertexOffset!==ft||this.boundDynamicVertexBuffer!==pt||this.boundDynamicVertexBuffer2!==$e;!q.extVertexArrayObject||Wt?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,Wt=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 Vt=it;Vt<$e;Vt++)Wt.disableVertexAttribArray(Vt)}he.enableAttributes(Wt,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,Wt=Tt*(J.tileID.canonical.x+J.tileID.wrap*it),Vt=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:[Wt>>16,Vt>>16],u_pixel_coord_lower:[Wt&65535,Vt&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)}},fc=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)}},wc=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})},fr=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}},vn=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}},ci=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")}},Xi=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 Zi=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),Wt=it.width*_e.fromScale,Vt=Tt.width*_e.toScale;return e.extend(Al(be,q,he),{u_patternscale_a:[pt/Wt,-it.height/2],u_patternscale_b:[pt/Vt,-Tt.height/2],u_sdfgamma:ft.width/(Math.min(Wt,Vt)*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)}},Vl=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:Dl(_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 Dl(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)}},gc=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)}},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_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)}},Tc=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 Wt=_e.transform;return e.extend(Tc(be,q,he,J,_e,qe,ft,pt,$e,it),{u_gamma_scale:J?Math.cos(Wt._pitch)*Wt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},_c=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:fc,fill:Cf,fillPattern:gf,fillOutline:Su,fillOutlinePattern:wc,circle:fr,collisionBox:vn,collisionCircle:an,debug:xa,clippingMask:ci,heatmap:Ha,heatmapTexture:bi,hillshade:Xi,hillshadePrepare:No,line:Zi,lineGradient:Li,linePattern:ns,lineSDF:Bs,raster:Mu,symbolIcon:ml,symbolSDF:gc,symbolTextAndIcon:yc,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=[],Wt=0,Vt=0,Jt=0;Jt0){var Wr=e.create(),fn=Yt;e.mul(Wr,Bt.placementInvProjMatrix,be.transform.glCoordMatrix),e.mul(Wr,Wr,Bt.placementViewportMatrix),Tt.push({circleArray:Or,circleOffset:Vt,transform:fn,invTransform:Wr}),Wt+=Or.length/4,Vt=Wt}Ht&&it.draw(pt,$e.LINES,Vn.disabled,Un.disabled,be.colorModeForRenderPass(),Gr.disabled,On(Yt,be.transform,rr),he.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,null,be.transform.zoom,null,null,Ht.collisionVertexBuffer)}}if(!(!ft||!Tt.length)){var ua=be.useProgram("collisionCircle"),Zn=new e.StructArrayLayout2f1f2i16;Zn.resize(Wt*4),Zn._trim();for(var Gn=0,ca=0,va=Tt;ca=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}),Wt=!q||Math.abs(q.tileID.overscaledZ-Tt)>Math.abs(be.tileID.overscaledZ-Tt),Vt=Wt&&be.refreshedUponExpiration?1:e.clamp(Wt?pt:1-$e,0,1);return be.refreshedUponExpiration&&pt>=1&&(be.refreshedUponExpiration=!1),q?{opacity:1,mix:1-Vt}:{opacity:Vt,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 Wt=Un.disabled,Vt=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(),Yt=0,Ht=rr;Yt "+he.overscaledZ);var Yt=Bt+" "+Jt+"kb";Wo(be,Yt),ft.draw(J,_e.TRIANGLES,pt,$e,qt.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 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(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 Qs={symbol:P,circle:Gt,heatmap:hr,line:xn,fill:Ze,"fill-extrusion":vt,hillshade:zt,raster:gr,background:Pr,debug:To,custom:Js},Es=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 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,qt.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(qt.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]],fn=qe[Wr.source],ua=$e[Wr.source];this._renderTileClippingMasks(Wr,ua),this.renderLayer(this,fn,Wr,ua)}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],ca=(Zn.type==="symbol"?Tt:it)[Zn.source];this._renderTileClippingMasks(Zn,$e[Zn.source]),this.renderLayer(this,Gn,Zn,ca)}if(this.options.showTileBoundaries){var va,Pa,ha=e.values(this.style._layers);ha.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},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 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),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]]),Wt=e.sub([],ft[it[2]],ft[it[1]]),Vt=e.normalize([],e.cross([],Tt,Wt)),Jt=-e.dot(Vt,ft[it[1]]);return Vt.concat(Jt)});return new al(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,Wt=0;Wtthis.max[$e]-this.min[$e])return 0}return 1};var iu=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};iu.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},iu.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)},iu.prototype.equals=function(q){return this.top===q.top&&this.bottom===q.bottom&&this.left===q.left&&this.right===q.right},iu.prototype.clone=function(){return new iu(this.top,this.bottom,this.left,this.right)},iu.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 iu,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=al.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,he),$e=q.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&($e=he);var it=3,Tt=function(ha){return{aabb:new mu([ha*qe,0,0],[(ha+1)*qe,qe,0]),zoom:0,x:0,y:0,wrap:ha,fullyVisible:!1}},Wt=[],Vt=[],Jt=he,ir=q.reparseOverscaled?J:he;if(this._renderWorldCopies)for(var rr=1;rr<=3;rr++)Wt.push(Tt(-rr)),Wt.push(Tt(rr));for(Wt.push(Tt(0));Wt.length>0;){var Bt=Wt.pop(),Yt=Bt.x,Ht=Bt.y,Or=Bt.fullyVisible;if(!Or){var Wr=Bt.aabb.intersects(pt);if(Wr===0)continue;Or=Wr===2}var fn=Bt.aabb.distanceX(ft),ua=Bt.aabb.distanceY(ft),Zn=Math.max(Math.abs(fn),Math.abs(ua)),Gn=it+(1<Gn&&Bt.zoom>=$e){Vt.push({tileID:new e.OverscaledTileID(Bt.zoom===Jt?ir:Bt.zoom,Bt.wrap,Bt.zoom,Yt,Ht),distanceSq:e.sqrLen([ft[0]-.5-Yt,ft[1]-.5-Ht])});continue}for(var ca=0;ca<4;ca++){var va=(Yt<<1)+ca%2,Pa=(Ht<<1)+(ca>>1);Wt.push({aabb:Bt.aabb.quadrant(ca),zoom:Bt.zoom+1,x:va,y:Pa,wrap:Bt.wrap,fullyVisible:Or})}}return Vt.sort(function(ha,Fa){return ha.distanceSq-Fa.distanceSq}).map(function(ha){return ha.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,Wt=J[2]/qe,Vt=_e[2]/ft,Jt=Wt===Vt?0:(he-Wt)/(Vt-Wt);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 Wt=this.latRange;q=e.mercatorYfromLat(Wt[1])*this.worldSize,he=e.mercatorYfromLat(Wt[0])*this.worldSize,qe=he-qhe&&($e=he-Bt)}if(this.lngRange){var Yt=Jt.x,Ht=it.x/2;Yt-Ht_e&&(pt=_e-Ht)}(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,Wt=this.height/50,Vt=new Float64Array(16);e.perspective(Vt,this._fov,this.width/this.height,Wt,Tt),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,[-pt,-$e,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 Jt=this.width%2/2,ir=this.height%2/2,rr=Math.cos(this.angle),Bt=Math.sin(this.angle),Yt=pt-Math.round(pt)+rr*Jt+Bt*ir,Ht=$e-Math.round($e)+rr*ir+Bt*Jt,Or=new Float64Array(Vt);if(e.translate(Or,Or,[Yt>.5?Yt-1:Yt,Ht>.5?Ht-1:Ht,0]),this.alignedProjMatrix=Or,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={}}},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 Wt=this._hashName,Vt=!1,Jt=e.window.location.hash.slice(1).split("&").map(function(ir){var rr=ir.split("=")[0];return rr===Wt?(Vt=!0,rr+"="+Tt):ir}).filter(function(ir){return ir});return Vt||Jt.push(Wt+"="+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 Nc={linearity:.3,easing:e.bezier(0,0,.3,1)},ge=e.extend({deceleration:2500,maxSpeed:1400},Nc),Oe=e.extend({deceleration:20,maxSpeed:1400},Nc),rt=e.extend({deceleration:1e3,maxSpeed:360},Nc),wt=e.extend({deceleration:1e3,maxSpeed:90},Nc),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 Wt=tr(he.zoom,$e,Oe);it.zoom=this._map.transform.zoom+Wt.amount,It(it,Wt)}if(he.bearing){var Vt=tr(he.bearing,$e,rt);it.bearing=this._map.transform.bearing+e.clamp(Vt.amount,-179,179),It(it,Vt)}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 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 er(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 er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},hn.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()},hn.prototype.isEnabled=function(){return!0},hn.prototype.isActive=function(){return!1},hn.prototype.enable=function(){},hn.prototype.disable=function(){};var Sn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._container=q.getContainer(),this._clickTolerance=he.clickTolerance||1};Sn.prototype.isEnabled=function(){return!!this._enabled},Sn.prototype.isActive=function(){return!!this._active},Sn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Sn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sn.prototype.mousedown=function(q,he){this.isEnabled()&&q.shiftKey&&q.button===0&&(r.disableDrag(),this._startPos=this._lastPos=he,this._active=!0)},Sn.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)>la)&&(this.aborted=!0)}}},Sa.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 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,Ac(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 Ac(J)&&Ac(_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,fa=2,gn=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)};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%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()}},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)>yr?this._wheelZoomRate:this._defaultZoomRate,_e=fa/(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 Wt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Vt=$e(Wt);Tt=e.number(pt,ft,Vt),Wt<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}}},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),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},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 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 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 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 ga(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,fn):Math.max(.5,fn),ha=Math.pow(Pa,1-ca),Fa=ft.unproject(Or.add(Wr.mult(ca*ha)).mult(va));ft.setLocationAtPoint(ft.renderWorldCopies?Fa.wrap():Fa,Bt)}qe._fireMoveEvents(_e)},function(ca){qe._afterEase(_e,ca)},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(),Wt=this.getPadding(),Vt="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(Vt-$e),Yt=e.Point.convert(J.offset),Ht=pt.centerPoint.add(Yt),Or=pt.pointLocation(Ht),Wr=e.LngLat.convert(J.center||Or);this._normalizeCenter(Wr);var fn=pt.project(Or),ua=pt.project(Wr).sub(fn),Zn=J.curve,Gn=Math.max(pt.width,pt.height),ca=Gn/Bt,va=ua.mag();if("minZoom"in J){var Pa=e.clamp(Math.min(J.minZoom,$e,Vt),pt.minZoom,pt.maxZoom),ha=Gn/pt.zoomScale(Pa-$e);Zn=Math.sqrt(ha/va*2)}var Fa=Zn*Zn;function Ka(ol){var Tu=(ca*ca-Gn*Gn+(ol?-1:1)*Fa*Fa*va*va)/(2*(ol?ca:Gn)*Fa*va);return Math.log(Math.sqrt(Tu*Tu+1)-Tu)}function wi(ol){return(Math.exp(ol)-Math.exp(-ol))/2}function qi(ol){return(Math.exp(ol)+Math.exp(-ol))/2}function xs(ol){return wi(ol)/qi(ol)}var ps=Ka(0),yl=function(ol){return qi(ps)/qi(ps+Zn*ol)},fl=function(ol){return Gn*((qi(ps)*xs(ps+Zn*ol)-wi(ps))/Fa)/va},xl=(Ka(1)-ps)/Zn;if(Math.abs(va)<1e-6||!isFinite(xl)){if(Math.abs(Gn-ca)<1e-6)return this.easeTo(J,_e);var _l=caJ.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(ol){var Tu=ol*xl,Kf=1/yl(Tu);pt.zoom=ol===1?Vt:$e+pt.scaleZoom(Kf),qe._rotating&&(pt.bearing=e.number(it,Jt,ol)),qe._pitching&&(pt.pitch=e.number(Tt,ir,ol)),qe._padding&&(pt.interpolatePadding(Wt,rr,ol),Ht=pt.centerPoint.add(Yt));var Eh=ol===1?Wr:pt.unproject(fn.add(ua.mult(fl(Tu))).mult(Kf));pt.setLocationAtPoint(pt.renderWorldCopies?Eh.wrap():Eh,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 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 ia=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ia.prototype.add=function(q){var he=++this._id,J=this._queue;return J.push({callback:q,id:he,cancelled:!1}),he},ia.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 ia,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},hi,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 Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length?it||(it=!0,ft.call(pt,new er(_e,pt,Bt.originalEvent,{features:Yt}))):it=!1},Wt=function(){it=!1};return{layer:qe,listener:ft,delegates:{mousemove:Tt,mouseout:Wt}}}else if(_e==="mouseleave"||_e==="mouseout"){var Vt=!1,Jt=function(Bt){var Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length?Vt=!0:Vt&&(Vt=!1,ft.call(pt,new er(_e,pt,Bt.originalEvent)))},ir=function(Bt){Vt&&(Vt=!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 Yt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Yt.length&&(Bt.features=Yt,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],Wt=0;Wt180;){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 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,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"}],Wt=0,Vt=Tt;Wt=_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 tl(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,Ju=(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"),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,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 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(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"},tu=function(q){this.options=e.extend({},_f,q),e.bindAll(["_onMove","setUnit"],this)};tu.prototype.getDefaultPosition=function(){return"bottom-left"},tu.prototype._onMove=function(){du(this._map,this._container,this.options)},tu.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},tu.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},tu.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;fo(q,J,it,be._getUIString("ScaleControl.Miles"))}else fo(q,J,$e,be._getUIString("ScaleControl.Feet"))}else if(he&&he.unit==="nautical"){var Tt=pt/1852;fo(q,J,Tt,be._getUIString("ScaleControl.NauticalMiles"))}else pt>=1e3?fo(q,J,pt/1e3,be._getUIString("ScaleControl.Kilometers")):fo(q,J,pt,be._getUIString("ScaleControl.Meters"))}function fo(be,q,he,J){var _e=js(he),qe=_e/he;be.style.width=q*qe+"px",be.innerHTML=_e+" "+J}function Qu(be){var q=Math.pow(10,Math.ceil(-Math.log(be)/Math.LN10));return Math.round(be*q)/q}function js(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:Qu(he),q*he}var Ol=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")};Ol.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},Ol.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ol.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Ol.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)},Ol.prototype._updateTitle=function(){var q=this._getTitle();this._fullscreenButton.setAttribute("aria-label",q),this._fullscreenButton.title=q},Ol.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ol.prototype._isFullscreen=function(){return this._fullscreen},Ol.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())},Ol.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 hc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},dc=["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(hc),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=Ao(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,Wt;ft.y+$e.bottom.ythis._map.transform.height-Tt?Wt=["bottom"]:Wt=[],ft.xthis._map.transform.width-it/2&&Wt.push("right"),Wt.length===0?pt="bottom":pt=Wt.join("-")}var Vt=ft.add($e[pt]).round();r.setTransform(this._container,qo[pt]+" translate("+Vt.x+"px,"+Vt.y+"px)"),Qo(this._container,pt,"popup")}},q.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var J=this._container.querySelector(dc);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:Oi,NavigationControl:ji,GeolocateControl:Ju,AttributionControl:ta,ScaleControl:tu,FullscreenControl:Ol,Popup:Co,Marker:cl,Style:Yu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Mi,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})}}),t7=Ge({"src/plots/mapbox/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=wL(),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}}}),r7=Ge({"src/plots/mapbox/mapbox.js"(K,G){var h=TL(),b=_n(),S=B_(),E=Ro(),e=Ts(),t=lv(),r=Yf(),o=Up(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=Wy(),v=t7();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}}}),l7=Ge({"src/traces/choroplethmapbox/index.js"(K,G){G.exports={attributes:AL(),supplyDefaults:o7(),colorbar:Am(),calc:CE(),plot:s7(),hoverPoints:PE(),eventData:RE(),selectPoints:IE(),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/densitymapbox/hover.js"(K,G){var h=Ts(),b=XE().hoverPoints,S=XE().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]}}}}),p7=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}}}),m7=Ge({"src/traces/densitymapbox/index.js"(K,G){G.exports={attributes:ML(),supplyDefaults:c7(),colorbar:Am(),formatLabels:bL(),calc:f7(),plot:d7(),hoverPoints:v7(),eventData:p7(),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} +{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-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],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":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],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,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"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(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"}}}),_7=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"}}]}}}),q_=Ge({"src/plots/map/constants.js"(K,G){var h=zp(),b=y7(),S=_7(),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."}}}),lS=Ge({"src/plots/map/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=kc().attributes,E=Ns(),e=Gc().textposition,t=Hc().overrideAll,r=_u().templatedArray,o=q_(),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"}}}),ZE=Ge({"src/traces/scattermap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=uv(),e=$b(),t=Gc(),r=lS(),o=Gl(),n=zu(),i=Ki().extendFlat,a=Hc().overrideAll,s=lS(),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")}}),EL=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}}}}),x7=Ge({"src/traces/scattermap/defaults.js"(K,G){var h=_n(),b=uu(),S=Kd(),E=Vp(),e=op(),t=Nd(),r=ZE(),o=EL().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}}}),kL=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}}}),CL=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}}}}),b7=Ge({"src/traces/scattermap/convert.js"(K,G){var h=Si(),b=_n(),S=Ii().BADNUM,E=F_(),e=Ec(),t=As(),r=Fp(),o=uu(),n=EL().isSupportedFont,i=CL(),a=$d().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}}}),w7=Ge({"src/traces/scattermap/plot.js"(K,G){var h=_n(),b=b7(),S=q_().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}}}),T7=Ge({"src/traces/scattermap/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),A7=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(Zt,pr,br,Hr,Qr){const dn=4*Math.max(-pr,0),An=(Math.max(0,br)-br)*Hr*4+dn,Nn=4*Hr,pa=Math.max(0,pr),oi=Math.max(0,br);return{rect:{x:pa,y:oi,width:Math.min(Zt.width,pr+Hr)-pa,height:Math.min(Zt.height,br+Qr)-oi},layout:[{offset:An,stride:Nn}]}})(Y,D,Q,me,Re)),gt)for(let Zt=0;ZtL(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 Zt=yield We.blob();throw new ce(We.status,We.statusText,me.url,Zt)}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 Zt in me.headers)Rt.setRequestHeader(Zt,me.headers[Zt]);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 Zt=Rt.response;if(me.type==="json")try{Zt=JSON.parse(Rt.response)}catch(pr){return void We(pr)}Ve({data:Zt,cacheControl:Rt.getResponseHeader("Cache-Control"),expires:Rt.getResponseHeader("Expires")})}else{const Zt=new Blob([Rt.response],{type:Rt.getResponseHeader("Content-Type")});We(new ce(Rt.status,Rt.statusText,me.url,Zt))}},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(Er),Sr,Nr,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 Br(Y){return(Y%=360)<0&&(Y+=360),Y}function kn([Y,D,Q,me]){let Re,Ve;const We=Vn((.2225045*(Y=Wn(Y))+.7168786*(D=Wn(D))+.0606169*(Q=Wn(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 Wn(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 na([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),[aa(3.1338561*Ve-1.6168667*Re-.4906146*We),aa(-.9787684*Ve+1.9161415*Re+.033454*We),aa(.0719453*Ve-.2289914*Re+1.4052427*We),me]}function aa(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 qt(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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi]=We,Ba=[pr||" ",Qr||" ",Nn].join("");if(Ba===" "||Ba===" /"||Ba===",,"||Ba===",,,"){const ei=[Zt,Hr,An].join(""),Fi=ei==="%%%"?100:ei===""?255:0;if(Fi){const co=[sr(+Rt/Fi,0,1),sr(+br/Fi,0,1),sr(+dn/Fi,0,1),pa?Va(+pa,oi):1];if(qt(co))return co}}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,Zt,pr,br,Hr,Qr,dn]=Ve,An=[Rt||" ",pr||" ",Hr].join("");if(An===" "||An===" /"||An===",,"||An===",,,"){const Nn=[+gt,sr(+Zt,0,100),sr(+br,0,100),Qr?Va(+Qr,dn):1];if(qt(Nn))return(function([pa,oi,Ba,ei]){function Fi(co){const $o=(co+pa/30)%12,hl=oi*Math.min(Ba,1-Ba);return Ba-hl*Math.max(-1,Math.min($o-3,9-$o,1))}return pa=Br(pa),oi/=100,Ba/=100,[Fi(0),Fi(8),Fi(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)?Br(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 sn{constructor(D,Q,me,Re,Ve){this.text=D,this.image=Q,this.scale=me,this.fontStack=Re,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 Tn{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Tn)return D;if(typeof D=="number")return new Tn([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 Tn(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 ma{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof ma)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 mn||Y instanceof Tn||Y instanceof ma||Y instanceof da)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 Mr;if(Y instanceof mn)return $r;if(Y instanceof Tn)return Sr;if(Y instanceof ma)return Mt;if(Y instanceof da)return Nr;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=Er;break}Q=Re}return je(Q||Er,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 mn||Y instanceof Tn||Y instanceof ma||Y instanceof da?Y.toString():JSON.stringify(Y)}class Mi{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 Mi(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 Zt=D[1];if(typeof Zt!="string"||!(Zt in xt)||Zt==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);gt=xt[Zt],Re++}else gt=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],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=Tn.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=ma.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 mn.fromString(pi(this.args[0].evaluate(D)));case"resolvedImage":return da.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 ln{constructor(D,Q,me=[],Re,Ve=new lt,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 Mi)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){const gt=new qr;try{We=new Mi(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 ln(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,Er),Re=Q.parse(D[2],2,Er);return me&&Re?ye(me.type,[Nt,Ft,nt,dt,Er])?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 un{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,Er),Re=Q.parse(D[2],2,Er);if(!me||!Re)return null;if(!ye(me.type,[Nt,Ft,nt,dt,Er]))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 un(me,Re,Ve):null}return new un(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 Zt=2;ZtNumber.MAX_SAFE_INTEGER)return Hr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof dn=="number"&&Math.floor(dn)!==dn)return Hr.error("Numeric branch labels must be integer values.");if(me){if(Hr.checkSubtype(me,Hn(dn)))return null}else me=Hn(dn);if(Ve[String(dn)]!==void 0)return Hr.error("Branch labels must be unique.");Ve[String(dn)]=We.length}const Qr=Q.parse(br,Zt,Re);if(!Qr)return null;Re=Re||Qr.type,We.push(Qr)}const gt=Q.parse(D[1],1,Er);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,Er),Re=Q.parse(D[2],2,nt);if(!me||!Re)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 ${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 cn(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.',Zt);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[cn(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 Hi=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,Zt,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=Zt)):(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[dn,An,Nn,pa]=(function([oi,Ba,ei,Fi]){return oi=isNaN(oi)?0:oi*mr,na([ei,Math.cos(oi)*Ba,Math.sin(oi)*Ba,Fi])})([Hr,Qr??so(Ve,Zt,Q),so(We,pr,Q),so(gt,br,Q)]);return new ur(dn,An,Nn,pa,!1)}case"lab":{const[Re,Ve,We,gt]=na(io(Y.lab,D.lab,Q));return new ur(Re,Ve,We,gt,!1)}}},array:io,padding:function(Y,D,Q){return new Tn(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:Zt}}}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 Zt=0;Zt=pr)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Hr);const dn=Q.parse(br,Qr,Rt);if(!dn)return null;Rt=Rt||dn.type,gt.push([pr,dn])}return Xe(Rt,nt)||Xe(Rt,Qt)||Xe(Rt,Sr)||Xe(Rt,Mt)||Xe(Rt,je(nt))?new fi(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=cn(Q,Re),gt=fi.interpolationFactor(this.interpolation,Re,Q[We],Q[We+1]),Rt=me[We].evaluate(D),Zt=me[We+1].evaluate(D);switch(this.operator){case"interpolate":return Mo[this.type.kind](Rt,Zt,gt);case"interpolate-hcl":return Mo.color(Rt,Zt,gt,"hcl");case"interpolate-lab":return Mo.color(Rt,Zt,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?Er: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 da&&!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 vP{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,Er);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 Zt=We.parse(Ve[2],2,Er);if(!Zt)return null;if(!Xs(gt,Zt.type))return We.concat(2).error(`"${gt}" comparisons are not supported for type '${Je(Zt.type)}'.`);if(Rt.type.kind!==Zt.type.kind&&Rt.type.kind!=="value"&&Zt.type.kind!=="value")return We.error(`Cannot compare types '${Je(Rt.type)}' and '${Je(Zt.type)}'.`);me&&(Rt.type.kind==="value"&&Zt.type.kind!=="value"?Rt=new Cr(Zt.type,[Rt]):Rt.type.kind!=="value"&&Zt.type.kind==="value"&&(Zt=new Cr(Rt.type,[Zt])));let pr=null;if(Ve.length===4){if(Rt.type.kind!=="string"&&Zt.type.kind!=="string"&&Rt.type.kind!=="value"&&Zt.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(pr=We.parse(Ve[3],3,Mr),!pr)return null}return new vP(Rt,Zt,pr)}evaluate(Ve){const We=this.lhs.evaluate(Ve),gt=this.rhs.evaluate(Ve);if(me&&this.hasUntypedArgument){const Rt=Hn(We),Zt=Hn(gt);if(Rt.kind!==Zt.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}, ${Zt.kind}) instead.`)}if(this.collator&&!me&&this.hasUntypedArgument){const Rt=Hn(We),Zt=Hn(gt);if(Rt.kind!=="string"||Zt.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 vo{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 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 vo(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 ll{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 Zt=null;if(gt["text-font"]&&(Zt=Q.parse(gt["text-font"],1,je(Ft)),!Zt))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=Zt,br.textColor=pr}else{const Rt=Q.parse(D[We],1,Er);if(!Rt)return null;const Zt=Rt.type.kind;if(Zt!=="string"&&Zt!=="value"&&Zt!=="null"&&Zt!=="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 ll(Re)}evaluate(D){return new mn(this.sections.map(Q=>{const me=Q.content.evaluate(D);return Hn(me)===Nr?new sn("",me,null,null,null):new sn(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=Nr,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=da.fromString(Q);return me&&D.availableImages&&(me.available=D.availableImages.indexOf(Q)>-1),me}eachChild(D){D(this.input)}outputDefined(){return!1}}class Pl{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 Pl(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 di(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 Rl(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(ul(Y,Q))return!0;return!1}function Ji(Y,D){for(const Q of Y)if(!ul(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 Zt=[Rt.x+Ve[0],Rt.y+Ve[1]];Io(Zt,D,Q,Re),We.push(Zt)}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 Zt=[];for(const pr of Rt){const br=[pr.x+Ve[0],pr.y+Ve[1]];Cl(D,br),Zt.push(br)}We.push(Zt)}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 Zt of Rt)Io(Zt,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 Zt of Rt)if(!ul(Zt,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 Zt of Rt)if(!Au(Zt,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 Zt of Rt)if(!Ji(Zt,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 Zt of Rt)if(!gs(Zt,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 Fl(Y,D,Q,me,Re){ql(Y,D,Q,me||Y.length-1,Re||df)}function ql(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),Zt=.5*Math.sqrt(gt*Rt*(Ve-Rt)/Ve)*(We-Ve/2<0?-1:1);ql(Y,D,Math.max(Q,Math.floor(D-We*Rt/Ve+Zt)),Math.min(me,Math.floor(D+(Ve-We)*Rt/Ve+Zt)),Re)}var pr=Y[D],br=Q,Hr=me;for(Yu(Y,Q,D),Re(Y[me],pr)>0&&Yu(Y,Q,me);br0;)Hr--}Re(Y[Q],pr)===0?Yu(Y,Q,Hr):Yu(Y,++Hr,me),Hr<=D&&(Q=Hr+1),D<=Hr&&(me=Hr-1)}}function Yu(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?(Zt=D[Rt+1][0],pr=D[Rt+1][1]):Qr>0&&(Zt+=br/this.kx*Qr,pr+=Hr/this.ky*Qr)),br=this.wrap(Q[0]-Zt)*this.kx,Hr=(Q[1]-pr)*this.ky;const dn=br*br+Hr*Hr;dn180;)D-=360;return D}}function oc(Y,D){return D[0]-Y[0]}function Zu(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=Zu(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 Jl(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 Wu(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 Il(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,Zt=gt.length,pr=Zt-1;Rt0;){const Rt=We.pop();if(Rt[0]>=Ve)continue;const Zt=Rt[1],pr=D?50:100;if(Zu(Zt)<=pr){if(!sc(Zt,Y.length))return NaN;if(D){const br=Fs(Y,Zt,Q,me);if(isNaN(br)||br===0)return br;Ve=Math.min(Ve,br)}else for(let br=Zt[0];br<=Zt[1];++br){const Hr=Sd(Y[br],Q,me);if(Ve=Math.min(Ve,Hr),Ve===0)return 0}}else{const br=nf(Zt,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 Zt=Rt[1],pr=Rt[2],br=D?50:100,Hr=me?50:100;if(Zu(Zt)<=br&&Zu(pr)<=Hr){if(!sc(Zt,Y.length)&&sc(pr,Q.length))return NaN;let Qr;if(D&&me)Qr=Ff(Y,Zt,Q,pr,Re),We=Math.min(We,Qr);else if(D&&!me){const dn=Y.slice(Zt[0],Zt[1]+1);for(let An=pr[0];An<=pr[1];++An)if(Qr=Mf(Q[An],dn,Re),We=Math.min(We,Qr),We===0)return We}else if(!D&&me){const dn=Q.slice(pr[0],pr[1]+1);for(let An=Zt[0];An<=Zt[1];++An)if(Qr=Mf(Y[An],dn,Re),We=Math.min(We,Qr),We===0)return We}else Qr=fu(Y,Zt,Q,pr,Re),We=Math.min(We,Qr)}else{const Qr=nf(Zt,D),dn=nf(pr,me);th(gt,We,Re,Y,Q,Qr[0],dn[0]),th(gt,We,Re,Y,Q,Qr[0],dn[1]),th(gt,We,Re,Y,Q,Qr[1],dn[0]),th(gt,We,Re,Y,Q,Qr[1],dn[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(Zt=>Zt.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 Zt of Ve){switch(Rt.type){case"Point":gt=Math.min(gt,af([Rt.coordinates],!1,Zt,We,gt));break;case"LineString":gt=Math.min(gt,af(Rt.coordinates,!0,Zt,We,gt));break;case"Polygon":gt=Math.min(gt,pl(Zt,Rt.coordinates,We,gt))}if(gt===0)return gt}return gt})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const uh={"==":Uo,"!=":Ys,">":sl,"<":Vs,">=":Zo,"<=":fs,array:Cr,at:lr,boolean:Cr,case:qn,coalesce:Ho,collator:vo,format:ll,image:kl,in:zr,"index-of":un,interpolate:fi,"interpolate-hcl":fi,"interpolate-lab":fi,length:Pl,let:Jr,literal:Mi,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 $u{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=$u.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(([Zt])=>!Array.isArray(Zt)||Zt.length===D.length-1);let Rt=null;for(const[Zt,pr]of gt){Rt=new ln(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 Mi}),!!Q&&Bh(Y)&&Gh(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bh(Y){if(Y instanceof $u&&(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 $u&&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 $u&&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 Ku(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 Bl(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:Tn.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,Zt;if(Ve==="exponential")gt=Zh;else if(Ve==="interval")gt=Dc;else if(Ve==="categorical"){gt=Yh,Rt=Object.create(null);for(const pr of Y.stops)Rt[pr[0]]=pr[1];Zt=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 dn=0;dndn[0]),evaluate:({zoom:dn},An)=>Zh({stops:Hr,base:Y.base},D,dn).evaluate(dn,An)}}if(Re){const pr=Ve==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:pr,interpolationFactor:fi.interpolationFactor.bind(void 0,pr),zoomStops:Y.stops.map(br=>br[0]),evaluate:({zoom:br})=>gt(Y,D,br,Rt,Zt)}}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,Zt)}}}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 Dc(Y,D,Q){if(Bl(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=cn(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(Bl(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=cn(Y.stops.map(pr=>pr[0]),Q),We=(function(pr,br,Hr,Qr){const dn=Qr-Hr,An=pr-Hr;return dn===0?0:br===1?An/dn:(Math.pow(br,An)-1)/(Math.pow(br,dn)-1)})(Q,me,Y.stops[Ve][0],Y.stops[Ve+1][0]),gt=Y.stops[Ve][1],Rt=Y.stops[Ve+1][1],Zt=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 Zt(br,Hr,We,Y.colorSpace)}}:Zt(gt,Rt,We,Y.colorSpace)}function wu(Y,D,Q){switch(D.type){case"color":Q=ur.parse(Q);break;case"formatted":Q=mn.fromString(Q.toString());break;case"resolvedImage":Q=da.fromString(Q.toString());break;case"padding":Q=Tn.parse(Q);break;default:Bl(Q)===D.type||D.type==="enum"&&D.values[Q]||(Q=void 0)}return fh(Q,Y.default,D.default)}$u.register(uh,{error:[{kind:"error"},[Ft],(Y,[D])=>{throw new Dt(D.evaluate(Y))}],typeof:[Ft,[Er],(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:Er,overloads:[[[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.properties())],[[Ft,ar],(Y,[D,Q])=>ch(D.evaluate(Y),Q.evaluate(Y))]]},"feature-state":[Er,[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.featureState||{})],properties:[ar,[],Y=>Y.properties()],"geometry-type":[Ft,[],Y=>Y.geometryType()],id:[Er,[],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:[Er,[],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,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],Re=Q.value;return typeof me==typeof Re&&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],Re=Q.value;return typeof me==typeof Re&&me>Re}],"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],Re=Q.value;return typeof me==typeof Re&&me<=Re}],"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],Re=Q.value;return typeof me==typeof Re&&me>=Re}],"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,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(Er),(Y,D)=>D.map(Q=>pi(Q.evaluate(Y))).join("")],"resolved-locale":[Ft,[Mr],(Y,[D])=>D.evaluate(Y).resolvedLocale()]});class zc{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"?Tn.parse(me.default)||null:me.type==="variableAnchorOffsetCollection"?ma.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 Ql(Y,D){const Q=new ln(uh,Fh,[],D?(function(Re){const Ve={color:Qt,string:Ft,number:nt,enum:Ft,boolean:Nt,formatted:$r,padding:Sr,resolvedImage:Nr,variableAnchorOffsetCollection:Mt};return Re.type==="array"?je(Ve[Re.value]||Er,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 zc(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 mc{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?fi.interpolationFactor(this.interpolationType,D,Q,me):0}}function Oc(Y,D){const Q=Ql(Y,D);if(Q.result==="error")return Q;const me=Q.value.expression,Re=Bh(me);if(!Re&&!Ku(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 fi&&!Nh(D)?vf([new Ne("",'"interpolate" expressions cannot be used with this property')]):Ef(We?new mc(Re?"camera":"composite",Q.value,We.labels,We instanceof fi?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 fi)&&Y.input instanceof $u&&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=Ql(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:ev(Y)}}function Ed(Y,D){return YD?1:0}function ev(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=au(Y.value.type);let me,Re,Ve,We={};const gt=Q!=="categorical"&&Y.value.property===void 0,Rt=!gt,Zt=Bl(Y.value.stops)==="array"&&Bl(Y.value.stops[0])==="array"&&Bl(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 dn=[];const An=Qr.value;return dn=dn.concat(Uh({key:Qr.key,value:An,valueSpec:Qr.valueSpec,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,arrayElementValidator:br})),Bl(An)==="array"&&An.length===0&&dn.push(new Ae(Qr.key,An,"array must have at least one stop")),dn},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&&!Ku(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"&&!Zt||Y.value.property!==void 0||pr.push(new Ae(Y.key,Y.value,'"property" property is required')),pr;function br(Qr){let dn=[];const An=Qr.value,Nn=Qr.key;if(Bl(An)!=="array")return[new Ae(Nn,An,`array expected, ${Bl(An)} found`)];if(An.length!==2)return[new Ae(Nn,An,`array length 2 expected, length ${An.length} found`)];if(Zt){if(Bl(An[0])!=="object")return[new Ae(Nn,An,`object expected, ${Bl(An[0])} found`)];if(An[0].zoom===void 0)return[new Ae(Nn,An,"object stop key must have zoom")];if(An[0].value===void 0)return[new Ae(Nn,An,"object stop key must have value")];if(Ve&&Ve>au(An[0].zoom))return[new Ae(Nn,An[0].zoom,"stop zoom values must appear in ascending order")];au(An[0].zoom)!==Ve&&(Ve=au(An[0].zoom),Re=void 0,We={}),dn=dn.concat(sf({key:`${Nn}[0]`,value:An[0],valueSpec:{zoom:{}},validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,objectElementValidators:{zoom:su,value:Hr}}))}else dn=dn.concat(Hr({key:`${Nn}[0]`,value:An[0],validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec},An));return Uf(Fc(An[1]))?dn.concat([new Ae(`${Nn}[1]`,An[1],"expressions are not allowed in function stops.")]):dn.concat(Qr.validateSpec({key:`${Nn}[1]`,value:An[1],valueSpec:D,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec}))}function Hr(Qr,dn){const An=Bl(Qr.value),Nn=au(Qr.value),pa=Qr.value!==null?Qr.value:dn;if(me){if(An!==me)return[new Ae(Qr.key,pa,`${An} stop domain type must match previous stop domain type ${me}`)]}else me=An;if(An!=="number"&&An!=="string"&&An!=="boolean")return[new Ae(Qr.key,pa,"stop domain value must be a number, string, or boolean")];if(An!=="number"&&Q!=="categorical"){let oi=`number expected, ${An} found`;return Ku(D)&&Q===void 0&&(oi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ae(Qr.key,pa,oi)]}return Q!=="categorical"||An!=="number"||isFinite(Nn)&&Math.floor(Nn)===Nn?Q!=="categorical"&&An==="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(au(Q))===-1&&Re.push(new Ae(D,Q,`expected one of [${me.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(me.values).indexOf(au(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(Fc(Y.value))?qf(pe({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):mf(Y)}function mf(Y){const D=Y.value,Q=Y.key;if(Bl(D)!=="array")return[new Ae(Q,D,`array expected, ${Bl(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})),au(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&au(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=Bl(D[1]),Re!=="string"&&Ve.push(new Ae(`${Q}[1]`,D[1],`string expected, ${Re} found`)));for(let We=2;We{Zt in Q&&D.push(new Ae(me,Q[Zt],`"${Zt}" is prohibited for ref layers`))}),Re.layers.forEach(Zt=>{au(Zt.id)===gt&&(Rt=Zt)}),Rt?Rt.ref?D.push(new Ae(me,Q.ref,"ref cannot reference another ref layer")):We=au(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],Zt=Rt&&au(Rt.type);Rt?Zt==="vector"&&We==="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster source`)):Zt!=="raster-dem"&&We==="hillshade"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster-dem source`)):Zt==="raster"&&We!=="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a vector source`)):Zt!=="vector"||Q["source-layer"]?Zt==="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"]||Zt==="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:{"*":Zt=>fc(pe({layerType:We},Zt))}}),paint:Rt=>sf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Zt=>kd(pe({layerType:We},Zt))}})}})),D}function Wc(Y){const D=Y.value,Q=Y.key,me=Bl(D);return me!=="string"?[new Ae(Q,D,`string expected, ${me} found`)]:[]}const Cf={promoteId:function({key:Y,value:D}){if(Bl(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=au(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 Zt;const pr=(Zt=Rt.sourceName)!==null&&Zt!==void 0?Zt:"",br=Rt.value,Hr=Rt.styleSpec,Qr=Hr.source_raster_dem,dn=Rt.style;let An=[];const Nn=Bl(br);if(br===void 0)return An;if(Nn!=="object")return An.push(new Ae("source_raster_dem",br,`object expected, ${Nn} found`)),An;const pa=au(br.encoding)==="custom",oi=["redFactor","greenFactor","blueFactor","baseShift"],Ba=Rt.value.encoding?`"${Rt.value.encoding}"`:"Default";for(const ei in br)!pa&&oi.includes(ei)?An.push(new Ae(ei,br[ei],`In "${pr}": "${ei}" is only valid when "encoding" is set to "custom". ${Ba} encoding found`)):Qr[ei]?An=An.concat(Rt.validateSpec({key:ei,value:br[ei],valueSpec:Qr[ei],validateSpec:Rt.validateSpec,style:dn,styleSpec:Hr})):An.push(new Ae(ei,br[ei],`unknown property "${ei}"`));return An})({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[Zt,pr]=D.clusterProperties[Rt],br=typeof Zt=="string"?[Zt,["accumulated"],["get",Rt]]:Zt;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=Bl(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 wc(Y){const D=Y.value,Q=Y.styleSpec,me=Q.sky,Re=Y.style,Ve=Bl(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=Bl(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=Bl(D);return me!=="boolean"?[new Ae(Q,D,`boolean expected, ${me} found`)]:[]},number:su,color:function(Y){const D=Y.key,Q=Y.value,me=Bl(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:wc,terrain:pu,projection:function(Y){const D=Y.value,Q=Y.styleSpec,me=Q.projection,Re=Y.style,Ve=Bl(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(Bl(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 vn(Y){return function(D){return Y(bo(Gi({},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(vn(gf)),Rr.sprite=On(vn(Vf)),Rr.glyphs=On(vn(fr)),Rr.light=On(vn(Su)),Rr.sky=On(vn(wc)),Rr.terrain=On(vn(pu)),Rr.layer=On(vn($h)),Rr.filter=On(vn(dh)),Rr.paintProperty=On(vn(kd)),Rr.layoutProperty=On(vn(fc));const Aa=Rr,xa=Aa.light,ti=Aa.sky,ci=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[dn+0]&&Re>=br[dn+1])?(gt[Qr]=!0,We.push(pr[Qr])):gt[Qr]=!1}}}}_forEachCell(D,Q,me,Re,Ve,We,gt,Rt){const Zt=this._convertToCellCoord(D),pr=this._convertToCellCoord(Q),br=this._convertToCellCoord(me),Hr=this._convertToCellCoord(Re);for(let Qr=Zt;Qr<=br;Qr++)for(let dn=pr;dn<=Hr;dn++){const An=this.d*dn+Qr;if((!Rt||Rt(this._convertFromCellCoord(Qr),this._convertFromCellCoord(dn),this._convertFromCellCoord(Qr+1),this._convertFromCellCoord(dn+1)))&&Ve.call(this,D,Q,me,Re,An,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 Zi{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 Vl(Y){return Mu.test(String.fromCodePoint(Y))}function yo(Y,D){return!(!D&&Vl(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||Li.Khmer(Y))}function ys(Y){for(const D of Y)if(Vl(D.charCodeAt(0)))return!0;return!1}const Dl=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 Zi,this.transition={})}isSupportedScript(D){return(function(Q,me){for(const Re of Q)if(!yo(Re.charCodeAt(0),me))return!1;return!0})(D,Dl.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 gc{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=Oc(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=ma.parse(me)):Ve=Tn.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 yc{constructor(D){this.property=D,this.value=new gc(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 Tc{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 yc(this._values[D].property)),this._values[D].value=new gc(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 yc(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 _c(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 _c(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 Zt=Rt*Rt,pr=Zt*Rt;return 4*(Rt<.5?pr:3*(Rt-Zt)+pr-.75)})(gt))}}return Ve}}class _c{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 gc(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 Bc{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 gc(me,void 0),Ve=this.defaultTransitionablePropertyValues[Q]=new yc(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",Bc);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 Tc(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(ci,`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&&Ku(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 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 Re=2*D;return this.int16[Re+0]=Q,this.int16[Re+1]=me,D}}Gt.prototype.bytesPerElement=4,Na("StructArrayLayout2i4",Gt);class hr 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}}hr.prototype.bytesPerElement=6,Na("StructArrayLayout3i6",hr);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 en 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,Zt=8*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.uint8[Zt+4]=Re,this.uint8[Zt+5]=Ve,this.uint8[Zt+6]=We,this.uint8[Zt+7]=gt,D}}en.prototype.bytesPerElement=8,Na("StructArrayLayout2i4ub8",en);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,Zt,pr){const br=this.length;return this.resize(br+1),this.emplace(br,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,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]=Zt,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,Zt,pr,br,Hr){const Qr=this.length;return this.resize(Qr+1),this.emplace(Qr,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr){const dn=12*D;return this.int16[dn+0]=Q,this.int16[dn+1]=me,this.int16[dn+2]=Re,this.int16[dn+3]=Ve,this.uint16[dn+4]=We,this.uint16[dn+5]=gt,this.uint16[dn+6]=Rt,this.uint16[dn+7]=Zt,this.int16[dn+8]=pr,this.int16[dn+9]=br,this.int16[dn+10]=Hr,this.int16[dn+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,Zt){const pr=this.length;return this.resize(pr+1),this.emplace(pr,D,Q,me,Re,Ve,We,gt,Rt,Zt)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,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]=Zt,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,Zt=4*D,pr=8*D;return this.uint8[Rt+0]=Q,this.uint8[Rt+1]=me,this.float32[Zt+1]=Re,this.float32[Zt+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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa){const oi=this.length;return this.resize(oi+1),this.emplace(oi,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi){const Ba=24*D,ei=12*D,Fi=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]=Zt,this.uint16[Ba+11]=pr,this.uint16[Ba+12]=br,this.float32[ei+7]=Hr,this.float32[ei+8]=Qr,this.uint8[Fi+36]=dn,this.uint8[Fi+37]=An,this.uint8[Fi+38]=Nn,this.uint32[ei+10]=pa,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,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss){const bs=this.length;return this.resize(bs+1),this.emplace(bs,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn,An,Nn,pa,oi,Ba,ei,Fi,co,$o,hl,is,Yo,Ds,Ss,bs){const Qi=32*D,Gs=16*D;return this.int16[Qi+0]=Q,this.int16[Qi+1]=me,this.int16[Qi+2]=Re,this.int16[Qi+3]=Ve,this.int16[Qi+4]=We,this.int16[Qi+5]=gt,this.int16[Qi+6]=Rt,this.int16[Qi+7]=Zt,this.uint16[Qi+8]=pr,this.uint16[Qi+9]=br,this.uint16[Qi+10]=Hr,this.uint16[Qi+11]=Qr,this.uint16[Qi+12]=dn,this.uint16[Qi+13]=An,this.uint16[Qi+14]=Nn,this.uint16[Qi+15]=pa,this.uint16[Qi+16]=oi,this.uint16[Qi+17]=Ba,this.uint16[Qi+18]=ei,this.uint16[Qi+19]=Fi,this.uint16[Qi+20]=co,this.uint16[Qi+21]=$o,this.uint16[Qi+22]=hl,this.uint32[Gs+12]=is,this.float32[Gs+13]=Yo,this.float32[Gs+14]=Ds,this.uint16[Qi+30]=Ss,this.uint16[Qi+31]=bs,D}}Yr.prototype.bytesPerElement=64,Na("StructArrayLayout8i15ui1ul2f2ui64",Yr);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 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 Wi 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]}}Wi.prototype.size=48;class To extends Pr{get(D){return new Wi(this,D)}}Na("PlacedSymbolArray",To);class ho 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]}}ho.prototype.size=64;class Wo extends Yr{get(D){return new ho(this,D)}}Na("SymbolInstanceArray",Wo);class Js extends on{getoffsetX(D){return this.float32[1*D+0]}}Na("GlyphOffsetArray",Js);class Qs extends hr{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 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 al extends En{get(D){return new Es(this,D)}}Na("TextAnchorOffsetArray",al);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 iu extends Pn{get(D){return new mu(this,D)}}Na("FeatureIndexArray",iu);class ks extends Gt{}class Cs extends Gt{}class Ru extends Gt{}class uc extends Lr{}class Nc extends en{}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 hn{constructor(D=[]){this.segments=D}prepareSegment(D,Q,me,Re){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!==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 hn([{vertexOffset:D,primitiveOffset:Q,vertexLength:me,primitiveLength:Re,vaos:{},sortKey:0}])}}function Sn(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 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,Zt;for(me=Y.length-(Q=3&Y.length),Re=D,We=3432918353,gt=461845907,Zt=0;Zt>>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(Zt+2))<<16;case 2:Rt^=(255&Y.charCodeAt(Zt+1))<<8;case 1:Re^=Rt=(65535&(Rt=(Rt=(65535&(Rt^=255&Y.charCodeAt(Zt)))*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 Qn=zn.exports,la={exports:{}};la.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=Qn,Ra=la.exports;La.exports=Sa,La.exports.murmur3=Sa,La.exports.murmur2=Ra;var sa=r(La.exports);class ai{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,Q,me,Re){this.ids.push(Yi(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=Yi(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 zi(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 Yi(Y){const D=+Y;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:sa(String(Y))}function zi(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 eu{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 Ac(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:on,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",eu),Na("SourceExpressionBinder",lo),Na("CrossFadedCompositeBinder",el),Na("CompositeExpressionBinder",Ls),Na("ProgramConfiguration",$l,{omit:["_buffers"]}),Na("ProgramConfigurationSet",zl);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 hn,this.programConfigurations=new zl(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:Zt,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 dn=gt?We.evaluate(Qr,{},me):void 0,An={id:Zt,properties:Rt.properties,type:Rt.type,sourceLayerIndex:br,index:pr,geometry:Hr?Qr.geometry:mt(Rt),patterns:{},sortKey:dn};Ve.push(An)}gt&&Ve.sort((Rt,Zt)=>Rt.sortKey-Zt.sortKey);for(const Rt of Ve){const{geometry:Zt,index:pr,sourceLayerIndex:br}=Rt,Hr=D[pr].feature;this.addFeature(Rt,Zt,pr,me),Q.featureIndex.insert(Hr,Zt,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 Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),pr=Zt.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),Zt.vertexLength+=4,Zt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,{},Re)}}function fa(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 ga(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;gtOi(Nn,An))})(Zt,Rt),Qr=br?pr*gt:pr;for(const dn of Re)for(const An of dn){const Nn=br?An:Oi(An,Rt);let pa=Qr;const oi=$a([],[An.x,An.y,0,1],Rt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?pa*=oi[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(pa*=We.cameraToCenterDistance/oi[3]),gn(Hr,Nn,pa))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 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 Bc(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 Ao(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 Zt=Y.expression.evaluate(D);Re.data[We+gt+0]=Math.floor(255*Zt.r/Zt.a),Re.data[We+gt+1]=Math.floor(255*Zt.g/Zt.a),Re.data[We+gt+2]=Math.floor(255*Zt.b/Zt.a),Re.data[We+gt+3]=Math.floor(255*Zt.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),dn>br&&(br=dn)}Zt=Math.max(pr-gt,br-Rt),Zt=Zt!==0?32767/Zt:0}return js(Ve,We,Q,gt,Rt,Zt,0),We}function fo(Y,D,Q,me,Re){let Ve;if(Re===(function(We,gt,Rt,Zt){let pr=0;for(let br=gt,Hr=Rt-Zt;br0)for(let We=D;We=D;We-=me)Ve=Vt(We/me|0,Y[We],Y[We+1],Ve);return Ve&&ft(Ve,Ve.next)&&(Jt(Ve),Ve=Ve.next),Ve}function Qu(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 js(Y,D,Q,me,Re,Ve,We){if(!Y)return;!We&&Ve&&(function(Rt,Zt,pr,br){let Hr=Rt;do Hr.z===0&&(Hr.z=q(Hr.x,Hr.y,Zt,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 dn,An=1;do{let Nn,pa=Qr;Qr=null;let oi=null;for(dn=0;pa;){dn++;let Ba=pa,ei=0;for(let co=0;co0||Fi>0&&Ba;)ei!==0&&(Fi===0||!Ba||pa.z<=Ba.z)?(Nn=pa,pa=pa.nextZ,ei--):(Nn=Ba,Ba=Ba.nextZ,Fi--),oi?oi.nextZ=Nn:Qr=Nn,Nn.prevZ=oi,oi=Nn;pa=Ba}oi.nextZ=null,An*=2}while(dn>1)})(Hr)})(Y,me,Re,Ve);let gt=Y;for(;Y.prev!==Y.next;){const Rt=Y.prev,Zt=Y.next;if(Ve?hc(Y,me,Re,Ve):Ol(Y))D.push(Rt.i,Y.i,Zt.i),Jt(Y),Y=Zt.next,gt=Zt.next;else if((Y=Zt)===gt){We?We===1?js(Y=dc(Qu(Y),D),D,Q,me,Re,Ve,2):We===2&&Co(Y,D,Q,me,Re,Ve):js(Qu(Y),D,Q,me,Re,Ve,1);break}}}function Ol(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,Zt=me.y,pr=ReVe?Re>We?Re:We:Ve>We?Ve:We,Qr=gt>Rt?gt>Zt?gt:Zt:Rt>Zt?Rt:Zt;let dn=me.next;for(;dn!==D;){if(dn.x>=pr&&dn.x<=Hr&&dn.y>=br&&dn.y<=Qr&&J(Re,gt,Ve,Rt,We,Zt,dn.x,dn.y)&&qe(dn.prev,dn,dn.next)>=0)return!1;dn=dn.next}return!0}function hc(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,Zt=We.x,pr=Re.y,br=Ve.y,Hr=We.y,Qr=gtRt?gt>Zt?gt:Zt:Rt>Zt?Rt:Zt,Nn=pr>br?pr>Hr?pr:Hr:br>Hr?br:Hr,pa=q(Qr,dn,D,Q,me),oi=q(An,Nn,D,Q,me);let Ba=Y.prevZ,ei=Y.nextZ;for(;Ba&&Ba.z>=pa&&ei&&ei.z<=oi;){if(Ba.x>=Qr&&Ba.x<=An&&Ba.y>=dn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Zt,Hr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0||(Ba=Ba.prevZ,ei.x>=Qr&&ei.x<=An&&ei.y>=dn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Zt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0))return!1;ei=ei.nextZ}for(;Ba&&Ba.z>=pa;){if(Ba.x>=Qr&&Ba.x<=An&&Ba.y>=dn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Zt,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<=An&&ei.y>=dn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Zt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0)return!1;ei=ei.nextZ}return!0}function dc(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 Qu(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=Wt(We,gt);return We=Qu(We,We.next),Rt=Qu(Rt,Rt.next),js(We,D,Q,me,Re,Ve,0),void js(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 Zt,pr=-1/0;do{if(Rt<=We.y&&Rt>=We.next.y&&We.next.y!==We.y){const An=We.x+(Rt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(An<=gt&&An>pr&&(pr=An,Zt=We.x=We.x&&We.x>=Hr&>!==We.x&&J(RtZt.x||We.x===Zt.x&&be(Zt,We)))&&(Zt=We,dn=An)}We=We.next}while(We!==br);return Zt})(Y,D);if(!Q)return D;const me=Wt(Q,Y);return Qu(me,me.next),Qu(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 Wt(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 Vt(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),Zt=gt.evaluate({zoom:me},Q,{},Re.availableImages),pr=gt.evaluate({zoom:me+1},Q,{},Re.availableImages);Rt=Rt&&Rt.name?Rt.name:Rt,Zt=Zt&&Zt.name?Zt.name:Zt,pr=pr&&pr.name?pr.name:pr,Ve[Rt]=!0,Ve[Zt]=!0,Ve[pr]=!0,Q.patterns[We.id]={min:Rt,mid:Zt,max:pr}}}return Q}class Yt{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 zl(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=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:Zt,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,dn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Zt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(dn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Zt,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,Zt,me,{});Q.featureIndex.insert(D[Zt].feature,Rt,Zt,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,tu),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),Zt=Rt.vertexLength,pr=[],br=[];for(const Qr of We){if(Qr.length===0)continue;Qr!==We[0]&&br.push(pr.length/2);const dn=this.segments2.prepareSegment(Qr.length,this.layoutVertexArray,this.indexArray2),An=dn.vertexLength;this.layoutVertexArray.emplaceBack(Qr[0].x,Qr[0].y),this.indexArray2.emplaceBack(An+Qr.length-1,An),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 va(Ve,We));else{if(me!==7)throw new Error("unknown command "+me);D&&D.push(D[0].clone())}}return D&>.push(D),gt},ha.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,Zt=-1/0;Y.pos>3}if(me--,Q===1||Q===2)(Re+=Y.readSVarint())gt&&(gt=Re),(Ve+=Y.readSVarint())Zt&&(Zt=Ve);else if(Q!==7)throw new Error("unknown command "+Q)}return[We,Rt,gt,Zt]},ha.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(),Zt=ha.types[this.type];function pr(Qr){for(var dn=0;dn>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 fl(Y,D,Q){if(Y===3){var me=new yl(Q,Q.readVarint()+Q.pos);me.length&&(D[me.name]=me)}}ca.VectorTile=function(Y,D){this.layers=Y.readFields(fl,{},D)},ca.VectorTileFeature=Pa,ca.VectorTileLayer=qi;const xl=ca.VectorTileFeature.types,_l=Math.pow(2,13);function ec(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 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 uc,this.centroidVertexArray=new ks,this.indexArray=new er,this.programConfigurations=new zl(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=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,Zt=yr(Re,Rt);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Zt,me))continue;const pr={id:Ve,sourceLayerIndex:gt,index:We,geometry:Rt?Zt.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 dn of We)Rt+=dn.length;let Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const dn of We){if(dn.length===0||Kf(dn))continue;let An=0;for(let Nn=0;Nn=1){const oi=dn[Nn-1];if(!Tu(pa,oi)){Zt.vertexLength+4>hn.MAX_VERTEX_ARRAY_LENGTH&&(Zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ba=pa.sub(oi)._perp()._unit(),ei=oi.dist(pa);An+ei>32768&&(An=0),ec(this.layoutVertexArray,pa.x,pa.y,Ba.x,Ba.y,0,0,An),ec(this.layoutVertexArray,pa.x,pa.y,Ba.x,Ba.y,0,1,An),gt.x+=2*pa.x,gt.y+=2*pa.y,gt.vertexCount+=2,An+=ei,ec(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,0,An),ec(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,1,An),gt.x+=2*oi.x,gt.y+=2*oi.y,gt.vertexCount+=2;const Fi=Zt.vertexLength;this.indexArray.emplaceBack(Fi,Fi+2,Fi+1),this.indexArray.emplaceBack(Fi+1,Fi+2,Fi+3),Zt.vertexLength+=4,Zt.primitiveLength+=2}}}}if(Zt.vertexLength+Rt>hn.MAX_VERTEX_ARRAY_LENGTH&&(Zt=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),xl[D.type]!=="Polygon")continue;const pr=[],br=[],Hr=Zt.vertexLength;for(const dn of We)if(dn.length!==0){dn!==We[0]&&br.push(pr.length/2);for(let An=0;AnKl)||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",ol,{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 ol(D)}queryRadius(){return Fn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,Q,me,Re,Ve,We,gt,Rt){const Zt=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(dn,An,Nn,pa){const oi=[];for(const Ba of dn){const ei=[Ba.x,Ba.y,0,1];$a(ei,ei,An),oi.push(new i(ei[0]/ei[3],ei[1]/ei[3]))}return oi})(Zt,Rt),Qr=(function(dn,An,Nn,pa){const oi=[],Ba=[],ei=pa[8]*An,Fi=pa[9]*An,co=pa[10]*An,$o=pa[11]*An,hl=pa[8]*Nn,is=pa[9]*Nn,Yo=pa[10]*Nn,Ds=pa[11]*Nn;for(const Ss of dn){const bs=[],Qi=[];for(const Gs of Ss){const zs=Gs.x,Ll=Gs.y,lf=pa[0]*zs+pa[4]*Ll+pa[12],Jc=pa[1]*zs+pa[5]*Ll+pa[13],hd=pa[2]*zs+pa[6]*Ll+pa[14],Av=pa[3]*zs+pa[7]*Ll+pa[15],kh=hd+co,Qh=Av+$o,vv=lf+hl,pv=Jc+is,mv=hd+Yo,Jf=Av+Ds,dd=new i((lf+ei)/Qh,(Jc+Fi)/Qh);dd.z=kh/Qh,bs.push(dd);const iv=new i(vv/Jf,pv/Jf);iv.z=mv/Jf,Qi.push(iv)}oi.push(bs),Ba.push(Qi)}return[oi,Ba]})(Re,br,pr,Rt);return(function(dn,An,Nn){let pa=1/0;pn(Nn,An)&&(pa=hp(Nn,An[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 Nc,this.layoutVertexArray2=new ge,this.indexArray=new er,this.programConfigurations=new zl(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=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:Zt,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,dn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Zt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(dn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Zt,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,Zt,me,{});Q.featureIndex.insert(D[Zt].feature,Rt,Zt,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"),Zt=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,Zt,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 pa=0;pa=2&&D[Rt-1].equals(D[Rt-2]);)Rt--;let Zt=0;for(;Zt0;if($o&&pa>Zt){const Ds=Hr.dist(Qr);if(Ds>2*pr){const Ss=Hr.sub(Hr.sub(Qr)._mult(pr/Ds)._round());this.updateDistance(Qr,Ss),this.addCurrentVertex(Ss,An,0,0,br),Qr=Ss}}const is=Qr&&dn;let Yo=is?me:gt?"butt":Re;if(is&&Yo==="round"&&(FiVe&&(Yo="bevel"),Yo==="bevel"&&(Fi>2&&(Yo="flipbevel"),Fi100)oi=Nn.mult(-1);else{const Ds=Fi*An.add(Nn).mag()/An.sub(Nn).mag();oi._perp()._mult(Ds*(hl?-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 Ds=-Math.sqrt(Fi*Fi-1),Ss=hl?Ds:0,bs=hl?0:Ds;if(Qr&&this.addCurrentVertex(Hr,An,Ss,bs,br),Yo==="fakeround"){const Qi=Math.round(180*co/Math.PI/20);for(let Gs=1;Gs2*pr){const Ss=Hr.add(dn.sub(Hr)._mult(pr/Ds)._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 Zt=.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&Zt)<<2,Zt>>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,Fg;Na("LineBucket",dp,{omit:["layers","patternFeatures"]});var Q0={get paint(){return Fg=Fg||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 Bc(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 Bg 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),Zt=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 dn=0;dn=3){for(let Nn=0;Nn0?D+2*Y:Y}const Nm=_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 Ng=_t([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Um=_t([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function jm(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()),Dl.applyArabicShaping&&(Re=Dl.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 vc=24,av=Sc,Ug=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-Zt;else{if(Ve===Rt)return We?NaN:1/0*(Qr?-1:1);We+=Math.pow(2,me),Ve-=Zt}return(Qr?-1:1)*We*Math.pow(2,Ve-me)},Jy=function(Y,D,Q,me,Re,Ve){var We,gt,Rt,Zt=8*Ve-Re-1,pr=(1<>1,Hr=Re===23?Math.pow(2,-24)-Math.pow(2,-77):0,Qr=0,dn=1,An=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+=dn,gt/=256,Re-=8);for(We=We<0;Y[Q+Qr]=255&We,Qr+=dn,We/=256,Zt-=8);Y[Q+Qr-dn]|=128*An};function Sc(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}Sc.Varint=0,Sc.Fixed64=1,Sc.Bytes=2,Sc.Fixed32=5;var V_=4294967296,qm=1/V_,tw=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Zv(Y){return Y.type===Sc.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function Vm(Y,D,Q){return Q?4294967296*D+(Y>>>0):4294967296*(D>>>0)+(Y>>>0)}function rw(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 H_(Y,D){for(var Q=0;Q>>8,Y[Q+2]=D>>>16,Y[Q+3]=D>>>24}function cS(Y,D){return(Y[D]|Y[D+1]<<8|Y[D+2]<<16)+(Y[D+3]<<24)}Sc.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=aw(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=cS(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=aw(this.buf,this.pos)+aw(this.buf,this.pos+4)*V_;return this.pos+=8,Y},readSFixed64:function(){var Y=aw(this.buf,this.pos)+cS(this.buf,this.pos+4)*V_;return this.pos+=8,Y},readFloat:function(){var Y=Ug(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=Ug(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,Zt=We.buf;if(gt=(112&(Rt=Zt[We.pos++]))>>4,Rt<128||(gt|=(127&(Rt=Zt[We.pos++]))<<3,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<10,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<17,Rt<128)||(gt|=(127&(Rt=Zt[We.pos++]))<<24,Rt<128)||(gt|=(1&(Rt=Zt[We.pos++]))<<31,Rt<128))return Vm(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&&tw?(function(Q,me,Re){return tw.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],Zt=Q[We+3],(192&(gt=Q[We+1]))==128&&(192&Rt)==128&&(192&Zt)==128&&((br=(15&pr)<<18|(63>)<<12|(63&Rt)<<6|63&Zt)<=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!==Sc.Bytes)return Y.push(this.readVarint(D));var Q=Zv(this);for(Y=Y||[];this.pos127;);else if(D===Sc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Sc.Fixed32)this.pos+=4;else{if(D!==Sc.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&&rw(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&&rw(Q,me,this),this.pos=Q-1,this.writeVarint(me),this.pos+=me},writeMessage:function(Y,D,Q){this.writeTag(Y,Sc.Bytes),this.writeRawMessage(D,Q)},writePackedVarint:function(Y,D){D.length&&this.writeMessage(Y,H_,D)},writePackedSVarint:function(Y,D){D.length&&this.writeMessage(Y,s6,D)},writePackedBoolean:function(Y,D){D.length&&this.writeMessage(Y,c6,D)},writePackedFloat:function(Y,D){D.length&&this.writeMessage(Y,l6,D)},writePackedDouble:function(Y,D){D.length&&this.writeMessage(Y,u6,D)},writePackedFixed32:function(Y,D){D.length&&this.writeMessage(Y,f6,D)},writePackedSFixed32:function(Y,D){D.length&&this.writeMessage(Y,h6,D)},writePackedFixed64:function(Y,D){D.length&&this.writeMessage(Y,d6,D)},writePackedSFixed64:function(Y,D){D.length&&this.writeMessage(Y,nw,D)},writeBytesField:function(Y,D){this.writeTag(Y,Sc.Bytes),this.writeBytes(D)},writeFixed32Field:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(Y,D){this.writeTag(Y,Sc.Varint),this.writeVarint(D)},writeSVarintField:function(Y,D){this.writeTag(Y,Sc.Varint),this.writeSVarint(D)},writeStringField:function(Y,D){this.writeTag(Y,Sc.Bytes),this.writeString(D)},writeFloatField:function(Y,D){this.writeTag(Y,Sc.Fixed32),this.writeFloat(D)},writeDoubleField:function(Y,D){this.writeTag(Y,Sc.Fixed64),this.writeDouble(D)},writeBooleanField:function(Y,D){this.writeVarintField(Y,!!D)}};var X3=r(av);const iw=3;function v6(Y,D,Q){Y===1&&Q.readMessage(fS,D)}function fS(Y,D,Q){if(Y===3){const{id:me,bitmap:Re,width:Ve,height:We,left:gt,top:Rt,advance:Zt}=Q.readMessage(Y3,{});D.push({id:me,bitmap:new Qo({width:Ve+2*iw,height:We+2*iw},Re),metrics:{width:Ve,height:We,left:gt,top:Rt,advance:Zt}})}}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=iw;function ow(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 Zt=me.pop();gt=0&&me>=D&&lw[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(G_.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 sw(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn){const An=t1.fromFeature(Y,Re);let Nn;br===e.ah.vertical&&An.verticalizePunctuation();const{processBidirectionalText:pa,processStyledBidirectionalText:oi}=Dl;if(pa&&An.sections.length===1){Nn=[];const Fi=pa(An.toString(),jg(An,Zt,Ve,D,me,Qr));for(const co of Fi){const $o=new t1;$o.text=co,$o.sections=An.sections;for(let hl=0;hl0&&Cp>Pd&&(Pd=Cp)}else{const uf=$o[Bu.fontStack],Rd=uf&&uf[Uc];if(Rd&&Rd.rect)c1=Rd.rect,wf=Rd.metrics;else{const Cp=co[Bu.fontStack],Kv=Cp&&Cp[Uc];if(!Kv)continue;wf=Kv.metrics}Hf=(dd-Bu.scale)*vc}ov?(Fi.verticalizable=!0,gv.push({glyph:Uc,imageName:t0,x:Ll,y:lf+Hf,vertical:ov,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Mc,metrics:wf,rect:c1}),Ll+=r0*Bu.scale+Qi):(gv.push({glyph:Uc,imageName:t0,x:Ll,y:lf+Hf,vertical:ov,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Mc,metrics:wf,rect:c1}),Ll+=wf.advance*Bu.scale+Qi)}gv.length!==0&&(Jc=Math.max(Ll-Qi,Jc),g6(gv,0,gv.length-1,Av,Pd)),Ll=0;const $v=Yo*dd+Pd;Xd.lineOffset=Math.max(Pd,iv),lf+=$v,hd=Math.max($v,hd),++kh}var Qh;const vv=lf-e1,{horizontalAlign:pv,verticalAlign:mv}=$3(Ds);(function(Jf,dd,iv,Xd,gv,Pd,$v,bf,Bu){const Mc=(dd-iv)*gv;let Uc=0;Uc=Pd!==$v?-bf*Xd-e1:(-Xd*Bu+.5)*$v;for(const Hf of Jf)for(const wf of Hf.positionedGlyphs)wf.x+=Mc,wf.y+=Uc})(Fi.positionedLines,Av,pv,mv,Jc,hd,Yo,vv,is.length),Fi.top+=-mv*vv,Fi.bottom=Fi.top+vv,Fi.left+=-pv*Jc,Fi.right=Fi.left+Jc})(ei,D,Q,me,Nn,We,gt,Rt,br,Zt,Hr,dn),!(function(Fi){for(const co of Fi)if(co.positionedGlyphs.length!==0)return!1;return!0})(Ba)&&ei}const lw={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},p6={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},m6={40:!0};function uw(Y,D,Q,me,Re,Ve){if(D.imageName){const We=me[D.imageName];return We?We.displaySize[0]*D.scale*vc/Ve+Re:0}{const We=Q[D.fontStack],gt=We&&We[Y];return gt?gt.metrics.advance*D.scale+Re:0}}function dS(Y,D,Q,me){const Re=Math.pow(Y-D,2);return me?Y=0;let Zt=0;for(let br=0;brZt){const pr=Math.ceil(Ve/Zt);Re*=pr/We,We=pr}return{x1:me,y1:Re,x2:me+Ve,y2:Re+We}}function pS(Y,D,Q,me,Re,Ve){const We=Y.image;let gt;if(We.content){const Nn=We.content,pa=We.pixelRatio||1;gt=[Nn[0]/pa,Nn[1]/pa,We.displaySize[0]-Nn[2]/pa,We.displaySize[1]-Nn[3]/pa]}const Rt=D.left*Ve,Zt=D.right*Ve;let pr,br,Hr,Qr;Q==="width"||Q==="both"?(Qr=Re[0]+Rt-me[3],br=Re[0]+Zt+me[1]):(Qr=Re[0]+(Rt+Zt-We.displaySize[0])/2,br=Qr+We.displaySize[0]);const dn=D.top*Ve,An=D.bottom*Ve;return Q==="height"||Q==="both"?(pr=Re[1]+dn-me[0],Hr=Re[1]+An+me[2]):(pr=Re[1]+(dn+An-We.displaySize[1])/2,Hr=pr+We.displaySize[1]),{image:We,top:pr,right:br,bottom:Hr,left:Qr,collisionPadding:gt}}const X_=255,T0=128,Gm=X_*T0;function mS(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=oa([]),this.placementViewportMatrix=oa([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mS(this.zoom,Q["text-size"]),this.iconSizeData=mS(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 zl(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new oh(new zl(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Js,this.lineVertexArray=new Qs,this.symbolInstances=new Wo,this.textAnchorOffsets=new al}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=[],!Zt&&!pr)return;const Hr=Q.iconDependencies,Qr=Q.glyphDependencies,dn=Q.availableImages,An=new ml(this.zoom);for(const{feature:Nn,id:pa,index:oi,sourceLayerIndex:Ba}of D){const ei=Re._featureFilter.needGeometry,Fi=yr(Nn,ei);if(!Re._featureFilter.filter(An,Fi,me))continue;let co,$o;if(ei||(Fi.geometry=mt(Nn)),Zt){const is=Re.getValueAndResolveTokens("text-field",Fi,me,dn),Yo=mn.factory(is),Ds=this.hasRTLText=this.hasRTLText||x6(Yo);(!Ds||Dl.getRTLTextPluginStatus()==="unavailable"||Ds&&Dl.isParsed())&&(co=jm(Yo,Re,Fi))}if(pr){const is=Re.getValueAndResolveTokens("icon-image",Fi,me,dn);$o=is instanceof da?is:da.fromString(is)}if(!co&&!$o)continue;const hl=this.sortFeaturesByKey?br.evaluate(Fi,{},me):void 0;if(this.features.push({id:pa,text:co,icon:$o,index:oi,sourceLayerIndex:Ba,geometry:Fi.geometry,properties:Nn.properties,type:_6[Nn.type],sortKey:hl}),$o&&(Hr[$o.name]=!0),co){const is=We.evaluate(Fi,{},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 Ds of co.sections)if(Ds.image)Hr[Ds.image.name]=!0;else{const Ss=ns(co.toString()),bs=Ds.fontStack||is,Qi=Qr[bs]=Qr[bs]||{};this.calculateGlyphDependencies(Ds.text,Qi,Yo,this.allowVerticalPlacement,Ss)}}}Ve.get("symbol-placement")==="line"&&(this.features=(function(Nn){const pa={},oi={},Ba=[];let ei=0;function Fi(is){Ba.push(Nn[is]),ei++}function co(is,Yo,Ds){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(Ds[0]),Ss}function $o(is,Yo,Ds){const Ss=pa[Yo];return delete pa[Yo],pa[is]=Ss,Ba[Ss].geometry[0].shift(),Ba[Ss].geometry[0]=Ds[0].concat(Ba[Ss].geometry[0]),Ss}function hl(is,Yo,Ds){const Ss=Ds?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,pa)=>Nn.sortKey-pa.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 Y_,Z_;Na("SymbolBucket",qg,{omit:["layers","collisionBoxArray","features","compareText"]}),qg.MAX_GLYPHS=65535,qg.addDynamicAttributes=Xm;var Q3={get paint(){return Z_=Z_||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 Y_=Y_||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 hw 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,(Zt,pr)=>gt&&pr in gt?String(gt[pr]):"")})(Q.properties,Ve)}createBucket(D){return new qg(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of Q3.paint.overridableProperties){if(!hw.hasPaintOverride(this.layout,D))continue;const Q=this.paint.get(D),me=new n1(Q),Re=new zc(me,Q.property.specification);let Ve=null;Ve=Q.value.kind==="constant"||Q.value.kind==="source"?new kf("source",Re):new mc("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())&&hw.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 mn)We(me.value.value.sections);else if(me.value.kind==="source"){const gt=Zt=>{Ve||(Zt instanceof Mi&&Hn(Zt.value)===$r?We(Zt.value.sections):Zt instanceof ll?We(Zt.sections):Zt.eachChild(gt))},Rt=me.value;Rt._styleExpression&>(Rt._styleExpression.expression)}return Ve}}let eT;var gS={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 W_ extends oe{constructor(D){super(D,gS)}}let dw;var tT={get paint(){return dw=dw||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 b6 extends oe{constructor(D){super(D,tT)}}class yS 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 $_{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 A0{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 A0(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 A0)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new A0(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new A0(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 _S=2*Math.PI*rT;function vw(Y){return _S*Math.cos(Y*Math.PI/180)}function pw(Y){return(180+Y)/360}function xS(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function kp(Y,D){return Y/vw(D)}function nT(Y){return 360/Math.PI*Math.atan(Math.exp((180-360*Y)*Math.PI/180))-90}class K_{constructor(D,Q,me=0){this.x=+D,this.y=+Q,this.z=+me}static fromLngLat(D,Q=0){const me=A0.convert(D);return new K_(pw(me.lng),xS(me.lat),kp(Q,me.lat))}toLngLat(){return new A0(360*this.x-180,nT(this.y))}toAltitude(){return this.z*vw(nT(this.y))}meterInMercatorCoordinateUnits(){return 1/_S*(D=nT(this.y),1/Math.cos(D*Math.PI/180));var D}}function bS(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=bS(256*(Ve=this.x),256*(We=Math.pow(2,gt)-We-1),gt),Zt=bS(256*(Ve+1),256*(We+1),gt),Rt[0]+","+Rt[1]+","+Zt[0]+","+Zt[1]);var Ve,We,gt,Rt,Zt;const pr=(function(br,Hr,Qr){let dn,An="";for(let Nn=br;Nn>0;Nn--)dn=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 wS{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 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 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,Zt=-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 AS{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 SS{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 iu,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 Zt=0;Zt=0&&br[3]>=0&&Rt.insert(gt,br[0],br[1],br[2],br[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ca.VectorTile(new X3(this.rawTileData)).layers,this.sourceLayerCoder=new TS(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,Zt=D.queryPadding*We,pr=iT(Rt),br=this.grid.query(pr.minX-Zt,pr.minY-Zt,pr.maxX+Zt,pr.maxY+Zt),Hr=iT(D.cameraQueryGeometry),Qr=this.grid3D.query(Hr.minX-Zt,Hr.minY-Zt,Hr.maxX+Zt,Hr.maxY+Zt,(Nn,pa,oi,Ba)=>(function(ei,Fi,co,$o,hl){for(const Yo of ei)if(Fi<=Yo.x&&co<=Yo.y&&$o>=Yo.x&&hl>=Yo.y)return!0;const is=[new i(Fi,co),new i(Fi,hl),new i($o,hl),new i($o,co)];if(ei.length>2){for(const Yo of is)if(Ga(ei,Yo))return!0}for(let Yo=0;Yo(Ba||(Ba=mt(ei)),Fi.queryIntersectsFeature(Rt,ei,co,Ba,this.z,D.transform,We,D.pixelPosMatrix)))}return dn}loadMatchingFeature(D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br){const Hr=this.bucketLayerIDs[Q];if(We&&!(function(Nn,pa){for(let oi=0;oi=0)return!0;return!1})(We,Hr))return;const Qr=this.sourceLayerCoder.decode(me),dn=this.vtLayers[Qr].feature(Re);if(Ve.needGeometry){const Nn=yr(dn,!0);if(!Ve.filter(new ml(this.tileID.overscaledZ),Nn,this.tileID.canonical))return}else if(!Ve.filter(new ml(this.tileID.overscaledZ),dn))return;const An=this.getId(dn,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 ES(Y,D){return D-Y}function kS(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",SS,{omit:["rawTileData","sourceLayerCoder"]});class Ym extends i{constructor(D,Q,me,Re){super(D,Q),this.angle=me,Re!==void 0&&(this.segment=Re)}clone(){return new Ym(this.x,this.y,this.angle,this.segment)}}function CS(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 Zt=0;for(;gtme;)Zt-=Rt.shift().angleDelta;if(Zt>Re)return!1;We++,gt+=pr.dist(br)}return!0}function LS(Y){let D=0;for(let Q=0;QZt){const dn=(Zt-Rt)/Qr,An=Mo.number(br.x,Hr.x,dn),Nn=Mo.number(br.y,Hr.y,dn),pa=new Ym(An,Nn,Hr.angleTo(br),pr);return pa._round(),!We||CS(Y,pa,gt,We,D)?pa:void 0}Rt+=Qr}}function T6(Y,D,Q,me,Re,Ve,We,gt,Rt){const Zt=PS(me,Ve,We),pr=RS(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&&Fi=0&&Hr+Zt<=pr){const co=new Ym(ei,Fi,oi,dn);co._round(),me&&!CS(Y,co,Ve,me,Re)||Qr.push(co)}}br+=pa}return gt||Qr.length||We||(Qr=Hg(Y,br/2,Q,me,Re,Ve,We,!0,Rt)),Qr}Na("Anchor",Ym);const i1=Jh;function IS(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 Zt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const pr=Ve.stretchX||[[0,gt]],br=Ve.stretchY||[[0,Rt]],Hr=(Qi,Gs)=>Qi+Gs[1]-Gs[0],Qr=pr.reduce(Hr,0),dn=br.reduce(Hr,0),An=gt-Qr,Nn=Rt-dn;let pa=0,oi=Qr,Ba=0,ei=dn,Fi=0,co=An,$o=0,hl=Nn;if(Ve.content&&me){const Qi=Ve.content,Gs=Qi[2]-Qi[0],zs=Qi[3]-Qi[1];(Ve.textFitWidth||Ve.textFitHeight)&&(Zt=vS(Y)),pa=o1(pr,0,Qi[0]),Ba=o1(br,0,Qi[1]),oi=o1(pr,Qi[0],Qi[2]),ei=o1(br,Qi[1],Qi[3]),Fi=Qi[0]-pa,$o=Qi[1]-Ba,co=Gs-oi,hl=zs-ei}const is=Zt.x1,Yo=Zt.y1,Ds=Zt.x2-is,Ss=Zt.y2-Yo,bs=(Qi,Gs,zs,Ll)=>{const lf=Wv(Qi.stretch-pa,oi,Ds,is),Jc=mw(Qi.fixed-Fi,co,Qi.stretch,Qr),hd=Wv(Gs.stretch-Ba,ei,Ss,Yo),Av=mw(Gs.fixed-$o,hl,Gs.stretch,dn),kh=Wv(zs.stretch-pa,oi,Ds,is),Qh=mw(zs.fixed-Fi,co,zs.stretch,Qr),vv=Wv(Ll.stretch-Ba,ei,Ss,Yo),pv=mw(Ll.fixed-$o,hl,Ll.stretch,dn),mv=new i(lf,hd),Jf=new i(kh,hd),dd=new i(kh,vv),iv=new i(lf,vv),Xd=new i(Jc/We,Av/We),gv=new i(Qh/We,pv/We),Pd=D*Math.PI/180;if(Pd){const Bu=Math.sin(Pd),Mc=Math.cos(Pd),Uc=[Mc,-Bu,Bu,Mc];mv._matMult(Uc),Jf._matMult(Uc),iv._matMult(Uc),dd._matMult(Uc)}const $v=Qi.stretch+Qi.fixed,bf=Gs.stretch+Gs.fixed;return{tl:mv,tr:Jf,bl:iv,br:dd,tex:{x:Ve.paddedRect.x+i1+$v,y:Ve.paddedRect.y+i1+bf,w:zs.stretch+zs.fixed-$v,h:Ll.stretch+Ll.fixed-bf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xd,pixelOffsetBR:gv,minFontScaleX:co/We/Ds,minFontScaleY:hl/We/Ss,isSDF:Q}};if(me&&(Ve.stretchX||Ve.stretchY)){const Qi=s1(pr,An,Qr),Gs=s1(br,Nn,dn);for(let zs=0;zs0&&(An=Math.max(10,An),this.circleDiameter=An)}else{const Hr=!((br=We.image)===null||br===void 0)&&br.content&&(We.image.textFitWidth||We.image.textFitHeight)?vS(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 dn=new i(Hr.x1,Hr.y1),An=new i(Hr.x2,Hr.y1),Nn=new i(Hr.x1,Hr.y2),pa=new i(Hr.x2,Hr.y2),oi=pr*Math.PI/180;dn._rotate(oi),An._rotate(oi),Nn._rotate(oi),pa._rotate(oi),Hr.x1=Math.min(dn.x,An.x,Nn.x,pa.x),Hr.x2=Math.max(dn.x,An.x,Nn.x,pa.x),Hr.y1=Math.min(dn.y,An.y,Nn.y,pa.y),Hr.y2=Math.max(dn.y,An.y,Nn.y,pa.y)}D.emplaceBack(Q.x,Q.y,Hr.x1,Hr.y1,Hr.x2,Hr.y2,me,Re,Ve)}this.boxEndIndex=D.length}}class A6{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 S6(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=dn.x),(!Qr||dn.y>We)&&(We=dn.y)}const Rt=Math.min(Ve-me,We-Re);let Zt=Rt/2;const pr=new A6([],M6);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||(Zt=Qr.h/2,pr.push(new S0(Qr.p.x-Zt,Qr.p.y-Zt,Zt,Y)),pr.push(new S0(Qr.p.x+Zt,Qr.p.y-Zt,Zt,Y)),pr.push(new S0(Qr.p.x-Zt,Qr.p.y+Zt,Zt,Y)),pr.push(new S0(Qr.p.x+Zt,Qr.p.y+Zt,Zt,Y)),Hr+=4)}return Q&&(console.log(`num probes: ${Hr}`),console.log(`best distance: ${br.d}`)),br.p}function M6(Y,D){return D.max-Y.max}function S0(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!=dn.y>Re.y&&Re.x<(dn.x-Qr.x)*(Re.y-Qr.y)/(dn.y-Qr.y)+Qr.x&&(We=!We),gt=Math.min(gt,Bi(Re,Qr,dn))}}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 Zm=7,oT=Number.POSITIVE_INFINITY;function DS(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-Zm;break;case"bottom-right":case"bottom-left":case"bottom":We=-Re+Zm}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-Zm;break;case"bottom-right":case"bottom-left":Ve=-We+Zm;break;case"bottom":Ve=-me+Zm;break;case"top":Ve=me-Zm}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 zS(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 Zt=0;ZtHr*vc);pr.startsWith("top")?br[1]-=Zm:pr.startsWith("bottom")&&(br[1]+=Zm),Rt[Zt+1]=br}return new ma(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)*vc,oT]:Re.get("text-offset").evaluate(D,{},Q).map(Zt=>Zt*vc);const Rt=[];for(const Zt of We)Rt.push(Zt,DS(Zt,gt));return new ma(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 E6(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,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),dn=FS(Q.horizontal),An=We/24,Nn=Y.tilePixelRatio*An,pa=Y.tilePixelRatio*br/24,oi=Y.tilePixelRatio*gt,Ba=Y.tilePixelRatio*Hr.get("symbol-spacing"),ei=Hr.get("text-padding")*Y.tilePixelRatio,Fi=(function(Qi,Gs,zs,Ll=1){const lf=Qi.get("icon-padding").evaluate(Gs,{},zs),Jc=lf&&lf.values;return[Jc[0]*Ll,Jc[1]*Ll,Jc[2]*Ll,Jc[3]*Ll]})(Hr,D,pr,Y.tilePixelRatio),co=Hr.get("text-max-angle")/180*Math.PI,$o=Hr.get("text-rotation-alignment")!=="viewport"&&Hr.get("symbol-placement")!=="point",hl=Hr.get("icon-rotation-alignment")==="map"&&Hr.get("symbol-placement")!=="point",is=Hr.get("symbol-placement"),Yo=Ba/2,Ds=Hr.get("icon-text-fit");let Ss;me&&Ds!=="none"&&(Y.allowVerticalPlacement&&Q.vertical&&(Ss=pS(me,Q.vertical,Ds,Hr.get("icon-text-fit-padding"),Qr,An)),dn&&(me=pS(me,dn,Ds,Hr.get("icon-text-fit-padding"),Qr,An)));const bs=(Qi,Gs)=>{Gs.x<0||Gs.x>=Kl||Gs.y<0||Gs.y>=Kl||(function(zs,Ll,lf,Jc,hd,Av,kh,Qh,vv,pv,mv,Jf,dd,iv,Xd,gv,Pd,$v,bf,Bu,Mc,Uc,Hf,wf,c1){const t0=zs.addToLineVertexArray(Ll,lf);let r0,ov,uf,Rd,Cp=0,Kv=0,yv=0,dT=0,vT=-1,bw=-1;const rm={};let pT=sa("");if(zs.allowVerticalPlacement&&Jc.vertical){const Yd=Qh.layout.get("text-rotate").evaluate(Mc,{},wf)+90;uf=new gw(vv,Ll,pv,mv,Jf,Jc.vertical,dd,iv,Xd,Yd),kh&&(Rd=new gw(vv,Ll,pv,mv,Jf,kh,Pd,$v,Xd,Yd))}if(hd){const Yd=Qh.layout.get("icon-rotate").evaluate(Mc,{}),Jv=Qh.layout.get("icon-text-fit")!=="none",Wm=IS(hd,Yd,Hf,Jv),n0=kh?IS(kh,Yd,Hf,Jv):void 0;ov=new gw(vv,Ll,pv,mv,Jf,hd,Pd,$v,!1,Yd),Cp=4*Wm.length;const Gg=zs.iconSizeData;let a0=null;Gg.kind==="source"?(a0=[T0*Qh.layout.get("icon-size").evaluate(Mc,{})],a0[0]>Gm&&y(`${zs.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)):Gg.kind==="composite"&&(a0=[T0*Uc.compositeIconSizes[0].evaluate(Mc,{},wf),T0*Uc.compositeIconSizes[1].evaluate(Mc,{},wf)],(a0[0]>Gm||a0[1]>Gm)&&y(`${zs.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)),zs.addSymbols(zs.icon,Wm,a0,Bu,bf,Mc,e.ah.none,Ll,t0.lineStartIndex,t0.lineLength,-1,wf),vT=zs.icon.placedSymbolArray.length-1,n0&&(Kv=4*n0.length,zs.addSymbols(zs.icon,n0,a0,Bu,bf,Mc,e.ah.vertical,Ll,t0.lineStartIndex,t0.lineLength,-1,wf),bw=zs.icon.placedSymbolArray.length-1)}const mT=Object.keys(Jc.horizontal);for(const Yd of mT){const Jv=Jc.horizontal[Yd];if(!r0){pT=sa(Jv.text);const n0=Qh.layout.get("text-rotate").evaluate(Mc,{},wf);r0=new gw(vv,Ll,pv,mv,Jf,Jv,dd,iv,Xd,n0)}const Wm=Jv.positionedLines.length===1;if(yv+=OS(zs,Ll,Jv,Av,Qh,Xd,Mc,gv,t0,Jc.vertical?e.ah.horizontal:e.ah.horizontalOnly,Wm?mT:[Yd],rm,vT,Uc,wf),Wm)break}Jc.vertical&&(dT+=OS(zs,Ll,Jc.vertical,Av,Qh,Xd,Mc,gv,t0,e.ah.vertical,["vertical"],rm,bw,Uc,wf));const gT=r0?r0.boxStartIndex:zs.collisionBoxArray.length,yT=r0?r0.boxEndIndex:zs.collisionBoxArray.length,k6=uf?uf.boxStartIndex:zs.collisionBoxArray.length,C6=uf?uf.boxEndIndex:zs.collisionBoxArray.length,L6=ov?ov.boxStartIndex:zs.collisionBoxArray.length,P6=ov?ov.boxEndIndex:zs.collisionBoxArray.length,qS=Rd?Rd.boxStartIndex:zs.collisionBoxArray.length,f1=Rd?Rd.boxEndIndex:zs.collisionBoxArray.length;let ed=-1;const h1=(Yd,Jv)=>Yd&&Yd.circleDiameter?Math.max(Yd.circleDiameter,Jv):Jv;ed=h1(r0,ed),ed=h1(uf,ed),ed=h1(ov,ed),ed=h1(Rd,ed);const _T=ed>-1?1:0;_T&&(ed*=c1/vc),zs.glyphOffsetArray.length>=qg.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Mc.sortKey!==void 0&&zs.addToSortKeyRanges(zs.symbolInstances.length,Mc.sortKey);const VS=zS(Qh,Mc,wf),[R6,HS]=(function(Yd,Jv){const Wm=Yd.length,n0=Jv?.values;if(n0?.length>0)for(let Gg=0;Gg=0?rm.right:-1,rm.center>=0?rm.center:-1,rm.left>=0?rm.left:-1,rm.vertical||-1,vT,bw,pT,gT,yT,k6,C6,L6,P6,qS,f1,pv,yv,dT,Cp,Kv,_T,0,dd,ed,R6,HS)})(Y,Gs,Qi,Q,me,Re,Ss,Y.layers[0],Y.collisionBoxArray,D.index,D.sourceLayerIndex,Y.index,Nn,[ei,ei,ei,ei],$o,Rt,oi,Fi,hl,Qr,D,Ve,Zt,pr,We)};if(is==="line")for(const Qi of kS(D.geometry,0,0,Kl,Kl)){const Gs=T6(Qi,Ba,co,Q.vertical||dn,me,24,pa,Y.overscaling,Kl);for(const zs of Gs)dn&&BS(Y,dn.text,Yo,zs)||bs(Qi,zs)}else if(is==="line-center"){for(const Qi of D.geometry)if(Qi.length>1){const Gs=w6(Qi,co,Q.vertical||dn,me,24,pa);Gs&&bs(Qi,Gs)}}else if(D.type==="Polygon")for(const Qi of Xc(D.geometry,0)){const Gs=S6(Qi,16);bs(Qi[0],new Ym(Gs.x,Gs.y,0))}else if(D.type==="LineString")for(const Qi of D.geometry)bs(Qi,new Ym(Qi[0].x,Qi[0].y,0));else if(D.type==="Point")for(const Qi of D.geometry)for(const Gs of Qi)bs([Gs],new Ym(Gs.x,Gs.y,0))}function OS(Y,D,Q,me,Re,Ve,We,gt,Rt,Zt,pr,br,Hr,Qr,dn){const An=(function(oi,Ba,ei,Fi,co,$o,hl,is){const Yo=Fi.layout.get("text-rotate").evaluate($o,{})*Math.PI/180,Ds=[];for(const Ss of Ba.positionedLines)for(const bs of Ss.positionedGlyphs){if(!bs.rect)continue;const Qi=bs.rect||{};let Gs=Z3+1,zs=!0,Ll=1,lf=0;const Jc=(co||is)&&bs.vertical,hd=bs.metrics.advance*bs.scale/2;if(is&&Ba.verticalizable&&(lf=Ss.lineOffset/2-(bs.imageName?-(vc-bs.metrics.width*bs.scale)/2:(bs.scale-1)*vc)),bs.imageName){const Bu=hl[bs.imageName];zs=Bu.sdf,Ll=Bu.pixelRatio,Gs=Jh/Ll}const Av=co?[bs.x+hd,bs.y]:[0,0];let kh=co?[0,0]:[bs.x+hd+ei[0],bs.y+ei[1]-lf],Qh=[0,0];Jc&&(Qh=kh,kh=[0,0]);const vv=bs.metrics.isDoubleResolution?2:1,pv=(bs.metrics.left-Gs)*bs.scale-hd+kh[0],mv=(-bs.metrics.top-Gs)*bs.scale+kh[1],Jf=pv+Qi.w/vv*bs.scale/Ll,dd=mv+Qi.h/vv*bs.scale/Ll,iv=new i(pv,mv),Xd=new i(Jf,mv),gv=new i(pv,dd),Pd=new i(Jf,dd);if(Jc){const Bu=new i(-hd,hd-e1),Mc=-Math.PI/2,Uc=vc/2-hd,Hf=new i(5-e1-Uc,-(bs.imageName?Uc:0)),wf=new i(...Qh);iv._rotateAround(Mc,Bu)._add(Hf)._add(wf),Xd._rotateAround(Mc,Bu)._add(Hf)._add(wf),gv._rotateAround(Mc,Bu)._add(Hf)._add(wf),Pd._rotateAround(Mc,Bu)._add(Hf)._add(wf)}if(Yo){const Bu=Math.sin(Yo),Mc=Math.cos(Yo),Uc=[Mc,-Bu,Bu,Mc];iv._matMult(Uc),Xd._matMult(Uc),gv._matMult(Uc),Pd._matMult(Uc)}const $v=new i(0,0),bf=new i(0,0);Ds.push({tl:iv,tr:Xd,bl:gv,br:Pd,tex:Qi,writingMode:Ba.writingMode,glyphOffset:Av,sectionIndex:bs.sectionIndex,isSDF:zs,pixelOffsetTL:$v,pixelOffsetBR:bf,minFontScaleX:0,minFontScaleY:0})}return Ds})(0,Q,gt,Re,Ve,We,me,Y.allowVerticalPlacement),Nn=Y.textSizeData;let pa=null;Nn.kind==="source"?(pa=[T0*Re.layout.get("text-size").evaluate(We,{})],pa[0]>Gm&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)):Nn.kind==="composite"&&(pa=[T0*Qr.compositeTextSizes[0].evaluate(We,{},dn),T0*Qr.compositeTextSizes[1].evaluate(We,{},dn)],(pa[0]>Gm||pa[1]>Gm)&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)),Y.addSymbols(Y.text,An,pa,gt,Ve,We,Zt,D,Rt.lineStartIndex,Rt.lineLength,Hr,dn);for(const oi of pr)br[oi]=Y.text.placedSymbolArray.length-1;return 4*An.length}function FS(Y){for(const D in Y)return Y[D];return null}function BS(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=NS[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=NS.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],Zt=[];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 pa=We[2*Nn],oi=We[2*Nn+1];pa>=D&&pa<=me&&oi>=Q&&oi<=Re&&Zt.push(Ve[Nn])}continue}const Qr=Hr+br>>1,dn=We[2*Qr],An=We[2*Qr+1];dn>=D&&dn<=me&&An>=Q&&An<=Re&&Zt.push(Ve[Qr]),(pr===0?D<=dn:Q<=An)&&(Rt.push(Hr),Rt.push(Qr-1),Rt.push(1-pr)),(pr===0?me>=dn:Re>=An)&&(Rt.push(Qr+1),Rt.push(br),Rt.push(1-pr))}return Zt}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=[],Zt=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)<=Zt&&Rt.push(Re[Nn]);continue}const Qr=Hr+br>>1,dn=Ve[2*Qr],An=Ve[2*Qr+1];Gd(dn,An,D,Q)<=Zt&&Rt.push(Re[Qr]),(pr===0?D-me<=dn:Q-me<=An)&&(gt.push(Hr),gt.push(Qr-1),gt.push(1-pr)),(pr===0?D+me>=dn:Q+me>=An)&&(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;US(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 US(Y,D,Q,me,Re,Ve){for(;Re>me;){if(Re-me>600){const Zt=Re-me+1,pr=Q-me+1,br=Math.log(Zt),Hr=.5*Math.exp(2*br/3),Qr=.5*Math.sqrt(br*Hr*(Zt-Hr)/Zt)*(pr-Zt/2<0?-1:1);US(Y,D,Q,Math.max(me,Math.floor(Q-pr*Hr/Zt+Qr)),Math.min(Re,Math.floor(Q+(Zt-pr)*Hr/Zt+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){yw(Y,Q,me),yw(D,2*Q,2*me),yw(D,2*Q+1,2*me+1)}function yw(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 _w=null,u1=[];const fT=1e3/60,xw="loadTime",hT="fullLoadTime",jS={mark(Y){performance.mark(Y)},frame(Y){const D=Y;_w!=null&&u1.push(D-_w),_w=D},clearMetrics(){_w=null,u1=[],performance.clearMeasures(xw),performance.clearMeasures(hT);for(const Y in e.bg)performance.clearMarks(e.bg[Y])},getPerformanceMetrics(){performance.measure(xw,e.bg.create,e.bg.load),performance.measure(hT,e.bg.create,e.bg.fullLoad);const Y=performance.getEntriesByName(xw)[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 $_(()=>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,Zt,pr,br,Hr,Qr,dn,An=Q[0],Nn=Q[1],pa=Q[2];return D===Y?(Y[12]=D[0]*An+D[4]*Nn+D[8]*pa+D[12],Y[13]=D[1]*An+D[5]*Nn+D[9]*pa+D[13],Y[14]=D[2]*An+D[6]*Nn+D[10]*pa+D[14],Y[15]=D[3]*An+D[7]*Nn+D[11]*pa+D[15]):(Re=D[1],Ve=D[2],We=D[3],gt=D[4],Rt=D[5],Zt=D[6],pr=D[7],br=D[8],Hr=D[9],Qr=D[10],dn=D[11],Y[0]=me=D[0],Y[1]=Re,Y[2]=Ve,Y[3]=We,Y[4]=gt,Y[5]=Rt,Y[6]=Zt,Y[7]=pr,Y[8]=br,Y[9]=Hr,Y[10]=Qr,Y[11]=dn,Y[12]=me*An+gt*Nn+br*pa+D[12],Y[13]=Re*An+Rt*Nn+Hr*pa+D[13],Y[14]=Ve*An+Zt*Nn+Qr*pa+D[14],Y[15]=We*An+pr*Nn+dn*pa+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=qg,e.a7=Ah,e.a8=yr,e.a9=AS,e.aA=function(Y){if(Y.type==="custom")return new yS(Y);switch(Y.type){case"background":return new W_(Y);case"circle":return new Oa(Y);case"fill":return new fn(Y);case"fill-extrusion":return new Gv(Y);case"heatmap":return new tl(Y);case"hillshade":return new Ju(Y);case"line":return new Bg(Y);case"raster":return new b6(Y);case"symbol":return new hw(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,Zt){let pr;for(pr in gt=gt||{},We=We||{})Object.prototype.hasOwnProperty.call(We,pr)&&(Object.prototype.hasOwnProperty.call(gt,pr)||Ye(pr,Rt,Zt));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,Zt)):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 Zt=(We=We||[]).map(et),pr=gt.map(et),br=We.reduce(Pe,{}),Hr=gt.reduce(Pe,{}),Qr=Zt.slice(),dn=Object.create(null);let An,Nn,pa,oi,Ba;for(let ei=0,Fi=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],Zt=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+Zt*me,Y[1]=We*Re+pr*me,Y[2]=gt*Re+br*me,Y[3]=Rt*Re+Hr*me,Y[4]=Zt*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(fi.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/T0:Y.kind==="composite"?Mo.number(me/T0,Re/T0,Q):D},e.aj=Xm,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 Zt=(gt*(Y.y-Q.y)-We*(Y.x-Q.x))/Rt;return new i(Y.x+Zt*Ve,Y.y+Zt*Re)},e.al=kS,e.am=fa,e.an=oa,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=vc,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],Zt=D[7],pr=D[8],br=D[9],Hr=D[10],Qr=D[11],dn=D[12],An=D[13],Nn=D[14],pa=D[15],oi=Q*gt-me*We,Ba=Q*Rt-Re*We,ei=Q*Zt-Ve*We,Fi=me*Rt-Re*gt,co=me*Zt-Ve*gt,$o=Re*Zt-Ve*Rt,hl=pr*An-br*dn,is=pr*Nn-Hr*dn,Yo=pr*pa-Qr*dn,Ds=br*Nn-Hr*An,Ss=br*pa-Qr*An,bs=Hr*pa-Qr*Nn,Qi=oi*bs-Ba*Ss+ei*Ds+Fi*Yo-co*is+$o*hl;return Qi?(Y[0]=(gt*bs-Rt*Ss+Zt*Ds)*(Qi=1/Qi),Y[1]=(Re*Ss-me*bs-Ve*Ds)*Qi,Y[2]=(An*$o-Nn*co+pa*Fi)*Qi,Y[3]=(Hr*co-br*$o-Qr*Fi)*Qi,Y[4]=(Rt*Yo-We*bs-Zt*is)*Qi,Y[5]=(Q*bs-Re*Yo+Ve*is)*Qi,Y[6]=(Nn*ei-dn*$o-pa*Ba)*Qi,Y[7]=(pr*$o-Hr*ei+Qr*Ba)*Qi,Y[8]=(We*Ss-gt*Yo+Zt*hl)*Qi,Y[9]=(me*Yo-Q*Ss-Ve*hl)*Qi,Y[10]=(dn*co-An*ei+pa*oi)*Qi,Y[11]=(br*ei-pr*co-Qr*oi)*Qi,Y[12]=(gt*is-We*Ds-Rt*hl)*Qi,Y[13]=(Q*Ds-me*is+Re*hl)*Qi,Y[14]=(An*Ba-dn*Fi-Nn*oi)*Qi,Y[15]=(pr*Fi-br*Ba+Hr*oi)*Qi,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=Zi,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 hr{},e.be=rT,e.bf=jS,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*vc)}let is=We?"center":Q.get("text-justify").evaluate(Zt,{},Y.canonical);const Yo=Q.get("symbol-placement")==="point"?Q.get("text-max-width").evaluate(Zt,{},Y.canonical)*vc:1/0,Ds=()=>{Y.bucket.allowVerticalPlacement&&ns(ei)&&(dn.vertical=sw(An,Y.glyphMap,Y.glyphPositions,Y.imagePositions,pr,Yo,Ve,$o,"left",co,pa,e.ah.vertical,!0,Hr,br))};if(!We&&hl){const Ss=new Set;if(is==="auto")for(let Qi=0;Qit(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(v6,[])},e.o=Qo,e.p=ow,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 aa in Lt){const Un=je.layers[aa];if(!Un)continue;Un.version===1&&e.w(`Vector tile source "${this.source}" layer "${aa}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ka=ye.encode(aa),Va=[];for(let sr=0;sr=qt.maxzoom||qt.visibility!=="none"&&(n(sr,this.zoom,ke),(Xe[qt.id]=qt.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,aa=>Object.keys(aa).map(Number));this.inFlightDependencies.forEach(aa=>aa?.abort()),this.inFlightDependencies=[];let Ot=Promise.resolve({});if(Object.keys(Ct).length){const aa=new AbortController;this.inFlightDependencies.push(aa),Ot=xe.sendAsync({type:"GG",data:{stacks:Ct,source:this.source,tileID:this.tileID,type:"glyphs"}},aa)}const Kt=Object.keys(Qe.iconDependencies);let xr=Promise.resolve({});if(Kt.length){const aa=new AbortController;this.inFlightDependencies.push(aa),xr=xe.sendAsync({type:"GI",data:{icons:Kt,source:this.source,tileID:this.tileID,type:"icons"}},aa)}const mr=Object.keys(Qe.patternDependencies);let vr=Promise.resolve({});if(mr.length){const aa=new AbortController;this.inFlightDependencies.push(aa),vr=xe.sendAsync({type:"GI",data:{icons:mr,source:this.source,tileID:this.tileID,type:"patterns"}},aa)}const[Br,kn,Wn]=yield Promise.all([Ot,xr,vr]),Vn=new r(Br),na=new e.bo(kn,Wn);for(const aa in Xe){const Un=Xe[aa];Un instanceof e.a6?(n(Un.layers,this.zoom,ke),e.bp({bucket:Un,glyphMap:Br,glyphPositions:Vn.positions,imageMap:kn,imagePositions:na.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,na.patternPositions))}return this.status="done",{buckets:Object.values(Xe).filter(aa=>!aa.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Vn.image,imageAtlas:na,glyphMap:this.returnDependencies?Br: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[Br,kn]=vr.geometry.coordinates;Ot=ce(Br),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&&(Br+=Qe[Wn+j])}if(Br>vr&&Br>=Ee){let kn,Wn=Kt*vr,Vn=xr*vr,na=-1;const aa=((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];Wn+=Qe[ka]*Va,Vn+=Qe[ka+1]*Va,Qe[ka+4]=aa,ye&&(kn||(kn=this._map(Qe,Ot,!0),na=this.clusterProps.length,this.clusterProps.push(kn)),ye(kn,this._map(Qe,ka)))}Qe[Ot+4]=aa,Lt.push(Wn/Br,Vn/Br,1/0,aa,-1,Br),ye&&Lt.push(na)}else{for(let kn=0;kn1)for(const kn of mr){const Wn=kn*Ct;if(!(Qe[Wn+2]<=Je)){Qe[Wn+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 Br=[];ct(vr,Br,Je,ke,xe,!0),Br.length&&mr.push(Br)}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 Br=0;BrJe&&(Ct=Qe(Xe,kn,Wn,na,aa,Je),Ee&&(Xe.start=Ot+Lt*Ct)):Un>ke?ka=Je&&(Ct=Qe(Xe,kn,Wn,na,aa,Je),Va=!0),ka>ke&&Un<=ke&&(Ct=Qe(Xe,kn,Wn,na,aa,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,Br=.5+mr,kn=1+mr;let Wn=null,Vn=null,na=null,aa=null,Un=Fe(je,Ot,ke-mr,ke+Br,0,xr.minX,xr.maxX,Lt),ka=Fe(je,Ot,ke+vr,ke+kn,0,xr.minX,xr.maxX,Lt);je=null,Un&&(Wn=Fe(Un,Ot,xe-mr,xe+Br,1,xr.minY,xr.maxY,Lt),Vn=Fe(Un,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),Un=null),ka&&(na=Fe(ka,Ot,xe-mr,xe+Br,1,xr.minY,xr.maxY,Lt),aa=Fe(ka,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),ka=null),Ct>1&&console.timeEnd("clipping"),Qe.push(Wn||[],Je+1,2*ke,2*xe),Qe.push(Vn||[],Je+1,2*ke,2*xe+1),Qe.push(na||[],Je+1,2*ke+1,2*xe),Qe.push(aa||[],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=Mr(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=Mr(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=Er(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 Nr{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 Nr(self)),Nr}),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=Gt=>{const hr=Me++;return Ce[hr]=Gt,hr},Ue.removeThrottleControl=Gt=>{delete Ce[Gt],_t()},Ue.getImage=(Gt,hr,Ar=!0)=>new Promise((Lr,en)=>{s.supported&&(Gt.headers||(Gt.headers={}),Gt.headers.accept="image/webp,*/*"),t.e(Gt,{type:"image"}),P.push({abortController:hr,requestParameters:Gt,supportImageRefresh:Ar,state:"queued",onError:xn=>{en(xn)},onSuccess:xn=>{Lr(xn)}}),_t()});const Be=Gt=>t._(this,void 0,void 0,function*(){Gt.state="running";const{requestParameters:hr,supportImageRefresh:Ar,onError:Lr,onSuccess:en,abortController:xn}=Gt,Ze=Ar===!1&&!t.i(self)&&!t.g(hr.url)&&(!hr.headers||Object.keys(hr.headers).reduce((bt,zt)=>bt&&zt==="accept",!0));oe++;const tt=Ze?kt(hr,xn):t.m(hr,xn);try{const bt=yield tt;delete Gt.abortController,Gt.state="completed",bt.data instanceof HTMLImageElement||t.b(bt.data)?en(bt):bt.data&&en({data:yield(vt=bt.data,typeof createImageBitmap=="function"?t.d(vt):t.f(vt)),cacheControl:bt.cacheControl,expires:bt.expires})}catch(bt){delete Gt.abortController,Lr(bt)}finally{oe--,_t()}var vt}),_t=()=>{const Gt=(()=>{for(const hr of Object.keys(Ce))if(Ce[hr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let hr=oe;hr0;hr++){const Ar=P.shift();Ar.abortController.signal.aborted?hr--:Be(Ar)}},kt=(Gt,hr)=>new Promise((Ar,Lr)=>{const en=new Image,xn=Gt.url,Ze=Gt.credentials;Ze&&Ze==="include"?en.crossOrigin="use-credentials":(Ze&&Ze==="same-origin"||!t.s(xn))&&(en.crossOrigin="anonymous"),hr.signal.addEventListener("abort",()=>{en.src="",Lr(t.c())}),en.fetchPriority="high",en.onload=()=>{en.onerror=en.onload=null,Ar({data:en})},en.onerror=()=>{en.onerror=en.onload=null,hr.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."))},en.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: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)),_t)this.size=[Ce,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,Ce,Be,0,this.format,Gt.UNSIGNED_BYTE,P.data);else{const{x:hr,y:Ar}=Me||{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,hr,Ar,Gt.RGBA,Gt.UNSIGNED_BYTE,P):Gt.texSubImage2D(Gt.TEXTURE_2D,0,hr,Ar,Ce,Be,Gt.RGBA,Gt.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Gt.generateMipmap(Gt.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,Gt=_t.y+1,hr=this.getImage(Be).data,Ar=hr.width,Lr=hr.height;t.R.copy(hr,Ce,{x:0,y:0},{x:kt,y:Gt},{width:Ar,height:Lr}),t.R.copy(hr,Ce,{x:0,y:Lr-1},{x:kt,y:Gt-1},{width:Ar,height:1}),t.R.copy(hr,Ce,{x:0,y:0},{x:kt,y:Gt+Lr},{width:Ar,height:1}),t.R.copy(hr,Ce,{x:Ar-1,y:0},{x:kt-1,y:Gt},{width:1,height:Lr}),t.R.copy(hr,Ce,{x:0,y:0},{x:kt+Ar,y:Gt},{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,Gt){for(let hr=P;hr-1);Gt++,Be[Gt]=kt,_t[Gt]=hr,_t[Gt+1]=I}for(let kt=0,Gt=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 Gt={};for(const hr of t.n(kt.data))Gt[hr.id]=hr;return Gt})},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,Gt=this._createCanvas(kt),hr=this.ctx=Gt.getContext("2d",{willReadFrequently:!0});hr.font=`${_t} ${Be} ${Ue}px ${Ce}`,hr.textBaseline="alphabetic",hr.textAlign="left",hr.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))),Gt=Math.min(this.size-this.buffer,_t+Math.ceil(Me)),hr=kt+2*this.buffer,Ar=Gt+2*this.buffer,Lr=Math.max(hr*Ar,0),en=new Uint8ClampedArray(Lr),xn={data:en,width:hr,height:Ar,glyphWidth:kt,glyphHeight:Gt,glyphTop:_t,glyphLeft:0,glyphAdvance:P};if(kt===0||Gt===0)return xn;const{ctx:Ze,buffer:tt,gridInner:vt,gridOuter:bt}=this;Ze.clearRect(tt,tt,kt,Gt),Ze.fillText(Ue,tt,tt+_t);const zt=Ze.getImageData(tt,tt,kt,Gt);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,hr,Ar,hr,this.f,this.v,this.z),L(vt,tt,tt,kt,Gt,hr,this.f,this.v,this.z);for(let Et=0;Et1&&(Gt=P[++kt]);const Ar=Math.abs(hr-Gt.left),Lr=Math.abs(hr-Gt.right),en=Math.min(Ar,Lr);let xn;const Ze=Be/Me*(Ce+1);if(Gt.isDash){const tt=Ce-Math.abs(Ze);xn=Math.sqrt(en*en+tt*tt)}else xn=Ce-Math.sqrt(en*en+Ze*Ze);this.data[_t+hr]=Math.max(0,Math.min(255,xn+128))}}}addRegularDash(P){for(let kt=P.length-1;kt>=0;--kt){const Gt=P[kt],hr=P[kt+1];Gt.zeroLength?P.splice(kt,1):hr&&hr.isDash===Gt.isDash&&(hr.left=Gt.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 Gt=Math.abs(kt-_t.left),hr=Math.abs(kt-_t.right),Ar=Math.min(Gt,hr);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,en,xn){if(Lr)for(const Ze of Lr){const tt=en[Ze];if(tt&&tt.source===xn&&tt.type==="fill-extrusion")return!0}else for(const Ze in en){const tt=en[Ze];if(tt.source===xn&&tt.type==="fill-extrusion")return!0}return!1})(Ce&&Ce.layers,P,Ue.id),kt=Be.maxPitchScaleFactor(),Gt=Ue.tilesIn(Me,kt,_t);Gt.sort(H);const hr=[];for(const Lr of Gt)hr.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 en={},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=en[zt]=en[zt]||[];for(const Tr of Et)Ut[Tr.featureIndex]||(Ut[Tr.featureIndex]=!0,gr.push(Tr))}}return en})(hr);for(const Lr in Ar)Ar[Lr].forEach(en=>{const xn=en.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 Gt=yield P.actor.sendAsync({type:"LDT",data:kt});P.dem=Gt,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,Gt={};return Gt[new t.S(P.overscaledZ,Be,oe.z,Ce,oe.y).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,_t,oe.y).key]={backfilled:!1},oe.y>0&&(Gt[new t.S(P.overscaledZ,Be,oe.z,Ce,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,_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,Gt=-1/0;for(const en of Ce)Be=Math.min(Be,en.x),_t=Math.min(_t,en.y),kt=Math.max(kt,en.x),Gt=Math.max(Gt,en.y);const hr=Math.max(kt-Be,Gt-_t),Ar=Math.max(0,Math.floor(-Math.log(hr)/Math.LN2)),Lr=Math.pow(2,Ar);return new t.a1(Ar,Math.floor((Be+kt)/2*Lr),Math.floor((_t+Gt)/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 lt(){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(hr)).filter(Boolean);if(Gt.length!==0){kt.layers=Gt,kt.stateDependentLayerIds&&(kt.stateDependentLayers=kt.stateDependentLayerIds.map(hr=>Gt.filter(Ar=>Ar.id===hr)[0]));for(const hr of Gt)_t[hr.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,lt().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,Gt,hr,Ar){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ce,cameraQueryGeometry:Be,scale:_t,tileSize:this.tileSize,pixelPosMatrix:Ar,transform:Gt,params:kt,queryPadding:this.queryPadding*hr},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:Gt,x:hr,y:Ar}=this.tileID.canonical,Lr={z:Gt,x:hr,y:Ar};for(let en=0;en<_t.length;en++){const xn=_t.feature(en);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,Gt,hr,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 Gt=new(Pe(Be.type))(Ce,Be,_t,kt);if(Gt.id!==Ce)throw new Error(`Expected Source id to be ${Ce} instead of ${Gt.id}`);return Gt})(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),Gt=new t.P(_t.canonical.x,_t.canonical.y)._rotate(this.transform.angle);return Be.overscaledZ-_t.overscaledZ||Gt.y-kt.y||Gt.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+Gt)===1?_t+=Gt:Math.abs(_t-Gt)===1&&(_t-=Gt)),Be.dem&&Ce.dem&&(Ce.dem.backfillBorder(Be.dem,_t,kt),Ce.neighboringTiles&&Ce.neighboringTiles[hr]&&(Ce.neighboringTiles[hr].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 hr=_t.tileID.scaledTo(_t.tileID.overscaledZ-1);_t=this._tiles[hr.key],_t&&_t.hasData()&&(kt=hr)}let Gt=kt;for(;Gt.overscaledZ>oe;)if(Gt=Gt.scaledTo(Gt.overscaledZ-1),P[Gt.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={},Gt={},hr=Object.keys(P),Ar=i.now();for(const Lr of hr){const en=P[Lr],xn=this._tiles[Lr];if(!xn||xn.fadeEndTime!==0&&xn.fadeEndTime<=Ar)continue;const Ze=this.findLoadedParent(en,oe),tt=this.findLoadedSibling(en),vt=Ze||tt||null;vt&&(this._addTile(vt.tileID),kt[vt.tileID.key]=vt.tileID),Gt[Lr]=en}this._retainLoadedChildren(Gt,Ce,Me,P);for(const Lr in kt)P[Lr]||(this._coveredTiles[Lr]=!0,P[Lr]=kt[Lr]);if(_t){const Lr={},en={};for(const xn of Be)this._tiles[xn.key].hasData()?Lr[xn.key]=xn:en[xn.key]=xn;for(const xn in en){const Ze=en[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 en[xn])}for(const xn in en){const Ze=en[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 en=Lr.scaledTo(Lr.canonical.z-1);Ar[en.key]=en;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 Gt=this._updateRetainedTiles(Me,Ce);ar(this._source.type)&&this._updateCoveredAndRetainedTiles(Gt,Be,_t,Ce,Me,oe);for(const Ar in Gt)this._tiles[Ar].clearFadeHold();const hr=t.ab(this._tiles,Gt);for(const Ar of hr){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),Gt={};for(const hr of P){const Ar=this._addTile(hr);Ce[hr.key]=hr,Ar.hasData()||oethis._source.maxzoom){const en=hr.children(this._source.maxzoom)[0],xn=this.getTile(en);if(xn&&xn.hasData()){Ce[en.key]=en;continue}}else{const en=hr.children(this._source.maxzoom);if(Ce[en[0].key]&&Ce[en[1].key]&&Ce[en[2].key]&&Ce[en[3].key])continue}let Lr=Ar.wasRequested();for(let en=hr.overscaledZ-1;en>=_t;--en){const xn=hr.scaledTo(en);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)),Gt=_t.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),hr=this.getIds();let Ar=1/0,Lr=1/0,en=-1/0,xn=-1/0;for(const Ze of Gt)Ar=Math.min(Ar,Ze.x),Lr=Math.min(Lr,Ze.y),en=Math.max(en,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=Gt.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 Er{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-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 $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 Gt=[];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 hr=0;hr0}hitTestCircle(P,oe,Me,Ce,Be){const _t=P-Me,kt=P+Me,Gt=oe-Me,hr=oe+Me;if(kt<0||_t>this.width||hr<0||Gt>this.height)return!1;const Ar=[];return this._forEachCell(_t,Gt,kt,hr,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,Gt){const{seenUids:hr,hitTest:Ar,overlapMode:Lr}=kt,en=this.boxCells[Be];if(en!==null){const Ze=this.bboxes;for(const tt of en)if(!hr.box[tt]){hr.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]&&(!Gt||Gt(bt))&&(!Ar||!Mr(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(!hr.circle[tt]){hr.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)&&(!Gt||Gt(bt))&&(!Ar||!Mr(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,Gt){const{circle:hr,seenUids:Ar,overlapMode:Lr}=kt,en=this.boxCells[Be];if(en!==null){const Ze=this.bboxes;for(const tt of en)if(!Ar.box[tt]){Ar.box[tt]=!0;const vt=4*tt,bt=this.boxKeys[tt];if(this._circleAndRectCollide(hr.x,hr.y,hr.radius,Ze[vt+0],Ze[vt+1],Ze[vt+2],Ze[vt+3])&&(!Gt||Gt(bt))&&!Mr(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],hr.x,hr.y,hr.radius)&&(!Gt||Gt(bt))&&!Mr(Lr,bt.overlapMode))return _t.push(!0),!0}}}_forEachCell(P,oe,Me,Ce,Be,_t,kt,Gt){const hr=this._convertToXCellCoord(P),Ar=this._convertToYCellCoord(oe),Lr=this._convertToXCellCoord(Me),en=this._convertToYCellCoord(Ce);for(let xn=hr;xn<=Lr;xn++)for(let Ze=Ar;Ze<=en;Ze++)if(Be.call(this,P,oe,Me,Ce,this.xCellCount*Ze+xn,_t,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,Me,Ce,Be,_t){const kt=Ce-P,Gt=Be-oe,hr=Me+_t;return hr*hr>kt*kt+Gt*Gt}_circleAndRectCollide(P,oe,Me,Ce,Be,_t,kt){const Gt=(_t-Ce)/2,hr=Math.abs(P-(Ce+Gt));if(hr>Gt+Me)return!1;const Ar=(kt-Be)/2,Lr=Math.abs(oe-(Be+Ar));if(Lr>Ar+Me)return!1;if(hr<=Gt||Lr<=Ar)return!0;const en=hr-Gt,xn=Lr-Ar;return en*en+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 Nr(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,Gt,hr,Ar,Lr,en,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,Gt,hr,Ar){const Lr=oe/24,en=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,en,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,hr);if(gr)return gr}Ze=[zt.first];for(let gr=P.glyphStartIndex+1;gr0?Et.point:(function(Tr,Pr,Yr,on,En,Pn){return Xe(Tr,Pr,Yr,1,En,Pn)})(Ue.tileAnchorPoint,zt,vt,0,Be,Ue),gr=ye(P.writingMode,vt,Ut,hr);if(gr)return gr}const tt=Kt(Lr*kt.getoffsetX(P.glyphStartIndex),en,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(Gt,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,Gt=oe.sub(kt);return oe.add(Gt._mult(Me/Gt.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,Gt,hr,Ar,Lr){return Xe(kt,Gt,hr,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,Gt){if(kt.projectionCache.offsets[Ue])return kt.projectionCache.offsets[Ue];const hr=oe.add(P);if(Ue+Gt.direction=Ce)return kt.projectionCache.offsets[Ue]=hr,hr;const Ar=Qe(Ue+Gt.direction,kt,Gt),Lr=Ct(Ar.sub(oe),_t,Gt.direction),en=oe.add(Lr),xn=Ar.add(Lr);return kt.projectionCache.offsets[Ue]=t.ak(Be,hr,en,xn)||hr,kt.projectionCache.offsets[Ue]}function Kt(Ue,P,oe,Me,Ce,Be,_t,kt,Gt){const hr=Me?Ue-P:Ue+P;let Ar=hr>0?1:-1,Lr=0;Me&&(Ar*=-1,Lr=Math.PI),Ar<0&&(Lr+=Math.PI);let en,xn=Ar>0?Be+Ce:Be+Ce+1;kt.projectionCache.cachedAnchorPoint?en=kt.projectionCache.cachedAnchorPoint:(en=Lt(kt.tileAnchorPoint.x,kt.tileAnchorPoint.y,kt).point,kt.projectionCache.cachedAnchorPoint=en);let Ze,tt,vt=en,bt=en,zt=0,Et=0;const Ut=Math.abs(hr),gr=[];let Tr;for(;zt+Et<=Ut;){if(xn+=Ar,xn=_t)return null;zt+=Et,bt=vt,tt=Ze;const on={absOffsetX:Ut,direction:Ar,distanceFromAnchor:zt,previousVertex:bt};if(vt=Qe(xn,kt,on),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,on).sub(vt),oe,Ar):Ct(Pn,oe,Ar),tt||(tt=bt.add(En)),Ze=Ot(xn,En,vt,Be,_t,tt,oe,kt,on),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:Gt?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;ho--)ni.push(ri.path[ho]);for(let ho=1;hoWo.signedDistanceFromCamera<=0)?[]:ho.map(Wo=>Wo.point)}let To=[];if(ni.length>0){const ho=ni[0].clone(),Wo=ni[0].clone();for(let Js=1;Js=Pn.x&&Wo.x<=Xn.x&&ho.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 ho of To){Ta.reset(ho,.25*En);let Wo=0;Wo=Ta.length<=.5*En?1:Math.ceil(Ta.paddedLength/Wi)+1;for(let Js=0;JsMt(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+Br,Ar.y+Br);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)),Gt={},hr={};for(const Ar of kt){const Lr=Ar.key;if(Gt[Lr.bucketInstanceId]===void 0&&(Gt[Lr.bucketInstanceId]={}),Gt[Lr.bucketInstanceId][Lr.featureIndex])continue;const en=[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,en)&&(Gt[Lr.bucketInstanceId][Lr.featureIndex]=!0,hr[Lr.bucketInstanceId]===void 0&&(hr[Lr.bucketInstanceId]=[]),hr[Lr.bucketInstanceId].push(Lr.featureIndex))}return hr}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,Gt={bucketInstanceId:Ce,featureIndex:Be,collisionGroupID:_t,overlapMode:oe};for(let hr=0;hr=this.screenRightBoundary||Cethis.screenBottomBoundary}isInsideGrid(P,oe,Me,Ce){return Me>=0&&P=0&&oethis.projectAndGetPerspectiveRatio(Me,En.x,En.y,Ce,hr));Yr=on.some(En=>!En.isOccluded),Pr=on.map(En=>En.point)}else Yr=!0;return{box:t.ao(Pr),allPointsOccluded:!Yr}}}function Wn(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 na{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 aa{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 qt{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,Gt=Be.layers[0].layout,hr=Be.layers[0].paint,Ar=Math.pow(2,this.transform.zoom-Me.tileID.overscaledZ),Lr=Me.tileSize/t.X,en=Me.tileID.toUnwrapped(),xn=this.transform.calculatePosMatrix(en),Ze=Gt.get("text-pitch-alignment")==="map",tt=Gt.get("text-rotation-alignment")==="map",vt=Wn(Me,1,this.transform.zoom),bt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,hr.get("text-translate"),hr.get("text-translate-anchor")),zt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,hr.get("icon-translate"),hr.get("icon-translate-anchor")),Et=Sr(xn,Ze,tt,this.transform,vt);let Ut=null;if(Ze){const Tr=Nr(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:Gt,translationText:bt,translationIcon:zt,posMatrix:xn,unwrappedTileID:en,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:on}=Tr;P.push({sortKey:Pr,symbolInstanceStart:Yr,symbolInstanceEnd:on,parameters:gr})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Be.symbolInstances.length,parameters:gr})}attemptAnchorPlacement(P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,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,en,Gt,hr,Ar,kt,_t,vt,Lr.predicate,Et,Tr);if((!zt||this.collisionIndex.placeCollisionBox(zt,en,Gt,hr,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:Gt,unwrappedTileID:hr,textLabelPlaneMatrix:Ar,labelToScreenMatrix:Lr,textPixelRatio:en,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",on=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,Wi)=>{var To,ho;if(oe[Wa.crossTileID])return;if(xn)return void(this.placements[Wa.crossTileID]=new aa(!1,!1,!1));let Wo=!1,Js=!1,Qs=!0,Es=null,al={box:null,placeable:!1,offscreen:null},mu={placeable:!1},iu=null,ks=null,Cs=null,Ru=0,uc=0,Nc=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?(al=Zr(),mu=al):al=_r(),al&&al.placeable)break}else al=_r()},tr=Wa.textAnchorOffsetStartIndex,er=Wa.textAnchorOffsetEndIndex;if(er===tr){const _r=(Zr,Xr)=>{const hn=this.collisionIndex.placeCollisionBox(Zr,Et,en,Gt,hr,Yr,Pr,_t,vt.predicate,Ta);return hn&&hn.placeable&&(this.markUsedOrientation(Ce,Xr,Wa),this.placedOrientations[Wa.crossTileID]=Xr),hn};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(al&&al.placeable)}else{let _r=t.aq[(ho=(To=this.prevPlacement)===null||To===void 0?void 0:To.variableOffsets[Wa.crossTileID])===null||ho===void 0?void 0:ho.anchor];const Zr=(hn,Sn,Cn)=>{const La=hn.x2-hn.x1,zn=hn.y2-hn.y1,Qn=Wa.textBoxScale,la=on&&gr==="never"?Sn:null;let Sa=null,Ra=Et==="never"?1:2,sa="never";_r&&Ra++;for(let ai=0;aiZr(ge,ni.iconBox,t.ah.horizontal),()=>{const hn=ni.verticalTextBox;return Ce.allowVerticalPlacement&&(!al||!al.placeable)&&Wa.numVerticalGlyphVertices>0&&hn?Zr(hn,ni.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),al&&(Wo=al.placeable,Qs=al.offscreen);const Xr=St(al&&al.placeable);if(!Wo&&this.prevPlacement){const hn=this.prevPlacement.variableOffsets[Wa.crossTileID];hn&&(this.variableOffsets[Wa.crossTileID]=hn,this.markUsedJustification(Ce,hn.anchor,Wa,Xr))}}}if(iu=al,Wo=iu&&iu.placeable,Qs=iu&&iu.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,Gt,hr,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,Qs=Qs&&ks.offscreen}if(ni.iconFeatureIndex&&(Nc=ni.iconFeatureIndex),ni.iconBox){const St=It=>this.collisionIndex.placeCollisionBox(It,gr,en,Gt,hr,Yr,Pr,kt,vt.predicate,Ta,on&&Es?Es:void 0);mu&&mu.placeable&&ni.verticalIconBox?(Cs=St(ni.verticalIconBox),Js=Cs.placeable):(Cs=St(ni.iconBox),Js=Cs.placeable),Qs=Qs&&Cs.offscreen}const Oe=bt||Wa.numHorizontalGlyphVertices===0&&Wa.numVerticalGlyphVertices===0,rt=zt||Wa.numIconVertices===0;Oe||rt?rt?Oe||(Js=Js&&Wo):Wo=Js&&Wo:Js=Wo=Js&&Wo;const wt=Js&&Cs.placeable;if(Wo&&iu.placeable&&this.collisionIndex.insertCollisionBox(iu.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,Nc,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,Wi,ni,iu,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 aa(Wo||Pn,Js||Xn,Qs||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 Wi=Wa[ni];ri(Ce.symbolInstances.get(Wi),Ce.collisionArrays[Wi],Wi)}}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 Gt in this.placements){const hr=this.placements[Gt],Ar=Be[Gt];Ar?(this.opacities[Gt]=new na(Ar,Ce,hr.text,hr.icon),Me=Me||hr.text!==Ar.text.placed||hr.icon!==Ar.icon.placed):(this.opacities[Gt]=new na(null,Ce,hr.text,hr.icon,hr.skipFade),Me=Me||hr.text||hr.icon)}for(const Gt in Be){const hr=Be[Gt];if(!this.opacities[Gt]){const Ar=new na(hr,Ce,!1,!1);Ar.isHidden()||(this.opacities[Gt]=Ar,Me=Me||hr.text.placed||hr.icon.placed)}}for(const Gt in _t)this.variableOffsets[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.variableOffsets[Gt]=_t[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");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 na(null,0,!1,!1,!0),Gt=_t.get("text-allow-overlap"),hr=_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",en=_t.get("text-pitch-alignment")==="map",xn=_t.get("icon-text-fit")!=="none",Ze=new na(null,0,Gt&&(hr||!P.hasIconData()||_t.get("icon-optional")),hr&&(Gt||!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],on=Yr===t.ah.vertical,En=Yr===t.ah.horizontal||Yr===t.ah.horizontalOnly;if(Et>0||Ut>0){const Xn=da(Tr.text);tt(P.text,Et,on?_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||on?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=da(Tr.icon),Ta=!(xn&&zt.verticalPlacedIconSymbolIndex&&on);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(en?this.transform.angle:-this.transform.angle)):ri=!1}if(Xn.textBox||Xn.verticalTextBox){let Wa;Xn.textBox&&(Wa=on),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]-Br,kt=Me[1]-Br,Gt=Me[2]-Br,hr=Me[3]-Br;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,Gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,Gt,hr),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,_t,hr)}const ur=Math.pow(2,25),Gr=Math.pow(2,24),sn=Math.pow(2,17),mn=Math.pow(2,16),Tn=Math.pow(2,9),Jn=Math.pow(2,8),ma=Math.pow(2,1);function da(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*sn+P*mn+oe*Tn+P*Jn+oe*ma+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,Gt=!1){if(!_t[0]&&!_t[1])return[0,0];const hr=Gt?kt==="map"?Ce.angle:0:kt==="viewport"?-Ce.angle:0;if(hr){const Ar=Math.sin(hr),Lr=Math.cos(hr);_t=[_t[0]*Lr-_t[1]*Ar,_t[0]*Ar+_t[1]*Lr]}return[Gt?_t[0]:Wn(Be,_t[0],Ce.zoom),Gt?_t[1]:Wn(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-Gt.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,Gt){this.placement=new qt(P,Ca(),oe,_t,kt,Gt),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 Mi=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(Gt.anchorX*Mi),y:Math.floor(Gt.anchorY*Mi)})),crossTileIDs:_t.map(Gt=>Gt.crossTileID)};if(kt.positions.length>128){const Gt=new t.av(kt.positions.length,16,Uint16Array);for(const{x:hr,y:Ar}of kt.positions)Gt.add(hr,Ar);Gt.finish(),delete kt.positions,kt.index=Gt}this._symbolsByKey[Be]=kt}}getScaledCoordinates(P,oe){const{x:Me,y:Ce,z:Be}=this.tileID.canonical,{x:_t,y:kt,z:Gt}=oe.canonical,hr=Mi/Math.pow(2,Gt-Be),Ar=(kt*t.X+P.anchorY)*hr,Lr=Ce*t.X*Mi;return{x:Math.floor((_t*t.X+P.anchorX)*hr-Me*t.X*Mi),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 Gt=_t[kt];Gt.tileID.isChildOf(P)&&Gt.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()),lt().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,Gt){return t._(this,void 0,void 0,function*(){const hr=w(Be),Ar=kt>1?"@2x":"",Lr={},en={};for(const{id:xn,url:Ze}of hr){const tt=_t.transformRequest(m(Ze,Ar,".json"),"SpriteJSON");Lr[xn]=t.h(tt,Gt);const vt=_t.transformRequest(m(Ze,Ar,".png"),"SpriteImage");en[xn]=l.getImage(vt,Gt)}return yield Promise.all([...Object.values(Lr),...Object.values(en)]),(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:on,stretchX:En,stretchY:Pn,content:Xn,textFitWidth:Ta,textFitHeight:ri}=zt[Et];tt[vt][Et]={data:null,pixelRatio:on,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,en)})})(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(Gt=>!(Gt in Be)):[];for(const Gt of kt)this.imageManager.removeImage(Gt),this._changedImages[Gt]=!0;for(const Gt in Be[_t]){const hr=_t==="default"?Gt:`${_t}:${Gt}`;this._spritesImagesIds[_t].push(hr),hr in this.imageManager.images?this.imageManager.updateImage(hr,Be[_t][Gt],!1):this.imageManager.addImage(hr,Be[_t][Gt]),oe&&(this._changedImages[hr]=!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 Gt of P){const hr=Gt[kt];if(hr)for(const Ar of hr)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 Gt=Ce.length-1;Gt>=0;Gt--){const hr=Ce[Gt].feature;if(Me[hr.layer.id]<_t)break;Be.push(hr),Ce.pop()}else for(const Gt of P){const hr=Gt[kt];if(hr)for(const Ar of hr)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 Gt=this._layers[kt];if(!Gt)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[Gt.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,Gt,hr,Ar,Lr,en,xn){const Ze={},tt=en.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],Gt,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 on=Yr.indexOf(Tr.featureIndex);return Yr.indexOf(Pr.featureIndex)-on}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=hr[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(hr=>Ce.getTileByID(hr)),kt=[],Gt={};for(let hr=0;hr<_t.length;hr++){const Ar=_t[hr],Lr=Ar.tileID.canonical.key;Gt[Lr]||(Gt[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),lt().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 Gt={};for(const hr of this._order){const Ar=this._layers[hr];if(Ar.type!=="symbol")continue;if(!Gt[Ar.source]){const en=this.sourceCaches[Ar.source];Gt[Ar.source]=en.getRenderableIds(!0).map(xn=>en.getTileByID(xn)).sort((xn,Ze)=>Ze.tileID.overscaledZ-xn.tileID.overscaledZ||(xn.tileID.isLessThan(Ze.tileID)?-1:1))}const Lr=this.crossTileSymbolIndex.addLayer(Ar,Gt[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,Gt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),kt=!0),_t&&this.pauseablePlacement.placement.setStale()),kt||_t)for(const hr of this._order){const Ar=this._layers[hr];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 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 ln=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:At(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:At(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:At(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:At(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:At("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:At(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:At(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:At("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:At("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:At("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:At(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:At(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:At(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;gl_Position=u_matrix*vec4(a_pos,0,1);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;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:At(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:At(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:At(`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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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 +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),hillshadePrepare:At(`#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 +}`,"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;}"),hillshade:At(`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 +}`,"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;}"),line:At(`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 +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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 +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:At(`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() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:At(`#ifdef GL_ES +precision highp float; +#endif +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 +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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 tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:At(`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 +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:At(`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 +}`,"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;}"),symbolIcon:At(`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 +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;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=u_is_text ? size/24.0 : size;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*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:At(`#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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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;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=u_is_text ? size/24.0 : size;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+a_pxoffset)*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=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:At(`#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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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,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,(Gt,hr,Ar,Lr,en)=>(kt[en]=!0,hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +varying ${Ar} ${Lr} ${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`)),vertexSource:P=P.replace(oe,(Gt,hr,Ar,Lr,en)=>{const xn=Lr==="float"?"vec2":"vec4",Ze=en.match(/color/)?"color":xn;return kt[en]?hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +uniform lowp float u_${en}_t; +attribute ${Ar} ${xn} a_${en}; +varying ${Ar} ${Lr} ${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${en} + ${en} = a_${en}; +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${en} + ${en} = unpack_mix_${Ze}(a_${en}, u_${en}_t); +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:hr==="define"?` +#ifndef HAS_UNIFORM_u_${en} +uniform lowp float u_${en}_t; +attribute ${Ar} ${xn} a_${en}; +#else +uniform ${Ar} ${Lr} u_${en}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = a_${en}; +#else + ${Ar} ${Lr} ${en} = u_${en}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${en} + ${Ar} ${Lr} ${en} = unpack_mix_${Ze}(a_${en}, u_${en}_t); +#else + ${Ar} ${Lr} ${en} = u_${en}; +#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,Gt,hr){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 un(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,Gt,hr,Ar,Lr,en,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),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 gr in this.terrainUniforms)this.terrainUniforms[gr].set(Gt[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 en.get()){const Tr=gr.vaos||(gr.vaos={});(Tr[hr]||(Tr[hr]=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/Wn(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 hr=new t.A(9);return t.A!=Float32Array&&(hr[1]=0,hr[2]=0,hr[3]=0,hr[5]=0,hr[6]=0,hr[7]=0),hr[0]=1,hr[4]=1,hr[8]=1,hr})();Ce.properties.get("anchor")==="viewport"&&(function(hr,Ar){var Lr=Math.sin(Ar),en=Math.cos(Ar);hr[0]=en,hr[1]=Lr,hr[2]=0,hr[3]=-Lr,hr[4]=en,hr[5]=0,hr[6]=0,hr[7]=0,hr[8]=1})(kt,-P.transform.angle),(function(hr,Ar,Lr){var en=Ar[0],xn=Ar[1],Ze=Ar[2];hr[0]=en*Lr[0]+xn*Lr[3]+Ze*Lr[6],hr[1]=en*Lr[1]+xn*Lr[4]+Ze*Lr[7],hr[2]=en*Lr[2]+xn*Lr[5]+Ze*Lr[8]})(_t,_t,kt);const Gt=Ce.properties.get("color");return{u_matrix:Ue,u_lightpos:_t,u_lightintensity:Ce.properties.get("intensity"),u_lightcolor:[Gt.r,Gt.g,Gt.b],u_vertical_gradient:+oe,u_opacity:Me}},cn=(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}),Hi=(Ue,P,oe,Me)=>{const Ce=Ue.transform;let Be,_t;if(Me.paint.get("circle-pitch-alignment")==="map"){const kt=Wn(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}),fi=(Ue,P,oe,Me)=>({u_matrix:Ue,u_extrude_scale:Wn(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/Wn(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/Wn(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),Gt=oe.layout.get("line-cap")==="round",hr=_t.getDash(Me.from,Gt),Ar=_t.getDash(Me.to,Gt),Lr=hr.width*Ce.fromScale,en=Ar.width*Ce.toScale;return t.e(Xs(Ue,P,oe,Be),{u_patternscale_a:[kt/Lr,-hr.height/2],u_patternscale_b:[kt/en,-Ar.height/2],u_sdfgamma:_t.width/(256*Math.min(Lr,en)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:hr.y,u_tex_y_b:Ar.y,u_mix:Ce.t})};function Ys(Ue,P){return 1/Wn(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 sl=(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,Gt,hr,Ar,Lr,en,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:Gt,u_coord_matrix:hr,u_is_text:+Lr,u_pitch_with_map:+Me,u_is_along_line:Ce,u_is_variable_anchor:Be,u_texsize:en,u_texture:0,u_translation:Ar,u_pitched_scale:xn}},vo=(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,xn,Ze)=>{const tt=_t.transform;return t.e(Zo(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,Lr,en,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,Gt,hr,Ar,Lr,en,xn)=>t.e(vo(Ue,P,oe,Me,Ce,Be,_t,kt,Gt,hr,Ar,!0,Lr,!0,xn),{u_texsize_icon:en,u_texture_icon:1}),ll=(Ue,P,oe)=>({u_matrix:Ue,u_opacity:P,u_color:oe}),kl=(Ue,P,oe,Me,Ce,Be)=>t.e((function(_t,kt,Gt,hr){const Ar=Gt.imageManager.getPattern(_t.from.toString()),Lr=Gt.imageManager.getPattern(_t.to.toString()),{width:en,height:xn}=Gt.imageManager.getPixelSize(),Ze=Math.pow(2,hr.tileID.overscaledZ),tt=hr.tileSize*Math.pow(2,Gt.transform.tileZoom)/Ze,vt=tt*(hr.tileID.canonical.x+hr.tileID.wrap*Ze),bt=tt*hr.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:[en,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/Wn(hr,1,Gt.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}),Pl={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 di={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),Gt.push({circleArray:gr,circleOffset:Ar,transform:zt.posMatrix,invTransform:Tr,coord:zt}),hr+=gr.length/4,Ar=hr}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||!Gt.length)return;const en=Ue.useProgram("collisionCircle"),xn=new t.aR;xn.resize(4*hr),xn._trim();let Ze=0;for(const bt of Gt)for(let zt=0;zt=0&&(bt[Et.associatedIconIndex]={shiftedAnchor:Wi,angle:To})}else mr(Et.numGlyphs,tt)}if(hr){vt.clear();const zt=Ue.icon.placedSymbolArray;for(let Et=0;EtUe.style.map.terrain.getElevation(Pn,Cn,La):null,Sn=oe.layout.get("text-rotation-alignment")==="map";ke(Ta,Pn.posMatrix,Ue,Ce,uc,ge,bt,hr,Sn,tt,Pn.toUnwrapped(),Ze.width,Ze.height,Oe,hn)}const St=Pn.posMatrix,It=Ce&&Yr||wt,tr=zt||It?Ou:uc,er=Nc,_r=ni&&oe.paint.get(Ce?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Zr;Zr=ni?Ta.iconsInText?hs(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Qs,iu,En):vo(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Qs,!0,En):Zo(Wi.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Qs,En);const Xr={program:ho,buffers:ri,uniformValues:Zr,atlasTexture:Es,atlasTextureIcon:ks,atlasInterpolation:al,atlasInterpolationIcon:mu,isSDF:ni,hasHalo:_r};if(gr&&Ta.canOverlap){Tr=!0;const hn=ri.segments.get();for(const Sn of hn)on.push({segments:new t.a0([Sn]),sortKey:Sn.sortKey,state:Xr,terrainData:Js})}else on.push({segments:ri.segments,sortKey:0,state:Xr,terrainData:Js})}Tr&&on.sort((Pn,Xn)=>Pn.sortKey-Xn.sortKey);for(const Pn of on){const Xn=Pn.state;if(en.activeTexture.set(xn.TEXTURE0),Xn.atlasTexture.bind(Xn.atlasInterpolation,xn.CLAMP_TO_EDGE),Xn.atlasTextureIcon&&(en.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,Gt,hr){const Ar=Me.context;Ce.draw(Ar,Ar.gl.TRIANGLES,Be,_t,kt,Oo.disabled,Gt,hr,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]),Gt=P.getBucket(oe);if(!Gt)return;const hr=Me.key;let Ar=oe.heatmapFbos.get(hr);Ar||(Ar=Fh(Ce,P.tileSize,P.tileSize),oe.heatmapFbos.set(hr,Ar)),Ce.bindFramebuffer.set(Ar.framebuffer),Ce.viewport.set([0,0,P.tileSize,P.tileSize]),Ce.clear({color:t.aM.transparent});const Lr=Gt.programConfigurations.get(oe.id),en=Ue.useProgram("heatmap",Lr),xn=Ue.style.map.terrain.getTerrainData(Me);en.draw(Ce,Be.TRIANGLES,Fs.disabled,_t,kt,Oo.disabled,fi(Me.posMatrix,P,Ue.transform.zoom,oe.paint.get("heatmap-intensity")),xn,oe.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.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,Gt=(Ce=Ue.RGBA16F)!==null&&Ce!==void 0?Ce:Be.RGBA;Be.texImage2D(Be.TEXTURE_2D,0,Gt,P,oe,0,Be.RGBA,kt,null);const hr=Ue.createFramebuffer(P,oe,!1,!1);return hr.colorAttachment.set(_t),hr}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 Gt=Ce.getPaintProperty(P);_t=Be[Gt],kt=Be[Gt]}_t&&kt&&Ue.setConstantPatternPositions(_t,kt)}function Gh(Ue,P,oe,Me,Ce,Be,_t){const kt=Ue.context.gl,Gt="fill-pattern",hr=oe.paint.get(Gt),Ar=hr&&hr.constantOr(1),Lr=oe.getCrossfadeParameters();let en,xn,Ze,tt,vt;_t?(xn=Ar&&!oe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",en=kt.LINES):(xn=Ar?"fillPattern":"fill",en=kt.TRIANGLES);const bt=hr.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,Gt,bt,Et,oe);const Yr=Pr?zt:null,on=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(on,Ue,Lr,Et,En):Ea(on,En)}else tt=Ut.indexBuffer,vt=Ut.segments,Ze=Ar?gi(on,Ue,Lr,Et):In(on);Tr.draw(Ue.context,en,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,Gt=kt.gl,hr="fill-extrusion-pattern",Ar=oe.paint.get(hr),Lr=Ar.constantOr(1),en=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(Gt.TEXTURE0),vt.imageAtlasTexture.bind(Gt.LINEAR,Gt.CLAMP_TO_EDGE),Et.updatePaintBuffers(en)),of(Et,hr,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?cn(gr,Ue,Tr,xn,tt,en,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,Gt=kt.gl,hr=oe.fbo;if(!hr)return;const Ar=Ue.useProgram("hillshade"),Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,hr.colorAttachment.get()),Ar.draw(kt,Gt.TRIANGLES,Ce,Be,_t,Oo.disabled,((en,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-=en.transform.angle);const Ut=!en.options.moving;return{u_matrix:tt?tt.posMatrix:en.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 Ku(Ue,P,oe,Me,Ce,Be){const _t=Ue.context,kt=_t.gl,Gt=P.dem;if(Gt&&Gt.data){const hr=Gt.dim,Ar=Gt.stride,Lr=Gt.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 en=P.fbo;if(!en){const xn=new u(_t,{width:hr,height:hr,data:null},kt.RGBA);xn.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),en=P.fbo=_t.createFramebuffer(hr,hr,!0,!1),en.colorAttachment.set(xn.texture)}_t.bindFramebuffer.set(en.framebuffer),_t.viewport.set([0,0,hr,hr]),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,Gt),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(),Gt=(kt-Ue.timeAdded)/_t,hr=P?(kt-P.timeAdded)/_t:-1,Ar=oe.getSource(),Lr=Ce.coveringZoomLevel({tileSize:Ar.tileSize,roundZoom:Ar.roundZoom}),en=!P||Math.abs(P.tileID.overscaledZ-Lr)>Math.abs(Ue.tileID.overscaledZ-Lr),xn=en&&Ue.refreshedUponExpiration?1:t.ac(en?Gt:1-hr,0,1);return Ue.refreshedUponExpiration&&Gt>=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),Bl=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){Dc(Ue,0,P+oe/2,Ue.transform.width,oe,Me)}function Yh(Ue,P,oe,Me){Dc(Ue,P-oe/2,0,oe,Ue.transform.height,Me)}function Dc(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,Gt=pl.disabled,hr=Ue.colorModeForRenderPass(),Ar="$debug",Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(oe);Me.activeTexture.set(Ce.TEXTURE0);const en=P.getTileByID(oe.key).latestRawTileData,xn=Math.floor((en&&en.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,Gt,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,Gt,hr,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"),Gt=P.getTerrainMesh();Me.bindFramebuffer.set(null),Me.viewport.set([0,0,Ue.width,Ue.height]);for(const hr of oe){const Ar=Ue.renderToTexture.getTexture(hr),Lr=P.getTerrainData(hr.tileID);Me.activeTexture.set(Ce.TEXTURE0),Ce.bindTexture(Ce.TEXTURE_2D,Ar.texture);const en=Ue.transform.calculatePosMatrix(hr.tileID.toUnwrapped()),xn=P.getMeshFrameDelta(Ue.transform.zoom),Ze=Ue.transform.calculateFogMatrix(hr.tileID.toUnwrapped()),tt=zr(en,xn,Ze,Ue.style.sky,Ue.transform.pitch);kt.draw(Me,Ce.TRIANGLES,_t,pl.disabled,Be,Oo.backCCW,tt,Lr,"terrain",Gt.vertexBuffer,Gt.indexBuffer,Gt.segments)}}class zc{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,ln.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,ln.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,ln.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 Gt=this.context.gl;this.stencilClearMode=new pl({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 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++,Gt=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),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 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}))(hr,Gt.style.map.transform,Gt.pixelRatio),xn=new Fs(Lr.LEQUAL,Fs.ReadWrite,[0,1]),Ze=pl.disabled,tt=Gt.colorModeForRenderPass(),vt=Gt.useProgram("sky");if(!hr.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),hr.mesh=new zc(Ar.createVertexBuffer(bt,ln.members),Ar.createIndexBuffer(zt),t.a0.simpleSegment(0,0,bt.length,zt.length))}vt.draw(Ar,Lr.TRIANGLES,xn,Ze,tt,Oo.disabled,en,void 0,"sky",hr.mesh.vertexBuffer,hr.mesh.indexBuffer,hr.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 Gt=this.style._layers[Me[this.currentLayer]],hr=Ce[Gt.source],Ar=Be[Gt.source];this._renderTileClippingMasks(Gt,Ar),this.renderLayer(this,hr,Gt,Ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayervt.source&&!vt.isHidden(Ar)?[hr.sourceCaches[vt.source]]:[]),xn=en.filter(vt=>vt.getSource().type==="vector"),Ze=en.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);Gt&&(function(hr,Ar,Lr){for(let en=0;en0),Ce&&(t.b0(oe,Me),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Be,_t){const kt=Be.context,Gt=kt.gl,hr=fu.unblended,Ar=new Fs(Gt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),en=_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 en){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,Gt.TRIANGLES,Ar,pl.disabled,hr,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,Gt=kt.gl,hr=fu.unblended,Ar=new Fs(Gt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),en=_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(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,en.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,Gt.TRIANGLES,Ar,pl.disabled,hr,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,Gt,hr){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(en,xn,Ze,tt,vt,bt,zt,Et,Ut){const gr=xn.transform,Tr=Ca(),Pr=vt==="map",Yr=bt==="map";for(const on of en){const En=tt.getTile(on),Pn=En.getBucket(Ze);if(!Pn||!Pn.text||!Pn.text.segments.get().length)continue;const Xn=t.ag(Pn.textSizeData,gr.zoom),Ta=Wn(En,1,xn.transform.zoom),ri=Sr(on.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),Wi=xn.style.map.terrain?(ho,Wo)=>xn.style.map.terrain.getElevation(on,ho,Wo):null,To=Tr.translatePosition(gr,En,zt,Et);uh(Pn,Pr,Yr,Ut,gr,ri,on.posMatrix,ni,Xn,Wa,Tr,To,on.toUnwrapped(),Wi)}}})(Gt,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"),hr),kt.paint.get("icon-opacity").constantOr(1)!==0&&fd(Be,_t,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,Lr),kt.paint.get("text-opacity").constantOr(1)!==0&&fd(Be,_t,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,Lr),_t.map.showCollisionBoxes&&(af(Be,_t,kt,Gt,!0),af(Be,_t,kt,Gt,!1))})(P,oe,Me,Ce,this.style.placement.variableOffsets);break;case"circle":(function(Be,_t,kt,Gt){if(Be.renderPass!=="translucent")return;const hr=kt.paint.get("circle-opacity"),Ar=kt.paint.get("circle-stroke-width"),Lr=kt.paint.get("circle-stroke-opacity"),en=!kt.layout.get("circle-sort-key").isConstant();if(hr.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:on}=Et.state;gr.draw(xn,Ze.TRIANGLES,tt,vt,bt,Oo.disabled,Yr,on,kt.id,Tr,Pr,Et.segments,kt.paint,Be.transform.zoom,Ut)}})(P,oe,Me,Ce);break;case"heatmap":(function(Be,_t,kt,Gt){if(kt.paint.get("heatmap-opacity")===0)return;const hr=Be.context;if(Be.style.map.terrain){for(const Ar of Gt){const Lr=_t.getTile(Ar);_t.hasRenderableParent(Ar)||(Be.renderPass==="offscreen"?ch(Be,Lr,kt,Ar):Be.renderPass==="translucent"&&Nf(Be,kt,Ar))}hr.viewport.set([0,0,Be.width,Be.height])}else Be.renderPass==="offscreen"?(function(Ar,Lr,en,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,en),Ze.clear({color:t.aM.transparent});for(let zt=0;zt20&&Ar.texParameterf(Ar.TEXTURE_2D,hr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,hr.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=sl(Ta,on||[0,0],Yr||1,Pr,kt);Lr instanceof st?en.draw(hr,Ar.TRIANGLES,Et,pl.disabled,xn,Oo.disabled,ri,Pn,kt.id,Lr.boundsBuffer,Be.quadTriangleIndexBuffer,Lr.boundsSegments):en.draw(hr,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,Gt){const hr=kt.paint.get("background-color"),Ar=kt.paint.get("background-opacity");if(Ar===0)return;const Lr=Be.context,en=Lr.gl,xn=Be.transform,Ze=xn.tileSize,tt=kt.paint.get("background-pattern");if(Be.isPatternMissing(tt))return;const vt=!tt&&hr.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=Gt||xn.coveringTiles({tileSize:Ze,terrain:Be.style.map.terrain});tt&&(Lr.activeTexture.set(en.TEXTURE0),Be.imageManager.bind(Be.context));const Tr=kt.getCrossfadeParameters();for(const Pr of gr){const Yr=Gt?Pr.posMatrix:Be.transform.calculatePosMatrix(Pr.toUnwrapped()),on=tt?kl(Yr,Ar,Be,tt,{tileID:Pr,tileSize:Ze},Tr):ll(Yr,Ar,hr),En=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Pr);Ut.draw(Lr,en.TRIANGLES,zt,bt,Et,Oo.disabled,on,En,kt.id,Be.tileExtentBuffer,Be.quadTriangleIndexBuffer,Be.tileExtentSegments)}})(P,0,Me,Ce);break;case"custom":(function(Be,_t,kt){const Gt=Be.context,hr=kt.implementation;if(Be.renderPass==="offscreen"){const Ar=hr.prerender;Ar&&(Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Ar.call(hr,Gt.gl,Be.transform.customLayerMatrix()),Gt.setDirty(),Be.setBaseState())}else if(Be.renderPass==="translucent"){Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Gt.setStencilMode(pl.disabled);const Ar=hr.renderingMode==="3d"?new Fs(Be.context.gl.LEQUAL,Fs.ReadWrite,Be.depthRangeFor3D):Be.depthModeForSublayer(0,Fs.ReadOnly);Gt.setDepthMode(Ar),hr.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,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 hr=Math.sin(_t),Ar=Math.cos(_t);Me=[Me[0]*Ar-Me[1]*hr,Me[0]*hr+Me[1]*Ar]}const kt=[Be?Me[0]:Wn(oe,Me[0],this.transform.zoom),Be?Me[1]:Wn(oe,Me[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()),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,Pl[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 Ql{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 Gt=1/(kt=t.af([],kt,P))[3]/oe*Ce;return t.b1(kt,kt,[Gt,Gt,1/kt[3],Gt])}),_t=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(kt=>{const Gt=(function(en,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)),en[0]=xn[0]*bt,en[1]=xn[1]*bt,en[2]=xn[2]*bt,en})([],(function(en,xn,Ze){var tt=xn[0],vt=xn[1],bt=xn[2],zt=Ze[0],Et=Ze[1],Ut=Ze[2];return en[0]=vt*Ut-bt*Et,en[1]=bt*zt-tt*Ut,en[2]=tt*Et-vt*zt,en})([],M([],Be[kt[0]],Be[kt[1]]),M([],Be[kt[2]],Be[kt[1]]))),hr=-((Ar=Gt)[0]*(Lr=Be[kt[1]])[0]+Ar[1]*Lr[1]+Ar[2]*Lr[2]);var Ar,Lr;return Gt.concat(hr)});return new Ql(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 mc{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 mc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Oc=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 mc,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],Gt=Ce[2],hr=Ce[3],Ar=Math.sin(Be),Lr=Math.cos(Be);Me[0]=_t*Lr+Gt*Ar,Me[1]=kt*Lr+hr*Ar,Me[2]=_t*-Ar+Gt*Lr,Me[3]=kt*-Ar+hr*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)),Gt=Math.floor(Math.max(Me.x,Ce.x,Be.x,_t.x)),hr=1;for(let Ar=kt-hr;Ar<=Gt+hr;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),Gt=Math.pow(2,Ce),hr=[Gt*_t.x,Gt*_t.y,0],Ar=[Gt*kt.x,Gt*kt.y,0],Lr=Ql.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ce);let en=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(en=Ce);const xn=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ze=Et=>({aabb:new kf([Et*Gt,0,0],[(Et+1)*Gt,Gt,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?hr:Ar,Yr=Et.aabb.distanceX(Pr),on=Et.aabb.distanceY(Pr),En=Math.max(Math.abs(Yr),Math.abs(on));if(Et.zoom===bt||En>xn+(1<=en){const Pn=bt-Et.zoom,Xn=hr[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),Wi=P.terrain.getMinMaxElevation(ni),To=(oe=Wi.minElevation)!==null&&oe!==void 0?oe:this.elevation,ho=(Me=Wi.maxElevation)!==null&&Me!==void 0?Me:this.elevation;Wa=new kf([Wa.min[0],Wa.min[1],To],[Wa.max[0],Wa.max[1],ho])}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,Oc);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),Gt=this.scaleZoom(kt/this.tileSize);this._elevation=Be,this._center=Ce,this.zoom=Gt}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 en=oe.pointCoordinate(P);if(en!=null)return en}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,Gt=Ce[1]/_t,hr=Me[2]/Be,Ar=Ce[2]/_t,Lr=hr===Ar?0:(0-hr)/(Ar-hr);return new t.Z(t.y.number(Me[0]/Be,Ce[0]/_t,Lr)/this.worldSize,t.y.number(kt,Gt,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,Oc])}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,Gt=0,hr=Be,Ar=0,Lr=0;const{x:en,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=(Gt+hr)/2;let Ut=Ze;this._renderWorldCopies&&(Ut=t.b3(Ze,Et-Be/2,Et+Be/2));const gr=en/2;Ut-grhr&&(vt=hr-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),Gt=_t<0?kt:Be,hr=Math.PI/2+this._pitch,Ar=this._fov*(.5+P.y/this.height),Lr=Math.sin(Ar)*Gt/Math.sin(t.ac(Math.PI-hr-Ar,.01,Math.PI-.01)),en=this.getHorizon(),xn=2*Math.atan(en/this.cameraToCenterDistance)*(.5+P.y/(2*en)),Ze=Math.sin(xn)*Gt/Math.sin(t.ac(Math.PI-hr-xn,.01,Math.PI-.01)),tt=Math.min(Lr,Ze);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*tt+Gt),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,Gt=this._map.getBearing(),hr=this._map.getPitch();let Ar="";if(Ar+=P?`/${_t}/${kt}/${Me}`:`${Me}/${kt}/${_t}`,(Gt||hr)&&(Ar+="/"+Math.round(10*Gt)/10),hr&&(Ar+=`/${Math.round(hr)}`),this._hashName){const Lr=this._hashName;let en=!1;const xn=window.location.hash.slice(1).split("&").map(Ze=>{const tt=Ze.split("=")[0];return tt===Lr?(en=!0,`${tt}=${Ar}`):Ze}).filter(Ze=>Ze);return en||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),ev=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,ev);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(Gt)),kt=Be.reduce((Gt,hr,Ar,Lr)=>Gt.add(hr.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 au{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 Fc{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 Fc(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 su(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 Fc(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()}},fc=({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 hr in Ce){const Ar=Ce[hr],Lr=this._touches[hr];Lr&&(Be._add(Ar),_t._add(Ar.sub(Lr)),kt++,Ce[hr]=Ar)}if(this._touches=Ce,this._shouldBePrevented(kt)||!_t.mag())return;const Gt=_t.div(kt);return this._sum._add(Gt),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 fr={panStep:100,bearingStep:15,pitchStep:10};class Rr{constructor(P){this._tr=new Fc(P);const oe=fr;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 Gt=this._tr;kt.easeTo({duration:300,easeId:"keyboardHandler",easing:vn,zoom:oe?Math.round(Gt.zoom)+oe*(P.shiftKey?2:1):Gt.zoom,bearing:Gt.bearing+Me*this._bearingStep,pitch:Gt.pitch+Ce*this._pitchStep,offset:[-Be*this._panStep,-_t*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 vn(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 Fc(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 Gt=this._type==="wheel"&&Math.abs(this._delta)>an?this._wheelZoomRate:this._defaultZoomRate;let hr=2/(1+Math.exp(-Math.abs(this._delta*Gt)));this._delta<0&&hr!==0&&(hr=1/hr);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*hr))),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 Gt=Math.min(kt/200,1),hr=Ce(Gt);Be=t.y.number(Me,oe,hr),Gt<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 Fc(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 ci{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 Xi(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},Gt={},hr={},Ar=Ce.touches,Lr=Ar?this._getMapTouches(Ar):void 0,en=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(hr,bt,tt)?vt.reset():vt[Be||Ce.type]&&(zt=vt[Be||Ce.type](Ce,en,Lr),this.mergeHandlerResult(kt,Gt,zt,tt,_t),zt&&zt.needsRenderFrame&&this._triggerRenderFrame()),(zt||vt.isActive())&&(hr[tt]=vt)}const xn={};for(const tt in this._previousActiveHandlers)hr[tt]||(xn[tt]=_t);this._previousActiveHandlers=hr,(Object.keys(xn).length||Xi(kt))&&(this._changes.push([kt,Gt,xn]),this._triggerRenderFrame()),(Object.keys(hr).length||Xi(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 Gt=new ti;this._add("tapDragZoom",Gt);const hr=oe.touchPitch=new jh(oe);this._add("touchPitch",hr),P.interactive&&P.touchPitch&&oe.touchPitch.enable(P.touchPitch);const Ar=fc(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 en=(({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 ci(Me,en,xn),this._add("mousePan",en),this._add("touchPan",xn,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&oe.dragPan.enable(P.dragPan);const Ze=new Vf,tt=new wc;oe.touchZoomRotate=new Ha(Me,tt,Ze,Gt),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 au(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(!(Xi(P)||_t&&this._terrainMovement))return this._fireEvents(oe,Me,!0);let{panDelta:kt,zoomDelta:Gt,bearingDelta:hr,pitchDelta:Ar,around:Lr,pinchAround:en}=P;en!==void 0&&(Lr=en),Ce._stop(!0),Lr=Lr||Ce.transform.centerPoint;const xn=Be.pointLocation(kt?Lr.sub(kt):Lr);hr&&(Be.bearing+=hr),Ar&&(Be.pitch+=Ar),Gt&&(Be.zoom+=Gt),_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:en}=P[Lr];this._eventsInProgress[Lr]||(_t[`${Lr}start`]=en),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:en}=P[Lr];this._fireEvent(Lr,en)}const kt={};let Gt;for(const Lr in this._eventsInProgress){const{handlerName:en,originalEvent:xn}=this._eventsInProgress[Lr];this._handlersById[en].isActive()||(delete this._eventsInProgress[Lr],Gt=oe[en]||xn,kt[`${Lr}end`]=Gt)}for(const Lr in kt)this._fireEvent(Lr,kt[Lr]);const hr=Qa(this._eventsInProgress),Ar=(Ce||Be)&&!hr;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),en=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,hr,Pr)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,Pr)),this._padding&&(Ce.interpolatePadding(Gt,Lr,Pr),xn=Ce.centerPoint.add(en)),this.terrain&&!P.freezeElevation&&this._updateElevation(Pr),Ut)Ce.setLocationAtPoint(Ut,gr);else{const Yr=Ce.zoomScale(Ce.zoom-Be),on=vt>Be?Math.min(2,Et):Math.max(.5,Et),En=Math.pow(on,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:Gt,bearing:hr,elevation:Ar}=Ce(Be);_t&&(Be.center=_t),kt!==void 0&&(Be.zoom=kt),Gt!==void 0&&(Be.pitch=Gt),hr!==void 0&&(Be.bearing=hr),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,Gt=Ce.padding,hr="bearing"in P?this._normalizeBearing(P.bearing,_t):_t,Ar="pitch"in P?+P.pitch:kt,Lr="padding"in P?P.padding:Ce.padding,en=t.P.convert(P.offset);let xn=Ce.centerPoint.add(en);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),Wi=gr/Ce.zoomScale(ni-Be);Ut=Math.sqrt(Wi/Pr*2)}const Yr=Ut*Ut;function on(ni){const Wi=(Tr*Tr-gr*gr+(ni?-1:1)*Yr*Yr*Pr*Pr)/(2*(ni?Tr:gr)*Yr*Pr);return Math.log(Math.sqrt(Wi*Wi+1)-Wi)}function En(ni){return(Math.exp(ni)-Math.exp(-ni))/2}function Pn(ni){return(Math.exp(ni)+Math.exp(-ni))/2}const Xn=on(!1);let Ta=function(ni){return Pn(Xn)/Pn(Xn+Ut*ni)},ri=function(ni){return gr*((Pn(Xn)*(En(Wi=Xn+Ut*ni)/Pn(Wi))-En(Xn))/Yr)/Pr;var Wi},Wa=(on(!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=Wi=>Math.exp(ni*Ut*Wi)}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!==hr,this._pitching=Ar!==kt,this._padding=!Ce.isPaddingEqual(Lr),this._prepareEase(oe,!1),this.terrain&&this._prepareElevation(tt),this._ease(ni=>{const Wi=ni*Wa,To=1/Ta(Wi);Ce.zoom=ni===1?vt:Be+Ce.scaleZoom(To),this._rotating&&(Ce.bearing=t.y.number(_t,hr,ni)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,ni)),this._padding&&(Ce.interpolatePadding(Gt,Lr,ni),xn=Ce.centerPoint.add(en)),this.terrain&&!P.freezeElevation&&this._updateElevation(ni);const ho=ni===1?tt:Ce.unproject(zt.add(Et.mult(ri(Wi))).mult(To));Ce.setLocationAtPoint(Ce.renderWorldCopies?ho.wrap():ho,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 Zi{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),Gt=Ce.canonical.y-(Ce.canonical.y>>_t<<_t),hr=t.X>>_t;t.aP(Be.posMatrix,0,hr,0,hr,0,1),t.J(Be.posMatrix,Be.posMatrix,[-kt*hr,-Gt*hr,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),Gt=P.canonical.y-(P.canonical.y>>_t<<_t),hr=t.X>>_t;t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),t.J(Be.posMatrix,Be.posMatrix,[kt*hr,Gt*hr,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 Gt=oe[0]+(oe[2]>>4<<8),hr=oe[1]+((15&oe[2])<<8),Ar=this.coordsIndex[255-oe[3]],Lr=Ar&&this.sourceCache.getTileByID(Ar);if(!Lr)return null;const en=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 hr=this.pool.getObjectForId(kt.rtt[Be].id);if(hr.stamp===kt.rtt[Be].stamp){this.pool.useObject(hr);continue}}const Gt=this.pool.getOrCreateFreeObject();this.pool.useObject(Gt),this.pool.stampObject(Gt),kt.rtt[Be]={id:Gt.id,stamp:Gt.stamp},Me.context.bindFramebuffer.set(Gt.fbo.framebuffer),Me.context.clear({color:t.aM.transparent,stencil:0}),Me.currentStencilSource=void 0;for(let hr=0;hr<_t.length;hr++){const Ar=Me.style._layers[_t[hr]],Lr=Ar.source?this._coordsDescendingInv[Ar.source][kt.tileID.key]:[kt.tileID];Me.context.viewport.set([0,0,Gt.fbo.width,Gt.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},Vl=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=fc({clickTolerance:Ce,enable:!0}),this.touchRotate=(({enable:_t,clickTolerance:kt,bearingDegreesPerPixelMoved:Gt=.8})=>{const hr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({bearingDelta:(Lr.x-Ar.x)*Gt}),moveStateManager:hr,enable:_t,assignEvents:Vl})})({clickTolerance:Ce,enable:!0}),this.map=P,Me&&(this.mousePitch=$h({clickTolerance:Be,enable:!0}),this.touchPitch=(({enable:_t,clickTolerance:kt,pitchDegreesPerPixelMoved:Gt=-.5})=>{const hr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({pitchDelta:(Lr.y-Ar.y)*Gt}),moveStateManager:hr,enable:_t,assignEvents:Vl})})({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 Dl;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 gc={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 yc(Ue,P,oe){const Me=Ue.classList;for(const Ce in gc)Me.remove(`maplibregl-${oe}-anchor-${Ce}`);Me.add(`maplibregl-${oe}-anchor-${P}`)}class Tc 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,`${gc[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 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 bt 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",bt.rx),zt.setAttributeNS(null,"ry",bt.ry),kt.appendChild(zt)}const hr=a.createNS("http://www.w3.org/2000/svg","g");hr.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"),hr.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 en=a.createNS("http://www.w3.org/2000/svg","path");en.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(en);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(hr),_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()}),yc(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,Gt=Math.sin(Ce.getPitch()*Math.PI/180)*kt,hr=Ce.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Ar=Ce.transform.lngLatToCameraDepth(this._lngLat,_t+Gt)-hr>.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 _c=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 Gt=3.2808*kt;Gt>5280?Xo(P,Me,Gt/5280,Ue._getUIString("ScaleControl.Miles")):Xo(P,Me,Gt,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(Gt){const hr=Math.pow(10,Math.ceil(-Math.log(Gt)/Math.LN10));return Math.round(Gt*hr)/hr})(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 Bc=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=ci,e.DragRotateHandler=Ni,e.EdgeInsets=mc,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 Tc({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Tc({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(Dl!==void 0&&!P)return Dl;if(window.navigator.permissions===void 0)return Dl=!!window.navigator.geolocation,Dl;try{Dl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Dl=!!window.navigator.geolocation}return Dl})})().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,_c=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":_c--,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"),_c++,_c>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=Zi,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 Zi,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 Gt=this._getClampedPixelRatio(Me,Ce);this._resizeCanvas(Me,Ce,Gt),this.painter.resize(Me,Ce,Gt)}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(Gt=>this.getLayer(Gt)),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(Gt=>this.getLayer(Gt));(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:Gt,textFitHeight:hr}=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:en}=P,xn=P;return this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},new Uint8Array(en)),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Gt,textFitHeight:hr,sdf:Ce,version:0,userImage:xn}),xn.onAdd&&xn.onAdd(this,Ue),this}}{const{width:Ar,height:Lr,data:en}=i.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},en),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Gt,textFitHeight:hr,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=Tc,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,Gt=this._container.offsetHeight;let hr;hr=Me.y+Be.bottom.ythis._map.transform.height-Gt?["bottom"]:[],Me.xthis._map.transform.width-kt/2&&hr.push("right"),Ce=hr.length===0?"bottom":hr.join("-")}let _t=Me.add(Be[Ce]);this.options.subpixelPositioning||(_t=_t.round()),a.setTransform(this._container,`${gc[Ce]} translate(${_t.x}px,${_t.y}px)`),yc(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=wc,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 lt().getRTLTextPluginStatus()},e.getVersion=function(){return Bc},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 lt().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){fe.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=h;return E})}}),M7=Ge({"src/plots/map/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=CL(),E=q_();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}}}),E7=Ge({"src/plots/map/map.js"(K,G){var h=S7(),b=_n(),S=B_(),E=Ro(),e=Ts(),t=lv(),r=Yf(),o=Up(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=q_(),v=M7();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}}}),I7=Ge({"src/traces/choroplethmap/index.js"(K,G){G.exports={attributes:LL(),supplyDefaults:P7(),colorbar:Am(),calc:CE(),plot:R7(),hoverPoints:PE(),eventData:RE(),selectPoints:IE(),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}}}),N7=Ge({"src/traces/densitymap/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]}}}}),U7=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}}}),j7=Ge({"src/traces/densitymap/index.js"(K,G){G.exports={attributes:RL(),supplyDefaults:z7(),colorbar:Am(),formatLabels:kL(),calc:O7(),plot:B7(),hoverPoints:N7(),eventData:U7(),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})}}}),G7=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})})}}),Z7=Ge({"node_modules/d3-force/dist/d3-force.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,G7(),KE(),X7(),Y7()):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})})}}),zL=Ge({"node_modules/d3-shape/dist/d3-shape.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,W7()):(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,un,Rn,qn,jn,cn){var In=zr-At,gi=un-lr,Ea=jn-Rn,Ci=cn-qn,Hi=Ci*In-Ea*gi;if(!(Hi*Hill*ll+kl*kl&&(Vs=fs,sl=Zo),{cx:Vs,cy:sl,x01:-Ea,y01:-Ci,x11:Vs*(Rn/Jo-1),y11:sl*(Rn/Jo-1)}}function w(){var At=T,lr=l,zr=S(0),un=null,Rn=g,qn=x,jn=A,cn=null;function In(){var gi,Ea,Ci=+At.apply(this,arguments),Hi=+lr.apply(this,arguments),so=Rn.apply(this,arguments)-f,io=qn.apply(this,arguments)-f,Mo=E(io-so),fi=io>so;if(cn||(cn=gi=b.path()),Hia))cn.moveTo(0,0);else if(Mo>c-a)cn.moveTo(Hi*t(so),Hi*n(so)),cn.arc(0,0,Hi,so,io,!fi),Ci>a&&(cn.moveTo(Ci*t(io),Ci*n(io)),cn.arc(0,0,Ci,io,so,fi));else{var ts=so,Ho=io,Xs=so,cs=io,Jo=Mo,Uo=Mo,Ys=jn.apply(this,arguments)/2,Vs=Ys>a&&(un?+un.apply(this,arguments):i(Ci*Ci+Hi*Hi)),sl=o(E(Hi-Ci)/2,+zr.apply(this,arguments)),fs=sl,Zo=sl,vo,hs;if(Vs>a){var ll=v(Vs/Ci*n(Ys)),kl=v(Vs/Hi*n(Ys));(Jo-=ll*2)>a?(ll*=fi?1:-1,Xs+=ll,cs-=ll):(Jo=0,Xs=cs=(so+io)/2),(Uo-=kl*2)>a?(kl*=fi?1:-1,ts+=kl,Ho-=kl):(Uo=0,ts=Ho=(so+io)/2)}var Pl=Hi*t(ts),Ms=Hi*n(ts),di=Ci*t(cs),to=Ci*n(cs);if(sl>a){var Cl=Hi*t(Ho),Ps=Hi*n(Ho),Fo=Ci*t(Xs),Rl=Ci*n(Xs),Zs;if(Moa?Zo>a?(vo=_(Fo,Rl,Pl,Ms,Hi,Zo,fi),hs=_(Cl,Ps,di,to,Hi,Zo,fi),cn.moveTo(vo.cx+vo.x01,vo.cy+vo.y01),Zoa)||!(Jo>a)?cn.lineTo(di,to):fs>a?(vo=_(di,to,Cl,Ps,Ci,-fs,fi),hs=_(Pl,Ms,Fo,Rl,Ci,-fs,fi),cn.lineTo(vo.cx+vo.x01,vo.cy+vo.y01),fs=Hi;--so)cn.point(Ho[so],Xs[so]);cn.lineEnd(),cn.areaEnd()}fi&&(Ho[Ci]=+At(Mo,Ci,Ea),Xs[Ci]=+zr(Mo,Ci,Ea),cn.point(lr?+lr(Mo,Ci,Ea):Ho[Ci],un?+un(Mo,Ci,Ea):Xs[Ci]))}if(ts)return cn=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),un=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?(un=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):un},In.lineX0=In.lineY0=function(){return gi().x(At).y(zr)},In.lineY1=function(){return gi().x(At).y(un)},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&&(cn=jn(qn)),In):jn},In.context=function(Ea){return arguments.length?(Ea==null?qn=cn=null:cn=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,un=S(0),Rn=S(c),qn=S(0);function jn(cn){var In,gi=cn.length,Ea,Ci,Hi=0,so=new Array(gi),io=new Array(gi),Mo=+un.apply(this,arguments),fi=Math.min(c,Math.max(-c,Rn.apply(this,arguments)-Mo)),ts,Ho=Math.min(Math.abs(fi)/gi,qn.apply(this,arguments)),Xs=Ho*(fi<0?-1:1),cs;for(In=0;In0&&(Hi+=cs);for(lr!=null?so.sort(function(Jo,Uo){return lr(io[Jo],io[Uo])}):zr!=null&&so.sort(function(Jo,Uo){return zr(cn[Jo],cn[Uo])}),In=0,Ci=Hi?(fi-gi*Xs)/Hi:0;In0?cs*Ci:0)+Xs,io[Ea]={data:cn[Ea],index:In,value:cs,startAngle:Mo,endAngle:ts,padAngle:Ho};return io}return jn.value=function(cn){return arguments.length?(At=typeof cn=="function"?cn:S(+cn),jn):At},jn.sortValues=function(cn){return arguments.length?(lr=cn,zr=null,jn):lr},jn.sort=function(cn){return arguments.length?(zr=cn,lr=null,jn):zr},jn.startAngle=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),jn):un},jn.endAngle=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),jn):Rn},jn.padAngle=function(cn){return arguments.length?(qn=typeof cn=="function"?cn:S(+cn),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,un=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(un())},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,un=d,Rn=y,qn=null;function jn(){var cn,In=le.call(arguments),gi=lr.apply(this,In),Ea=zr.apply(this,In);if(qn||(qn=cn=b.path()),At(qn,+un.apply(this,(In[0]=gi,In)),+Rn.apply(this,In),+un.apply(this,(In[0]=Ea,In)),+Rn.apply(this,In)),cn)return qn=null,cn+""||null}return jn.source=function(cn){return arguments.length?(lr=cn,jn):lr},jn.target=function(cn){return arguments.length?(zr=cn,jn):zr},jn.x=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),jn):un},jn.y=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),jn):Rn},jn.context=function(cn){return arguments.length?(qn=cn??null,jn):qn},jn}function ne(At,lr,zr,un,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr=(lr+un)/2,zr,lr,Rn,un,Rn)}function $(At,lr,zr,un,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr,zr=(zr+Rn)/2,un,zr,un,Rn)}function ue(At,lr,zr,un,Rn){var qn=fe(lr,zr),jn=fe(lr,zr=(zr+Rn)/2),cn=fe(un,zr),In=fe(un,Rn);At.moveTo(qn[0],qn[1]),At.bezierCurveTo(jn[0],jn[1],cn[0],cn[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),un=zr*Se;At.moveTo(0,-zr),At.lineTo(un,0),At.lineTo(0,zr),At.lineTo(-un,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),un=st*zr,Rn=ct*zr;At.moveTo(0,-zr),At.lineTo(un,Rn);for(var qn=1;qn<5;++qn){var jn=c*qn/5,cn=Math.cos(jn),In=Math.sin(jn);At.lineTo(In*zr,-cn*zr),At.lineTo(cn*un-In*Rn,In*un+cn*Rn)}At.closePath()}},et={draw:function(At,lr){var zr=Math.sqrt(lr),un=-zr/2;At.rect(un,un,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,lt=1/Math.sqrt(12),dt=(lt/2+1)*3,nt={draw:function(At,lr){var zr=Math.sqrt(lr/dt),un=zr/2,Rn=zr*lt,qn=un,jn=zr*lt+zr,cn=-qn,In=jn;At.moveTo(un,Rn),At.lineTo(qn,jn),At.lineTo(cn,In),At.lineTo(pe*un-Ne*Rn,Ne*un+pe*Rn),At.lineTo(pe*qn-Ne*jn,Ne*qn+pe*jn),At.lineTo(pe*cn-Ne*In,Ne*cn+pe*In),At.lineTo(pe*un+Ne*Rn,pe*Rn-Ne*un),At.lineTo(pe*qn+Ne*jn,pe*jn-Ne*qn),At.lineTo(pe*cn+Ne*In,pe*In-Ne*cn),At.closePath()}},Ft=[ie,de,Fe,et,at,Ae,nt];function Nt(){var At=S(ie),lr=S(64),zr=null;function un(){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 un.type=function(Rn){return arguments.length?(At=typeof Rn=="function"?Rn:S(Rn),un):At},un.size=function(Rn){return arguments.length?(lr=typeof Rn=="function"?Rn:S(+Rn),un):lr},un.context=function(Rn){return arguments.length?(zr=Rn??null,un):zr},un}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 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: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 Mr(At){return new Er(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 Nr(At){this._context=At}Nr.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,un=(this._y0+4*this._y1+lr)/6;this._line?this._context.lineTo(zr,un):this._context.moveTo(zr,un);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 Nr(At)}function je(At,lr){this._basis=new Er(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 un=At[0],Rn=lr[0],qn=At[zr]-un,jn=lr[zr]-Rn,cn=-1,In;++cn<=zr;)In=cn/zr,this._basis.point(this._beta*At[cn]+(1-this._beta)*(un+In*qn),this._beta*lr[cn]+(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(un){return lr===1?new Er(un):new je(un,lr)}return zr.beta=function(un){return At(+un)},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(un){return new xe(un,lr)}return zr.tension=function(un){return At(+un)},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(un){return new Ee(un,lr)}return zr.tension=function(un){return At(+un)},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(un){return new Qe(un,lr)}return zr.tension=function(un){return At(+un)},zr})(0);function Ct(At,lr,zr){var un=At._x1,Rn=At._y1,qn=At._x2,jn=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 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(un,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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+un*un,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(un){return lr?new Ot(un,lr):new xe(un,0)}return zr.alpha=function(un){return At(+un)},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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+un*un,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(un){return lr?new xr(un,lr):new Ee(un,0)}return zr.alpha=function(un){return At(+un)},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,un=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+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,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 Br=(function At(lr){function zr(un){return lr?new vr(un,lr):new Qe(un,0)}return zr.alpha=function(un){return At(+un)},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 Wn(At){return new kn(At)}function Vn(At){return At<0?-1:1}function na(At,lr,zr){var un=At._x1-At._x0,Rn=lr-At._x1,qn=(At._y1-At._y0)/(un||Rn<0&&-0),jn=(zr-At._y1)/(Rn||un<0&&-0),cn=(qn*Rn+jn*un)/(un+Rn);return(Vn(qn)+Vn(jn))*Math.min(Math.abs(qn),Math.abs(jn),.5*Math.abs(cn))||0}function aa(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 un=At._x0,Rn=At._y0,qn=At._x1,jn=At._y1,cn=(qn-un)/3;At._context.bezierCurveTo(un+cn,Rn+cn*lr,qn-cn,jn-cn*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,aa(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,aa(this,zr=na(this,At,lr)),zr);break;default:Un(this,this._t0,zr=na(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,un,Rn,qn){this._context.bezierCurveTo(lr,At,un,zr,qn,Rn)}};function qt(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 un=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 Tn(At){return new mn(At,.5)}function Jn(At){return new mn(At,0)}function ma(At){return new mn(At,1)}function da(At,lr){if((jn=At.length)>1)for(var zr=1,un,Rn,qn=At[lr[0]],jn,cn=qn.length;zr=0;)zr[lr]=lr;return zr}function Ca(At,lr){return At[lr]}function Hn(){var At=S([]),lr=_a,zr=da,un=Ca;function Rn(qn){var jn=At.apply(this,arguments),cn,In=qn.length,gi=jn.length,Ea=new Array(gi),Ci;for(cn=0;cn0){for(var zr,un,Rn=0,qn=At[0].length,jn;Rn0)for(var zr,un=0,Rn,qn,jn,cn,In,gi=At[lr[0]].length;un0?(Rn[0]=jn,Rn[1]=jn+=qn):qn<0?(Rn[1]=cn,Rn[0]=cn+=qn):(Rn[0]=0,Rn[1]=qn)}function Dt(At,lr){if((Rn=At.length)>0){for(var zr=0,un=At[lr[0]],Rn,qn=un.length;zr0)||!((qn=(Rn=At[lr[0]]).length)>0))){for(var zr=0,un=1,Rn,qn,jn;unqn&&(qn=Rn,zr=lr);return zr}function Vr(At){var lr=At.map(Dr);return _a(At).sort(function(zr,un){return lr[zr]-lr[un]})}function Dr(At){for(var lr=0,zr=-1,un=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})})}}),K7=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"(K,G){var h=DL();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 Er(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 Mr(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)Br=vr.y1-vr.y0,vr.y0=ct/2-Br/2,vr.y1=ct/2+Br/2;else if(mr==Ot-1&&xr==1)Br=vr.y1-vr.y0,vr.y0=ct/2-Br/2,vr.y1=ct/2+Br/2;else{var kn=0,Wn=b.mean(vr.sourceLinks,g),Vn=b.mean(vr.targetLinks,l);Wn&&Vn?kn=(Wn+Vn)/2:kn=Wn||Vn;var na=(kn-T(vr))*Lt;vr.y0+=na,vr.y1+=na}})})}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 Nr(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,lt=pe.circularLinkType,dt=ze.links.filter(function(Nt){return Nt.source.column==Ne&&Nt.circularLinkType==lt});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==lt}),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 lt=Ae/(pe+1),dt=Math.pow(1-lt,3),nt=3*lt*Math.pow(1-lt,2),Ft=3*Math.pow(lt,2)*(1-lt),Nt=Math.pow(lt,3),Qt=dt*at.y0+nt*at.y0+Ft*at.y1+Nt*at.y1,ar=Qt-at.width/2,Er=Qt+at.width/2,Mr;ar>Ne.y0&&arNe.y0&&ErNe.y1&&H($r,Mr,Ye,st)})):arNe.y1&&(Mr=Er-Ne.y0+10,Ne=H(Ne,Mr,Ye,st),ze.nodes.forEach(function($r){w($r,ct)==w(Ne,ct)||$r.column!=Ne.column||$r.y0Ne.y1&&H($r,Mr,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 lt=$(Ne,pe);return pe.y1-lt}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 lt=Ne+1,dt=0;for(lt;lt1&&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,lt=st-Ye,dt=lt/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})})}}),OL=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"}}}}),Q7=Ge({"src/traces/sankey/render.js"(K,G){var h=Z7(),b=(ao(),ui(xi)).interpolateNumber,S=ki(),E=$7(),e=J7(),t=OL(),r=Is(),o=go(),n=As(),i=_n(),a=i.strTranslate,s=i.strRotate,f=Og(),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-Nr.y0,Mt>1e-6&&(Nr.y0+=Mt,Nr.y1+=Mt)),je=Nr.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}),Nr=[],Mt=-1,je,Je=-1/0,ke;for(Pe=0;PeJe+Se&&(Mt+=1,je=xe.x0),Je=xe.x0,Nr[Mt]||(Nr[Mt]=[]),Nr[Mt].push(xe),ke=je-xe.x0,xe.x0+=ke,xe.x1+=ke}return Nr}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}})}}}),e9=Ge({"src/traces/sankey/base_plot.js"(K){var G=Hc().overrideAll,h=Bd().getModuleCalcData,b=FL(),S=tc(),E=Np(),e=lv(),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,lt=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-lt-dt.bottom}else Ne=$.t+$.h/2-H/2-dt.bottom-lt;ee&&(Ne=de-(dt.top+dt.bottom)/2,pe=$.l-i.bulletPadding*$.w)}else Ne=fe._numbersTop-lt-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 lt=R.gauge.threshold.value;(lt||lt===0)&&et.push({range:[lt,lt],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 lt=te(R.number.valueformat,ct,N[0].lastY,N[0].y);return function(dt){pe.text(et+lt(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 lt(){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(){lt(),le&&le()}).each("interrupt",function(){lt(),le&&le()}):lt(),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}}}),l9=Ge({"src/traces/indicator/index.js"(K,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:a9(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:BL(),supplyDefaults:i9().supplyDefaults,calc:o9().calc,plot:s9(),meta:{}}}}),u9=Ge({"lib/indicator.js"(K,G){G.exports=l9()}}),UL=Ge({"src/traces/table/attributes.js"(K,G){var h=hm(),b=Ki().extendFlat,S=Hc().overrideAll,E=Ns(),e=kc().attributes,t=pc().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")}}),c9=Ge({"src/traces/table/defaults.js"(K,G){var h=_n(),b=UL(),S=kc().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"}}}}),h9=Ge({"src/traces/table/data_preparation_helper.js"(K,G){var h=jL(),b=Ki().extendFlat,S=Si(),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:[]}}}}),d9=Ge({"src/traces/table/data_split_helpers.js"(K){var G=Ki().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]}}}),qL=Ge({"src/traces/table/plot.js"(K,G){var h=jL(),b=ki(),S=_n(),E=S.numberFormat,e=Og(),t=As(),r=nc(),o=_n().raiseToTop,n=_n().strTranslate,i=_n().cancelTransition,a=h9(),s=d9(),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(Er){return(nt===Er?b.event.x:Er.x)+Er.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(Er){return Er.calcdata.key===nt.calcdata.key}),ar=Qt.sort(function(Er,Mr){return Nt(Er)-Nt(Mr)});ar.forEach(function(Er,Mr){Er.xIndex=Mr,Er.x=nt===Er?Er.x:Er.xScale(Er)}),ct.filter(function(Er){return nt!==Er}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(Er){return n(Er.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 lt=ct.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);lt.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),lt.attr("id",function(nt){return v(ie,nt)});var dt=lt.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,lt;Le.wrappingNeeded=!Le.wrapped&&!at&&!et&&(lt=L(Ne)),Le.cellHeightMayIncrease=ct||et||Le.mayHaveMarkup||(lt===void 0?L(Ne):lt),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,lt){Ye[lt].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(),lt=b.select(Ae.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),dt=Ae.transform.baseVal.consolidate(),nt=lt.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}}}}),T9=Ge({"src/traces/carpet/plot.js"(K,G){var h=ki(),b=As(),S=VL(),E=HL(),e=w9(),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()}}}),A9=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}))}}}}),E9=Ge({"src/traces/carpet/calc_labels.js"(K,G){var h=Ts(),b=Ki().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}}}),C9=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}}}),L9=Ge({"src/traces/carpet/constants.js"(K,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),P9=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)]]}}}),R9=Ge({"src/traces/carpet/compute_control_points.js"(K,G){var h=P9(),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}}}}),F9=Ge({"src/traces/carpet/calc.js"(K,G){var h=Ts(),b=_n().isArray1D,S=A9(),E=S9(),e=M9(),t=E9(),r=k9(),o=jx(),n=C9(),i=Ux(),a=O9();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]}}}),B9=Ge({"src/traces/carpet/index.js"(K,G){G.exports={attributes:JE(),supplyDefaults:b9(),plot:T9(),calc:F9(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:_h(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),N9=Ge({"lib/carpet.js"(K,G){G.exports=B9()}}),GL=Ge({"src/traces/scattercarpet/attributes.js"(K,G){var h=uv(),b=Gc(),S=Gl(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=zu(),o=Ki().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}}}),U9=Ge({"src/traces/scattercarpet/defaults.js"(K,G){var h=_n(),b=u0(),S=uu(),E=Kd(),e=Vp(),t=Jd(),r=op(),o=Nd(),n=GL();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}}}),G9=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}}}),X9=Ge({"src/traces/scattercarpet/index.js"(K,G){G.exports={attributes:GL(),supplyDefaults:U9(),colorbar:Zf(),formatLabels:j9(),calc:q9(),plot:V9(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:H9(),selectPoints:lg(),eventData:G9(),moduleType:"trace",name:"scattercarpet",basePlotModule:_h(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Y9=Ge({"lib/scattercarpet.js"(K,G){G.exports=X9()}}),XL=Ge({"src/traces/contourcarpet/attributes.js"(K,G){var h=bd(),b=W1(),S=zu(),E=Ki().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}))}}),YL=Ge({"src/traces/contourcarpet/defaults.js"(K,G){var h=_n(),b=bh(),S=XL(),E=B2(),e=tb(),t=$1();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")}}}),Z9=Ge({"src/traces/contourcarpet/calc.js"(K,G){var h=_d(),b=_n(),S=Ux(),E=jx(),e=qx(),t=Vx(),r=L2(),o=YL(),n=QE(),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]}}}),W9=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}}}),KL=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]),lt=ee.radius=ct/Fe,dt=ee.innerRadius=ee.getHole(V)*lt,nt=ee.cx=pe-lt*Le[0],Ft=ee.cy=Ne+lt*Le[3],Nt=ee.cxx=nt-pe,Qt=ee.cyy=Ft-Ne,ar=ue.side,Er;ar==="counterclockwise"?(Er=ar,ar="top"):ar==="clockwise"&&(Er=ar,ar="bottom"),ee.radialAxis=ee.mockAxis(ce,V,ue,{_id:"x",side:ar,_trueSide:Er,domain:[dt/$.w,lt/$.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 Mr=ee.pathSubplot();ee.clipPaths.forTraces.select("path").attr("d",Mr).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",Mr).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(lt){var dt=z(ee,y([lt.x,0]));return t(dt[0]-H,dt[1]-ae)}:function(lt){return t(Se.l2p(lt.x)+te,0)},Ye=Fe?function(lt){return L(ee,lt.x,-1/0,1/0)}:function(lt){return ee.pathArc(Se.r2p(lt.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(lt){return lt>=0}).map(function(lt){return i.tickText(Se,lt,!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,lt=(de.linewidth||1)/2;i.drawTicks(ne,de,{vals:Ae,layer:$["angular-axis"],path:"M"+Ne*lt+",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,lt=c.makeDragger($,"path","maindrag",ce.dragmode===!1?"none":"crosshair");h.select(lt).attr("d",V.pathSubplot()).attr("transform",t(de,Se)),lt.onmousemove=function(mr){v.hover(ne,mr,V.id),ne._fullLayout._lasthover=lt,ne._fullLayout._hoversubplot=V.id},lt.onmouseout=function(mr){ne._dragging||p.unhover(ne,mr)};var dt={element:lt,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,Er,Mr,$r,Sr;function Nr(mr,vr){return Math.sqrt(mr*mr+vr*vr)}function Mt(mr,vr){return Nr(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 Br=Ae/mr,kn=vr-Br,Wn=vr+Br,Vn=Math.max(0,Math.min(mr,ae)),na=Vn-Pe,aa=Vn+Pe;return"M"+Je(na,kn)+"A"+[na,na]+" 0,0,0 "+Je(na,Wn)+"L"+Je(aa,Wn)+"A"+[aa,aa]+" 0,0,1 "+Je(aa,kn)+"Z"}function xe(mr,vr,Br){if(mr===0)return V.pathSector(2*Pe);var kn=Je(mr,vr),Wn=Je(mr,Br),Vn=ct((kn[0]+Wn[0])/2),na=ct((kn[1]+Wn[1])/2),aa,Un;if(Vn&&na){var ka=na/Vn,Va=-1/ka,sr=at(Pe,ka,Vn,na);aa=at(Ae,Va,sr[0][0],sr[0][1]),Un=at(Ae,Va,sr[1][0],sr[1][1])}else{var qt,or;na?(qt=Ae,or=Pe):(qt=Pe,or=Ae),aa=[[Vn-qt,na-or],[Vn+qt,na-or]],Un=[[Vn-qt,na+or],[Vn+qt,na+or]]}return"M"+aa.join("L")+"L"+Un.reverse().join("L")+"Z"}function ye(){Nt=null,Qt=null,ar=V.pathSubplot(),Er=!1;var mr=ne._fullLayout[V.id];Mr=b(mr.bgcolor).getLuminance(),$r=c.makeZoombox(ue,Mr,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),Br.indexOf("event")>-1&&v.click(ne,vr,V.id)}dt.prepFn=function(mr,vr,Br){var kn=ne._fullLayout.dragmode,Wn=lt.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var Vn=ne._fullLayout._invTransform;pe=ne._fullLayout._invScaleX,Ne=ne._fullLayout._invScaleY;var na=E.apply3DTransform(Vn)(vr-Wn.left,Br-Wn.top);if(nt=na[0],Ft=na[1],Ye){var aa=u.findPolygonOffset(ae,ze[0],ze[1],Ye);nt+=Le+aa[0],Ft+=Fe+aa[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,Br,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}}}),r8=Ge({"src/plots/polar/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=kc().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"}}}),lO=Ge({"src/plots/polar/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=tg(),r=z0(),o=Op(),n=Pv(),i=zf(),a=Vu(),s=YT(),f=um(),c=r8(),p=QL(),v=t6(),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}}}),fO=Ge({"src/traces/scatterpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:n6(),categories:["polar","symbols","showLegend","scatter-like"],attributes:uS(),supplyDefaults:a6().supplyDefaults,colorbar:Zf(),formatLabels:i6(),calc:uO(),plot:cO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:o6().hoverPoints,selectPoints:lg(),meta:{}}}}),hO=Ge({"lib/scatterpolar.js"(K,G){G.exports=fO()}}),n8=Ge({"src/traces/scatterpolargl/attributes.js"(K,G){var h=uS(),{cliponaxis:b,hoveron:S}=h,E=eo(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=eS();G.exports=bo(Gi({},E),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),dO=Ge({"src/traces/scatterpolargl/defaults.js"(K,G){var h=_n(),b=uu(),S=a6().handleRThetaDefaults,E=Kd(),e=Vp(),t=op(),r=Nd(),o=u0().PTS_LINESONLY,n=n8();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}}),_O=Ge({"src/traces/scatterpolargl/index.js"(K,G){var h=gO();h.plot=yO(),G.exports=h}}),xO=Ge({"lib/scatterpolargl.js"(K,G){G.exports=_O()}}),a8=Ge({"src/traces/barpolar/attributes.js"(K,G){var{hovertemplateAttrs:h,templatefallbackAttrs:b}=Sl(),S=Ki().extendFlat,E=uS(),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}}}),i8=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"}}}}),bO=Ge({"src/traces/barpolar/defaults.js"(K,G){var h=_n(),b=a6().handleRThetaDefaults,S=h0(),E=a8();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)}}}),wO=Ge({"src/traces/barpolar/layout_defaults.js"(K,G){var h=_n(),b=i8();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)}}}}),AO=Ge({"src/traces/barpolar/hover.js"(K,G){var h=Yf(),b=_n(),S=Cc().getTraceColor,E=b.fillText,e=o6().makeHoverPointText,t=r6().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]}}}}),SO=Ge({"src/traces/barpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:n6(),categories:["polar","bar","showLegend"],attributes:a8(),layoutAttributes:i8(),supplyDefaults:bO(),supplyLayoutDefaults:wO(),calc:o8().calc,crossTraceCalc:o8().crossTraceCalc,plot:TO(),colorbar:Zf(),formatLabels:i6(),style:xd().style,styleOnSelect:xd().styleOnSelect,hoverPoints:AO(),selectPoints:wm(),meta:{}}}}),MO=Ge({"lib/barpolar.js"(K,G){G.exports=SO()}}),s8=Ge({"src/plots/smith/constants.js"(K,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),l8=Ge({"src/plots/smith/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=kc().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"}}}),EO=Ge({"src/plots/smith/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=Pv(),r=Op(),o=Vu(),n=rp(),i=l8(),a=s8(),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}}}),DO=Ge({"src/traces/scattersmith/index.js"(K,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:kO(),categories:["smith","symbols","showLegend","scatter-like"],attributes:u8(),supplyDefaults:CO(),colorbar:Zf(),formatLabels:LO(),calc:PO(),plot:RO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:IO().hoverPoints,selectPoints:lg(),meta:{}}}}),zO=Ge({"lib/scattersmith.js"(K,G){G.exports=DO()}}),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}}),OO=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}})}}),FO=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}}}),BO=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}}),NO=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}}),UO=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}}),jO=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}}),qO=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}}),VO=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}}),HO=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}}),GO=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}}),XO=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}}),YO=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}}),ZO=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}}),WO=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}}),$O=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]}}),KO=Ge({"src/components/calendars/calendars.js"(K,G){G.exports=Vv(),OO(),FO(),BO(),NO(),UO(),jO(),qO(),VO(),HO(),GO(),XO(),YO(),ZO(),WO(),$O()}}),JO=Ge({"src/components/calendars/index.js"(K,G){var h=KO(),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({x:ot.path.map((ut,Xt)=>Xt),y:ot.path.map(ut=>ut.value),type:"scatter",mode:"lines+markers",name:ot.label,line:{color:ot.color,width:2},marker:{color:ot.color,size:4},hovertemplate:"iteration %{x}
f = %{y:.4g}"}));return ra.jsxs("div",{className:"flex flex-col gap-1",children:[ra.jsx("span",{className:"text-sm text-gray-700",children:"f at each iteration"}),ra.jsx("div",{className:"h-40",children:ra.jsx(Ek,{data:Ke,layout:{showlegend:!1,margin:{t:8,r:8,b:32,l:48},font:{size:11},xaxis:{title:{text:"iteration",standoff:4},rangemode:"tozero"},yaxis:{automargin:!0}},config:{displayModeBar:!1,responsive:!0},style:{width:"100%",height:"100%"}})})]})}const r4={scrollZoom:!0,displayModeBar:!0,doubleClick:!1,responsive:!0},n4={x:.02,y:.98,xanchor:"left",yanchor:"top",bgcolor:"rgba(255,255,255,0.8)"},HB="#1B2A4A";function GB({values:we,trajectories:Ke,xRange:ot,yRange:ut,onViewChange:Xt,onClick:$t,surface:cr,arrows:kr}){const tn=ru.useRef(null),[Ur,yn]=ru.useState(void 0),[Mn,ea]=ru.useState(null);xB(()=>tn.current?.el,cr?null:$t);const Bn=we!==null&&"y"in we,Gi=Ke.length>1;if(Bn&&cr){const li=[YB(we),...Ke.flatMap(wo=>a4(wo,!0))],Ge={uirevision:"surface",showlegend:Gi,legend:n4,margin:{t:20,r:20,b:20,l:20},scene:{camera:Ur,aspectmode:"cube",xaxis:{title:{text:"x"},range:[...ot.current]},yaxis:{title:{text:"y"},range:[...ut.current]},zaxis:{title:{text:"f(x, y)"}}}};return ra.jsx("div",{className:"flex-1 min-h-[320px]",onPointerDown:()=>{ea({data:li,layout:Ge}),window.addEventListener("pointerup",()=>setTimeout(()=>ea(null),50),{once:!0})},children:ra.jsx(Ek,{data:Mn?.data??li,layout:Mn?.layout??Ge,onRelayout:wo=>{const vl=wo["scene.camera"];vl&&yn(vl)},config:r4,style:{width:"100%",height:"100%"}},"surface")})}const bo=[];we&&"y"in we?(bo.push(XB(we)),kr&&bo.push(...ZB(we,ot.current,ut.current))):we&&bo.push({x:we.x,y:we.f,type:"scatter",mode:"lines",line:{color:HB,width:2},name:"f(x)",showlegend:!1,hovertemplate:"x = %{x:.4g}
f(x) = %{y:.4g}"}),bo.push(...Ke.flatMap(li=>a4(li,!1,Bn)));const eo={dragmode:"pan",uirevision:"view",showlegend:Gi,legend:n4,margin:{t:40,r:40,b:40,l:40},xaxis:{title:{text:"x"},range:[...ot.current]},yaxis:{title:{text:Bn?"y":"f(x)"},range:[...ut.current]}};return ra.jsx("div",{className:"flex-1 min-h-[320px]",children:ra.jsx(Ek,{ref:tn,data:bo,layout:eo,onRelayout:li=>{const Ge=tn.current?.el?._fullLayout,wo=Ge?.xaxis?.range??[li["xaxis.range[0]"],li["xaxis.range[1]"]],vl=Ge?.yaxis?.range??[li["yaxis.range[0]"],li["yaxis.range[1]"]];(wo[0]!==ot.current[0]||wo[1]!==ot.current[1]||vl[0]!==ut.current[0]||vl[1]!==ut.current[1])&&wo.every(Number.isFinite)&&vl.every(Number.isFinite)&&Xt([wo[0],wo[1]],[vl[0],vl[1]])},config:r4,style:{width:"100%",height:"100%",minWidth:0}},"flat")})}function XB(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 YB(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 a4(we,Ke,ot=!0){const ut=we.path.map(tn=>tn.position[0]),Xt=ot?we.path.map(tn=>tn.position[1]):we.path.map(tn=>tn.value),$t=we.path.map(tn=>tn.value),cr=ot?"x = %{x:.4g}, y = %{y:.4g}
f = %{customdata:.4g}%{fullData.name}":"x = %{x:.4g}
f(x) = %{y:.4g}%{fullData.name}",kr=we.path.length-1;return Ke?[{x:ut,y:Xt,z:$t,type:"scatter3d",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:we.color,width:5},marker:{color:we.color,size:2.5},hoverinfo:"skip"},{x:ut.slice(kr),y:Xt.slice(kr),z:$t.slice(kr),type:"scatter3d",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:we.color,size:6,line:{color:"white",width:1}},hoverinfo:"skip"}]:[{x:ut,y:Xt,customdata:$t,type:"scatter",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:we.color,width:2},marker:{color:we.color,size:7},hovertemplate:cr},{x:ut.slice(kr),y:Xt.slice(kr),customdata:$t.slice(kr),type:"scatter",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:we.color,size:14,line:{color:"white",width:2}},hovertemplate:cr}]}function ZB({arrows:we},[Ke,ot],[ut,Xt]){const $t=Math.sqrt(we.x.length),cr=we.u.map((eo,li)=>Math.hypot((eo??NaN)/(ot-Ke),(we.v[li]??NaN)/(Xt-ut))),kr=cr.filter(eo=>Number.isFinite(eo)&&eo>0).sort((eo,li)=>eo-li),tn=kr[Math.floor(.9*(kr.length-1))]??1,Ur=[],yn=[],Mn=[],ea=[],Bn=[],Gi=[];we.x.forEach((eo,li)=>{const Ge=we.u[li],wo=we.v[li];if(Ge===null||wo===null||!(cr[li]>0))return;const vl=.9*Math.min(1,cr[li]/tn)/(cr[li]*$t),Eo=Ge*vl,ui=wo*vl,mo=we.y[li];Ur.push(eo,eo+Eo,null),yn.push(mo,mo+ui,null),Mn.push(eo+Eo),ea.push(mo+ui),Bn.push(Math.atan2(Eo/(ot-Ke),ui/(Xt-ut))*180/Math.PI),Gi.push([eo,mo,Ge,wo])});const bo="rgba(255, 255, 255, 0.85)";return[{x:Ur,y:yn,type:"scatter",mode:"lines",line:{color:bo,width:1},hoverinfo:"skip",showlegend:!1},{x:Mn,y:ea,customdata:Gi,type:"scatter",mode:"markers",showlegend:!1,marker:{symbol:"triangle-up",size:6,color:bo,angle:Bn,angleref:"up"},hovertemplate:"x = %{customdata[0]:.3g}, y = %{customdata[1]:.3g}
∇f = (%{customdata[2]:.3g}, %{customdata[3]:.3g})"}]}const WB="text-sm text-ink-muted";function pP({editor:we,twoVariables:Ke,onResetStart:ot,onRandomStart:ut,hint:Xt}){const $t=dM(we.algorithm),[cr,kr]=ru.useState(!1),tn=ru.useId(),Ur=$t.params.length>0,yn=Object.keys(we.params).length>0;function Mn(Bn,Gi){we.changeParams({...we.params,[Bn]:Gi})}function ea(Bn){we.changeParams(Object.fromEntries(Object.entries(we.params).filter(([Gi])=>Gi!==Bn)))}return ra.jsxs(ra.Fragment,{children:[ra.jsxs("div",{className:"flex items-center gap-2",children:[ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(uP,{label:"Algorithm",hideLabel:!0,options:hM.map(Bn=>Bn.label),activeOption:$t.label,onChange:Bn=>we.changeAlgorithm(hM.find(Gi=>Gi.label===Bn).id)})}),ra.jsx(PT,{label:`About the ${$t.label} settings`,onClick:()=>kr(!0),disabled:!Ur,children:ra.jsx(sB,{size:16})}),ra.jsx(PT,{label:"Reset the settings to their defaults",onClick:()=>we.changeParams({}),disabled:!yn,children:ra.jsx(cM,{size:16})})]}),ra.jsx(kB,{model:$t,values:we.params,onChange:we.changeParams,inline:!0}),ra.jsx(Uk,{title:`${$t.label} settings`,open:cr,onClose:()=>kr(!1),wide:!0,children:ra.jsx(dP,{model:$t,values:we.params,onChange:Mn,onResetOne:ea,onReset:()=>we.changeParams({})})}),ra.jsxs("div",{className:"flex flex-col gap-2",children:[ra.jsxs("div",{role:"group","aria-labelledby":`${tn}-initial`,className:"flex flex-col gap-1",children:[ra.jsx("span",{id:`${tn}-initial`,className:"text-sm text-gray-700",children:"Initial point"}),ra.jsxs("div",{className:"flex items-center gap-2",children:[ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(wk,{label:"Initial x",hideLabel:!0,prefix:Ke?"x":void 0,value:we.startText[0],onChange:Bn=>we.changeStart(0,Bn),mono:!0})}),Ke&&ra.jsx("div",{className:"min-w-0 flex-1",children:ra.jsx(wk,{label:"Initial y",hideLabel:!0,prefix:"y",value:we.startText[1],onChange:Bn=>we.changeStart(1,Bn),mono:!0})}),ra.jsx(PT,{label:"Random initial point",onClick:ut,children:ra.jsx(iB,{size:16})}),ra.jsx(PT,{label:"Reset the initial point",onClick:ot,children:ra.jsx(cM,{size:16})})]})]}),!we.startValid&&ra.jsx("p",{className:"text-red-600 font-semibold",children:"The initial point must be numbers."}),Xt&&ra.jsx("p",{className:WB,children:Xt})]})]})}function $B(we,Ke){const ot={};return(we[we.length-1]===""?[...we,""]:we).join((ot.padRight?" ":"")+","+(ot.padLeft===!1?"":" ")).trim()}const KB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QB={};function i4(we,Ke){return(QB.jsx?JB:KB).test(we)}const eN=/[ \t\n\f\r]/g;function tN(we){return typeof we=="object"?we.type==="text"?o4(we.value):!1:o4(we)}function o4(we){return we.replace(eN,"")===""}class OT{constructor(Ke,ot,ut){this.normal=ot,this.property=Ke,ut&&(this.space=ut)}}OT.prototype.normal={};OT.prototype.property={};OT.prototype.space=void 0;function mP(we,Ke){const ot={},ut={};for(const Xt of we)Object.assign(ot,Xt.property),Object.assign(ut,Xt.normal);return new OT(ot,ut,Ke)}function kk(we){return we.toLowerCase()}class Ip{constructor(Ke,ot){this.attribute=ot,this.property=Ke}}Ip.prototype.attribute="";Ip.prototype.booleanish=!1;Ip.prototype.boolean=!1;Ip.prototype.commaOrSpaceSeparated=!1;Ip.prototype.commaSeparated=!1;Ip.prototype.defined=!1;Ip.prototype.mustUseProperty=!1;Ip.prototype.number=!1;Ip.prototype.overloadedBoolean=!1;Ip.prototype.property="";Ip.prototype.spaceSeparated=!1;Ip.prototype.space=void 0;let rN=0;const qu=nx(),Zd=nx(),Ck=nx(),Vo=nx(),mh=nx(),zw=nx(),o0=nx();function nx(){return 2**++rN}const Lk=Object.freeze(Object.defineProperty({__proto__:null,boolean:qu,booleanish:Zd,commaOrSpaceSeparated:o0,commaSeparated:zw,number:Vo,overloadedBoolean:Ck,spaceSeparated:mh},Symbol.toStringTag,{value:"Module"})),ok=Object.keys(Lk);class Vk extends Ip{constructor(Ke,ot,ut,Xt){let $t=-1;if(super(Ke,ot),s4(this,"space",Xt),typeof ut=="number")for(;++$t4&&ot.slice(0,4)==="data"&&sN.test(Ke)){if(Ke.charAt(4)==="-"){const $t=Ke.slice(5).replace(l4,cN);ut="data"+$t.charAt(0).toUpperCase()+$t.slice(1)}else{const $t=Ke.slice(4);if(!l4.test($t)){let cr=$t.replace(oN,uN);cr.charAt(0)!=="-"&&(cr="-"+cr),Ke="data"+cr}}Xt=Vk}return new Xt(ut,Ke)}function uN(we){return"-"+we.toLowerCase()}function cN(we){return we.charAt(1).toUpperCase()}const fN=mP([gP,nN,xP,bP,wP],"html"),Hk=mP([gP,aN,xP,bP,wP],"svg");function hN(we){return we.join(" ").trim()}var Rw={},sk,u4;function dN(){if(u4)return sk;u4=1;var we=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ke=/\n/g,ot=/^\s*/,ut=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xt=/^:\s*/,$t=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,cr=/^[;\s]*/,kr=/^\s+|\s+$/g,tn=` +`,Ur="/",yn="*",Mn="",ea="comment",Bn="declaration";function Gi(eo,li){if(typeof eo!="string")throw new TypeError("First argument must be a string");if(!eo)return[];li=li||{};var Ge=1,wo=1;function vl(Si){var Ii=Si.match(Ke);Ii&&(Ge+=Ii.length);var Ti=Si.lastIndexOf(tn);wo=~Ti?Si.length-Ti:wo+Si.length}function Eo(){var Si={line:Ge,column:wo};return function(Ii){return Ii.position=new ui(Si),ki(),Ii}}function ui(Si){this.start=Si,this.end={line:Ge,column:wo},this.source=li.source}ui.prototype.content=eo;function mo(Si){var Ii=new Error(li.source+":"+Ge+":"+wo+": "+Si);if(Ii.reason=Si,Ii.filename=li.source,Ii.line=Ge,Ii.column=wo,Ii.source=eo,!li.silent)throw Ii}function Rs(Si){var Ii=Si.exec(eo);if(Ii){var Ti=Ii[0];return vl(Ti),eo=eo.slice(Ti.length),Ii}}function ki(){Rs(ot)}function $s(Si){var Ii;for(Si=Si||[];Ii=Di();)Ii!==!1&&Si.push(Ii);return Si}function Di(){var Si=Eo();if(!(Ur!=eo.charAt(0)||yn!=eo.charAt(1))){for(var Ii=2;Mn!=eo.charAt(Ii)&&(yn!=eo.charAt(Ii)||Ur!=eo.charAt(Ii+1));)++Ii;if(Ii+=2,Mn===eo.charAt(Ii-1))return mo("End of comment missing");var Ti=eo.slice(2,Ii-2);return wo+=2,vl(Ti),eo=eo.slice(Ii),wo+=2,Si({type:ea,comment:Ti})}}function zo(){var Si=Eo(),Ii=Rs(ut);if(Ii){if(Di(),!Rs(Xt))return mo("property missing ':'");var Ti=Rs($t),So=Si({type:Bn,property:bo(Ii[0].replace(we,Mn)),value:Ti?bo(Ti[0].replace(we,Mn)):Mn});return Rs(cr),So}}function Nl(){var Si=[];$s(Si);for(var Ii;Ii=zo();)Ii!==!1&&(Si.push(Ii),$s(Si));return Si}return ki(),Nl()}function bo(eo){return eo?eo.replace(kr,Mn):Mn}return sk=Gi,sk}var c4;function vN(){if(c4)return Rw;c4=1;var we=Rw&&Rw.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(Rw,"__esModule",{value:!0}),Rw.default=ot;const Ke=we(dN());function ot(ut,Xt){let $t=null;if(!ut||typeof ut!="string")return $t;const cr=(0,Ke.default)(ut),kr=typeof Xt=="function";return cr.forEach(tn=>{if(tn.type!=="declaration")return;const{property:Ur,value:yn}=tn;kr?Xt(Ur,yn,tn):yn&&($t=$t||{},$t[Ur]=yn)}),$t}return Rw}var MT={},f4;function pN(){if(f4)return MT;f4=1,Object.defineProperty(MT,"__esModule",{value:!0}),MT.camelCase=void 0;var we=/^--[a-zA-Z0-9_-]+$/,Ke=/-([a-z])/g,ot=/^[^-]+$/,ut=/^-(webkit|moz|ms|o|khtml)-/,Xt=/^-(ms)-/,$t=function(Ur){return!Ur||ot.test(Ur)||we.test(Ur)},cr=function(Ur,yn){return yn.toUpperCase()},kr=function(Ur,yn){return"".concat(yn,"-")},tn=function(Ur,yn){return yn===void 0&&(yn={}),$t(Ur)?Ur:(Ur=Ur.toLowerCase(),yn.reactCompat?Ur=Ur.replace(Xt,kr):Ur=Ur.replace(ut,kr),Ur.replace(Ke,cr))};return MT.camelCase=tn,MT}var ET,h4;function mN(){if(h4)return ET;h4=1;var we=ET&&ET.__importDefault||function(Xt){return Xt&&Xt.__esModule?Xt:{default:Xt}},Ke=we(vN()),ot=pN();function ut(Xt,$t){var cr={};return!Xt||typeof Xt!="string"||(0,Ke.default)(Xt,function(kr,tn){kr&&tn&&(cr[(0,ot.camelCase)(kr,$t)]=tn)}),cr}return ut.default=ut,ET=ut,ET}var gN=mN();const yN=Nk(gN),TP=AP("end"),Gk=AP("start");function AP(we){return Ke;function Ke(ot){const ut=ot&&ot.position&&ot.position[we]||{};if(typeof ut.line=="number"&&ut.line>0&&typeof ut.column=="number"&&ut.column>0)return{line:ut.line,column:ut.column,offset:typeof ut.offset=="number"&&ut.offset>-1?ut.offset:void 0}}}function _N(we){const Ke=Gk(we),ot=TP(we);if(Ke&&ot)return{start:Ke,end:ot}}function RT(we){return!we||typeof we!="object"?"":"position"in we||"type"in we?d4(we.position):"start"in we||"end"in we?d4(we):"line"in we||"column"in we?Pk(we):""}function Pk(we){return v4(we&&we.line)+":"+v4(we&&we.column)}function d4(we){return Pk(we&&we.start)+"-"+Pk(we&&we.end)}function v4(we){return we&&typeof we=="number"?we:1}class ep extends Error{constructor(Ke,ot,ut){super(),typeof ot=="string"&&(ut=ot,ot=void 0);let Xt="",$t={},cr=!1;if(ot&&("line"in ot&&"column"in ot?$t={place:ot}:"start"in ot&&"end"in ot?$t={place:ot}:"type"in ot?$t={ancestors:[ot],place:ot.position}:$t={...ot}),typeof Ke=="string"?Xt=Ke:!$t.cause&&Ke&&(cr=!0,Xt=Ke.message,$t.cause=Ke),!$t.ruleId&&!$t.source&&typeof ut=="string"){const tn=ut.indexOf(":");tn===-1?$t.ruleId=ut:($t.source=ut.slice(0,tn),$t.ruleId=ut.slice(tn+1))}if(!$t.place&&$t.ancestors&&$t.ancestors){const tn=$t.ancestors[$t.ancestors.length-1];tn&&($t.place=tn.position)}const kr=$t.place&&"start"in $t.place?$t.place.start:$t.place;this.ancestors=$t.ancestors||void 0,this.cause=$t.cause||void 0,this.column=kr?kr.column:void 0,this.fatal=void 0,this.file="",this.message=Xt,this.line=kr?kr.line:void 0,this.name=RT($t.place)||"1:1",this.place=$t.place||void 0,this.reason=this.message,this.ruleId=$t.ruleId||void 0,this.source=$t.source||void 0,this.stack=cr&&$t.cause&&typeof $t.cause.stack=="string"?$t.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 Xk={}.hasOwnProperty,xN=new Map,bN=/[A-Z]/g,wN=new Set(["table","tbody","thead","tfoot","tr"]),TN=new Set(["td","th"]),SP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AN(we,Ke){if(!Ke||Ke.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const ot=Ke.filePath||void 0;let ut;if(Ke.development){if(typeof Ke.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");ut=RN(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");ut=PN(ot,Ke.jsx,Ke.jsxs)}const Xt={Fragment:Ke.Fragment,ancestors:[],components:Ke.components||{},create:ut,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"?Hk:fN,stylePropertyNameCase:Ke.stylePropertyNameCase||"dom",tableCellAlignToStyle:Ke.tableCellAlignToStyle!==!1},$t=MP(Xt,we,void 0);return $t&&typeof $t!="string"?$t:Xt.create(we,Xt.Fragment,{children:$t||void 0},void 0)}function MP(we,Ke,ot){if(Ke.type==="element")return SN(we,Ke,ot);if(Ke.type==="mdxFlowExpression"||Ke.type==="mdxTextExpression")return MN(we,Ke);if(Ke.type==="mdxJsxFlowElement"||Ke.type==="mdxJsxTextElement")return kN(we,Ke,ot);if(Ke.type==="mdxjsEsm")return EN(we,Ke);if(Ke.type==="root")return CN(we,Ke,ot);if(Ke.type==="text")return LN(we,Ke)}function SN(we,Ke,ot){const ut=we.schema;let Xt=ut;Ke.tagName.toLowerCase()==="svg"&&ut.space==="html"&&(Xt=Hk,we.schema=Xt),we.ancestors.push(Ke);const $t=kP(we,Ke.tagName,!1),cr=IN(we,Ke);let kr=Zk(we,Ke);return wN.has(Ke.tagName)&&(kr=kr.filter(function(tn){return typeof tn=="string"?!tN(tn):!0})),EP(we,cr,$t,Ke),Yk(cr,kr),we.ancestors.pop(),we.schema=ut,we.create(Ke,$t,cr,ot)}function MN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater){const ut=Ke.data.estree.body[0];return ut.type,we.evaluater.evaluateExpression(ut.expression)}zT(we,Ke.position)}function EN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater)return we.evaluater.evaluateProgram(Ke.data.estree);zT(we,Ke.position)}function kN(we,Ke,ot){const ut=we.schema;let Xt=ut;Ke.name==="svg"&&ut.space==="html"&&(Xt=Hk,we.schema=Xt),we.ancestors.push(Ke);const $t=Ke.name===null?we.Fragment:kP(we,Ke.name,!0),cr=DN(we,Ke),kr=Zk(we,Ke);return EP(we,cr,$t,Ke),Yk(cr,kr),we.ancestors.pop(),we.schema=ut,we.create(Ke,$t,cr,ot)}function CN(we,Ke,ot){const ut={};return Yk(ut,Zk(we,Ke)),we.create(Ke,we.Fragment,ut,ot)}function LN(we,Ke){return Ke.value}function EP(we,Ke,ot,ut){typeof ot!="string"&&ot!==we.Fragment&&we.passNode&&(Ke.node=ut)}function Yk(we,Ke){if(Ke.length>0){const ot=Ke.length>1?Ke:Ke[0];ot&&(we.children=ot)}}function PN(we,Ke,ot){return ut;function ut(Xt,$t,cr,kr){const Ur=Array.isArray(cr.children)?ot:Ke;return kr?Ur($t,cr,kr):Ur($t,cr)}}function RN(we,Ke){return ot;function ot(ut,Xt,$t,cr){const kr=Array.isArray($t.children),tn=Gk(ut);return Ke(Xt,$t,cr,kr,{columnNumber:tn?tn.column-1:void 0,fileName:we,lineNumber:tn?tn.line:void 0},void 0)}}function IN(we,Ke){const ot={};let ut,Xt;for(Xt in Ke.properties)if(Xt!=="children"&&Xk.call(Ke.properties,Xt)){const $t=zN(we,Xt,Ke.properties[Xt]);if($t){const[cr,kr]=$t;we.tableCellAlignToStyle&&cr==="align"&&typeof kr=="string"&&TN.has(Ke.tagName)?ut=kr:ot[cr]=kr}}if(ut){const $t=ot.style||(ot.style={});$t[we.stylePropertyNameCase==="css"?"text-align":"textAlign"]=ut}return ot}function DN(we,Ke){const ot={};for(const ut of Ke.attributes)if(ut.type==="mdxJsxExpressionAttribute")if(ut.data&&ut.data.estree&&we.evaluater){const $t=ut.data.estree.body[0];$t.type;const cr=$t.expression;cr.type;const kr=cr.properties[0];kr.type,Object.assign(ot,we.evaluater.evaluateExpression(kr.argument))}else zT(we,Ke.position);else{const Xt=ut.name;let $t;if(ut.value&&typeof ut.value=="object")if(ut.value.data&&ut.value.data.estree&&we.evaluater){const kr=ut.value.data.estree.body[0];kr.type,$t=we.evaluater.evaluateExpression(kr.expression)}else zT(we,Ke.position);else $t=ut.value===null?!0:ut.value;ot[Xt]=$t}return ot}function Zk(we,Ke){const ot=[];let ut=-1;const Xt=we.passKeys?new Map:xN;for(;++utXt?0:Xt+Ke:Ke=Ke>Xt?Xt:Ke,ot=ot>0?ot:0,ut.length<1e4)cr=Array.from(ut),cr.unshift(Ke,ot),we.splice(...cr);else for(ot&&we.splice(Ke,ot);$t0?(Jm(we,we.length,0,Ke),we):Ke}const g4={}.hasOwnProperty;function VN(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 Km=x1(/[A-Za-z]/),s0=x1(/[\dA-Za-z]/),XN=x1(/[#-'*+\--9=?A-Z^-~]/);function Rk(we){return we!==null&&(we<32||we===127)}const Ik=x1(/\d/),YN=x1(/[\dA-Fa-f]/),ZN=x1(/[!-/:-@[-`{-~]/);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 WN=x1(new RegExp("\\p{P}|\\p{S}","u")),$N=x1(/\s/);function x1(we){return Ke;function Ke(ot){return ot!==null&&ot>-1&&we.test(String.fromCharCode(ot))}}function Nw(we){const Ke=[];let ot=-1,ut=0,Xt=0;for(;++ot55295&&$t<57344){const kr=we.charCodeAt(ot+1);$t<56320&&kr>56319&&kr<57344?(cr=String.fromCharCode($t,kr),Xt=1):cr="�"}else cr=String.fromCharCode($t);cr&&(Ke.push(we.slice(ut,ot),encodeURIComponent(cr)),ut=ot+Xt+1,cr=""),Xt&&(ot+=Xt,Xt=0)}return Ke.join("")+we.slice(ut)}function gh(we,Ke,ot,ut){const Xt=ut?ut-1:Number.POSITIVE_INFINITY;let $t=0;return cr;function cr(tn){return Af(tn)?(we.enter(ot),kr(tn)):Ke(tn)}function kr(tn){return Af(tn)&&$t++cr))return;const mo=Ke.events.length;let Rs=mo,ki,$s;for(;Rs--;)if(Ke.events[Rs][0]==="exit"&&Ke.events[Rs][1].type==="chunkFlow"){if(ki){$s=Ke.events[Rs][1].end;break}ki=!0}for(li(ut),ui=mo;uiwo;){const Eo=ot[vl];Ke.containerState=Eo[1],Eo[0].exit.call(Ke,we)}ot.length=wo}function Ge(){Xt.write([null]),$t=void 0,Xt=void 0,Ke.containerState._closeFlow=void 0}}function tU(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 _4(we){if(we===null||Rp(we)||$N(we))return 1;if(WN(we))return 2}function $k(we,Ke,ot){const ut=[];let Xt=-1;for(;++Xt1&&we[ot][1].end.offset-we[ot][1].start.offset>1?2:1;const Mn={...we[ut][1].end},ea={...we[ot][1].start};x4(Mn,-tn),x4(ea,tn),cr={type:tn>1?"strongSequence":"emphasisSequence",start:Mn,end:{...we[ut][1].end}},kr={type:tn>1?"strongSequence":"emphasisSequence",start:{...we[ot][1].start},end:ea},$t={type:tn>1?"strongText":"emphasisText",start:{...we[ut][1].end},end:{...we[ot][1].start}},Xt={type:tn>1?"strong":"emphasis",start:{...cr.start},end:{...kr.end}},we[ut][1].end={...cr.start},we[ot][1].start={...kr.end},Ur=[],we[ut][1].end.offset-we[ut][1].start.offset&&(Ur=E0(Ur,[["enter",we[ut][1],Ke],["exit",we[ut][1],Ke]])),Ur=E0(Ur,[["enter",Xt,Ke],["enter",cr,Ke],["exit",cr,Ke],["enter",$t,Ke]]),Ur=E0(Ur,$k(Ke.parser.constructs.insideSpan.null,we.slice(ut+1,ot),Ke)),Ur=E0(Ur,[["exit",$t,Ke],["enter",kr,Ke],["exit",kr,Ke],["exit",Xt,Ke]]),we[ot][1].end.offset-we[ot][1].start.offset?(yn=2,Ur=E0(Ur,[["enter",we[ot][1],Ke],["exit",we[ot][1],Ke]])):yn=0,Jm(we,ut-1,ot-ut+3,Ur),ot=ut+Ur.length-yn-2;break}}for(ot=-1;++ot0&&Af(ui)?gh(we,Ge,"linePrefix",$t+1)(ui):Ge(ui)}function Ge(ui){return ui===null||yu(ui)?we.check(b4,bo,vl)(ui):(we.enter("codeFlowValue"),wo(ui))}function wo(ui){return ui===null||yu(ui)?(we.exit("codeFlowValue"),Ge(ui)):(we.consume(ui),wo)}function vl(ui){return we.exit("codeFenced"),Ke(ui)}function Eo(ui,mo,Rs){let ki=0;return $s;function $s(Ii){return ui.enter("lineEnding"),ui.consume(Ii),ui.exit("lineEnding"),Di}function Di(Ii){return ui.enter("codeFencedFence"),Af(Ii)?gh(ui,zo,"linePrefix",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ii):zo(Ii)}function zo(Ii){return Ii===kr?(ui.enter("codeFencedFenceSequence"),Nl(Ii)):Rs(Ii)}function Nl(Ii){return Ii===kr?(ki++,ui.consume(Ii),Nl):ki>=cr?(ui.exit("codeFencedFenceSequence"),Af(Ii)?gh(ui,Si,"whitespace")(Ii):Si(Ii)):Rs(Ii)}function Si(Ii){return Ii===null||yu(Ii)?(ui.exit("codeFencedFence"),mo(Ii)):Rs(Ii)}}}function dU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return cr===null?ot(cr):(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),$t)}function $t(cr){return ut.parser.lazy[ut.now().line]?ot(cr):Ke(cr)}}const uk={name:"codeIndented",tokenize:pU},vU={partial:!0,tokenize:mU};function pU(we,Ke,ot){const ut=this;return Xt;function Xt(Ur){return we.enter("codeIndented"),gh(we,$t,"linePrefix",5)(Ur)}function $t(Ur){const yn=ut.events[ut.events.length-1];return yn&&yn[1].type==="linePrefix"&&yn[2].sliceSerialize(yn[1],!0).length>=4?cr(Ur):ot(Ur)}function cr(Ur){return Ur===null?tn(Ur):yu(Ur)?we.attempt(vU,cr,tn)(Ur):(we.enter("codeFlowValue"),kr(Ur))}function kr(Ur){return Ur===null||yu(Ur)?(we.exit("codeFlowValue"),cr(Ur)):(we.consume(Ur),kr)}function tn(Ur){return we.exit("codeIndented"),Ke(Ur)}}function mU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return ut.parser.lazy[ut.now().line]?ot(cr):yu(cr)?(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),Xt):gh(we,$t,"linePrefix",5)(cr)}function $t(cr){const kr=ut.events[ut.events.length-1];return kr&&kr[1].type==="linePrefix"&&kr[2].sliceSerialize(kr[1],!0).length>=4?Ke(cr):yu(cr)?Xt(cr):ot(cr)}}const gU={name:"codeText",previous:_U,resolve:yU,tokenize:xU};function yU(we){let Ke=we.length-4,ot=3,ut,Xt;if((we[ot][1].type==="lineEnding"||we[ot][1].type==="space")&&(we[Ke][1].type==="lineEnding"||we[Ke][1].type==="space")){for(ut=ot;++ut=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-ut+this.left.length,this.right.length-Ke+this.left.length).reverse():this.left.slice(Ke).concat(this.right.slice(this.right.length-ut+this.left.length).reverse())}splice(Ke,ot,ut){const Xt=ot||0;this.setCursor(Math.trunc(Ke));const $t=this.right.splice(this.right.length-Xt,Number.POSITIVE_INFINITY);return ut&&kT(this.left,ut),$t.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(cr):we.interrupt(ut.parser.constructs.flow,ot,Ke)(cr)}}function zP(we,Ke,ot,ut,Xt,$t,cr,kr,tn){const Ur=tn||Number.POSITIVE_INFINITY;let yn=0;return Mn;function Mn(li){return li===60?(we.enter(ut),we.enter(Xt),we.enter($t),we.consume(li),we.exit($t),ea):li===null||li===32||li===41||Rk(li)?ot(li):(we.enter(ut),we.enter(cr),we.enter(kr),we.enter("chunkString",{contentType:"string"}),bo(li))}function ea(li){return li===62?(we.enter($t),we.consume(li),we.exit($t),we.exit(Xt),we.exit(ut),Ke):(we.enter(kr),we.enter("chunkString",{contentType:"string"}),Bn(li))}function Bn(li){return li===62?(we.exit("chunkString"),we.exit(kr),ea(li)):li===null||li===60||yu(li)?ot(li):(we.consume(li),li===92?Gi:Bn)}function Gi(li){return li===60||li===62||li===92?(we.consume(li),Bn):Bn(li)}function bo(li){return!yn&&(li===null||li===41||Rp(li))?(we.exit("chunkString"),we.exit(kr),we.exit(cr),we.exit(ut),Ke(li)):yn999||Bn===null||Bn===91||Bn===93&&!tn||Bn===94&&!kr&&"_hiddenFootnoteSupport"in cr.parser.constructs?ot(Bn):Bn===93?(we.exit($t),we.enter(Xt),we.consume(Bn),we.exit(Xt),we.exit(ut),Ke):yu(Bn)?(we.enter("lineEnding"),we.consume(Bn),we.exit("lineEnding"),yn):(we.enter("chunkString",{contentType:"string"}),Mn(Bn))}function Mn(Bn){return Bn===null||Bn===91||Bn===93||yu(Bn)||kr++>999?(we.exit("chunkString"),yn(Bn)):(we.consume(Bn),tn||(tn=!Af(Bn)),Bn===92?ea:Mn)}function ea(Bn){return Bn===91||Bn===92||Bn===93?(we.consume(Bn),kr++,Mn):Mn(Bn)}}function FP(we,Ke,ot,ut,Xt,$t){let cr;return kr;function kr(ea){return ea===34||ea===39||ea===40?(we.enter(ut),we.enter(Xt),we.consume(ea),we.exit(Xt),cr=ea===40?41:ea,tn):ot(ea)}function tn(ea){return ea===cr?(we.enter(Xt),we.consume(ea),we.exit(Xt),we.exit(ut),Ke):(we.enter($t),Ur(ea))}function Ur(ea){return ea===cr?(we.exit($t),tn(cr)):ea===null?ot(ea):yu(ea)?(we.enter("lineEnding"),we.consume(ea),we.exit("lineEnding"),gh(we,Ur,"linePrefix")):(we.enter("chunkString",{contentType:"string"}),yn(ea))}function yn(ea){return ea===cr||ea===null||yu(ea)?(we.exit("chunkString"),Ur(ea)):(we.consume(ea),ea===92?Mn:yn)}function Mn(ea){return ea===cr||ea===92?(we.consume(ea),yn):yn(ea)}}function IT(we,Ke){let ot;return ut;function ut(Xt){return yu(Xt)?(we.enter("lineEnding"),we.consume(Xt),we.exit("lineEnding"),ot=!0,ut):Af(Xt)?gh(we,ut,ot?"linePrefix":"lineSuffix")(Xt):Ke(Xt)}}const kU={name:"definition",tokenize:LU},CU={partial:!0,tokenize:PU};function LU(we,Ke,ot){const ut=this;let Xt;return $t;function $t(Bn){return we.enter("definition"),cr(Bn)}function cr(Bn){return OP.call(ut,we,kr,ot,"definitionLabel","definitionLabelMarker","definitionLabelString")(Bn)}function kr(Bn){return Xt=Ow(ut.sliceSerialize(ut.events[ut.events.length-1][1]).slice(1,-1)),Bn===58?(we.enter("definitionMarker"),we.consume(Bn),we.exit("definitionMarker"),tn):ot(Bn)}function tn(Bn){return Rp(Bn)?IT(we,Ur)(Bn):Ur(Bn)}function Ur(Bn){return zP(we,yn,ot,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Bn)}function yn(Bn){return we.attempt(CU,Mn,Mn)(Bn)}function Mn(Bn){return Af(Bn)?gh(we,ea,"whitespace")(Bn):ea(Bn)}function ea(Bn){return Bn===null||yu(Bn)?(we.exit("definition"),ut.parser.defined.push(Xt),Ke(Bn)):ot(Bn)}}function PU(we,Ke,ot){return ut;function ut(kr){return Rp(kr)?IT(we,Xt)(kr):ot(kr)}function Xt(kr){return FP(we,$t,ot,"definitionTitle","definitionTitleMarker","definitionTitleString")(kr)}function $t(kr){return Af(kr)?gh(we,cr,"whitespace")(kr):cr(kr)}function cr(kr){return kr===null||yu(kr)?Ke(kr):ot(kr)}}const RU={name:"hardBreakEscape",tokenize:IU};function IU(we,Ke,ot){return ut;function ut($t){return we.enter("hardBreakEscape"),we.consume($t),Xt}function Xt($t){return yu($t)?(we.exit("hardBreakEscape"),Ke($t)):ot($t)}}const DU={name:"headingAtx",resolve:zU,tokenize:OU};function zU(we,Ke){let ot=we.length-2,ut=3,Xt,$t;return we[ut][1].type==="whitespace"&&(ut+=2),ot-2>ut&&we[ot][1].type==="whitespace"&&(ot-=2),we[ot][1].type==="atxHeadingSequence"&&(ut===ot-1||ot-4>ut&&we[ot-2][1].type==="whitespace")&&(ot-=ut+1===ot?2:4),ot>ut&&(Xt={type:"atxHeadingText",start:we[ut][1].start,end:we[ot][1].end},$t={type:"chunkText",start:we[ut][1].start,end:we[ot][1].end,contentType:"text"},Jm(we,ut,ot-ut+1,[["enter",Xt,Ke],["enter",$t,Ke],["exit",$t,Ke],["exit",Xt,Ke]])),we}function OU(we,Ke,ot){let ut=0;return Xt;function Xt(yn){return we.enter("atxHeading"),$t(yn)}function $t(yn){return we.enter("atxHeadingSequence"),cr(yn)}function cr(yn){return yn===35&&ut++<6?(we.consume(yn),cr):yn===null||Rp(yn)?(we.exit("atxHeadingSequence"),kr(yn)):ot(yn)}function kr(yn){return yn===35?(we.enter("atxHeadingSequence"),tn(yn)):yn===null||yu(yn)?(we.exit("atxHeading"),Ke(yn)):Af(yn)?gh(we,kr,"whitespace")(yn):(we.enter("atxHeadingText"),Ur(yn))}function tn(yn){return yn===35?(we.consume(yn),tn):(we.exit("atxHeadingSequence"),kr(yn))}function Ur(yn){return yn===null||yn===35||Rp(yn)?(we.exit("atxHeadingText"),kr(yn)):(we.consume(yn),Ur)}}const FU=["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"],T4=["pre","script","style","textarea"],BU={concrete:!0,name:"htmlFlow",resolveTo:jU,tokenize:qU},NU={partial:!0,tokenize:HU},UU={partial:!0,tokenize:VU};function jU(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 qU(we,Ke,ot){const ut=this;let Xt,$t,cr,kr,tn;return Ur;function Ur(Kn){return yn(Kn)}function yn(Kn){return we.enter("htmlFlow"),we.enter("htmlFlowData"),we.consume(Kn),Mn}function Mn(Kn){return Kn===33?(we.consume(Kn),ea):Kn===47?(we.consume(Kn),$t=!0,bo):Kn===63?(we.consume(Kn),Xt=3,ut.interrupt?Ke:ba):Km(Kn)?(we.consume(Kn),cr=String.fromCharCode(Kn),eo):ot(Kn)}function ea(Kn){return Kn===45?(we.consume(Kn),Xt=2,Bn):Kn===91?(we.consume(Kn),Xt=5,kr=0,Gi):Km(Kn)?(we.consume(Kn),Xt=4,ut.interrupt?Ke:ba):ot(Kn)}function Bn(Kn){return Kn===45?(we.consume(Kn),ut.interrupt?Ke:ba):ot(Kn)}function Gi(Kn){const vs="CDATA[";return Kn===vs.charCodeAt(kr++)?(we.consume(Kn),kr===vs.length?ut.interrupt?Ke:zo:Gi):ot(Kn)}function bo(Kn){return Km(Kn)?(we.consume(Kn),cr=String.fromCharCode(Kn),eo):ot(Kn)}function eo(Kn){if(Kn===null||Kn===47||Kn===62||Rp(Kn)){const vs=Kn===47,Is=cr.toLowerCase();return!vs&&!$t&&T4.includes(Is)?(Xt=1,ut.interrupt?Ke(Kn):zo(Kn)):FU.includes(cr.toLowerCase())?(Xt=6,vs?(we.consume(Kn),li):ut.interrupt?Ke(Kn):zo(Kn)):(Xt=7,ut.interrupt&&!ut.parser.lazy[ut.now().line]?ot(Kn):$t?Ge(Kn):wo(Kn))}return Kn===45||s0(Kn)?(we.consume(Kn),cr+=String.fromCharCode(Kn),eo):ot(Kn)}function li(Kn){return Kn===62?(we.consume(Kn),ut.interrupt?Ke:zo):ot(Kn)}function Ge(Kn){return Af(Kn)?(we.consume(Kn),Ge):$s(Kn)}function wo(Kn){return Kn===47?(we.consume(Kn),$s):Kn===58||Kn===95||Km(Kn)?(we.consume(Kn),vl):Af(Kn)?(we.consume(Kn),wo):$s(Kn)}function vl(Kn){return Kn===45||Kn===46||Kn===58||Kn===95||s0(Kn)?(we.consume(Kn),vl):Eo(Kn)}function Eo(Kn){return Kn===61?(we.consume(Kn),ui):Af(Kn)?(we.consume(Kn),Eo):wo(Kn)}function ui(Kn){return Kn===null||Kn===60||Kn===61||Kn===62||Kn===96?ot(Kn):Kn===34||Kn===39?(we.consume(Kn),tn=Kn,mo):Af(Kn)?(we.consume(Kn),ui):Rs(Kn)}function mo(Kn){return Kn===tn?(we.consume(Kn),tn=null,ki):Kn===null||yu(Kn)?ot(Kn):(we.consume(Kn),mo)}function Rs(Kn){return Kn===null||Kn===34||Kn===39||Kn===47||Kn===60||Kn===61||Kn===62||Kn===96||Rp(Kn)?Eo(Kn):(we.consume(Kn),Rs)}function ki(Kn){return Kn===47||Kn===62||Af(Kn)?wo(Kn):ot(Kn)}function $s(Kn){return Kn===62?(we.consume(Kn),Di):ot(Kn)}function Di(Kn){return Kn===null||yu(Kn)?zo(Kn):Af(Kn)?(we.consume(Kn),Di):ot(Kn)}function zo(Kn){return Kn===45&&Xt===2?(we.consume(Kn),Ti):Kn===60&&Xt===1?(we.consume(Kn),So):Kn===62&&Xt===4?(we.consume(Kn),qa):Kn===63&&Xt===3?(we.consume(Kn),ba):Kn===93&&Xt===5?(we.consume(Kn),bu):yu(Kn)&&(Xt===6||Xt===7)?(we.exit("htmlFlowData"),we.check(NU,ro,Nl)(Kn)):Kn===null||yu(Kn)?(we.exit("htmlFlowData"),Nl(Kn)):(we.consume(Kn),zo)}function Nl(Kn){return we.check(UU,Si,ro)(Kn)}function Si(Kn){return we.enter("lineEnding"),we.consume(Kn),we.exit("lineEnding"),Ii}function Ii(Kn){return Kn===null||yu(Kn)?Nl(Kn):(we.enter("htmlFlowData"),zo(Kn))}function Ti(Kn){return Kn===45?(we.consume(Kn),ba):zo(Kn)}function So(Kn){return Kn===47?(we.consume(Kn),cr="",ws):zo(Kn)}function ws(Kn){if(Kn===62){const vs=cr.toLowerCase();return T4.includes(vs)?(we.consume(Kn),qa):zo(Kn)}return Km(Kn)&&cr.length<8?(we.consume(Kn),cr+=String.fromCharCode(Kn),ws):zo(Kn)}function bu(Kn){return Kn===93?(we.consume(Kn),ba):zo(Kn)}function ba(Kn){return Kn===62?(we.consume(Kn),qa):Kn===45&&Xt===2?(we.consume(Kn),ba):zo(Kn)}function qa(Kn){return Kn===null||yu(Kn)?(we.exit("htmlFlowData"),ro(Kn)):(we.consume(Kn),qa)}function ro(Kn){return we.exit("htmlFlow"),Ke(Kn)}}function VU(we,Ke,ot){const ut=this;return Xt;function Xt(cr){return yu(cr)?(we.enter("lineEnding"),we.consume(cr),we.exit("lineEnding"),$t):ot(cr)}function $t(cr){return ut.parser.lazy[ut.now().line]?ot(cr):Ke(cr)}}function HU(we,Ke,ot){return ut;function ut(Xt){return we.enter("lineEnding"),we.consume(Xt),we.exit("lineEnding"),we.attempt(xM,Ke,ot)}}const GU={name:"htmlText",tokenize:XU};function XU(we,Ke,ot){const ut=this;let Xt,$t,cr;return kr;function kr(ba){return we.enter("htmlText"),we.enter("htmlTextData"),we.consume(ba),tn}function tn(ba){return ba===33?(we.consume(ba),Ur):ba===47?(we.consume(ba),Eo):ba===63?(we.consume(ba),wo):Km(ba)?(we.consume(ba),Rs):ot(ba)}function Ur(ba){return ba===45?(we.consume(ba),yn):ba===91?(we.consume(ba),$t=0,Gi):Km(ba)?(we.consume(ba),Ge):ot(ba)}function yn(ba){return ba===45?(we.consume(ba),Bn):ot(ba)}function Mn(ba){return ba===null?ot(ba):ba===45?(we.consume(ba),ea):yu(ba)?(cr=Mn,So(ba)):(we.consume(ba),Mn)}function ea(ba){return ba===45?(we.consume(ba),Bn):Mn(ba)}function Bn(ba){return ba===62?Ti(ba):ba===45?ea(ba):Mn(ba)}function Gi(ba){const qa="CDATA[";return ba===qa.charCodeAt($t++)?(we.consume(ba),$t===qa.length?bo:Gi):ot(ba)}function bo(ba){return ba===null?ot(ba):ba===93?(we.consume(ba),eo):yu(ba)?(cr=bo,So(ba)):(we.consume(ba),bo)}function eo(ba){return ba===93?(we.consume(ba),li):bo(ba)}function li(ba){return ba===62?Ti(ba):ba===93?(we.consume(ba),li):bo(ba)}function Ge(ba){return ba===null||ba===62?Ti(ba):yu(ba)?(cr=Ge,So(ba)):(we.consume(ba),Ge)}function wo(ba){return ba===null?ot(ba):ba===63?(we.consume(ba),vl):yu(ba)?(cr=wo,So(ba)):(we.consume(ba),wo)}function vl(ba){return ba===62?Ti(ba):wo(ba)}function Eo(ba){return Km(ba)?(we.consume(ba),ui):ot(ba)}function ui(ba){return ba===45||s0(ba)?(we.consume(ba),ui):mo(ba)}function mo(ba){return yu(ba)?(cr=mo,So(ba)):Af(ba)?(we.consume(ba),mo):Ti(ba)}function Rs(ba){return ba===45||s0(ba)?(we.consume(ba),Rs):ba===47||ba===62||Rp(ba)?ki(ba):ot(ba)}function ki(ba){return ba===47?(we.consume(ba),Ti):ba===58||ba===95||Km(ba)?(we.consume(ba),$s):yu(ba)?(cr=ki,So(ba)):Af(ba)?(we.consume(ba),ki):Ti(ba)}function $s(ba){return ba===45||ba===46||ba===58||ba===95||s0(ba)?(we.consume(ba),$s):Di(ba)}function Di(ba){return ba===61?(we.consume(ba),zo):yu(ba)?(cr=Di,So(ba)):Af(ba)?(we.consume(ba),Di):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),Xt=ba,Nl):yu(ba)?(cr=zo,So(ba)):Af(ba)?(we.consume(ba),zo):(we.consume(ba),Si)}function Nl(ba){return ba===Xt?(we.consume(ba),Xt=void 0,Ii):ba===null?ot(ba):yu(ba)?(cr=Nl,So(ba)):(we.consume(ba),Nl)}function Si(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),Si)}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",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ba):bu(ba)}function bu(ba){return we.enter("htmlTextData"),cr(ba)}}const Kk={name:"labelEnd",resolveAll:$U,resolveTo:KU,tokenize:JU},YU={tokenize:QU},ZU={tokenize:ej},WU={tokenize:tj};function $U(we){let Ke=-1;const ot=[];for(;++Ke=3&&(Ur===null||yu(Ur))?(we.exit("thematicBreak"),Ke(Ur)):ot(Ur)}function tn(Ur){return Ur===Xt?(we.consume(Ur),ut++,tn):(we.exit("thematicBreakSequence"),Af(Ur)?gh(we,kr,"whitespace")(Ur):kr(Ur))}}const Pp={continuation:{tokenize:fj},exit:dj,name:"list",tokenize:cj},lj={partial:!0,tokenize:vj},uj={partial:!0,tokenize:hj};function cj(we,Ke,ot){const ut=this,Xt=ut.events[ut.events.length-1];let $t=Xt&&Xt[1].type==="linePrefix"?Xt[2].sliceSerialize(Xt[1],!0).length:0,cr=0;return kr;function kr(Bn){const Gi=ut.containerState.type||(Bn===42||Bn===43||Bn===45?"listUnordered":"listOrdered");if(Gi==="listUnordered"?!ut.containerState.marker||Bn===ut.containerState.marker:Ik(Bn)){if(ut.containerState.type||(ut.containerState.type=Gi,we.enter(Gi,{_container:!0})),Gi==="listUnordered")return we.enter("listItemPrefix"),Bn===42||Bn===45?we.check(lM,ot,Ur)(Bn):Ur(Bn);if(!ut.interrupt||Bn===49)return we.enter("listItemPrefix"),we.enter("listItemValue"),tn(Bn)}return ot(Bn)}function tn(Bn){return Ik(Bn)&&++cr<10?(we.consume(Bn),tn):(!ut.interrupt||cr<2)&&(ut.containerState.marker?Bn===ut.containerState.marker:Bn===41||Bn===46)?(we.exit("listItemValue"),Ur(Bn)):ot(Bn)}function Ur(Bn){return we.enter("listItemMarker"),we.consume(Bn),we.exit("listItemMarker"),ut.containerState.marker=ut.containerState.marker||Bn,we.check(xM,ut.interrupt?ot:yn,we.attempt(lj,ea,Mn))}function yn(Bn){return ut.containerState.initialBlankLine=!0,$t++,ea(Bn)}function Mn(Bn){return Af(Bn)?(we.enter("listItemPrefixWhitespace"),we.consume(Bn),we.exit("listItemPrefixWhitespace"),ea):ot(Bn)}function ea(Bn){return ut.containerState.size=$t+ut.sliceSerialize(we.exit("listItemPrefix"),!0).length,Ke(Bn)}}function fj(we,Ke,ot){const ut=this;return ut.containerState._closeFlow=void 0,we.check(xM,Xt,$t);function Xt(kr){return ut.containerState.furtherBlankLines=ut.containerState.furtherBlankLines||ut.containerState.initialBlankLine,gh(we,Ke,"listItemIndent",ut.containerState.size+1)(kr)}function $t(kr){return ut.containerState.furtherBlankLines||!Af(kr)?(ut.containerState.furtherBlankLines=void 0,ut.containerState.initialBlankLine=void 0,cr(kr)):(ut.containerState.furtherBlankLines=void 0,ut.containerState.initialBlankLine=void 0,we.attempt(uj,Ke,cr)(kr))}function cr(kr){return ut.containerState._closeFlow=!0,ut.interrupt=void 0,gh(we,we.attempt(Pp,Ke,ot),"linePrefix",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(kr)}}function hj(we,Ke,ot){const ut=this;return gh(we,Xt,"listItemIndent",ut.containerState.size+1);function Xt($t){const cr=ut.events[ut.events.length-1];return cr&&cr[1].type==="listItemIndent"&&cr[2].sliceSerialize(cr[1],!0).length===ut.containerState.size?Ke($t):ot($t)}}function dj(we){we.exit(this.containerState.type)}function vj(we,Ke,ot){const ut=this;return gh(we,Xt,"listItemPrefixWhitespace",ut.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function Xt($t){const cr=ut.events[ut.events.length-1];return!Af($t)&&cr&&cr[1].type==="listItemPrefixWhitespace"?Ke($t):ot($t)}}const A4={name:"setextUnderline",resolveTo:pj,tokenize:mj};function pj(we,Ke){let ot=we.length,ut,Xt,$t;for(;ot--;)if(we[ot][0]==="enter"){if(we[ot][1].type==="content"){ut=ot;break}we[ot][1].type==="paragraph"&&(Xt=ot)}else we[ot][1].type==="content"&&we.splice(ot,1),!$t&&we[ot][1].type==="definition"&&($t=ot);const cr={type:"setextHeading",start:{...we[ut][1].start},end:{...we[we.length-1][1].end}};return we[Xt][1].type="setextHeadingText",$t?(we.splice(Xt,0,["enter",cr,Ke]),we.splice($t+1,0,["exit",we[ut][1],Ke]),we[ut][1].end={...we[$t][1].end}):we[ut][1]=cr,we.push(["exit",cr,Ke]),we}function mj(we,Ke,ot){const ut=this;let Xt;return $t;function $t(Ur){let yn=ut.events.length,Mn;for(;yn--;)if(ut.events[yn][1].type!=="lineEnding"&&ut.events[yn][1].type!=="linePrefix"&&ut.events[yn][1].type!=="content"){Mn=ut.events[yn][1].type==="paragraph";break}return!ut.parser.lazy[ut.now().line]&&(ut.interrupt||Mn)?(we.enter("setextHeadingLine"),Xt=Ur,cr(Ur)):ot(Ur)}function cr(Ur){return we.enter("setextHeadingLineSequence"),kr(Ur)}function kr(Ur){return Ur===Xt?(we.consume(Ur),kr):(we.exit("setextHeadingLineSequence"),Af(Ur)?gh(we,tn,"lineSuffix")(Ur):tn(Ur))}function tn(Ur){return Ur===null||yu(Ur)?(we.exit("setextHeadingLine"),Ke(Ur)):ot(Ur)}}const gj={tokenize:yj};function yj(we){const Ke=this,ot=we.attempt(xM,ut,we.attempt(this.parser.constructs.flowInitial,Xt,gh(we,we.attempt(this.parser.constructs.flow,Xt,we.attempt(TU,Xt)),"linePrefix")));return ot;function ut($t){if($t===null){we.consume($t);return}return we.enter("lineEndingBlank"),we.consume($t),we.exit("lineEndingBlank"),Ke.currentConstruct=void 0,ot}function Xt($t){if($t===null){we.consume($t);return}return we.enter("lineEnding"),we.consume($t),we.exit("lineEnding"),Ke.currentConstruct=void 0,ot}}const _j={resolveAll:NP()},xj=BP("string"),bj=BP("text");function BP(we){return{resolveAll:NP(we==="text"?wj:void 0),tokenize:Ke};function Ke(ot){const ut=this,Xt=this.parser.constructs[we],$t=ot.attempt(Xt,cr,kr);return cr;function cr(yn){return Ur(yn)?$t(yn):kr(yn)}function kr(yn){if(yn===null){ot.consume(yn);return}return ot.enter("data"),ot.consume(yn),tn}function tn(yn){return Ur(yn)?(ot.exit("data"),$t(yn)):(ot.consume(yn),tn)}function Ur(yn){if(yn===null)return!0;const Mn=Xt[yn];let ea=-1;if(Mn)for(;++ea-1){const kr=cr[0];typeof kr=="string"?cr[0]=kr.slice(ut):cr.shift()}$t>0&&cr.push(we[Xt].slice(0,$t))}return cr}function zj(we,Ke){let ot=-1;const ut=[];let Xt;for(;++ot0){const tp=nu.tokenStack[nu.tokenStack.length-1];(tp[1]||M4).call(nu,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&&(ut.className=["language-"+Xt[0]]);let $t={type:"element",tagName:"code",properties:ut,children:[{type:"text",value:ot}]};return Ke.meta&&($t.data={meta:Ke.meta}),we.patch(Ke,$t),$t=we.applyData(Ke,$t),$t={type:"element",tagName:"pre",properties:{},children:[$t]},we.patch(Ke,$t),$t}function Wj(we,Ke){const ot={type:"element",tagName:"del",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function $j(we,Ke){const ot={type:"element",tagName:"em",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function Kj(we,Ke){const ot=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",ut=String(Ke.identifier).toUpperCase(),Xt=Nw(ut.toLowerCase()),$t=we.footnoteOrder.indexOf(ut);let cr,kr=we.footnoteCounts.get(ut);kr===void 0?(kr=0,we.footnoteOrder.push(ut),cr=we.footnoteOrder.length):cr=$t+1,kr+=1,we.footnoteCounts.set(ut,kr);const tn={type:"element",tagName:"a",properties:{href:"#"+ot+"fn-"+Xt,id:ot+"fnref-"+Xt+(kr>1?"-"+kr:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(cr)}]};we.patch(Ke,tn);const Ur={type:"element",tagName:"sup",properties:{},children:[tn]};return we.patch(Ke,Ur),we.applyData(Ke,Ur)}function Jj(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 Qj(we,Ke){if(we.options.allowDangerousHtml){const ot={type:"raw",value:Ke.value};return we.patch(Ke,ot),we.applyData(Ke,ot)}}function qP(we,Ke){const ot=Ke.referenceType;let ut="]";if(ot==="collapsed"?ut+="[]":ot==="full"&&(ut+="["+(Ke.label||Ke.identifier)+"]"),Ke.type==="imageReference")return[{type:"text",value:"!["+Ke.alt+ut}];const Xt=we.all(Ke),$t=Xt[0];$t&&$t.type==="text"?$t.value="["+$t.value:Xt.unshift({type:"text",value:"["});const cr=Xt[Xt.length-1];return cr&&cr.type==="text"?cr.value+=ut:Xt.push({type:"text",value:ut}),Xt}function eq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),ut=we.definitionById.get(ot);if(!ut)return qP(we,Ke);const Xt={src:Nw(ut.url||""),alt:Ke.alt};ut.title!==null&&ut.title!==void 0&&(Xt.title=ut.title);const $t={type:"element",tagName:"img",properties:Xt,children:[]};return we.patch(Ke,$t),we.applyData(Ke,$t)}function tq(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 ut={type:"element",tagName:"img",properties:ot,children:[]};return we.patch(Ke,ut),we.applyData(Ke,ut)}function rq(we,Ke){const ot={type:"text",value:Ke.value.replace(/\r?\n|\r/g," ")};we.patch(Ke,ot);const ut={type:"element",tagName:"code",properties:{},children:[ot]};return we.patch(Ke,ut),we.applyData(Ke,ut)}function nq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),ut=we.definitionById.get(ot);if(!ut)return qP(we,Ke);const Xt={href:Nw(ut.url||"")};ut.title!==null&&ut.title!==void 0&&(Xt.title=ut.title);const $t={type:"element",tagName:"a",properties:Xt,children:we.all(Ke)};return we.patch(Ke,$t),we.applyData(Ke,$t)}function aq(we,Ke){const ot={href:Nw(Ke.url)};Ke.title!==null&&Ke.title!==void 0&&(ot.title=Ke.title);const ut={type:"element",tagName:"a",properties:ot,children:we.all(Ke)};return we.patch(Ke,ut),we.applyData(Ke,ut)}function iq(we,Ke,ot){const ut=we.all(Ke),Xt=ot?oq(ot):VP(Ke),$t={},cr=[];if(typeof Ke.checked=="boolean"){const yn=ut[0];let Mn;yn&&yn.type==="element"&&yn.tagName==="p"?Mn=yn:(Mn={type:"element",tagName:"p",properties:{},children:[]},ut.unshift(Mn)),Mn.children.length>0&&Mn.children.unshift({type:"text",value:" "}),Mn.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Ke.checked,disabled:!0},children:[]}),$t.className=["task-list-item"]}let kr=-1;for(;++kr1}function sq(we,Ke){const ot={},ut=we.all(Ke);let Xt=-1;for(typeof Ke.start=="number"&&Ke.start!==1&&(ot.start=Ke.start);++Xt0){const cr={type:"element",tagName:"tbody",properties:{},children:we.wrap(ot,!0)},kr=Gk(Ke.children[1]),tn=TP(Ke.children[Ke.children.length-1]);kr&&tn&&(cr.position={start:kr,end:tn}),Xt.push(cr)}const $t={type:"element",tagName:"table",properties:{},children:we.wrap(Xt,!0)};return we.patch(Ke,$t),we.applyData(Ke,$t)}function hq(we,Ke,ot){const ut=ot?ot.children:void 0,$t=(ut?ut.indexOf(Ke):1)===0?"th":"td",cr=ot&&ot.type==="table"?ot.align:void 0,kr=cr?cr.length:Ke.children.length;let tn=-1;const Ur=[];for(;++tn0,!0),ut[0]),Xt=ut.index+ut[0].length,ut=ot.exec(Ke);return $t.push(C4(Ke.slice(Xt),Xt>0,!1)),$t.join("")}function C4(we,Ke,ot){let ut=0,Xt=we.length;if(Ke){let $t=we.codePointAt(ut);for(;$t===E4||$t===k4;)ut++,$t=we.codePointAt(ut)}if(ot){let $t=we.codePointAt(Xt-1);for(;$t===E4||$t===k4;)Xt--,$t=we.codePointAt(Xt-1)}return Xt>ut?we.slice(ut,Xt):""}function pq(we,Ke){const ot={type:"text",value:vq(String(Ke.value))};return we.patch(Ke,ot),we.applyData(Ke,ot)}function mq(we,Ke){const ot={type:"element",tagName:"hr",properties:{},children:[]};return we.patch(Ke,ot),we.applyData(Ke,ot)}const gq={blockquote:Xj,break:Yj,code:Zj,delete:Wj,emphasis:$j,footnoteReference:Kj,heading:Jj,html:Qj,imageReference:eq,image:tq,inlineCode:rq,linkReference:nq,link:aq,listItem:iq,list:sq,paragraph:lq,root:uq,strong:cq,table:fq,tableCell:dq,tableRow:hq,text:pq,thematicBreak:mq,toml:rM,yaml:rM,definition:rM,footnoteDefinition:rM};function rM(){}const HP=-1,bM=0,DT=1,vM=2,Jk=3,Qk=4,eC=5,tC=6,GP=7,XP=8,L4=typeof self=="object"?self:globalThis,yq=(we,Ke)=>{const ot=(Xt,$t)=>(we.set($t,Xt),Xt),ut=Xt=>{if(we.has(Xt))return we.get(Xt);const[$t,cr]=Ke[Xt];switch($t){case bM:case HP:return ot(cr,Xt);case DT:{const kr=ot([],Xt);for(const tn of cr)kr.push(ut(tn));return kr}case vM:{const kr=ot({},Xt);for(const[tn,Ur]of cr)kr[ut(tn)]=ut(Ur);return kr}case Jk:return ot(new Date(cr),Xt);case Qk:{const{source:kr,flags:tn}=cr;return ot(new RegExp(kr,tn),Xt)}case eC:{const kr=ot(new Map,Xt);for(const[tn,Ur]of cr)kr.set(ut(tn),ut(Ur));return kr}case tC:{const kr=ot(new Set,Xt);for(const tn of cr)kr.add(ut(tn));return kr}case GP:{const{name:kr,message:tn}=cr;return ot(new L4[kr](tn),Xt)}case XP:return ot(BigInt(cr),Xt);case"BigInt":return ot(Object(BigInt(cr)),Xt);case"ArrayBuffer":return ot(new Uint8Array(cr).buffer,cr);case"DataView":{const{buffer:kr}=new Uint8Array(cr);return ot(new DataView(kr),cr)}}return ot(new L4[$t](cr),Xt)};return ut},P4=we=>yq(new Map,we)(0),Iw="",{toString:_q}={},{keys:xq}=Object,CT=we=>{const Ke=typeof we;if(Ke!=="object"||!we)return[bM,Ke];const ot=_q.call(we).slice(8,-1);switch(ot){case"Array":return[DT,Iw];case"Object":return[vM,Iw];case"Date":return[Jk,Iw];case"RegExp":return[Qk,Iw];case"Map":return[eC,Iw];case"Set":return[tC,Iw];case"DataView":return[DT,ot]}return ot.includes("Array")?[DT,ot]:ot.includes("Error")?[GP,ot]:[vM,ot]},nM=([we,Ke])=>we===bM&&(Ke==="function"||Ke==="symbol"),bq=(we,Ke,ot,ut)=>{const Xt=(cr,kr)=>{const tn=ut.push(cr)-1;return ot.set(kr,tn),tn},$t=cr=>{if(ot.has(cr))return ot.get(cr);let[kr,tn]=CT(cr);switch(kr){case bM:{let yn=cr;switch(tn){case"bigint":kr=XP,yn=cr.toString();break;case"function":case"symbol":if(we)throw new TypeError("unable to serialize "+tn);yn=null;break;case"undefined":return Xt([HP],cr)}return Xt([kr,yn],cr)}case DT:{if(tn){let ea=cr;return tn==="DataView"?ea=new Uint8Array(cr.buffer):tn==="ArrayBuffer"&&(ea=new Uint8Array(cr)),Xt([tn,[...ea]],cr)}const yn=[],Mn=Xt([kr,yn],cr);for(const ea of cr)yn.push($t(ea));return Mn}case vM:{if(tn)switch(tn){case"BigInt":return Xt([tn,cr.toString()],cr);case"Boolean":case"Number":case"String":return Xt([tn,cr.valueOf()],cr)}if(Ke&&"toJSON"in cr)return $t(cr.toJSON());const yn=[],Mn=Xt([kr,yn],cr);for(const ea of xq(cr))(we||!nM(CT(cr[ea])))&&yn.push([$t(ea),$t(cr[ea])]);return Mn}case Jk:return Xt([kr,cr.toISOString()],cr);case Qk:{const{source:yn,flags:Mn}=cr;return Xt([kr,{source:yn,flags:Mn}],cr)}case eC:{const yn=[],Mn=Xt([kr,yn],cr);for(const[ea,Bn]of cr)(we||!(nM(CT(ea))||nM(CT(Bn))))&&yn.push([$t(ea),$t(Bn)]);return Mn}case tC:{const yn=[],Mn=Xt([kr,yn],cr);for(const ea of cr)(we||!nM(CT(ea)))&&yn.push($t(ea));return Mn}}const{message:Ur}=cr;return Xt([kr,{name:tn,message:Ur}],cr)};return $t},R4=(we,{json:Ke,lossy:ot}={})=>{const ut=[];return bq(!(Ke||ot),!!Ke,new Map,ut)(we),ut},pM=typeof structuredClone=="function"?(we,Ke)=>Ke&&("json"in Ke||"lossy"in Ke)?P4(R4(we,Ke)):structuredClone(we):(we,Ke)=>P4(R4(we,Ke));function wq(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 Tq(we,Ke){return"Back to reference "+(we+1)+(Ke>1?"-"+Ke:"")}function Aq(we){const Ke=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",ot=we.options.footnoteBackContent||wq,ut=we.options.footnoteBackLabel||Tq,Xt=we.options.footnoteLabel||"Footnotes",$t=we.options.footnoteLabelTagName||"h2",cr=we.options.footnoteLabelProperties||{className:["sr-only"]},kr=[];let tn=-1;for(;++tn0&&Gi.push({type:"text",value:" "});let Ge=typeof ot=="string"?ot:ot(tn,Bn);typeof Ge=="string"&&(Ge={type:"text",value:Ge}),Gi.push({type:"element",tagName:"a",properties:{href:"#"+Ke+"fnref-"+ea+(Bn>1?"-"+Bn:""),dataFootnoteBackref:"",ariaLabel:typeof ut=="string"?ut:ut(tn,Bn),className:["data-footnote-backref"]},children:Array.isArray(Ge)?Ge:[Ge]})}const eo=yn[yn.length-1];if(eo&&eo.type==="element"&&eo.tagName==="p"){const Ge=eo.children[eo.children.length-1];Ge&&Ge.type==="text"?Ge.value+=" ":eo.children.push({type:"text",value:" "}),eo.children.push(...Gi)}else yn.push(...Gi);const li={type:"element",tagName:"li",properties:{id:Ke+"fn-"+ea},children:we.wrap(yn,!0)};we.patch(Ur,li),kr.push(li)}if(kr.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:$t,properties:{...pM(cr),id:"footnote-label"},children:[{type:"text",value:Xt}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:we.wrap(kr,!0)},{type:"text",value:` +`}]}}const YP=(function(we){if(we==null)return kq;if(typeof we=="function")return wM(we);if(typeof we=="object")return Array.isArray(we)?Sq(we):Mq(we);if(typeof we=="string")return Eq(we);throw new Error("Expected function, string, or object as test")});function Sq(we){const Ke=[];let ot=-1;for(;++ot":""))+")"})}return ea;function ea(){let Bn=ZP,Gi,bo,eo;if((!Ke||$t(tn,Ur,yn[yn.length-1]||void 0))&&(Bn=Iq(ot(tn,yn)),Bn[0]===I4))return Bn;if("children"in tn&&tn.children){const li=tn;if(li.children&&Bn[0]!==Pq)for(bo=(ut?li.children.length:-1)+cr,eo=yn.concat(li);bo>-1&&bo0&&ot.push({type:"text",value:` +`}),ot}function D4(we){let Ke=0,ot=we.charCodeAt(Ke);for(;ot===9||ot===32;)Ke++,ot=we.charCodeAt(Ke);return we.slice(Ke)}function z4(we,Ke){const ot=zq(we,Ke),ut=ot.one(we,void 0),Xt=Aq(ot),$t=Array.isArray(ut)?{type:"root",children:ut}:ut||{type:"root",children:[]};return Xt&&$t.children.push({type:"text",value:` +`},Xt),$t}function Uq(we,Ke){return we&&"run"in we?async function(ot,ut){const Xt=z4(ot,{file:ut,...Ke});await we.run(Xt,ut)}:function(ot,ut){return z4(ot,{file:ut,...we||Ke})}}function O4(we){if(we)throw we}var fk,F4;function jq(){if(F4)return fk;F4=1;var we=Object.prototype.hasOwnProperty,Ke=Object.prototype.toString,ot=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,Xt=function(Ur){return typeof Array.isArray=="function"?Array.isArray(Ur):Ke.call(Ur)==="[object Array]"},$t=function(Ur){if(!Ur||Ke.call(Ur)!=="[object Object]")return!1;var yn=we.call(Ur,"constructor"),Mn=Ur.constructor&&Ur.constructor.prototype&&we.call(Ur.constructor.prototype,"isPrototypeOf");if(Ur.constructor&&!yn&&!Mn)return!1;var ea;for(ea in Ur);return typeof ea>"u"||we.call(Ur,ea)},cr=function(Ur,yn){ot&&yn.name==="__proto__"?ot(Ur,yn.name,{enumerable:!0,configurable:!0,value:yn.newValue,writable:!0}):Ur[yn.name]=yn.newValue},kr=function(Ur,yn){if(yn==="__proto__")if(we.call(Ur,yn)){if(ut)return ut(Ur,yn).value}else return;return Ur[yn]};return fk=function tn(){var Ur,yn,Mn,ea,Bn,Gi,bo=arguments[0],eo=1,li=arguments.length,Ge=!1;for(typeof bo=="boolean"&&(Ge=bo,bo=arguments[1]||{},eo=2),(bo==null||typeof bo!="object"&&typeof bo!="function")&&(bo={});eocr.length;let tn;kr&&cr.push(Xt);try{tn=we.apply(this,cr)}catch(Ur){const yn=Ur;if(kr&&ot)throw yn;return Xt(yn)}kr||(tn&&tn.then&&typeof tn.then=="function"?tn.then($t,Xt):tn instanceof Error?Xt(tn):$t(tn))}function Xt(cr,...kr){ot||(ot=!0,Ke(cr,...kr))}function $t(cr){Xt(null,cr)}}const $m={basename:Gq,dirname:Xq,extname:Yq,join:Zq,sep:"/"};function Gq(we,Ke){if(Ke!==void 0&&typeof Ke!="string")throw new TypeError('"ext" argument must be a string');FT(we);let ot=0,ut=-1,Xt=we.length,$t;if(Ke===void 0||Ke.length===0||Ke.length>we.length){for(;Xt--;)if(we.codePointAt(Xt)===47){if($t){ot=Xt+1;break}}else ut<0&&($t=!0,ut=Xt+1);return ut<0?"":we.slice(ot,ut)}if(Ke===we)return"";let cr=-1,kr=Ke.length-1;for(;Xt--;)if(we.codePointAt(Xt)===47){if($t){ot=Xt+1;break}}else cr<0&&($t=!0,cr=Xt+1),kr>-1&&(we.codePointAt(Xt)===Ke.codePointAt(kr--)?kr<0&&(ut=Xt):(kr=-1,ut=cr));return ot===ut?ut=cr:ut<0&&(ut=we.length),we.slice(ot,ut)}function Xq(we){if(FT(we),we.length===0)return".";let Ke=-1,ot=we.length,ut;for(;--ot;)if(we.codePointAt(ot)===47){if(ut){Ke=ot;break}}else ut||(ut=!0);return Ke<0?we.codePointAt(0)===47?"/":".":Ke===1&&we.codePointAt(0)===47?"//":we.slice(0,Ke)}function Yq(we){FT(we);let Ke=we.length,ot=-1,ut=0,Xt=-1,$t=0,cr;for(;Ke--;){const kr=we.codePointAt(Ke);if(kr===47){if(cr){ut=Ke+1;break}continue}ot<0&&(cr=!0,ot=Ke+1),kr===46?Xt<0?Xt=Ke:$t!==1&&($t=1):Xt>-1&&($t=-1)}return Xt<0||ot<0||$t===0||$t===1&&Xt===ot-1&&Xt===ut+1?"":we.slice(Xt,ot)}function Zq(...we){let Ke=-1,ot;for(;++Ke0&&we.codePointAt(we.length-1)===47&&(ot+="/"),Ke?"/"+ot:ot}function $q(we,Ke){let ot="",ut=0,Xt=-1,$t=0,cr=-1,kr,tn;for(;++cr<=we.length;){if(cr2){if(tn=ot.lastIndexOf("/"),tn!==ot.length-1){tn<0?(ot="",ut=0):(ot=ot.slice(0,tn),ut=ot.length-1-ot.lastIndexOf("/")),Xt=cr,$t=0;continue}}else if(ot.length>0){ot="",ut=0,Xt=cr,$t=0;continue}}Ke&&(ot=ot.length>0?ot+"/..":"..",ut=2)}else ot.length>0?ot+="/"+we.slice(Xt+1,cr):ot=we.slice(Xt+1,cr),ut=cr-Xt-1;Xt=cr,$t=0}else kr===46&&$t>-1?$t++:$t=-1}return ot}function FT(we){if(typeof we!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(we))}const Kq={cwd:Jq};function Jq(){return"/"}function Fk(we){return!!(we!==null&&typeof we=="object"&&"href"in we&&we.href&&"protocol"in we&&we.protocol&&we.auth===void 0)}function Qq(we){if(typeof we=="string")we=new URL(we);else if(!Fk(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 eV(we)}function eV(we){if(we.hostname!==""){const ut=new TypeError('File URL host must be "localhost" or empty on darwin');throw ut.code="ERR_INVALID_FILE_URL_HOST",ut}const Ke=we.pathname;let ot=-1;for(;++ot0){let[Bn,...Gi]=yn;const bo=ut[ea][1];Ok(bo)&&Ok(Bn)&&(Bn=hk(!0,bo,Bn)),ut[ea]=[Ur,Bn,...Gi]}}}}const aV=new rC().freeze();function mk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `parser`")}function gk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `compiler`")}function yk(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 N4(we){if(!Ok(we)||typeof we.type!="string")throw new TypeError("Expected node, got `"+we+"`")}function U4(we,Ke,ot){if(!ot)throw new Error("`"+we+"` finished async. Use `"+Ke+"` instead")}function aM(we){return iV(we)?we:new $P(we)}function iV(we){return!!(we&&typeof we=="object"&&"message"in we&&"messages"in we)}function oV(we){return typeof we=="string"||sV(we)}function sV(we){return!!(we&&typeof we=="object"&&"byteLength"in we&&"byteOffset"in we)}const lV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",j4=[],q4={allowDangerousHtml:!0},uV=/^(https?|ircs?|mailto|xmpp)$/i,cV=[{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 fV(we){const Ke=hV(we),ot=dV(we);return vV(Ke.runSync(Ke.parse(ot),ot),we)}function hV(we){const Ke=we.rehypePlugins||j4,ot=we.remarkPlugins||j4,ut=we.remarkRehypeOptions?{...we.remarkRehypeOptions,...q4}:q4;return aV().use(Gj).use(ot).use(Uq,ut).use(Ke)}function dV(we){const Ke=we.children||"",ot=new $P;return typeof Ke=="string"&&(ot.value=Ke),ot}function vV(we,Ke){const ot=Ke.allowedElements,ut=Ke.allowElement,Xt=Ke.components,$t=Ke.disallowedElements,cr=Ke.skipHtml,kr=Ke.unwrapDisallowed,tn=Ke.urlTransform||pV;for(const yn of cV)Object.hasOwn(Ke,yn.from)&&(""+yn.from+(yn.to?"use `"+yn.to+"` instead":"remove it")+lV+yn.id,void 0);return WP(we,Ur),AN(we,{Fragment:ra.Fragment,components:Xt,ignoreInvalidStyle:!0,jsx:ra.jsx,jsxs:ra.jsxs,passKeys:!0,passNode:!0});function Ur(yn,Mn,ea){if(yn.type==="raw"&&ea&&typeof Mn=="number")return cr?ea.children.splice(Mn,1):ea.children[Mn]={type:"text",value:yn.value},Mn;if(yn.type==="element"){let Bn;for(Bn in lk)if(Object.hasOwn(lk,Bn)&&Object.hasOwn(yn.properties,Bn)){const Gi=yn.properties[Bn],bo=lk[Bn];(bo===null||bo.includes(yn.tagName))&&(yn.properties[Bn]=tn(String(Gi||""),Bn,yn))}}if(yn.type==="element"){let Bn=ot?!ot.includes(yn.tagName):$t?$t.includes(yn.tagName):!1;if(!Bn&&ut&&typeof Mn=="number"&&(Bn=!ut(yn,Mn,ea)),Bn&&ea&&typeof Mn=="number")return kr&&yn.children?ea.children.splice(Mn,1,...yn.children):ea.children.splice(Mn,1),Mn}}}function pV(we){const Ke=we.indexOf(":"),ot=we.indexOf("?"),ut=we.indexOf("#"),Xt=we.indexOf("/");return Ke===-1||Xt!==-1&&Ke>Xt||ot!==-1&&Ke>ot||ut!==-1&&Ke>ut||uV.test(we.slice(0,Ke))?we:""}const mV="Watch an optimiser walk downhill on a function you choose, one iteration at a time.\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. **Optimiser:** 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, 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\nThe **Metrics** tab shows the current point with f, the gradient and the Hessian (or f′ and f″ with one variable), and a chart of f at each iteration. 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). Tick **Gradient field** to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. **Surface** shows f in 3D; drag to turn it.\n\n## Compare\n\nIn the **Compare** tab, press **+ Add optimiser** for another run on the same function. Click a run to open it and change its algorithm, settings and initial point; every run steps together, from the start again after a change. Click a run's colour to pick another, or × to remove it. Run 1 is the main run from Configure: editing it here changes it there too.\n\n## Plot\n\nDrag to pan and scroll to zoom. The function is redrawn for the new view.\n";function gV(){return ra.jsx("div",{className:"prose leading-loose",children:ra.jsx(fV,{components:{h2:({children:we})=>ra.jsx("h2",{className:"text-xl font-semibold mt-12 mb-2 first:mt-4",children:we}),p:({children:we})=>ra.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:we}),ol:({children:we})=>ra.jsx("ol",{className:"list-decimal pl-5 mb-3",children:we}),li:({children:we})=>ra.jsx("li",{className:"mb-1",children:we}),code:({children:we})=>ra.jsx("code",{className:"bg-gray-200 px-1 py-0.5 rounded",children:we})},children:mV})})}const KP=Symbol("Comlink.proxy"),yV=Symbol("Comlink.endpoint"),_V=Symbol("Comlink.releaseProxy"),_k=Symbol("Comlink.finalizer"),uM=Symbol("Comlink.thrown"),JP=we=>typeof we=="object"&&we!==null||typeof we=="function",xV={canHandle:we=>JP(we)&&we[KP],serialize(we){const{port1:Ke,port2:ot}=new MessageChannel;return eR(we,Ke),[ot,[ot]]},deserialize(we){return we.start(),rR(we)}},bV={canHandle:we=>JP(we)&&uM 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}},QP=new Map([["proxy",xV],["throw",bV]]);function wV(we,Ke){for(const ot of we)if(Ke===ot||ot==="*"||ot instanceof RegExp&&ot.test(Ke))return!0;return!1}function eR(we,Ke=globalThis,ot=["*"]){Ke.addEventListener("message",function ut(Xt){if(!Xt||!Xt.data)return;if(!wV(ot,Xt.origin)){console.warn(`Invalid origin '${Xt.origin}' for comlink proxy`);return}const{id:$t,type:cr,path:kr}=Object.assign({path:[]},Xt.data),tn=(Xt.data.argumentList||[]).map(rx);let Ur;try{const yn=kr.slice(0,-1).reduce((ea,Bn)=>ea[Bn],we),Mn=kr.reduce((ea,Bn)=>ea[Bn],we);switch(cr){case"GET":Ur=Mn;break;case"SET":yn[kr.slice(-1)[0]]=rx(Xt.data.value),Ur=!0;break;case"APPLY":Ur=Mn.apply(yn,tn);break;case"CONSTRUCT":{const ea=new Mn(...tn);Ur=kV(ea)}break;case"ENDPOINT":{const{port1:ea,port2:Bn}=new MessageChannel;eR(we,Bn),Ur=EV(ea,[ea])}break;case"RELEASE":Ur=void 0;break;default:return}}catch(yn){Ur={value:yn,[uM]:0}}Promise.resolve(Ur).catch(yn=>({value:yn,[uM]:0})).then(yn=>{const[Mn,ea]=yM(yn);Ke.postMessage(Object.assign(Object.assign({},Mn),{id:$t}),ea),cr==="RELEASE"&&(Ke.removeEventListener("message",ut),tR(Ke),_k in we&&typeof we[_k]=="function"&&we[_k]())}).catch(yn=>{const[Mn,ea]=yM({value:new TypeError("Unserializable return value"),[uM]:0});Ke.postMessage(Object.assign(Object.assign({},Mn),{id:$t}),ea)})}),Ke.start&&Ke.start()}function TV(we){return we.constructor.name==="MessagePort"}function tR(we){TV(we)&&we.close()}function rR(we,Ke){const ot=new Map;return we.addEventListener("message",function(Xt){const{data:$t}=Xt;if(!$t||!$t.id)return;const cr=ot.get($t.id);if(cr)try{cr($t)}finally{ot.delete($t.id)}}),Bk(we,ot,[],Ke)}function iM(we){if(we)throw new Error("Proxy has been released and is not useable")}function nR(we){return Dw(we,new Map,{type:"RELEASE"}).then(()=>{tR(we)})}const mM=new WeakMap,gM="FinalizationRegistry"in globalThis&&new FinalizationRegistry(we=>{const Ke=(mM.get(we)||0)-1;mM.set(we,Ke),Ke===0&&nR(we)});function AV(we,Ke){const ot=(mM.get(Ke)||0)+1;mM.set(Ke,ot),gM&&gM.register(we,Ke,we)}function SV(we){gM&&gM.unregister(we)}function Bk(we,Ke,ot=[],ut=function(){}){let Xt=!1;const $t=new Proxy(ut,{get(cr,kr){if(iM(Xt),kr===_V)return()=>{SV($t),nR(we),Ke.clear(),Xt=!0};if(kr==="then"){if(ot.length===0)return{then:()=>$t};const tn=Dw(we,Ke,{type:"GET",path:ot.map(Ur=>Ur.toString())}).then(rx);return tn.then.bind(tn)}return Bk(we,Ke,[...ot,kr])},set(cr,kr,tn){iM(Xt);const[Ur,yn]=yM(tn);return Dw(we,Ke,{type:"SET",path:[...ot,kr].map(Mn=>Mn.toString()),value:Ur},yn).then(rx)},apply(cr,kr,tn){iM(Xt);const Ur=ot[ot.length-1];if(Ur===yV)return Dw(we,Ke,{type:"ENDPOINT"}).then(rx);if(Ur==="bind")return Bk(we,Ke,ot.slice(0,-1));const[yn,Mn]=V4(tn);return Dw(we,Ke,{type:"APPLY",path:ot.map(ea=>ea.toString()),argumentList:yn},Mn).then(rx)},construct(cr,kr){iM(Xt);const[tn,Ur]=V4(kr);return Dw(we,Ke,{type:"CONSTRUCT",path:ot.map(yn=>yn.toString()),argumentList:tn},Ur).then(rx)}});return AV($t,we),$t}function MV(we){return Array.prototype.concat.apply([],we)}function V4(we){const Ke=we.map(yM);return[Ke.map(ot=>ot[0]),MV(Ke.map(ot=>ot[1]))]}const aR=new WeakMap;function EV(we,Ke){return aR.set(we,Ke),we}function kV(we){return Object.assign(we,{[KP]:!0})}function yM(we){for(const[Ke,ot]of QP)if(ot.canHandle(we)){const[ut,Xt]=ot.serialize(we);return[{type:"HANDLER",name:Ke,value:ut},Xt]}return[{type:"RAW",value:we},aR.get(we)||[]]}function rx(we){switch(we.type){case"HANDLER":return QP.get(we.name).deserialize(we.value);case"RAW":return we.value}}function Dw(we,Ke,ot,ut){return new Promise(Xt=>{const $t=CV();Ke.set($t,Xt),we.start&&we.start(),we.postMessage(Object.assign({id:$t},ot),ut)})}function CV(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function LV(we){const Ke=rR(we),ot=new Set;let ut="loading";Ke.init().then(()=>Xt("ready"),$t=>{console.error("Python failed to load:",$t),Xt("failed")});function Xt($t){ut=$t,ot.forEach(cr=>cr())}return{call:($t,...cr)=>Ke.call($t,cr[0]),getStatus:()=>ut,subscribe($t){return ot.add($t),()=>ot.delete($t)}}}function PV(we){return ru.useSyncExternalStore(we.subscribe,we.getStatus)}const LT=LV(new Worker(new URL("/assets/pyodide.worker-CoStWDaX.js",import.meta.url),{type:"module"})),H4=500,RV=200,IV=_1.length;function DV(we){const Ke=we.filter($t=>$t!==null&&Number.isFinite($t));if(Ke.length===0)return null;const ot=Math.min(...Ke),ut=Math.max(...Ke),Xt=ut>ot?.1*(ut-ot):1;return[ot-Xt,ut+Xt]}function xk([we,Ke],ot){const ut=Math.max(0,2-Math.floor(Math.log10(Math.abs(Ke-we))));return String(Number(ot.toFixed(ut)))}function G4(we){return{algorithm:"gradient_descent",params:{},startText:we.map(String)}}function X4(we,Ke,ot){const ut=we.startText.map($t=>$t.trim()===""?NaN:Number($t)),Xt={algorithm:we.algorithm,start:ut,params:we.params};return{algorithm:we.algorithm,params:we.params,startText:we.startText,startValid:ut.every(Number.isFinite),settings:Xt,setStartText($t){Ke(cr=>({...cr,startText:$t}))},changeAlgorithm($t){Ke(cr=>({...cr,algorithm:$t,params:{}}))},changeParams($t){ot(),Ke(cr=>({...cr,params:$t}))},changeStart($t,cr){ot(),Ke(kr=>({...kr,startText:kr.startText.map((tn,Ur)=>Ur===$t?cr:tn)}))}}}function zV(){const we=PV(LT),Ke=Fw[1][0],[ot,ut]=ru.useState(Ke.expression),Xt=W8(ot),[$t,cr]=ru.useState(()=>G4(Ke.start)),[kr,tn]=ru.useState([]),Ur=ru.useRef(2),[yn,Mn]=ru.useState(!1),[ea,Bn]=ru.useState(!1),[Gi,bo]=ru.useState(null),[eo,li]=ru.useState(null),[Ge,wo]=ru.useState(null),[vl,Eo]=ru.useState([]),ui=ru.useRef(Ke.x),mo=ru.useRef([-1,1]),Rs=ru.useRef(!0),ki=ru.useRef(0),$s=()=>{ki.current=H4},Di=X4($t,cr,$s),zo=kr.map(qs=>X4(qs,Ul=>tn(lu=>lu.map(Vc=>Vc.id===qs.id?{...Vc,...Ul(Vc)}:Vc)),$s)),Nl=ru.useRef(null),Si=ru.useRef(0),Ii=ru.useRef([]),Ti=[{id:1,settings:Di.settings,color:_1[0].value,label:`1 · ${dM(Di.algorithm).label}`},...kr.map((qs,Ul)=>({id:qs.id,settings:zo[Ul].settings,color:qs.color,label:`${qs.id} · ${dM(qs.algorithm).label}`}))],So=Ti.map(qs=>qs.settings),ws=Di.startValid&&zo.every(qs=>qs.startValid),bu=ru.useCallback(async qs=>{const Ul=Si.current,lu=await LT.call("handle_state",{iteration:qs});if(!lu.ok)throw new Error(lu.error.message);return lu.data&&Ul===Si.current&&(Ii.current[qs]=lu.data),lu.data},[]),ba=wB(bu,{intervalMs:RV}),{stepper:qa}=ba;async function ro(){const qs=await LT.call("handle_function_values",{x_range:ui.current,y_range:mo.current});if(!qs.ok){console.error(`Python ${qs.error.kind} error: ${qs.error.message}`);return}const Ul=qs.data;Ul&&!("y"in Ul)&&Rs.current&&(mo.current=DV(Ul.f)??mo.current),Rs.current=!1,wo(Ul)}async function Kn(qs,Ul){const lu=++Si.current;if(qa.pause(),qs!==Nl.current){Nl.current=null;const Wd=await LT.call("handle_set_function",{variables:Xt,expression:ot});if(lu!==Si.current)return;if(bo(Wd.ok?null:Wd.error.message),!Wd.ok){wo(null),Eo([]),Ii.current=[],await qa.restart();return}if(Nl.current=qs,Rs.current=!0,await ro(),lu!==Si.current)return}const Vc=await LT.call("handle_set_runs",{runs:Ul.map(Wd=>Wd.settings)});lu===Si.current&&(li(Vc.ok?null:Vc.error.message),Ii.current=[],Eo(Vc.ok?Ul:[]),await qa.restart())}const vs=`${Xt} +${ot}`,Is=JSON.stringify(So);ru.useEffect(()=>{if(!ws)return;const qs=setTimeout(()=>Kn(vs,Ti),ki.current);return ki.current=0,()=>clearTimeout(qs)},[vs,Is]);function Ki(qs,Ul){const lu=W8(qs);if(ut(qs),lu!==Xt&&(Eo([]),wo(null),!Ul)){const Vc=Wd=>lu===2?[Wd[0],"0"]:[Wd[0]];Di.setStartText(Vc(Di.startText)),tn(Wd=>Wd.map($g=>({...$g,startText:Vc($g.startText)}))),lu===2&&(mo.current=ui.current)}Ul&&(Di.setStartText(Ul.start.map(String)),tn(Vc=>Vc.map(Wd=>({...Wd,startText:Ul.start.map(String)}))),ui.current=Ul.x,Ul.y&&(mo.current=Ul.y))}function Ns(qs){Ki(qs.expression,qs)}function ff(qs){ki.current=H4,Ki(qs)}function tc(qs,Ul,lu){qs.setStartText(Xt===1?[xk(ui.current,Ul)]:[xk(ui.current,Ul),xk(mo.current,lu)])}function Od(qs){const Ul=([lu,Vc])=>lu+(.05+.9*Math.random())*(Vc-lu);tc(qs,Ul(ui.current),Ul(mo.current))}function Gl(){return(Mk.find(qs=>qs.expression===ot)??Fw[Xt][0]).start}function pp(qs){qs.setStartText(Gl().map(String))}function Xf(){const qs=new Set([_1[0].value,...kr.map(Vc=>Vc.color)]),Ul=_1.find(Vc=>!qs.has(Vc.value))?.value??_1[1].value,lu=Ur.current++;return tn([...kr,{id:lu,color:Ul,...G4(Gl())}]),lu}function go(qs){const Ul=kr.filter(lu=>lu.id!==qs);Ul.length===0&&(Ur.current=2),tn(Ul)}function kv(qs,Ul){ui.current=qs,mo.current=Ul,ro()}const mp=Ii.current.slice(0,ba.iteration+1),Wg=vl.map((qs,Ul)=>({...qs,color:kr.find(lu=>lu.id===qs.id)?.color??qs.color,path:mp.map(lu=>lu?.runs[Ul]?.point).filter(lu=>!!lu),stopped:ba.state?.runs[Ul]?.stopped??null}));return{pythonStatus:we,variables:Xt,expression:ot,changeExpression:ff,choosePreset:Ns,functionError:Gi,surface:yn,setSurface:Mn,showArrows:ea,setShowArrows:Bn,main:Di,setStartAt:(qs,Ul)=>tc(Di,qs,Ul),randomStart:Od,resetStart:pp,runError:eo,comparisons:kr.map((qs,Ul)=>({id:qs.id,color:qs.color,editor:zo[Ul]})),canAddComparison:kr.length+1tn(lu=>lu.map(Vc=>Vc.id===qs?{...Vc,color:Ul}:Vc)),values:Ge,xRange:ui,yRange:mo,handleViewChange:kv,trajectories:Wg,step:ba}}const OV=[{label:"Univariate: f(x)",options:Fw[1].map(we=>we.name)},{label:"Bivariate: f(x, y)",options:Fw[2].map(we=>we.name)}],FV=[{value:"contour",label:"Contour"},{value:"surface",label:"Surface"}],oM="text-sm text-ink-muted";function BV(){const we=zV(),Ke=Mk.find(kr=>kr.expression===we.expression),ot=we.variables===2,ut=we.trajectories[0],Xt=ut?.path[ut.path.length-1],[$t,cr]=ru.useState(null);return ra.jsx(vB,{title:"Optimisation",usage:ra.jsx(gV,{}),examples:ra.jsx("p",{children:"Examples are coming soon."}),tabs:[{label:"Configure",content:ra.jsxs(ra.Fragment,{children:[ra.jsxs(W6,{label:"Function",children:[ra.jsx(uP,{label:"Function",hideLabel:!0,options:Ke?[]:[Z8],groupedOptions:OV,activeOption:Ke?.name??Z8,onChange:kr=>{const tn=Mk.find(Ur=>Ur.name===kr);tn&&we.choosePreset(tn)}}),ra.jsx(wk,{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}),ot&&ra.jsxs("div",{className:"grid grid-cols-3 items-center",children:[ra.jsx("div",{className:"col-span-2",children:ra.jsx(_B,{label:"Plot",options:FV,value:we.surface?"surface":"contour",onChange:kr=>we.setSurface(kr==="surface")})}),ra.jsxs("label",{title:we.surface?"Only on the contour plot":void 0,className:`flex items-center justify-end gap-1.5 whitespace-nowrap text-sm text-gray-700 ${we.surface?"opacity-50":"cursor-pointer"}`,children:[ra.jsx("input",{type:"checkbox",checked:we.showArrows,disabled:we.surface,onChange:kr=>we.setShowArrows(kr.target.checked),className:"size-4 accent-ink"}),"Gradient field"]})]})]}),ra.jsx(H8,{}),ra.jsx(W6,{label:"Optimiser",children:ra.jsx(pP,{editor:we.main,twoVariables:ot,onResetStart:()=>we.resetStart(we.main),onRandomStart:()=>we.randomStart(we.main),hint:ot&&we.surface?void 0:"Or click the plot to move the initial point."})})]})},{label:"Compare",content:ra.jsxs(ra.Fragment,{children:[ra.jsx("p",{className:oM,children:"Add optimisers to compare trajectories"}),ra.jsxs("ul",{className:"flex flex-col gap-2",children:[ra.jsx(Y4,{id:1,color:_1[0].value,editor:we.main,trajectory:ut,note:"Also set in Configure",open:$t===1,onToggle:()=>cr($t===1?null:1),twoVariables:ot,onResetStart:()=>we.resetStart(we.main),onRandomStart:()=>we.randomStart(we.main)}),we.comparisons.map(kr=>ra.jsx(Y4,{id:kr.id,color:kr.color,editor:kr.editor,trajectory:we.trajectories.find(tn=>tn.id===kr.id),taken:[_1[0].value,...we.comparisons.map(tn=>tn.color)],open:$t===kr.id,onToggle:()=>cr($t===kr.id?null:kr.id),onColorChange:tn=>we.setComparisonColor(kr.id,tn),onRemove:()=>we.removeComparison(kr.id),twoVariables:ot,onResetStart:()=>we.resetStart(kr.editor),onRandomStart:()=>we.randomStart(kr.editor)},kr.id))]}),ra.jsx(fM,{label:"+ Add optimiser",onClick:()=>cr(we.addComparison()),disabled:!we.canAddComparison})]})},{label:"Metrics",content:Xt?ra.jsxs(ra.Fragment,{children:[ra.jsx(LB,{title:"Current point",items:NV(Xt)}),ra.jsx(H8,{}),ra.jsx(W6,{label:"History",children:ra.jsx(VB,{trajectories:we.trajectories})})]}):ra.jsx("p",{className:oM,children:"Step the optimiser to see the current point and its history."})}],footer:ra.jsxs(ra.Fragment,{children:[we.pythonStatus==="loading"&&ra.jsx("p",{className:oM,children:"Loading Python… actions will run once it is ready."}),we.pythonStatus==="failed"&&ra.jsx("p",{className:"text-red-600 font-semibold",children:"Python failed to load. Try reloading the page."}),we.runError&&ra.jsx("p",{className:"text-red-600 font-semibold",children:we.runError}),ra.jsx(AB,{stepper:we.step}),we.trajectories.filter(kr=>kr.stopped).map(kr=>ra.jsxs("p",{className:oM,children:[kr.label," stopped at iteration ",kr.path.length-1,". ",kr.stopped]},kr.label))]}),children:ra.jsx(GB,{values:we.values,trajectories:we.trajectories,xRange:we.xRange,yRange:we.yRange,onViewChange:we.handleViewChange,onClick:we.setStartAt,surface:we.surface,arrows:we.showArrows})})}function NV(we){return we.position.length===1?[{name:"x",kind:"scalar",value:we.position[0]},{name:"f(x)",kind:"scalar",value:we.value},{name:"f′(x)",kind:"scalar",value:we.gradient[0]},{name:"f″(x)",kind:"scalar",value:we.hessian[0][0]}]:[{name:"Position",kind:"vector",value:{labels:["x","y"],values:we.position}},{name:"f(x, y)",kind:"scalar",value:we.value},{name:"Gradient ∇f",kind:"vector",value:{labels:["∂f/∂x","∂f/∂y"],values:we.gradient}},{name:"Hessian",kind:"matrix",value:{rows:["x","y"],columns:["x","y"],values:we.hessian}}]}function UV({trajectory:we}){const Ke=we?.path[we.path.length-1];return Ke?ra.jsxs("span",{className:"shrink-0 font-mono text-ink",children:["f = ",Number(Ke.value.toPrecision(3))]}):null}function Y4({id:we,color:Ke,editor:ot,trajectory:ut,note:Xt,open:$t,onToggle:cr,onColorChange:kr,onRemove:tn,taken:Ur=[],twoVariables:yn,onResetStart:Mn,onRandomStart:ea}){const Bn=`${we} · ${dM(ot.algorithm).label}`;return ra.jsxs("li",{className:"rounded-md border-[1.5px] border-grid",children:[ra.jsxs("div",{className:"flex items-center gap-2 py-1 pl-1 pr-1",children:[kr?ra.jsx(yB,{label:`Colour of run ${we}`,colors:_1,value:Ke,onChange:kr,taken:Ur}):ra.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center",title:`Run ${we}'s colour is fixed`,children:ra.jsx("span",{"aria-hidden":!0,className:"block size-6 rounded-full border-2 border-white ring-[1.5px] ring-grid",style:{backgroundColor:Ke}})}),ra.jsxs("button",{type:"button",onClick:cr,"aria-expanded":$t,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 self-stretch rounded px-1 text-left text-sm text-gray-700 hover:bg-paper",children:[ra.jsxs("span",{className:"min-w-0 flex-1",children:[ra.jsx("span",{className:"block truncate",children:Bn}),Xt&&ra.jsx("span",{className:"block text-xs text-ink-muted",children:Xt}),!ot.startValid&&ra.jsx("span",{className:"block text-xs font-semibold text-red-600",children:"Check the initial point"})]}),ra.jsx(UV,{trajectory:ut}),ra.jsx(aB,{size:16,"aria-hidden":!0,className:`shrink-0 text-ink-muted transition-transform ${$t?"rotate-180":""}`})]}),tn&&ra.jsx(PT,{label:`Remove run ${we}`,onClick:tn,children:ra.jsx(oP,{size:16})})]}),$t&&ra.jsx("div",{className:"flex flex-col gap-4 border-t border-grid p-3",children:ra.jsx(pP,{editor:ot,twoVariables:yn,onResetStart:Mn,onRandomStart:ea})})]})}XF.createRoot(document.getElementById("root")).render(ra.jsx(ru.StrictMode,{children:ra.jsx(BV,{})})); diff --git a/dist/assets/index-fjwvheKn 2.css b/dist/assets/index-fjwvheKn 2.css new file mode 100644 index 0000000000000000000000000000000000000000..db8533bac1dfd4307b967af8b23c4da837919266 --- /dev/null +++ b/dist/assets/index-fjwvheKn 2.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-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-paper:#f6f7f3;--color-grid:#e3e7ee}}@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{.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)}.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-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}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.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)}.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-\[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-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}.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}.justify-end{justify-content:flex-end}.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-y-1{row-gap:calc(var(--spacing)*1)}.self-center{align-self:center}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.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-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-l-\[1\.5px\]{border-left-style:var(--tw-border-style);border-left-width:1.5px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-grid{border-color:var(--color-grid)}.border-ink{border-color:var(--color-ink)}.border-orange-400{border-color:var(--color-orange-400)}.border-red-600{border-color:var(--color-red-600)}.border-slate-200{border-color:var(--color-slate-200)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-t-blue-600{border-top-color:var(--color-blue-600)}.border-b-white{border-bottom-color:var(--color-white)}.bg-gray-200{background-color:var(--color-gray-200)}.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-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-\[linear-gradient\(transparent_58\%\,var\(--color-marker\)_58\%\,var\(--color-marker\)_92\%\,transparent_92\%\)\]{background-image:linear-gradient(transparent 58%,var(--color-marker)58%,var(--color-marker)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-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)}.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-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-orange-400{color:var(--color-orange-400)}.text-red-600{color:var(--color-red-600)}.text-slate-800{color:var(--color-slate-800)}.text-white{color:var(--color-white)}.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-red-600{outline-color:var(--color-red-600)}.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)}.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)}.first\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}.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-ink:focus-within{outline-color:var(--color-ink)}.focus-within\:outline-red-600:focus-within{outline-color:var(--color-red-600)}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-paper:hover{background-color:var(--color-paper)}}.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))}}}@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}@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-fjwvheKn.css b/dist/assets/index-fjwvheKn.css new file mode 100644 index 0000000000000000000000000000000000000000..db8533bac1dfd4307b967af8b23c4da837919266 --- /dev/null +++ b/dist/assets/index-fjwvheKn.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-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-paper:#f6f7f3;--color-grid:#e3e7ee}}@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{.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)}.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-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}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.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)}.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-\[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-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}.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}.justify-end{justify-content:flex-end}.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-y-1{row-gap:calc(var(--spacing)*1)}.self-center{align-self:center}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.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-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-l-\[1\.5px\]{border-left-style:var(--tw-border-style);border-left-width:1.5px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-grid{border-color:var(--color-grid)}.border-ink{border-color:var(--color-ink)}.border-orange-400{border-color:var(--color-orange-400)}.border-red-600{border-color:var(--color-red-600)}.border-slate-200{border-color:var(--color-slate-200)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-t-blue-600{border-top-color:var(--color-blue-600)}.border-b-white{border-bottom-color:var(--color-white)}.bg-gray-200{background-color:var(--color-gray-200)}.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-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-\[linear-gradient\(transparent_58\%\,var\(--color-marker\)_58\%\,var\(--color-marker\)_92\%\,transparent_92\%\)\]{background-image:linear-gradient(transparent 58%,var(--color-marker)58%,var(--color-marker)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-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)}.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-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-orange-400{color:var(--color-orange-400)}.text-red-600{color:var(--color-red-600)}.text-slate-800{color:var(--color-slate-800)}.text-white{color:var(--color-white)}.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-red-600{outline-color:var(--color-red-600)}.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)}.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)}.first\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}.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-ink:focus-within{outline-color:var(--color-ink)}.focus-within\:outline-red-600:focus-within{outline-color:var(--color-red-600)}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-paper:hover{background-color:var(--color-paper)}}.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))}}}@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}@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/instrument-sans-latin-ext-wght-normal-B5bTHO_g 2.woff2 b/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0ea0da04cb2bdacb918460c16ca2863138a19f4d Binary files /dev/null and b/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g 2.woff2 differ 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 2.woff2 b/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg 2.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..8611e41b14c75cfc8360e50d0d22a22d20a1de50 Binary files /dev/null and b/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg 2.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-CoStWDaX 2.js b/dist/assets/pyodide.worker-CoStWDaX 2.js new file mode 100644 index 0000000000000000000000000000000000000000..27eb9b9cea9624fb005373496ef79e9c83f44444 --- /dev/null +++ b/dist/assets/pyodide.worker-CoStWDaX 2.js @@ -0,0 +1,410 @@ +(function(){"use strict";const S=Symbol("Comlink.proxy"),M=Symbol("Comlink.endpoint"),L=Symbol("Comlink.releaseProxy"),x=Symbol("Comlink.finalizer"),b=Symbol("Comlink.thrown"),j=e=>typeof e=="object"&&e!==null||typeof e=="function",D={canHandle:e=>j(e)&&e[S],serialize(e){const{port1:n,port2:t}=new MessageChannel;return E(e,n),[t,[t]]},deserialize(e){return e.start(),z(e)}},V={canHandle:e=>j(e)&&b 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}},A=new Map([["proxy",D],["throw",V]]);function C(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(!C(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=F(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;E(e,g),r=W(p,[p])}break;case"RELEASE":r=void 0;break;default:return}}catch(s){r={value:s,[b]:0}}Promise.resolve(r).catch(s=>({value:s,[b]:0})).then(s=>{const[l,p]=_(s);n.postMessage(Object.assign(Object.assign({},l),{id:a}),p),d==="RELEASE"&&(n.removeEventListener("message",u),R(n),x in e&&typeof e[x]=="function"&&e[x]())}).catch(s=>{const[l,p]=_({value:new TypeError("Unserializable return value"),[b]:0});n.postMessage(Object.assign(Object.assign({},l),{id:a}),p)})}),n.start&&n.start()}function H(e){return e.constructor.name==="MessagePort"}function R(e){H(e)&&e.close()}function z(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 v(e){if(e)throw new Error("Proxy has been released and is not useable")}function O(e){return m(e,new Map,{type:"RELEASE"}).then(()=>{R(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&&O(e)});function q(e,n){const t=(y.get(n)||0)+1;y.set(n,t),h&&h.register(e,n,e)}function G(e){h&&h.unregister(e)}function w(e,n,t=[],u=function(){}){let i=!1;const a=new Proxy(u,{get(d,f){if(v(i),f===L)return()=>{G(a),O(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){v(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){v(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]=I(o);return m(e,n,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:s},l).then(c)},construct(d,f){v(i);const[o,r]=I(f);return m(e,n,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:o},r).then(c)}});return q(a,e),a}function U(e){return Array.prototype.concat.apply([],e)}function I(e){const n=e.map(_);return[n.map(t=>t[0]),U(n.map(t=>t[1]))]}const P=new WeakMap;function W(e,n){return P.set(e,n),e}function F(e){return Object.assign(e,{[S]:!0})}function _(e){for(const[n,t]of A)if(t.canHandle(e)){const[u,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:u},i]}return[{type:"RAW",value:e},P.get(e)||[]]}function c(e){switch(e.type){case"HANDLER":return A.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 T="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(`${T}pyodide.mjs`);n=await a({indexURL:T}),await n.loadPackage(e.packages);for(const[o,r]of Object.entries(e.files))n.FS.writeFile(o,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?.()}}})}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 X=`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 +# 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: + self._objective = Objective(expr, n) + except Exception: + raise UserError("This function can't be differentiated here. Try writing it another way.") + + 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 None} + for run, p, end in zip(self._runs, points, ended) + ] + } +`,Y=`"""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 numpy as np +from sympy import Abs, Expr, 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, +} + + +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] + names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES + try: + expr = parse_expr( + expression, + local_dict=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: + allowed = " and ".join(str(v) for v in variables) + raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: use only {allowed}.") + return expr + + +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, expr.diff(v), modules="numpy") for v in variables] + self._hessian = [[lambdify(variables, expr.diff(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 + 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 + 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 the denominator 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 the denominator 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 the denominator 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":X,"logic.py":Y,"algorithms.json":K}})})(); diff --git a/dist/assets/pyodide.worker-CoStWDaX.js b/dist/assets/pyodide.worker-CoStWDaX.js new file mode 100644 index 0000000000000000000000000000000000000000..27eb9b9cea9624fb005373496ef79e9c83f44444 --- /dev/null +++ b/dist/assets/pyodide.worker-CoStWDaX.js @@ -0,0 +1,410 @@ +(function(){"use strict";const S=Symbol("Comlink.proxy"),M=Symbol("Comlink.endpoint"),L=Symbol("Comlink.releaseProxy"),x=Symbol("Comlink.finalizer"),b=Symbol("Comlink.thrown"),j=e=>typeof e=="object"&&e!==null||typeof e=="function",D={canHandle:e=>j(e)&&e[S],serialize(e){const{port1:n,port2:t}=new MessageChannel;return E(e,n),[t,[t]]},deserialize(e){return e.start(),z(e)}},V={canHandle:e=>j(e)&&b 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}},A=new Map([["proxy",D],["throw",V]]);function C(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(!C(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=F(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;E(e,g),r=W(p,[p])}break;case"RELEASE":r=void 0;break;default:return}}catch(s){r={value:s,[b]:0}}Promise.resolve(r).catch(s=>({value:s,[b]:0})).then(s=>{const[l,p]=_(s);n.postMessage(Object.assign(Object.assign({},l),{id:a}),p),d==="RELEASE"&&(n.removeEventListener("message",u),R(n),x in e&&typeof e[x]=="function"&&e[x]())}).catch(s=>{const[l,p]=_({value:new TypeError("Unserializable return value"),[b]:0});n.postMessage(Object.assign(Object.assign({},l),{id:a}),p)})}),n.start&&n.start()}function H(e){return e.constructor.name==="MessagePort"}function R(e){H(e)&&e.close()}function z(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 v(e){if(e)throw new Error("Proxy has been released and is not useable")}function O(e){return m(e,new Map,{type:"RELEASE"}).then(()=>{R(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&&O(e)});function q(e,n){const t=(y.get(n)||0)+1;y.set(n,t),h&&h.register(e,n,e)}function G(e){h&&h.unregister(e)}function w(e,n,t=[],u=function(){}){let i=!1;const a=new Proxy(u,{get(d,f){if(v(i),f===L)return()=>{G(a),O(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){v(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){v(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]=I(o);return m(e,n,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:s},l).then(c)},construct(d,f){v(i);const[o,r]=I(f);return m(e,n,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:o},r).then(c)}});return q(a,e),a}function U(e){return Array.prototype.concat.apply([],e)}function I(e){const n=e.map(_);return[n.map(t=>t[0]),U(n.map(t=>t[1]))]}const P=new WeakMap;function W(e,n){return P.set(e,n),e}function F(e){return Object.assign(e,{[S]:!0})}function _(e){for(const[n,t]of A)if(t.canHandle(e)){const[u,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:u},i]}return[{type:"RAW",value:e},P.get(e)||[]]}function c(e){switch(e.type){case"HANDLER":return A.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 T="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(`${T}pyodide.mjs`);n=await a({indexURL:T}),await n.loadPackage(e.packages);for(const[o,r]of Object.entries(e.files))n.FS.writeFile(o,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?.()}}})}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 X=`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 +# 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: + self._objective = Objective(expr, n) + except Exception: + raise UserError("This function can't be differentiated here. Try writing it another way.") + + 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 None} + for run, p, end in zip(self._runs, points, ended) + ] + } +`,Y=`"""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 numpy as np +from sympy import Abs, Expr, 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, +} + + +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] + names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES + try: + expr = parse_expr( + expression, + local_dict=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: + allowed = " and ".join(str(v) for v in variables) + raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: use only {allowed}.") + return expr + + +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, expr.diff(v), modules="numpy") for v in variables] + self._hessian = [[lambdify(variables, expr.diff(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 + 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 + 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 the denominator 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 the denominator 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 the denominator 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":X,"logic.py":Y,"algorithms.json":K}})})(); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..e0cda849dff96c9a5b736676b0d2cb0b3e236e32 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + Optimisation + + + + +
+ + diff --git a/dist/vite.svg b/dist/vite.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7b8dfb1b2a60bd50538bec9f876511b9cac21e3 --- /dev/null +++ b/dist/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontends/package-lock.json b/frontends/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..a4a4345b4304a69a02feda19c15df67c5d22975b --- /dev/null +++ b/frontends/package-lock.json @@ -0,0 +1,1242 @@ +{ + "name": "frontends", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "react-markdown": "^10.1.0" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "license": "MIT", + "peer": true, + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "license": "ISC" + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT", + "peer": true + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-markdown": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz", + "integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/frontends/package.json b/frontends/package.json new file mode 100644 index 0000000000000000000000000000000000000000..19657cacf22c3aab09704a3be7ba71da4077d109 --- /dev/null +++ b/frontends/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "react-markdown": "^10.1.0" + } +} diff --git a/frontends/react/.gitignore b/frontends/react/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a547bf36d8d11a4f89c59c144f24795749086dd1 --- /dev/null +++ b/frontends/react/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontends/react/.prettierrc b/frontends/react/.prettierrc new file mode 100644 index 0000000000000000000000000000000000000000..38c6ce0cfd238b1ec682092ed60dc83126b8e6a9 --- /dev/null +++ b/frontends/react/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "singleQuote": false, + "tabWidth": 2, + "plugins": ["prettier-plugin-tailwindcss"] +} \ No newline at end of file diff --git a/frontends/react/README.md b/frontends/react/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d2e77611fd3d959fee0487c41bd27b318be32b04 --- /dev/null +++ b/frontends/react/README.md @@ -0,0 +1,73 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/frontends/react/env.d.ts b/frontends/react/env.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a19df294ce86f36ed50554be84d1b007c0c566a0 --- /dev/null +++ b/frontends/react/env.d.ts @@ -0,0 +1,9 @@ +declare module "*.py?raw" { + const content: string; + export default content; +} + +declare module "*.md?raw" { + const content: string; + export default content; +} diff --git a/frontends/react/eslint.config.js b/frontends/react/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..5e6b472f583e34a1cca751440d4f241495475723 --- /dev/null +++ b/frontends/react/eslint.config.js @@ -0,0 +1,23 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/frontends/react/index.html b/frontends/react/index.html new file mode 100644 index 0000000000000000000000000000000000000000..6de1cd6bace528a3ec437d0d86f773cb702d9ff4 --- /dev/null +++ b/frontends/react/index.html @@ -0,0 +1,13 @@ + + + + + + + Optimisation + + +
+ + + diff --git a/frontends/react/package-lock.json b/frontends/react/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..a7e56f2c8553ac1f5ee5002b60754a76599b7d4c --- /dev/null +++ b/frontends/react/package-lock.json @@ -0,0 +1,7674 @@ +{ + "name": "optimization", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "optimization", + "version": "0.0.0", + "dependencies": { + "@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", + "react-markdown": "^10.1.0", + "react-plotly.js": "^2.6.0", + "tailwindcss": "^4.1.18" + }, + "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", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "prettier-plugin-tailwindcss": "^0.7.2", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "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", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@choojs/findup": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", + "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", + "license": "MIT", + "dependencies": { + "commander": "^2.15.1" + }, + "bin": { + "findup": "bin/findup.js" + } + }, + "node_modules/@elvis/pyodide": { + "resolved": "../../../../packages/pyodide", + "link": true + }, + "node_modules/@elvis/ui": { + "resolved": "../../../../packages/ui", + "link": true + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "license": "ISC", + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/geojson-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz", + "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw==", + "license": "ISC" + }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", + "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@mapbox/mapbox-gl-supported": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz", + "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==", + "license": "BSD-3-Clause", + "peerDependencies": { + "mapbox-gl": ">=0.32.1 <2.0.0" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", + "license": "ISC" + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz", + "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw==", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/unitbezier": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", + "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "license": "ISC", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", + "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", + "license": "ISC", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^4.0.0", + "minimist": "^1.2.8", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "tinyqueue": "^3.0.0" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "license": "BSD-2-Clause" + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "license": "ISC" + }, + "node_modules/@plotly/d3": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@plotly/d3/-/d3-3.8.2.tgz", + "integrity": "sha512-wvsNmh1GYjyJfyEBPKJLTMzgf2c2bEbSIL50lmqVUi+o1NHaLPi1Lb4v7VxXXJn043BhNyrxUrWI85Q+zmjOVA==", + "license": "BSD-3-Clause" + }, + "node_modules/@plotly/d3-sankey": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey/-/d3-sankey-0.7.2.tgz", + "integrity": "sha512-2jdVos1N3mMp3QW0k2q1ph7Gd6j5PY1YihBrwpkFnKqO+cqtZq3AdEYUeSGXMeLsBDQYiqTVcihYfk8vr5tqhw==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-array": "1", + "d3-collection": "1", + "d3-shape": "^1.2.0" + } + }, + "node_modules/@plotly/d3-sankey-circular": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey-circular/-/d3-sankey-circular-0.33.1.tgz", + "integrity": "sha512-FgBV1HEvCr3DV7RHhDsPXyryknucxtfnLwPtCKKxdolKyTFYoLX/ibEfX39iFYIL7DYbVeRtP43dbFcrHNE+KQ==", + "license": "MIT", + "dependencies": { + "d3-array": "^1.2.1", + "d3-collection": "^1.0.4", + "d3-shape": "^1.2.0", + "elementary-circuits-directed-graph": "^1.0.4" + } + }, + "node_modules/@plotly/mapbox-gl": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/@plotly/mapbox-gl/-/mapbox-gl-1.13.4.tgz", + "integrity": "sha512-sR3/Pe5LqT/fhYgp4rT4aSFf1rTsxMbGiH6Hojc7PH36ny5Bn17iVFUjpzycafETURuFbLZUfjODO8LvSI+5zQ==", + "license": "SEE LICENSE IN LICENSE.txt", + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/@plotly/point-cluster": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz", + "integrity": "sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==", + "license": "MIT", + "dependencies": { + "array-bounds": "^1.0.1", + "binary-search-bounds": "^2.0.4", + "clamp": "^1.0.1", + "defined": "^1.0.0", + "dtype": "^2.0.0", + "flatten-vertex-data": "^1.0.2", + "is-obj": "^1.0.1", + "math-log2": "^1.0.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0" + } + }, + "node_modules/@plotly/regl": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@plotly/regl/-/regl-2.1.2.tgz", + "integrity": "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==", + "license": "MIT" + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.53", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.53.tgz", + "integrity": "sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz", + "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz", + "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz", + "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz", + "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz", + "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz", + "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz", + "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz", + "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz", + "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz", + "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz", + "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz", + "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz", + "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz", + "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz", + "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz", + "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz", + "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz", + "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz", + "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz", + "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz", + "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz", + "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz", + "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz", + "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tailwindcss/node": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz", + "integrity": "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.6.1", + "lightningcss": "1.30.2", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.18" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.18.tgz", + "integrity": "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-x64": "4.1.18", + "@tailwindcss/oxide-freebsd-x64": "4.1.18", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-x64-musl": "4.1.18", + "@tailwindcss/oxide-wasm32-wasi": "4.1.18", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.18" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.18.tgz", + "integrity": "sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.18.tgz", + "integrity": "sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.18.tgz", + "integrity": "sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.18.tgz", + "integrity": "sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.18.tgz", + "integrity": "sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.18.tgz", + "integrity": "sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.18.tgz", + "integrity": "sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz", + "integrity": "sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz", + "integrity": "sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.18.tgz", + "integrity": "sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@emnapi/wasi-threads": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.0", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz", + "integrity": "sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.18.tgz", + "integrity": "sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.18.tgz", + "integrity": "sha512-jVA+/UpKL1vRLg6Hkao5jldawNmRo7mQYrZtNHMIVpLfLhDml5nMRUo/8MwoX2vNXvnaXNNMedrMfMugAVX1nA==", + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.1.18", + "@tailwindcss/oxide": "4.1.18", + "tailwindcss": "4.1.18" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7" + } + }, + "node_modules/@turf/area": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@turf/area/-/area-7.3.1.tgz", + "integrity": "sha512-9nSiwt4zB5QDMcSoTxF28WpK1f741MNKcpUJDiHVRX08CZ4qfGWGV9ZIPQ8TVEn5RE4LyYkFuQ47Z9pdEUZE9Q==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "7.3.1", + "@turf/meta": "7.3.1", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/bbox": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-7.3.1.tgz", + "integrity": "sha512-/IyMKoS7P9B0ch5PIlQ6gMfoE8gRr48+cSbzlyexvEjuDuaAV1VURjH1jAthS0ipFG8RrFxFJKnp7TLL1Skong==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "7.3.1", + "@turf/meta": "7.3.1", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/centroid": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-7.3.1.tgz", + "integrity": "sha512-hRnsDdVBH4pX9mAjYympb2q5W8TCMUMNEjcRrAF7HTCyjIuRmjJf8vUtlzf7TTn9RXbsvPc1vtm3kLw20Jm8DQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "7.3.1", + "@turf/meta": "7.3.1", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/helpers": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.3.1.tgz", + "integrity": "sha512-zkL34JVhi5XhsuMEO0MUTIIFEJ8yiW1InMu4hu/oRqamlY4mMoZql0viEmH6Dafh/p+zOl8OYvMJ3Vm3rFshgg==", + "license": "MIT", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/meta": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.3.1.tgz", + "integrity": "sha512-NWsfOE5RVtWpLQNkfOF/RrYvLRPwwruxhZUV0UFIzHqfiRJ50aO9Y6uLY4bwCUe2TumLJQSR4yaoA72Rmr2mnQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "7.3.1", + "@types/geojson": "^7946.0.10" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", + "license": "MIT" + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.4.tgz", + "integrity": "sha512-vnDVpYPMzs4wunl27jHrfmwojOGKya0xyM3sH+UE5iv5uPS6vX7UIoh6m+vQc5LGBq52HBKPIn/zcSZVzeDEZg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/pbf": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", + "license": "MIT" + }, + "node_modules/@types/plotly.js": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/plotly.js/-/plotly.js-3.0.9.tgz", + "integrity": "sha512-nHKn7czWIPN7rT5wWI5qhML2O1Prm/Gx0NNe1MVr5GUL1zuzxbvIDmG7hlKMMtDsEtNfNQLMlMwk0CRtd3uqhg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", + "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/react-plotly.js": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/@types/react-plotly.js/-/react-plotly.js-2.6.4.tgz", + "integrity": "sha512-AU6w1u3qEGM0NmBA69PaOgNc0KPFA/+qkH6Uu9EBTJ45/WYOUoXi9AF5O15PRM2klpHSiHAAs4WnlI+OZAFmUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/plotly.js": "*", + "@types/react": "*" + } + }, + "node_modules/@types/supercluster": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.51.0.tgz", + "integrity": "sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/type-utils": "8.51.0", + "@typescript-eslint/utils": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.51.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.51.0.tgz", + "integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.51.0.tgz", + "integrity": "sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.51.0", + "@typescript-eslint/types": "^8.51.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.51.0.tgz", + "integrity": "sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.51.0.tgz", + "integrity": "sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.51.0.tgz", + "integrity": "sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/utils": "8.51.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.51.0.tgz", + "integrity": "sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.51.0.tgz", + "integrity": "sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.51.0", + "@typescript-eslint/tsconfig-utils": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "debug": "^4.3.4", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.7.tgz", + "integrity": "sha512-MOwgjc8tfrpn5QQEvjijjmDVtMw2oL88ugTevzxQnzRLm6l3fVEF2gzU0kYeYYKD8C66+IdGX6peJ4MyUlUnPg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.51.0.tgz", + "integrity": "sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.51.0.tgz", + "integrity": "sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "license": "ISC" + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.2.tgz", + "integrity": "sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.5", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.53", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/abs-svg-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz", + "integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA==", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-bounds": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-bounds/-/array-bounds-1.0.1.tgz", + "integrity": "sha512-8wdW3ZGk6UjMPJx/glyEt0sLzzwAE1bhToPsO1W2pbpR2gULyxe3BjSiuJFheP50T/GgODVPz2fuMUmIywt8cQ==", + "license": "MIT" + }, + "node_modules/array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-normalize": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array-normalize/-/array-normalize-1.1.4.tgz", + "integrity": "sha512-fCp0wKFLjvSPmCn4F5Tiw4M3lpMZoHlCjfcs7nNzuj3vqQQ1/a8cgB9DXcpDSn18c+coLnaW7rqfcYCvKbyJXg==", + "license": "MIT", + "dependencies": { + "array-bounds": "^1.0.0" + } + }, + "node_modules/array-range": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-range/-/array-range-1.0.1.tgz", + "integrity": "sha512-shdaI1zT3CVNL2hnx9c0JMc0ZogGaxDs5e85akgHWKYa0yVbIyp06Ind3dVkTj/uuFrzaHBOyqFzo+VV6aXgtA==", + "license": "MIT" + }, + "node_modules/array-rearrange": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", + "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==", + "license": "MIT" + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.11", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz", + "integrity": "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/binary-search-bounds": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.5.tgz", + "integrity": "sha512-H0ea4Fd3lS1+sTEB2TgcLoK21lLhwEJzlQv3IN47pJS976Gx4zoWe0ak3q+uYh60ppQxg9F16Ri4tS1sfD4+jA==", + "license": "MIT" + }, + "node_modules/bit-twiddle": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", + "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==", + "license": "MIT" + }, + "node_modules/bitmap-sdf": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", + "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", + "license": "MIT" + }, + "node_modules/bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001762", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz", + "integrity": "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/canvas-fit": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/canvas-fit/-/canvas-fit-1.5.0.tgz", + "integrity": "sha512-onIcjRpz69/Hx5bB5HGbYKUF2uC6QT6Gp+pfpGm3A7mPfcluSLV5v4Zu+oflDUwLdUw0rLIBhUbi0v8hM4FJQQ==", + "license": "MIT", + "dependencies": { + "element-size": "^1.1.1" + } + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/clamp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", + "integrity": "sha512-kgMuFyE78OC6Dyu3Dy7vcx4uy97EIbVxJB/B0eJ3bUNAkwdNcxYzgKltnyADiYwsR7SEqkkUPsEUT//OVS6XMA==", + "license": "MIT" + }, + "node_modules/color-alpha": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/color-alpha/-/color-alpha-1.0.4.tgz", + "integrity": "sha512-lr8/t5NPozTSqli+duAN+x+no/2WaKTeWvxhHGN+aXT6AJ8vPlzLa7UriyjWak0pSC2jHol9JgjBYnnHsGha9A==", + "license": "MIT", + "dependencies": { + "color-parse": "^1.3.8" + } + }, + "node_modules/color-alpha/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-id": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/color-id/-/color-id-1.1.0.tgz", + "integrity": "sha512-2iRtAn6dC/6/G7bBIo0uupVrIne1NsQJvJxZOBCzQOfk7jRq97feaDZ3RdzuHakRXXnHGNwglto3pqtRx1sX0g==", + "license": "MIT", + "dependencies": { + "clamp": "^1.0.1" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-normalize": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/color-normalize/-/color-normalize-1.5.0.tgz", + "integrity": "sha512-rUT/HDXMr6RFffrR53oX3HGWkDOP9goSAQGBkUaAYKjOE2JxozccdGyufageWDlInRAjm/jYPrf/Y38oa+7obw==", + "license": "MIT", + "dependencies": { + "clamp": "^1.0.1", + "color-rgba": "^2.1.1", + "dtype": "^2.0.0" + } + }, + "node_modules/color-normalize/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-normalize/node_modules/color-rgba": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.4.0.tgz", + "integrity": "sha512-Nti4qbzr/z2LbUWySr7H9dk3Rl7gZt7ihHAxlgT4Ho90EXWkjtkL1avTleu9yeGuqrt/chxTB6GKK8nZZ6V0+Q==", + "license": "MIT", + "dependencies": { + "color-parse": "^1.4.2", + "color-space": "^2.0.0" + } + }, + "node_modules/color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "license": "MIT", + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.3.2.tgz", + "integrity": "sha512-BcKnbOEsOarCwyoLstcoEztwT0IJxqqQkNwDuA3a65sICvvHL2yoeV13psoDFh5IuiOMnIOKdQDwB4Mk3BypiA==", + "license": "Unlicense" + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/country-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/country-regex/-/country-regex-1.1.0.tgz", + "integrity": "sha512-iSPlClZP8vX7MC3/u6s3lrDuoQyhQukh5LyABJ3hvfzbQ3Yyayd4fp04zjLnfi267B/B2FkumcWWgrbban7sSA==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-font": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-font/-/css-font-1.2.0.tgz", + "integrity": "sha512-V4U4Wps4dPDACJ4WpgofJ2RT5Yqwe1lEH6wlOOaIxMi0gTjdIijsc5FmxQlZ7ZZyKQkkutqqvULOp07l9c7ssA==", + "license": "MIT", + "dependencies": { + "css-font-size-keywords": "^1.0.0", + "css-font-stretch-keywords": "^1.0.1", + "css-font-style-keywords": "^1.0.1", + "css-font-weight-keywords": "^1.0.0", + "css-global-keywords": "^1.0.1", + "css-system-font-keywords": "^1.0.0", + "pick-by-alias": "^1.2.0", + "string-split-by": "^1.0.0", + "unquote": "^1.1.0" + } + }, + "node_modules/css-font-size-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-size-keywords/-/css-font-size-keywords-1.0.0.tgz", + "integrity": "sha512-Q+svMDbMlelgCfH/RVDKtTDaf5021O486ZThQPIpahnIjUkMUslC+WuOQSWTgGSrNCH08Y7tYNEmmy0hkfMI8Q==", + "license": "MIT" + }, + "node_modules/css-font-stretch-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-stretch-keywords/-/css-font-stretch-keywords-1.0.1.tgz", + "integrity": "sha512-KmugPO2BNqoyp9zmBIUGwt58UQSfyk1X5DbOlkb2pckDXFSAfjsD5wenb88fNrD6fvS+vu90a/tsPpb9vb0SLg==", + "license": "MIT" + }, + "node_modules/css-font-style-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-style-keywords/-/css-font-style-keywords-1.0.1.tgz", + "integrity": "sha512-0Fn0aTpcDktnR1RzaBYorIxQily85M2KXRpzmxQPgh8pxUN9Fcn00I8u9I3grNr1QXVgCl9T5Imx0ZwKU973Vg==", + "license": "MIT" + }, + "node_modules/css-font-weight-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-weight-keywords/-/css-font-weight-keywords-1.0.0.tgz", + "integrity": "sha512-5So8/NH+oDD+EzsnF4iaG4ZFHQ3vaViePkL1ZbZ5iC/KrsCY+WHq/lvOgrtmuOQ9pBBZ1ADGpaf+A4lj1Z9eYA==", + "license": "MIT" + }, + "node_modules/css-global-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-global-keywords/-/css-global-keywords-1.0.1.tgz", + "integrity": "sha512-X1xgQhkZ9n94WDwntqst5D/FKkmiU0GlJSFZSV3kLvyJ1WC5VeyoXDOuleUD+SIuH9C7W05is++0Woh0CGfKjQ==", + "license": "MIT" + }, + "node_modules/css-system-font-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-system-font-keywords/-/css-system-font-keywords-1.0.0.tgz", + "integrity": "sha512-1umTtVd/fXS25ftfjB71eASCrYhilmEsvDEI6wG/QplnmlfmVM5HkZ/ZX46DT5K3eblFPgLUHt5BRCb0YXkSFA==", + "license": "MIT" + }, + "node_modules/csscolorparser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", + "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/d": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", + "license": "ISC", + "dependencies": { + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/d3-array": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", + "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-collection": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", + "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-force": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", + "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-collection": "1", + "d3-dispatch": "1", + "d3-quadtree": "1", + "d3-timer": "1" + } + }, + "node_modules/d3-format": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", + "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-geo": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", + "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-array": "1" + } + }, + "node_modules/d3-geo-projection": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.9.0.tgz", + "integrity": "sha512-ZULvK/zBn87of5rWAfFMc9mJOipeSo57O+BBitsKIXmU4rTVAnX1kSsJkE0R+TxY8pGNoM1nbyRRE7GYHhdOEQ==", + "license": "BSD-3-Clause", + "dependencies": { + "commander": "2", + "d3-array": "1", + "d3-geo": "^1.12.0", + "resolve": "^1.1.10" + }, + "bin": { + "geo2svg": "bin/geo2svg", + "geograticule": "bin/geograticule", + "geoproject": "bin/geoproject", + "geoquantize": "bin/geoquantize", + "geostitch": "bin/geostitch" + } + }, + "node_modules/d3-hierarchy": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", + "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-quadtree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", + "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-time": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", + "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-time-format": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", + "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-time": "1" + } + }, + "node_modules/d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", + "license": "BSD-3-Clause" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-kerning": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-kerning/-/detect-kerning-2.1.2.tgz", + "integrity": "sha512-I3JIbrnKPAntNLl1I6TpSQQdQ4AutYzv/sKMFKbepawV/hlH0GmYKhUoOEMd4xqaUHT+Bm0f4127lh5qs1m1tw==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/draw-svg-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/draw-svg-path/-/draw-svg-path-1.0.0.tgz", + "integrity": "sha512-P8j3IHxcgRMcY6sDzr0QvJDLzBnJJqpTG33UZ2Pvp8rw0apCHhJCWqYprqrXjrgHnJ6tuhP1iTJSAodPDHxwkg==", + "license": "MIT", + "dependencies": { + "abs-svg-path": "~0.1.1", + "normalize-svg-path": "~0.1.0" + } + }, + "node_modules/dtype": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dtype/-/dtype-2.0.0.tgz", + "integrity": "sha512-s2YVcLKdFGS0hpFqJaTwscsyt0E8nNFdmo73Ocd81xNPj4URI4rj6D60A+vFMIw7BXWlb4yRkEwfBqcZzPGiZg==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/dup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dup/-/dup-1.0.0.tgz", + "integrity": "sha512-Bz5jxMMC0wgp23Zm15ip1x8IhYRqJvF3nFC0UInJUDkN1z4uNPk9jTnfCUJXbOGiQ1JbXLQsiV41Fb+HXcj5BA==", + "license": "MIT" + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==", + "license": "ISC" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", + "dev": true, + "license": "ISC" + }, + "node_modules/element-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/element-size/-/element-size-1.1.1.tgz", + "integrity": "sha512-eaN+GMOq/Q+BIWy0ybsgpcYImjGIdNLyjLFJU4XsLHXYQao5jCNb36GyN6C2qwmDDYSfIBmKpPpr4VnBdLCsPQ==", + "license": "MIT" + }, + "node_modules/elementary-circuits-directed-graph": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/elementary-circuits-directed-graph/-/elementary-circuits-directed-graph-1.3.1.tgz", + "integrity": "sha512-ZEiB5qkn2adYmpXGnJKkxT8uJHlW/mxmBpmeqawEHzPxh9HkLD4/1mFYX5l0On+f6rcPIt8/EWlRU2Vo3fX6dQ==", + "license": "MIT", + "dependencies": { + "strongly-connected-components": "^1.0.1" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.4", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", + "integrity": "sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es5-ext": { + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", + "hasInstallScript": true, + "license": "ISC", + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "license": "MIT", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", + "license": "ISC", + "dependencies": { + "d": "^1.0.2", + "ext": "^1.7.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "license": "ISC", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.4.26", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz", + "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=8.40" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "license": "ISC", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "license": "MIT", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "license": "ISC", + "dependencies": { + "type": "^2.7.2" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/falafel": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.5.tgz", + "integrity": "sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==", + "license": "MIT", + "dependencies": { + "acorn": "^7.1.1", + "isarray": "^2.0.1" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/falafel/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-isnumeric": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-isnumeric/-/fast-isnumeric-1.1.4.tgz", + "integrity": "sha512-1mM8qOr2LYz8zGaUdmiqRDiuue00Dxjgcb1NQR7TnhLVh6sQyngP9xvLo7Sl7LZpP/sk5eb+bcyWXw530NTBZw==", + "license": "MIT", + "dependencies": { + "is-string-blank": "^1.0.1" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/flatten-vertex-data": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz", + "integrity": "sha512-BvCBFK2NZqerFTdMDgqfHBwxYWnxeCkwONsw6PvBMcUXqo8U/KDWwmXhqx1x2kLIg7DqIsJfOaJFOmlua3Lxuw==", + "license": "MIT", + "dependencies": { + "dtype": "^2.0.0" + } + }, + "node_modules/font-atlas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/font-atlas/-/font-atlas-2.1.0.tgz", + "integrity": "sha512-kP3AmvX+HJpW4w3d+PiPR2X6E1yvsBXt2yhuCw+yReO9F1WYhvZwx3c95DGZGwg9xYzDGrgJYa885xmVA+28Cg==", + "license": "MIT", + "dependencies": { + "css-font": "^1.0.0" + } + }, + "node_modules/font-measure": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/font-measure/-/font-measure-1.2.2.tgz", + "integrity": "sha512-mRLEpdrWzKe9hbfaF3Qpr06TAjquuBVP5cHy4b3hyeNdjc9i0PO6HniGsX5vjL5OWv7+Bd++NiooNpT/s8BvIA==", + "license": "MIT", + "dependencies": { + "css-font": "^1.2.0" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/geojson-vt": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", + "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==", + "license": "ISC" + }, + "node_modules/get-canvas-context": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-canvas-context/-/get-canvas-context-1.0.2.tgz", + "integrity": "sha512-LnpfLf/TNzr9zVOGiIY6aKCz8EKuXmlYNV7CM2pUjBa/B+c2I15tS7KLySep75+FuerJdmArvJLcsAXWEy2H0A==", + "license": "MIT" + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gl-mat4": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gl-mat4/-/gl-mat4-1.2.0.tgz", + "integrity": "sha512-sT5C0pwB1/e9G9AvAoLsoaJtbMGjfd/jfxo8jMCKqYYEnjZuFvqV5rehqar0538EmssjdDeiEWnKyBSTw7quoA==", + "license": "Zlib" + }, + "node_modules/gl-matrix": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz", + "integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==", + "license": "MIT" + }, + "node_modules/gl-text": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gl-text/-/gl-text-1.4.0.tgz", + "integrity": "sha512-o47+XBqLCj1efmuNyCHt7/UEJmB9l66ql7pnobD6p+sgmBUdzfMZXIF0zD2+KRfpd99DJN+QXdvTFAGCKCVSmQ==", + "license": "MIT", + "dependencies": { + "bit-twiddle": "^1.0.2", + "color-normalize": "^1.5.0", + "css-font": "^1.2.0", + "detect-kerning": "^2.1.2", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "font-atlas": "^2.1.0", + "font-measure": "^1.2.2", + "gl-util": "^3.1.2", + "is-plain-obj": "^1.1.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "parse-unit": "^1.0.1", + "pick-by-alias": "^1.2.0", + "regl": "^2.0.0", + "to-px": "^1.0.1", + "typedarray-pool": "^1.1.0" + } + }, + "node_modules/gl-util": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/gl-util/-/gl-util-3.1.3.tgz", + "integrity": "sha512-dvRTggw5MSkJnCbh74jZzSoTOGnVYK+Bt+Ckqm39CVcl6+zSsxqWk4lr5NKhkqXHL6qvZAU9h17ZF8mIskY9mA==", + "license": "MIT", + "dependencies": { + "is-browser": "^2.0.1", + "is-firefox": "^1.0.3", + "is-plain-obj": "^1.1.0", + "number-is-integer": "^1.0.1", + "object-assign": "^4.1.0", + "pick-by-alias": "^1.2.0", + "weak-map": "^1.0.5" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/global-prefix": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", + "license": "MIT", + "dependencies": { + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/global-prefix/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/global-prefix/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glsl-inject-defines": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz", + "integrity": "sha512-W49jIhuDtF6w+7wCMcClk27a2hq8znvHtlGnrYkSWEr8tHe9eA2dcnohlcAmxLYBSpSSdzOkRdyPTrx9fw49+A==", + "license": "MIT", + "dependencies": { + "glsl-token-inject-block": "^1.0.0", + "glsl-token-string": "^1.0.1", + "glsl-tokenizer": "^2.0.2" + } + }, + "node_modules/glsl-resolve": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/glsl-resolve/-/glsl-resolve-0.0.1.tgz", + "integrity": "sha512-xxFNsfnhZTK9NBhzJjSBGX6IOqYpvBHxxmo+4vapiljyGNCY0Bekzn0firQkQrazK59c1hYxMDxYS8MDlhw4gA==", + "license": "MIT", + "dependencies": { + "resolve": "^0.6.1", + "xtend": "^2.1.2" + } + }, + "node_modules/glsl-resolve/node_modules/resolve": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", + "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==", + "license": "MIT" + }, + "node_modules/glsl-resolve/node_modules/xtend": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.2.0.tgz", + "integrity": "sha512-SLt5uylT+4aoXxXuwtQp5ZnMMzhDb1Xkg4pEqc00WUJCQifPfV9Ub1VrNhp9kXkrjZD2I2Hl8WnjP37jzZLPZw==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/glsl-token-assignments": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz", + "integrity": "sha512-OwXrxixCyHzzA0U2g4btSNAyB2Dx8XrztY5aVUCjRSh4/D0WoJn8Qdps7Xub3sz6zE73W3szLrmWtQ7QMpeHEQ==", + "license": "MIT" + }, + "node_modules/glsl-token-defines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz", + "integrity": "sha512-Vb5QMVeLjmOwvvOJuPNg3vnRlffscq2/qvIuTpMzuO/7s5kT+63iL6Dfo2FYLWbzuiycWpbC0/KV0biqFwHxaQ==", + "license": "MIT", + "dependencies": { + "glsl-tokenizer": "^2.0.0" + } + }, + "node_modules/glsl-token-depth": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz", + "integrity": "sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==", + "license": "MIT" + }, + "node_modules/glsl-token-descope": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz", + "integrity": "sha512-kS2PTWkvi/YOeicVjXGgX5j7+8N7e56srNDEHDTVZ1dcESmbmpmgrnpjPcjxJjMxh56mSXYoFdZqb90gXkGjQw==", + "license": "MIT", + "dependencies": { + "glsl-token-assignments": "^2.0.0", + "glsl-token-depth": "^1.1.0", + "glsl-token-properties": "^1.0.0", + "glsl-token-scope": "^1.1.0" + } + }, + "node_modules/glsl-token-inject-block": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz", + "integrity": "sha512-q/m+ukdUBuHCOtLhSr0uFb/qYQr4/oKrPSdIK2C4TD+qLaJvqM9wfXIF/OOBjuSA3pUoYHurVRNao6LTVVUPWA==", + "license": "MIT" + }, + "node_modules/glsl-token-properties": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz", + "integrity": "sha512-dSeW1cOIzbuUoYH0y+nxzwK9S9O3wsjttkq5ij9ZGw0OS41BirKJzzH48VLm8qLg+au6b0sINxGC0IrGwtQUcA==", + "license": "MIT" + }, + "node_modules/glsl-token-scope": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz", + "integrity": "sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==", + "license": "MIT" + }, + "node_modules/glsl-token-string": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-string/-/glsl-token-string-1.0.1.tgz", + "integrity": "sha512-1mtQ47Uxd47wrovl+T6RshKGkRRCYWhnELmkEcUAPALWGTFe2XZpH3r45XAwL2B6v+l0KNsCnoaZCSnhzKEksg==", + "license": "MIT" + }, + "node_modules/glsl-token-whitespace-trim": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz", + "integrity": "sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==", + "license": "MIT" + }, + "node_modules/glsl-tokenizer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", + "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", + "license": "MIT", + "dependencies": { + "through2": "^0.6.3" + } + }, + "node_modules/glsl-tokenizer/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "license": "MIT" + }, + "node_modules/glsl-tokenizer/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/glsl-tokenizer/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "license": "MIT" + }, + "node_modules/glsl-tokenizer/node_modules/through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", + "license": "MIT", + "dependencies": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + }, + "node_modules/glslify": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glslify/-/glslify-7.1.1.tgz", + "integrity": "sha512-bud98CJ6kGZcP9Yxcsi7Iz647wuDz3oN+IZsjCRi5X1PI7t/xPKeL0mOwXJjo+CRZMqvq0CkSJiywCcY7kVYog==", + "license": "MIT", + "dependencies": { + "bl": "^2.2.1", + "concat-stream": "^1.5.2", + "duplexify": "^3.4.5", + "falafel": "^2.1.0", + "from2": "^2.3.0", + "glsl-resolve": "0.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glslify-bundle": "^5.0.0", + "glslify-deps": "^1.2.5", + "minimist": "^1.2.5", + "resolve": "^1.1.5", + "stack-trace": "0.0.9", + "static-eval": "^2.0.5", + "through2": "^2.0.1", + "xtend": "^4.0.0" + }, + "bin": { + "glslify": "bin.js" + } + }, + "node_modules/glslify-bundle": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glslify-bundle/-/glslify-bundle-5.1.1.tgz", + "integrity": "sha512-plaAOQPv62M1r3OsWf2UbjN0hUYAB7Aph5bfH58VxJZJhloRNbxOL9tl/7H71K7OLJoSJ2ZqWOKk3ttQ6wy24A==", + "license": "MIT", + "dependencies": { + "glsl-inject-defines": "^1.0.1", + "glsl-token-defines": "^1.0.0", + "glsl-token-depth": "^1.1.1", + "glsl-token-descope": "^1.0.2", + "glsl-token-scope": "^1.1.1", + "glsl-token-string": "^1.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glsl-tokenizer": "^2.0.2", + "murmurhash-js": "^1.0.0", + "shallow-copy": "0.0.1" + } + }, + "node_modules/glslify-deps": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/glslify-deps/-/glslify-deps-1.3.2.tgz", + "integrity": "sha512-7S7IkHWygJRjcawveXQjRXLO2FTjijPDYC7QfZyAQanY+yGLCFHYnPtsGT9bdyHiwPTw/5a1m1M9hamT2aBpag==", + "license": "ISC", + "dependencies": { + "@choojs/findup": "^0.2.0", + "events": "^3.2.0", + "glsl-resolve": "0.0.1", + "glsl-tokenizer": "^2.0.0", + "graceful-fs": "^4.1.2", + "inherits": "^2.0.1", + "map-limit": "0.0.1", + "resolve": "^1.0.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/grid-index": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", + "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-hover": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-hover/-/has-hover-1.0.1.tgz", + "integrity": "sha512-0G6w7LnlcpyDzpeGUTuT0CEw05+QlMuGVk1IHNAlHrGJITGodjZu3x8BNDUMfKJSZXNB2ZAclqc1bvrd+uUpfg==", + "license": "MIT", + "dependencies": { + "is-browser": "^2.0.1" + } + }, + "node_modules/has-passive-events": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-passive-events/-/has-passive-events-1.0.0.tgz", + "integrity": "sha512-2vSj6IeIsgvsRMyeQ0JaCX5Q3lX4zMn5HpoVc7MEhQ6pv8Iq9rsXjsp+E5ZwaT7T0xhMT0KmU8gtt1EFVdbJiw==", + "license": "MIT", + "dependencies": { + "is-browser": "^2.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-browser/-/is-browser-2.1.0.tgz", + "integrity": "sha512-F5rTJxDQ2sW81fcfOR1GnCXT6sVJC104fCyfj+mjpwNEwaPYSn5fte5jiHmBg3DHsIoL/l8Kvw5VN5SsTRcRFQ==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-firefox": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-firefox/-/is-firefox-1.0.3.tgz", + "integrity": "sha512-6Q9ITjvWIm0Xdqv+5U12wgOKEM2KoBw4Y926m0OFkvlCxnbG94HKAsVz8w3fWcfAS5YA2fJORXX1dLrkprCCxA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-iexplorer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-iexplorer/-/is-iexplorer-1.0.0.tgz", + "integrity": "sha512-YeLzceuwg3K6O0MLM3UyUUjKAlyULetwryFp1mHy1I5PfArK0AEqlfa+MR4gkJjcbuJXoDJCvXbyqZVf5CR2Sg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-mobile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-4.0.0.tgz", + "integrity": "sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==", + "license": "MIT" + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-string-blank": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-string-blank/-/is-string-blank-1.0.1.tgz", + "integrity": "sha512-9H+ZBCVs3L9OYqv8nuUAzpcT9OTgMD1yAWrG7ihlnibdkbtB850heAmYWxHuXc4CHy4lKeK69tN+ny1K7gBIrw==", + "license": "MIT" + }, + "node_modules/is-svg-path": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-svg-path/-/is-svg-path-1.0.2.tgz", + "integrity": "sha512-Lj4vePmqpPR1ZnRctHv8ltSh1OrSxHkhUkd7wi+VQdcdP15/KvQFyk7LhNuM7ZW0EVbJz8kZLVmL9quLrfq4Kg==", + "license": "MIT" + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-pretty-compact": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", + "license": "ISC" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz", + "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.30.2", + "lightningcss-darwin-arm64": "1.30.2", + "lightningcss-darwin-x64": "1.30.2", + "lightningcss-freebsd-x64": "1.30.2", + "lightningcss-linux-arm-gnueabihf": "1.30.2", + "lightningcss-linux-arm64-gnu": "1.30.2", + "lightningcss-linux-arm64-musl": "1.30.2", + "lightningcss-linux-x64-gnu": "1.30.2", + "lightningcss-linux-x64-musl": "1.30.2", + "lightningcss-win32-arm64-msvc": "1.30.2", + "lightningcss-win32-x64-msvc": "1.30.2" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.30.2.tgz", + "integrity": "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.2.tgz", + "integrity": "sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.2.tgz", + "integrity": "sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.2.tgz", + "integrity": "sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.2.tgz", + "integrity": "sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.2.tgz", + "integrity": "sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.2.tgz", + "integrity": "sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz", + "integrity": "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz", + "integrity": "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.2.tgz", + "integrity": "sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.2.tgz", + "integrity": "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "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", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/map-limit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "integrity": "sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==", + "license": "MIT", + "dependencies": { + "once": "~1.3.0" + } + }, + "node_modules/map-limit/node_modules/once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/mapbox-gl": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.3.tgz", + "integrity": "sha512-p8lJFEiqmEQlyv+DQxFAOG/XPWN0Wp7j/Psq93Zywz7qt9CcUKFYDBOoOEKzqe6gudHVJY8/Bhqw6VDpX2lSBg==", + "license": "SEE LICENSE IN LICENSE.txt", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/maplibre-gl": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", + "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "@maplibre/maplibre-gl-style-spec": "^20.3.1", + "@types/geojson": "^7946.0.14", + "@types/geojson-vt": "3.2.5", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", + "earcut": "^3.0.0", + "geojson-vt": "^4.0.2", + "gl-matrix": "^3.4.3", + "global-prefix": "^4.0.0", + "kdbush": "^4.0.2", + "murmurhash-js": "^1.0.0", + "pbf": "^3.3.0", + "potpack": "^2.0.0", + "quickselect": "^3.0.0", + "supercluster": "^8.0.1", + "tinyqueue": "^3.0.0", + "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, + "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz", + "integrity": "sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==", + "license": "BSD-2-Clause" + }, + "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "license": "BSD-2-Clause" + }, + "node_modules/maplibre-gl/node_modules/earcut": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/geojson-vt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/potpack": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.1.0.tgz", + "integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "license": "ISC", + "dependencies": { + "kdbush": "^4.0.2" + } + }, + "node_modules/maplibre-gl/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "license": "ISC" + }, + "node_modules/math-log2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", + "integrity": "sha512-9W0yGtkaMAkf74XGYVy4Dqw3YUMnTNB2eeiw9aQbUl4A3KmuCEHTt2DgAB07ENzOYAjsYSAYufkAq0Zd+jU7zA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz", + "integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mouse-change": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/mouse-change/-/mouse-change-1.4.0.tgz", + "integrity": "sha512-vpN0s+zLL2ykyyUDh+fayu9Xkor5v/zRD9jhSqjRS1cJTGS0+oakVZzNm5n19JvvEj0you+MXlYTpNxUDQUjkQ==", + "license": "MIT", + "dependencies": { + "mouse-event": "^1.0.0" + } + }, + "node_modules/mouse-event": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/mouse-event/-/mouse-event-1.0.5.tgz", + "integrity": "sha512-ItUxtL2IkeSKSp9cyaX2JLUuKk2uMoxBg4bbOWVd29+CskYJR9BGsUqtXenNzKbnDshvupjUewDIYVrOB6NmGw==", + "license": "MIT" + }, + "node_modules/mouse-event-offset": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mouse-event-offset/-/mouse-event-offset-3.0.2.tgz", + "integrity": "sha512-s9sqOs5B1Ykox3Xo8b3Ss2IQju4UwlW6LSR+Q5FXWpprJ5fzMLefIIItr3PH8RwzfGy6gxs/4GAmiNuZScE25w==", + "license": "MIT" + }, + "node_modules/mouse-wheel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mouse-wheel/-/mouse-wheel-1.2.0.tgz", + "integrity": "sha512-+OfYBiUOCTWcTECES49neZwL5AoGkXE+lFjIvzwNCnYRlso+EnfvovcBxGoyQ0yQt806eSPjS675K0EwWknXmw==", + "license": "MIT", + "dependencies": { + "right-now": "^1.0.0", + "signum": "^1.0.0", + "to-px": "^1.0.1" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/needle": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "license": "MIT", + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "license": "ISC" + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-svg-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-0.1.0.tgz", + "integrity": "sha512-1/kmYej2iedi5+ROxkRESL/pI02pkg0OBnaR4hJkSIX6+ORzepwbuUXfrdZaPjysTsJInj0Rj5NuX027+dMBvA==", + "license": "MIT" + }, + "node_modules/number-is-integer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-integer/-/number-is-integer-1.0.1.tgz", + "integrity": "sha512-Dq3iuiFBkrbmuQjGFFF3zckXNCQoSD37/SdSbgcBailUx6knDvDwb5CympBgcoWHy36sfS12u74MHYkXyHq6bg==", + "license": "MIT", + "dependencies": { + "is-finite": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parenthesis": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz", + "integrity": "sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw==", + "license": "MIT" + }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/parse-rect": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.2.0.tgz", + "integrity": "sha512-4QZ6KYbnE6RTwg9E0HpLchUM9EZt6DnDxajFZZDSV4p/12ZJEvPO702DZpGvRYEPo00yKDys7jASi+/w7aO8LA==", + "license": "MIT", + "dependencies": { + "pick-by-alias": "^1.2.0" + } + }, + "node_modules/parse-svg-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/parse-svg-path/-/parse-svg-path-0.1.2.tgz", + "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==", + "license": "MIT" + }, + "node_modules/parse-unit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-unit/-/parse-unit-1.0.1.tgz", + "integrity": "sha512-hrqldJHokR3Qj88EIlV/kAyAi/G5R2+R56TBANxNMy0uPlYcttx0jnMW6Yx5KsKPSbC3KddM/7qQm3+0wEXKxg==", + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/pbf": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT" + }, + "node_modules/pick-by-alias": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pick-by-alias/-/pick-by-alias-1.2.0.tgz", + "integrity": "sha512-ESj2+eBxhGrcA1azgHs7lARG5+5iLakc/6nlfbpjcLl00HuuUOIuORhYXN4D1HfvMSKuVtFQjAlnwi1JHEeDIw==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/plotly.js": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-3.3.1.tgz", + "integrity": "sha512-SrGSZ02HvCWQIYsbQX4sgjgGo7k4T+Oz8a+RQwE5Caz+yu1vputBM1UThmiOPY51B5HzO9ajym8Rl4pmLj+i9Q==", + "license": "MIT", + "dependencies": { + "@plotly/d3": "3.8.2", + "@plotly/d3-sankey": "0.7.2", + "@plotly/d3-sankey-circular": "0.33.1", + "@plotly/mapbox-gl": "1.13.4", + "@plotly/regl": "^2.1.2", + "@turf/area": "^7.1.0", + "@turf/bbox": "^7.1.0", + "@turf/centroid": "^7.1.0", + "base64-arraybuffer": "^1.0.2", + "canvas-fit": "^1.5.0", + "color-alpha": "1.0.4", + "color-normalize": "1.5.0", + "color-parse": "2.0.0", + "color-rgba": "3.0.0", + "country-regex": "^1.1.0", + "d3-force": "^1.2.1", + "d3-format": "^1.4.5", + "d3-geo": "^1.12.1", + "d3-geo-projection": "^2.9.0", + "d3-hierarchy": "^1.1.9", + "d3-interpolate": "^3.0.1", + "d3-time": "^1.1.0", + "d3-time-format": "^2.2.3", + "fast-isnumeric": "^1.1.4", + "gl-mat4": "^1.2.0", + "gl-text": "^1.4.0", + "has-hover": "^1.0.1", + "has-passive-events": "^1.0.0", + "is-mobile": "^4.0.0", + "maplibre-gl": "^4.7.1", + "mouse-change": "^1.4.0", + "mouse-event-offset": "^3.0.2", + "mouse-wheel": "^1.2.0", + "native-promise-only": "^0.8.1", + "parse-svg-path": "^0.1.2", + "point-in-polygon": "^1.1.0", + "polybooljs": "^1.2.2", + "probe-image-size": "^7.2.3", + "regl-error2d": "^2.0.12", + "regl-line2d": "^3.1.3", + "regl-scatter2d": "^3.3.1", + "regl-splom": "^1.0.14", + "strongly-connected-components": "^1.0.1", + "superscript-text": "^1.0.0", + "svg-path-sdf": "^1.1.3", + "tinycolor2": "^1.4.2", + "to-px": "1.0.1", + "topojson-client": "^3.1.0", + "webgl-context": "^2.2.0", + "world-calendars": "^1.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/point-in-polygon": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", + "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==", + "license": "MIT" + }, + "node_modules/polybooljs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.2.tgz", + "integrity": "sha512-ziHW/02J0XuNuUtmidBc6GXE8YohYydp3DWPWXYsd7O721TjcmN+k6ezjdwkDqep+gnWnFY+yqZHvzElra2oCg==", + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", + "license": "ISC" + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.7.2.tgz", + "integrity": "sha512-LkphyK3Fw+q2HdMOoiEHWf93fNtYJwfamoKPl7UwtjFQdei/iIBoX11G6j706FzN3ymX9mPVi97qIY8328vdnA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-hermes": "*", + "@prettier/plugin-oxc": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-hermes": { + "optional": true + }, + "@prettier/plugin-oxc": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, + "node_modules/probe-image-size": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", + "license": "MIT", + "dependencies": { + "lodash.merge": "^4.6.2", + "needle": "^2.5.2", + "stream-parser": "~0.3.1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", + "license": "ISC" + }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "license": "MIT", + "dependencies": { + "performance-now": "^2.1.0" + } + }, + "node_modules/react": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", + "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.3" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/react-markdown": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz", + "integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, + "node_modules/react-plotly.js": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/react-plotly.js/-/react-plotly.js-2.6.0.tgz", + "integrity": "sha512-g93xcyhAVCSt9kV1svqG1clAEdL6k3U+jjuSzfTV7owaSU9Go6Ph8bl25J+jKfKvIGAEYpe4qj++WHJuc9IaeA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "plotly.js": ">1.34.0", + "react": ">0.13.0" + } + }, + "node_modules/react-refresh": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", + "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/regl": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/regl/-/regl-2.1.1.tgz", + "integrity": "sha512-+IOGrxl3FZ8ZM9ixCWQZzFRiRn7Rzn9bu3iFHwg/yz4tlOUQgbO4PHLgG+1ZT60zcIV8tief6Qrmyl8qcoJP0g==", + "license": "MIT" + }, + "node_modules/regl-error2d": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/regl-error2d/-/regl-error2d-2.0.12.tgz", + "integrity": "sha512-r7BUprZoPO9AbyqM5qlJesrSRkl+hZnVKWKsVp7YhOl/3RIpi4UDGASGJY0puQ96u5fBYw/OlqV24IGcgJ0McA==", + "license": "MIT", + "dependencies": { + "array-bounds": "^1.0.1", + "color-normalize": "^1.5.0", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-line2d": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/regl-line2d/-/regl-line2d-3.1.3.tgz", + "integrity": "sha512-fkgzW+tTn4QUQLpFKsUIE0sgWdCmXAM3ctXcCgoGBZTSX5FE2A0M7aynz7nrZT5baaftLrk9te54B+MEq4QcSA==", + "license": "MIT", + "dependencies": { + "array-bounds": "^1.0.1", + "array-find-index": "^1.0.2", + "array-normalize": "^1.1.4", + "color-normalize": "^1.5.0", + "earcut": "^2.1.5", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0" + } + }, + "node_modules/regl-scatter2d": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.3.1.tgz", + "integrity": "sha512-seOmMIVwaCwemSYz/y4WE0dbSO9svNFSqtTh5RE57I7PjGo3tcUYKtH0MTSoshcAsreoqN8HoCtnn8wfHXXfKQ==", + "license": "MIT", + "dependencies": { + "@plotly/point-cluster": "^3.1.9", + "array-range": "^1.0.1", + "array-rearrange": "^2.2.2", + "clamp": "^1.0.1", + "color-id": "^1.1.0", + "color-normalize": "^1.5.0", + "color-rgba": "^2.1.1", + "flatten-vertex-data": "^1.0.2", + "glslify": "^7.0.0", + "is-iexplorer": "^1.0.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-scatter2d/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/regl-scatter2d/node_modules/color-rgba": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.4.0.tgz", + "integrity": "sha512-Nti4qbzr/z2LbUWySr7H9dk3Rl7gZt7ihHAxlgT4Ho90EXWkjtkL1avTleu9yeGuqrt/chxTB6GKK8nZZ6V0+Q==", + "license": "MIT", + "dependencies": { + "color-parse": "^1.4.2", + "color-space": "^2.0.0" + } + }, + "node_modules/regl-splom": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/regl-splom/-/regl-splom-1.0.14.tgz", + "integrity": "sha512-OiLqjmPRYbd7kDlHC6/zDf6L8lxgDC65BhC8JirhP4ykrK4x22ZyS+BnY8EUinXKDeMgmpRwCvUmk7BK4Nweuw==", + "license": "MIT", + "dependencies": { + "array-bounds": "^1.0.1", + "array-range": "^1.0.1", + "color-alpha": "^1.0.4", + "flatten-vertex-data": "^1.0.2", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "raf": "^3.4.1", + "regl-scatter2d": "^3.2.3" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "license": "MIT", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/right-now": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/right-now/-/right-now-1.0.0.tgz", + "integrity": "sha512-DA8+YS+sMIVpbsuKgy+Z67L9Lxb1p05mNxRpDPNksPDEFir4vmBlUtuN9jkTGn9YMMdlBuK7XQgFiz6ws+yhSg==", + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", + "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.59.0", + "@rollup/rollup-android-arm64": "4.59.0", + "@rollup/rollup-darwin-arm64": "4.59.0", + "@rollup/rollup-darwin-x64": "4.59.0", + "@rollup/rollup-freebsd-arm64": "4.59.0", + "@rollup/rollup-freebsd-x64": "4.59.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", + "@rollup/rollup-linux-arm-musleabihf": "4.59.0", + "@rollup/rollup-linux-arm64-gnu": "4.59.0", + "@rollup/rollup-linux-arm64-musl": "4.59.0", + "@rollup/rollup-linux-loong64-gnu": "4.59.0", + "@rollup/rollup-linux-loong64-musl": "4.59.0", + "@rollup/rollup-linux-ppc64-gnu": "4.59.0", + "@rollup/rollup-linux-ppc64-musl": "4.59.0", + "@rollup/rollup-linux-riscv64-gnu": "4.59.0", + "@rollup/rollup-linux-riscv64-musl": "4.59.0", + "@rollup/rollup-linux-s390x-gnu": "4.59.0", + "@rollup/rollup-linux-x64-gnu": "4.59.0", + "@rollup/rollup-linux-x64-musl": "4.59.0", + "@rollup/rollup-openbsd-x64": "4.59.0", + "@rollup/rollup-openharmony-arm64": "4.59.0", + "@rollup/rollup-win32-arm64-msvc": "4.59.0", + "@rollup/rollup-win32-ia32-msvc": "4.59.0", + "@rollup/rollup-win32-x64-gnu": "4.59.0", + "@rollup/rollup-win32-x64-msvc": "4.59.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz", + "integrity": "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==", + "license": "BlueOak-1.0.0" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signum": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/signum/-/signum-1.0.0.tgz", + "integrity": "sha512-yodFGwcyt59XRh7w5W3jPcIQb3Bwi21suEfT7MAWnBX3iCdklJpgDgvGT9o04UonglZN5SNMfJFkHIR/jO8GHw==", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==", + "engines": { + "node": "*" + } + }, + "node_modules/static-eval": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", + "integrity": "sha512-MgWpQ/ZjGieSVB3eOJVs4OA2LT/q1vx98KPCTTQPzq/aLr0YUXTsgryTXr4SLfR0ZfUUCiedM9n/ABeDIyy4mA==", + "license": "MIT", + "dependencies": { + "escodegen": "^2.1.0" + } + }, + "node_modules/stream-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", + "license": "MIT", + "dependencies": { + "debug": "2" + } + }, + "node_modules/stream-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/stream-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/string-split-by": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string-split-by/-/string-split-by-1.0.0.tgz", + "integrity": "sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==", + "license": "MIT", + "dependencies": { + "parenthesis": "^3.1.5" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strongly-connected-components": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", + "integrity": "sha512-i0TFx4wPcO0FwX+4RkLJi1MxmcTv90jNZgxMu9XRnMXMeFUY1VJlIoXpZunPUvUUqbCT1pg5PEkFqqpcaElNaA==", + "license": "MIT" + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/supercluster": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", + "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", + "license": "ISC", + "dependencies": { + "kdbush": "^3.0.0" + } + }, + "node_modules/supercluster/node_modules/kdbush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", + "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==", + "license": "ISC" + }, + "node_modules/superscript-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/superscript-text/-/superscript-text-1.0.0.tgz", + "integrity": "sha512-gwu8l5MtRZ6koO0icVTlmN5pm7Dhh1+Xpe9O4x6ObMAsW+3jPbW14d1DsBq1F4wiI+WOFjXF35pslgec/G8yCQ==", + "license": "MIT" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg-arc-to-cubic-bezier": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz", + "integrity": "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==", + "license": "ISC" + }, + "node_modules/svg-path-bounds": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/svg-path-bounds/-/svg-path-bounds-1.0.2.tgz", + "integrity": "sha512-H4/uAgLWrppIC0kHsb2/dWUYSmb4GE5UqH06uqWBcg6LBjX2fu0A8+JrO2/FJPZiSsNOKZAhyFFgsLTdYUvSqQ==", + "license": "MIT", + "dependencies": { + "abs-svg-path": "^0.1.1", + "is-svg-path": "^1.0.1", + "normalize-svg-path": "^1.0.0", + "parse-svg-path": "^0.1.2" + } + }, + "node_modules/svg-path-bounds/node_modules/normalize-svg-path": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-1.1.0.tgz", + "integrity": "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg==", + "license": "MIT", + "dependencies": { + "svg-arc-to-cubic-bezier": "^3.0.0" + } + }, + "node_modules/svg-path-sdf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/svg-path-sdf/-/svg-path-sdf-1.1.3.tgz", + "integrity": "sha512-vJJjVq/R5lSr2KLfVXVAStktfcfa1pNFjFOgyJnzZFXlO/fDZ5DmM8FpnSKKzLPfEYTVeXuVBTHF296TpxuJVg==", + "license": "MIT", + "dependencies": { + "bitmap-sdf": "^1.0.0", + "draw-svg-path": "^1.0.0", + "is-svg-path": "^1.0.1", + "parse-svg-path": "^0.1.2", + "svg-path-bounds": "^1.0.1" + } + }, + "node_modules/tailwindcss": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz", + "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyqueue": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", + "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==", + "license": "ISC" + }, + "node_modules/to-float32": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/to-float32/-/to-float32-1.1.0.tgz", + "integrity": "sha512-keDnAusn/vc+R3iEiSDw8TOF7gPiTLdK1ArvWtYbJQiVfmRg6i/CAvbKq3uIS0vWroAC7ZecN3DjQKw3aSklUg==", + "license": "MIT" + }, + "node_modules/to-px": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-px/-/to-px-1.0.1.tgz", + "integrity": "sha512-2y3LjBeIZYL19e5gczp14/uRWFDtDUErJPVN3VU9a7SJO+RjGRtYR47aMN2bZgGlxvW4ZcEz2ddUPVHXcMfuXw==", + "license": "MIT", + "dependencies": { + "parse-unit": "^1.0.1" + } + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "license": "ISC", + "dependencies": { + "commander": "2" + }, + "bin": { + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ts-api-utils": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "license": "ISC" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/typedarray-pool": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.2.0.tgz", + "integrity": "sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==", + "license": "MIT", + "dependencies": { + "bit-twiddle": "^1.0.0", + "dup": "^1.0.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.51.0.tgz", + "integrity": "sha512-jh8ZuM5oEh2PSdyQG9YAEM1TCGuWenLSuSUhf/irbVUNW9O5FhbFVONviN2TgMTBnUmyHv7E56rYnfLZK6TkiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.51.0", + "@typescript-eslint/parser": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/utils": "8.51.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==", + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/update-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-diff/-/update-diff-1.1.0.tgz", + "integrity": "sha512-rCiBPiHxZwT4+sBhEbChzpO5hYHjm91kScWgdHf4Qeafs6Ba7MBl+d9GlGv72bcTZQO0sLmtQS1pHSWoCLtN/A==", + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.0.tgz", + "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "license": "MIT", + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/weak-map": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.8.tgz", + "integrity": "sha512-lNR9aAefbGPpHO7AEnY0hCFjz1eTkWCXYvkTRrTHs9qv8zJp+SkVYpzfLIFXQQiG3tVvbNFQgVg2bQS8YGgxyw==", + "license": "Apache-2.0" + }, + "node_modules/webgl-context": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webgl-context/-/webgl-context-2.2.0.tgz", + "integrity": "sha512-q/fGIivtqTT7PEoF07axFIlHNk/XCPaYpq64btnepopSWvKNFkoORlQYgqDigBIuGA1ExnFd/GnSUnBNEPQY7Q==", + "license": "MIT", + "dependencies": { + "get-canvas-context": "^1.0.1" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/world-calendars": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/world-calendars/-/world-calendars-1.0.4.tgz", + "integrity": "sha512-VGRnLJS+xJmGDPodgJRnGIDwGu0s+Cr9V2HB3EzlDZ5n0qb8h5SJtGUEkjrphZYAglEiXZ6kiXdmk0H/h/uu/w==", + "license": "MIT", + "dependencies": { + "object-assign": "^4.1.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", + "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/frontends/react/package.json b/frontends/react/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9fcbc9f4eefdf726ebc4d7d56c3d73cb9b614be9 --- /dev/null +++ b/frontends/react/package.json @@ -0,0 +1,41 @@ +{ + "name": "optimization", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@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", + "react-markdown": "^10.1.0", + "react-plotly.js": "^2.6.0", + "tailwindcss": "^4.1.18" + }, + "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", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "prettier-plugin-tailwindcss": "^0.7.2", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "vite": "^7.2.4" + } +} diff --git a/frontends/react/public/vite.svg b/frontends/react/public/vite.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7b8dfb1b2a60bd50538bec9f876511b9cac21e3 --- /dev/null +++ b/frontends/react/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontends/react/src/App.tsx b/frontends/react/src/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d2c100c32d7eaf121f082b556567e83f0992e5d3 --- /dev/null +++ b/frontends/react/src/App.tsx @@ -0,0 +1,276 @@ +import { useState } from "react"; +import { ChevronDown, X } from "lucide-react"; +import { + AppLayout, + Button, + ColorPicker, + Divider, + Dropdown, + IconButton, + InputField, + InputSection, + ResultSection, + SegmentedControl, + StepControls, + type ResultItem, +} from "@elvis/ui"; + +import { algorithmById } from "./algorithms"; +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 Usage from "./Usage"; +import useOptimisation, { type RunEditor, type Trajectory } from "./useOptimisation"; +import type { Point } from "./types"; + +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; + +const helpClass = "text-sm text-ink-muted"; + +export default function App() { + const app = useOptimisation(); + const preset = ALL_PRESETS.find((p) => p.expression === app.expression); + const twoVariables = app.variables === 2; + const main = app.trajectories[0]; + const point = main?.path[main.path.length - 1]; + // The comparison card being edited; the others are collapsed + const [openCard, setOpenCard] = useState(null); + + return ( + } + examples={

Examples are coming soon.

} + tabs={[{ label: "Configure", content: <> + + { + const chosen = ALL_PRESETS.find((p) => p.name === name); + if (chosen) { + app.choosePreset(chosen); + } + }} + /> + +
+ app.setSurface(v === "surface")} + /> +
+ + + )} +
+ + + app.resetStart(app.main)} + onRandomStart={() => app.randomStart(app.main)} + hint={twoVariables && app.surface ? undefined : "Or click the plot to move the initial point."} + /> + + }, + { label: "Compare", content: <> +

Add optimisers to compare trajectories

+
    + {/* The main run: the same settings as Configure, with a fixed colour */} + setOpenCard(openCard === 1 ? null : 1)} + twoVariables={twoVariables} + onResetStart={() => app.resetStart(app.main)} + onRandomStart={() => app.randomStart(app.main)} + /> + {app.comparisons.map((c) => ( + t.id === c.id)} + taken={[RUN_COLORS[0].value, ...app.comparisons.map((o) => o.color)]} + open={openCard === c.id} + onToggle={() => setOpenCard(openCard === c.id ? null : c.id)} + onColorChange={(color) => app.setComparisonColor(c.id, color)} + onRemove={() => app.removeComparison(c.id)} + twoVariables={twoVariables} + onResetStart={() => app.resetStart(c.editor)} + onRandomStart={() => app.randomStart(c.editor)} + /> + ))} +
+ + {onRemove && ( + + + + )} + + {open && ( +
+ +
+ )} + + ); +} diff --git a/frontends/react/src/HistoryPlot 2.tsx b/frontends/react/src/HistoryPlot 2.tsx new file mode 100644 index 0000000000000000000000000000000000000000..06e7970d2f50ec7621860d451aedcee7ad6fad5b --- /dev/null +++ b/frontends/react/src/HistoryPlot 2.tsx @@ -0,0 +1,38 @@ +import Plot from "react-plotly.js"; +import type { Data } from "plotly.js"; + +import type { Trajectory } from "./useOptimisation"; + +// f at each iteration, one line per run +export default function HistoryPlot({ trajectories }: { trajectories: Trajectory[] }) { + const data = trajectories.map((t) => ({ + x: t.path.map((_, k) => k), + y: t.path.map((p) => p.value), + type: "scatter", + mode: "lines+markers", + name: t.label, + line: { color: t.color, width: 2 }, + marker: { color: t.color, size: 4 }, + hovertemplate: "iteration %{x}
f = %{y:.4g}", + })) as Data[]; + + return ( +
+ f at each iteration +
+ +
+
+ ); +} diff --git a/frontends/react/src/HistoryPlot.tsx b/frontends/react/src/HistoryPlot.tsx new file mode 100644 index 0000000000000000000000000000000000000000..06e7970d2f50ec7621860d451aedcee7ad6fad5b --- /dev/null +++ b/frontends/react/src/HistoryPlot.tsx @@ -0,0 +1,38 @@ +import Plot from "react-plotly.js"; +import type { Data } from "plotly.js"; + +import type { Trajectory } from "./useOptimisation"; + +// f at each iteration, one line per run +export default function HistoryPlot({ trajectories }: { trajectories: Trajectory[] }) { + const data = trajectories.map((t) => ({ + x: t.path.map((_, k) => k), + y: t.path.map((p) => p.value), + type: "scatter", + mode: "lines+markers", + name: t.label, + line: { color: t.color, width: 2 }, + marker: { color: t.color, size: 4 }, + hovertemplate: "iteration %{x}
f = %{y:.4g}", + })) as Data[]; + + return ( +
+ f at each iteration +
+ +
+
+ ); +} diff --git a/frontends/react/src/OptimisationPlot 2.tsx b/frontends/react/src/OptimisationPlot 2.tsx new file mode 100644 index 0000000000000000000000000000000000000000..832767b481d315b4a4bae9e88fa4768dea4a1457 --- /dev/null +++ b/frontends/react/src/OptimisationPlot 2.tsx @@ -0,0 +1,234 @@ +import { useRef, useState, type RefObject } from "react"; +import { usePlotlyClick } 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", bgcolor: "rgba(255,255,255,0.8)" } as const; +const INK = "#1B2A4A"; + +export default function OptimisationPlot({ values, trajectories, xRange, yRange, onViewChange, onClick, surface, arrows }: OptimisationPlotProps) { + const plotRef = useRef(null); + // 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, true))]; + const layout: Partial = { + // Keep the camera while stepping + uirevision: "surface", + showlegend: showLegend, + legend: LEGEND, + margin: { t: 20, r: 20, b: 20, l: 20 }, + scene: { + camera, + aspectmode: "cube", + xaxis: { title: { text: "x" }, range: [...xRange.current] }, + yaxis: { title: { text: "y" }, range: [...yRange.current] }, + zaxis: { 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: INK, width: 2 }, + name: "f(x)", + showlegend: false, + hovertemplate: "x = %{x:.4g}
f(x) = %{y:.4g}", + }); + } + data.push(...trajectories.flatMap((t) => pathTraces(t, 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", + showlegend: showLegend, + legend: LEGEND, + margin: { t: 40, r: 40, b: 40, l: 40 }, + xaxis: { title: { text: "x" }, range: [...xRange.current] }, + yaxis: { 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, threeD: boolean, twoVariables = true): Data[] { + 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); + const hovertemplate = twoVariables + ? "x = %{x:.4g}, y = %{y:.4g}
f = %{customdata:.4g}%{fullData.name}" + : "x = %{x:.4g}
f(x) = %{y:.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: t.color, width: 5 }, marker: { color: t.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: t.color, size: 6, line: { color: "white", width: 1 } }, hoverinfo: "skip" }, + ] as Data[]; + } + return [ + { x: xs, y: ys, customdata: fs, type: "scatter", mode: "lines+markers", name: t.label, legendgroup: t.label, + line: { color: t.color, width: 2 }, marker: { color: t.color, size: 7 }, hovertemplate }, + { x: xs.slice(last), y: ys.slice(last), customdata: fs.slice(last), type: "scatter", mode: "markers", name: t.label, + legendgroup: t.label, showlegend: false, marker: { color: t.color, size: 14, line: { color: "white", 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)[] = []; + const headX: number[] = []; + const headY: number[] = []; + const angles: 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); + headX.push(x + dx); + headY.push(y + dy); + // Plotly turns markers clockwise from up, in screen space + angles.push((Math.atan2(dx / (x1 - x0), dy / (y1 - y0)) * 180) / Math.PI); + hover.push([x, y, u, v]); + }); + + const color = "rgba(255, 255, 255, 0.85)"; + return [ + { x: shaftX, y: shaftY, type: "scatter", mode: "lines", line: { color, width: 1 }, hoverinfo: "skip", showlegend: false }, + { + x: headX, y: headY, customdata: hover, type: "scatter", mode: "markers", showlegend: false, + marker: { symbol: "triangle-up", size: 6, color, angle: angles, angleref: "up" }, + hovertemplate: "x = %{customdata[0]:.3g}, y = %{customdata[1]:.3g}
∇f = (%{customdata[2]:.3g}, %{customdata[3]:.3g})", + }, + ] as Data[]; +} diff --git a/frontends/react/src/OptimisationPlot.tsx b/frontends/react/src/OptimisationPlot.tsx new file mode 100644 index 0000000000000000000000000000000000000000..832767b481d315b4a4bae9e88fa4768dea4a1457 --- /dev/null +++ b/frontends/react/src/OptimisationPlot.tsx @@ -0,0 +1,234 @@ +import { useRef, useState, type RefObject } from "react"; +import { usePlotlyClick } 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", bgcolor: "rgba(255,255,255,0.8)" } as const; +const INK = "#1B2A4A"; + +export default function OptimisationPlot({ values, trajectories, xRange, yRange, onViewChange, onClick, surface, arrows }: OptimisationPlotProps) { + const plotRef = useRef(null); + // 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, true))]; + const layout: Partial = { + // Keep the camera while stepping + uirevision: "surface", + showlegend: showLegend, + legend: LEGEND, + margin: { t: 20, r: 20, b: 20, l: 20 }, + scene: { + camera, + aspectmode: "cube", + xaxis: { title: { text: "x" }, range: [...xRange.current] }, + yaxis: { title: { text: "y" }, range: [...yRange.current] }, + zaxis: { 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: INK, width: 2 }, + name: "f(x)", + showlegend: false, + hovertemplate: "x = %{x:.4g}
f(x) = %{y:.4g}", + }); + } + data.push(...trajectories.flatMap((t) => pathTraces(t, 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", + showlegend: showLegend, + legend: LEGEND, + margin: { t: 40, r: 40, b: 40, l: 40 }, + xaxis: { title: { text: "x" }, range: [...xRange.current] }, + yaxis: { 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, threeD: boolean, twoVariables = true): Data[] { + 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); + const hovertemplate = twoVariables + ? "x = %{x:.4g}, y = %{y:.4g}
f = %{customdata:.4g}%{fullData.name}" + : "x = %{x:.4g}
f(x) = %{y:.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: t.color, width: 5 }, marker: { color: t.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: t.color, size: 6, line: { color: "white", width: 1 } }, hoverinfo: "skip" }, + ] as Data[]; + } + return [ + { x: xs, y: ys, customdata: fs, type: "scatter", mode: "lines+markers", name: t.label, legendgroup: t.label, + line: { color: t.color, width: 2 }, marker: { color: t.color, size: 7 }, hovertemplate }, + { x: xs.slice(last), y: ys.slice(last), customdata: fs.slice(last), type: "scatter", mode: "markers", name: t.label, + legendgroup: t.label, showlegend: false, marker: { color: t.color, size: 14, line: { color: "white", 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)[] = []; + const headX: number[] = []; + const headY: number[] = []; + const angles: 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); + headX.push(x + dx); + headY.push(y + dy); + // Plotly turns markers clockwise from up, in screen space + angles.push((Math.atan2(dx / (x1 - x0), dy / (y1 - y0)) * 180) / Math.PI); + hover.push([x, y, u, v]); + }); + + const color = "rgba(255, 255, 255, 0.85)"; + return [ + { x: shaftX, y: shaftY, type: "scatter", mode: "lines", line: { color, width: 1 }, hoverinfo: "skip", showlegend: false }, + { + x: headX, y: headY, customdata: hover, type: "scatter", mode: "markers", showlegend: false, + marker: { symbol: "triangle-up", size: 6, color, angle: angles, angleref: "up" }, + 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 2.tsx b/frontends/react/src/OptimiserControls 2.tsx new file mode 100644 index 0000000000000000000000000000000000000000..23dcc10094148487f5dae7e585108ba3c708c226 --- /dev/null +++ b/frontends/react/src/OptimiserControls 2.tsx @@ -0,0 +1,87 @@ +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; used for the main run +// (Configure) and for setting up a comparison (Compare) +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/OptimiserControls.tsx b/frontends/react/src/OptimiserControls.tsx new file mode 100644 index 0000000000000000000000000000000000000000..23dcc10094148487f5dae7e585108ba3c708c226 --- /dev/null +++ b/frontends/react/src/OptimiserControls.tsx @@ -0,0 +1,87 @@ +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; used for the main run +// (Configure) and for setting up a comparison (Compare) +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/Usage 2.tsx b/frontends/react/src/Usage 2.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ee21eafd3aafdc028bdfb05cc4ac4aace8065f02 --- /dev/null +++ b/frontends/react/src/Usage 2.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/Usage.tsx b/frontends/react/src/Usage.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ee21eafd3aafdc028bdfb05cc4ac4aace8065f02 --- /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/assets/react.svg b/frontends/react/src/assets/react.svg new file mode 100644 index 0000000000000000000000000000000000000000..6c87de9bb3358469122cc991d5cf578927246184 --- /dev/null +++ b/frontends/react/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontends/react/src/colors 2.ts b/frontends/react/src/colors 2.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c9dd9a6ff64e8f00da0c76cf1ac6dc766c15f91 --- /dev/null +++ b/frontends/react/src/colors 2.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. The first is the +// main run's; comparisons pick from the rest. +export const RUN_COLORS = [ + { name: "Black", value: "#000000" }, + { 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" }, +]; diff --git a/frontends/react/src/colors.ts b/frontends/react/src/colors.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c9dd9a6ff64e8f00da0c76cf1ac6dc766c15f91 --- /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. The first is the +// main run's; comparisons pick from the rest. +export const RUN_COLORS = [ + { name: "Black", value: "#000000" }, + { 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" }, +]; 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 2.ts b/frontends/react/src/functions 2.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5da588dc1e1c8c6a4c6fc25bc20b5d8472fd719 --- /dev/null +++ b/frontends/react/src/functions 2.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/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 new file mode 100644 index 0000000000000000000000000000000000000000..3cd2654267f6834109ac3306e6a4929fccab7397 --- /dev/null +++ b/frontends/react/src/index.css @@ -0,0 +1,3 @@ +@import "tailwindcss"; +@import "@elvis/ui/theme.css"; +@source "../node_modules/@elvis/ui/dist"; diff --git a/frontends/react/src/main.tsx b/frontends/react/src/main.tsx new file mode 100644 index 0000000000000000000000000000000000000000..bef5202a32cbd0632c43de40f6e908532903fd42 --- /dev/null +++ b/frontends/react/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/frontends/react/src/pyodide.worker.ts b/frontends/react/src/pyodide.worker.ts new file mode 100644 index 0000000000000000000000000000000000000000..d078f61d0278e71026137d7aeaa4990b08a378e6 --- /dev/null +++ b/frontends/react/src/pyodide.worker.ts @@ -0,0 +1,10 @@ +import { exposePython } from "@elvis/pyodide/worker"; + +import managerCode from "../../../backend/src/manager.py?raw"; +import logicCode from "../../../backend/src/logic.py?raw"; +import algorithmsSpec from "../../../backend/src/algorithms.json?raw"; + +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 new file mode 100644 index 0000000000000000000000000000000000000000..519e0b2cd8c1609e915f9a30c10f29cec87402e1 --- /dev/null +++ b/frontends/react/src/types.ts @@ -0,0 +1,51 @@ +import type { ParamValue } from "@elvis/ui"; + +// 1 for f(x), 2 for f(x, y) +export type Variables = 1 | 2; + +export type Range = [number, number]; + +// 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; +} + +// A point on a trajectory, with f and its derivatives there +export interface Point { + position: number[]; + value: number; + gradient: number[]; + hessian: number[][]; +} + +export interface RunState { + // null once the run has stopped; stopped then says why + point: Point | null; + stopped: string | null; +} + +// Every run after some number of iterations +export interface State { + runs: RunState[]; +} + +// f sampled for the plot; null where f has no finite value +export interface CurveValues { + x: number[]; + f: (number | null)[]; +} + +export interface SurfaceValues { + x: number[]; + y: number[]; + // 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 type FunctionValues = CurveValues | SurfaceValues; diff --git a/frontends/react/src/usage.md b/frontends/react/src/usage.md new file mode 100644 index 0000000000000000000000000000000000000000..433936c26bc4fd6f564501ec53329114edd7fcd6 --- /dev/null +++ b/frontends/react/src/usage.md @@ -0,0 +1,22 @@ +Watch an optimiser walk downhill on a function you choose, one iteration at a time. + +## Steps + +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. **Optimiser:** 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, 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. + +The **Metrics** tab shows the current point with f, the gradient and the Hessian (or f′ and f″ with one variable), and a chart of f at each iteration. A run stops after 1000 iterations, or earlier if it diverges. + +## Two variables + +The plot is a contour map of f, coloured from low (purple) to high (yellow). Tick **Gradient field** to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. **Surface** shows f in 3D; drag to turn it. + +## Compare + +In the **Compare** tab, press **+ Add optimiser** for another run on the same function. Click a run to open it and change its algorithm, settings and initial point; every run steps together, from the start again after a change. Click a run's colour to pick another, or × to remove it. Run 1 is the main run from Configure: editing it here changes it there too. + +## Plot + +Drag to pan and scroll to zoom. The function is redrawn for the new view. diff --git a/frontends/react/src/useOptimisation 2.ts b/frontends/react/src/useOptimisation 2.ts new file mode 100644 index 0000000000000000000000000000000000000000..628905da4e9fee4ddc8c57ee133f63bad4e3ea99 --- /dev/null +++ b/frontends/react/src/useOptimisation 2.ts @@ -0,0 +1,344 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { usePythonStatus } from "@elvis/pyodide"; +import { useStepper, type ParamValue } from "@elvis/ui"; + +import { algorithmById } 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; +// Runs shown at once (the current one plus comparisons), one per colour +export const MAX_RUNS = RUN_COLORS.length; + +// A run Python is stepping; id 1 is the main run +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 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))); +} + +// One optimiser's settings as the student edits them, with the start kept as typed +interface RunDraft { + algorithm: string; + params: Record; + startText: string[]; +} + +// A run added in the Compare tab: its own settings, a fixed number and a colour +export interface Comparison extends RunDraft { + id: number; + color: string; +} + +function newDraft(start: number[]): RunDraft { + return { algorithm: "gradient_descent", params: {}, startText: start.map(String) }; +} + +// 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); + const [mainDraft, setMainDraft] = useState(() => newDraft(first.start)); + // Runs added in the Compare tab, stepped alongside the main one + const [compared, setCompared] = useState([]); + // The next comparison's number (the main run is 1) + 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); + // 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 main = makeEditor(mainDraft, setMainDraft, typing); + const comparisonEditors = compared.map((c) => + makeEditor(c, (change) => setCompared((cs) => cs.map((x) => (x.id === c.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 allRuns: Run[] = [ + { id: 1, settings: main.settings, color: RUN_COLORS[0].value, label: `1 · ${algorithmById(main.algorithm).label}` }, + ...compared.map((c, i) => ({ + id: c.id, + settings: comparisonEditors[i].settings, + color: c.color, + label: `${c.id} · ${algorithmById(c.algorithm).label}`, + })), + ]; + const allSettings = allRuns.map((run) => run.settings); + const allValid = main.startValid && comparisonEditors.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 result = await python.call("handle_function_values", { x_range: xRange.current, y_range: yRange.current }); + 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); + delay.current = 0; + 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 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]]); + main.setStartText(starts(main.startText)); + setCompared((cs) => cs.map((c) => ({ ...c, startText: starts(c.startText) }))); + if (n === 2) { + yRange.current = xRange.current; + } + } + } + if (preset) { + main.setStartText(preset.start.map(String)); + setCompared((cs) => cs.map((c) => ({ ...c, startText: preset.start.map(String) }))); + 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)]); + } + + // Somewhere in the middle 90% of the view + function randomStart(editor: RunEditor) { + const pick = ([a, b]: Range) => a + (0.05 + 0.9 * Math.random()) * (b - a); + startAt(editor, pick(xRange.current), pick(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 comparison with default settings and the first free colour; returns its id + function addComparison(): number { + const used = new Set([RUN_COLORS[0].value, ...compared.map((c) => c.color)]); + const color = RUN_COLORS.find((c) => !used.has(c.value))?.value ?? RUN_COLORS[1].value; + const id = nextId.current++; + setCompared([...compared, { id, color, ...newDraft(defaultStart()) }]); + return id; + } + + function removeComparison(id: number) { + const rest = compared.filter((c) => c.id !== id); + if (rest.length === 0) { + nextId.current = 2; + } + setCompared(rest); + } + + + function handleViewChange(x: Range, y: Range) { + xRange.current = x; + yRange.current = y; + refreshValues(); + } + + const shown = states.current.slice(0, step.iteration + 1); + const trajectories: Trajectory[] = runs.map((run, r) => ({ + ...run, + // A colour picked since the last rerun applies straight away + color: compared.find((c) => c.id === run.id)?.color ?? run.color, + 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, + main, + // Clicking the plot moves the main run's start + setStartAt: (x: number, y: number) => startAt(main, x, y), + randomStart, + resetStart, + runError, + comparisons: compared.map((c, i) => ({ id: c.id, color: c.color, editor: comparisonEditors[i] })), + canAddComparison: compared.length + 1 < MAX_RUNS, + addComparison, + removeComparison, + setComparisonColor: (id: number, color: string) => setCompared((cs) => cs.map((c) => (c.id === id ? { ...c, color } : c))), + values, + xRange, + yRange, + handleViewChange, + trajectories, + step, + }; +} diff --git a/frontends/react/src/useOptimisation.ts b/frontends/react/src/useOptimisation.ts new file mode 100644 index 0000000000000000000000000000000000000000..628905da4e9fee4ddc8c57ee133f63bad4e3ea99 --- /dev/null +++ b/frontends/react/src/useOptimisation.ts @@ -0,0 +1,344 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { usePythonStatus } from "@elvis/pyodide"; +import { useStepper, type ParamValue } from "@elvis/ui"; + +import { algorithmById } 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; +// Runs shown at once (the current one plus comparisons), one per colour +export const MAX_RUNS = RUN_COLORS.length; + +// A run Python is stepping; id 1 is the main run +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 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))); +} + +// One optimiser's settings as the student edits them, with the start kept as typed +interface RunDraft { + algorithm: string; + params: Record; + startText: string[]; +} + +// A run added in the Compare tab: its own settings, a fixed number and a colour +export interface Comparison extends RunDraft { + id: number; + color: string; +} + +function newDraft(start: number[]): RunDraft { + return { algorithm: "gradient_descent", params: {}, startText: start.map(String) }; +} + +// 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); + const [mainDraft, setMainDraft] = useState(() => newDraft(first.start)); + // Runs added in the Compare tab, stepped alongside the main one + const [compared, setCompared] = useState([]); + // The next comparison's number (the main run is 1) + 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); + // 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 main = makeEditor(mainDraft, setMainDraft, typing); + const comparisonEditors = compared.map((c) => + makeEditor(c, (change) => setCompared((cs) => cs.map((x) => (x.id === c.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 allRuns: Run[] = [ + { id: 1, settings: main.settings, color: RUN_COLORS[0].value, label: `1 · ${algorithmById(main.algorithm).label}` }, + ...compared.map((c, i) => ({ + id: c.id, + settings: comparisonEditors[i].settings, + color: c.color, + label: `${c.id} · ${algorithmById(c.algorithm).label}`, + })), + ]; + const allSettings = allRuns.map((run) => run.settings); + const allValid = main.startValid && comparisonEditors.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 result = await python.call("handle_function_values", { x_range: xRange.current, y_range: yRange.current }); + 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); + delay.current = 0; + 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 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]]); + main.setStartText(starts(main.startText)); + setCompared((cs) => cs.map((c) => ({ ...c, startText: starts(c.startText) }))); + if (n === 2) { + yRange.current = xRange.current; + } + } + } + if (preset) { + main.setStartText(preset.start.map(String)); + setCompared((cs) => cs.map((c) => ({ ...c, startText: preset.start.map(String) }))); + 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)]); + } + + // Somewhere in the middle 90% of the view + function randomStart(editor: RunEditor) { + const pick = ([a, b]: Range) => a + (0.05 + 0.9 * Math.random()) * (b - a); + startAt(editor, pick(xRange.current), pick(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 comparison with default settings and the first free colour; returns its id + function addComparison(): number { + const used = new Set([RUN_COLORS[0].value, ...compared.map((c) => c.color)]); + const color = RUN_COLORS.find((c) => !used.has(c.value))?.value ?? RUN_COLORS[1].value; + const id = nextId.current++; + setCompared([...compared, { id, color, ...newDraft(defaultStart()) }]); + return id; + } + + function removeComparison(id: number) { + const rest = compared.filter((c) => c.id !== id); + if (rest.length === 0) { + nextId.current = 2; + } + setCompared(rest); + } + + + function handleViewChange(x: Range, y: Range) { + xRange.current = x; + yRange.current = y; + refreshValues(); + } + + const shown = states.current.slice(0, step.iteration + 1); + const trajectories: Trajectory[] = runs.map((run, r) => ({ + ...run, + // A colour picked since the last rerun applies straight away + color: compared.find((c) => c.id === run.id)?.color ?? run.color, + 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, + main, + // Clicking the plot moves the main run's start + setStartAt: (x: number, y: number) => startAt(main, x, y), + randomStart, + resetStart, + runError, + comparisons: compared.map((c, i) => ({ id: c.id, color: c.color, editor: comparisonEditors[i] })), + canAddComparison: compared.length + 1 < MAX_RUNS, + addComparison, + removeComparison, + setComparisonColor: (id: number, color: string) => setCompared((cs) => cs.map((c) => (c.id === id ? { ...c, color } : c))), + values, + xRange, + yRange, + handleViewChange, + trajectories, + step, + }; +} diff --git a/frontends/react/tsconfig.app.json b/frontends/react/tsconfig.app.json new file mode 100644 index 0000000000000000000000000000000000000000..a9b5a59ca647ca0102d2501b56cedd83ad7b6818 --- /dev/null +++ b/frontends/react/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/frontends/react/tsconfig.json b/frontends/react/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..1ffef600d959ec9e396d5a260bd3f5b927b2cef8 --- /dev/null +++ b/frontends/react/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/frontends/react/tsconfig.node.json b/frontends/react/tsconfig.node.json new file mode 100644 index 0000000000000000000000000000000000000000..8a67f62f4ceebff3424e6e8cd4b3c25b17347546 --- /dev/null +++ b/frontends/react/tsconfig.node.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/frontends/react/vite.config.ts b/frontends/react/vite.config.ts new file mode 100644 index 0000000000000000000000000000000000000000..f570dca614f2b5a8c2577ce4615ae3d52a1d39c9 --- /dev/null +++ b/frontends/react/vite.config.ts @@ -0,0 +1,25 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import tailwindcss from '@tailwindcss/vite' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + 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/index.html b/index.html deleted file mode 100644 index b0c4b3666032a737f3903db53e6a8a9272483e28..0000000000000000000000000000000000000000 --- a/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - My static Space - - - -
    - - diff --git a/old_code/README.md b/old_code/README.md new file mode 100644 index 0000000000000000000000000000000000000000..61739abbd5a6700fe6d3960adc84e0fabc27531c --- /dev/null +++ b/old_code/README.md @@ -0,0 +1,12 @@ +--- +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 new file mode 100644 index 0000000000000000000000000000000000000000..b91acef6d7531e98f9cdd89780521d6032144f6e --- /dev/null +++ b/old_code/bivariate.py @@ -0,0 +1,603 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..65e3087a40b76e76e1252fcb2ac9ad380f964f84 --- /dev/null +++ b/old_code/optimisation.py @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..20f4cc7ca21cf43420424930f535bb5553a1ff67 --- /dev/null +++ b/old_code/optimisers.py @@ -0,0 +1,312 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..c0790ec2b0eb8fa0f9f7ea8f9a6f7c8f9a05d1c5 --- /dev/null +++ b/old_code/requirements.txt @@ -0,0 +1,9 @@ +matplotlib +mpu +numexpr +numpy +pandas +pillow +plotly +scikit-learn +sympy diff --git a/old_code/univariate.py b/old_code/univariate.py new file mode 100644 index 0000000000000000000000000000000000000000..6281aa7e99c4f02cd24e800666b304656ccab351 --- /dev/null +++ b/old_code/univariate.py @@ -0,0 +1,261 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..9350beecead91a2e438be5580ea56ae278b72dde --- /dev/null +++ b/old_code/usage.md @@ -0,0 +1 @@ +**Quick start** diff --git a/style.css b/style.css deleted file mode 100644 index 114adf441e9032febb46bc056b2a8bb651075f0d..0000000000000000000000000000000000000000 --- a/style.css +++ /dev/null @@ -1,28 +0,0 @@ -body { - padding: 2rem; - font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif; -} - -h1 { - font-size: 16px; - margin-top: 0; -} - -p { - color: rgb(107, 114, 128); - font-size: 15px; - margin-bottom: 10px; - margin-top: 5px; -} - -.card { - max-width: 620px; - margin: 0 auto; - padding: 16px; - border: 1px solid lightgray; - border-radius: 16px; -} - -.card p:last-child { - margin-bottom: 0; -}