{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9e68b3e7",
   "metadata": {
    "papermill": {
     "duration": 0.001797,
     "end_time": "2026-10-05T12:56:59.589998+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:56:59.588201+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "# Population & infrastructure risk exposure\n",
    "\n",
    "**Question:** how many people and which facilities are exposed to a given hazard *before* any event?\n",
    "\n",
    "**Method** (after INFORM / the MapAction–IFRC children-exposure work):\n",
    "1. **Hazard mask** — compare the hazard layer to the intensity threshold → 1 exposed / 0 not.\n",
    "2. **Overlay population** — project to a common grid and multiply by the population raster.\n",
    "3. **Zonal statistics** — sum exposed population and count facilities per subdivision."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2890e525",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:56:59.596505Z",
     "iopub.status.busy": "2026-10-05T12:56:59.596278Z",
     "iopub.status.idle": "2026-10-05T12:56:59.600072Z",
     "shell.execute_reply": "2026-10-05T12:56:59.599613Z"
    },
    "papermill": {
     "duration": 0.006788,
     "end_time": "2026-10-05T12:56:59.600903+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:56:59.594115+00:00",
     "status": "completed"
    },
    "tags": [
     "parameters"
    ]
   },
   "outputs": [],
   "source": [
    "# --- Reserved parameters (injected by the Notebook Factory; defaults keep the notebook runnable standalone) ---\n",
    "run_id = \"\"\n",
    "inputs_dir = \"\"\n",
    "output_dir = \"outputs\"\n",
    "area = {}                      # {id, code, name, level, country, country_name, bbox}\n",
    "area_geojson = \"\"              # FeatureCollection with the target area\n",
    "subdivisions_geojson = \"\"      # FeatureCollection with the aggregation subdivisions\n",
    "event = {}                     # Montandon STAC item (dict)\n",
    "event_json = \"\"\n",
    "montandon_stac_url = \"https://montandon-eoapi-stage.ifrc.org/stac\"\n",
    "hazard = \"\"\n",
    "\n",
    "# --- User parameters ---\n",
    "hazard = \"flood\"\n",
    "intensity_threshold = 0.5\n",
    "return_period = 100\n",
    "climate_scenario = \"current\"\n",
    "aggregation_level = 2\n",
    "population_source = \"worldpop_100m\"\n",
    "age_group = \"all\"\n",
    "infrastructure_layers = [\"schools\", \"hospitals\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e5add1c8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:56:59.607090Z",
     "iopub.status.busy": "2026-10-05T12:56:59.606934Z",
     "iopub.status.idle": "2026-10-05T12:56:59.609927Z",
     "shell.execute_reply": "2026-10-05T12:56:59.609486Z"
    },
    "papermill": {
     "duration": 0.005492,
     "end_time": "2026-10-05T12:56:59.610513+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:56:59.605021+00:00",
     "status": "completed"
    },
    "tags": [
     "injected-parameters"
    ]
   },
   "outputs": [],
   "source": [
    "# Parameters\n",
    "run_id = \"44d6f490-ef9b-4560-b1cd-c07021e40884\"\n",
    "inputs_dir = \"/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs\"\n",
    "output_dir = \"/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/outputs\"\n",
    "area = {\"id\": 19, \"code\": \"NPL.5.2_1\", \"name\": \"Gandaki\", \"level\": 2, \"country\": \"NPL\", \"country_name\": \"Nepal\", \"bbox\": [83.4423, 27.741, 85.1999, 28.9002]}\n",
    "area_geojson = \"/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs/area.geojson\"\n",
    "subdivisions_geojson = \"/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs/subdivisions.geojson\"\n",
    "event = {}\n",
    "event_json = \"\"\n",
    "montandon_stac_url = \"https://montandon-eoapi-stage.ifrc.org/stac\"\n",
    "hazard = \"flood\"\n",
    "age_group = \"all\"\n",
    "return_period = 100\n",
    "climate_scenario = \"current\"\n",
    "aggregation_level = 2\n",
    "population_source = \"worldpop_100m\"\n",
    "intensity_threshold = 0.5\n",
    "infrastructure_layers = [\"schools\", \"hospitals\"]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d61257a8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:56:59.617208Z",
     "iopub.status.busy": "2026-10-05T12:56:59.617067Z",
     "iopub.status.idle": "2026-10-05T12:57:00.104864Z",
     "shell.execute_reply": "2026-10-05T12:57:00.104376Z"
    },
    "papermill": {
     "duration": 0.508522,
     "end_time": "2026-10-05T12:57:00.123555+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:56:59.615033+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Area: Gandaki · 1 subdivisions\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>code</th>\n",
       "      <th>name</th>\n",
       "      <th>level</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NPL.5.2_1</td>\n",
       "      <td>Gandaki</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        code     name  level\n",
       "0  NPL.5.2_1  Gandaki      2"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json, math, os, warnings\n",
    "from pathlib import Path\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import geopandas as gpd\n",
    "import shapely\n",
    "from shapely.geometry import box\n",
    "\n",
    "warnings.filterwarnings(\"ignore\", message=\".*geographic CRS.*\")\n",
    "Path(output_dir).mkdir(parents=True, exist_ok=True)\n",
    "\n",
    "def centroids(geoms):\n",
    "    \"\"\"Centroids computed in an equal-area projection (avoids the geographic-CRS warning).\"\"\"\n",
    "    return geoms.to_crs(6933).centroid.to_crs(4326)\n",
    "\n",
    "def load_area_and_subdivisions():\n",
    "    \"\"\"Read the boundaries prepared by the app, or build a small demo area when run standalone.\"\"\"\n",
    "    if area_geojson and Path(area_geojson).exists():\n",
    "        area_gdf = gpd.read_file(area_geojson)\n",
    "        subs = gpd.read_file(subdivisions_geojson) if subdivisions_geojson and Path(subdivisions_geojson).exists() else area_gdf.copy()\n",
    "        return area_gdf, subs\n",
    "    demo = gpd.GeoDataFrame({\"name\": [\"Demo area\"], \"code\": [\"DEMO\"], \"level\": [1]}, geometry=[box(83.5, 26.5, 88.0, 30.5)], crs=4326)\n",
    "    cells, names = [], []\n",
    "    minx, miny, maxx, maxy = demo.total_bounds\n",
    "    for i in range(3):\n",
    "        for j in range(3):\n",
    "            cells.append(box(minx + i * (maxx - minx) / 3, miny + j * (maxy - miny) / 3, minx + (i + 1) * (maxx - minx) / 3, miny + (j + 1) * (maxy - miny) / 3))\n",
    "            names.append(f\"Demo district {i * 3 + j + 1}\")\n",
    "    subs = gpd.GeoDataFrame({\"name\": names, \"code\": [f\"DEMO.{k}\" for k in range(9)], \"level\": [2] * 9}, geometry=cells, crs=4326)\n",
    "    return demo, subs\n",
    "\n",
    "area_gdf, subdivisions = load_area_and_subdivisions()\n",
    "area_name = area.get(\"name\") or area_gdf.iloc[0].get(\"name\", \"Demo area\")\n",
    "print(f\"Area: {area_name} · {len(subdivisions)} subdivisions\")\n",
    "subdivisions[[\"code\", \"name\", \"level\"]].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2be11e97",
   "metadata": {
    "papermill": {
     "duration": 0.001531,
     "end_time": "2026-10-05T12:57:00.129992+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.128461+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## 1 · Hazard layer and mask\n",
    "\n",
    "> **Illustrative data.** Real runs would fetch the hazard raster for `hazard`, `return_period` and\n",
    "> `climate_scenario` (STORM, Aqueduct, GEM, GlobFire…). Here a synthetic field stands in."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b2901e30",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.137080Z",
     "iopub.status.busy": "2026-10-05T12:57:00.136878Z",
     "iopub.status.idle": "2026-10-05T12:57:00.150015Z",
     "shell.execute_reply": "2026-10-05T12:57:00.149555Z"
    },
    "papermill": {
     "duration": 0.024434,
     "end_time": "2026-10-05T12:57:00.158625+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.134191+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "flood · threshold 0.5 · 100-yr · current: 40.6% of grid cells exposed\n"
     ]
    }
   ],
   "source": [
    "# ---------------------------------------------------------------------------------------------\n",
    "# ILLUSTRATIVE DATA. The hazard and population grids below are synthetic, generated so the\n",
    "# pipeline can be exercised end-to-end without large downloads. Replace `hazard_grid()` and\n",
    "# `population_grid()` with real loaders (STORM / Aqueduct / GEM / GlobFire rasters, WorldPop / GHSL)\n",
    "# and the rest of the notebook works unchanged.\n",
    "# ---------------------------------------------------------------------------------------------\n",
    "def make_grid(bounds, n=120):\n",
    "    minx, miny, maxx, maxy = bounds\n",
    "    step = max((maxx - minx), (maxy - miny)) / n\n",
    "    xs = np.arange(minx + step / 2, maxx, step)\n",
    "    ys = np.arange(miny + step / 2, maxy, step)\n",
    "    X, Y = np.meshgrid(xs, ys)\n",
    "    return X, Y, step\n",
    "\n",
    "def hazard_grid(X, Y, seed=0):\n",
    "    \"\"\"Synthetic hazard intensity field in the units of the chosen hazard.\"\"\"\n",
    "    rng = np.random.default_rng(seed)\n",
    "    cx, cy = rng.uniform(X.min(), X.max()), rng.uniform(Y.min(), Y.max())\n",
    "    d = np.hypot(X - cx, Y - cy) / max(X.max() - X.min(), 1e-6)\n",
    "    ridges = 0.5 + 0.5 * np.sin(X * 9 + rng.uniform(0, 6)) * np.cos(Y * 7 + rng.uniform(0, 6))\n",
    "    field = np.clip(1.0 - 1.6 * d, 0, 1) * 0.6 + ridges * 0.4\n",
    "    return np.clip(field, 0, 1)   # 0..1\n",
    "\n",
    "def population_grid(X, Y, subs, seed=0):\n",
    "    \"\"\"Synthetic population: denser near subdivision centroids.\"\"\"\n",
    "    rng = np.random.default_rng(seed + 1)\n",
    "    pop = np.zeros_like(X)\n",
    "    for geom in subs.geometry:\n",
    "        c = geom.centroid\n",
    "        pop += np.exp(-((X - c.x) ** 2 + (Y - c.y) ** 2) / (0.02 + rng.uniform(0, 0.05)))\n",
    "    pop *= rng.uniform(0.6, 1.4, size=X.shape)\n",
    "    return pop / pop.sum() * 250_000 * len(subs)   # people per cell\n",
    "\n",
    "def cells_to_gdf(X, Y, step, **cols):\n",
    "    geoms = [box(x - step / 2, y - step / 2, x + step / 2, y + step / 2) for x, y in zip(X.ravel(), Y.ravel())]\n",
    "    return gpd.GeoDataFrame({k: v.ravel() for k, v in cols.items()}, geometry=geoms, crs=4326)\n",
    "\n",
    "def zonal_sum(cells, zones, value_cols):\n",
    "    \"\"\"Sum cell values per zone using cell centroids (fast enough for illustrative grids).\"\"\"\n",
    "    pts = cells.copy()\n",
    "    pts[\"geometry\"] = centroids(pts.geometry)\n",
    "    joined = gpd.sjoin(pts, zones[[\"geometry\"]], how=\"inner\", predicate=\"within\")\n",
    "    agg = joined.groupby(\"index_right\")[value_cols].sum()\n",
    "    out = zones.copy()\n",
    "    for c in value_cols:\n",
    "        out[c] = agg[c].reindex(zones.index).fillna(0).values\n",
    "    return out\n",
    "\n",
    "seed = abs(hash((area.get(\"code\", \"DEMO\"), hazard, return_period, climate_scenario))) % 10_000\n",
    "X, Y, step = make_grid(area_gdf.total_bounds)\n",
    "intensity = hazard_grid(X, Y, seed)\n",
    "if climate_scenario != \"current\":\n",
    "    intensity = np.clip(intensity * (1.15 if climate_scenario == \"rcp45\" else 1.3), 0, 1)\n",
    "intensity *= 1 + math.log10(return_period / 100) * 0.2 if return_period else 1\n",
    "mask = (intensity >= intensity_threshold).astype(int)\n",
    "print(f\"{hazard} · threshold {intensity_threshold} · {return_period}-yr · {climate_scenario}: {mask.mean():.1%} of grid cells exposed\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a8bfbf1d",
   "metadata": {
    "papermill": {
     "duration": 0.00159,
     "end_time": "2026-10-05T12:57:00.164868+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.163278+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## 2 · Overlay population"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "aa4bba4d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.171109Z",
     "iopub.status.busy": "2026-10-05T12:57:00.170921Z",
     "iopub.status.idle": "2026-10-05T12:57:00.419257Z",
     "shell.execute_reply": "2026-10-05T12:57:00.418768Z"
    },
    "papermill": {
     "duration": 0.261639,
     "end_time": "2026-10-05T12:57:00.430345+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.168706+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Population (worldpop_100m, all): 250,000 · exposed: 151,951\n"
     ]
    }
   ],
   "source": [
    "share = {\"all\": 1.0, \"under_18\": 0.33, \"under_5\": 0.10, \"over_65\": 0.06}[age_group]\n",
    "population = population_grid(X, Y, subdivisions, seed) * share\n",
    "exposed = population * mask\n",
    "cells = cells_to_gdf(X, Y, step, intensity=intensity, mask=mask, population=population, exposed=exposed)\n",
    "cells = cells[cells.intersects(area_gdf.union_all())]\n",
    "print(f\"Population ({population_source}, {age_group}): {population.sum():,.0f} · exposed: {exposed.sum():,.0f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "424acc6a",
   "metadata": {
    "papermill": {
     "duration": 0.001812,
     "end_time": "2026-10-05T12:57:00.440566+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.438754+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## 3 · Zonal statistics per subdivision"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "45ff43eb",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.455205Z",
     "iopub.status.busy": "2026-10-05T12:57:00.455018Z",
     "iopub.status.idle": "2026-10-05T12:57:00.658114Z",
     "shell.execute_reply": "2026-10-05T12:57:00.657647Z"
    },
    "papermill": {
     "duration": 0.229044,
     "end_time": "2026-10-05T12:57:00.681631+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.452587+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">\n",
       "#T_7eaa4_row0_col3 {\n",
       "  background-color: #fff7ec;\n",
       "  color: #000000;\n",
       "}\n",
       "</style>\n",
       "<table id=\"T_7eaa4\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th class=\"blank level0\" >&nbsp;</th>\n",
       "      <th id=\"T_7eaa4_level0_col0\" class=\"col_heading level0 col0\" >name</th>\n",
       "      <th id=\"T_7eaa4_level0_col1\" class=\"col_heading level0 col1\" >population</th>\n",
       "      <th id=\"T_7eaa4_level0_col2\" class=\"col_heading level0 col2\" >exposed</th>\n",
       "      <th id=\"T_7eaa4_level0_col3\" class=\"col_heading level0 col3\" >exposed_share</th>\n",
       "      <th id=\"T_7eaa4_level0_col4\" class=\"col_heading level0 col4\" >schools_total</th>\n",
       "      <th id=\"T_7eaa4_level0_col5\" class=\"col_heading level0 col5\" >schools_exposed</th>\n",
       "      <th id=\"T_7eaa4_level0_col6\" class=\"col_heading level0 col6\" >hospitals_total</th>\n",
       "      <th id=\"T_7eaa4_level0_col7\" class=\"col_heading level0 col7\" >hospitals_exposed</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th id=\"T_7eaa4_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
       "      <td id=\"T_7eaa4_row0_col0\" class=\"data row0 col0\" >Gandaki</td>\n",
       "      <td id=\"T_7eaa4_row0_col1\" class=\"data row0 col1\" >247,535</td>\n",
       "      <td id=\"T_7eaa4_row0_col2\" class=\"data row0 col2\" >151,419</td>\n",
       "      <td id=\"T_7eaa4_row0_col3\" class=\"data row0 col3\" >61.2%</td>\n",
       "      <td id=\"T_7eaa4_row0_col4\" class=\"data row0 col4\" >25</td>\n",
       "      <td id=\"T_7eaa4_row0_col5\" class=\"data row0 col5\" >13</td>\n",
       "      <td id=\"T_7eaa4_row0_col6\" class=\"data row0 col6\" >4</td>\n",
       "      <td id=\"T_7eaa4_row0_col7\" class=\"data row0 col7\" >1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7fa23b3b9640>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stats = zonal_sum(cells, subdivisions, [\"population\", \"exposed\"])\n",
    "stats[\"exposed_share\"] = (stats[\"exposed\"] / stats[\"population\"].replace(0, np.nan)).fillna(0)\n",
    "\n",
    "# Facilities: synthetic points per subdivision (replace with OSM / HOT exports)\n",
    "rng = np.random.default_rng(seed)\n",
    "fac_rows = []\n",
    "for layer in infrastructure_layers:\n",
    "    per_zone = {\"schools\": 25, \"hospitals\": 4, \"airports\": 1, \"roads\": 10}.get(layer, 5)\n",
    "    for idx, geom in subdivisions.geometry.items():\n",
    "        minx, miny, maxx, maxy = geom.bounds\n",
    "        n = 0\n",
    "        while n < per_zone:\n",
    "            p = shapely.Point(rng.uniform(minx, maxx), rng.uniform(miny, maxy))\n",
    "            if geom.contains(p):\n",
    "                fac_rows.append({\"layer\": layer, \"zone\": idx, \"geometry\": p}); n += 1\n",
    "facilities = gpd.GeoDataFrame(fac_rows, crs=4326) if fac_rows else gpd.GeoDataFrame(columns=[\"layer\", \"zone\", \"geometry\"], crs=4326)\n",
    "if len(facilities):\n",
    "    hit = gpd.sjoin(facilities, cells[cells[\"mask\"] == 1][[\"geometry\"]], how=\"left\", predicate=\"within\")\n",
    "    facilities[\"exposed\"] = hit[\"index_right\"].notna().groupby(level=0).any().reindex(facilities.index).fillna(False).astype(bool)\n",
    "    for layer in infrastructure_layers:\n",
    "        f = facilities[facilities.layer == layer]\n",
    "        stats[f\"{layer}_total\"] = f.groupby(\"zone\").size().reindex(stats.index).fillna(0).astype(int)\n",
    "        stats[f\"{layer}_exposed\"] = f[f.exposed].groupby(\"zone\").size().reindex(stats.index).fillna(0).astype(int)\n",
    "\n",
    "cols = [\"name\", \"population\", \"exposed\", \"exposed_share\"] + [c for c in stats.columns if c.endswith(\"_exposed\") or c.endswith(\"_total\")]\n",
    "table = stats[cols].sort_values(\"exposed\", ascending=False)\n",
    "table[\"population\"] = table[\"population\"].round(0); table[\"exposed\"] = table[\"exposed\"].round(0)\n",
    "table.to_csv(Path(output_dir) / \"exposure_by_subdivision.csv\", index=False)\n",
    "stats.to_file(Path(output_dir) / \"exposure_by_subdivision.geojson\", driver=\"GeoJSON\")\n",
    "table.style.format({\"population\": \"{:,.0f}\", \"exposed\": \"{:,.0f}\", \"exposed_share\": \"{:.1%}\"}).background_gradient(subset=[\"exposed_share\"], cmap=\"OrRd\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1e6ce49",
   "metadata": {
    "papermill": {
     "duration": 0.001667,
     "end_time": "2026-10-05T12:57:00.688078+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.686411+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## Results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d23f2462",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.695062Z",
     "iopub.status.busy": "2026-10-05T12:57:00.694838Z",
     "iopub.status.idle": "2026-10-05T12:57:00.818844Z",
     "shell.execute_reply": "2026-10-05T12:57:00.818353Z"
    },
    "papermill": {
     "duration": 0.135822,
     "end_time": "2026-10-05T12:57:00.827969+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.692147+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "93bd8c63c2d1461b8ce78525386348f4",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "<manywidgets.row.widget.Row object at 0x7fa231fa92b0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Visualisation: lonboard for maps, manywidgets for charts, controls and stats.\n",
    "# All of these are anywidgets, so they stay interactive in the published (kernel-free) page.\n",
    "from matplotlib import colormaps\n",
    "from lonboard import Map, PolygonLayer, ScatterplotLayer\n",
    "from manywidgets import Chart, Column, Legend, Row, Slider, Stat\n",
    "from manywidgets.lonboard import LayerToggle\n",
    "\n",
    "def colors_for(values, cmap=\"OrRd\", vmin=None, vmax=None):\n",
    "    v = np.asarray(values, dtype=float)\n",
    "    vmin = np.nanmin(v) if vmin is None else vmin\n",
    "    vmax = np.nanmax(v) if vmax is None else vmax\n",
    "    norm = (v - vmin) / (vmax - vmin) if vmax > vmin else np.zeros_like(v)\n",
    "    rgba = colormaps[cmap](np.nan_to_num(norm))\n",
    "    return (rgba * 255).astype(np.uint8)\n",
    "\n",
    "def legend_for(cmap, vmin, vmax, title=\"\", n=5, fmt=\"{:.0%}\"):\n",
    "    stops = np.linspace(vmin, vmax, n)\n",
    "    rgb = colors_for(stops, cmap, vmin, vmax)[:, :3]\n",
    "    return Legend(entries=[[[int(c) for c in rgb[i]], fmt.format(stops[i])] for i in range(n)], title=title)\n",
    "\n",
    "def bar_chart(names, values, title, y_label, color=\"#E4572E\"):\n",
    "    chart = Chart(chart_type=\"bar\", title=title, y_label=y_label, height=max(280, 22 * len(names) + 120), legend_enabled=False)\n",
    "    chart.set_options(scales={\"x\": {\"type\": \"category\", \"ticks\": {\"autoSkip\": False, \"maxRotation\": 60, \"minRotation\": 30}}})\n",
    "    chart.add_series(x=[str(n) for n in names], y=[float(v) for v in values], name=y_label, series_type=\"bar\", color=color)\n",
    "    return chart\n",
    "\n",
    "def fmt_int(v):\n",
    "    return f\"{float(v):,.0f}\"\n",
    "\n",
    "n_fac = int(sum(stats[c].sum() for c in stats.columns if c.endswith(\"_exposed\"))) if infrastructure_layers else 0\n",
    "Row(\n",
    "    Stat(label=f\"Population ({age_group})\", value=fmt_int(stats[\"population\"].sum())),\n",
    "    Stat(label=\"Exposed population\", value=fmt_int(stats[\"exposed\"].sum())),\n",
    "    Stat(label=\"Share exposed\", value=f\"{stats['exposed'].sum() / max(stats['population'].sum(), 1):.1%}\"),\n",
    "    Stat(label=\"Facilities exposed\", value=n_fac),\n",
    "    gap=\"16px\",\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ffe4b42e",
   "metadata": {
    "papermill": {
     "duration": 0.002094,
     "end_time": "2026-10-05T12:57:00.857938+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.855844+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "### Map — exposed population share per subdivision"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1a789f1c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.865521Z",
     "iopub.status.busy": "2026-10-05T12:57:00.865339Z",
     "iopub.status.idle": "2026-10-05T12:57:00.938151Z",
     "shell.execute_reply": "2026-10-05T12:57:00.937687Z"
    },
    "papermill": {
     "duration": 0.097497,
     "end_time": "2026-10-05T12:57:00.960229+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.862732+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "373352e76f984ab3957b0d4aeb94bfd8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(<lonboard._map.Map object at 0x7fa239656030>, VBox(children=(ErrorOutput(), ErrorOutput(), Erro…"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vmax = max(float(stats[\"exposed_share\"].max()), 0.01)\n",
    "zones_layer = PolygonLayer.from_geopandas(stats[[\"name\", \"population\", \"exposed\", \"exposed_share\", \"geometry\"]], get_fill_color=colors_for(stats[\"exposed_share\"], \"OrRd\", 0, vmax), get_line_color=[60, 60, 60], line_width_min_pixels=1, opacity=0.75)\n",
    "layers = [zones_layer]\n",
    "fac_layer = None\n",
    "if len(facilities) and facilities.exposed.any():\n",
    "    fx = facilities[facilities.exposed]\n",
    "    fac_layer = ScatterplotLayer.from_geopandas(fx[[\"layer\", \"geometry\"]], get_fill_color=[31, 36, 48], radius_min_pixels=3)\n",
    "    layers.append(fac_layer)\n",
    "Map(layers)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "bf001d19",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:00.977591Z",
     "iopub.status.busy": "2026-10-05T12:57:00.977407Z",
     "iopub.status.idle": "2026-10-05T12:57:00.990645Z",
     "shell.execute_reply": "2026-10-05T12:57:00.990162Z"
    },
    "papermill": {
     "duration": 0.025187,
     "end_time": "2026-10-05T12:57:00.999711+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:00.974524+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a35cd520994c464abcd1b1a928dc724a",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "<manywidgets.row.widget.Row object at 0x7fa230943380>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "toggles = [LayerToggle(layer=zones_layer, label=\"Exposed share\")] + ([LayerToggle(layer=fac_layer, label=\"Exposed facilities\")] if fac_layer is not None else [])\n",
    "Row(Column(*toggles, gap=\"6px\"), legend_for(\"OrRd\", 0, vmax, title=\"Exposed population share\"), gap=\"24px\", align=\"start\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a41d3c8d",
   "metadata": {
    "papermill": {
     "duration": 0.001941,
     "end_time": "2026-10-05T12:57:01.010130+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:01.008189+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "### Exposed population by subdivision"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "95be0995",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-05T12:57:01.019105Z",
     "iopub.status.busy": "2026-10-05T12:57:01.018917Z",
     "iopub.status.idle": "2026-10-05T12:57:01.031141Z",
     "shell.execute_reply": "2026-10-05T12:57:01.030638Z"
    },
    "papermill": {
     "duration": 0.02854,
     "end_time": "2026-10-05T12:57:01.044712+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:01.016172+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "319660a5393147ca82a701e841177853",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "<manywidgets.chart.widget.Chart object at 0x7fa230942750>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bar_chart(table[\"name\"], table[\"exposed\"], title=f\"{area_name} · {hazard} ≥ {intensity_threshold} · {return_period}-yr · {climate_scenario}\", y_label=f\"Exposed population ({age_group})\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fb421396",
   "metadata": {
    "papermill": {
     "duration": 0.001949,
     "end_time": "2026-10-05T12:57:01.051653+00:00",
     "exception": false,
     "start_time": "2026-10-05T12:57:01.049704+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## Reproduce or adapt\n",
    "\n",
    "Download this notebook, change the parameters in the first cell (or replace the synthetic loaders with real\n",
    "rasters) and re-run it with standard Jupyter tooling. The published page is a frozen artefact; the method is not."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.15"
  },
  "papermill": {
   "default_parameters": {},
   "duration": 2.604878,
   "end_time": "2026-10-05T12:57:01.280980+00:00",
   "environment_variables": {},
   "exception": null,
   "input_path": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/template/notebook.ipynb",
   "output_path": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/notebook.ipynb",
   "parameters": {
    "age_group": "all",
    "aggregation_level": 2,
    "area": {
     "bbox": [
      83.4423,
      27.741,
      85.1999,
      28.9002
     ],
     "code": "NPL.5.2_1",
     "country": "NPL",
     "country_name": "Nepal",
     "id": 19,
     "level": 2,
     "name": "Gandaki"
    },
    "area_geojson": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs/area.geojson",
    "climate_scenario": "current",
    "event": {},
    "event_json": "",
    "hazard": "flood",
    "infrastructure_layers": [
     "schools",
     "hospitals"
    ],
    "inputs_dir": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs",
    "intensity_threshold": 0.5,
    "montandon_stac_url": "https://montandon-eoapi-stage.ifrc.org/stac",
    "output_dir": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/outputs",
    "population_source": "worldpop_100m",
    "return_period": 100,
    "run_id": "44d6f490-ef9b-4560-b1cd-c07021e40884",
    "subdivisions_geojson": "/app/data/work/44d6f490-ef9b-4560-b1cd-c07021e40884/inputs/subdivisions.geojson"
   },
   "start_time": "2026-10-05T12:56:58.676102+00:00",
   "version": "2.7.0"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "0372e9c3b18a46f6b7a2fa6db4ee34e0": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": "100%",
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": "100%"
      }
     },
     "10ae88b9cd2c4cd19ef92e80fccbb94c": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.stat.widget.Stat",
       "_css": ".manywidgets-stat {\n  display: inline-block;\n  min-width: 140px;\n  padding: 14px 18px;\n  border: 1px solid #e1e4e8;\n  border-radius: 10px;\n  background: #ffffff;\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n}\n\n.manywidgets-stat__label {\n  color: #586069;\n  font-size: 12px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.manywidgets-stat__value-row {\n  display: flex;\n  align-items: baseline;\n  gap: 4px;\n  margin-top: 6px;\n}\n\n.manywidgets-stat__value {\n  font-size: 30px;\n  font-weight: 700;\n  color: #24292e;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__unit {\n  font-size: 14px;\n  color: #586069;\n}\n\n.manywidgets-stat__delta {\n  margin-top: 4px;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__delta--up {\n  color: #1a7f37;\n}\n.manywidgets-stat__delta--down {\n  color: #cf222e;\n}\n.manywidgets-stat__delta--flat {\n  color: #586069;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction onChanges(model, names, fn) {\n  for (const name of names) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// src/manywidgets/stat/src/index.ts\nfunction render({ model, el }) {\n  const card = document.createElement(\"div\");\n  card.className = \"manywidgets-stat\";\n  const labelEl = document.createElement(\"div\");\n  labelEl.className = \"manywidgets-stat__label\";\n  const valueRow = document.createElement(\"div\");\n  valueRow.className = \"manywidgets-stat__value-row\";\n  const valueEl = document.createElement(\"span\");\n  valueEl.className = \"manywidgets-stat__value\";\n  const unitEl = document.createElement(\"span\");\n  unitEl.className = \"manywidgets-stat__unit\";\n  valueRow.appendChild(valueEl);\n  valueRow.appendChild(unitEl);\n  const deltaEl = document.createElement(\"div\");\n  deltaEl.className = \"manywidgets-stat__delta\";\n  card.appendChild(labelEl);\n  card.appendChild(valueRow);\n  card.appendChild(deltaEl);\n  el.appendChild(card);\n  function update() {\n    labelEl.textContent = model.get(\"label\");\n    valueEl.textContent = String(model.get(\"value\"));\n    unitEl.textContent = model.get(\"unit\");\n    const delta = model.get(\"delta\");\n    if (delta == null || delta === \"\") {\n      deltaEl.textContent = \"\";\n      deltaEl.className = \"manywidgets-stat__delta\";\n      return;\n    }\n    const n = Number(delta);\n    const sign = n > 0 ? \"\\u25B2\" : n < 0 ? \"\\u25BC\" : \"\\u2022\";\n    const dir = n > 0 ? \"up\" : n < 0 ? \"down\" : \"flat\";\n    deltaEl.textContent = `${sign} ${Math.abs(n)}`;\n    deltaEl.className = `manywidgets-stat__delta manywidgets-stat__delta--${dir}`;\n  }\n  update();\n  onChanges(model, [\"label\", \"value\", \"unit\", \"delta\"], update);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "delta": null,
       "label": "Population (all)",
       "layout": "IPY_MODEL_6ba9a2dd5c554b2bbd59060024fdff71",
       "tabbable": null,
       "tooltip": null,
       "unit": "",
       "value": "247,535",
       "widget_id": "stat_1"
      }
     },
     "206ee61a9fdf48a39fe75026c1beacd8": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_control_type": "navigation",
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "position": null,
       "show_compass": null,
       "show_zoom": null,
       "visualize_pitch": null,
       "visualize_roll": null
      }
     },
     "2554306e59bc405bbf3bd3cdec8c1c05": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "2dd53f4de47e41d1993a285012f8b353": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_bde16f262b0c401789c1dd3c93cf259d",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "319660a5393147ca82a701e841177853": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.chart.widget.Chart",
       "_css": ".manywidgets-chart {\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n  max-width: 100%;\n}\n\n.manywidgets-chart canvas {\n  display: block;\n}\n",
       "_dom_classes": [],
       "_esm": "var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// packages/core/src/index.ts\nfunction safeSaveChanges(model) {\n  try {\n    model?.save_changes?.();\n  } catch {\n  }\n}\nfunction onChanges(model, names2, fn) {\n  for (const name of names2) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names2) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// node_modules/@kurkle/color/dist/color.esm.js\nfunction round(v) {\n  return v + 0.5 | 0;\n}\nvar lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n  return lim(round(v * 2.55), 0, 255);\n}\nfunction n2b(v) {\n  return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n  return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n  return lim(round(v * 100), 0, 100);\n}\nvar map$1 = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };\nvar hex = [...\"0123456789ABCDEF\"];\nvar h1 = (b) => hex[b & 15];\nvar h2 = (b) => hex[(b & 240) >> 4] + hex[b & 15];\nvar eq = (b) => (b & 240) >> 4 === (b & 15);\nvar isShort = (v) => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n  var len = str.length;\n  var ret;\n  if (str[0] === \"#\") {\n    if (len === 4 || len === 5) {\n      ret = {\n        r: 255 & map$1[str[1]] * 17,\n        g: 255 & map$1[str[2]] * 17,\n        b: 255 & map$1[str[3]] * 17,\n        a: len === 5 ? map$1[str[4]] * 17 : 255\n      };\n    } else if (len === 7 || len === 9) {\n      ret = {\n        r: map$1[str[1]] << 4 | map$1[str[2]],\n        g: map$1[str[3]] << 4 | map$1[str[4]],\n        b: map$1[str[5]] << 4 | map$1[str[6]],\n        a: len === 9 ? map$1[str[7]] << 4 | map$1[str[8]] : 255\n      };\n    }\n  }\n  return ret;\n}\nvar alpha = (a, f) => a < 255 ? f(a) : \"\";\nfunction hexString(v) {\n  var f = isShort(v) ? h1 : h2;\n  return v ? \"#\" + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f) : void 0;\n}\nvar HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n  const a = s * Math.min(l, 1 - l);\n  const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n  return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n  const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n  return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n  const rgb = hsl2rgbn(h, 1, 0.5);\n  let i;\n  if (w + b > 1) {\n    i = 1 / (w + b);\n    w *= i;\n    b *= i;\n  }\n  for (i = 0; i < 3; i++) {\n    rgb[i] *= 1 - w - b;\n    rgb[i] += w;\n  }\n  return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n  if (r === max) {\n    return (g - b) / d + (g < b ? 6 : 0);\n  }\n  if (g === max) {\n    return (b - r) / d + 2;\n  }\n  return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n  const range = 255;\n  const r = v.r / range;\n  const g = v.g / range;\n  const b = v.b / range;\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const l = (max + min) / 2;\n  let h, s, d;\n  if (max !== min) {\n    d = max - min;\n    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n    h = hueValue(r, g, b, d, max);\n    h = h * 60 + 0.5;\n  }\n  return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n  return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n  return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n  return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n  return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n  return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n  const m = HUE_RE.exec(str);\n  let a = 255;\n  let v;\n  if (!m) {\n    return;\n  }\n  if (m[5] !== v) {\n    a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n  }\n  const h = hue(+m[2]);\n  const p1 = +m[3] / 100;\n  const p2 = +m[4] / 100;\n  if (m[1] === \"hwb\") {\n    v = hwb2rgb(h, p1, p2);\n  } else if (m[1] === \"hsv\") {\n    v = hsv2rgb(h, p1, p2);\n  } else {\n    v = hsl2rgb(h, p1, p2);\n  }\n  return {\n    r: v[0],\n    g: v[1],\n    b: v[2],\n    a\n  };\n}\nfunction rotate(v, deg) {\n  var h = rgb2hsl(v);\n  h[0] = hue(h[0] + deg);\n  h = hsl2rgb(h);\n  v.r = h[0];\n  v.g = h[1];\n  v.b = h[2];\n}\nfunction hslString(v) {\n  if (!v) {\n    return;\n  }\n  const a = rgb2hsl(v);\n  const h = a[0];\n  const s = n2p(a[1]);\n  const l = n2p(a[2]);\n  return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`;\n}\nvar map = {\n  x: \"dark\",\n  Z: \"light\",\n  Y: \"re\",\n  X: \"blu\",\n  W: \"gr\",\n  V: \"medium\",\n  U: \"slate\",\n  A: \"ee\",\n  T: \"ol\",\n  S: \"or\",\n  B: \"ra\",\n  C: \"lateg\",\n  D: \"ights\",\n  R: \"in\",\n  Q: \"turquois\",\n  E: \"hi\",\n  P: \"ro\",\n  O: \"al\",\n  N: \"le\",\n  M: \"de\",\n  L: \"yello\",\n  F: \"en\",\n  K: \"ch\",\n  G: \"arks\",\n  H: \"ea\",\n  I: \"ightg\",\n  J: \"wh\"\n};\nvar names$1 = {\n  OiceXe: \"f0f8ff\",\n  antiquewEte: \"faebd7\",\n  aqua: \"ffff\",\n  aquamarRe: \"7fffd4\",\n  azuY: \"f0ffff\",\n  beige: \"f5f5dc\",\n  bisque: \"ffe4c4\",\n  black: \"0\",\n  blanKedOmond: \"ffebcd\",\n  Xe: \"ff\",\n  XeviTet: \"8a2be2\",\n  bPwn: \"a52a2a\",\n  burlywood: \"deb887\",\n  caMtXe: \"5f9ea0\",\n  KartYuse: \"7fff00\",\n  KocTate: \"d2691e\",\n  cSO: \"ff7f50\",\n  cSnflowerXe: \"6495ed\",\n  cSnsilk: \"fff8dc\",\n  crimson: \"dc143c\",\n  cyan: \"ffff\",\n  xXe: \"8b\",\n  xcyan: \"8b8b\",\n  xgTMnPd: \"b8860b\",\n  xWay: \"a9a9a9\",\n  xgYF: \"6400\",\n  xgYy: \"a9a9a9\",\n  xkhaki: \"bdb76b\",\n  xmagFta: \"8b008b\",\n  xTivegYF: \"556b2f\",\n  xSange: \"ff8c00\",\n  xScEd: \"9932cc\",\n  xYd: \"8b0000\",\n  xsOmon: \"e9967a\",\n  xsHgYF: \"8fbc8f\",\n  xUXe: \"483d8b\",\n  xUWay: \"2f4f4f\",\n  xUgYy: \"2f4f4f\",\n  xQe: \"ced1\",\n  xviTet: \"9400d3\",\n  dAppRk: \"ff1493\",\n  dApskyXe: \"bfff\",\n  dimWay: \"696969\",\n  dimgYy: \"696969\",\n  dodgerXe: \"1e90ff\",\n  fiYbrick: \"b22222\",\n  flSOwEte: \"fffaf0\",\n  foYstWAn: \"228b22\",\n  fuKsia: \"ff00ff\",\n  gaRsbSo: \"dcdcdc\",\n  ghostwEte: \"f8f8ff\",\n  gTd: \"ffd700\",\n  gTMnPd: \"daa520\",\n  Way: \"808080\",\n  gYF: \"8000\",\n  gYFLw: \"adff2f\",\n  gYy: \"808080\",\n  honeyMw: \"f0fff0\",\n  hotpRk: \"ff69b4\",\n  RdianYd: \"cd5c5c\",\n  Rdigo: \"4b0082\",\n  ivSy: \"fffff0\",\n  khaki: \"f0e68c\",\n  lavFMr: \"e6e6fa\",\n  lavFMrXsh: \"fff0f5\",\n  lawngYF: \"7cfc00\",\n  NmoncEffon: \"fffacd\",\n  ZXe: \"add8e6\",\n  ZcSO: \"f08080\",\n  Zcyan: \"e0ffff\",\n  ZgTMnPdLw: \"fafad2\",\n  ZWay: \"d3d3d3\",\n  ZgYF: \"90ee90\",\n  ZgYy: \"d3d3d3\",\n  ZpRk: \"ffb6c1\",\n  ZsOmon: \"ffa07a\",\n  ZsHgYF: \"20b2aa\",\n  ZskyXe: \"87cefa\",\n  ZUWay: \"778899\",\n  ZUgYy: \"778899\",\n  ZstAlXe: \"b0c4de\",\n  ZLw: \"ffffe0\",\n  lime: \"ff00\",\n  limegYF: \"32cd32\",\n  lRF: \"faf0e6\",\n  magFta: \"ff00ff\",\n  maPon: \"800000\",\n  VaquamarRe: \"66cdaa\",\n  VXe: \"cd\",\n  VScEd: \"ba55d3\",\n  VpurpN: \"9370db\",\n  VsHgYF: \"3cb371\",\n  VUXe: \"7b68ee\",\n  VsprRggYF: \"fa9a\",\n  VQe: \"48d1cc\",\n  VviTetYd: \"c71585\",\n  midnightXe: \"191970\",\n  mRtcYam: \"f5fffa\",\n  mistyPse: \"ffe4e1\",\n  moccasR: \"ffe4b5\",\n  navajowEte: \"ffdead\",\n  navy: \"80\",\n  Tdlace: \"fdf5e6\",\n  Tive: \"808000\",\n  TivedBb: \"6b8e23\",\n  Sange: \"ffa500\",\n  SangeYd: \"ff4500\",\n  ScEd: \"da70d6\",\n  pOegTMnPd: \"eee8aa\",\n  pOegYF: \"98fb98\",\n  pOeQe: \"afeeee\",\n  pOeviTetYd: \"db7093\",\n  papayawEp: \"ffefd5\",\n  pHKpuff: \"ffdab9\",\n  peru: \"cd853f\",\n  pRk: \"ffc0cb\",\n  plum: \"dda0dd\",\n  powMrXe: \"b0e0e6\",\n  purpN: \"800080\",\n  YbeccapurpN: \"663399\",\n  Yd: \"ff0000\",\n  Psybrown: \"bc8f8f\",\n  PyOXe: \"4169e1\",\n  saddNbPwn: \"8b4513\",\n  sOmon: \"fa8072\",\n  sandybPwn: \"f4a460\",\n  sHgYF: \"2e8b57\",\n  sHshell: \"fff5ee\",\n  siFna: \"a0522d\",\n  silver: \"c0c0c0\",\n  skyXe: \"87ceeb\",\n  UXe: \"6a5acd\",\n  UWay: \"708090\",\n  UgYy: \"708090\",\n  snow: \"fffafa\",\n  sprRggYF: \"ff7f\",\n  stAlXe: \"4682b4\",\n  tan: \"d2b48c\",\n  teO: \"8080\",\n  tEstN: \"d8bfd8\",\n  tomato: \"ff6347\",\n  Qe: \"40e0d0\",\n  viTet: \"ee82ee\",\n  JHt: \"f5deb3\",\n  wEte: \"ffffff\",\n  wEtesmoke: \"f5f5f5\",\n  Lw: \"ffff00\",\n  LwgYF: \"9acd32\"\n};\nfunction unpack() {\n  const unpacked = {};\n  const keys = Object.keys(names$1);\n  const tkeys = Object.keys(map);\n  let i, j, k, ok, nk;\n  for (i = 0; i < keys.length; i++) {\n    ok = nk = keys[i];\n    for (j = 0; j < tkeys.length; j++) {\n      k = tkeys[j];\n      nk = nk.replace(k, map[k]);\n    }\n    k = parseInt(names$1[ok], 16);\n    unpacked[nk] = [k >> 16 & 255, k >> 8 & 255, k & 255];\n  }\n  return unpacked;\n}\nvar names;\nfunction nameParse(str) {\n  if (!names) {\n    names = unpack();\n    names.transparent = [0, 0, 0, 0];\n  }\n  const a = names[str.toLowerCase()];\n  return a && {\n    r: a[0],\n    g: a[1],\n    b: a[2],\n    a: a.length === 4 ? a[3] : 255\n  };\n}\nvar RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n  const m = RGB_RE.exec(str);\n  let a = 255;\n  let r, g, b;\n  if (!m) {\n    return;\n  }\n  if (m[7] !== r) {\n    const v = +m[7];\n    a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n  }\n  r = +m[1];\n  g = +m[3];\n  b = +m[5];\n  r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n  g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n  b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n  return {\n    r,\n    g,\n    b,\n    a\n  };\n}\nfunction rgbString(v) {\n  return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`);\n}\nvar to = (v) => v <= 31308e-7 ? v * 12.92 : Math.pow(v, 1 / 2.4) * 1.055 - 0.055;\nvar from = (v) => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n  const r = from(b2n(rgb1.r));\n  const g = from(b2n(rgb1.g));\n  const b = from(b2n(rgb1.b));\n  return {\n    r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n    g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n    b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n    a: rgb1.a + t * (rgb2.a - rgb1.a)\n  };\n}\nfunction modHSL(v, i, ratio) {\n  if (v) {\n    let tmp = rgb2hsl(v);\n    tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n    tmp = hsl2rgb(tmp);\n    v.r = tmp[0];\n    v.g = tmp[1];\n    v.b = tmp[2];\n  }\n}\nfunction clone(v, proto) {\n  return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n  var v = { r: 0, g: 0, b: 0, a: 255 };\n  if (Array.isArray(input)) {\n    if (input.length >= 3) {\n      v = { r: input[0], g: input[1], b: input[2], a: 255 };\n      if (input.length > 3) {\n        v.a = n2b(input[3]);\n      }\n    }\n  } else {\n    v = clone(input, { r: 0, g: 0, b: 0, a: 1 });\n    v.a = n2b(v.a);\n  }\n  return v;\n}\nfunction functionParse(str) {\n  if (str.charAt(0) === \"r\") {\n    return rgbParse(str);\n  }\n  return hueParse(str);\n}\nvar Color = class _Color {\n  constructor(input) {\n    if (input instanceof _Color) {\n      return input;\n    }\n    const type = typeof input;\n    let v;\n    if (type === \"object\") {\n      v = fromObject(input);\n    } else if (type === \"string\") {\n      v = hexParse(input) || nameParse(input) || functionParse(input);\n    }\n    this._rgb = v;\n    this._valid = !!v;\n  }\n  get valid() {\n    return this._valid;\n  }\n  get rgb() {\n    var v = clone(this._rgb);\n    if (v) {\n      v.a = b2n(v.a);\n    }\n    return v;\n  }\n  set rgb(obj) {\n    this._rgb = fromObject(obj);\n  }\n  rgbString() {\n    return this._valid ? rgbString(this._rgb) : void 0;\n  }\n  hexString() {\n    return this._valid ? hexString(this._rgb) : void 0;\n  }\n  hslString() {\n    return this._valid ? hslString(this._rgb) : void 0;\n  }\n  mix(color2, weight) {\n    if (color2) {\n      const c1 = this.rgb;\n      const c2 = color2.rgb;\n      let w2;\n      const p = weight === w2 ? 0.5 : weight;\n      const w = 2 * p - 1;\n      const a = c1.a - c2.a;\n      const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;\n      w2 = 1 - w1;\n      c1.r = 255 & w1 * c1.r + w2 * c2.r + 0.5;\n      c1.g = 255 & w1 * c1.g + w2 * c2.g + 0.5;\n      c1.b = 255 & w1 * c1.b + w2 * c2.b + 0.5;\n      c1.a = p * c1.a + (1 - p) * c2.a;\n      this.rgb = c1;\n    }\n    return this;\n  }\n  interpolate(color2, t) {\n    if (color2) {\n      this._rgb = interpolate(this._rgb, color2._rgb, t);\n    }\n    return this;\n  }\n  clone() {\n    return new _Color(this.rgb);\n  }\n  alpha(a) {\n    this._rgb.a = n2b(a);\n    return this;\n  }\n  clearer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 - ratio;\n    return this;\n  }\n  greyscale() {\n    const rgb = this._rgb;\n    const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n    rgb.r = rgb.g = rgb.b = val;\n    return this;\n  }\n  opaquer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 + ratio;\n    return this;\n  }\n  negate() {\n    const v = this._rgb;\n    v.r = 255 - v.r;\n    v.g = 255 - v.g;\n    v.b = 255 - v.b;\n    return this;\n  }\n  lighten(ratio) {\n    modHSL(this._rgb, 2, ratio);\n    return this;\n  }\n  darken(ratio) {\n    modHSL(this._rgb, 2, -ratio);\n    return this;\n  }\n  saturate(ratio) {\n    modHSL(this._rgb, 1, ratio);\n    return this;\n  }\n  desaturate(ratio) {\n    modHSL(this._rgb, 1, -ratio);\n    return this;\n  }\n  rotate(deg) {\n    rotate(this._rgb, deg);\n    return this;\n  }\n};\n\n// node_modules/chart.js/dist/chunks/helpers.dataset.js\nfunction noop() {\n}\nvar uid = /* @__PURE__ */ (() => {\n  let id = 0;\n  return () => id++;\n})();\nfunction isNullOrUndef(value) {\n  return value === null || value === void 0;\n}\nfunction isArray(value) {\n  if (Array.isArray && Array.isArray(value)) {\n    return true;\n  }\n  const type = Object.prototype.toString.call(value);\n  if (type.slice(0, 7) === \"[object\" && type.slice(-6) === \"Array]\") {\n    return true;\n  }\n  return false;\n}\nfunction isObject(value) {\n  return value !== null && Object.prototype.toString.call(value) === \"[object Object]\";\n}\nfunction isNumberFinite(value) {\n  return (typeof value === \"number\" || value instanceof Number) && isFinite(+value);\n}\nfunction finiteOrDefault(value, defaultValue) {\n  return isNumberFinite(value) ? value : defaultValue;\n}\nfunction valueOrDefault(value, defaultValue) {\n  return typeof value === \"undefined\" ? defaultValue : value;\n}\nvar toPercentage = (value, dimension) => typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 : +value / dimension;\nvar toDimension = (value, dimension) => typeof value === \"string\" && value.endsWith(\"%\") ? parseFloat(value) / 100 * dimension : +value;\nfunction callback(fn, args, thisArg) {\n  if (fn && typeof fn.call === \"function\") {\n    return fn.apply(thisArg, args);\n  }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n  let i, len, keys;\n  if (isArray(loopable)) {\n    len = loopable.length;\n    if (reverse) {\n      for (i = len - 1; i >= 0; i--) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    } else {\n      for (i = 0; i < len; i++) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    }\n  } else if (isObject(loopable)) {\n    keys = Object.keys(loopable);\n    len = keys.length;\n    for (i = 0; i < len; i++) {\n      fn.call(thisArg, loopable[keys[i]], keys[i]);\n    }\n  }\n}\nfunction _elementsEqual(a0, a1) {\n  let i, ilen, v0, v1;\n  if (!a0 || !a1 || a0.length !== a1.length) {\n    return false;\n  }\n  for (i = 0, ilen = a0.length; i < ilen; ++i) {\n    v0 = a0[i];\n    v1 = a1[i];\n    if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction clone2(source) {\n  if (isArray(source)) {\n    return source.map(clone2);\n  }\n  if (isObject(source)) {\n    const target = /* @__PURE__ */ Object.create(null);\n    const keys = Object.keys(source);\n    const klen = keys.length;\n    let k = 0;\n    for (; k < klen; ++k) {\n      target[keys[k]] = clone2(source[keys[k]]);\n    }\n    return target;\n  }\n  return source;\n}\nfunction isValidKey(key) {\n  return [\n    \"__proto__\",\n    \"prototype\",\n    \"constructor\"\n  ].indexOf(key) === -1;\n}\nfunction _merger(key, target, source, options) {\n  if (!isValidKey(key)) {\n    return;\n  }\n  const tval = target[key];\n  const sval = source[key];\n  if (isObject(tval) && isObject(sval)) {\n    merge(tval, sval, options);\n  } else {\n    target[key] = clone2(sval);\n  }\n}\nfunction merge(target, source, options) {\n  const sources = isArray(source) ? source : [\n    source\n  ];\n  const ilen = sources.length;\n  if (!isObject(target)) {\n    return target;\n  }\n  options = options || {};\n  const merger = options.merger || _merger;\n  let current;\n  for (let i = 0; i < ilen; ++i) {\n    current = sources[i];\n    if (!isObject(current)) {\n      continue;\n    }\n    const keys = Object.keys(current);\n    for (let k = 0, klen = keys.length; k < klen; ++k) {\n      merger(keys[k], target, current, options);\n    }\n  }\n  return target;\n}\nfunction mergeIf(target, source) {\n  return merge(target, source, {\n    merger: _mergerIf\n  });\n}\nfunction _mergerIf(key, target, source) {\n  if (!isValidKey(key)) {\n    return;\n  }\n  const tval = target[key];\n  const sval = source[key];\n  if (isObject(tval) && isObject(sval)) {\n    mergeIf(tval, sval);\n  } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n    target[key] = clone2(sval);\n  }\n}\nvar keyResolvers = {\n  // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n  \"\": (v) => v,\n  // default resolvers\n  x: (o) => o.x,\n  y: (o) => o.y\n};\nfunction _splitKey(key) {\n  const parts = key.split(\".\");\n  const keys = [];\n  let tmp = \"\";\n  for (const part of parts) {\n    tmp += part;\n    if (tmp.endsWith(\"\\\\\")) {\n      tmp = tmp.slice(0, -1) + \".\";\n    } else {\n      keys.push(tmp);\n      tmp = \"\";\n    }\n  }\n  return keys;\n}\nfunction _getKeyResolver(key) {\n  const keys = _splitKey(key);\n  return (obj) => {\n    for (const k of keys) {\n      if (k === \"\") {\n        break;\n      }\n      obj = obj && obj[k];\n    }\n    return obj;\n  };\n}\nfunction resolveObjectKey(obj, key) {\n  const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n  return resolver(obj);\n}\nfunction _capitalize(str) {\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\nvar defined = (value) => typeof value !== \"undefined\";\nvar isFunction = (value) => typeof value === \"function\";\nvar setsEqual = (a, b) => {\n  if (a.size !== b.size) {\n    return false;\n  }\n  for (const item of a) {\n    if (!b.has(item)) {\n      return false;\n    }\n  }\n  return true;\n};\nfunction _isClickEvent(e) {\n  return e.type === \"mouseup\" || e.type === \"click\" || e.type === \"contextmenu\";\n}\nvar PI = Math.PI;\nvar TAU = 2 * PI;\nvar PITAU = TAU + PI;\nvar INFINITY = Number.POSITIVE_INFINITY;\nvar RAD_PER_DEG = PI / 180;\nvar HALF_PI = PI / 2;\nvar QUARTER_PI = PI / 4;\nvar TWO_THIRDS_PI = PI * 2 / 3;\nvar log10 = Math.log10;\nvar sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n  return Math.abs(x - y) < epsilon;\n}\nfunction niceNum(range) {\n  const roundedRange = Math.round(range);\n  range = almostEquals(range, roundedRange, range / 1e3) ? roundedRange : range;\n  const niceRange = Math.pow(10, Math.floor(log10(range)));\n  const fraction = range / niceRange;\n  const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n  return niceFraction * niceRange;\n}\nfunction _factorize(value) {\n  const result = [];\n  const sqrt = Math.sqrt(value);\n  let i;\n  for (i = 1; i < sqrt; i++) {\n    if (value % i === 0) {\n      result.push(i);\n      result.push(value / i);\n    }\n  }\n  if (sqrt === (sqrt | 0)) {\n    result.push(sqrt);\n  }\n  result.sort((a, b) => a - b).pop();\n  return result;\n}\nfunction isNonPrimitive(n) {\n  return typeof n === \"symbol\" || typeof n === \"object\" && n !== null && !(Symbol.toPrimitive in n || \"toString\" in n || \"valueOf\" in n);\n}\nfunction isNumber(n) {\n  return !isNonPrimitive(n) && !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n  const rounded = Math.round(x);\n  return rounded - epsilon <= x && rounded + epsilon >= x;\n}\nfunction _setMinAndMaxByKey(array, target, property) {\n  let i, ilen, value;\n  for (i = 0, ilen = array.length; i < ilen; i++) {\n    value = array[i][property];\n    if (!isNaN(value)) {\n      target.min = Math.min(target.min, value);\n      target.max = Math.max(target.max, value);\n    }\n  }\n}\nfunction toRadians(degrees) {\n  return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n  return radians * (180 / PI);\n}\nfunction _decimalPlaces(x) {\n  if (!isNumberFinite(x)) {\n    return;\n  }\n  let e = 1;\n  let p = 0;\n  while (Math.round(x * e) / e !== x) {\n    e *= 10;\n    p++;\n  }\n  return p;\n}\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n  const distanceFromXCenter = anglePoint.x - centrePoint.x;\n  const distanceFromYCenter = anglePoint.y - centrePoint.y;\n  const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n  let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n  if (angle < -0.5 * PI) {\n    angle += TAU;\n  }\n  return {\n    angle,\n    distance: radialDistanceFromCenter\n  };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n  return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\nfunction _angleDiff(a, b) {\n  return (a - b + PITAU) % TAU - PI;\n}\nfunction _normalizeAngle(a) {\n  return (a % TAU + TAU) % TAU;\n}\nfunction _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n  const a = _normalizeAngle(angle);\n  const s = _normalizeAngle(start);\n  const e = _normalizeAngle(end);\n  const angleToStart = _normalizeAngle(s - a);\n  const angleToEnd = _normalizeAngle(e - a);\n  const startToAngle = _normalizeAngle(a - s);\n  const endToAngle = _normalizeAngle(a - e);\n  return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\nfunction _limitValue(value, min, max) {\n  return Math.max(min, Math.min(max, value));\n}\nfunction _int16Range(value) {\n  return _limitValue(value, -32768, 32767);\n}\nfunction _isBetween(value, start, end, epsilon = 1e-6) {\n  return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\nfunction _lookup(table, value, cmp) {\n  cmp = cmp || ((index2) => table[index2] < value);\n  let hi = table.length - 1;\n  let lo = 0;\n  let mid;\n  while (hi - lo > 1) {\n    mid = lo + hi >> 1;\n    if (cmp(mid)) {\n      lo = mid;\n    } else {\n      hi = mid;\n    }\n  }\n  return {\n    lo,\n    hi\n  };\n}\nvar _lookupByKey = (table, key, value, last) => _lookup(table, value, last ? (index2) => {\n  const ti = table[index2][key];\n  return ti < value || ti === value && table[index2 + 1][key] === value;\n} : (index2) => table[index2][key] < value);\nvar _rlookupByKey = (table, key, value) => _lookup(table, value, (index2) => table[index2][key] >= value);\nfunction _filterBetween(values, min, max) {\n  let start = 0;\n  let end = values.length;\n  while (start < end && values[start] < min) {\n    start++;\n  }\n  while (end > start && values[end - 1] > max) {\n    end--;\n  }\n  return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nvar arrayEvents = [\n  \"push\",\n  \"pop\",\n  \"shift\",\n  \"splice\",\n  \"unshift\"\n];\nfunction listenArrayEvents(array, listener) {\n  if (array._chartjs) {\n    array._chartjs.listeners.push(listener);\n    return;\n  }\n  Object.defineProperty(array, \"_chartjs\", {\n    configurable: true,\n    enumerable: false,\n    value: {\n      listeners: [\n        listener\n      ]\n    }\n  });\n  arrayEvents.forEach((key) => {\n    const method = \"_onData\" + _capitalize(key);\n    const base = array[key];\n    Object.defineProperty(array, key, {\n      configurable: true,\n      enumerable: false,\n      value(...args) {\n        const res = base.apply(this, args);\n        array._chartjs.listeners.forEach((object) => {\n          if (typeof object[method] === \"function\") {\n            object[method](...args);\n          }\n        });\n        return res;\n      }\n    });\n  });\n}\nfunction unlistenArrayEvents(array, listener) {\n  const stub = array._chartjs;\n  if (!stub) {\n    return;\n  }\n  const listeners = stub.listeners;\n  const index2 = listeners.indexOf(listener);\n  if (index2 !== -1) {\n    listeners.splice(index2, 1);\n  }\n  if (listeners.length > 0) {\n    return;\n  }\n  arrayEvents.forEach((key) => {\n    delete array[key];\n  });\n  delete array._chartjs;\n}\nfunction _arrayUnique(items) {\n  const set2 = new Set(items);\n  if (set2.size === items.length) {\n    return items;\n  }\n  return Array.from(set2);\n}\nvar requestAnimFrame = (function() {\n  if (typeof window === \"undefined\") {\n    return function(callback2) {\n      return callback2();\n    };\n  }\n  return window.requestAnimationFrame;\n})();\nfunction throttled(fn, thisArg) {\n  let argsToUse = [];\n  let ticking = false;\n  return function(...args) {\n    argsToUse = args;\n    if (!ticking) {\n      ticking = true;\n      requestAnimFrame.call(window, () => {\n        ticking = false;\n        fn.apply(thisArg, argsToUse);\n      });\n    }\n  };\n}\nfunction debounce(fn, delay) {\n  let timeout;\n  return function(...args) {\n    if (delay) {\n      clearTimeout(timeout);\n      timeout = setTimeout(fn, delay, args);\n    } else {\n      fn.apply(this, args);\n    }\n    return delay;\n  };\n}\nvar _toLeftRightCenter = (align) => align === \"start\" ? \"left\" : align === \"end\" ? \"right\" : \"center\";\nvar _alignStartEnd = (align, start, end) => align === \"start\" ? start : align === \"end\" ? end : (start + end) / 2;\nvar _textX = (align, left, right, rtl) => {\n  const check = rtl ? \"left\" : \"right\";\n  return align === check ? right : align === \"center\" ? (left + right) / 2 : left;\n};\nfunction _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n  const pointCount = points.length;\n  let start = 0;\n  let count = pointCount;\n  if (meta._sorted) {\n    const { iScale, vScale, _parsed } = meta;\n    const spanGaps = meta.dataset ? meta.dataset.options ? meta.dataset.options.spanGaps : null : null;\n    const axis = iScale.axis;\n    const { min, max, minDefined, maxDefined } = iScale.getUserBounds();\n    if (minDefined) {\n      start = Math.min(\n        // @ts-expect-error Need to type _parsed\n        _lookupByKey(_parsed, axis, min).lo,\n        // @ts-expect-error Need to fix types on _lookupByKey\n        animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo\n      );\n      if (spanGaps) {\n        const distanceToDefinedLo = _parsed.slice(0, start + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis]));\n        start -= Math.max(0, distanceToDefinedLo);\n      }\n      start = _limitValue(start, 0, pointCount - 1);\n    }\n    if (maxDefined) {\n      let end = Math.max(\n        // @ts-expect-error Need to type _parsed\n        _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n        // @ts-expect-error Need to fix types on _lookupByKey\n        animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1\n      );\n      if (spanGaps) {\n        const distanceToDefinedHi = _parsed.slice(end - 1).findIndex((point) => !isNullOrUndef(point[vScale.axis]));\n        end += Math.max(0, distanceToDefinedHi);\n      }\n      count = _limitValue(end, start, pointCount) - start;\n    } else {\n      count = pointCount - start;\n    }\n  }\n  return {\n    start,\n    count\n  };\n}\nfunction _scaleRangesChanged(meta) {\n  const { xScale, yScale, _scaleRanges } = meta;\n  const newRanges = {\n    xmin: xScale.min,\n    xmax: xScale.max,\n    ymin: yScale.min,\n    ymax: yScale.max\n  };\n  if (!_scaleRanges) {\n    meta._scaleRanges = newRanges;\n    return true;\n  }\n  const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n  Object.assign(_scaleRanges, newRanges);\n  return changed;\n}\nvar atEdge = (t) => t === 0 || t === 1;\nvar elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nvar elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\nvar effects = {\n  linear: (t) => t,\n  easeInQuad: (t) => t * t,\n  easeOutQuad: (t) => -t * (t - 2),\n  easeInOutQuad: (t) => (t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n  easeInCubic: (t) => t * t * t,\n  easeOutCubic: (t) => (t -= 1) * t * t + 1,\n  easeInOutCubic: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n  easeInQuart: (t) => t * t * t * t,\n  easeOutQuart: (t) => -((t -= 1) * t * t * t - 1),\n  easeInOutQuart: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n  easeInQuint: (t) => t * t * t * t * t,\n  easeOutQuint: (t) => (t -= 1) * t * t * t * t + 1,\n  easeInOutQuint: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n  easeInSine: (t) => -Math.cos(t * HALF_PI) + 1,\n  easeOutSine: (t) => Math.sin(t * HALF_PI),\n  easeInOutSine: (t) => -0.5 * (Math.cos(PI * t) - 1),\n  easeInExpo: (t) => t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n  easeOutExpo: (t) => t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n  easeInOutExpo: (t) => atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n  easeInCirc: (t) => t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n  easeOutCirc: (t) => Math.sqrt(1 - (t -= 1) * t),\n  easeInOutCirc: (t) => (t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n  easeInElastic: (t) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n  easeOutElastic: (t) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n  easeInOutElastic(t) {\n    const s = 0.1125;\n    const p = 0.45;\n    return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n  },\n  easeInBack(t) {\n    const s = 1.70158;\n    return t * t * ((s + 1) * t - s);\n  },\n  easeOutBack(t) {\n    const s = 1.70158;\n    return (t -= 1) * t * ((s + 1) * t + s) + 1;\n  },\n  easeInOutBack(t) {\n    let s = 1.70158;\n    if ((t /= 0.5) < 1) {\n      return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n    }\n    return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n  },\n  easeInBounce: (t) => 1 - effects.easeOutBounce(1 - t),\n  easeOutBounce(t) {\n    const m = 7.5625;\n    const d = 2.75;\n    if (t < 1 / d) {\n      return m * t * t;\n    }\n    if (t < 2 / d) {\n      return m * (t -= 1.5 / d) * t + 0.75;\n    }\n    if (t < 2.5 / d) {\n      return m * (t -= 2.25 / d) * t + 0.9375;\n    }\n    return m * (t -= 2.625 / d) * t + 0.984375;\n  },\n  easeInOutBounce: (t) => t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nfunction isPatternOrGradient(value) {\n  if (value && typeof value === \"object\") {\n    const type = value.toString();\n    return type === \"[object CanvasPattern]\" || type === \"[object CanvasGradient]\";\n  }\n  return false;\n}\nfunction color(value) {\n  return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n  return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\nvar numbers = [\n  \"x\",\n  \"y\",\n  \"borderWidth\",\n  \"radius\",\n  \"tension\"\n];\nvar colors = [\n  \"color\",\n  \"borderColor\",\n  \"backgroundColor\"\n];\nfunction applyAnimationsDefaults(defaults2) {\n  defaults2.set(\"animation\", {\n    delay: void 0,\n    duration: 1e3,\n    easing: \"easeOutQuart\",\n    fn: void 0,\n    from: void 0,\n    loop: void 0,\n    to: void 0,\n    type: void 0\n  });\n  defaults2.describe(\"animation\", {\n    _fallback: false,\n    _indexable: false,\n    _scriptable: (name) => name !== \"onProgress\" && name !== \"onComplete\" && name !== \"fn\"\n  });\n  defaults2.set(\"animations\", {\n    colors: {\n      type: \"color\",\n      properties: colors\n    },\n    numbers: {\n      type: \"number\",\n      properties: numbers\n    }\n  });\n  defaults2.describe(\"animations\", {\n    _fallback: \"animation\"\n  });\n  defaults2.set(\"transitions\", {\n    active: {\n      animation: {\n        duration: 400\n      }\n    },\n    resize: {\n      animation: {\n        duration: 0\n      }\n    },\n    show: {\n      animations: {\n        colors: {\n          from: \"transparent\"\n        },\n        visible: {\n          type: \"boolean\",\n          duration: 0\n        }\n      }\n    },\n    hide: {\n      animations: {\n        colors: {\n          to: \"transparent\"\n        },\n        visible: {\n          type: \"boolean\",\n          easing: \"linear\",\n          fn: (v) => v | 0\n        }\n      }\n    }\n  });\n}\nfunction applyLayoutsDefaults(defaults2) {\n  defaults2.set(\"layout\", {\n    autoPadding: true,\n    padding: {\n      top: 0,\n      right: 0,\n      bottom: 0,\n      left: 0\n    }\n  });\n}\nvar intlCache = /* @__PURE__ */ new Map();\nfunction getNumberFormat(locale, options) {\n  options = options || {};\n  const cacheKey = locale + JSON.stringify(options);\n  let formatter = intlCache.get(cacheKey);\n  if (!formatter) {\n    formatter = new Intl.NumberFormat(locale, options);\n    intlCache.set(cacheKey, formatter);\n  }\n  return formatter;\n}\nfunction formatNumber(num, locale, options) {\n  return getNumberFormat(locale, options).format(num);\n}\nvar formatters = {\n  values(value) {\n    return isArray(value) ? value : \"\" + value;\n  },\n  numeric(tickValue, index2, ticks) {\n    if (tickValue === 0) {\n      return \"0\";\n    }\n    const locale = this.chart.options.locale;\n    let notation;\n    let delta = tickValue;\n    if (ticks.length > 1) {\n      const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n      if (maxTick < 1e-4 || maxTick > 1e15) {\n        notation = \"scientific\";\n      }\n      delta = calculateDelta(tickValue, ticks);\n    }\n    const logDelta = log10(Math.abs(delta));\n    const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n    const options = {\n      notation,\n      minimumFractionDigits: numDecimal,\n      maximumFractionDigits: numDecimal\n    };\n    Object.assign(options, this.options.ticks.format);\n    return formatNumber(tickValue, locale, options);\n  },\n  logarithmic(tickValue, index2, ticks) {\n    if (tickValue === 0) {\n      return \"0\";\n    }\n    const remain = ticks[index2].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n    if ([\n      1,\n      2,\n      3,\n      5,\n      10,\n      15\n    ].includes(remain) || index2 > 0.8 * ticks.length) {\n      return formatters.numeric.call(this, tickValue, index2, ticks);\n    }\n    return \"\";\n  }\n};\nfunction calculateDelta(tickValue, ticks) {\n  let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n  if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n    delta = tickValue - Math.floor(tickValue);\n  }\n  return delta;\n}\nvar Ticks = {\n  formatters\n};\nfunction applyScaleDefaults(defaults2) {\n  defaults2.set(\"scale\", {\n    display: true,\n    offset: false,\n    reverse: false,\n    beginAtZero: false,\n    bounds: \"ticks\",\n    clip: true,\n    grace: 0,\n    grid: {\n      display: true,\n      lineWidth: 1,\n      drawOnChartArea: true,\n      drawTicks: true,\n      tickLength: 8,\n      tickWidth: (_ctx, options) => options.lineWidth,\n      tickColor: (_ctx, options) => options.color,\n      offset: false\n    },\n    border: {\n      display: true,\n      dash: [],\n      dashOffset: 0,\n      width: 1\n    },\n    title: {\n      display: false,\n      text: \"\",\n      padding: {\n        top: 4,\n        bottom: 4\n      }\n    },\n    ticks: {\n      minRotation: 0,\n      maxRotation: 50,\n      mirror: false,\n      textStrokeWidth: 0,\n      textStrokeColor: \"\",\n      padding: 3,\n      display: true,\n      autoSkip: true,\n      autoSkipPadding: 3,\n      labelOffset: 0,\n      callback: Ticks.formatters.values,\n      minor: {},\n      major: {},\n      align: \"center\",\n      crossAlign: \"near\",\n      showLabelBackdrop: false,\n      backdropColor: \"rgba(255, 255, 255, 0.75)\",\n      backdropPadding: 2\n    }\n  });\n  defaults2.route(\"scale.ticks\", \"color\", \"\", \"color\");\n  defaults2.route(\"scale.grid\", \"color\", \"\", \"borderColor\");\n  defaults2.route(\"scale.border\", \"color\", \"\", \"borderColor\");\n  defaults2.route(\"scale.title\", \"color\", \"\", \"color\");\n  defaults2.describe(\"scale\", {\n    _fallback: false,\n    _scriptable: (name) => !name.startsWith(\"before\") && !name.startsWith(\"after\") && name !== \"callback\" && name !== \"parser\",\n    _indexable: (name) => name !== \"borderDash\" && name !== \"tickBorderDash\" && name !== \"dash\"\n  });\n  defaults2.describe(\"scales\", {\n    _fallback: \"scale\"\n  });\n  defaults2.describe(\"scale.ticks\", {\n    _scriptable: (name) => name !== \"backdropPadding\" && name !== \"callback\",\n    _indexable: (name) => name !== \"backdropPadding\"\n  });\n}\nvar overrides = /* @__PURE__ */ Object.create(null);\nvar descriptors = /* @__PURE__ */ Object.create(null);\nfunction getScope$1(node, key) {\n  if (!key) {\n    return node;\n  }\n  const keys = key.split(\".\");\n  for (let i = 0, n = keys.length; i < n; ++i) {\n    const k = keys[i];\n    node = node[k] || (node[k] = /* @__PURE__ */ Object.create(null));\n  }\n  return node;\n}\nfunction set(root, scope, values) {\n  if (typeof scope === \"string\") {\n    return merge(getScope$1(root, scope), values);\n  }\n  return merge(getScope$1(root, \"\"), scope);\n}\nvar Defaults = class {\n  constructor(_descriptors2, _appliers) {\n    this.animation = void 0;\n    this.backgroundColor = \"rgba(0,0,0,0.1)\";\n    this.borderColor = \"rgba(0,0,0,0.1)\";\n    this.color = \"#666\";\n    this.datasets = {};\n    this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n    this.elements = {};\n    this.events = [\n      \"mousemove\",\n      \"mouseout\",\n      \"click\",\n      \"touchstart\",\n      \"touchmove\"\n    ];\n    this.font = {\n      family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n      size: 12,\n      style: \"normal\",\n      lineHeight: 1.2,\n      weight: null\n    };\n    this.hover = {};\n    this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n    this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n    this.hoverColor = (ctx, options) => getHoverColor(options.color);\n    this.indexAxis = \"x\";\n    this.interaction = {\n      mode: \"nearest\",\n      intersect: true,\n      includeInvisible: false\n    };\n    this.maintainAspectRatio = true;\n    this.onHover = null;\n    this.onClick = null;\n    this.parsing = true;\n    this.plugins = {};\n    this.responsive = true;\n    this.scale = void 0;\n    this.scales = {};\n    this.showLine = true;\n    this.drawActiveElementsOnTop = true;\n    this.describe(_descriptors2);\n    this.apply(_appliers);\n  }\n  set(scope, values) {\n    return set(this, scope, values);\n  }\n  get(scope) {\n    return getScope$1(this, scope);\n  }\n  describe(scope, values) {\n    return set(descriptors, scope, values);\n  }\n  override(scope, values) {\n    return set(overrides, scope, values);\n  }\n  route(scope, name, targetScope, targetName) {\n    const scopeObject = getScope$1(this, scope);\n    const targetScopeObject = getScope$1(this, targetScope);\n    const privateName = \"_\" + name;\n    Object.defineProperties(scopeObject, {\n      [privateName]: {\n        value: scopeObject[name],\n        writable: true\n      },\n      [name]: {\n        enumerable: true,\n        get() {\n          const local = this[privateName];\n          const target = targetScopeObject[targetName];\n          if (isObject(local)) {\n            return Object.assign({}, target, local);\n          }\n          return valueOrDefault(local, target);\n        },\n        set(value) {\n          this[privateName] = value;\n        }\n      }\n    });\n  }\n  apply(appliers) {\n    appliers.forEach((apply) => apply(this));\n  }\n};\nvar defaults = /* @__PURE__ */ new Defaults({\n  _scriptable: (name) => !name.startsWith(\"on\"),\n  _indexable: (name) => name !== \"events\",\n  hover: {\n    _fallback: \"interaction\"\n  },\n  interaction: {\n    _scriptable: false,\n    _indexable: false\n  }\n}, [\n  applyAnimationsDefaults,\n  applyLayoutsDefaults,\n  applyScaleDefaults\n]);\nfunction toFontString(font) {\n  if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n    return null;\n  }\n  return (font.style ? font.style + \" \" : \"\") + (font.weight ? font.weight + \" \" : \"\") + font.size + \"px \" + font.family;\n}\nfunction _measureText(ctx, data, gc, longest, string) {\n  let textWidth = data[string];\n  if (!textWidth) {\n    textWidth = data[string] = ctx.measureText(string).width;\n    gc.push(string);\n  }\n  if (textWidth > longest) {\n    longest = textWidth;\n  }\n  return longest;\n}\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n  cache = cache || {};\n  let data = cache.data = cache.data || {};\n  let gc = cache.garbageCollect = cache.garbageCollect || [];\n  if (cache.font !== font) {\n    data = cache.data = {};\n    gc = cache.garbageCollect = [];\n    cache.font = font;\n  }\n  ctx.save();\n  ctx.font = font;\n  let longest = 0;\n  const ilen = arrayOfThings.length;\n  let i, j, jlen, thing, nestedThing;\n  for (i = 0; i < ilen; i++) {\n    thing = arrayOfThings[i];\n    if (thing !== void 0 && thing !== null && !isArray(thing)) {\n      longest = _measureText(ctx, data, gc, longest, thing);\n    } else if (isArray(thing)) {\n      for (j = 0, jlen = thing.length; j < jlen; j++) {\n        nestedThing = thing[j];\n        if (nestedThing !== void 0 && nestedThing !== null && !isArray(nestedThing)) {\n          longest = _measureText(ctx, data, gc, longest, nestedThing);\n        }\n      }\n    }\n  }\n  ctx.restore();\n  const gcLen = gc.length / 2;\n  if (gcLen > arrayOfThings.length) {\n    for (i = 0; i < gcLen; i++) {\n      delete data[gc[i]];\n    }\n    gc.splice(0, gcLen);\n  }\n  return longest;\n}\nfunction _alignPixel(chart, pixel, width) {\n  const devicePixelRatio = chart.currentDevicePixelRatio;\n  const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n  return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\nfunction clearCanvas(canvas, ctx) {\n  if (!ctx && !canvas) {\n    return;\n  }\n  ctx = ctx || canvas.getContext(\"2d\");\n  ctx.save();\n  ctx.resetTransform();\n  ctx.clearRect(0, 0, canvas.width, canvas.height);\n  ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n  drawPointLegend(ctx, options, x, y, null);\n}\nfunction drawPointLegend(ctx, options, x, y, w) {\n  let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n  const style = options.pointStyle;\n  const rotation = options.rotation;\n  const radius = options.radius;\n  let rad = (rotation || 0) * RAD_PER_DEG;\n  if (style && typeof style === \"object\") {\n    type = style.toString();\n    if (type === \"[object HTMLImageElement]\" || type === \"[object HTMLCanvasElement]\") {\n      ctx.save();\n      ctx.translate(x, y);\n      ctx.rotate(rad);\n      ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n      ctx.restore();\n      return;\n    }\n  }\n  if (isNaN(radius) || radius <= 0) {\n    return;\n  }\n  ctx.beginPath();\n  switch (style) {\n    // Default includes circle\n    default:\n      if (w) {\n        ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n      } else {\n        ctx.arc(x, y, radius, 0, TAU);\n      }\n      ctx.closePath();\n      break;\n    case \"triangle\":\n      width = w ? w / 2 : radius;\n      ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      rad += TWO_THIRDS_PI;\n      ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      rad += TWO_THIRDS_PI;\n      ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      ctx.closePath();\n      break;\n    case \"rectRounded\":\n      cornerRadius = radius * 0.516;\n      size = radius - cornerRadius;\n      xOffset = Math.cos(rad + QUARTER_PI) * size;\n      xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n      yOffset = Math.sin(rad + QUARTER_PI) * size;\n      yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n      ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n      ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n      ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n      ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n      ctx.closePath();\n      break;\n    case \"rect\":\n      if (!rotation) {\n        size = Math.SQRT1_2 * radius;\n        width = w ? w / 2 : size;\n        ctx.rect(x - width, y - size, 2 * width, 2 * size);\n        break;\n      }\n      rad += QUARTER_PI;\n    /* falls through */\n    case \"rectRot\":\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      ctx.closePath();\n      break;\n    case \"crossRot\":\n      rad += QUARTER_PI;\n    /* falls through */\n    case \"cross\":\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      break;\n    case \"star\":\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      rad += QUARTER_PI;\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      break;\n    case \"line\":\n      xOffset = w ? w / 2 : Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      ctx.moveTo(x - xOffset, y - yOffset);\n      ctx.lineTo(x + xOffset, y + yOffset);\n      break;\n    case \"dash\":\n      ctx.moveTo(x, y);\n      ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n      break;\n    case false:\n      ctx.closePath();\n      break;\n  }\n  ctx.fill();\n  if (options.borderWidth > 0) {\n    ctx.stroke();\n  }\n}\nfunction _isPointInArea(point, area, margin) {\n  margin = margin || 0.5;\n  return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n  ctx.save();\n  ctx.beginPath();\n  ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n  ctx.clip();\n}\nfunction unclipArea(ctx) {\n  ctx.restore();\n}\nfunction _steppedLineTo(ctx, previous, target, flip, mode) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  if (mode === \"middle\") {\n    const midpoint = (previous.x + target.x) / 2;\n    ctx.lineTo(midpoint, previous.y);\n    ctx.lineTo(midpoint, target.y);\n  } else if (mode === \"after\" !== !!flip) {\n    ctx.lineTo(previous.x, target.y);\n  } else {\n    ctx.lineTo(target.x, previous.y);\n  }\n  ctx.lineTo(target.x, target.y);\n}\nfunction _bezierCurveTo(ctx, previous, target, flip) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\nfunction setRenderOpts(ctx, opts) {\n  if (opts.translation) {\n    ctx.translate(opts.translation[0], opts.translation[1]);\n  }\n  if (!isNullOrUndef(opts.rotation)) {\n    ctx.rotate(opts.rotation);\n  }\n  if (opts.color) {\n    ctx.fillStyle = opts.color;\n  }\n  if (opts.textAlign) {\n    ctx.textAlign = opts.textAlign;\n  }\n  if (opts.textBaseline) {\n    ctx.textBaseline = opts.textBaseline;\n  }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n  if (opts.strikethrough || opts.underline) {\n    const metrics = ctx.measureText(line);\n    const left = x - metrics.actualBoundingBoxLeft;\n    const right = x + metrics.actualBoundingBoxRight;\n    const top = y - metrics.actualBoundingBoxAscent;\n    const bottom = y + metrics.actualBoundingBoxDescent;\n    const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n    ctx.strokeStyle = ctx.fillStyle;\n    ctx.beginPath();\n    ctx.lineWidth = opts.decorationWidth || 2;\n    ctx.moveTo(left, yDecoration);\n    ctx.lineTo(right, yDecoration);\n    ctx.stroke();\n  }\n}\nfunction drawBackdrop(ctx, opts) {\n  const oldColor = ctx.fillStyle;\n  ctx.fillStyle = opts.color;\n  ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n  ctx.fillStyle = oldColor;\n}\nfunction renderText(ctx, text, x, y, font, opts = {}) {\n  const lines = isArray(text) ? text : [\n    text\n  ];\n  const stroke = opts.strokeWidth > 0 && opts.strokeColor !== \"\";\n  let i, line;\n  ctx.save();\n  ctx.font = font.string;\n  setRenderOpts(ctx, opts);\n  for (i = 0; i < lines.length; ++i) {\n    line = lines[i];\n    if (opts.backdrop) {\n      drawBackdrop(ctx, opts.backdrop);\n    }\n    if (stroke) {\n      if (opts.strokeColor) {\n        ctx.strokeStyle = opts.strokeColor;\n      }\n      if (!isNullOrUndef(opts.strokeWidth)) {\n        ctx.lineWidth = opts.strokeWidth;\n      }\n      ctx.strokeText(line, x, y, opts.maxWidth);\n    }\n    ctx.fillText(line, x, y, opts.maxWidth);\n    decorateText(ctx, x, y, line, opts);\n    y += Number(font.lineHeight);\n  }\n  ctx.restore();\n}\nfunction addRoundedRectPath(ctx, rect) {\n  const { x, y, w, h, radius } = rect;\n  ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n  ctx.lineTo(x, y + h - radius.bottomLeft);\n  ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n  ctx.lineTo(x + w - radius.bottomRight, y + h);\n  ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n  ctx.lineTo(x + w, y + radius.topRight);\n  ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n  ctx.lineTo(x + radius.topLeft, y);\n}\nvar LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nvar FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\nfunction toLineHeight(value, size) {\n  const matches = (\"\" + value).match(LINE_HEIGHT);\n  if (!matches || matches[1] === \"normal\") {\n    return size * 1.2;\n  }\n  value = +matches[2];\n  switch (matches[3]) {\n    case \"px\":\n      return value;\n    case \"%\":\n      value /= 100;\n      break;\n  }\n  return size * value;\n}\nvar numberOrZero = (v) => +v || 0;\nfunction _readValueToProps(value, props) {\n  const ret = {};\n  const objProps = isObject(props);\n  const keys = objProps ? Object.keys(props) : props;\n  const read = isObject(value) ? objProps ? (prop) => valueOrDefault(value[prop], value[props[prop]]) : (prop) => value[prop] : () => value;\n  for (const prop of keys) {\n    ret[prop] = numberOrZero(read(prop));\n  }\n  return ret;\n}\nfunction toTRBL(value) {\n  return _readValueToProps(value, {\n    top: \"y\",\n    right: \"x\",\n    bottom: \"y\",\n    left: \"x\"\n  });\n}\nfunction toTRBLCorners(value) {\n  return _readValueToProps(value, [\n    \"topLeft\",\n    \"topRight\",\n    \"bottomLeft\",\n    \"bottomRight\"\n  ]);\n}\nfunction toPadding(value) {\n  const obj = toTRBL(value);\n  obj.width = obj.left + obj.right;\n  obj.height = obj.top + obj.bottom;\n  return obj;\n}\nfunction toFont(options, fallback) {\n  options = options || {};\n  fallback = fallback || defaults.font;\n  let size = valueOrDefault(options.size, fallback.size);\n  if (typeof size === \"string\") {\n    size = parseInt(size, 10);\n  }\n  let style = valueOrDefault(options.style, fallback.style);\n  if (style && !(\"\" + style).match(FONT_STYLE)) {\n    console.warn('Invalid font style specified: \"' + style + '\"');\n    style = void 0;\n  }\n  const font = {\n    family: valueOrDefault(options.family, fallback.family),\n    lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n    size,\n    style,\n    weight: valueOrDefault(options.weight, fallback.weight),\n    string: \"\"\n  };\n  font.string = toFontString(font);\n  return font;\n}\nfunction resolve(inputs, context, index2, info) {\n  let cacheable = true;\n  let i, ilen, value;\n  for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n    value = inputs[i];\n    if (value === void 0) {\n      continue;\n    }\n    if (context !== void 0 && typeof value === \"function\") {\n      value = value(context);\n      cacheable = false;\n    }\n    if (index2 !== void 0 && isArray(value)) {\n      value = value[index2 % value.length];\n      cacheable = false;\n    }\n    if (value !== void 0) {\n      if (info && !cacheable) {\n        info.cacheable = false;\n      }\n      return value;\n    }\n  }\n}\nfunction _addGrace(minmax, grace, beginAtZero) {\n  const { min, max } = minmax;\n  const change = toDimension(grace, (max - min) / 2);\n  const keepZero = (value, add) => beginAtZero && value === 0 ? 0 : value + add;\n  return {\n    min: keepZero(min, -Math.abs(change)),\n    max: keepZero(max, change)\n  };\n}\nfunction createContext(parentContext, context) {\n  return Object.assign(Object.create(parentContext), context);\n}\nfunction _createResolver(scopes, prefixes = [\n  \"\"\n], rootScopes, fallback, getTarget = () => scopes[0]) {\n  const finalRootScopes = rootScopes || scopes;\n  if (typeof fallback === \"undefined\") {\n    fallback = _resolve(\"_fallback\", scopes);\n  }\n  const cache = {\n    [Symbol.toStringTag]: \"Object\",\n    _cacheable: true,\n    _scopes: scopes,\n    _rootScopes: finalRootScopes,\n    _fallback: fallback,\n    _getTarget: getTarget,\n    override: (scope) => _createResolver([\n      scope,\n      ...scopes\n    ], prefixes, finalRootScopes, fallback)\n  };\n  return new Proxy(cache, {\n    /**\n    * A trap for the delete operator.\n    */\n    deleteProperty(target, prop) {\n      delete target[prop];\n      delete target._keys;\n      delete scopes[0][prop];\n      return true;\n    },\n    /**\n    * A trap for getting property values.\n    */\n    get(target, prop) {\n      return _cached(target, prop, () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n    },\n    /**\n    * A trap for Object.getOwnPropertyDescriptor.\n    * Also used by Object.hasOwnProperty.\n    */\n    getOwnPropertyDescriptor(target, prop) {\n      return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n    },\n    /**\n    * A trap for Object.getPrototypeOf.\n    */\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(scopes[0]);\n    },\n    /**\n    * A trap for the in operator.\n    */\n    has(target, prop) {\n      return getKeysFromAllScopes(target).includes(prop);\n    },\n    /**\n    * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n    */\n    ownKeys(target) {\n      return getKeysFromAllScopes(target);\n    },\n    /**\n    * A trap for setting property values.\n    */\n    set(target, prop, value) {\n      const storage = target._storage || (target._storage = getTarget());\n      target[prop] = storage[prop] = value;\n      delete target._keys;\n      return true;\n    }\n  });\n}\nfunction _attachContext(proxy, context, subProxy, descriptorDefaults) {\n  const cache = {\n    _cacheable: false,\n    _proxy: proxy,\n    _context: context,\n    _subProxy: subProxy,\n    _stack: /* @__PURE__ */ new Set(),\n    _descriptors: _descriptors(proxy, descriptorDefaults),\n    setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n    override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n  };\n  return new Proxy(cache, {\n    /**\n    * A trap for the delete operator.\n    */\n    deleteProperty(target, prop) {\n      delete target[prop];\n      delete proxy[prop];\n      return true;\n    },\n    /**\n    * A trap for getting property values.\n    */\n    get(target, prop, receiver) {\n      return _cached(target, prop, () => _resolveWithContext(target, prop, receiver));\n    },\n    /**\n    * A trap for Object.getOwnPropertyDescriptor.\n    * Also used by Object.hasOwnProperty.\n    */\n    getOwnPropertyDescriptor(target, prop) {\n      return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n        enumerable: true,\n        configurable: true\n      } : void 0 : Reflect.getOwnPropertyDescriptor(proxy, prop);\n    },\n    /**\n    * A trap for Object.getPrototypeOf.\n    */\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(proxy);\n    },\n    /**\n    * A trap for the in operator.\n    */\n    has(target, prop) {\n      return Reflect.has(proxy, prop);\n    },\n    /**\n    * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n    */\n    ownKeys() {\n      return Reflect.ownKeys(proxy);\n    },\n    /**\n    * A trap for setting property values.\n    */\n    set(target, prop, value) {\n      proxy[prop] = value;\n      delete target[prop];\n      return true;\n    }\n  });\n}\nfunction _descriptors(proxy, defaults2 = {\n  scriptable: true,\n  indexable: true\n}) {\n  const { _scriptable = defaults2.scriptable, _indexable = defaults2.indexable, _allKeys = defaults2.allKeys } = proxy;\n  return {\n    allKeys: _allKeys,\n    scriptable: _scriptable,\n    indexable: _indexable,\n    isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n    isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n  };\n}\nvar readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;\nvar needsSubResolver = (prop, value) => isObject(value) && prop !== \"adapters\" && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve2) {\n  if (Object.prototype.hasOwnProperty.call(target, prop) || prop === \"constructor\") {\n    return target[prop];\n  }\n  const value = resolve2();\n  target[prop] = value;\n  return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n  const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;\n  let value = _proxy[prop];\n  if (isFunction(value) && descriptors2.isScriptable(prop)) {\n    value = _resolveScriptable(prop, value, target, receiver);\n  }\n  if (isArray(value) && value.length) {\n    value = _resolveArray(prop, value, target, descriptors2.isIndexable);\n  }\n  if (needsSubResolver(prop, value)) {\n    value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors2);\n  }\n  return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n  const { _proxy, _context, _subProxy, _stack } = target;\n  if (_stack.has(prop)) {\n    throw new Error(\"Recursion detected: \" + Array.from(_stack).join(\"->\") + \"->\" + prop);\n  }\n  _stack.add(prop);\n  let value = getValue(_context, _subProxy || receiver);\n  _stack.delete(prop);\n  if (needsSubResolver(prop, value)) {\n    value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n  }\n  return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n  const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;\n  if (typeof _context.index !== \"undefined\" && isIndexable(prop)) {\n    return value[_context.index % value.length];\n  } else if (isObject(value[0])) {\n    const arr = value;\n    const scopes = _proxy._scopes.filter((s) => s !== arr);\n    value = [];\n    for (const item of arr) {\n      const resolver = createSubResolver(scopes, _proxy, prop, item);\n      value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors2));\n    }\n  }\n  return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n  return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nvar getScope = (key, parent) => key === true ? parent : typeof key === \"string\" ? resolveObjectKey(parent, key) : void 0;\nfunction addScopes(set2, parentScopes, key, parentFallback, value) {\n  for (const parent of parentScopes) {\n    const scope = getScope(key, parent);\n    if (scope) {\n      set2.add(scope);\n      const fallback = resolveFallback(scope._fallback, key, value);\n      if (typeof fallback !== \"undefined\" && fallback !== key && fallback !== parentFallback) {\n        return fallback;\n      }\n    } else if (scope === false && typeof parentFallback !== \"undefined\" && key !== parentFallback) {\n      return null;\n    }\n  }\n  return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n  const rootScopes = resolver._rootScopes;\n  const fallback = resolveFallback(resolver._fallback, prop, value);\n  const allScopes = [\n    ...parentScopes,\n    ...rootScopes\n  ];\n  const set2 = /* @__PURE__ */ new Set();\n  set2.add(value);\n  let key = addScopesFromKey(set2, allScopes, prop, fallback || prop, value);\n  if (key === null) {\n    return false;\n  }\n  if (typeof fallback !== \"undefined\" && fallback !== prop) {\n    key = addScopesFromKey(set2, allScopes, fallback, key, value);\n    if (key === null) {\n      return false;\n    }\n  }\n  return _createResolver(Array.from(set2), [\n    \"\"\n  ], rootScopes, fallback, () => subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set2, allScopes, key, fallback, item) {\n  while (key) {\n    key = addScopes(set2, allScopes, key, fallback, item);\n  }\n  return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n  const parent = resolver._getTarget();\n  if (!(prop in parent)) {\n    parent[prop] = {};\n  }\n  const target = parent[prop];\n  if (isArray(target) && isObject(value)) {\n    return value;\n  }\n  return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n  let value;\n  for (const prefix of prefixes) {\n    value = _resolve(readKey(prefix, prop), scopes);\n    if (typeof value !== \"undefined\") {\n      return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n    }\n  }\n}\nfunction _resolve(key, scopes) {\n  for (const scope of scopes) {\n    if (!scope) {\n      continue;\n    }\n    const value = scope[key];\n    if (typeof value !== \"undefined\") {\n      return value;\n    }\n  }\n}\nfunction getKeysFromAllScopes(target) {\n  let keys = target._keys;\n  if (!keys) {\n    keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n  }\n  return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n  const set2 = /* @__PURE__ */ new Set();\n  for (const scope of scopes) {\n    for (const key of Object.keys(scope).filter((k) => !k.startsWith(\"_\"))) {\n      set2.add(key);\n    }\n  }\n  return Array.from(set2);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n  const { iScale } = meta;\n  const { key = \"r\" } = this._parsing;\n  const parsed = new Array(count);\n  let i, ilen, index2, item;\n  for (i = 0, ilen = count; i < ilen; ++i) {\n    index2 = i + start;\n    item = data[index2];\n    parsed[i] = {\n      r: iScale.parse(resolveObjectKey(item, key), index2)\n    };\n  }\n  return parsed;\n}\nvar EPSILON = Number.EPSILON || 1e-14;\nvar getPoint = (points, i) => i < points.length && !points[i].skip && points[i];\nvar getValueAxis = (indexAxis) => indexAxis === \"x\" ? \"y\" : \"x\";\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n  const previous = firstPoint.skip ? middlePoint : firstPoint;\n  const current = middlePoint;\n  const next = afterPoint.skip ? middlePoint : afterPoint;\n  const d01 = distanceBetweenPoints(current, previous);\n  const d12 = distanceBetweenPoints(next, current);\n  let s01 = d01 / (d01 + d12);\n  let s12 = d12 / (d01 + d12);\n  s01 = isNaN(s01) ? 0 : s01;\n  s12 = isNaN(s12) ? 0 : s12;\n  const fa = t * s01;\n  const fb = t * s12;\n  return {\n    previous: {\n      x: current.x - fa * (next.x - previous.x),\n      y: current.y - fa * (next.y - previous.y)\n    },\n    next: {\n      x: current.x + fb * (next.x - previous.x),\n      y: current.y + fb * (next.y - previous.y)\n    }\n  };\n}\nfunction monotoneAdjust(points, deltaK, mK) {\n  const pointsLen = points.length;\n  let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (let i = 0; i < pointsLen - 1; ++i) {\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent || !pointAfter) {\n      continue;\n    }\n    if (almostEquals(deltaK[i], 0, EPSILON)) {\n      mK[i] = mK[i + 1] = 0;\n      continue;\n    }\n    alphaK = mK[i] / deltaK[i];\n    betaK = mK[i + 1] / deltaK[i];\n    squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n    if (squaredMagnitude <= 9) {\n      continue;\n    }\n    tauK = 3 / Math.sqrt(squaredMagnitude);\n    mK[i] = alphaK * tauK * deltaK[i];\n    mK[i + 1] = betaK * tauK * deltaK[i];\n  }\n}\nfunction monotoneCompute(points, mK, indexAxis = \"x\") {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  let delta, pointBefore, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (let i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n    const iPixel = pointCurrent[indexAxis];\n    const vPixel = pointCurrent[valueAxis];\n    if (pointBefore) {\n      delta = (iPixel - pointBefore[indexAxis]) / 3;\n      pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n      pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n    }\n    if (pointAfter) {\n      delta = (pointAfter[indexAxis] - iPixel) / 3;\n      pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n      pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n    }\n  }\n}\nfunction splineCurveMonotone(points, indexAxis = \"x\") {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  const deltaK = Array(pointsLen).fill(0);\n  const mK = Array(pointsLen);\n  let i, pointBefore, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n    if (pointAfter) {\n      const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n      deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n    }\n    mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n  }\n  monotoneAdjust(points, deltaK, mK);\n  monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n  return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n  let i, ilen, point, inArea, inAreaPrev;\n  let inAreaNext = _isPointInArea(points[0], area);\n  for (i = 0, ilen = points.length; i < ilen; ++i) {\n    inAreaPrev = inArea;\n    inArea = inAreaNext;\n    inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n    if (!inArea) {\n      continue;\n    }\n    point = points[i];\n    if (inAreaPrev) {\n      point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n      point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n    }\n    if (inAreaNext) {\n      point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n      point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n    }\n  }\n}\nfunction _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n  let i, ilen, point, controlPoints;\n  if (options.spanGaps) {\n    points = points.filter((pt) => !pt.skip);\n  }\n  if (options.cubicInterpolationMode === \"monotone\") {\n    splineCurveMonotone(points, indexAxis);\n  } else {\n    let prev = loop ? points[points.length - 1] : points[0];\n    for (i = 0, ilen = points.length; i < ilen; ++i) {\n      point = points[i];\n      controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n      point.cp1x = controlPoints.previous.x;\n      point.cp1y = controlPoints.previous.y;\n      point.cp2x = controlPoints.next.x;\n      point.cp2y = controlPoints.next.y;\n      prev = point;\n    }\n  }\n  if (options.capBezierPoints) {\n    capBezierPoints(points, area);\n  }\n}\nfunction _isDomSupported() {\n  return typeof window !== \"undefined\" && typeof document !== \"undefined\";\n}\nfunction _getParentNode(domNode) {\n  let parent = domNode.parentNode;\n  if (parent && parent.toString() === \"[object ShadowRoot]\") {\n    parent = parent.host;\n  }\n  return parent;\n}\nfunction parseMaxStyle(styleValue, node, parentProperty) {\n  let valueInPixels;\n  if (typeof styleValue === \"string\") {\n    valueInPixels = parseInt(styleValue, 10);\n    if (styleValue.indexOf(\"%\") !== -1) {\n      valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n    }\n  } else {\n    valueInPixels = styleValue;\n  }\n  return valueInPixels;\n}\nvar getComputedStyle = (element) => element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n  return getComputedStyle(el).getPropertyValue(property);\n}\nvar positions = [\n  \"top\",\n  \"right\",\n  \"bottom\",\n  \"left\"\n];\nfunction getPositionedStyle(styles, style, suffix) {\n  const result = {};\n  suffix = suffix ? \"-\" + suffix : \"\";\n  for (let i = 0; i < 4; i++) {\n    const pos = positions[i];\n    result[pos] = parseFloat(styles[style + \"-\" + pos + suffix]) || 0;\n  }\n  result.width = result.left + result.right;\n  result.height = result.top + result.bottom;\n  return result;\n}\nvar useOffsetPos = (x, y, target) => (x > 0 || y > 0) && (!target || !target.shadowRoot);\nfunction getCanvasPosition(e, canvas) {\n  const touches = e.touches;\n  const source = touches && touches.length ? touches[0] : e;\n  const { offsetX, offsetY } = source;\n  let box = false;\n  let x, y;\n  if (useOffsetPos(offsetX, offsetY, e.target)) {\n    x = offsetX;\n    y = offsetY;\n  } else {\n    const rect = canvas.getBoundingClientRect();\n    x = source.clientX - rect.left;\n    y = source.clientY - rect.top;\n    box = true;\n  }\n  return {\n    x,\n    y,\n    box\n  };\n}\nfunction getRelativePosition(event, chart) {\n  if (\"native\" in event) {\n    return event;\n  }\n  const { canvas, currentDevicePixelRatio } = chart;\n  const style = getComputedStyle(canvas);\n  const borderBox = style.boxSizing === \"border-box\";\n  const paddings = getPositionedStyle(style, \"padding\");\n  const borders = getPositionedStyle(style, \"border\", \"width\");\n  const { x, y, box } = getCanvasPosition(event, canvas);\n  const xOffset = paddings.left + (box && borders.left);\n  const yOffset = paddings.top + (box && borders.top);\n  let { width, height } = chart;\n  if (borderBox) {\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  return {\n    x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n    y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n  };\n}\nfunction getContainerSize(canvas, width, height) {\n  let maxWidth, maxHeight;\n  if (width === void 0 || height === void 0) {\n    const container = canvas && _getParentNode(canvas);\n    if (!container) {\n      width = canvas.clientWidth;\n      height = canvas.clientHeight;\n    } else {\n      const rect = container.getBoundingClientRect();\n      const containerStyle = getComputedStyle(container);\n      const containerBorder = getPositionedStyle(containerStyle, \"border\", \"width\");\n      const containerPadding = getPositionedStyle(containerStyle, \"padding\");\n      width = rect.width - containerPadding.width - containerBorder.width;\n      height = rect.height - containerPadding.height - containerBorder.height;\n      maxWidth = parseMaxStyle(containerStyle.maxWidth, container, \"clientWidth\");\n      maxHeight = parseMaxStyle(containerStyle.maxHeight, container, \"clientHeight\");\n    }\n  }\n  return {\n    width,\n    height,\n    maxWidth: maxWidth || INFINITY,\n    maxHeight: maxHeight || INFINITY\n  };\n}\nvar round1 = (v) => Math.round(v * 10) / 10;\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n  const style = getComputedStyle(canvas);\n  const margins = getPositionedStyle(style, \"margin\");\n  const maxWidth = parseMaxStyle(style.maxWidth, canvas, \"clientWidth\") || INFINITY;\n  const maxHeight = parseMaxStyle(style.maxHeight, canvas, \"clientHeight\") || INFINITY;\n  const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n  let { width, height } = containerSize;\n  if (style.boxSizing === \"content-box\") {\n    const borders = getPositionedStyle(style, \"border\", \"width\");\n    const paddings = getPositionedStyle(style, \"padding\");\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  width = Math.max(0, width - margins.width);\n  height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n  width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n  height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n  if (width && !height) {\n    height = round1(width / 2);\n  }\n  const maintainHeight = bbWidth !== void 0 || bbHeight !== void 0;\n  if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n    height = containerSize.height;\n    width = round1(Math.floor(height * aspectRatio));\n  }\n  return {\n    width,\n    height\n  };\n}\nfunction retinaScale(chart, forceRatio, forceStyle) {\n  const pixelRatio = forceRatio || 1;\n  const deviceHeight = round1(chart.height * pixelRatio);\n  const deviceWidth = round1(chart.width * pixelRatio);\n  chart.height = round1(chart.height);\n  chart.width = round1(chart.width);\n  const canvas = chart.canvas;\n  if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n    canvas.style.height = `${chart.height}px`;\n    canvas.style.width = `${chart.width}px`;\n  }\n  if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n    chart.currentDevicePixelRatio = pixelRatio;\n    canvas.height = deviceHeight;\n    canvas.width = deviceWidth;\n    chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n    return true;\n  }\n  return false;\n}\nvar supportsEventListenerOptions = (function() {\n  let passiveSupported = false;\n  try {\n    const options = {\n      get passive() {\n        passiveSupported = true;\n        return false;\n      }\n    };\n    if (_isDomSupported()) {\n      window.addEventListener(\"test\", null, options);\n      window.removeEventListener(\"test\", null, options);\n    }\n  } catch (e) {\n  }\n  return passiveSupported;\n})();\nfunction readUsedSize(element, property) {\n  const value = getStyle(element, property);\n  const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n  return matches ? +matches[1] : void 0;\n}\nfunction _pointInLine(p1, p2, t, mode) {\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: p1.y + t * (p2.y - p1.y)\n  };\n}\nfunction _steppedInterpolation(p1, p2, t, mode) {\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: mode === \"middle\" ? t < 0.5 ? p1.y : p2.y : mode === \"after\" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n  };\n}\nfunction _bezierInterpolation(p1, p2, t, mode) {\n  const cp1 = {\n    x: p1.cp2x,\n    y: p1.cp2y\n  };\n  const cp2 = {\n    x: p2.cp1x,\n    y: p2.cp1y\n  };\n  const a = _pointInLine(p1, cp1, t);\n  const b = _pointInLine(cp1, cp2, t);\n  const c = _pointInLine(cp2, p2, t);\n  const d = _pointInLine(a, b, t);\n  const e = _pointInLine(b, c, t);\n  return _pointInLine(d, e, t);\n}\nvar getRightToLeftAdapter = function(rectX, width) {\n  return {\n    x(x) {\n      return rectX + rectX + width - x;\n    },\n    setWidth(w) {\n      width = w;\n    },\n    textAlign(align) {\n      if (align === \"center\") {\n        return align;\n      }\n      return align === \"right\" ? \"left\" : \"right\";\n    },\n    xPlus(x, value) {\n      return x - value;\n    },\n    leftForLtr(x, itemWidth) {\n      return x - itemWidth;\n    }\n  };\n};\nvar getLeftToRightAdapter = function() {\n  return {\n    x(x) {\n      return x;\n    },\n    setWidth(w) {\n    },\n    textAlign(align) {\n      return align;\n    },\n    xPlus(x, value) {\n      return x + value;\n    },\n    leftForLtr(x, _itemWidth) {\n      return x;\n    }\n  };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n  return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n  let style, original;\n  if (direction === \"ltr\" || direction === \"rtl\") {\n    style = ctx.canvas.style;\n    original = [\n      style.getPropertyValue(\"direction\"),\n      style.getPropertyPriority(\"direction\")\n    ];\n    style.setProperty(\"direction\", direction, \"important\");\n    ctx.prevTextDirection = original;\n  }\n}\nfunction restoreTextDirection(ctx, original) {\n  if (original !== void 0) {\n    delete ctx.prevTextDirection;\n    ctx.canvas.style.setProperty(\"direction\", original[0], original[1]);\n  }\n}\nfunction propertyFn(property) {\n  if (property === \"angle\") {\n    return {\n      between: _angleBetween,\n      compare: _angleDiff,\n      normalize: _normalizeAngle\n    };\n  }\n  return {\n    between: _isBetween,\n    compare: (a, b) => a - b,\n    normalize: (x) => x\n  };\n}\nfunction normalizeSegment({ start, end, count, loop, style }) {\n  return {\n    start: start % count,\n    end: end % count,\n    loop: loop && (end - start + 1) % count === 0,\n    style\n  };\n}\nfunction getSegment(segment, points, bounds) {\n  const { property, start: startBound, end: endBound } = bounds;\n  const { between, normalize } = propertyFn(property);\n  const count = points.length;\n  let { start, end, loop } = segment;\n  let i, ilen;\n  if (loop) {\n    start += count;\n    end += count;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n        break;\n      }\n      start--;\n      end--;\n    }\n    start %= count;\n    end %= count;\n  }\n  if (end < start) {\n    end += count;\n  }\n  return {\n    start,\n    end,\n    loop,\n    style: segment.style\n  };\n}\nfunction _boundSegment(segment, points, bounds) {\n  if (!bounds) {\n    return [\n      segment\n    ];\n  }\n  const { property, start: startBound, end: endBound } = bounds;\n  const count = points.length;\n  const { compare, between, normalize } = propertyFn(property);\n  const { start, end, loop, style } = getSegment(segment, points, bounds);\n  const result = [];\n  let inside = false;\n  let subStart = null;\n  let value, point, prevValue;\n  const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n  const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n  const shouldStart = () => inside || startIsBefore();\n  const shouldStop = () => !inside || endIsBefore();\n  for (let i = start, prev = start; i <= end; ++i) {\n    point = points[i % count];\n    if (point.skip) {\n      continue;\n    }\n    value = normalize(point[property]);\n    if (value === prevValue) {\n      continue;\n    }\n    inside = between(value, startBound, endBound);\n    if (subStart === null && shouldStart()) {\n      subStart = compare(value, startBound) === 0 ? i : prev;\n    }\n    if (subStart !== null && shouldStop()) {\n      result.push(normalizeSegment({\n        start: subStart,\n        end: i,\n        loop,\n        count,\n        style\n      }));\n      subStart = null;\n    }\n    prev = i;\n    prevValue = value;\n  }\n  if (subStart !== null) {\n    result.push(normalizeSegment({\n      start: subStart,\n      end,\n      loop,\n      count,\n      style\n    }));\n  }\n  return result;\n}\nfunction _boundSegments(line, bounds) {\n  const result = [];\n  const segments = line.segments;\n  for (let i = 0; i < segments.length; i++) {\n    const sub = _boundSegment(segments[i], line.points, bounds);\n    if (sub.length) {\n      result.push(...sub);\n    }\n  }\n  return result;\n}\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n  let start = 0;\n  let end = count - 1;\n  if (loop && !spanGaps) {\n    while (start < count && !points[start].skip) {\n      start++;\n    }\n  }\n  while (start < count && points[start].skip) {\n    start++;\n  }\n  start %= count;\n  if (loop) {\n    end += start;\n  }\n  while (end > start && points[end % count].skip) {\n    end--;\n  }\n  end %= count;\n  return {\n    start,\n    end\n  };\n}\nfunction solidSegments(points, start, max, loop) {\n  const count = points.length;\n  const result = [];\n  let last = start;\n  let prev = points[start];\n  let end;\n  for (end = start + 1; end <= max; ++end) {\n    const cur = points[end % count];\n    if (cur.skip || cur.stop) {\n      if (!prev.skip) {\n        loop = false;\n        result.push({\n          start: start % count,\n          end: (end - 1) % count,\n          loop\n        });\n        start = last = cur.stop ? end : null;\n      }\n    } else {\n      last = end;\n      if (prev.skip) {\n        start = end;\n      }\n    }\n    prev = cur;\n  }\n  if (last !== null) {\n    result.push({\n      start: start % count,\n      end: last % count,\n      loop\n    });\n  }\n  return result;\n}\nfunction _computeSegments(line, segmentOptions) {\n  const points = line.points;\n  const spanGaps = line.options.spanGaps;\n  const count = points.length;\n  if (!count) {\n    return [];\n  }\n  const loop = !!line._loop;\n  const { start, end } = findStartAndEnd(points, count, loop, spanGaps);\n  if (spanGaps === true) {\n    return splitByStyles(line, [\n      {\n        start,\n        end,\n        loop\n      }\n    ], points, segmentOptions);\n  }\n  const max = end < start ? end + count : end;\n  const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n  return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction splitByStyles(line, segments, points, segmentOptions) {\n  if (!segmentOptions || !segmentOptions.setContext || !points) {\n    return segments;\n  }\n  return doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n  const chartContext = line._chart.getContext();\n  const baseStyle = readStyle(line.options);\n  const { _datasetIndex: datasetIndex, options: { spanGaps } } = line;\n  const count = points.length;\n  const result = [];\n  let prevStyle = baseStyle;\n  let start = segments[0].start;\n  let i = start;\n  function addStyle(s, e, l, st) {\n    const dir = spanGaps ? -1 : 1;\n    if (s === e) {\n      return;\n    }\n    s += count;\n    while (points[s % count].skip) {\n      s -= dir;\n    }\n    while (points[e % count].skip) {\n      e += dir;\n    }\n    if (s % count !== e % count) {\n      result.push({\n        start: s % count,\n        end: e % count,\n        loop: l,\n        style: st\n      });\n      prevStyle = st;\n      start = e % count;\n    }\n  }\n  for (const segment of segments) {\n    start = spanGaps ? start : segment.start;\n    let prev = points[start % count];\n    let style;\n    for (i = start + 1; i <= segment.end; i++) {\n      const pt = points[i % count];\n      style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n        type: \"segment\",\n        p0: prev,\n        p1: pt,\n        p0DataIndex: (i - 1) % count,\n        p1DataIndex: i % count,\n        datasetIndex\n      })));\n      if (styleChanged(style, prevStyle)) {\n        addStyle(start, i - 1, segment.loop, prevStyle);\n      }\n      prev = pt;\n      prevStyle = style;\n    }\n    if (start < i - 1) {\n      addStyle(start, i - 1, segment.loop, prevStyle);\n    }\n  }\n  return result;\n}\nfunction readStyle(options) {\n  return {\n    backgroundColor: options.backgroundColor,\n    borderCapStyle: options.borderCapStyle,\n    borderDash: options.borderDash,\n    borderDashOffset: options.borderDashOffset,\n    borderJoinStyle: options.borderJoinStyle,\n    borderWidth: options.borderWidth,\n    borderColor: options.borderColor\n  };\n}\nfunction styleChanged(style, prevStyle) {\n  if (!prevStyle) {\n    return false;\n  }\n  const cache = [];\n  const replacer = function(key, value) {\n    if (!isPatternOrGradient(value)) {\n      return value;\n    }\n    if (!cache.includes(value)) {\n      cache.push(value);\n    }\n    return cache.indexOf(value);\n  };\n  return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\nfunction getSizeForArea(scale, chartArea, field) {\n  return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n  const { xScale, yScale } = meta;\n  if (xScale && yScale) {\n    return {\n      left: getSizeForArea(xScale, chartArea, \"left\"),\n      right: getSizeForArea(xScale, chartArea, \"right\"),\n      top: getSizeForArea(yScale, chartArea, \"top\"),\n      bottom: getSizeForArea(yScale, chartArea, \"bottom\")\n    };\n  }\n  return chartArea;\n}\nfunction getDatasetClipArea(chart, meta) {\n  const clip = meta._clip;\n  if (clip.disabled) {\n    return false;\n  }\n  const area = getDatasetArea(meta, chart.chartArea);\n  return {\n    left: clip.left === false ? 0 : area.left - (clip.left === true ? 0 : clip.left),\n    right: clip.right === false ? chart.width : area.right + (clip.right === true ? 0 : clip.right),\n    top: clip.top === false ? 0 : area.top - (clip.top === true ? 0 : clip.top),\n    bottom: clip.bottom === false ? chart.height : area.bottom + (clip.bottom === true ? 0 : clip.bottom)\n  };\n}\n\n// node_modules/chart.js/dist/chart.js\nvar Animator = class {\n  constructor() {\n    this._request = null;\n    this._charts = /* @__PURE__ */ new Map();\n    this._running = false;\n    this._lastDate = void 0;\n  }\n  _notify(chart, anims, date, type) {\n    const callbacks = anims.listeners[type];\n    const numSteps = anims.duration;\n    callbacks.forEach((fn) => fn({\n      chart,\n      initial: anims.initial,\n      numSteps,\n      currentStep: Math.min(date - anims.start, numSteps)\n    }));\n  }\n  _refresh() {\n    if (this._request) {\n      return;\n    }\n    this._running = true;\n    this._request = requestAnimFrame.call(window, () => {\n      this._update();\n      this._request = null;\n      if (this._running) {\n        this._refresh();\n      }\n    });\n  }\n  _update(date = Date.now()) {\n    let remaining = 0;\n    this._charts.forEach((anims, chart) => {\n      if (!anims.running || !anims.items.length) {\n        return;\n      }\n      const items = anims.items;\n      let i = items.length - 1;\n      let draw2 = false;\n      let item;\n      for (; i >= 0; --i) {\n        item = items[i];\n        if (item._active) {\n          if (item._total > anims.duration) {\n            anims.duration = item._total;\n          }\n          item.tick(date);\n          draw2 = true;\n        } else {\n          items[i] = items[items.length - 1];\n          items.pop();\n        }\n      }\n      if (draw2) {\n        chart.draw();\n        this._notify(chart, anims, date, \"progress\");\n      }\n      if (!items.length) {\n        anims.running = false;\n        this._notify(chart, anims, date, \"complete\");\n        anims.initial = false;\n      }\n      remaining += items.length;\n    });\n    this._lastDate = date;\n    if (remaining === 0) {\n      this._running = false;\n    }\n  }\n  _getAnims(chart) {\n    const charts = this._charts;\n    let anims = charts.get(chart);\n    if (!anims) {\n      anims = {\n        running: false,\n        initial: true,\n        items: [],\n        listeners: {\n          complete: [],\n          progress: []\n        }\n      };\n      charts.set(chart, anims);\n    }\n    return anims;\n  }\n  listen(chart, event, cb) {\n    this._getAnims(chart).listeners[event].push(cb);\n  }\n  add(chart, items) {\n    if (!items || !items.length) {\n      return;\n    }\n    this._getAnims(chart).items.push(...items);\n  }\n  has(chart) {\n    return this._getAnims(chart).items.length > 0;\n  }\n  start(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims) {\n      return;\n    }\n    anims.running = true;\n    anims.start = Date.now();\n    anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n    this._refresh();\n  }\n  running(chart) {\n    if (!this._running) {\n      return false;\n    }\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.running || !anims.items.length) {\n      return false;\n    }\n    return true;\n  }\n  stop(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.items.length) {\n      return;\n    }\n    const items = anims.items;\n    let i = items.length - 1;\n    for (; i >= 0; --i) {\n      items[i].cancel();\n    }\n    anims.items = [];\n    this._notify(chart, anims, Date.now(), \"complete\");\n  }\n  remove(chart) {\n    return this._charts.delete(chart);\n  }\n};\nvar animator = /* @__PURE__ */ new Animator();\nvar transparent = \"transparent\";\nvar interpolators = {\n  boolean(from2, to2, factor) {\n    return factor > 0.5 ? to2 : from2;\n  },\n  color(from2, to2, factor) {\n    const c0 = color(from2 || transparent);\n    const c1 = c0.valid && color(to2 || transparent);\n    return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to2;\n  },\n  number(from2, to2, factor) {\n    return from2 + (to2 - from2) * factor;\n  }\n};\nvar Animation = class {\n  constructor(cfg, target, prop, to2) {\n    const currentValue = target[prop];\n    to2 = resolve([\n      cfg.to,\n      to2,\n      currentValue,\n      cfg.from\n    ]);\n    const from2 = resolve([\n      cfg.from,\n      currentValue,\n      to2\n    ]);\n    this._active = true;\n    this._fn = cfg.fn || interpolators[cfg.type || typeof from2];\n    this._easing = effects[cfg.easing] || effects.linear;\n    this._start = Math.floor(Date.now() + (cfg.delay || 0));\n    this._duration = this._total = Math.floor(cfg.duration);\n    this._loop = !!cfg.loop;\n    this._target = target;\n    this._prop = prop;\n    this._from = from2;\n    this._to = to2;\n    this._promises = void 0;\n  }\n  active() {\n    return this._active;\n  }\n  update(cfg, to2, date) {\n    if (this._active) {\n      this._notify(false);\n      const currentValue = this._target[this._prop];\n      const elapsed = date - this._start;\n      const remain = this._duration - elapsed;\n      this._start = date;\n      this._duration = Math.floor(Math.max(remain, cfg.duration));\n      this._total += elapsed;\n      this._loop = !!cfg.loop;\n      this._to = resolve([\n        cfg.to,\n        to2,\n        currentValue,\n        cfg.from\n      ]);\n      this._from = resolve([\n        cfg.from,\n        currentValue,\n        to2\n      ]);\n    }\n  }\n  cancel() {\n    if (this._active) {\n      this.tick(Date.now());\n      this._active = false;\n      this._notify(false);\n    }\n  }\n  tick(date) {\n    const elapsed = date - this._start;\n    const duration = this._duration;\n    const prop = this._prop;\n    const from2 = this._from;\n    const loop = this._loop;\n    const to2 = this._to;\n    let factor;\n    this._active = from2 !== to2 && (loop || elapsed < duration);\n    if (!this._active) {\n      this._target[prop] = to2;\n      this._notify(true);\n      return;\n    }\n    if (elapsed < 0) {\n      this._target[prop] = from2;\n      return;\n    }\n    factor = elapsed / duration % 2;\n    factor = loop && factor > 1 ? 2 - factor : factor;\n    factor = this._easing(Math.min(1, Math.max(0, factor)));\n    this._target[prop] = this._fn(from2, to2, factor);\n  }\n  wait() {\n    const promises = this._promises || (this._promises = []);\n    return new Promise((res, rej) => {\n      promises.push({\n        res,\n        rej\n      });\n    });\n  }\n  _notify(resolved) {\n    const method = resolved ? \"res\" : \"rej\";\n    const promises = this._promises || [];\n    for (let i = 0; i < promises.length; i++) {\n      promises[i][method]();\n    }\n  }\n};\nvar Animations = class {\n  constructor(chart, config) {\n    this._chart = chart;\n    this._properties = /* @__PURE__ */ new Map();\n    this.configure(config);\n  }\n  configure(config) {\n    if (!isObject(config)) {\n      return;\n    }\n    const animationOptions = Object.keys(defaults.animation);\n    const animatedProps = this._properties;\n    Object.getOwnPropertyNames(config).forEach((key) => {\n      const cfg = config[key];\n      if (!isObject(cfg)) {\n        return;\n      }\n      const resolved = {};\n      for (const option of animationOptions) {\n        resolved[option] = cfg[option];\n      }\n      (isArray(cfg.properties) && cfg.properties || [\n        key\n      ]).forEach((prop) => {\n        if (prop === key || !animatedProps.has(prop)) {\n          animatedProps.set(prop, resolved);\n        }\n      });\n    });\n  }\n  _animateOptions(target, values) {\n    const newOptions = values.options;\n    const options = resolveTargetOptions(target, newOptions);\n    if (!options) {\n      return [];\n    }\n    const animations = this._createAnimations(options, newOptions);\n    if (newOptions.$shared) {\n      awaitAll(target.options.$animations, newOptions).then(() => {\n        target.options = newOptions;\n      }, () => {\n      });\n    }\n    return animations;\n  }\n  _createAnimations(target, values) {\n    const animatedProps = this._properties;\n    const animations = [];\n    const running = target.$animations || (target.$animations = {});\n    const props = Object.keys(values);\n    const date = Date.now();\n    let i;\n    for (i = props.length - 1; i >= 0; --i) {\n      const prop = props[i];\n      if (prop.charAt(0) === \"$\") {\n        continue;\n      }\n      if (prop === \"options\") {\n        animations.push(...this._animateOptions(target, values));\n        continue;\n      }\n      const value = values[prop];\n      let animation = running[prop];\n      const cfg = animatedProps.get(prop);\n      if (animation) {\n        if (cfg && animation.active()) {\n          animation.update(cfg, value, date);\n          continue;\n        } else {\n          animation.cancel();\n        }\n      }\n      if (!cfg || !cfg.duration) {\n        target[prop] = value;\n        continue;\n      }\n      running[prop] = animation = new Animation(cfg, target, prop, value);\n      animations.push(animation);\n    }\n    return animations;\n  }\n  update(target, values) {\n    if (this._properties.size === 0) {\n      Object.assign(target, values);\n      return;\n    }\n    const animations = this._createAnimations(target, values);\n    if (animations.length) {\n      animator.add(this._chart, animations);\n      return true;\n    }\n  }\n};\nfunction awaitAll(animations, properties) {\n  const running = [];\n  const keys = Object.keys(properties);\n  for (let i = 0; i < keys.length; i++) {\n    const anim = animations[keys[i]];\n    if (anim && anim.active()) {\n      running.push(anim.wait());\n    }\n  }\n  return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n  if (!newOptions) {\n    return;\n  }\n  let options = target.options;\n  if (!options) {\n    target.options = newOptions;\n    return;\n  }\n  if (options.$shared) {\n    target.options = options = Object.assign({}, options, {\n      $shared: false,\n      $animations: {}\n    });\n  }\n  return options;\n}\nfunction scaleClip(scale, allowedOverflow) {\n  const opts = scale && scale.options || {};\n  const reverse = opts.reverse;\n  const min = opts.min === void 0 ? allowedOverflow : 0;\n  const max = opts.max === void 0 ? allowedOverflow : 0;\n  return {\n    start: reverse ? max : min,\n    end: reverse ? min : max\n  };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n  if (allowedOverflow === false) {\n    return false;\n  }\n  const x = scaleClip(xScale, allowedOverflow);\n  const y = scaleClip(yScale, allowedOverflow);\n  return {\n    top: y.end,\n    right: x.end,\n    bottom: y.start,\n    left: x.start\n  };\n}\nfunction toClip(value) {\n  let t, r, b, l;\n  if (isObject(value)) {\n    t = value.top;\n    r = value.right;\n    b = value.bottom;\n    l = value.left;\n  } else {\n    t = r = b = l = value;\n  }\n  return {\n    top: t,\n    right: r,\n    bottom: b,\n    left: l,\n    disabled: value === false\n  };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n  const keys = [];\n  const metasets = chart._getSortedDatasetMetas(filterVisible);\n  let i, ilen;\n  for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n    keys.push(metasets[i].index);\n  }\n  return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n  const keys = stack.keys;\n  const singleMode = options.mode === \"single\";\n  let i, ilen, datasetIndex, otherValue;\n  if (value === null) {\n    return;\n  }\n  let found = false;\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    datasetIndex = +keys[i];\n    if (datasetIndex === dsIndex) {\n      found = true;\n      if (options.all) {\n        continue;\n      }\n      break;\n    }\n    otherValue = stack.values[datasetIndex];\n    if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n      value += otherValue;\n    }\n  }\n  if (!found && !options.all) {\n    return 0;\n  }\n  return value;\n}\nfunction convertObjectDataToArray(data, meta) {\n  const { iScale, vScale } = meta;\n  const iAxisKey = iScale.axis === \"x\" ? \"x\" : \"y\";\n  const vAxisKey = vScale.axis === \"x\" ? \"x\" : \"y\";\n  const keys = Object.keys(data);\n  const adata = new Array(keys.length);\n  let i, ilen, key;\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    key = keys[i];\n    adata[i] = {\n      [iAxisKey]: key,\n      [vAxisKey]: data[key]\n    };\n  }\n  return adata;\n}\nfunction isStacked(scale, meta) {\n  const stacked = scale && scale.options.stacked;\n  return stacked || stacked === void 0 && meta.stack !== void 0;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n  return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n  const { min, max, minDefined, maxDefined } = scale.getUserBounds();\n  return {\n    min: minDefined ? min : Number.NEGATIVE_INFINITY,\n    max: maxDefined ? max : Number.POSITIVE_INFINITY\n  };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n  const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n  return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n  for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n    const value = stack[meta.index];\n    if (positive && value > 0 || !positive && value < 0) {\n      return meta.index;\n    }\n  }\n  return null;\n}\nfunction updateStacks(controller, parsed) {\n  const { chart, _cachedMeta: meta } = controller;\n  const stacks = chart._stacks || (chart._stacks = {});\n  const { iScale, vScale, index: datasetIndex } = meta;\n  const iAxis = iScale.axis;\n  const vAxis = vScale.axis;\n  const key = getStackKey(iScale, vScale, meta);\n  const ilen = parsed.length;\n  let stack;\n  for (let i = 0; i < ilen; ++i) {\n    const item = parsed[i];\n    const { [iAxis]: index2, [vAxis]: value } = item;\n    const itemStacks = item._stacks || (item._stacks = {});\n    stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index2);\n    stack[datasetIndex] = value;\n    stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n    stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n    const visualValues = stack._visualValues || (stack._visualValues = {});\n    visualValues[datasetIndex] = value;\n  }\n}\nfunction getFirstScaleId(chart, axis) {\n  const scales2 = chart.scales;\n  return Object.keys(scales2).filter((key) => scales2[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index2) {\n  return createContext(parent, {\n    active: false,\n    dataset: void 0,\n    datasetIndex: index2,\n    index: index2,\n    mode: \"default\",\n    type: \"dataset\"\n  });\n}\nfunction createDataContext(parent, index2, element) {\n  return createContext(parent, {\n    active: false,\n    dataIndex: index2,\n    parsed: void 0,\n    raw: void 0,\n    element,\n    index: index2,\n    mode: \"default\",\n    type: \"data\"\n  });\n}\nfunction clearStacks(meta, items) {\n  const datasetIndex = meta.controller.index;\n  const axis = meta.vScale && meta.vScale.axis;\n  if (!axis) {\n    return;\n  }\n  items = items || meta._parsed;\n  for (const parsed of items) {\n    const stacks = parsed._stacks;\n    if (!stacks || stacks[axis] === void 0 || stacks[axis][datasetIndex] === void 0) {\n      return;\n    }\n    delete stacks[axis][datasetIndex];\n    if (stacks[axis]._visualValues !== void 0 && stacks[axis]._visualValues[datasetIndex] !== void 0) {\n      delete stacks[axis]._visualValues[datasetIndex];\n    }\n  }\n}\nvar isDirectUpdateMode = (mode) => mode === \"reset\" || mode === \"none\";\nvar cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nvar createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked && {\n  keys: getSortedDatasetIndices(chart, true),\n  values: null\n};\nvar DatasetController = class {\n  constructor(chart, datasetIndex) {\n    this.chart = chart;\n    this._ctx = chart.ctx;\n    this.index = datasetIndex;\n    this._cachedDataOpts = {};\n    this._cachedMeta = this.getMeta();\n    this._type = this._cachedMeta.type;\n    this.options = void 0;\n    this._parsing = false;\n    this._data = void 0;\n    this._objectData = void 0;\n    this._sharedOptions = void 0;\n    this._drawStart = void 0;\n    this._drawCount = void 0;\n    this.enableOptionSharing = false;\n    this.supportsDecimation = false;\n    this.$context = void 0;\n    this._syncList = [];\n    this.datasetElementType = new.target.datasetElementType;\n    this.dataElementType = new.target.dataElementType;\n    this.initialize();\n  }\n  initialize() {\n    const meta = this._cachedMeta;\n    this.configure();\n    this.linkScales();\n    meta._stacked = isStacked(meta.vScale, meta);\n    this.addElements();\n    if (this.options.fill && !this.chart.isPluginEnabled(\"filler\")) {\n      console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n    }\n  }\n  updateIndex(datasetIndex) {\n    if (this.index !== datasetIndex) {\n      clearStacks(this._cachedMeta);\n    }\n    this.index = datasetIndex;\n  }\n  linkScales() {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n    const chooseId = (axis, x, y, r) => axis === \"x\" ? x : axis === \"r\" ? r : y;\n    const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, \"x\"));\n    const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, \"y\"));\n    const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, \"r\"));\n    const indexAxis = meta.indexAxis;\n    const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n    const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n    meta.xScale = this.getScaleForId(xid);\n    meta.yScale = this.getScaleForId(yid);\n    meta.rScale = this.getScaleForId(rid);\n    meta.iScale = this.getScaleForId(iid);\n    meta.vScale = this.getScaleForId(vid);\n  }\n  getDataset() {\n    return this.chart.data.datasets[this.index];\n  }\n  getMeta() {\n    return this.chart.getDatasetMeta(this.index);\n  }\n  getScaleForId(scaleID) {\n    return this.chart.scales[scaleID];\n  }\n  _getOtherScale(scale) {\n    const meta = this._cachedMeta;\n    return scale === meta.iScale ? meta.vScale : meta.iScale;\n  }\n  reset() {\n    this._update(\"reset\");\n  }\n  _destroy() {\n    const meta = this._cachedMeta;\n    if (this._data) {\n      unlistenArrayEvents(this._data, this);\n    }\n    if (meta._stacked) {\n      clearStacks(meta);\n    }\n  }\n  _dataCheck() {\n    const dataset = this.getDataset();\n    const data = dataset.data || (dataset.data = []);\n    const _data = this._data;\n    if (isObject(data)) {\n      const meta = this._cachedMeta;\n      this._data = convertObjectDataToArray(data, meta);\n    } else if (_data !== data) {\n      if (_data) {\n        unlistenArrayEvents(_data, this);\n        const meta = this._cachedMeta;\n        clearStacks(meta);\n        meta._parsed = [];\n      }\n      if (data && Object.isExtensible(data)) {\n        listenArrayEvents(data, this);\n      }\n      this._syncList = [];\n      this._data = data;\n    }\n  }\n  addElements() {\n    const meta = this._cachedMeta;\n    this._dataCheck();\n    if (this.datasetElementType) {\n      meta.dataset = new this.datasetElementType();\n    }\n  }\n  buildOrUpdateElements(resetNewElements) {\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n    let stackChanged = false;\n    this._dataCheck();\n    const oldStacked = meta._stacked;\n    meta._stacked = isStacked(meta.vScale, meta);\n    if (meta.stack !== dataset.stack) {\n      stackChanged = true;\n      clearStacks(meta);\n      meta.stack = dataset.stack;\n    }\n    this._resyncElements(resetNewElements);\n    if (stackChanged || oldStacked !== meta._stacked) {\n      updateStacks(this, meta._parsed);\n      meta._stacked = isStacked(meta.vScale, meta);\n    }\n  }\n  configure() {\n    const config = this.chart.config;\n    const scopeKeys = config.datasetScopeKeys(this._type);\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n    this.options = config.createResolver(scopes, this.getContext());\n    this._parsing = this.options.parsing;\n    this._cachedDataOpts = {};\n  }\n  parse(start, count) {\n    const { _cachedMeta: meta, _data: data } = this;\n    const { iScale, _stacked } = meta;\n    const iAxis = iScale.axis;\n    let sorted = start === 0 && count === data.length ? true : meta._sorted;\n    let prev = start > 0 && meta._parsed[start - 1];\n    let i, cur, parsed;\n    if (this._parsing === false) {\n      meta._parsed = data;\n      meta._sorted = true;\n      parsed = data;\n    } else {\n      if (isArray(data[start])) {\n        parsed = this.parseArrayData(meta, data, start, count);\n      } else if (isObject(data[start])) {\n        parsed = this.parseObjectData(meta, data, start, count);\n      } else {\n        parsed = this.parsePrimitiveData(meta, data, start, count);\n      }\n      const isNotInOrderComparedToPrev = () => cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n      for (i = 0; i < count; ++i) {\n        meta._parsed[i + start] = cur = parsed[i];\n        if (sorted) {\n          if (isNotInOrderComparedToPrev()) {\n            sorted = false;\n          }\n          prev = cur;\n        }\n      }\n      meta._sorted = sorted;\n    }\n    if (_stacked) {\n      updateStacks(this, parsed);\n    }\n  }\n  parsePrimitiveData(meta, data, start, count) {\n    const { iScale, vScale } = meta;\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const labels = iScale.getLabels();\n    const singleScale = iScale === vScale;\n    const parsed = new Array(count);\n    let i, ilen, index2;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index2 = i + start;\n      parsed[i] = {\n        [iAxis]: singleScale || iScale.parse(labels[index2], index2),\n        [vAxis]: vScale.parse(data[index2], index2)\n      };\n    }\n    return parsed;\n  }\n  parseArrayData(meta, data, start, count) {\n    const { xScale, yScale } = meta;\n    const parsed = new Array(count);\n    let i, ilen, index2, item;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index2 = i + start;\n      item = data[index2];\n      parsed[i] = {\n        x: xScale.parse(item[0], index2),\n        y: yScale.parse(item[1], index2)\n      };\n    }\n    return parsed;\n  }\n  parseObjectData(meta, data, start, count) {\n    const { xScale, yScale } = meta;\n    const { xAxisKey = \"x\", yAxisKey = \"y\" } = this._parsing;\n    const parsed = new Array(count);\n    let i, ilen, index2, item;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index2 = i + start;\n      item = data[index2];\n      parsed[i] = {\n        x: xScale.parse(resolveObjectKey(item, xAxisKey), index2),\n        y: yScale.parse(resolveObjectKey(item, yAxisKey), index2)\n      };\n    }\n    return parsed;\n  }\n  getParsed(index2) {\n    return this._cachedMeta._parsed[index2];\n  }\n  getDataElement(index2) {\n    return this._cachedMeta.data[index2];\n  }\n  applyStack(scale, parsed, mode) {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const value = parsed[scale.axis];\n    const stack = {\n      keys: getSortedDatasetIndices(chart, true),\n      values: parsed._stacks[scale.axis]._visualValues\n    };\n    return applyStack(stack, value, meta.index, {\n      mode\n    });\n  }\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    const parsedValue = parsed[scale.axis];\n    let value = parsedValue === null ? NaN : parsedValue;\n    const values = stack && parsed._stacks[scale.axis];\n    if (stack && values) {\n      stack.values = values;\n      value = applyStack(stack, parsedValue, this._cachedMeta.index);\n    }\n    range.min = Math.min(range.min, value);\n    range.max = Math.max(range.max, value);\n  }\n  getMinMax(scale, canStack) {\n    const meta = this._cachedMeta;\n    const _parsed = meta._parsed;\n    const sorted = meta._sorted && scale === meta.iScale;\n    const ilen = _parsed.length;\n    const otherScale = this._getOtherScale(scale);\n    const stack = createStack(canStack, meta, this.chart);\n    const range = {\n      min: Number.POSITIVE_INFINITY,\n      max: Number.NEGATIVE_INFINITY\n    };\n    const { min: otherMin, max: otherMax } = getUserBounds(otherScale);\n    let i, parsed;\n    function _skip() {\n      parsed = _parsed[i];\n      const otherValue = parsed[otherScale.axis];\n      return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n    }\n    for (i = 0; i < ilen; ++i) {\n      if (_skip()) {\n        continue;\n      }\n      this.updateRangeFromParsed(range, scale, parsed, stack);\n      if (sorted) {\n        break;\n      }\n    }\n    if (sorted) {\n      for (i = ilen - 1; i >= 0; --i) {\n        if (_skip()) {\n          continue;\n        }\n        this.updateRangeFromParsed(range, scale, parsed, stack);\n        break;\n      }\n    }\n    return range;\n  }\n  getAllParsedValues(scale) {\n    const parsed = this._cachedMeta._parsed;\n    const values = [];\n    let i, ilen, value;\n    for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n      value = parsed[i][scale.axis];\n      if (isNumberFinite(value)) {\n        values.push(value);\n      }\n    }\n    return values;\n  }\n  getMaxOverflow() {\n    return false;\n  }\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const vScale = meta.vScale;\n    const parsed = this.getParsed(index2);\n    return {\n      label: iScale ? \"\" + iScale.getLabelForValue(parsed[iScale.axis]) : \"\",\n      value: vScale ? \"\" + vScale.getLabelForValue(parsed[vScale.axis]) : \"\"\n    };\n  }\n  _update(mode) {\n    const meta = this._cachedMeta;\n    this.update(mode || \"default\");\n    meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n  }\n  update(mode) {\n  }\n  draw() {\n    const ctx = this._ctx;\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const elements2 = meta.data || [];\n    const area = chart.chartArea;\n    const active = [];\n    const start = this._drawStart || 0;\n    const count = this._drawCount || elements2.length - start;\n    const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n    let i;\n    if (meta.dataset) {\n      meta.dataset.draw(ctx, area, start, count);\n    }\n    for (i = start; i < start + count; ++i) {\n      const element = elements2[i];\n      if (element.hidden) {\n        continue;\n      }\n      if (element.active && drawActiveElementsOnTop) {\n        active.push(element);\n      } else {\n        element.draw(ctx, area);\n      }\n    }\n    for (i = 0; i < active.length; ++i) {\n      active[i].draw(ctx, area);\n    }\n  }\n  getStyle(index2, active) {\n    const mode = active ? \"active\" : \"default\";\n    return index2 === void 0 && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index2 || 0, mode);\n  }\n  getContext(index2, active, mode) {\n    const dataset = this.getDataset();\n    let context;\n    if (index2 >= 0 && index2 < this._cachedMeta.data.length) {\n      const element = this._cachedMeta.data[index2];\n      context = element.$context || (element.$context = createDataContext(this.getContext(), index2, element));\n      context.parsed = this.getParsed(index2);\n      context.raw = dataset.data[index2];\n      context.index = context.dataIndex = index2;\n    } else {\n      context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n      context.dataset = dataset;\n      context.index = context.datasetIndex = this.index;\n    }\n    context.active = !!active;\n    context.mode = mode;\n    return context;\n  }\n  resolveDatasetElementOptions(mode) {\n    return this._resolveElementOptions(this.datasetElementType.id, mode);\n  }\n  resolveDataElementOptions(index2, mode) {\n    return this._resolveElementOptions(this.dataElementType.id, mode, index2);\n  }\n  _resolveElementOptions(elementType, mode = \"default\", index2) {\n    const active = mode === \"active\";\n    const cache = this._cachedDataOpts;\n    const cacheKey = elementType + \"-\" + mode;\n    const cached = cache[cacheKey];\n    const sharing = this.enableOptionSharing && defined(index2);\n    if (cached) {\n      return cloneIfNotShared(cached, sharing);\n    }\n    const config = this.chart.config;\n    const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n    const prefixes = active ? [\n      `${elementType}Hover`,\n      \"hover\",\n      elementType,\n      \"\"\n    ] : [\n      elementType,\n      \"\"\n    ];\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n    const names2 = Object.keys(defaults.elements[elementType]);\n    const context = () => this.getContext(index2, active, mode);\n    const values = config.resolveNamedOptions(scopes, names2, context, prefixes);\n    if (values.$shared) {\n      values.$shared = sharing;\n      cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n    }\n    return values;\n  }\n  _resolveAnimations(index2, transition, active) {\n    const chart = this.chart;\n    const cache = this._cachedDataOpts;\n    const cacheKey = `animation-${transition}`;\n    const cached = cache[cacheKey];\n    if (cached) {\n      return cached;\n    }\n    let options;\n    if (chart.options.animation !== false) {\n      const config = this.chart.config;\n      const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n      const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n      options = config.createResolver(scopes, this.getContext(index2, active, transition));\n    }\n    const animations = new Animations(chart, options && options.animations);\n    if (options && options._cacheable) {\n      cache[cacheKey] = Object.freeze(animations);\n    }\n    return animations;\n  }\n  getSharedOptions(options) {\n    if (!options.$shared) {\n      return;\n    }\n    return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n  }\n  includeOptions(mode, sharedOptions) {\n    return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n  }\n  _getSharedOptions(start, mode) {\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const previouslySharedOptions = this._sharedOptions;\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n    return {\n      sharedOptions,\n      includeOptions\n    };\n  }\n  updateElement(element, index2, properties, mode) {\n    if (isDirectUpdateMode(mode)) {\n      Object.assign(element, properties);\n    } else {\n      this._resolveAnimations(index2, mode).update(element, properties);\n    }\n  }\n  updateSharedOptions(sharedOptions, mode, newOptions) {\n    if (sharedOptions && !isDirectUpdateMode(mode)) {\n      this._resolveAnimations(void 0, mode).update(sharedOptions, newOptions);\n    }\n  }\n  _setStyle(element, index2, mode, active) {\n    element.active = active;\n    const options = this.getStyle(index2, active);\n    this._resolveAnimations(index2, mode, active).update(element, {\n      options: !active && this.getSharedOptions(options) || options\n    });\n  }\n  removeHoverStyle(element, datasetIndex, index2) {\n    this._setStyle(element, index2, \"active\", false);\n  }\n  setHoverStyle(element, datasetIndex, index2) {\n    this._setStyle(element, index2, \"active\", true);\n  }\n  _removeDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n    if (element) {\n      this._setStyle(element, void 0, \"active\", false);\n    }\n  }\n  _setDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n    if (element) {\n      this._setStyle(element, void 0, \"active\", true);\n    }\n  }\n  _resyncElements(resetNewElements) {\n    const data = this._data;\n    const elements2 = this._cachedMeta.data;\n    for (const [method, arg1, arg2] of this._syncList) {\n      this[method](arg1, arg2);\n    }\n    this._syncList = [];\n    const numMeta = elements2.length;\n    const numData = data.length;\n    const count = Math.min(numData, numMeta);\n    if (count) {\n      this.parse(0, count);\n    }\n    if (numData > numMeta) {\n      this._insertElements(numMeta, numData - numMeta, resetNewElements);\n    } else if (numData < numMeta) {\n      this._removeElements(numData, numMeta - numData);\n    }\n  }\n  _insertElements(start, count, resetNewElements = true) {\n    const meta = this._cachedMeta;\n    const data = meta.data;\n    const end = start + count;\n    let i;\n    const move = (arr) => {\n      arr.length += count;\n      for (i = arr.length - 1; i >= end; i--) {\n        arr[i] = arr[i - count];\n      }\n    };\n    move(data);\n    for (i = start; i < end; ++i) {\n      data[i] = new this.dataElementType();\n    }\n    if (this._parsing) {\n      move(meta._parsed);\n    }\n    this.parse(start, count);\n    if (resetNewElements) {\n      this.updateElements(data, start, count, \"reset\");\n    }\n  }\n  updateElements(element, start, count, mode) {\n  }\n  _removeElements(start, count) {\n    const meta = this._cachedMeta;\n    if (this._parsing) {\n      const removed = meta._parsed.splice(start, count);\n      if (meta._stacked) {\n        clearStacks(meta, removed);\n      }\n    }\n    meta.data.splice(start, count);\n  }\n  _sync(args) {\n    if (this._parsing) {\n      this._syncList.push(args);\n    } else {\n      const [method, arg1, arg2] = args;\n      this[method](arg1, arg2);\n    }\n    this.chart._dataChanges.push([\n      this.index,\n      ...args\n    ]);\n  }\n  _onDataPush() {\n    const count = arguments.length;\n    this._sync([\n      \"_insertElements\",\n      this.getDataset().data.length - count,\n      count\n    ]);\n  }\n  _onDataPop() {\n    this._sync([\n      \"_removeElements\",\n      this._cachedMeta.data.length - 1,\n      1\n    ]);\n  }\n  _onDataShift() {\n    this._sync([\n      \"_removeElements\",\n      0,\n      1\n    ]);\n  }\n  _onDataSplice(start, count) {\n    if (count) {\n      this._sync([\n        \"_removeElements\",\n        start,\n        count\n      ]);\n    }\n    const newCount = arguments.length - 2;\n    if (newCount) {\n      this._sync([\n        \"_insertElements\",\n        start,\n        newCount\n      ]);\n    }\n  }\n  _onDataUnshift() {\n    this._sync([\n      \"_insertElements\",\n      0,\n      arguments.length\n    ]);\n  }\n};\n__publicField(DatasetController, \"defaults\", {});\n__publicField(DatasetController, \"datasetElementType\", null);\n__publicField(DatasetController, \"dataElementType\", null);\nfunction getAllScaleValues(scale, type) {\n  if (!scale._cache.$bar) {\n    const visibleMetas = scale.getMatchingVisibleMetas(type);\n    let values = [];\n    for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n      values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n    }\n    scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n  }\n  return scale._cache.$bar;\n}\nfunction computeMinSampleSize(meta) {\n  const scale = meta.iScale;\n  const values = getAllScaleValues(scale, meta.type);\n  let min = scale._length;\n  let i, ilen, curr, prev;\n  const updateMinAndPrev = () => {\n    if (curr === 32767 || curr === -32768) {\n      return;\n    }\n    if (defined(prev)) {\n      min = Math.min(min, Math.abs(curr - prev) || min);\n    }\n    prev = curr;\n  };\n  for (i = 0, ilen = values.length; i < ilen; ++i) {\n    curr = scale.getPixelForValue(values[i]);\n    updateMinAndPrev();\n  }\n  prev = void 0;\n  for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n    curr = scale.getPixelForTick(i);\n    updateMinAndPrev();\n  }\n  return min;\n}\nfunction computeFitCategoryTraits(index2, ruler, options, stackCount) {\n  const thickness = options.barThickness;\n  let size, ratio;\n  if (isNullOrUndef(thickness)) {\n    size = ruler.min * options.categoryPercentage;\n    ratio = options.barPercentage;\n  } else {\n    size = thickness * stackCount;\n    ratio = 1;\n  }\n  return {\n    chunk: size / stackCount,\n    ratio,\n    start: ruler.pixels[index2] - size / 2\n  };\n}\nfunction computeFlexCategoryTraits(index2, ruler, options, stackCount) {\n  const pixels = ruler.pixels;\n  const curr = pixels[index2];\n  let prev = index2 > 0 ? pixels[index2 - 1] : null;\n  let next = index2 < pixels.length - 1 ? pixels[index2 + 1] : null;\n  const percent = options.categoryPercentage;\n  if (prev === null) {\n    prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n  }\n  if (next === null) {\n    next = curr + curr - prev;\n  }\n  const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n  const size = Math.abs(next - prev) / 2 * percent;\n  return {\n    chunk: size / stackCount,\n    ratio: options.barPercentage,\n    start\n  };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n  const startValue = vScale.parse(entry[0], i);\n  const endValue = vScale.parse(entry[1], i);\n  const min = Math.min(startValue, endValue);\n  const max = Math.max(startValue, endValue);\n  let barStart = min;\n  let barEnd = max;\n  if (Math.abs(min) > Math.abs(max)) {\n    barStart = max;\n    barEnd = min;\n  }\n  item[vScale.axis] = barEnd;\n  item._custom = {\n    barStart,\n    barEnd,\n    start: startValue,\n    end: endValue,\n    min,\n    max\n  };\n}\nfunction parseValue(entry, item, vScale, i) {\n  if (isArray(entry)) {\n    parseFloatBar(entry, item, vScale, i);\n  } else {\n    item[vScale.axis] = vScale.parse(entry, i);\n  }\n  return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n  const iScale = meta.iScale;\n  const vScale = meta.vScale;\n  const labels = iScale.getLabels();\n  const singleScale = iScale === vScale;\n  const parsed = [];\n  let i, ilen, item, entry;\n  for (i = start, ilen = start + count; i < ilen; ++i) {\n    entry = data[i];\n    item = {};\n    item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n    parsed.push(parseValue(entry, item, vScale, i));\n  }\n  return parsed;\n}\nfunction isFloatBar(custom) {\n  return custom && custom.barStart !== void 0 && custom.barEnd !== void 0;\n}\nfunction barSign(size, vScale, actualBase) {\n  if (size !== 0) {\n    return sign(size);\n  }\n  return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n  let reverse, start, end, top, bottom;\n  if (properties.horizontal) {\n    reverse = properties.base > properties.x;\n    start = \"left\";\n    end = \"right\";\n  } else {\n    reverse = properties.base < properties.y;\n    start = \"bottom\";\n    end = \"top\";\n  }\n  if (reverse) {\n    top = \"end\";\n    bottom = \"start\";\n  } else {\n    top = \"start\";\n    bottom = \"end\";\n  }\n  return {\n    start,\n    end,\n    reverse,\n    top,\n    bottom\n  };\n}\nfunction setBorderSkipped(properties, options, stack, index2) {\n  let edge = options.borderSkipped;\n  const res = {};\n  if (!edge) {\n    properties.borderSkipped = res;\n    return;\n  }\n  if (edge === true) {\n    properties.borderSkipped = {\n      top: true,\n      right: true,\n      bottom: true,\n      left: true\n    };\n    return;\n  }\n  const { start, end, reverse, top, bottom } = borderProps(properties);\n  if (edge === \"middle\" && stack) {\n    properties.enableBorderRadius = true;\n    if ((stack._top || 0) === index2) {\n      edge = top;\n    } else if ((stack._bottom || 0) === index2) {\n      edge = bottom;\n    } else {\n      res[parseEdge(bottom, start, end, reverse)] = true;\n      edge = top;\n    }\n  }\n  res[parseEdge(edge, start, end, reverse)] = true;\n  properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n  if (reverse) {\n    edge = swap(edge, a, b);\n    edge = startEnd(edge, b, a);\n  } else {\n    edge = startEnd(edge, a, b);\n  }\n  return edge;\n}\nfunction swap(orig, v1, v2) {\n  return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n  return v === \"start\" ? start : v === \"end\" ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n  properties.inflateAmount = inflateAmount === \"auto\" ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nvar BarController = class extends DatasetController {\n  parsePrimitiveData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n  parseArrayData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n  parseObjectData(meta, data, start, count) {\n    const { iScale, vScale } = meta;\n    const { xAxisKey = \"x\", yAxisKey = \"y\" } = this._parsing;\n    const iAxisKey = iScale.axis === \"x\" ? xAxisKey : yAxisKey;\n    const vAxisKey = vScale.axis === \"x\" ? xAxisKey : yAxisKey;\n    const parsed = [];\n    let i, ilen, item, obj;\n    for (i = start, ilen = start + count; i < ilen; ++i) {\n      obj = data[i];\n      item = {};\n      item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n      parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n    }\n    return parsed;\n  }\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    super.updateRangeFromParsed(range, scale, parsed, stack);\n    const custom = parsed._custom;\n    if (custom && scale === this._cachedMeta.vScale) {\n      range.min = Math.min(range.min, custom.min);\n      range.max = Math.max(range.max, custom.max);\n    }\n  }\n  getMaxOverflow() {\n    return 0;\n  }\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const { iScale, vScale } = meta;\n    const parsed = this.getParsed(index2);\n    const custom = parsed._custom;\n    const value = isFloatBar(custom) ? \"[\" + custom.start + \", \" + custom.end + \"]\" : \"\" + vScale.getLabelForValue(parsed[vScale.axis]);\n    return {\n      label: \"\" + iScale.getLabelForValue(parsed[iScale.axis]),\n      value\n    };\n  }\n  initialize() {\n    this.enableOptionSharing = true;\n    super.initialize();\n    const meta = this._cachedMeta;\n    meta.stack = this.getDataset().stack;\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    this.updateElements(meta.data, 0, meta.data.length, mode);\n  }\n  updateElements(bars, start, count, mode) {\n    const reset = mode === \"reset\";\n    const { index: index2, _cachedMeta: { vScale } } = this;\n    const base = vScale.getBasePixel();\n    const horizontal = vScale.isHorizontal();\n    const ruler = this._getRuler();\n    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);\n    for (let i = start; i < start + count; i++) {\n      const parsed = this.getParsed(i);\n      const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n        base,\n        head: base\n      } : this._calculateBarValuePixels(i);\n      const ipixels = this._calculateBarIndexPixels(i, ruler);\n      const stack = (parsed._stacks || {})[vScale.axis];\n      const properties = {\n        horizontal,\n        base: vpixels.base,\n        enableBorderRadius: !stack || isFloatBar(parsed._custom) || index2 === stack._top || index2 === stack._bottom,\n        x: horizontal ? vpixels.head : ipixels.center,\n        y: horizontal ? ipixels.center : vpixels.head,\n        height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n        width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n      };\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? \"active\" : mode);\n      }\n      const options = properties.options || bars[i].options;\n      setBorderSkipped(properties, options, stack, index2);\n      setInflateAmount(properties, options, ruler.ratio);\n      this.updateElement(bars[i], i, properties, mode);\n    }\n  }\n  _getStacks(last, dataIndex) {\n    const { iScale } = this._cachedMeta;\n    const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta) => meta.controller.options.grouped);\n    const stacked = iScale.options.stacked;\n    const stacks = [];\n    const currentParsed = this._cachedMeta.controller.getParsed(dataIndex);\n    const iScaleValue = currentParsed && currentParsed[iScale.axis];\n    const skipNull = (meta) => {\n      const parsed = meta._parsed.find((item) => item[iScale.axis] === iScaleValue);\n      const val = parsed && parsed[meta.vScale.axis];\n      if (isNullOrUndef(val) || isNaN(val)) {\n        return true;\n      }\n    };\n    for (const meta of metasets) {\n      if (dataIndex !== void 0 && skipNull(meta)) {\n        continue;\n      }\n      if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === void 0 && meta.stack === void 0) {\n        stacks.push(meta.stack);\n      }\n      if (meta.index === last) {\n        break;\n      }\n    }\n    if (!stacks.length) {\n      stacks.push(void 0);\n    }\n    return stacks;\n  }\n  _getStackCount(index2) {\n    return this._getStacks(void 0, index2).length;\n  }\n  _getAxisCount() {\n    return this._getAxis().length;\n  }\n  getFirstScaleIdForIndexAxis() {\n    const scales2 = this.chart.scales;\n    const indexScaleId = this.chart.options.indexAxis;\n    return Object.keys(scales2).filter((key) => scales2[key].axis === indexScaleId).shift();\n  }\n  _getAxis() {\n    const axis = {};\n    const firstScaleAxisId = this.getFirstScaleIdForIndexAxis();\n    for (const dataset of this.chart.data.datasets) {\n      axis[valueOrDefault(this.chart.options.indexAxis === \"x\" ? dataset.xAxisID : dataset.yAxisID, firstScaleAxisId)] = true;\n    }\n    return Object.keys(axis);\n  }\n  _getStackIndex(datasetIndex, name, dataIndex) {\n    const stacks = this._getStacks(datasetIndex, dataIndex);\n    const index2 = name !== void 0 ? stacks.indexOf(name) : -1;\n    return index2 === -1 ? stacks.length - 1 : index2;\n  }\n  _getRuler() {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const pixels = [];\n    let i, ilen;\n    for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n      pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n    }\n    const barThickness = opts.barThickness;\n    const min = barThickness || computeMinSampleSize(meta);\n    return {\n      min,\n      pixels,\n      start: iScale._startPixel,\n      end: iScale._endPixel,\n      stackCount: this._getStackCount(),\n      scale: iScale,\n      grouped: opts.grouped,\n      ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n    };\n  }\n  _calculateBarValuePixels(index2) {\n    const { _cachedMeta: { vScale, _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength } } = this;\n    const actualBase = baseValue || 0;\n    const parsed = this.getParsed(index2);\n    const custom = parsed._custom;\n    const floating = isFloatBar(custom);\n    let value = parsed[vScale.axis];\n    let start = 0;\n    let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n    let head, size;\n    if (length !== value) {\n      start = length - value;\n      length = value;\n    }\n    if (floating) {\n      value = custom.barStart;\n      length = custom.barEnd - custom.barStart;\n      if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n        start = 0;\n      }\n      start += value;\n    }\n    const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n    let base = vScale.getPixelForValue(startValue);\n    if (this.chart.getDataVisibility(index2)) {\n      head = vScale.getPixelForValue(start + length);\n    } else {\n      head = base;\n    }\n    size = head - base;\n    if (Math.abs(size) < minBarLength) {\n      size = barSign(size, vScale, actualBase) * minBarLength;\n      if (value === actualBase) {\n        base -= size / 2;\n      }\n      const startPixel = vScale.getPixelForDecimal(0);\n      const endPixel = vScale.getPixelForDecimal(1);\n      const min = Math.min(startPixel, endPixel);\n      const max = Math.max(startPixel, endPixel);\n      base = Math.max(Math.min(base, max), min);\n      head = base + size;\n      if (_stacked && !floating) {\n        parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n      }\n    }\n    if (base === vScale.getPixelForValue(actualBase)) {\n      const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n      base += halfGrid;\n      size -= halfGrid;\n    }\n    return {\n      size,\n      base,\n      head,\n      center: head + size / 2\n    };\n  }\n  _calculateBarIndexPixels(index2, ruler) {\n    const scale = ruler.scale;\n    const options = this.options;\n    const skipNull = options.skipNull;\n    const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n    let center, size;\n    const axisCount = this._getAxisCount();\n    if (ruler.grouped) {\n      const stackCount = skipNull ? this._getStackCount(index2) : ruler.stackCount;\n      const range = options.barThickness === \"flex\" ? computeFlexCategoryTraits(index2, ruler, options, stackCount * axisCount) : computeFitCategoryTraits(index2, ruler, options, stackCount * axisCount);\n      const axisID = this.chart.options.indexAxis === \"x\" ? this.getDataset().xAxisID : this.getDataset().yAxisID;\n      const axisNumber = this._getAxis().indexOf(valueOrDefault(axisID, this.getFirstScaleIdForIndexAxis()));\n      const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index2 : void 0) + axisNumber;\n      center = range.start + range.chunk * stackIndex + range.chunk / 2;\n      size = Math.min(maxBarThickness, range.chunk * range.ratio);\n    } else {\n      center = scale.getPixelForValue(this.getParsed(index2)[scale.axis], index2);\n      size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n    }\n    return {\n      base: center - size / 2,\n      head: center + size / 2,\n      center,\n      size\n    };\n  }\n  draw() {\n    const meta = this._cachedMeta;\n    const vScale = meta.vScale;\n    const rects = meta.data;\n    const ilen = rects.length;\n    let i = 0;\n    for (; i < ilen; ++i) {\n      if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) {\n        rects[i].draw(this._ctx);\n      }\n    }\n  }\n};\n__publicField(BarController, \"id\", \"bar\");\n__publicField(BarController, \"defaults\", {\n  datasetElementType: false,\n  dataElementType: \"bar\",\n  categoryPercentage: 0.8,\n  barPercentage: 0.9,\n  grouped: true,\n  animations: {\n    numbers: {\n      type: \"number\",\n      properties: [\n        \"x\",\n        \"y\",\n        \"base\",\n        \"width\",\n        \"height\"\n      ]\n    }\n  }\n});\n__publicField(BarController, \"overrides\", {\n  scales: {\n    _index_: {\n      type: \"category\",\n      offset: true,\n      grid: {\n        offset: true\n      }\n    },\n    _value_: {\n      type: \"linear\",\n      beginAtZero: true\n    }\n  }\n});\nvar BubbleController = class extends DatasetController {\n  initialize() {\n    this.enableOptionSharing = true;\n    super.initialize();\n  }\n  parsePrimitiveData(meta, data, start, count) {\n    const parsed = super.parsePrimitiveData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n    }\n    return parsed;\n  }\n  parseArrayData(meta, data, start, count) {\n    const parsed = super.parseArrayData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n  parseObjectData(meta, data, start, count) {\n    const parsed = super.parseObjectData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n  getMaxOverflow() {\n    const data = this._cachedMeta.data;\n    let max = 0;\n    for (let i = data.length - 1; i >= 0; --i) {\n      max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n    }\n    return max > 0 && max;\n  }\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const labels = this.chart.data.labels || [];\n    const { xScale, yScale } = meta;\n    const parsed = this.getParsed(index2);\n    const x = xScale.getLabelForValue(parsed.x);\n    const y = yScale.getLabelForValue(parsed.y);\n    const r = parsed._custom;\n    return {\n      label: labels[index2] || \"\",\n      value: \"(\" + x + \", \" + y + (r ? \", \" + r : \"\") + \")\"\n    };\n  }\n  update(mode) {\n    const points = this._cachedMeta.data;\n    this.updateElements(points, 0, points.length, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const reset = mode === \"reset\";\n    const { iScale, vScale } = this._cachedMeta;\n    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const parsed = !reset && this.getParsed(i);\n      const properties = {};\n      const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n      const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n      properties.skip = isNaN(iPixel) || isNaN(vPixel);\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n        if (reset) {\n          properties.options.radius = 0;\n        }\n      }\n      this.updateElement(point, i, properties, mode);\n    }\n  }\n  resolveDataElementOptions(index2, mode) {\n    const parsed = this.getParsed(index2);\n    let values = super.resolveDataElementOptions(index2, mode);\n    if (values.$shared) {\n      values = Object.assign({}, values, {\n        $shared: false\n      });\n    }\n    const radius = values.radius;\n    if (mode !== \"active\") {\n      values.radius = 0;\n    }\n    values.radius += valueOrDefault(parsed && parsed._custom, radius);\n    return values;\n  }\n};\n__publicField(BubbleController, \"id\", \"bubble\");\n__publicField(BubbleController, \"defaults\", {\n  datasetElementType: false,\n  dataElementType: \"point\",\n  animations: {\n    numbers: {\n      type: \"number\",\n      properties: [\n        \"x\",\n        \"y\",\n        \"borderWidth\",\n        \"radius\"\n      ]\n    }\n  }\n});\n__publicField(BubbleController, \"overrides\", {\n  scales: {\n    x: {\n      type: \"linear\"\n    },\n    y: {\n      type: \"linear\"\n    }\n  }\n});\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n  let ratioX = 1;\n  let ratioY = 1;\n  let offsetX = 0;\n  let offsetY = 0;\n  if (circumference < TAU) {\n    const startAngle = rotation;\n    const endAngle = startAngle + circumference;\n    const startX = Math.cos(startAngle);\n    const startY = Math.sin(startAngle);\n    const endX = Math.cos(endAngle);\n    const endY = Math.sin(endAngle);\n    const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n    const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n    const maxX = calcMax(0, startX, endX);\n    const maxY = calcMax(HALF_PI, startY, endY);\n    const minX = calcMin(PI, startX, endX);\n    const minY = calcMin(PI + HALF_PI, startY, endY);\n    ratioX = (maxX - minX) / 2;\n    ratioY = (maxY - minY) / 2;\n    offsetX = -(maxX + minX) / 2;\n    offsetY = -(maxY + minY) / 2;\n  }\n  return {\n    ratioX,\n    ratioY,\n    offsetX,\n    offsetY\n  };\n}\nvar DoughnutController = class extends DatasetController {\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n    this.enableOptionSharing = true;\n    this.innerRadius = void 0;\n    this.outerRadius = void 0;\n    this.offsetX = void 0;\n    this.offsetY = void 0;\n  }\n  linkScales() {\n  }\n  parse(start, count) {\n    const data = this.getDataset().data;\n    const meta = this._cachedMeta;\n    if (this._parsing === false) {\n      meta._parsed = data;\n    } else {\n      let getter = (i2) => +data[i2];\n      if (isObject(data[start])) {\n        const { key = \"value\" } = this._parsing;\n        getter = (i2) => +resolveObjectKey(data[i2], key);\n      }\n      let i, ilen;\n      for (i = start, ilen = start + count; i < ilen; ++i) {\n        meta._parsed[i] = getter(i);\n      }\n    }\n  }\n  _getRotation() {\n    return toRadians(this.options.rotation - 90);\n  }\n  _getCircumference() {\n    return toRadians(this.options.circumference);\n  }\n  _getRotationExtents() {\n    let min = TAU;\n    let max = -TAU;\n    for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n      if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n        const controller = this.chart.getDatasetMeta(i).controller;\n        const rotation = controller._getRotation();\n        const circumference = controller._getCircumference();\n        min = Math.min(min, rotation);\n        max = Math.max(max, rotation + circumference);\n      }\n    }\n    return {\n      rotation: min,\n      circumference: max - min\n    };\n  }\n  update(mode) {\n    const chart = this.chart;\n    const { chartArea } = chart;\n    const meta = this._cachedMeta;\n    const arcs = meta.data;\n    const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n    const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n    const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n    const chartWeight = this._getRingWeight(this.index);\n    const { circumference, rotation } = this._getRotationExtents();\n    const { ratioX, ratioY, offsetX, offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n    const maxWidth = (chartArea.width - spacing) / ratioX;\n    const maxHeight = (chartArea.height - spacing) / ratioY;\n    const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n    const outerRadius = toDimension(this.options.radius, maxRadius);\n    const innerRadius = Math.max(outerRadius * cutout, 0);\n    const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n    this.offsetX = offsetX * outerRadius;\n    this.offsetY = offsetY * outerRadius;\n    meta.total = this.calculateTotal();\n    this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n    this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n  _circumference(i, reset) {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const circumference = this._getCircumference();\n    if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n      return 0;\n    }\n    return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n  }\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === \"reset\";\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const centerX = (chartArea.left + chartArea.right) / 2;\n    const centerY = (chartArea.top + chartArea.bottom) / 2;\n    const animateScale = reset && animationOpts.animateScale;\n    const innerRadius = animateScale ? 0 : this.innerRadius;\n    const outerRadius = animateScale ? 0 : this.outerRadius;\n    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);\n    let startAngle = this._getRotation();\n    let i;\n    for (i = 0; i < start; ++i) {\n      startAngle += this._circumference(i, reset);\n    }\n    for (i = start; i < start + count; ++i) {\n      const circumference = this._circumference(i, reset);\n      const arc = arcs[i];\n      const properties = {\n        x: centerX + this.offsetX,\n        y: centerY + this.offsetY,\n        startAngle,\n        endAngle: startAngle + circumference,\n        circumference,\n        outerRadius,\n        innerRadius\n      };\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? \"active\" : mode);\n      }\n      startAngle += circumference;\n      this.updateElement(arc, i, properties, mode);\n    }\n  }\n  calculateTotal() {\n    const meta = this._cachedMeta;\n    const metaData = meta.data;\n    let total = 0;\n    let i;\n    for (i = 0; i < metaData.length; i++) {\n      const value = meta._parsed[i];\n      if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n        total += Math.abs(value);\n      }\n    }\n    return total;\n  }\n  calculateCircumference(value) {\n    const total = this._cachedMeta.total;\n    if (total > 0 && !isNaN(value)) {\n      return TAU * (Math.abs(value) / total);\n    }\n    return 0;\n  }\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index2], chart.options.locale);\n    return {\n      label: labels[index2] || \"\",\n      value\n    };\n  }\n  getMaxBorderWidth(arcs) {\n    let max = 0;\n    const chart = this.chart;\n    let i, ilen, meta, controller, options;\n    if (!arcs) {\n      for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n        if (chart.isDatasetVisible(i)) {\n          meta = chart.getDatasetMeta(i);\n          arcs = meta.data;\n          controller = meta.controller;\n          break;\n        }\n      }\n    }\n    if (!arcs) {\n      return 0;\n    }\n    for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n      options = controller.resolveDataElementOptions(i);\n      if (options.borderAlign !== \"inner\") {\n        max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n      }\n    }\n    return max;\n  }\n  getMaxOffset(arcs) {\n    let max = 0;\n    for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n      const options = this.resolveDataElementOptions(i);\n      max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n    }\n    return max;\n  }\n  _getRingWeightOffset(datasetIndex) {\n    let ringWeightOffset = 0;\n    for (let i = 0; i < datasetIndex; ++i) {\n      if (this.chart.isDatasetVisible(i)) {\n        ringWeightOffset += this._getRingWeight(i);\n      }\n    }\n    return ringWeightOffset;\n  }\n  _getRingWeight(datasetIndex) {\n    return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n  }\n  _getVisibleDatasetWeightTotal() {\n    return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n  }\n};\n__publicField(DoughnutController, \"id\", \"doughnut\");\n__publicField(DoughnutController, \"defaults\", {\n  datasetElementType: false,\n  dataElementType: \"arc\",\n  animation: {\n    animateRotate: true,\n    animateScale: false\n  },\n  animations: {\n    numbers: {\n      type: \"number\",\n      properties: [\n        \"circumference\",\n        \"endAngle\",\n        \"innerRadius\",\n        \"outerRadius\",\n        \"startAngle\",\n        \"x\",\n        \"y\",\n        \"offset\",\n        \"borderWidth\",\n        \"spacing\"\n      ]\n    }\n  },\n  cutout: \"50%\",\n  rotation: 0,\n  circumference: 360,\n  radius: \"100%\",\n  spacing: 0,\n  indexAxis: \"r\"\n});\n__publicField(DoughnutController, \"descriptors\", {\n  _scriptable: (name) => name !== \"spacing\",\n  _indexable: (name) => name !== \"spacing\" && !name.startsWith(\"borderDash\") && !name.startsWith(\"hoverBorderDash\")\n});\n__publicField(DoughnutController, \"overrides\", {\n  aspectRatio: 1,\n  plugins: {\n    legend: {\n      labels: {\n        generateLabels(chart) {\n          const data = chart.data;\n          const { labels: { pointStyle, textAlign, color: color2, useBorderRadius, borderRadius } } = chart.legend.options;\n          if (data.labels.length && data.datasets.length) {\n            return data.labels.map((label, i) => {\n              const meta = chart.getDatasetMeta(0);\n              const style = meta.controller.getStyle(i);\n              return {\n                text: label,\n                fillStyle: style.backgroundColor,\n                fontColor: color2,\n                hidden: !chart.getDataVisibility(i),\n                lineDash: style.borderDash,\n                lineDashOffset: style.borderDashOffset,\n                lineJoin: style.borderJoinStyle,\n                lineWidth: style.borderWidth,\n                strokeStyle: style.borderColor,\n                textAlign,\n                pointStyle,\n                borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n                index: i\n              };\n            });\n          }\n          return [];\n        }\n      },\n      onClick(e, legendItem, legend) {\n        legend.chart.toggleDataVisibility(legendItem.index);\n        legend.chart.update();\n      }\n    }\n  }\n});\nvar LineController = class extends DatasetController {\n  initialize() {\n    this.enableOptionSharing = true;\n    this.supportsDecimation = true;\n    super.initialize();\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    const { dataset: line, data: points = [], _dataset } = meta;\n    const animationsDisabled = this.chart._animationsDisabled;\n    let { start, count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n    this._drawStart = start;\n    this._drawCount = count;\n    if (_scaleRangesChanged(meta)) {\n      start = 0;\n      count = points.length;\n    }\n    line._chart = this.chart;\n    line._datasetIndex = this.index;\n    line._decimated = !!_dataset._decimated;\n    line.points = points;\n    const options = this.resolveDatasetElementOptions(mode);\n    if (!this.options.showLine) {\n      options.borderWidth = 0;\n    }\n    options.segment = this.options.segment;\n    this.updateElement(line, void 0, {\n      animated: !animationsDisabled,\n      options\n    }, mode);\n    this.updateElements(points, start, count, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const reset = mode === \"reset\";\n    const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;\n    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const { spanGaps, segment } = this.options;\n    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n    const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n    const end = start + count;\n    const pointsCount = points.length;\n    let prevParsed = start > 0 && this.getParsed(start - 1);\n    for (let i = 0; i < pointsCount; ++i) {\n      const point = points[i];\n      const properties = directUpdate ? point : {};\n      if (i < start || i >= end) {\n        properties.skip = true;\n        continue;\n      }\n      const parsed = this.getParsed(i);\n      const nullData = isNullOrUndef(parsed[vAxis]);\n      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n      properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n      if (segment) {\n        properties.parsed = parsed;\n        properties.raw = _dataset.data[i];\n      }\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n      }\n      if (!directUpdate) {\n        this.updateElement(point, i, properties, mode);\n      }\n      prevParsed = parsed;\n    }\n  }\n  getMaxOverflow() {\n    const meta = this._cachedMeta;\n    const dataset = meta.dataset;\n    const border = dataset.options && dataset.options.borderWidth || 0;\n    const data = meta.data || [];\n    if (!data.length) {\n      return border;\n    }\n    const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n    return Math.max(border, firstPoint, lastPoint) / 2;\n  }\n  draw() {\n    const meta = this._cachedMeta;\n    meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n    super.draw();\n  }\n};\n__publicField(LineController, \"id\", \"line\");\n__publicField(LineController, \"defaults\", {\n  datasetElementType: \"line\",\n  dataElementType: \"point\",\n  showLine: true,\n  spanGaps: false\n});\n__publicField(LineController, \"overrides\", {\n  scales: {\n    _index_: {\n      type: \"category\"\n    },\n    _value_: {\n      type: \"linear\"\n    }\n  }\n});\nvar PolarAreaController = class extends DatasetController {\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n    this.innerRadius = void 0;\n    this.outerRadius = void 0;\n  }\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index2].r, chart.options.locale);\n    return {\n      label: labels[index2] || \"\",\n      value\n    };\n  }\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n  update(mode) {\n    const arcs = this._cachedMeta.data;\n    this._updateRadius();\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n  getMinMax() {\n    const meta = this._cachedMeta;\n    const range = {\n      min: Number.POSITIVE_INFINITY,\n      max: Number.NEGATIVE_INFINITY\n    };\n    meta.data.forEach((element, index2) => {\n      const parsed = this.getParsed(index2).r;\n      if (!isNaN(parsed) && this.chart.getDataVisibility(index2)) {\n        if (parsed < range.min) {\n          range.min = parsed;\n        }\n        if (parsed > range.max) {\n          range.max = parsed;\n        }\n      }\n    });\n    return range;\n  }\n  _updateRadius() {\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n    const outerRadius = Math.max(minSize / 2, 0);\n    const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n    const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n    this.outerRadius = outerRadius - radiusLength * this.index;\n    this.innerRadius = this.outerRadius - radiusLength;\n  }\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === \"reset\";\n    const chart = this.chart;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const scale = this._cachedMeta.rScale;\n    const centerX = scale.xCenter;\n    const centerY = scale.yCenter;\n    const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n    let angle = datasetStartAngle;\n    let i;\n    const defaultAngle = 360 / this.countVisibleElements();\n    for (i = 0; i < start; ++i) {\n      angle += this._computeAngle(i, mode, defaultAngle);\n    }\n    for (i = start; i < start + count; i++) {\n      const arc = arcs[i];\n      let startAngle = angle;\n      let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n      let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n      angle = endAngle;\n      if (reset) {\n        if (animationOpts.animateScale) {\n          outerRadius = 0;\n        }\n        if (animationOpts.animateRotate) {\n          startAngle = endAngle = datasetStartAngle;\n        }\n      }\n      const properties = {\n        x: centerX,\n        y: centerY,\n        innerRadius: 0,\n        outerRadius,\n        startAngle,\n        endAngle,\n        options: this.resolveDataElementOptions(i, arc.active ? \"active\" : mode)\n      };\n      this.updateElement(arc, i, properties, mode);\n    }\n  }\n  countVisibleElements() {\n    const meta = this._cachedMeta;\n    let count = 0;\n    meta.data.forEach((element, index2) => {\n      if (!isNaN(this.getParsed(index2).r) && this.chart.getDataVisibility(index2)) {\n        count++;\n      }\n    });\n    return count;\n  }\n  _computeAngle(index2, mode, defaultAngle) {\n    return this.chart.getDataVisibility(index2) ? toRadians(this.resolveDataElementOptions(index2, mode).angle || defaultAngle) : 0;\n  }\n};\n__publicField(PolarAreaController, \"id\", \"polarArea\");\n__publicField(PolarAreaController, \"defaults\", {\n  dataElementType: \"arc\",\n  animation: {\n    animateRotate: true,\n    animateScale: true\n  },\n  animations: {\n    numbers: {\n      type: \"number\",\n      properties: [\n        \"x\",\n        \"y\",\n        \"startAngle\",\n        \"endAngle\",\n        \"innerRadius\",\n        \"outerRadius\"\n      ]\n    }\n  },\n  indexAxis: \"r\",\n  startAngle: 0\n});\n__publicField(PolarAreaController, \"overrides\", {\n  aspectRatio: 1,\n  plugins: {\n    legend: {\n      labels: {\n        generateLabels(chart) {\n          const data = chart.data;\n          if (data.labels.length && data.datasets.length) {\n            const { labels: { pointStyle, color: color2 } } = chart.legend.options;\n            return data.labels.map((label, i) => {\n              const meta = chart.getDatasetMeta(0);\n              const style = meta.controller.getStyle(i);\n              return {\n                text: label,\n                fillStyle: style.backgroundColor,\n                strokeStyle: style.borderColor,\n                fontColor: color2,\n                lineWidth: style.borderWidth,\n                pointStyle,\n                hidden: !chart.getDataVisibility(i),\n                index: i\n              };\n            });\n          }\n          return [];\n        }\n      },\n      onClick(e, legendItem, legend) {\n        legend.chart.toggleDataVisibility(legendItem.index);\n        legend.chart.update();\n      }\n    }\n  },\n  scales: {\n    r: {\n      type: \"radialLinear\",\n      angleLines: {\n        display: false\n      },\n      beginAtZero: true,\n      grid: {\n        circular: true\n      },\n      pointLabels: {\n        display: false\n      },\n      startAngle: 0\n    }\n  }\n});\nvar PieController = class extends DoughnutController {\n};\n__publicField(PieController, \"id\", \"pie\");\n__publicField(PieController, \"defaults\", {\n  cutout: 0,\n  rotation: 0,\n  circumference: 360,\n  radius: \"100%\"\n});\nvar RadarController = class extends DatasetController {\n  getLabelAndValue(index2) {\n    const vScale = this._cachedMeta.vScale;\n    const parsed = this.getParsed(index2);\n    return {\n      label: vScale.getLabels()[index2],\n      value: \"\" + vScale.getLabelForValue(parsed[vScale.axis])\n    };\n  }\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    const line = meta.dataset;\n    const points = meta.data || [];\n    const labels = meta.iScale.getLabels();\n    line.points = points;\n    if (mode !== \"resize\") {\n      const options = this.resolveDatasetElementOptions(mode);\n      if (!this.options.showLine) {\n        options.borderWidth = 0;\n      }\n      const properties = {\n        _loop: true,\n        _fullLoop: labels.length === points.length,\n        options\n      };\n      this.updateElement(line, void 0, properties, mode);\n    }\n    this.updateElements(points, 0, points.length, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const scale = this._cachedMeta.rScale;\n    const reset = mode === \"reset\";\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const options = this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n      const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n      const x = reset ? scale.xCenter : pointPosition.x;\n      const y = reset ? scale.yCenter : pointPosition.y;\n      const properties = {\n        x,\n        y,\n        angle: pointPosition.angle,\n        skip: isNaN(x) || isNaN(y),\n        options\n      };\n      this.updateElement(point, i, properties, mode);\n    }\n  }\n};\n__publicField(RadarController, \"id\", \"radar\");\n__publicField(RadarController, \"defaults\", {\n  datasetElementType: \"line\",\n  dataElementType: \"point\",\n  indexAxis: \"r\",\n  showLine: true,\n  elements: {\n    line: {\n      fill: \"start\"\n    }\n  }\n});\n__publicField(RadarController, \"overrides\", {\n  aspectRatio: 1,\n  scales: {\n    r: {\n      type: \"radialLinear\"\n    }\n  }\n});\nvar ScatterController = class extends DatasetController {\n  getLabelAndValue(index2) {\n    const meta = this._cachedMeta;\n    const labels = this.chart.data.labels || [];\n    const { xScale, yScale } = meta;\n    const parsed = this.getParsed(index2);\n    const x = xScale.getLabelForValue(parsed.x);\n    const y = yScale.getLabelForValue(parsed.y);\n    return {\n      label: labels[index2] || \"\",\n      value: \"(\" + x + \", \" + y + \")\"\n    };\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    const { data: points = [] } = meta;\n    const animationsDisabled = this.chart._animationsDisabled;\n    let { start, count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n    this._drawStart = start;\n    this._drawCount = count;\n    if (_scaleRangesChanged(meta)) {\n      start = 0;\n      count = points.length;\n    }\n    if (this.options.showLine) {\n      if (!this.datasetElementType) {\n        this.addElements();\n      }\n      const { dataset: line, _dataset } = meta;\n      line._chart = this.chart;\n      line._datasetIndex = this.index;\n      line._decimated = !!_dataset._decimated;\n      line.points = points;\n      const options = this.resolveDatasetElementOptions(mode);\n      options.segment = this.options.segment;\n      this.updateElement(line, void 0, {\n        animated: !animationsDisabled,\n        options\n      }, mode);\n    } else if (this.datasetElementType) {\n      delete meta.dataset;\n      this.datasetElementType = false;\n    }\n    this.updateElements(points, start, count, mode);\n  }\n  addElements() {\n    const { showLine } = this.options;\n    if (!this.datasetElementType && showLine) {\n      this.datasetElementType = this.chart.registry.getElement(\"line\");\n    }\n    super.addElements();\n  }\n  updateElements(points, start, count, mode) {\n    const reset = mode === \"reset\";\n    const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const { spanGaps, segment } = this.options;\n    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n    const directUpdate = this.chart._animationsDisabled || reset || mode === \"none\";\n    let prevParsed = start > 0 && this.getParsed(start - 1);\n    for (let i = start; i < start + count; ++i) {\n      const point = points[i];\n      const parsed = this.getParsed(i);\n      const properties = directUpdate ? point : {};\n      const nullData = isNullOrUndef(parsed[vAxis]);\n      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n      properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n      if (segment) {\n        properties.parsed = parsed;\n        properties.raw = _dataset.data[i];\n      }\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? \"active\" : mode);\n      }\n      if (!directUpdate) {\n        this.updateElement(point, i, properties, mode);\n      }\n      prevParsed = parsed;\n    }\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n  }\n  getMaxOverflow() {\n    const meta = this._cachedMeta;\n    const data = meta.data || [];\n    if (!this.options.showLine) {\n      let max = 0;\n      for (let i = data.length - 1; i >= 0; --i) {\n        max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n      }\n      return max > 0 && max;\n    }\n    const dataset = meta.dataset;\n    const border = dataset.options && dataset.options.borderWidth || 0;\n    if (!data.length) {\n      return border;\n    }\n    const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n    return Math.max(border, firstPoint, lastPoint) / 2;\n  }\n};\n__publicField(ScatterController, \"id\", \"scatter\");\n__publicField(ScatterController, \"defaults\", {\n  datasetElementType: false,\n  dataElementType: \"point\",\n  showLine: false,\n  fill: false\n});\n__publicField(ScatterController, \"overrides\", {\n  interaction: {\n    mode: \"point\"\n  },\n  scales: {\n    x: {\n      type: \"linear\"\n    },\n    y: {\n      type: \"linear\"\n    }\n  }\n});\nvar controllers = /* @__PURE__ */ Object.freeze({\n  __proto__: null,\n  BarController,\n  BubbleController,\n  DoughnutController,\n  LineController,\n  PieController,\n  PolarAreaController,\n  RadarController,\n  ScatterController\n});\nfunction abstract() {\n  throw new Error(\"This method is not implemented: Check that a complete date adapter is provided.\");\n}\nvar DateAdapterBase = class _DateAdapterBase {\n  constructor(options) {\n    __publicField(this, \"options\");\n    this.options = options || {};\n  }\n  /**\n  * Override default date adapter methods.\n  * Accepts type parameter to define options type.\n  * @example\n  * Chart._adapters._date.override<{myAdapterOption: string}>({\n  *   init() {\n  *     console.log(this.options.myAdapterOption);\n  *   }\n  * })\n  */\n  static override(members) {\n    Object.assign(_DateAdapterBase.prototype, members);\n  }\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  init() {\n  }\n  formats() {\n    return abstract();\n  }\n  parse() {\n    return abstract();\n  }\n  format() {\n    return abstract();\n  }\n  add() {\n    return abstract();\n  }\n  diff() {\n    return abstract();\n  }\n  startOf() {\n    return abstract();\n  }\n  endOf() {\n    return abstract();\n  }\n};\nvar adapters = {\n  _date: DateAdapterBase\n};\nfunction binarySearch(metaset, axis, value, intersect) {\n  const { controller, data, _sorted } = metaset;\n  const iScale = controller._cachedMeta.iScale;\n  const spanGaps = metaset.dataset ? metaset.dataset.options ? metaset.dataset.options.spanGaps : null : null;\n  if (iScale && axis === iScale.axis && axis !== \"r\" && _sorted && data.length) {\n    const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n    if (!intersect) {\n      const result = lookupMethod(data, axis, value);\n      if (spanGaps) {\n        const { vScale } = controller._cachedMeta;\n        const { _parsed } = metaset;\n        const distanceToDefinedLo = _parsed.slice(0, result.lo + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis]));\n        result.lo -= Math.max(0, distanceToDefinedLo);\n        const distanceToDefinedHi = _parsed.slice(result.hi).findIndex((point) => !isNullOrUndef(point[vScale.axis]));\n        result.hi += Math.max(0, distanceToDefinedHi);\n      }\n      return result;\n    } else if (controller._sharedOptions) {\n      const el = data[0];\n      const range = typeof el.getRange === \"function\" && el.getRange(axis);\n      if (range) {\n        const start = lookupMethod(data, axis, value - range);\n        const end = lookupMethod(data, axis, value + range);\n        return {\n          lo: start.lo,\n          hi: end.hi\n        };\n      }\n    }\n  }\n  return {\n    lo: 0,\n    hi: data.length - 1\n  };\n}\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n  const metasets = chart.getSortedVisibleDatasetMetas();\n  const value = position[axis];\n  for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n    const { index: index2, data } = metasets[i];\n    const { lo, hi } = binarySearch(metasets[i], axis, value, intersect);\n    for (let j = lo; j <= hi; ++j) {\n      const element = data[j];\n      if (!element.skip) {\n        handler(element, index2, j);\n      }\n    }\n  }\n}\nfunction getDistanceMetricForAxis(axis) {\n  const useX = axis.indexOf(\"x\") !== -1;\n  const useY = axis.indexOf(\"y\") !== -1;\n  return function(pt1, pt2) {\n    const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n    const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n    return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n  };\n}\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n  const items = [];\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return items;\n  }\n  const evaluationFunc = function(element, datasetIndex, index2) {\n    if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n      return;\n    }\n    if (element.inRange(position.x, position.y, useFinalPosition)) {\n      items.push({\n        element,\n        datasetIndex,\n        index: index2\n      });\n    }\n  };\n  evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n  return items;\n}\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n  let items = [];\n  function evaluationFunc(element, datasetIndex, index2) {\n    const { startAngle, endAngle } = element.getProps([\n      \"startAngle\",\n      \"endAngle\"\n    ], useFinalPosition);\n    const { angle } = getAngleFromPoint(element, {\n      x: position.x,\n      y: position.y\n    });\n    if (_angleBetween(angle, startAngle, endAngle)) {\n      items.push({\n        element,\n        datasetIndex,\n        index: index2\n      });\n    }\n  }\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  let items = [];\n  const distanceMetric = getDistanceMetricForAxis(axis);\n  let minDistance = Number.POSITIVE_INFINITY;\n  function evaluationFunc(element, datasetIndex, index2) {\n    const inRange2 = element.inRange(position.x, position.y, useFinalPosition);\n    if (intersect && !inRange2) {\n      return;\n    }\n    const center = element.getCenterPoint(useFinalPosition);\n    const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n    if (!pointInArea && !inRange2) {\n      return;\n    }\n    const distance = distanceMetric(position, center);\n    if (distance < minDistance) {\n      items = [\n        {\n          element,\n          datasetIndex,\n          index: index2\n        }\n      ];\n      minDistance = distance;\n    } else if (distance === minDistance) {\n      items.push({\n        element,\n        datasetIndex,\n        index: index2\n      });\n    }\n  }\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return [];\n  }\n  return axis === \"r\" && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n  const items = [];\n  const rangeMethod = axis === \"x\" ? \"inXRange\" : \"inYRange\";\n  let intersectsItem = false;\n  evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index2) => {\n    if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {\n      items.push({\n        element,\n        datasetIndex,\n        index: index2\n      });\n      intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n    }\n  });\n  if (intersect && !intersectsItem) {\n    return [];\n  }\n  return items;\n}\nvar Interaction = {\n  evaluateInteractionItems,\n  modes: {\n    index(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || \"x\";\n      const includeInvisible = options.includeInvisible || false;\n      const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n      const elements2 = [];\n      if (!items.length) {\n        return [];\n      }\n      chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n        const index2 = items[0].index;\n        const element = meta.data[index2];\n        if (element && !element.skip) {\n          elements2.push({\n            element,\n            datasetIndex: meta.index,\n            index: index2\n          });\n        }\n      });\n      return elements2;\n    },\n    dataset(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || \"xy\";\n      const includeInvisible = options.includeInvisible || false;\n      let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n      if (items.length > 0) {\n        const datasetIndex = items[0].datasetIndex;\n        const data = chart.getDatasetMeta(datasetIndex).data;\n        items = [];\n        for (let i = 0; i < data.length; ++i) {\n          items.push({\n            element: data[i],\n            datasetIndex,\n            index: i\n          });\n        }\n      }\n      return items;\n    },\n    point(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || \"xy\";\n      const includeInvisible = options.includeInvisible || false;\n      return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n    },\n    nearest(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || \"xy\";\n      const includeInvisible = options.includeInvisible || false;\n      return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n    },\n    x(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, \"x\", options.intersect, useFinalPosition);\n    },\n    y(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, \"y\", options.intersect, useFinalPosition);\n    }\n  }\n};\nvar STATIC_POSITIONS = [\n  \"left\",\n  \"top\",\n  \"right\",\n  \"bottom\"\n];\nfunction filterByPosition(array, position) {\n  return array.filter((v) => v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n  return array.filter((v) => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n  return array.sort((a, b) => {\n    const v0 = reverse ? b : a;\n    const v1 = reverse ? a : b;\n    return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n  });\n}\nfunction wrapBoxes(boxes) {\n  const layoutBoxes = [];\n  let i, ilen, box, pos, stack, stackWeight;\n  for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n    box = boxes[i];\n    ({ position: pos, options: { stack, stackWeight = 1 } } = box);\n    layoutBoxes.push({\n      index: i,\n      box,\n      pos,\n      horizontal: box.isHorizontal(),\n      weight: box.weight,\n      stack: stack && pos + stack,\n      stackWeight\n    });\n  }\n  return layoutBoxes;\n}\nfunction buildStacks(layouts2) {\n  const stacks = {};\n  for (const wrap of layouts2) {\n    const { stack, pos, stackWeight } = wrap;\n    if (!stack || !STATIC_POSITIONS.includes(pos)) {\n      continue;\n    }\n    const _stack = stacks[stack] || (stacks[stack] = {\n      count: 0,\n      placed: 0,\n      weight: 0,\n      size: 0\n    });\n    _stack.count++;\n    _stack.weight += stackWeight;\n  }\n  return stacks;\n}\nfunction setLayoutDims(layouts2, params) {\n  const stacks = buildStacks(layouts2);\n  const { vBoxMaxWidth, hBoxMaxHeight } = params;\n  let i, ilen, layout;\n  for (i = 0, ilen = layouts2.length; i < ilen; ++i) {\n    layout = layouts2[i];\n    const { fullSize } = layout.box;\n    const stack = stacks[layout.stack];\n    const factor = stack && layout.stackWeight / stack.weight;\n    if (layout.horizontal) {\n      layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n      layout.height = hBoxMaxHeight;\n    } else {\n      layout.width = vBoxMaxWidth;\n      layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n    }\n  }\n  return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n  const layoutBoxes = wrapBoxes(boxes);\n  const fullSize = sortByWeight(layoutBoxes.filter((wrap) => wrap.box.fullSize), true);\n  const left = sortByWeight(filterByPosition(layoutBoxes, \"left\"), true);\n  const right = sortByWeight(filterByPosition(layoutBoxes, \"right\"));\n  const top = sortByWeight(filterByPosition(layoutBoxes, \"top\"), true);\n  const bottom = sortByWeight(filterByPosition(layoutBoxes, \"bottom\"));\n  const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, \"x\");\n  const centerVertical = filterDynamicPositionByAxis(layoutBoxes, \"y\");\n  return {\n    fullSize,\n    leftAndTop: left.concat(top),\n    rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n    chartArea: filterByPosition(layoutBoxes, \"chartArea\"),\n    vertical: left.concat(right).concat(centerVertical),\n    horizontal: top.concat(bottom).concat(centerHorizontal)\n  };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n  return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n  maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n  maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n  maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n  maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n  const { pos, box } = layout;\n  const maxPadding = chartArea.maxPadding;\n  if (!isObject(pos)) {\n    if (layout.size) {\n      chartArea[pos] -= layout.size;\n    }\n    const stack = stacks[layout.stack] || {\n      size: 0,\n      count: 1\n    };\n    stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n    layout.size = stack.size / stack.count;\n    chartArea[pos] += layout.size;\n  }\n  if (box.getPadding) {\n    updateMaxPadding(maxPadding, box.getPadding());\n  }\n  const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, \"left\", \"right\"));\n  const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, \"top\", \"bottom\"));\n  const widthChanged = newWidth !== chartArea.w;\n  const heightChanged = newHeight !== chartArea.h;\n  chartArea.w = newWidth;\n  chartArea.h = newHeight;\n  return layout.horizontal ? {\n    same: widthChanged,\n    other: heightChanged\n  } : {\n    same: heightChanged,\n    other: widthChanged\n  };\n}\nfunction handleMaxPadding(chartArea) {\n  const maxPadding = chartArea.maxPadding;\n  function updatePos(pos) {\n    const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n    chartArea[pos] += change;\n    return change;\n  }\n  chartArea.y += updatePos(\"top\");\n  chartArea.x += updatePos(\"left\");\n  updatePos(\"right\");\n  updatePos(\"bottom\");\n}\nfunction getMargins(horizontal, chartArea) {\n  const maxPadding = chartArea.maxPadding;\n  function marginForPositions(positions2) {\n    const margin = {\n      left: 0,\n      top: 0,\n      right: 0,\n      bottom: 0\n    };\n    positions2.forEach((pos) => {\n      margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n    });\n    return margin;\n  }\n  return horizontal ? marginForPositions([\n    \"left\",\n    \"right\"\n  ]) : marginForPositions([\n    \"top\",\n    \"bottom\"\n  ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n  const refitBoxes = [];\n  let i, ilen, layout, box, refit, changed;\n  for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n    layout = boxes[i];\n    box = layout.box;\n    box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n    const { same, other } = updateDims(chartArea, params, layout, stacks);\n    refit |= same && refitBoxes.length;\n    changed = changed || other;\n    if (!box.fullSize) {\n      refitBoxes.push(layout);\n    }\n  }\n  return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n  box.top = top;\n  box.left = left;\n  box.right = left + width;\n  box.bottom = top + height;\n  box.width = width;\n  box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n  const userPadding = params.padding;\n  let { x, y } = chartArea;\n  for (const layout of boxes) {\n    const box = layout.box;\n    const stack = stacks[layout.stack] || {\n      count: 1,\n      placed: 0,\n      weight: 1\n    };\n    const weight = layout.stackWeight / stack.weight || 1;\n    if (layout.horizontal) {\n      const width = chartArea.w * weight;\n      const height = stack.size || box.height;\n      if (defined(stack.start)) {\n        y = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n      } else {\n        setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n      }\n      stack.start = y;\n      stack.placed += width;\n      y = box.bottom;\n    } else {\n      const height = chartArea.h * weight;\n      const width = stack.size || box.width;\n      if (defined(stack.start)) {\n        x = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n      } else {\n        setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n      }\n      stack.start = x;\n      stack.placed += height;\n      x = box.right;\n    }\n  }\n  chartArea.x = x;\n  chartArea.y = y;\n}\nvar layouts = {\n  addBox(chart, item) {\n    if (!chart.boxes) {\n      chart.boxes = [];\n    }\n    item.fullSize = item.fullSize || false;\n    item.position = item.position || \"top\";\n    item.weight = item.weight || 0;\n    item._layers = item._layers || function() {\n      return [\n        {\n          z: 0,\n          draw(chartArea) {\n            item.draw(chartArea);\n          }\n        }\n      ];\n    };\n    chart.boxes.push(item);\n  },\n  removeBox(chart, layoutItem) {\n    const index2 = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n    if (index2 !== -1) {\n      chart.boxes.splice(index2, 1);\n    }\n  },\n  configure(chart, item, options) {\n    item.fullSize = options.fullSize;\n    item.position = options.position;\n    item.weight = options.weight;\n  },\n  update(chart, width, height, minPadding) {\n    if (!chart) {\n      return;\n    }\n    const padding = toPadding(chart.options.layout.padding);\n    const availableWidth = Math.max(width - padding.width, 0);\n    const availableHeight = Math.max(height - padding.height, 0);\n    const boxes = buildLayoutBoxes(chart.boxes);\n    const verticalBoxes = boxes.vertical;\n    const horizontalBoxes = boxes.horizontal;\n    each(chart.boxes, (box) => {\n      if (typeof box.beforeLayout === \"function\") {\n        box.beforeLayout();\n      }\n    });\n    const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) => wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n    const params = Object.freeze({\n      outerWidth: width,\n      outerHeight: height,\n      padding,\n      availableWidth,\n      availableHeight,\n      vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n      hBoxMaxHeight: availableHeight / 2\n    });\n    const maxPadding = Object.assign({}, padding);\n    updateMaxPadding(maxPadding, toPadding(minPadding));\n    const chartArea = Object.assign({\n      maxPadding,\n      w: availableWidth,\n      h: availableHeight,\n      x: padding.left,\n      y: padding.top\n    }, padding);\n    const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n    fitBoxes(boxes.fullSize, chartArea, params, stacks);\n    fitBoxes(verticalBoxes, chartArea, params, stacks);\n    if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n      fitBoxes(verticalBoxes, chartArea, params, stacks);\n    }\n    handleMaxPadding(chartArea);\n    placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n    chartArea.x += chartArea.w;\n    chartArea.y += chartArea.h;\n    placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n    chart.chartArea = {\n      left: chartArea.left,\n      top: chartArea.top,\n      right: chartArea.left + chartArea.w,\n      bottom: chartArea.top + chartArea.h,\n      height: chartArea.h,\n      width: chartArea.w\n    };\n    each(boxes.chartArea, (layout) => {\n      const box = layout.box;\n      Object.assign(box, chart.chartArea);\n      box.update(chartArea.w, chartArea.h, {\n        left: 0,\n        top: 0,\n        right: 0,\n        bottom: 0\n      });\n    });\n  }\n};\nvar BasePlatform = class {\n  acquireContext(canvas, aspectRatio) {\n  }\n  releaseContext(context) {\n    return false;\n  }\n  addEventListener(chart, type, listener) {\n  }\n  removeEventListener(chart, type, listener) {\n  }\n  getDevicePixelRatio() {\n    return 1;\n  }\n  getMaximumSize(element, width, height, aspectRatio) {\n    width = Math.max(0, width || element.width);\n    height = height || element.height;\n    return {\n      width,\n      height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n    };\n  }\n  isAttached(canvas) {\n    return true;\n  }\n  updateConfig(config) {\n  }\n};\nvar BasicPlatform = class extends BasePlatform {\n  acquireContext(item) {\n    return item && item.getContext && item.getContext(\"2d\") || null;\n  }\n  updateConfig(config) {\n    config.options.animation = false;\n  }\n};\nvar EXPANDO_KEY = \"$chartjs\";\nvar EVENT_TYPES = {\n  touchstart: \"mousedown\",\n  touchmove: \"mousemove\",\n  touchend: \"mouseup\",\n  pointerenter: \"mouseenter\",\n  pointerdown: \"mousedown\",\n  pointermove: \"mousemove\",\n  pointerup: \"mouseup\",\n  pointerleave: \"mouseout\",\n  pointerout: \"mouseout\"\n};\nvar isNullOrEmpty = (value) => value === null || value === \"\";\nfunction initCanvas(canvas, aspectRatio) {\n  const style = canvas.style;\n  const renderHeight = canvas.getAttribute(\"height\");\n  const renderWidth = canvas.getAttribute(\"width\");\n  canvas[EXPANDO_KEY] = {\n    initial: {\n      height: renderHeight,\n      width: renderWidth,\n      style: {\n        display: style.display,\n        height: style.height,\n        width: style.width\n      }\n    }\n  };\n  style.display = style.display || \"block\";\n  style.boxSizing = style.boxSizing || \"border-box\";\n  if (isNullOrEmpty(renderWidth)) {\n    const displayWidth = readUsedSize(canvas, \"width\");\n    if (displayWidth !== void 0) {\n      canvas.width = displayWidth;\n    }\n  }\n  if (isNullOrEmpty(renderHeight)) {\n    if (canvas.style.height === \"\") {\n      canvas.height = canvas.width / (aspectRatio || 2);\n    } else {\n      const displayHeight = readUsedSize(canvas, \"height\");\n      if (displayHeight !== void 0) {\n        canvas.height = displayHeight;\n      }\n    }\n  }\n  return canvas;\n}\nvar eventListenerOptions = supportsEventListenerOptions ? {\n  passive: true\n} : false;\nfunction addListener(node, type, listener) {\n  if (node) {\n    node.addEventListener(type, listener, eventListenerOptions);\n  }\n}\nfunction removeListener(chart, type, listener) {\n  if (chart && chart.canvas) {\n    chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n  }\n}\nfunction fromNativeEvent(event, chart) {\n  const type = EVENT_TYPES[event.type] || event.type;\n  const { x, y } = getRelativePosition(event, chart);\n  return {\n    type,\n    chart,\n    native: event,\n    x: x !== void 0 ? x : null,\n    y: y !== void 0 ? y : null\n  };\n}\nfunction nodeListContains(nodeList, canvas) {\n  for (const node of nodeList) {\n    if (node === canvas || node.contains(canvas)) {\n      return true;\n    }\n  }\n}\nfunction createAttachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver((entries) => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {\n    childList: true,\n    subtree: true\n  });\n  return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver((entries) => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {\n    childList: true,\n    subtree: true\n  });\n  return observer;\n}\nvar drpListeningCharts = /* @__PURE__ */ new Map();\nvar oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n  const dpr = window.devicePixelRatio;\n  if (dpr === oldDevicePixelRatio) {\n    return;\n  }\n  oldDevicePixelRatio = dpr;\n  drpListeningCharts.forEach((resize, chart) => {\n    if (chart.currentDevicePixelRatio !== dpr) {\n      resize();\n    }\n  });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n  if (!drpListeningCharts.size) {\n    window.addEventListener(\"resize\", onWindowResize);\n  }\n  drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n  drpListeningCharts.delete(chart);\n  if (!drpListeningCharts.size) {\n    window.removeEventListener(\"resize\", onWindowResize);\n  }\n}\nfunction createResizeObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const container = canvas && _getParentNode(canvas);\n  if (!container) {\n    return;\n  }\n  const resize = throttled((width, height) => {\n    const w = container.clientWidth;\n    listener(width, height);\n    if (w < container.clientWidth) {\n      listener();\n    }\n  }, window);\n  const observer = new ResizeObserver((entries) => {\n    const entry = entries[0];\n    const width = entry.contentRect.width;\n    const height = entry.contentRect.height;\n    if (width === 0 && height === 0) {\n      return;\n    }\n    resize(width, height);\n  });\n  observer.observe(container);\n  listenDevicePixelRatioChanges(chart, resize);\n  return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n  if (observer) {\n    observer.disconnect();\n  }\n  if (type === \"resize\") {\n    unlistenDevicePixelRatioChanges(chart);\n  }\n}\nfunction createProxyAndListen(chart, type, listener) {\n  const canvas = chart.canvas;\n  const proxy = throttled((event) => {\n    if (chart.ctx !== null) {\n      listener(fromNativeEvent(event, chart));\n    }\n  }, chart);\n  addListener(canvas, type, proxy);\n  return proxy;\n}\nvar DomPlatform = class extends BasePlatform {\n  acquireContext(canvas, aspectRatio) {\n    const context = canvas && canvas.getContext && canvas.getContext(\"2d\");\n    if (context && context.canvas === canvas) {\n      initCanvas(canvas, aspectRatio);\n      return context;\n    }\n    return null;\n  }\n  releaseContext(context) {\n    const canvas = context.canvas;\n    if (!canvas[EXPANDO_KEY]) {\n      return false;\n    }\n    const initial = canvas[EXPANDO_KEY].initial;\n    [\n      \"height\",\n      \"width\"\n    ].forEach((prop) => {\n      const value = initial[prop];\n      if (isNullOrUndef(value)) {\n        canvas.removeAttribute(prop);\n      } else {\n        canvas.setAttribute(prop, value);\n      }\n    });\n    const style = initial.style || {};\n    Object.keys(style).forEach((key) => {\n      canvas.style[key] = style[key];\n    });\n    canvas.width = canvas.width;\n    delete canvas[EXPANDO_KEY];\n    return true;\n  }\n  addEventListener(chart, type, listener) {\n    this.removeEventListener(chart, type);\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const handlers = {\n      attach: createAttachObserver,\n      detach: createDetachObserver,\n      resize: createResizeObserver\n    };\n    const handler = handlers[type] || createProxyAndListen;\n    proxies[type] = handler(chart, type, listener);\n  }\n  removeEventListener(chart, type) {\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const proxy = proxies[type];\n    if (!proxy) {\n      return;\n    }\n    const handlers = {\n      attach: releaseObserver,\n      detach: releaseObserver,\n      resize: releaseObserver\n    };\n    const handler = handlers[type] || removeListener;\n    handler(chart, type, proxy);\n    proxies[type] = void 0;\n  }\n  getDevicePixelRatio() {\n    return window.devicePixelRatio;\n  }\n  getMaximumSize(canvas, width, height, aspectRatio) {\n    return getMaximumSize(canvas, width, height, aspectRatio);\n  }\n  isAttached(canvas) {\n    const container = canvas && _getParentNode(canvas);\n    return !!(container && container.isConnected);\n  }\n};\nfunction _detectPlatform(canvas) {\n  if (!_isDomSupported() || typeof OffscreenCanvas !== \"undefined\" && canvas instanceof OffscreenCanvas) {\n    return BasicPlatform;\n  }\n  return DomPlatform;\n}\nvar Element = class {\n  constructor() {\n    __publicField(this, \"x\");\n    __publicField(this, \"y\");\n    __publicField(this, \"active\", false);\n    __publicField(this, \"options\");\n    __publicField(this, \"$animations\");\n  }\n  tooltipPosition(useFinalPosition) {\n    const { x, y } = this.getProps([\n      \"x\",\n      \"y\"\n    ], useFinalPosition);\n    return {\n      x,\n      y\n    };\n  }\n  hasValue() {\n    return isNumber(this.x) && isNumber(this.y);\n  }\n  getProps(props, final) {\n    const anims = this.$animations;\n    if (!final || !anims) {\n      return this;\n    }\n    const ret = {};\n    props.forEach((prop) => {\n      ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n    });\n    return ret;\n  }\n};\n__publicField(Element, \"defaults\", {});\n__publicField(Element, \"defaultRoutes\");\nfunction autoSkip(scale, ticks) {\n  const tickOpts = scale.options.ticks;\n  const determinedMaxTicks = determineMaxTicks(scale);\n  const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n  const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n  const numMajorIndices = majorIndices.length;\n  const first = majorIndices[0];\n  const last = majorIndices[numMajorIndices - 1];\n  const newTicks = [];\n  if (numMajorIndices > ticksLimit) {\n    skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n    return newTicks;\n  }\n  const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n  if (numMajorIndices > 0) {\n    let i, ilen;\n    const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n    skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n    for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n      skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n    }\n    skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n    return newTicks;\n  }\n  skip(ticks, newTicks, spacing);\n  return newTicks;\n}\nfunction determineMaxTicks(scale) {\n  const offset = scale.options.offset;\n  const tickLength = scale._tickSize();\n  const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n  const maxChart = scale._maxLength / tickLength;\n  return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n  const evenMajorSpacing = getEvenSpacing(majorIndices);\n  const spacing = ticks.length / ticksLimit;\n  if (!evenMajorSpacing) {\n    return Math.max(spacing, 1);\n  }\n  const factors = _factorize(evenMajorSpacing);\n  for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n    const factor = factors[i];\n    if (factor > spacing) {\n      return factor;\n    }\n  }\n  return Math.max(spacing, 1);\n}\nfunction getMajorIndices(ticks) {\n  const result = [];\n  let i, ilen;\n  for (i = 0, ilen = ticks.length; i < ilen; i++) {\n    if (ticks[i].major) {\n      result.push(i);\n    }\n  }\n  return result;\n}\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n  let count = 0;\n  let next = majorIndices[0];\n  let i;\n  spacing = Math.ceil(spacing);\n  for (i = 0; i < ticks.length; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = majorIndices[count * spacing];\n    }\n  }\n}\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n  const start = valueOrDefault(majorStart, 0);\n  const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n  let count = 0;\n  let length, i, next;\n  spacing = Math.ceil(spacing);\n  if (majorEnd) {\n    length = majorEnd - majorStart;\n    spacing = length / Math.floor(length / spacing);\n  }\n  next = start;\n  while (next < 0) {\n    count++;\n    next = Math.round(start + count * spacing);\n  }\n  for (i = Math.max(start, 0); i < end; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = Math.round(start + count * spacing);\n    }\n  }\n}\nfunction getEvenSpacing(arr) {\n  const len = arr.length;\n  let i, diff;\n  if (len < 2) {\n    return false;\n  }\n  for (diff = arr[0], i = 1; i < len; ++i) {\n    if (arr[i] - arr[i - 1] !== diff) {\n      return false;\n    }\n  }\n  return diff;\n}\nvar reverseAlign = (align) => align === \"left\" ? \"right\" : align === \"right\" ? \"left\" : align;\nvar offsetFromEdge = (scale, edge, offset) => edge === \"top\" || edge === \"left\" ? scale[edge] + offset : scale[edge] - offset;\nvar getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\nfunction sample(arr, numItems) {\n  const result = [];\n  const increment = arr.length / numItems;\n  const len = arr.length;\n  let i = 0;\n  for (; i < len; i += increment) {\n    result.push(arr[Math.floor(i)]);\n  }\n  return result;\n}\nfunction getPixelForGridLine(scale, index2, offsetGridLines) {\n  const length = scale.ticks.length;\n  const validIndex2 = Math.min(index2, length - 1);\n  const start = scale._startPixel;\n  const end = scale._endPixel;\n  const epsilon = 1e-6;\n  let lineValue = scale.getPixelForTick(validIndex2);\n  let offset;\n  if (offsetGridLines) {\n    if (length === 1) {\n      offset = Math.max(lineValue - start, end - lineValue);\n    } else if (index2 === 0) {\n      offset = (scale.getPixelForTick(1) - lineValue) / 2;\n    } else {\n      offset = (lineValue - scale.getPixelForTick(validIndex2 - 1)) / 2;\n    }\n    lineValue += validIndex2 < index2 ? offset : -offset;\n    if (lineValue < start - epsilon || lineValue > end + epsilon) {\n      return;\n    }\n  }\n  return lineValue;\n}\nfunction garbageCollect(caches, length) {\n  each(caches, (cache) => {\n    const gc = cache.gc;\n    const gcLen = gc.length / 2;\n    let i;\n    if (gcLen > length) {\n      for (i = 0; i < gcLen; ++i) {\n        delete cache.data[gc[i]];\n      }\n      gc.splice(0, gcLen);\n    }\n  });\n}\nfunction getTickMarkLength(options) {\n  return options.drawTicks ? options.tickLength : 0;\n}\nfunction getTitleHeight(options, fallback) {\n  if (!options.display) {\n    return 0;\n  }\n  const font = toFont(options.font, fallback);\n  const padding = toPadding(options.padding);\n  const lines = isArray(options.text) ? options.text.length : 1;\n  return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n  return createContext(parent, {\n    scale,\n    type: \"scale\"\n  });\n}\nfunction createTickContext(parent, index2, tick) {\n  return createContext(parent, {\n    tick,\n    index: index2,\n    type: \"tick\"\n  });\n}\nfunction titleAlign(align, position, reverse) {\n  let ret = _toLeftRightCenter(align);\n  if (reverse && position !== \"right\" || !reverse && position === \"right\") {\n    ret = reverseAlign(ret);\n  }\n  return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n  const { top, left, bottom, right, chart } = scale;\n  const { chartArea, scales: scales2 } = chart;\n  let rotation = 0;\n  let maxWidth, titleX, titleY;\n  const height = bottom - top;\n  const width = right - left;\n  if (scale.isHorizontal()) {\n    titleX = _alignStartEnd(align, left, right);\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleY = scales2[positionAxisID].getPixelForValue(value) + height - offset;\n    } else if (position === \"center\") {\n      titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n    } else {\n      titleY = offsetFromEdge(scale, position, offset);\n    }\n    maxWidth = right - left;\n  } else {\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleX = scales2[positionAxisID].getPixelForValue(value) - width + offset;\n    } else if (position === \"center\") {\n      titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n    } else {\n      titleX = offsetFromEdge(scale, position, offset);\n    }\n    titleY = _alignStartEnd(align, bottom, top);\n    rotation = position === \"left\" ? -HALF_PI : HALF_PI;\n  }\n  return {\n    titleX,\n    titleY,\n    maxWidth,\n    rotation\n  };\n}\nvar Scale = class _Scale extends Element {\n  constructor(cfg) {\n    super();\n    this.id = cfg.id;\n    this.type = cfg.type;\n    this.options = void 0;\n    this.ctx = cfg.ctx;\n    this.chart = cfg.chart;\n    this.top = void 0;\n    this.bottom = void 0;\n    this.left = void 0;\n    this.right = void 0;\n    this.width = void 0;\n    this.height = void 0;\n    this._margins = {\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    };\n    this.maxWidth = void 0;\n    this.maxHeight = void 0;\n    this.paddingTop = void 0;\n    this.paddingBottom = void 0;\n    this.paddingLeft = void 0;\n    this.paddingRight = void 0;\n    this.axis = void 0;\n    this.labelRotation = void 0;\n    this.min = void 0;\n    this.max = void 0;\n    this._range = void 0;\n    this.ticks = [];\n    this._gridLineItems = null;\n    this._labelItems = null;\n    this._labelSizes = null;\n    this._length = 0;\n    this._maxLength = 0;\n    this._longestTextCache = {};\n    this._startPixel = void 0;\n    this._endPixel = void 0;\n    this._reversePixels = false;\n    this._userMax = void 0;\n    this._userMin = void 0;\n    this._suggestedMax = void 0;\n    this._suggestedMin = void 0;\n    this._ticksLength = 0;\n    this._borderValue = 0;\n    this._cache = {};\n    this._dataLimitsCached = false;\n    this.$context = void 0;\n  }\n  init(options) {\n    this.options = options.setContext(this.getContext());\n    this.axis = options.axis;\n    this._userMin = this.parse(options.min);\n    this._userMax = this.parse(options.max);\n    this._suggestedMin = this.parse(options.suggestedMin);\n    this._suggestedMax = this.parse(options.suggestedMax);\n  }\n  parse(raw, index2) {\n    return raw;\n  }\n  getUserBounds() {\n    let { _userMin, _userMax, _suggestedMin, _suggestedMax } = this;\n    _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n    _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n    _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n    _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n    return {\n      min: finiteOrDefault(_userMin, _suggestedMin),\n      max: finiteOrDefault(_userMax, _suggestedMax),\n      minDefined: isNumberFinite(_userMin),\n      maxDefined: isNumberFinite(_userMax)\n    };\n  }\n  getMinMax(canStack) {\n    let { min, max, minDefined, maxDefined } = this.getUserBounds();\n    let range;\n    if (minDefined && maxDefined) {\n      return {\n        min,\n        max\n      };\n    }\n    const metas = this.getMatchingVisibleMetas();\n    for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n      range = metas[i].controller.getMinMax(this, canStack);\n      if (!minDefined) {\n        min = Math.min(min, range.min);\n      }\n      if (!maxDefined) {\n        max = Math.max(max, range.max);\n      }\n    }\n    min = maxDefined && min > max ? max : min;\n    max = minDefined && min > max ? min : max;\n    return {\n      min: finiteOrDefault(min, finiteOrDefault(max, min)),\n      max: finiteOrDefault(max, finiteOrDefault(min, max))\n    };\n  }\n  getPadding() {\n    return {\n      left: this.paddingLeft || 0,\n      top: this.paddingTop || 0,\n      right: this.paddingRight || 0,\n      bottom: this.paddingBottom || 0\n    };\n  }\n  getTicks() {\n    return this.ticks;\n  }\n  getLabels() {\n    const data = this.chart.data;\n    return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n  }\n  getLabelItems(chartArea = this.chart.chartArea) {\n    const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n    return items;\n  }\n  beforeLayout() {\n    this._cache = {};\n    this._dataLimitsCached = false;\n  }\n  beforeUpdate() {\n    callback(this.options.beforeUpdate, [\n      this\n    ]);\n  }\n  update(maxWidth, maxHeight, margins) {\n    const { beginAtZero, grace, ticks: tickOpts } = this.options;\n    const sampleSize = tickOpts.sampleSize;\n    this.beforeUpdate();\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins = Object.assign({\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    }, margins);\n    this.ticks = null;\n    this._labelSizes = null;\n    this._gridLineItems = null;\n    this._labelItems = null;\n    this.beforeSetDimensions();\n    this.setDimensions();\n    this.afterSetDimensions();\n    this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n    if (!this._dataLimitsCached) {\n      this.beforeDataLimits();\n      this.determineDataLimits();\n      this.afterDataLimits();\n      this._range = _addGrace(this, grace, beginAtZero);\n      this._dataLimitsCached = true;\n    }\n    this.beforeBuildTicks();\n    this.ticks = this.buildTicks() || [];\n    this.afterBuildTicks();\n    const samplingEnabled = sampleSize < this.ticks.length;\n    this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n    this.configure();\n    this.beforeCalculateLabelRotation();\n    this.calculateLabelRotation();\n    this.afterCalculateLabelRotation();\n    if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === \"auto\")) {\n      this.ticks = autoSkip(this, this.ticks);\n      this._labelSizes = null;\n      this.afterAutoSkip();\n    }\n    if (samplingEnabled) {\n      this._convertTicksToLabels(this.ticks);\n    }\n    this.beforeFit();\n    this.fit();\n    this.afterFit();\n    this.afterUpdate();\n  }\n  configure() {\n    let reversePixels = this.options.reverse;\n    let startPixel, endPixel;\n    if (this.isHorizontal()) {\n      startPixel = this.left;\n      endPixel = this.right;\n    } else {\n      startPixel = this.top;\n      endPixel = this.bottom;\n      reversePixels = !reversePixels;\n    }\n    this._startPixel = startPixel;\n    this._endPixel = endPixel;\n    this._reversePixels = reversePixels;\n    this._length = endPixel - startPixel;\n    this._alignToPixels = this.options.alignToPixels;\n  }\n  afterUpdate() {\n    callback(this.options.afterUpdate, [\n      this\n    ]);\n  }\n  beforeSetDimensions() {\n    callback(this.options.beforeSetDimensions, [\n      this\n    ]);\n  }\n  setDimensions() {\n    if (this.isHorizontal()) {\n      this.width = this.maxWidth;\n      this.left = 0;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n      this.top = 0;\n      this.bottom = this.height;\n    }\n    this.paddingLeft = 0;\n    this.paddingTop = 0;\n    this.paddingRight = 0;\n    this.paddingBottom = 0;\n  }\n  afterSetDimensions() {\n    callback(this.options.afterSetDimensions, [\n      this\n    ]);\n  }\n  _callHooks(name) {\n    this.chart.notifyPlugins(name, this.getContext());\n    callback(this.options[name], [\n      this\n    ]);\n  }\n  beforeDataLimits() {\n    this._callHooks(\"beforeDataLimits\");\n  }\n  determineDataLimits() {\n  }\n  afterDataLimits() {\n    this._callHooks(\"afterDataLimits\");\n  }\n  beforeBuildTicks() {\n    this._callHooks(\"beforeBuildTicks\");\n  }\n  buildTicks() {\n    return [];\n  }\n  afterBuildTicks() {\n    this._callHooks(\"afterBuildTicks\");\n  }\n  beforeTickToLabelConversion() {\n    callback(this.options.beforeTickToLabelConversion, [\n      this\n    ]);\n  }\n  generateTickLabels(ticks) {\n    const tickOpts = this.options.ticks;\n    let i, ilen, tick;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      tick = ticks[i];\n      tick.label = callback(tickOpts.callback, [\n        tick.value,\n        i,\n        ticks\n      ], this);\n    }\n  }\n  afterTickToLabelConversion() {\n    callback(this.options.afterTickToLabelConversion, [\n      this\n    ]);\n  }\n  beforeCalculateLabelRotation() {\n    callback(this.options.beforeCalculateLabelRotation, [\n      this\n    ]);\n  }\n  calculateLabelRotation() {\n    const options = this.options;\n    const tickOpts = options.ticks;\n    const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n    const minRotation = tickOpts.minRotation || 0;\n    const maxRotation = tickOpts.maxRotation;\n    let labelRotation = minRotation;\n    let tickWidth, maxHeight, maxLabelDiagonal;\n    if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n      this.labelRotation = minRotation;\n      return;\n    }\n    const labelSizes = this._getLabelSizes();\n    const maxLabelWidth = labelSizes.widest.width;\n    const maxLabelHeight = labelSizes.highest.height;\n    const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n    tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n    if (maxLabelWidth + 6 > tickWidth) {\n      tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n      maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n      maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n      labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n      labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n    }\n    this.labelRotation = labelRotation;\n  }\n  afterCalculateLabelRotation() {\n    callback(this.options.afterCalculateLabelRotation, [\n      this\n    ]);\n  }\n  afterAutoSkip() {\n  }\n  beforeFit() {\n    callback(this.options.beforeFit, [\n      this\n    ]);\n  }\n  fit() {\n    const minSize = {\n      width: 0,\n      height: 0\n    };\n    const { chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;\n    const display = this._isVisible();\n    const isHorizontal = this.isHorizontal();\n    if (display) {\n      const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n      if (isHorizontal) {\n        minSize.width = this.maxWidth;\n        minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n      } else {\n        minSize.height = this.maxHeight;\n        minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n      }\n      if (tickOpts.display && this.ticks.length) {\n        const { first, last, widest, highest } = this._getLabelSizes();\n        const tickPadding = tickOpts.padding * 2;\n        const angleRadians = toRadians(this.labelRotation);\n        const cos = Math.cos(angleRadians);\n        const sin = Math.sin(angleRadians);\n        if (isHorizontal) {\n          const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n          minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n        } else {\n          const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n          minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n        }\n        this._calculatePadding(first, last, sin, cos);\n      }\n    }\n    this._handleMargins();\n    if (isHorizontal) {\n      this.width = this._length = chart.width - this._margins.left - this._margins.right;\n      this.height = minSize.height;\n    } else {\n      this.width = minSize.width;\n      this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n    }\n  }\n  _calculatePadding(first, last, sin, cos) {\n    const { ticks: { align, padding }, position } = this.options;\n    const isRotated = this.labelRotation !== 0;\n    const labelsBelowTicks = position !== \"top\" && this.axis === \"x\";\n    if (this.isHorizontal()) {\n      const offsetLeft = this.getPixelForTick(0) - this.left;\n      const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n      let paddingLeft = 0;\n      let paddingRight = 0;\n      if (isRotated) {\n        if (labelsBelowTicks) {\n          paddingLeft = cos * first.width;\n          paddingRight = sin * last.height;\n        } else {\n          paddingLeft = sin * first.height;\n          paddingRight = cos * last.width;\n        }\n      } else if (align === \"start\") {\n        paddingRight = last.width;\n      } else if (align === \"end\") {\n        paddingLeft = first.width;\n      } else if (align !== \"inner\") {\n        paddingLeft = first.width / 2;\n        paddingRight = last.width / 2;\n      }\n      this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n      this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n    } else {\n      let paddingTop = last.height / 2;\n      let paddingBottom = first.height / 2;\n      if (align === \"start\") {\n        paddingTop = 0;\n        paddingBottom = first.height;\n      } else if (align === \"end\") {\n        paddingTop = last.height;\n        paddingBottom = 0;\n      }\n      this.paddingTop = paddingTop + padding;\n      this.paddingBottom = paddingBottom + padding;\n    }\n  }\n  _handleMargins() {\n    if (this._margins) {\n      this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n      this._margins.top = Math.max(this.paddingTop, this._margins.top);\n      this._margins.right = Math.max(this.paddingRight, this._margins.right);\n      this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n    }\n  }\n  afterFit() {\n    callback(this.options.afterFit, [\n      this\n    ]);\n  }\n  isHorizontal() {\n    const { axis, position } = this.options;\n    return position === \"top\" || position === \"bottom\" || axis === \"x\";\n  }\n  isFullSize() {\n    return this.options.fullSize;\n  }\n  _convertTicksToLabels(ticks) {\n    this.beforeTickToLabelConversion();\n    this.generateTickLabels(ticks);\n    let i, ilen;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      if (isNullOrUndef(ticks[i].label)) {\n        ticks.splice(i, 1);\n        ilen--;\n        i--;\n      }\n    }\n    this.afterTickToLabelConversion();\n  }\n  _getLabelSizes() {\n    let labelSizes = this._labelSizes;\n    if (!labelSizes) {\n      const sampleSize = this.options.ticks.sampleSize;\n      let ticks = this.ticks;\n      if (sampleSize < ticks.length) {\n        ticks = sample(ticks, sampleSize);\n      }\n      this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n    }\n    return labelSizes;\n  }\n  _computeLabelSizes(ticks, length, maxTicksLimit) {\n    const { ctx, _longestTextCache: caches } = this;\n    const widths = [];\n    const heights = [];\n    const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n    let widestLabelSize = 0;\n    let highestLabelSize = 0;\n    let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n    for (i = 0; i < length; i += increment) {\n      label = ticks[i].label;\n      tickFont = this._resolveTickFontOptions(i);\n      ctx.font = fontString = tickFont.string;\n      cache = caches[fontString] = caches[fontString] || {\n        data: {},\n        gc: []\n      };\n      lineHeight = tickFont.lineHeight;\n      width = height = 0;\n      if (!isNullOrUndef(label) && !isArray(label)) {\n        width = _measureText(ctx, cache.data, cache.gc, width, label);\n        height = lineHeight;\n      } else if (isArray(label)) {\n        for (j = 0, jlen = label.length; j < jlen; ++j) {\n          nestedLabel = label[j];\n          if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n            width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n            height += lineHeight;\n          }\n        }\n      }\n      widths.push(width);\n      heights.push(height);\n      widestLabelSize = Math.max(width, widestLabelSize);\n      highestLabelSize = Math.max(height, highestLabelSize);\n    }\n    garbageCollect(caches, length);\n    const widest = widths.indexOf(widestLabelSize);\n    const highest = heights.indexOf(highestLabelSize);\n    const valueAt = (idx) => ({\n      width: widths[idx] || 0,\n      height: heights[idx] || 0\n    });\n    return {\n      first: valueAt(0),\n      last: valueAt(length - 1),\n      widest: valueAt(widest),\n      highest: valueAt(highest),\n      widths,\n      heights\n    };\n  }\n  getLabelForValue(value) {\n    return value;\n  }\n  getPixelForValue(value, index2) {\n    return NaN;\n  }\n  getValueForPixel(pixel) {\n  }\n  getPixelForTick(index2) {\n    const ticks = this.ticks;\n    if (index2 < 0 || index2 > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index2].value);\n  }\n  getPixelForDecimal(decimal) {\n    if (this._reversePixels) {\n      decimal = 1 - decimal;\n    }\n    const pixel = this._startPixel + decimal * this._length;\n    return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n  }\n  getDecimalForPixel(pixel) {\n    const decimal = (pixel - this._startPixel) / this._length;\n    return this._reversePixels ? 1 - decimal : decimal;\n  }\n  getBasePixel() {\n    return this.getPixelForValue(this.getBaseValue());\n  }\n  getBaseValue() {\n    const { min, max } = this;\n    return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n  }\n  getContext(index2) {\n    const ticks = this.ticks || [];\n    if (index2 >= 0 && index2 < ticks.length) {\n      const tick = ticks[index2];\n      return tick.$context || (tick.$context = createTickContext(this.getContext(), index2, tick));\n    }\n    return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n  }\n  _tickSize() {\n    const optionTicks = this.options.ticks;\n    const rot = toRadians(this.labelRotation);\n    const cos = Math.abs(Math.cos(rot));\n    const sin = Math.abs(Math.sin(rot));\n    const labelSizes = this._getLabelSizes();\n    const padding = optionTicks.autoSkipPadding || 0;\n    const w = labelSizes ? labelSizes.widest.width + padding : 0;\n    const h = labelSizes ? labelSizes.highest.height + padding : 0;\n    return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n  }\n  _isVisible() {\n    const display = this.options.display;\n    if (display !== \"auto\") {\n      return !!display;\n    }\n    return this.getMatchingVisibleMetas().length > 0;\n  }\n  _computeGridLineItems(chartArea) {\n    const axis = this.axis;\n    const chart = this.chart;\n    const options = this.options;\n    const { grid, position, border } = options;\n    const offset = grid.offset;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const ticksLength = ticks.length + (offset ? 1 : 0);\n    const tl = getTickMarkLength(grid);\n    const items = [];\n    const borderOpts = border.setContext(this.getContext());\n    const axisWidth = borderOpts.display ? borderOpts.width : 0;\n    const axisHalfWidth = axisWidth / 2;\n    const alignBorderValue = function(pixel) {\n      return _alignPixel(chart, pixel, axisWidth);\n    };\n    let borderValue, i, lineValue, alignedLineValue;\n    let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n    if (position === \"top\") {\n      borderValue = alignBorderValue(this.bottom);\n      ty1 = this.bottom - tl;\n      ty2 = borderValue - axisHalfWidth;\n      y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n      y2 = chartArea.bottom;\n    } else if (position === \"bottom\") {\n      borderValue = alignBorderValue(this.top);\n      y1 = chartArea.top;\n      y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = this.top + tl;\n    } else if (position === \"left\") {\n      borderValue = alignBorderValue(this.right);\n      tx1 = this.right - tl;\n      tx2 = borderValue - axisHalfWidth;\n      x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n      x2 = chartArea.right;\n    } else if (position === \"right\") {\n      borderValue = alignBorderValue(this.left);\n      x1 = chartArea.left;\n      x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n      tx1 = borderValue + axisHalfWidth;\n      tx2 = this.left + tl;\n    } else if (axis === \"x\") {\n      if (position === \"center\") {\n        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n      y1 = chartArea.top;\n      y2 = chartArea.bottom;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = ty1 + tl;\n    } else if (axis === \"y\") {\n      if (position === \"center\") {\n        borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n      tx1 = borderValue - axisHalfWidth;\n      tx2 = tx1 - tl;\n      x1 = chartArea.left;\n      x2 = chartArea.right;\n    }\n    const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n    const step = Math.max(1, Math.ceil(ticksLength / limit));\n    for (i = 0; i < ticksLength; i += step) {\n      const context = this.getContext(i);\n      const optsAtIndex = grid.setContext(context);\n      const optsAtIndexBorder = border.setContext(context);\n      const lineWidth = optsAtIndex.lineWidth;\n      const lineColor = optsAtIndex.color;\n      const borderDash = optsAtIndexBorder.dash || [];\n      const borderDashOffset = optsAtIndexBorder.dashOffset;\n      const tickWidth = optsAtIndex.tickWidth;\n      const tickColor = optsAtIndex.tickColor;\n      const tickBorderDash = optsAtIndex.tickBorderDash || [];\n      const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n      lineValue = getPixelForGridLine(this, i, offset);\n      if (lineValue === void 0) {\n        continue;\n      }\n      alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n      if (isHorizontal) {\n        tx1 = tx2 = x1 = x2 = alignedLineValue;\n      } else {\n        ty1 = ty2 = y1 = y2 = alignedLineValue;\n      }\n      items.push({\n        tx1,\n        ty1,\n        tx2,\n        ty2,\n        x1,\n        y1,\n        x2,\n        y2,\n        width: lineWidth,\n        color: lineColor,\n        borderDash,\n        borderDashOffset,\n        tickWidth,\n        tickColor,\n        tickBorderDash,\n        tickBorderDashOffset\n      });\n    }\n    this._ticksLength = ticksLength;\n    this._borderValue = borderValue;\n    return items;\n  }\n  _computeLabelItems(chartArea) {\n    const axis = this.axis;\n    const options = this.options;\n    const { position, ticks: optionTicks } = options;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const { align, crossAlign, padding, mirror } = optionTicks;\n    const tl = getTickMarkLength(options.grid);\n    const tickAndPadding = tl + padding;\n    const hTickAndPadding = mirror ? -padding : tickAndPadding;\n    const rotation = -toRadians(this.labelRotation);\n    const items = [];\n    let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n    let textBaseline = \"middle\";\n    if (position === \"top\") {\n      y = this.bottom - hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === \"bottom\") {\n      y = this.top + hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === \"left\") {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (position === \"right\") {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (axis === \"x\") {\n      if (position === \"center\") {\n        y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n      }\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (axis === \"y\") {\n      if (position === \"center\") {\n        x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        x = this.chart.scales[positionAxisID].getPixelForValue(value);\n      }\n      textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n    }\n    if (axis === \"y\") {\n      if (align === \"start\") {\n        textBaseline = \"top\";\n      } else if (align === \"end\") {\n        textBaseline = \"bottom\";\n      }\n    }\n    const labelSizes = this._getLabelSizes();\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      label = tick.label;\n      const optsAtIndex = optionTicks.setContext(this.getContext(i));\n      pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n      font = this._resolveTickFontOptions(i);\n      lineHeight = font.lineHeight;\n      lineCount = isArray(label) ? label.length : 1;\n      const halfCount = lineCount / 2;\n      const color2 = optsAtIndex.color;\n      const strokeColor = optsAtIndex.textStrokeColor;\n      const strokeWidth = optsAtIndex.textStrokeWidth;\n      let tickTextAlign = textAlign;\n      if (isHorizontal) {\n        x = pixel;\n        if (textAlign === \"inner\") {\n          if (i === ilen - 1) {\n            tickTextAlign = !this.options.reverse ? \"right\" : \"left\";\n          } else if (i === 0) {\n            tickTextAlign = !this.options.reverse ? \"left\" : \"right\";\n          } else {\n            tickTextAlign = \"center\";\n          }\n        }\n        if (position === \"top\") {\n          if (crossAlign === \"near\" || rotation !== 0) {\n            textOffset = -lineCount * lineHeight + lineHeight / 2;\n          } else if (crossAlign === \"center\") {\n            textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n          } else {\n            textOffset = -labelSizes.highest.height + lineHeight / 2;\n          }\n        } else {\n          if (crossAlign === \"near\" || rotation !== 0) {\n            textOffset = lineHeight / 2;\n          } else if (crossAlign === \"center\") {\n            textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n          } else {\n            textOffset = labelSizes.highest.height - lineCount * lineHeight;\n          }\n        }\n        if (mirror) {\n          textOffset *= -1;\n        }\n        if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n          x += lineHeight / 2 * Math.sin(rotation);\n        }\n      } else {\n        y = pixel;\n        textOffset = (1 - lineCount) * lineHeight / 2;\n      }\n      let backdrop;\n      if (optsAtIndex.showLabelBackdrop) {\n        const labelPadding = toPadding(optsAtIndex.backdropPadding);\n        const height = labelSizes.heights[i];\n        const width = labelSizes.widths[i];\n        let top = textOffset - labelPadding.top;\n        let left = 0 - labelPadding.left;\n        switch (textBaseline) {\n          case \"middle\":\n            top -= height / 2;\n            break;\n          case \"bottom\":\n            top -= height;\n            break;\n        }\n        switch (textAlign) {\n          case \"center\":\n            left -= width / 2;\n            break;\n          case \"right\":\n            left -= width;\n            break;\n          case \"inner\":\n            if (i === ilen - 1) {\n              left -= width;\n            } else if (i > 0) {\n              left -= width / 2;\n            }\n            break;\n        }\n        backdrop = {\n          left,\n          top,\n          width: width + labelPadding.width,\n          height: height + labelPadding.height,\n          color: optsAtIndex.backdropColor\n        };\n      }\n      items.push({\n        label,\n        font,\n        textOffset,\n        options: {\n          rotation,\n          color: color2,\n          strokeColor,\n          strokeWidth,\n          textAlign: tickTextAlign,\n          textBaseline,\n          translation: [\n            x,\n            y\n          ],\n          backdrop\n        }\n      });\n    }\n    return items;\n  }\n  _getXAxisLabelAlignment() {\n    const { position, ticks } = this.options;\n    const rotation = -toRadians(this.labelRotation);\n    if (rotation) {\n      return position === \"top\" ? \"left\" : \"right\";\n    }\n    let align = \"center\";\n    if (ticks.align === \"start\") {\n      align = \"left\";\n    } else if (ticks.align === \"end\") {\n      align = \"right\";\n    } else if (ticks.align === \"inner\") {\n      align = \"inner\";\n    }\n    return align;\n  }\n  _getYAxisLabelAlignment(tl) {\n    const { position, ticks: { crossAlign, mirror, padding } } = this.options;\n    const labelSizes = this._getLabelSizes();\n    const tickAndPadding = tl + padding;\n    const widest = labelSizes.widest.width;\n    let textAlign;\n    let x;\n    if (position === \"left\") {\n      if (mirror) {\n        x = this.right + padding;\n        if (crossAlign === \"near\") {\n          textAlign = \"left\";\n        } else if (crossAlign === \"center\") {\n          textAlign = \"center\";\n          x += widest / 2;\n        } else {\n          textAlign = \"right\";\n          x += widest;\n        }\n      } else {\n        x = this.right - tickAndPadding;\n        if (crossAlign === \"near\") {\n          textAlign = \"right\";\n        } else if (crossAlign === \"center\") {\n          textAlign = \"center\";\n          x -= widest / 2;\n        } else {\n          textAlign = \"left\";\n          x = this.left;\n        }\n      }\n    } else if (position === \"right\") {\n      if (mirror) {\n        x = this.left + padding;\n        if (crossAlign === \"near\") {\n          textAlign = \"right\";\n        } else if (crossAlign === \"center\") {\n          textAlign = \"center\";\n          x -= widest / 2;\n        } else {\n          textAlign = \"left\";\n          x -= widest;\n        }\n      } else {\n        x = this.left + tickAndPadding;\n        if (crossAlign === \"near\") {\n          textAlign = \"left\";\n        } else if (crossAlign === \"center\") {\n          textAlign = \"center\";\n          x += widest / 2;\n        } else {\n          textAlign = \"right\";\n          x = this.right;\n        }\n      }\n    } else {\n      textAlign = \"right\";\n    }\n    return {\n      textAlign,\n      x\n    };\n  }\n  _computeLabelArea() {\n    if (this.options.ticks.mirror) {\n      return;\n    }\n    const chart = this.chart;\n    const position = this.options.position;\n    if (position === \"left\" || position === \"right\") {\n      return {\n        top: 0,\n        left: this.left,\n        bottom: chart.height,\n        right: this.right\n      };\n    }\n    if (position === \"top\" || position === \"bottom\") {\n      return {\n        top: this.top,\n        left: 0,\n        bottom: this.bottom,\n        right: chart.width\n      };\n    }\n  }\n  drawBackground() {\n    const { ctx, options: { backgroundColor }, left, top, width, height } = this;\n    if (backgroundColor) {\n      ctx.save();\n      ctx.fillStyle = backgroundColor;\n      ctx.fillRect(left, top, width, height);\n      ctx.restore();\n    }\n  }\n  getLineWidthForValue(value) {\n    const grid = this.options.grid;\n    if (!this._isVisible() || !grid.display) {\n      return 0;\n    }\n    const ticks = this.ticks;\n    const index2 = ticks.findIndex((t) => t.value === value);\n    if (index2 >= 0) {\n      const opts = grid.setContext(this.getContext(index2));\n      return opts.lineWidth;\n    }\n    return 0;\n  }\n  drawGrid(chartArea) {\n    const grid = this.options.grid;\n    const ctx = this.ctx;\n    const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n    let i, ilen;\n    const drawLine = (p1, p2, style) => {\n      if (!style.width || !style.color) {\n        return;\n      }\n      ctx.save();\n      ctx.lineWidth = style.width;\n      ctx.strokeStyle = style.color;\n      ctx.setLineDash(style.borderDash || []);\n      ctx.lineDashOffset = style.borderDashOffset;\n      ctx.beginPath();\n      ctx.moveTo(p1.x, p1.y);\n      ctx.lineTo(p2.x, p2.y);\n      ctx.stroke();\n      ctx.restore();\n    };\n    if (grid.display) {\n      for (i = 0, ilen = items.length; i < ilen; ++i) {\n        const item = items[i];\n        if (grid.drawOnChartArea) {\n          drawLine({\n            x: item.x1,\n            y: item.y1\n          }, {\n            x: item.x2,\n            y: item.y2\n          }, item);\n        }\n        if (grid.drawTicks) {\n          drawLine({\n            x: item.tx1,\n            y: item.ty1\n          }, {\n            x: item.tx2,\n            y: item.ty2\n          }, {\n            color: item.tickColor,\n            width: item.tickWidth,\n            borderDash: item.tickBorderDash,\n            borderDashOffset: item.tickBorderDashOffset\n          });\n        }\n      }\n    }\n  }\n  drawBorder() {\n    const { chart, ctx, options: { border, grid } } = this;\n    const borderOpts = border.setContext(this.getContext());\n    const axisWidth = border.display ? borderOpts.width : 0;\n    if (!axisWidth) {\n      return;\n    }\n    const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n    const borderValue = this._borderValue;\n    let x1, x2, y1, y2;\n    if (this.isHorizontal()) {\n      x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n      x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n      y1 = y2 = borderValue;\n    } else {\n      y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n      y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n      x1 = x2 = borderValue;\n    }\n    ctx.save();\n    ctx.lineWidth = borderOpts.width;\n    ctx.strokeStyle = borderOpts.color;\n    ctx.beginPath();\n    ctx.moveTo(x1, y1);\n    ctx.lineTo(x2, y2);\n    ctx.stroke();\n    ctx.restore();\n  }\n  drawLabels(chartArea) {\n    const optionTicks = this.options.ticks;\n    if (!optionTicks.display) {\n      return;\n    }\n    const ctx = this.ctx;\n    const area = this._computeLabelArea();\n    if (area) {\n      clipArea(ctx, area);\n    }\n    const items = this.getLabelItems(chartArea);\n    for (const item of items) {\n      const renderTextOptions = item.options;\n      const tickFont = item.font;\n      const label = item.label;\n      const y = item.textOffset;\n      renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n    }\n    if (area) {\n      unclipArea(ctx);\n    }\n  }\n  drawTitle() {\n    const { ctx, options: { position, title, reverse } } = this;\n    if (!title.display) {\n      return;\n    }\n    const font = toFont(title.font);\n    const padding = toPadding(title.padding);\n    const align = title.align;\n    let offset = font.lineHeight / 2;\n    if (position === \"bottom\" || position === \"center\" || isObject(position)) {\n      offset += padding.bottom;\n      if (isArray(title.text)) {\n        offset += font.lineHeight * (title.text.length - 1);\n      }\n    } else {\n      offset += padding.top;\n    }\n    const { titleX, titleY, maxWidth, rotation } = titleArgs(this, offset, position, align);\n    renderText(ctx, title.text, 0, 0, font, {\n      color: title.color,\n      maxWidth,\n      rotation,\n      textAlign: titleAlign(align, position, reverse),\n      textBaseline: \"middle\",\n      translation: [\n        titleX,\n        titleY\n      ]\n    });\n  }\n  draw(chartArea) {\n    if (!this._isVisible()) {\n      return;\n    }\n    this.drawBackground();\n    this.drawGrid(chartArea);\n    this.drawBorder();\n    this.drawTitle();\n    this.drawLabels(chartArea);\n  }\n  _layers() {\n    const opts = this.options;\n    const tz = opts.ticks && opts.ticks.z || 0;\n    const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n    const bz = valueOrDefault(opts.border && opts.border.z, 0);\n    if (!this._isVisible() || this.draw !== _Scale.prototype.draw) {\n      return [\n        {\n          z: tz,\n          draw: (chartArea) => {\n            this.draw(chartArea);\n          }\n        }\n      ];\n    }\n    return [\n      {\n        z: gz,\n        draw: (chartArea) => {\n          this.drawBackground();\n          this.drawGrid(chartArea);\n          this.drawTitle();\n        }\n      },\n      {\n        z: bz,\n        draw: () => {\n          this.drawBorder();\n        }\n      },\n      {\n        z: tz,\n        draw: (chartArea) => {\n          this.drawLabels(chartArea);\n        }\n      }\n    ];\n  }\n  getMatchingVisibleMetas(type) {\n    const metas = this.chart.getSortedVisibleDatasetMetas();\n    const axisID = this.axis + \"AxisID\";\n    const result = [];\n    let i, ilen;\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      const meta = metas[i];\n      if (meta[axisID] === this.id && (!type || meta.type === type)) {\n        result.push(meta);\n      }\n    }\n    return result;\n  }\n  _resolveTickFontOptions(index2) {\n    const opts = this.options.ticks.setContext(this.getContext(index2));\n    return toFont(opts.font);\n  }\n  _maxDigits() {\n    const fontSize = this._resolveTickFontOptions(0).lineHeight;\n    return (this.isHorizontal() ? this.width : this.height) / fontSize;\n  }\n};\nvar TypedRegistry = class {\n  constructor(type, scope, override) {\n    this.type = type;\n    this.scope = scope;\n    this.override = override;\n    this.items = /* @__PURE__ */ Object.create(null);\n  }\n  isForType(type) {\n    return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n  }\n  register(item) {\n    const proto = Object.getPrototypeOf(item);\n    let parentScope;\n    if (isIChartComponent(proto)) {\n      parentScope = this.register(proto);\n    }\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope + \".\" + id;\n    if (!id) {\n      throw new Error(\"class does not have id: \" + item);\n    }\n    if (id in items) {\n      return scope;\n    }\n    items[id] = item;\n    registerDefaults(item, scope, parentScope);\n    if (this.override) {\n      defaults.override(item.id, item.overrides);\n    }\n    return scope;\n  }\n  get(id) {\n    return this.items[id];\n  }\n  unregister(item) {\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope;\n    if (id in items) {\n      delete items[id];\n    }\n    if (scope && id in defaults[scope]) {\n      delete defaults[scope][id];\n      if (this.override) {\n        delete overrides[id];\n      }\n    }\n  }\n};\nfunction registerDefaults(item, scope, parentScope) {\n  const itemDefaults = merge(/* @__PURE__ */ Object.create(null), [\n    parentScope ? defaults.get(parentScope) : {},\n    defaults.get(scope),\n    item.defaults\n  ]);\n  defaults.set(scope, itemDefaults);\n  if (item.defaultRoutes) {\n    routeDefaults(scope, item.defaultRoutes);\n  }\n  if (item.descriptors) {\n    defaults.describe(scope, item.descriptors);\n  }\n}\nfunction routeDefaults(scope, routes) {\n  Object.keys(routes).forEach((property) => {\n    const propertyParts = property.split(\".\");\n    const sourceName = propertyParts.pop();\n    const sourceScope = [\n      scope\n    ].concat(propertyParts).join(\".\");\n    const parts = routes[property].split(\".\");\n    const targetName = parts.pop();\n    const targetScope = parts.join(\".\");\n    defaults.route(sourceScope, sourceName, targetScope, targetName);\n  });\n}\nfunction isIChartComponent(proto) {\n  return \"id\" in proto && \"defaults\" in proto;\n}\nvar Registry = class {\n  constructor() {\n    this.controllers = new TypedRegistry(DatasetController, \"datasets\", true);\n    this.elements = new TypedRegistry(Element, \"elements\");\n    this.plugins = new TypedRegistry(Object, \"plugins\");\n    this.scales = new TypedRegistry(Scale, \"scales\");\n    this._typedRegistries = [\n      this.controllers,\n      this.scales,\n      this.elements\n    ];\n  }\n  add(...args) {\n    this._each(\"register\", args);\n  }\n  remove(...args) {\n    this._each(\"unregister\", args);\n  }\n  addControllers(...args) {\n    this._each(\"register\", args, this.controllers);\n  }\n  addElements(...args) {\n    this._each(\"register\", args, this.elements);\n  }\n  addPlugins(...args) {\n    this._each(\"register\", args, this.plugins);\n  }\n  addScales(...args) {\n    this._each(\"register\", args, this.scales);\n  }\n  getController(id) {\n    return this._get(id, this.controllers, \"controller\");\n  }\n  getElement(id) {\n    return this._get(id, this.elements, \"element\");\n  }\n  getPlugin(id) {\n    return this._get(id, this.plugins, \"plugin\");\n  }\n  getScale(id) {\n    return this._get(id, this.scales, \"scale\");\n  }\n  removeControllers(...args) {\n    this._each(\"unregister\", args, this.controllers);\n  }\n  removeElements(...args) {\n    this._each(\"unregister\", args, this.elements);\n  }\n  removePlugins(...args) {\n    this._each(\"unregister\", args, this.plugins);\n  }\n  removeScales(...args) {\n    this._each(\"unregister\", args, this.scales);\n  }\n  _each(method, args, typedRegistry) {\n    [\n      ...args\n    ].forEach((arg) => {\n      const reg = typedRegistry || this._getRegistryForType(arg);\n      if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n        this._exec(method, reg, arg);\n      } else {\n        each(arg, (item) => {\n          const itemReg = typedRegistry || this._getRegistryForType(item);\n          this._exec(method, itemReg, item);\n        });\n      }\n    });\n  }\n  _exec(method, registry2, component) {\n    const camelMethod = _capitalize(method);\n    callback(component[\"before\" + camelMethod], [], component);\n    registry2[method](component);\n    callback(component[\"after\" + camelMethod], [], component);\n  }\n  _getRegistryForType(type) {\n    for (let i = 0; i < this._typedRegistries.length; i++) {\n      const reg = this._typedRegistries[i];\n      if (reg.isForType(type)) {\n        return reg;\n      }\n    }\n    return this.plugins;\n  }\n  _get(id, typedRegistry, type) {\n    const item = typedRegistry.get(id);\n    if (item === void 0) {\n      throw new Error('\"' + id + '\" is not a registered ' + type + \".\");\n    }\n    return item;\n  }\n};\nvar registry = /* @__PURE__ */ new Registry();\nvar PluginService = class {\n  constructor() {\n    this._init = void 0;\n  }\n  notify(chart, hook, args, filter) {\n    if (hook === \"beforeInit\") {\n      this._init = this._createDescriptors(chart, true);\n      this._notify(this._init, chart, \"install\");\n    }\n    if (this._init === void 0) {\n      return;\n    }\n    const descriptors2 = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n    const result = this._notify(descriptors2, chart, hook, args);\n    if (hook === \"afterDestroy\") {\n      this._notify(descriptors2, chart, \"stop\");\n      this._notify(this._init, chart, \"uninstall\");\n      this._init = void 0;\n    }\n    return result;\n  }\n  _notify(descriptors2, chart, hook, args) {\n    args = args || {};\n    for (const descriptor of descriptors2) {\n      const plugin = descriptor.plugin;\n      const method = plugin[hook];\n      const params = [\n        chart,\n        args,\n        descriptor.options\n      ];\n      if (callback(method, params, plugin) === false && args.cancelable) {\n        return false;\n      }\n    }\n    return true;\n  }\n  invalidate() {\n    if (!isNullOrUndef(this._cache)) {\n      this._oldCache = this._cache;\n      this._cache = void 0;\n    }\n  }\n  _descriptors(chart) {\n    if (this._cache) {\n      return this._cache;\n    }\n    const descriptors2 = this._cache = this._createDescriptors(chart);\n    this._notifyStateChanges(chart);\n    return descriptors2;\n  }\n  _createDescriptors(chart, all) {\n    const config = chart && chart.config;\n    const options = valueOrDefault(config.options && config.options.plugins, {});\n    const plugins2 = allPlugins(config);\n    return options === false && !all ? [] : createDescriptors(chart, plugins2, options, all);\n  }\n  _notifyStateChanges(chart) {\n    const previousDescriptors = this._oldCache || [];\n    const descriptors2 = this._cache;\n    const diff = (a, b) => a.filter((x) => !b.some((y) => x.plugin.id === y.plugin.id));\n    this._notify(diff(previousDescriptors, descriptors2), chart, \"stop\");\n    this._notify(diff(descriptors2, previousDescriptors), chart, \"start\");\n  }\n};\nfunction allPlugins(config) {\n  const localIds = {};\n  const plugins2 = [];\n  const keys = Object.keys(registry.plugins.items);\n  for (let i = 0; i < keys.length; i++) {\n    plugins2.push(registry.getPlugin(keys[i]));\n  }\n  const local = config.plugins || [];\n  for (let i = 0; i < local.length; i++) {\n    const plugin = local[i];\n    if (plugins2.indexOf(plugin) === -1) {\n      plugins2.push(plugin);\n      localIds[plugin.id] = true;\n    }\n  }\n  return {\n    plugins: plugins2,\n    localIds\n  };\n}\nfunction getOpts(options, all) {\n  if (!all && options === false) {\n    return null;\n  }\n  if (options === true) {\n    return {};\n  }\n  return options;\n}\nfunction createDescriptors(chart, { plugins: plugins2, localIds }, options, all) {\n  const result = [];\n  const context = chart.getContext();\n  for (const plugin of plugins2) {\n    const id = plugin.id;\n    const opts = getOpts(options[id], all);\n    if (opts === null) {\n      continue;\n    }\n    result.push({\n      plugin,\n      options: pluginOpts(chart.config, {\n        plugin,\n        local: localIds[id]\n      }, opts, context)\n    });\n  }\n  return result;\n}\nfunction pluginOpts(config, { plugin, local }, opts, context) {\n  const keys = config.pluginScopeKeys(plugin);\n  const scopes = config.getOptionScopes(opts, keys);\n  if (local && plugin.defaults) {\n    scopes.push(plugin.defaults);\n  }\n  return config.createResolver(scopes, context, [\n    \"\"\n  ], {\n    scriptable: false,\n    indexable: false,\n    allKeys: true\n  });\n}\nfunction getIndexAxis(type, options) {\n  const datasetDefaults = defaults.datasets[type] || {};\n  const datasetOptions = (options.datasets || {})[type] || {};\n  return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || \"x\";\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n  let axis = id;\n  if (id === \"_index_\") {\n    axis = indexAxis;\n  } else if (id === \"_value_\") {\n    axis = indexAxis === \"x\" ? \"y\" : \"x\";\n  }\n  return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n  return axis === indexAxis ? \"_index_\" : \"_value_\";\n}\nfunction idMatchesAxis(id) {\n  if (id === \"x\" || id === \"y\" || id === \"r\") {\n    return id;\n  }\n}\nfunction axisFromPosition(position) {\n  if (position === \"top\" || position === \"bottom\") {\n    return \"x\";\n  }\n  if (position === \"left\" || position === \"right\") {\n    return \"y\";\n  }\n}\nfunction determineAxis(id, ...scaleOptions) {\n  if (idMatchesAxis(id)) {\n    return id;\n  }\n  for (const opts of scaleOptions) {\n    const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n    if (axis) {\n      return axis;\n    }\n  }\n  throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n  if (dataset[axis + \"AxisID\"] === id) {\n    return {\n      axis\n    };\n  }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n  if (config.data && config.data.datasets) {\n    const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n    if (boundDs.length) {\n      return getAxisFromDataset(id, \"x\", boundDs[0]) || getAxisFromDataset(id, \"y\", boundDs[0]);\n    }\n  }\n  return {};\n}\nfunction mergeScaleConfig(config, options) {\n  const chartDefaults = overrides[config.type] || {\n    scales: {}\n  };\n  const configScales = options.scales || {};\n  const chartIndexAxis = getIndexAxis(config.type, options);\n  const scales2 = /* @__PURE__ */ Object.create(null);\n  Object.keys(configScales).forEach((id) => {\n    const scaleConf = configScales[id];\n    if (!isObject(scaleConf)) {\n      return console.error(`Invalid scale configuration for scale: ${id}`);\n    }\n    if (scaleConf._proxy) {\n      return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n    }\n    const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n    const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n    const defaultScaleOptions = chartDefaults.scales || {};\n    scales2[id] = mergeIf(/* @__PURE__ */ Object.create(null), [\n      {\n        axis\n      },\n      scaleConf,\n      defaultScaleOptions[axis],\n      defaultScaleOptions[defaultId]\n    ]);\n  });\n  config.data.datasets.forEach((dataset) => {\n    const type = dataset.type || config.type;\n    const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n    const datasetDefaults = overrides[type] || {};\n    const defaultScaleOptions = datasetDefaults.scales || {};\n    Object.keys(defaultScaleOptions).forEach((defaultID) => {\n      const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n      const id = dataset[axis + \"AxisID\"] || axis;\n      scales2[id] = scales2[id] || /* @__PURE__ */ Object.create(null);\n      mergeIf(scales2[id], [\n        {\n          axis\n        },\n        configScales[id],\n        defaultScaleOptions[defaultID]\n      ]);\n    });\n  });\n  Object.keys(scales2).forEach((key) => {\n    const scale = scales2[key];\n    mergeIf(scale, [\n      defaults.scales[scale.type],\n      defaults.scale\n    ]);\n  });\n  return scales2;\n}\nfunction initOptions(config) {\n  const options = config.options || (config.options = {});\n  options.plugins = valueOrDefault(options.plugins, {});\n  options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n  data = data || {};\n  data.datasets = data.datasets || [];\n  data.labels = data.labels || [];\n  return data;\n}\nfunction initConfig(config) {\n  config = config || {};\n  config.data = initData(config.data);\n  initOptions(config);\n  return config;\n}\nvar keyCache = /* @__PURE__ */ new Map();\nvar keysCached = /* @__PURE__ */ new Set();\nfunction cachedKeys(cacheKey, generate) {\n  let keys = keyCache.get(cacheKey);\n  if (!keys) {\n    keys = generate();\n    keyCache.set(cacheKey, keys);\n    keysCached.add(keys);\n  }\n  return keys;\n}\nvar addIfFound = (set2, obj, key) => {\n  const opts = resolveObjectKey(obj, key);\n  if (opts !== void 0) {\n    set2.add(opts);\n  }\n};\nvar Config = class {\n  constructor(config) {\n    this._config = initConfig(config);\n    this._scopeCache = /* @__PURE__ */ new Map();\n    this._resolverCache = /* @__PURE__ */ new Map();\n  }\n  get platform() {\n    return this._config.platform;\n  }\n  get type() {\n    return this._config.type;\n  }\n  set type(type) {\n    this._config.type = type;\n  }\n  get data() {\n    return this._config.data;\n  }\n  set data(data) {\n    this._config.data = initData(data);\n  }\n  get options() {\n    return this._config.options;\n  }\n  set options(options) {\n    this._config.options = options;\n  }\n  get plugins() {\n    return this._config.plugins;\n  }\n  update() {\n    const config = this._config;\n    this.clearCache();\n    initOptions(config);\n  }\n  clearCache() {\n    this._scopeCache.clear();\n    this._resolverCache.clear();\n  }\n  datasetScopeKeys(datasetType) {\n    return cachedKeys(datasetType, () => [\n      [\n        `datasets.${datasetType}`,\n        \"\"\n      ]\n    ]);\n  }\n  datasetAnimationScopeKeys(datasetType, transition) {\n    return cachedKeys(`${datasetType}.transition.${transition}`, () => [\n      [\n        `datasets.${datasetType}.transitions.${transition}`,\n        `transitions.${transition}`\n      ],\n      [\n        `datasets.${datasetType}`,\n        \"\"\n      ]\n    ]);\n  }\n  datasetElementScopeKeys(datasetType, elementType) {\n    return cachedKeys(`${datasetType}-${elementType}`, () => [\n      [\n        `datasets.${datasetType}.elements.${elementType}`,\n        `datasets.${datasetType}`,\n        `elements.${elementType}`,\n        \"\"\n      ]\n    ]);\n  }\n  pluginScopeKeys(plugin) {\n    const id = plugin.id;\n    const type = this.type;\n    return cachedKeys(`${type}-plugin-${id}`, () => [\n      [\n        `plugins.${id}`,\n        ...plugin.additionalOptionScopes || []\n      ]\n    ]);\n  }\n  _cachedScopes(mainScope, resetCache) {\n    const _scopeCache = this._scopeCache;\n    let cache = _scopeCache.get(mainScope);\n    if (!cache || resetCache) {\n      cache = /* @__PURE__ */ new Map();\n      _scopeCache.set(mainScope, cache);\n    }\n    return cache;\n  }\n  getOptionScopes(mainScope, keyLists, resetCache) {\n    const { options, type } = this;\n    const cache = this._cachedScopes(mainScope, resetCache);\n    const cached = cache.get(keyLists);\n    if (cached) {\n      return cached;\n    }\n    const scopes = /* @__PURE__ */ new Set();\n    keyLists.forEach((keys) => {\n      if (mainScope) {\n        scopes.add(mainScope);\n        keys.forEach((key) => addIfFound(scopes, mainScope, key));\n      }\n      keys.forEach((key) => addIfFound(scopes, options, key));\n      keys.forEach((key) => addIfFound(scopes, overrides[type] || {}, key));\n      keys.forEach((key) => addIfFound(scopes, defaults, key));\n      keys.forEach((key) => addIfFound(scopes, descriptors, key));\n    });\n    const array = Array.from(scopes);\n    if (array.length === 0) {\n      array.push(/* @__PURE__ */ Object.create(null));\n    }\n    if (keysCached.has(keyLists)) {\n      cache.set(keyLists, array);\n    }\n    return array;\n  }\n  chartOptionScopes() {\n    const { options, type } = this;\n    return [\n      options,\n      overrides[type] || {},\n      defaults.datasets[type] || {},\n      {\n        type\n      },\n      defaults,\n      descriptors\n    ];\n  }\n  resolveNamedOptions(scopes, names2, context, prefixes = [\n    \"\"\n  ]) {\n    const result = {\n      $shared: true\n    };\n    const { resolver, subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n    let options = resolver;\n    if (needContext(resolver, names2)) {\n      result.$shared = false;\n      context = isFunction(context) ? context() : context;\n      const subResolver = this.createResolver(scopes, context, subPrefixes);\n      options = _attachContext(resolver, context, subResolver);\n    }\n    for (const prop of names2) {\n      result[prop] = options[prop];\n    }\n    return result;\n  }\n  createResolver(scopes, context, prefixes = [\n    \"\"\n  ], descriptorDefaults) {\n    const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n    return isObject(context) ? _attachContext(resolver, context, void 0, descriptorDefaults) : resolver;\n  }\n};\nfunction getResolver(resolverCache, scopes, prefixes) {\n  let cache = resolverCache.get(scopes);\n  if (!cache) {\n    cache = /* @__PURE__ */ new Map();\n    resolverCache.set(scopes, cache);\n  }\n  const cacheKey = prefixes.join();\n  let cached = cache.get(cacheKey);\n  if (!cached) {\n    const resolver = _createResolver(scopes, prefixes);\n    cached = {\n      resolver,\n      subPrefixes: prefixes.filter((p) => !p.toLowerCase().includes(\"hover\"))\n    };\n    cache.set(cacheKey, cached);\n  }\n  return cached;\n}\nvar hasFunction = (value) => isObject(value) && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));\nfunction needContext(proxy, names2) {\n  const { isScriptable, isIndexable } = _descriptors(proxy);\n  for (const prop of names2) {\n    const scriptable = isScriptable(prop);\n    const indexable = isIndexable(prop);\n    const value = (indexable || scriptable) && proxy[prop];\n    if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n      return true;\n    }\n  }\n  return false;\n}\nvar version = \"4.5.1\";\nvar KNOWN_POSITIONS = [\n  \"top\",\n  \"bottom\",\n  \"left\",\n  \"right\",\n  \"chartArea\"\n];\nfunction positionIsHorizontal(position, axis) {\n  return position === \"top\" || position === \"bottom\" || KNOWN_POSITIONS.indexOf(position) === -1 && axis === \"x\";\n}\nfunction compare2Level(l1, l2) {\n  return function(a, b) {\n    return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n  };\n}\nfunction onAnimationsComplete(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n  chart.notifyPlugins(\"afterRender\");\n  callback(animationOptions && animationOptions.onComplete, [\n    context\n  ], chart);\n}\nfunction onAnimationProgress(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n  callback(animationOptions && animationOptions.onProgress, [\n    context\n  ], chart);\n}\nfunction getCanvas(item) {\n  if (_isDomSupported() && typeof item === \"string\") {\n    item = document.getElementById(item);\n  } else if (item && item.length) {\n    item = item[0];\n  }\n  if (item && item.canvas) {\n    item = item.canvas;\n  }\n  return item;\n}\nvar instances = {};\nvar getChart = (key) => {\n  const canvas = getCanvas(key);\n  return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n  const keys = Object.keys(obj);\n  for (const key of keys) {\n    const intKey = +key;\n    if (intKey >= start) {\n      const value = obj[key];\n      delete obj[key];\n      if (move > 0 || intKey > start) {\n        obj[intKey + move] = value;\n      }\n    }\n  }\n}\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n  if (!inChartArea || e.type === \"mouseout\") {\n    return null;\n  }\n  if (isClick) {\n    return lastEvent;\n  }\n  return e;\n}\nvar Chart = class {\n  static register(...items) {\n    registry.add(...items);\n    invalidatePlugins();\n  }\n  static unregister(...items) {\n    registry.remove(...items);\n    invalidatePlugins();\n  }\n  constructor(item, userConfig) {\n    const config = this.config = new Config(userConfig);\n    const initialCanvas = getCanvas(item);\n    const existingChart = getChart(initialCanvas);\n    if (existingChart) {\n      throw new Error(\"Canvas is already in use. Chart with ID '\" + existingChart.id + \"' must be destroyed before the canvas with ID '\" + existingChart.canvas.id + \"' can be reused.\");\n    }\n    const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n    this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n    this.platform.updateConfig(config);\n    const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n    const canvas = context && context.canvas;\n    const height = canvas && canvas.height;\n    const width = canvas && canvas.width;\n    this.id = uid();\n    this.ctx = context;\n    this.canvas = canvas;\n    this.width = width;\n    this.height = height;\n    this._options = options;\n    this._aspectRatio = this.aspectRatio;\n    this._layers = [];\n    this._metasets = [];\n    this._stacks = void 0;\n    this.boxes = [];\n    this.currentDevicePixelRatio = void 0;\n    this.chartArea = void 0;\n    this._active = [];\n    this._lastEvent = void 0;\n    this._listeners = {};\n    this._responsiveListeners = void 0;\n    this._sortedMetasets = [];\n    this.scales = {};\n    this._plugins = new PluginService();\n    this.$proxies = {};\n    this._hiddenIndices = {};\n    this.attached = false;\n    this._animationsDisabled = void 0;\n    this.$context = void 0;\n    this._doResize = debounce((mode) => this.update(mode), options.resizeDelay || 0);\n    this._dataChanges = [];\n    instances[this.id] = this;\n    if (!context || !canvas) {\n      console.error(\"Failed to create chart: can't acquire context from the given item\");\n      return;\n    }\n    animator.listen(this, \"complete\", onAnimationsComplete);\n    animator.listen(this, \"progress\", onAnimationProgress);\n    this._initialize();\n    if (this.attached) {\n      this.update();\n    }\n  }\n  get aspectRatio() {\n    const { options: { aspectRatio, maintainAspectRatio }, width, height, _aspectRatio } = this;\n    if (!isNullOrUndef(aspectRatio)) {\n      return aspectRatio;\n    }\n    if (maintainAspectRatio && _aspectRatio) {\n      return _aspectRatio;\n    }\n    return height ? width / height : null;\n  }\n  get data() {\n    return this.config.data;\n  }\n  set data(data) {\n    this.config.data = data;\n  }\n  get options() {\n    return this._options;\n  }\n  set options(options) {\n    this.config.options = options;\n  }\n  get registry() {\n    return registry;\n  }\n  _initialize() {\n    this.notifyPlugins(\"beforeInit\");\n    if (this.options.responsive) {\n      this.resize();\n    } else {\n      retinaScale(this, this.options.devicePixelRatio);\n    }\n    this.bindEvents();\n    this.notifyPlugins(\"afterInit\");\n    return this;\n  }\n  clear() {\n    clearCanvas(this.canvas, this.ctx);\n    return this;\n  }\n  stop() {\n    animator.stop(this);\n    return this;\n  }\n  resize(width, height) {\n    if (!animator.running(this)) {\n      this._resize(width, height);\n    } else {\n      this._resizeBeforeDraw = {\n        width,\n        height\n      };\n    }\n  }\n  _resize(width, height) {\n    const options = this.options;\n    const canvas = this.canvas;\n    const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n    const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n    const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n    const mode = this.width ? \"resize\" : \"attach\";\n    this.width = newSize.width;\n    this.height = newSize.height;\n    this._aspectRatio = this.aspectRatio;\n    if (!retinaScale(this, newRatio, true)) {\n      return;\n    }\n    this.notifyPlugins(\"resize\", {\n      size: newSize\n    });\n    callback(options.onResize, [\n      this,\n      newSize\n    ], this);\n    if (this.attached) {\n      if (this._doResize(mode)) {\n        this.render();\n      }\n    }\n  }\n  ensureScalesHaveIDs() {\n    const options = this.options;\n    const scalesOptions = options.scales || {};\n    each(scalesOptions, (axisOptions, axisID) => {\n      axisOptions.id = axisID;\n    });\n  }\n  buildOrUpdateScales() {\n    const options = this.options;\n    const scaleOpts = options.scales;\n    const scales2 = this.scales;\n    const updated = Object.keys(scales2).reduce((obj, id) => {\n      obj[id] = false;\n      return obj;\n    }, {});\n    let items = [];\n    if (scaleOpts) {\n      items = items.concat(Object.keys(scaleOpts).map((id) => {\n        const scaleOptions = scaleOpts[id];\n        const axis = determineAxis(id, scaleOptions);\n        const isRadial = axis === \"r\";\n        const isHorizontal = axis === \"x\";\n        return {\n          options: scaleOptions,\n          dposition: isRadial ? \"chartArea\" : isHorizontal ? \"bottom\" : \"left\",\n          dtype: isRadial ? \"radialLinear\" : isHorizontal ? \"category\" : \"linear\"\n        };\n      }));\n    }\n    each(items, (item) => {\n      const scaleOptions = item.options;\n      const id = scaleOptions.id;\n      const axis = determineAxis(id, scaleOptions);\n      const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n      if (scaleOptions.position === void 0 || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n        scaleOptions.position = item.dposition;\n      }\n      updated[id] = true;\n      let scale = null;\n      if (id in scales2 && scales2[id].type === scaleType) {\n        scale = scales2[id];\n      } else {\n        const scaleClass = registry.getScale(scaleType);\n        scale = new scaleClass({\n          id,\n          type: scaleType,\n          ctx: this.ctx,\n          chart: this\n        });\n        scales2[scale.id] = scale;\n      }\n      scale.init(scaleOptions, options);\n    });\n    each(updated, (hasUpdated, id) => {\n      if (!hasUpdated) {\n        delete scales2[id];\n      }\n    });\n    each(scales2, (scale) => {\n      layouts.configure(this, scale, scale.options);\n      layouts.addBox(this, scale);\n    });\n  }\n  _updateMetasets() {\n    const metasets = this._metasets;\n    const numData = this.data.datasets.length;\n    const numMeta = metasets.length;\n    metasets.sort((a, b) => a.index - b.index);\n    if (numMeta > numData) {\n      for (let i = numData; i < numMeta; ++i) {\n        this._destroyDatasetMeta(i);\n      }\n      metasets.splice(numData, numMeta - numData);\n    }\n    this._sortedMetasets = metasets.slice(0).sort(compare2Level(\"order\", \"index\"));\n  }\n  _removeUnreferencedMetasets() {\n    const { _metasets: metasets, data: { datasets } } = this;\n    if (metasets.length > datasets.length) {\n      delete this._stacks;\n    }\n    metasets.forEach((meta, index2) => {\n      if (datasets.filter((x) => x === meta._dataset).length === 0) {\n        this._destroyDatasetMeta(index2);\n      }\n    });\n  }\n  buildOrUpdateControllers() {\n    const newControllers = [];\n    const datasets = this.data.datasets;\n    let i, ilen;\n    this._removeUnreferencedMetasets();\n    for (i = 0, ilen = datasets.length; i < ilen; i++) {\n      const dataset = datasets[i];\n      let meta = this.getDatasetMeta(i);\n      const type = dataset.type || this.config.type;\n      if (meta.type && meta.type !== type) {\n        this._destroyDatasetMeta(i);\n        meta = this.getDatasetMeta(i);\n      }\n      meta.type = type;\n      meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n      meta.order = dataset.order || 0;\n      meta.index = i;\n      meta.label = \"\" + dataset.label;\n      meta.visible = this.isDatasetVisible(i);\n      if (meta.controller) {\n        meta.controller.updateIndex(i);\n        meta.controller.linkScales();\n      } else {\n        const ControllerClass = registry.getController(type);\n        const { datasetElementType, dataElementType } = defaults.datasets[type];\n        Object.assign(ControllerClass, {\n          dataElementType: registry.getElement(dataElementType),\n          datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n        });\n        meta.controller = new ControllerClass(this, i);\n        newControllers.push(meta.controller);\n      }\n    }\n    this._updateMetasets();\n    return newControllers;\n  }\n  _resetElements() {\n    each(this.data.datasets, (dataset, datasetIndex) => {\n      this.getDatasetMeta(datasetIndex).controller.reset();\n    }, this);\n  }\n  reset() {\n    this._resetElements();\n    this.notifyPlugins(\"reset\");\n  }\n  update(mode) {\n    const config = this.config;\n    config.update();\n    const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n    const animsDisabled = this._animationsDisabled = !options.animation;\n    this._updateScales();\n    this._checkEventBindings();\n    this._updateHiddenIndices();\n    this._plugins.invalidate();\n    if (this.notifyPlugins(\"beforeUpdate\", {\n      mode,\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    const newControllers = this.buildOrUpdateControllers();\n    this.notifyPlugins(\"beforeElementsUpdate\");\n    let minPadding = 0;\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n      const { controller } = this.getDatasetMeta(i);\n      const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n      controller.buildOrUpdateElements(reset);\n      minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n    }\n    minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n    this._updateLayout(minPadding);\n    if (!animsDisabled) {\n      each(newControllers, (controller) => {\n        controller.reset();\n      });\n    }\n    this._updateDatasets(mode);\n    this.notifyPlugins(\"afterUpdate\", {\n      mode\n    });\n    this._layers.sort(compare2Level(\"z\", \"_idx\"));\n    const { _active, _lastEvent } = this;\n    if (_lastEvent) {\n      this._eventHandler(_lastEvent, true);\n    } else if (_active.length) {\n      this._updateHoverStyles(_active, _active, true);\n    }\n    this.render();\n  }\n  _updateScales() {\n    each(this.scales, (scale) => {\n      layouts.removeBox(this, scale);\n    });\n    this.ensureScalesHaveIDs();\n    this.buildOrUpdateScales();\n  }\n  _checkEventBindings() {\n    const options = this.options;\n    const existingEvents = new Set(Object.keys(this._listeners));\n    const newEvents = new Set(options.events);\n    if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n      this.unbindEvents();\n      this.bindEvents();\n    }\n  }\n  _updateHiddenIndices() {\n    const { _hiddenIndices } = this;\n    const changes = this._getUniformDataChanges() || [];\n    for (const { method, start, count } of changes) {\n      const move = method === \"_removeElements\" ? -count : count;\n      moveNumericKeys(_hiddenIndices, start, move);\n    }\n  }\n  _getUniformDataChanges() {\n    const _dataChanges = this._dataChanges;\n    if (!_dataChanges || !_dataChanges.length) {\n      return;\n    }\n    this._dataChanges = [];\n    const datasetCount = this.data.datasets.length;\n    const makeSet = (idx) => new Set(_dataChanges.filter((c) => c[0] === idx).map((c, i) => i + \",\" + c.splice(1).join(\",\")));\n    const changeSet = makeSet(0);\n    for (let i = 1; i < datasetCount; i++) {\n      if (!setsEqual(changeSet, makeSet(i))) {\n        return;\n      }\n    }\n    return Array.from(changeSet).map((c) => c.split(\",\")).map((a) => ({\n      method: a[1],\n      start: +a[2],\n      count: +a[3]\n    }));\n  }\n  _updateLayout(minPadding) {\n    if (this.notifyPlugins(\"beforeLayout\", {\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    layouts.update(this, this.width, this.height, minPadding);\n    const area = this.chartArea;\n    const noArea = area.width <= 0 || area.height <= 0;\n    this._layers = [];\n    each(this.boxes, (box) => {\n      if (noArea && box.position === \"chartArea\") {\n        return;\n      }\n      if (box.configure) {\n        box.configure();\n      }\n      this._layers.push(...box._layers());\n    }, this);\n    this._layers.forEach((item, index2) => {\n      item._idx = index2;\n    });\n    this.notifyPlugins(\"afterLayout\");\n  }\n  _updateDatasets(mode) {\n    if (this.notifyPlugins(\"beforeDatasetsUpdate\", {\n      mode,\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this.getDatasetMeta(i).controller.configure();\n    }\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._updateDataset(i, isFunction(mode) ? mode({\n        datasetIndex: i\n      }) : mode);\n    }\n    this.notifyPlugins(\"afterDatasetsUpdate\", {\n      mode\n    });\n  }\n  _updateDataset(index2, mode) {\n    const meta = this.getDatasetMeta(index2);\n    const args = {\n      meta,\n      index: index2,\n      mode,\n      cancelable: true\n    };\n    if (this.notifyPlugins(\"beforeDatasetUpdate\", args) === false) {\n      return;\n    }\n    meta.controller._update(mode);\n    args.cancelable = false;\n    this.notifyPlugins(\"afterDatasetUpdate\", args);\n  }\n  render() {\n    if (this.notifyPlugins(\"beforeRender\", {\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    if (animator.has(this)) {\n      if (this.attached && !animator.running(this)) {\n        animator.start(this);\n      }\n    } else {\n      this.draw();\n      onAnimationsComplete({\n        chart: this\n      });\n    }\n  }\n  draw() {\n    let i;\n    if (this._resizeBeforeDraw) {\n      const { width, height } = this._resizeBeforeDraw;\n      this._resizeBeforeDraw = null;\n      this._resize(width, height);\n    }\n    this.clear();\n    if (this.width <= 0 || this.height <= 0) {\n      return;\n    }\n    if (this.notifyPlugins(\"beforeDraw\", {\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    const layers = this._layers;\n    for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n    this._drawDatasets();\n    for (; i < layers.length; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n    this.notifyPlugins(\"afterDraw\");\n  }\n  _getSortedDatasetMetas(filterVisible) {\n    const metasets = this._sortedMetasets;\n    const result = [];\n    let i, ilen;\n    for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n      const meta = metasets[i];\n      if (!filterVisible || meta.visible) {\n        result.push(meta);\n      }\n    }\n    return result;\n  }\n  getSortedVisibleDatasetMetas() {\n    return this._getSortedDatasetMetas(true);\n  }\n  _drawDatasets() {\n    if (this.notifyPlugins(\"beforeDatasetsDraw\", {\n      cancelable: true\n    }) === false) {\n      return;\n    }\n    const metasets = this.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      this._drawDataset(metasets[i]);\n    }\n    this.notifyPlugins(\"afterDatasetsDraw\");\n  }\n  _drawDataset(meta) {\n    const ctx = this.ctx;\n    const args = {\n      meta,\n      index: meta.index,\n      cancelable: true\n    };\n    const clip = getDatasetClipArea(this, meta);\n    if (this.notifyPlugins(\"beforeDatasetDraw\", args) === false) {\n      return;\n    }\n    if (clip) {\n      clipArea(ctx, clip);\n    }\n    meta.controller.draw();\n    if (clip) {\n      unclipArea(ctx);\n    }\n    args.cancelable = false;\n    this.notifyPlugins(\"afterDatasetDraw\", args);\n  }\n  isPointInArea(point) {\n    return _isPointInArea(point, this.chartArea, this._minPadding);\n  }\n  getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n    const method = Interaction.modes[mode];\n    if (typeof method === \"function\") {\n      return method(this, e, options, useFinalPosition);\n    }\n    return [];\n  }\n  getDatasetMeta(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    const metasets = this._metasets;\n    let meta = metasets.filter((x) => x && x._dataset === dataset).pop();\n    if (!meta) {\n      meta = {\n        type: null,\n        data: [],\n        dataset: null,\n        controller: null,\n        hidden: null,\n        xAxisID: null,\n        yAxisID: null,\n        order: dataset && dataset.order || 0,\n        index: datasetIndex,\n        _dataset: dataset,\n        _parsed: [],\n        _sorted: false\n      };\n      metasets.push(meta);\n    }\n    return meta;\n  }\n  getContext() {\n    return this.$context || (this.$context = createContext(null, {\n      chart: this,\n      type: \"chart\"\n    }));\n  }\n  getVisibleDatasetCount() {\n    return this.getSortedVisibleDatasetMetas().length;\n  }\n  isDatasetVisible(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    if (!dataset) {\n      return false;\n    }\n    const meta = this.getDatasetMeta(datasetIndex);\n    return typeof meta.hidden === \"boolean\" ? !meta.hidden : !dataset.hidden;\n  }\n  setDatasetVisibility(datasetIndex, visible) {\n    const meta = this.getDatasetMeta(datasetIndex);\n    meta.hidden = !visible;\n  }\n  toggleDataVisibility(index2) {\n    this._hiddenIndices[index2] = !this._hiddenIndices[index2];\n  }\n  getDataVisibility(index2) {\n    return !this._hiddenIndices[index2];\n  }\n  _updateVisibility(datasetIndex, dataIndex, visible) {\n    const mode = visible ? \"show\" : \"hide\";\n    const meta = this.getDatasetMeta(datasetIndex);\n    const anims = meta.controller._resolveAnimations(void 0, mode);\n    if (defined(dataIndex)) {\n      meta.data[dataIndex].hidden = !visible;\n      this.update();\n    } else {\n      this.setDatasetVisibility(datasetIndex, visible);\n      anims.update(meta, {\n        visible\n      });\n      this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : void 0);\n    }\n  }\n  hide(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, false);\n  }\n  show(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, true);\n  }\n  _destroyDatasetMeta(datasetIndex) {\n    const meta = this._metasets[datasetIndex];\n    if (meta && meta.controller) {\n      meta.controller._destroy();\n    }\n    delete this._metasets[datasetIndex];\n  }\n  _stop() {\n    let i, ilen;\n    this.stop();\n    animator.remove(this);\n    for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._destroyDatasetMeta(i);\n    }\n  }\n  destroy() {\n    this.notifyPlugins(\"beforeDestroy\");\n    const { canvas, ctx } = this;\n    this._stop();\n    this.config.clearCache();\n    if (canvas) {\n      this.unbindEvents();\n      clearCanvas(canvas, ctx);\n      this.platform.releaseContext(ctx);\n      this.canvas = null;\n      this.ctx = null;\n    }\n    delete instances[this.id];\n    this.notifyPlugins(\"afterDestroy\");\n  }\n  toBase64Image(...args) {\n    return this.canvas.toDataURL(...args);\n  }\n  bindEvents() {\n    this.bindUserEvents();\n    if (this.options.responsive) {\n      this.bindResponsiveEvents();\n    } else {\n      this.attached = true;\n    }\n  }\n  bindUserEvents() {\n    const listeners = this._listeners;\n    const platform = this.platform;\n    const _add = (type, listener2) => {\n      platform.addEventListener(this, type, listener2);\n      listeners[type] = listener2;\n    };\n    const listener = (e, x, y) => {\n      e.offsetX = x;\n      e.offsetY = y;\n      this._eventHandler(e);\n    };\n    each(this.options.events, (type) => _add(type, listener));\n  }\n  bindResponsiveEvents() {\n    if (!this._responsiveListeners) {\n      this._responsiveListeners = {};\n    }\n    const listeners = this._responsiveListeners;\n    const platform = this.platform;\n    const _add = (type, listener2) => {\n      platform.addEventListener(this, type, listener2);\n      listeners[type] = listener2;\n    };\n    const _remove = (type, listener2) => {\n      if (listeners[type]) {\n        platform.removeEventListener(this, type, listener2);\n        delete listeners[type];\n      }\n    };\n    const listener = (width, height) => {\n      if (this.canvas) {\n        this.resize(width, height);\n      }\n    };\n    let detached;\n    const attached = () => {\n      _remove(\"attach\", attached);\n      this.attached = true;\n      this.resize();\n      _add(\"resize\", listener);\n      _add(\"detach\", detached);\n    };\n    detached = () => {\n      this.attached = false;\n      _remove(\"resize\", listener);\n      this._stop();\n      this._resize(0, 0);\n      _add(\"attach\", attached);\n    };\n    if (platform.isAttached(this.canvas)) {\n      attached();\n    } else {\n      detached();\n    }\n  }\n  unbindEvents() {\n    each(this._listeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._listeners = {};\n    each(this._responsiveListeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._responsiveListeners = void 0;\n  }\n  updateHoverStyle(items, mode, enabled) {\n    const prefix = enabled ? \"set\" : \"remove\";\n    let meta, item, i, ilen;\n    if (mode === \"dataset\") {\n      meta = this.getDatasetMeta(items[0].datasetIndex);\n      meta.controller[\"_\" + prefix + \"DatasetHoverStyle\"]();\n    }\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      item = items[i];\n      const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n      if (controller) {\n        controller[prefix + \"HoverStyle\"](item.element, item.datasetIndex, item.index);\n      }\n    }\n  }\n  getActiveElements() {\n    return this._active || [];\n  }\n  setActiveElements(activeElements) {\n    const lastActive = this._active || [];\n    const active = activeElements.map(({ datasetIndex, index: index2 }) => {\n      const meta = this.getDatasetMeta(datasetIndex);\n      if (!meta) {\n        throw new Error(\"No dataset found at index \" + datasetIndex);\n      }\n      return {\n        datasetIndex,\n        element: meta.data[index2],\n        index: index2\n      };\n    });\n    const changed = !_elementsEqual(active, lastActive);\n    if (changed) {\n      this._active = active;\n      this._lastEvent = null;\n      this._updateHoverStyles(active, lastActive);\n    }\n  }\n  notifyPlugins(hook, args, filter) {\n    return this._plugins.notify(this, hook, args, filter);\n  }\n  isPluginEnabled(pluginId) {\n    return this._plugins._cache.filter((p) => p.plugin.id === pluginId).length === 1;\n  }\n  _updateHoverStyles(active, lastActive, replay) {\n    const hoverOptions = this.options.hover;\n    const diff = (a, b) => a.filter((x) => !b.some((y) => x.datasetIndex === y.datasetIndex && x.index === y.index));\n    const deactivated = diff(lastActive, active);\n    const activated = replay ? active : diff(active, lastActive);\n    if (deactivated.length) {\n      this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n    }\n    if (activated.length && hoverOptions.mode) {\n      this.updateHoverStyle(activated, hoverOptions.mode, true);\n    }\n  }\n  _eventHandler(e, replay) {\n    const args = {\n      event: e,\n      replay,\n      cancelable: true,\n      inChartArea: this.isPointInArea(e)\n    };\n    const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n    if (this.notifyPlugins(\"beforeEvent\", args, eventFilter) === false) {\n      return;\n    }\n    const changed = this._handleEvent(e, replay, args.inChartArea);\n    args.cancelable = false;\n    this.notifyPlugins(\"afterEvent\", args, eventFilter);\n    if (changed || args.changed) {\n      this.render();\n    }\n    return this;\n  }\n  _handleEvent(e, replay, inChartArea) {\n    const { _active: lastActive = [], options } = this;\n    const useFinalPosition = replay;\n    const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n    const isClick = _isClickEvent(e);\n    const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n    if (inChartArea) {\n      this._lastEvent = null;\n      callback(options.onHover, [\n        e,\n        active,\n        this\n      ], this);\n      if (isClick) {\n        callback(options.onClick, [\n          e,\n          active,\n          this\n        ], this);\n      }\n    }\n    const changed = !_elementsEqual(active, lastActive);\n    if (changed || replay) {\n      this._active = active;\n      this._updateHoverStyles(active, lastActive, replay);\n    }\n    this._lastEvent = lastEvent;\n    return changed;\n  }\n  _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n    if (e.type === \"mouseout\") {\n      return [];\n    }\n    if (!inChartArea) {\n      return lastActive;\n    }\n    const hoverOptions = this.options.hover;\n    return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n  }\n};\n__publicField(Chart, \"defaults\", defaults);\n__publicField(Chart, \"instances\", instances);\n__publicField(Chart, \"overrides\", overrides);\n__publicField(Chart, \"registry\", registry);\n__publicField(Chart, \"version\", version);\n__publicField(Chart, \"getChart\", getChart);\nfunction invalidatePlugins() {\n  return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\nfunction clipSelf(ctx, element, endAngle) {\n  const { startAngle, x, y, outerRadius, innerRadius, options } = element;\n  const { borderWidth, borderJoinStyle } = options;\n  const outerAngleClip = Math.min(borderWidth / outerRadius, _normalizeAngle(startAngle - endAngle));\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius - borderWidth / 2, startAngle + outerAngleClip / 2, endAngle - outerAngleClip / 2);\n  if (innerRadius > 0) {\n    const innerAngleClip = Math.min(borderWidth / innerRadius, _normalizeAngle(startAngle - endAngle));\n    ctx.arc(x, y, innerRadius + borderWidth / 2, endAngle - innerAngleClip / 2, startAngle + innerAngleClip / 2, true);\n  } else {\n    const clipWidth = Math.min(borderWidth / 2, outerRadius * _normalizeAngle(startAngle - endAngle));\n    if (borderJoinStyle === \"round\") {\n      ctx.arc(x, y, clipWidth, endAngle - PI / 2, startAngle + PI / 2, true);\n    } else if (borderJoinStyle === \"bevel\") {\n      const r = 2 * clipWidth * clipWidth;\n      const endX = -r * Math.cos(endAngle + PI / 2) + x;\n      const endY = -r * Math.sin(endAngle + PI / 2) + y;\n      const startX = r * Math.cos(startAngle + PI / 2) + x;\n      const startY = r * Math.sin(startAngle + PI / 2) + y;\n      ctx.lineTo(endX, endY);\n      ctx.lineTo(startX, startY);\n    }\n  }\n  ctx.closePath();\n  ctx.moveTo(0, 0);\n  ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height);\n  ctx.clip(\"evenodd\");\n}\nfunction clipArc(ctx, element, endAngle) {\n  const { startAngle, pixelMargin, x, y, outerRadius, innerRadius } = element;\n  let angleMargin = pixelMargin / outerRadius;\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n  if (innerRadius > pixelMargin) {\n    angleMargin = pixelMargin / innerRadius;\n    ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n  } else {\n    ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n  }\n  ctx.closePath();\n  ctx.clip();\n}\nfunction toRadiusCorners(value) {\n  return _readValueToProps(value, [\n    \"outerStart\",\n    \"outerEnd\",\n    \"innerStart\",\n    \"innerEnd\"\n  ]);\n}\nfunction parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n  const o = toRadiusCorners(arc.options.borderRadius);\n  const halfThickness = (outerRadius - innerRadius) / 2;\n  const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n  const computeOuterLimit = (val) => {\n    const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n    return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n  };\n  return {\n    outerStart: computeOuterLimit(o.outerStart),\n    outerEnd: computeOuterLimit(o.outerEnd),\n    innerStart: _limitValue(o.innerStart, 0, innerLimit),\n    innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n  };\n}\nfunction rThetaToXY(r, theta, x, y) {\n  return {\n    x: x + r * Math.cos(theta),\n    y: y + r * Math.sin(theta)\n  };\n}\nfunction pathArc(ctx, element, offset, spacing, end, circular) {\n  const { x, y, startAngle: start, pixelMargin, innerRadius: innerR } = element;\n  const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n  const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n  let spacingOffset = 0;\n  const alpha2 = end - start;\n  if (spacing) {\n    const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n    const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n    const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n    const adjustedAngle = avNogSpacingRadius !== 0 ? alpha2 * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha2;\n    spacingOffset = (alpha2 - adjustedAngle) / 2;\n  }\n  const beta = Math.max(1e-3, alpha2 * outerRadius - offset / PI) / outerRadius;\n  const angleOffset = (alpha2 - beta) / 2;\n  const startAngle = start + angleOffset + spacingOffset;\n  const endAngle = end - angleOffset - spacingOffset;\n  const { outerStart, outerEnd, innerStart, innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n  const outerStartAdjustedRadius = outerRadius - outerStart;\n  const outerEndAdjustedRadius = outerRadius - outerEnd;\n  const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n  const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n  const innerStartAdjustedRadius = innerRadius + innerStart;\n  const innerEndAdjustedRadius = innerRadius + innerEnd;\n  const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n  const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n  ctx.beginPath();\n  if (circular) {\n    const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n    ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n    ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n    if (outerEnd > 0) {\n      const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n    }\n    const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n    ctx.lineTo(p4.x, p4.y);\n    if (innerEnd > 0) {\n      const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n    }\n    const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n    ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n    ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n    if (innerStart > 0) {\n      const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n    }\n    const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n    ctx.lineTo(p8.x, p8.y);\n    if (outerStart > 0) {\n      const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n    }\n  } else {\n    ctx.moveTo(x, y);\n    const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n    const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n    ctx.lineTo(outerStartX, outerStartY);\n    const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n    const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n    ctx.lineTo(outerEndX, outerEndY);\n  }\n  ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n  const { fullCircles, startAngle, circumference } = element;\n  let endAngle = element.endAngle;\n  if (fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    for (let i = 0; i < fullCircles; ++i) {\n      ctx.fill();\n    }\n    if (!isNaN(circumference)) {\n      endAngle = startAngle + (circumference % TAU || TAU);\n    }\n  }\n  pathArc(ctx, element, offset, spacing, endAngle, circular);\n  ctx.fill();\n  return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n  const { fullCircles, startAngle, circumference, options } = element;\n  const { borderWidth, borderJoinStyle, borderDash, borderDashOffset, borderRadius } = options;\n  const inner = options.borderAlign === \"inner\";\n  if (!borderWidth) {\n    return;\n  }\n  ctx.setLineDash(borderDash || []);\n  ctx.lineDashOffset = borderDashOffset;\n  if (inner) {\n    ctx.lineWidth = borderWidth * 2;\n    ctx.lineJoin = borderJoinStyle || \"round\";\n  } else {\n    ctx.lineWidth = borderWidth;\n    ctx.lineJoin = borderJoinStyle || \"bevel\";\n  }\n  let endAngle = element.endAngle;\n  if (fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    for (let i = 0; i < fullCircles; ++i) {\n      ctx.stroke();\n    }\n    if (!isNaN(circumference)) {\n      endAngle = startAngle + (circumference % TAU || TAU);\n    }\n  }\n  if (inner) {\n    clipArc(ctx, element, endAngle);\n  }\n  if (options.selfJoin && endAngle - startAngle >= PI && borderRadius === 0 && borderJoinStyle !== \"miter\") {\n    clipSelf(ctx, element, endAngle);\n  }\n  if (!fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    ctx.stroke();\n  }\n}\nvar ArcElement = class extends Element {\n  constructor(cfg) {\n    super();\n    __publicField(this, \"circumference\");\n    __publicField(this, \"endAngle\");\n    __publicField(this, \"fullCircles\");\n    __publicField(this, \"innerRadius\");\n    __publicField(this, \"outerRadius\");\n    __publicField(this, \"pixelMargin\");\n    __publicField(this, \"startAngle\");\n    this.options = void 0;\n    this.circumference = void 0;\n    this.startAngle = void 0;\n    this.endAngle = void 0;\n    this.innerRadius = void 0;\n    this.outerRadius = void 0;\n    this.pixelMargin = 0;\n    this.fullCircles = 0;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  inRange(chartX, chartY, useFinalPosition) {\n    const point = this.getProps([\n      \"x\",\n      \"y\"\n    ], useFinalPosition);\n    const { angle, distance } = getAngleFromPoint(point, {\n      x: chartX,\n      y: chartY\n    });\n    const { startAngle, endAngle, innerRadius, outerRadius, circumference } = this.getProps([\n      \"startAngle\",\n      \"endAngle\",\n      \"innerRadius\",\n      \"outerRadius\",\n      \"circumference\"\n    ], useFinalPosition);\n    const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n    const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n    const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle;\n    const betweenAngles = _circumference >= TAU || nonZeroBetween;\n    const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n    return betweenAngles && withinRadius;\n  }\n  getCenterPoint(useFinalPosition) {\n    const { x, y, startAngle, endAngle, innerRadius, outerRadius } = this.getProps([\n      \"x\",\n      \"y\",\n      \"startAngle\",\n      \"endAngle\",\n      \"innerRadius\",\n      \"outerRadius\"\n    ], useFinalPosition);\n    const { offset, spacing } = this.options;\n    const halfAngle = (startAngle + endAngle) / 2;\n    const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n    return {\n      x: x + Math.cos(halfAngle) * halfRadius,\n      y: y + Math.sin(halfAngle) * halfRadius\n    };\n  }\n  tooltipPosition(useFinalPosition) {\n    return this.getCenterPoint(useFinalPosition);\n  }\n  draw(ctx) {\n    const { options, circumference } = this;\n    const offset = (options.offset || 0) / 4;\n    const spacing = (options.spacing || 0) / 2;\n    const circular = options.circular;\n    this.pixelMargin = options.borderAlign === \"inner\" ? 0.33 : 0;\n    this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n    if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n      return;\n    }\n    ctx.save();\n    const halfAngle = (this.startAngle + this.endAngle) / 2;\n    ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n    const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n    const radiusOffset = offset * fix;\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n    drawArc(ctx, this, radiusOffset, spacing, circular);\n    drawBorder(ctx, this, radiusOffset, spacing, circular);\n    ctx.restore();\n  }\n};\n__publicField(ArcElement, \"id\", \"arc\");\n__publicField(ArcElement, \"defaults\", {\n  borderAlign: \"center\",\n  borderColor: \"#fff\",\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: void 0,\n  borderRadius: 0,\n  borderWidth: 2,\n  offset: 0,\n  spacing: 0,\n  angle: void 0,\n  circular: true,\n  selfJoin: false\n});\n__publicField(ArcElement, \"defaultRoutes\", {\n  backgroundColor: \"backgroundColor\"\n});\n__publicField(ArcElement, \"descriptors\", {\n  _scriptable: true,\n  _indexable: (name) => name !== \"borderDash\"\n});\nfunction setStyle(ctx, options, style = options) {\n  ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n  ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n  ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n  ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n  ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n  ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n  ctx.lineTo(target.x, target.y);\n}\nfunction getLineMethod(options) {\n  if (options.stepped) {\n    return _steppedLineTo;\n  }\n  if (options.tension || options.cubicInterpolationMode === \"monotone\") {\n    return _bezierCurveTo;\n  }\n  return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n  const count = points.length;\n  const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;\n  const { start: segmentStart, end: segmentEnd } = segment;\n  const start = Math.max(paramsStart, segmentStart);\n  const end = Math.min(paramsEnd, segmentEnd);\n  const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n  return {\n    count,\n    start,\n    loop: segment.loop,\n    ilen: end < start && !outside ? count + end - start : end - start\n  };\n}\nfunction pathSegment(ctx, line, segment, params) {\n  const { points, options } = line;\n  const { count, start, loop, ilen } = pathVars(points, segment, params);\n  const lineMethod = getLineMethod(options);\n  let { move = true, reverse } = params || {};\n  let i, point, prev;\n  for (i = 0; i <= ilen; ++i) {\n    point = points[(start + (reverse ? ilen - i : i)) % count];\n    if (point.skip) {\n      continue;\n    } else if (move) {\n      ctx.moveTo(point.x, point.y);\n      move = false;\n    } else {\n      lineMethod(ctx, prev, point, reverse, options.stepped);\n    }\n    prev = point;\n  }\n  if (loop) {\n    point = points[(start + (reverse ? ilen : 0)) % count];\n    lineMethod(ctx, prev, point, reverse, options.stepped);\n  }\n  return !!loop;\n}\nfunction fastPathSegment(ctx, line, segment, params) {\n  const points = line.points;\n  const { count, start, ilen } = pathVars(points, segment, params);\n  const { move = true, reverse } = params || {};\n  let avgX = 0;\n  let countX = 0;\n  let i, point, prevX, minY, maxY, lastY;\n  const pointIndex = (index2) => (start + (reverse ? ilen - index2 : index2)) % count;\n  const drawX = () => {\n    if (minY !== maxY) {\n      ctx.lineTo(avgX, maxY);\n      ctx.lineTo(avgX, minY);\n      ctx.lineTo(avgX, lastY);\n    }\n  };\n  if (move) {\n    point = points[pointIndex(0)];\n    ctx.moveTo(point.x, point.y);\n  }\n  for (i = 0; i <= ilen; ++i) {\n    point = points[pointIndex(i)];\n    if (point.skip) {\n      continue;\n    }\n    const x = point.x;\n    const y = point.y;\n    const truncX = x | 0;\n    if (truncX === prevX) {\n      if (y < minY) {\n        minY = y;\n      } else if (y > maxY) {\n        maxY = y;\n      }\n      avgX = (countX * avgX + x) / ++countX;\n    } else {\n      drawX();\n      ctx.lineTo(x, y);\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n    }\n    lastY = y;\n  }\n  drawX();\n}\nfunction _getSegmentMethod(line) {\n  const opts = line.options;\n  const borderDash = opts.borderDash && opts.borderDash.length;\n  const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== \"monotone\" && !opts.stepped && !borderDash;\n  return useFastPath ? fastPathSegment : pathSegment;\n}\nfunction _getInterpolationMethod(options) {\n  if (options.stepped) {\n    return _steppedInterpolation;\n  }\n  if (options.tension || options.cubicInterpolationMode === \"monotone\") {\n    return _bezierInterpolation;\n  }\n  return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n  let path = line._path;\n  if (!path) {\n    path = line._path = new Path2D();\n    if (line.path(path, start, count)) {\n      path.closePath();\n    }\n  }\n  setStyle(ctx, line.options);\n  ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n  const { segments, options } = line;\n  const segmentMethod = _getSegmentMethod(line);\n  for (const segment of segments) {\n    setStyle(ctx, options, segment.style);\n    ctx.beginPath();\n    if (segmentMethod(ctx, line, segment, {\n      start,\n      end: start + count - 1\n    })) {\n      ctx.closePath();\n    }\n    ctx.stroke();\n  }\n}\nvar usePath2D = typeof Path2D === \"function\";\nfunction draw(ctx, line, start, count) {\n  if (usePath2D && !line.options.segment) {\n    strokePathWithCache(ctx, line, start, count);\n  } else {\n    strokePathDirect(ctx, line, start, count);\n  }\n}\nvar LineElement = class extends Element {\n  constructor(cfg) {\n    super();\n    this.animated = true;\n    this.options = void 0;\n    this._chart = void 0;\n    this._loop = void 0;\n    this._fullLoop = void 0;\n    this._path = void 0;\n    this._points = void 0;\n    this._segments = void 0;\n    this._decimated = false;\n    this._pointsUpdated = false;\n    this._datasetIndex = void 0;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  updateControlPoints(chartArea, indexAxis) {\n    const options = this.options;\n    if ((options.tension || options.cubicInterpolationMode === \"monotone\") && !options.stepped && !this._pointsUpdated) {\n      const loop = options.spanGaps ? this._loop : this._fullLoop;\n      _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n      this._pointsUpdated = true;\n    }\n  }\n  set points(points) {\n    this._points = points;\n    delete this._segments;\n    delete this._path;\n    this._pointsUpdated = false;\n  }\n  get points() {\n    return this._points;\n  }\n  get segments() {\n    return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n  }\n  first() {\n    const segments = this.segments;\n    const points = this.points;\n    return segments.length && points[segments[0].start];\n  }\n  last() {\n    const segments = this.segments;\n    const points = this.points;\n    const count = segments.length;\n    return count && points[segments[count - 1].end];\n  }\n  interpolate(point, property) {\n    const options = this.options;\n    const value = point[property];\n    const points = this.points;\n    const segments = _boundSegments(this, {\n      property,\n      start: value,\n      end: value\n    });\n    if (!segments.length) {\n      return;\n    }\n    const result = [];\n    const _interpolate = _getInterpolationMethod(options);\n    let i, ilen;\n    for (i = 0, ilen = segments.length; i < ilen; ++i) {\n      const { start, end } = segments[i];\n      const p1 = points[start];\n      const p2 = points[end];\n      if (p1 === p2) {\n        result.push(p1);\n        continue;\n      }\n      const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n      const interpolated = _interpolate(p1, p2, t, options.stepped);\n      interpolated[property] = point[property];\n      result.push(interpolated);\n    }\n    return result.length === 1 ? result[0] : result;\n  }\n  pathSegment(ctx, segment, params) {\n    const segmentMethod = _getSegmentMethod(this);\n    return segmentMethod(ctx, this, segment, params);\n  }\n  path(ctx, start, count) {\n    const segments = this.segments;\n    const segmentMethod = _getSegmentMethod(this);\n    let loop = this._loop;\n    start = start || 0;\n    count = count || this.points.length - start;\n    for (const segment of segments) {\n      loop &= segmentMethod(ctx, this, segment, {\n        start,\n        end: start + count - 1\n      });\n    }\n    return !!loop;\n  }\n  draw(ctx, chartArea, start, count) {\n    const options = this.options || {};\n    const points = this.points || [];\n    if (points.length && options.borderWidth) {\n      ctx.save();\n      draw(ctx, this, start, count);\n      ctx.restore();\n    }\n    if (this.animated) {\n      this._pointsUpdated = false;\n      this._path = void 0;\n    }\n  }\n};\n__publicField(LineElement, \"id\", \"line\");\n__publicField(LineElement, \"defaults\", {\n  borderCapStyle: \"butt\",\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: \"miter\",\n  borderWidth: 3,\n  capBezierPoints: true,\n  cubicInterpolationMode: \"default\",\n  fill: false,\n  spanGaps: false,\n  stepped: false,\n  tension: 0\n});\n__publicField(LineElement, \"defaultRoutes\", {\n  backgroundColor: \"backgroundColor\",\n  borderColor: \"borderColor\"\n});\n__publicField(LineElement, \"descriptors\", {\n  _scriptable: true,\n  _indexable: (name) => name !== \"borderDash\" && name !== \"fill\"\n});\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n  const options = el.options;\n  const { [axis]: value } = el.getProps([\n    axis\n  ], useFinalPosition);\n  return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nvar PointElement = class extends Element {\n  constructor(cfg) {\n    super();\n    __publicField(this, \"parsed\");\n    __publicField(this, \"skip\");\n    __publicField(this, \"stop\");\n    this.options = void 0;\n    this.parsed = void 0;\n    this.skip = void 0;\n    this.stop = void 0;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  inRange(mouseX, mouseY, useFinalPosition) {\n    const options = this.options;\n    const { x, y } = this.getProps([\n      \"x\",\n      \"y\"\n    ], useFinalPosition);\n    return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n  }\n  inXRange(mouseX, useFinalPosition) {\n    return inRange$1(this, mouseX, \"x\", useFinalPosition);\n  }\n  inYRange(mouseY, useFinalPosition) {\n    return inRange$1(this, mouseY, \"y\", useFinalPosition);\n  }\n  getCenterPoint(useFinalPosition) {\n    const { x, y } = this.getProps([\n      \"x\",\n      \"y\"\n    ], useFinalPosition);\n    return {\n      x,\n      y\n    };\n  }\n  size(options) {\n    options = options || this.options || {};\n    let radius = options.radius || 0;\n    radius = Math.max(radius, radius && options.hoverRadius || 0);\n    const borderWidth = radius && options.borderWidth || 0;\n    return (radius + borderWidth) * 2;\n  }\n  draw(ctx, area) {\n    const options = this.options;\n    if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n      return;\n    }\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n    ctx.fillStyle = options.backgroundColor;\n    drawPoint(ctx, options, this.x, this.y);\n  }\n  getRange() {\n    const options = this.options || {};\n    return options.radius + options.hitRadius;\n  }\n};\n__publicField(PointElement, \"id\", \"point\");\n/**\n* @type {any}\n*/\n__publicField(PointElement, \"defaults\", {\n  borderWidth: 1,\n  hitRadius: 1,\n  hoverBorderWidth: 1,\n  hoverRadius: 4,\n  pointStyle: \"circle\",\n  radius: 3,\n  rotation: 0\n});\n/**\n* @type {any}\n*/\n__publicField(PointElement, \"defaultRoutes\", {\n  backgroundColor: \"backgroundColor\",\n  borderColor: \"borderColor\"\n});\nfunction getBarBounds(bar, useFinalPosition) {\n  const { x, y, base, width, height } = bar.getProps([\n    \"x\",\n    \"y\",\n    \"base\",\n    \"width\",\n    \"height\"\n  ], useFinalPosition);\n  let left, right, top, bottom, half;\n  if (bar.horizontal) {\n    half = height / 2;\n    left = Math.min(x, base);\n    right = Math.max(x, base);\n    top = y - half;\n    bottom = y + half;\n  } else {\n    half = width / 2;\n    left = x - half;\n    right = x + half;\n    top = Math.min(y, base);\n    bottom = Math.max(y, base);\n  }\n  return {\n    left,\n    top,\n    right,\n    bottom\n  };\n}\nfunction skipOrLimit(skip2, value, min, max) {\n  return skip2 ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n  const value = bar.options.borderWidth;\n  const skip2 = bar.borderSkipped;\n  const o = toTRBL(value);\n  return {\n    t: skipOrLimit(skip2.top, o.top, 0, maxH),\n    r: skipOrLimit(skip2.right, o.right, 0, maxW),\n    b: skipOrLimit(skip2.bottom, o.bottom, 0, maxH),\n    l: skipOrLimit(skip2.left, o.left, 0, maxW)\n  };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n  const { enableBorderRadius } = bar.getProps([\n    \"enableBorderRadius\"\n  ]);\n  const value = bar.options.borderRadius;\n  const o = toTRBLCorners(value);\n  const maxR = Math.min(maxW, maxH);\n  const skip2 = bar.borderSkipped;\n  const enableBorder = enableBorderRadius || isObject(value);\n  return {\n    topLeft: skipOrLimit(!enableBorder || skip2.top || skip2.left, o.topLeft, 0, maxR),\n    topRight: skipOrLimit(!enableBorder || skip2.top || skip2.right, o.topRight, 0, maxR),\n    bottomLeft: skipOrLimit(!enableBorder || skip2.bottom || skip2.left, o.bottomLeft, 0, maxR),\n    bottomRight: skipOrLimit(!enableBorder || skip2.bottom || skip2.right, o.bottomRight, 0, maxR)\n  };\n}\nfunction boundingRects(bar) {\n  const bounds = getBarBounds(bar);\n  const width = bounds.right - bounds.left;\n  const height = bounds.bottom - bounds.top;\n  const border = parseBorderWidth(bar, width / 2, height / 2);\n  const radius = parseBorderRadius(bar, width / 2, height / 2);\n  return {\n    outer: {\n      x: bounds.left,\n      y: bounds.top,\n      w: width,\n      h: height,\n      radius\n    },\n    inner: {\n      x: bounds.left + border.l,\n      y: bounds.top + border.t,\n      w: width - border.l - border.r,\n      h: height - border.t - border.b,\n      radius: {\n        topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n        topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n        bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n        bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n      }\n    }\n  };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n  const skipX = x === null;\n  const skipY = y === null;\n  const skipBoth = skipX && skipY;\n  const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n  return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n  return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction addNormalRectPath(ctx, rect) {\n  ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n  const x = rect.x !== refRect.x ? -amount : 0;\n  const y = rect.y !== refRect.y ? -amount : 0;\n  const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n  const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n  return {\n    x: rect.x + x,\n    y: rect.y + y,\n    w: rect.w + w,\n    h: rect.h + h,\n    radius: rect.radius\n  };\n}\nvar BarElement = class extends Element {\n  constructor(cfg) {\n    super();\n    this.options = void 0;\n    this.horizontal = void 0;\n    this.base = void 0;\n    this.width = void 0;\n    this.height = void 0;\n    this.inflateAmount = void 0;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  draw(ctx) {\n    const { inflateAmount, options: { borderColor, backgroundColor } } = this;\n    const { inner, outer } = boundingRects(this);\n    const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n    ctx.save();\n    if (outer.w !== inner.w || outer.h !== inner.h) {\n      ctx.beginPath();\n      addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n      ctx.clip();\n      addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n      ctx.fillStyle = borderColor;\n      ctx.fill(\"evenodd\");\n    }\n    ctx.beginPath();\n    addRectPath(ctx, inflateRect(inner, inflateAmount));\n    ctx.fillStyle = backgroundColor;\n    ctx.fill();\n    ctx.restore();\n  }\n  inRange(mouseX, mouseY, useFinalPosition) {\n    return inRange(this, mouseX, mouseY, useFinalPosition);\n  }\n  inXRange(mouseX, useFinalPosition) {\n    return inRange(this, mouseX, null, useFinalPosition);\n  }\n  inYRange(mouseY, useFinalPosition) {\n    return inRange(this, null, mouseY, useFinalPosition);\n  }\n  getCenterPoint(useFinalPosition) {\n    const { x, y, base, horizontal } = this.getProps([\n      \"x\",\n      \"y\",\n      \"base\",\n      \"horizontal\"\n    ], useFinalPosition);\n    return {\n      x: horizontal ? (x + base) / 2 : x,\n      y: horizontal ? y : (y + base) / 2\n    };\n  }\n  getRange(axis) {\n    return axis === \"x\" ? this.width / 2 : this.height / 2;\n  }\n};\n__publicField(BarElement, \"id\", \"bar\");\n__publicField(BarElement, \"defaults\", {\n  borderSkipped: \"start\",\n  borderWidth: 0,\n  borderRadius: 0,\n  inflateAmount: \"auto\",\n  pointStyle: void 0\n});\n__publicField(BarElement, \"defaultRoutes\", {\n  backgroundColor: \"backgroundColor\",\n  borderColor: \"borderColor\"\n});\nvar elements = /* @__PURE__ */ Object.freeze({\n  __proto__: null,\n  ArcElement,\n  BarElement,\n  LineElement,\n  PointElement\n});\nvar BORDER_COLORS = [\n  \"rgb(54, 162, 235)\",\n  \"rgb(255, 99, 132)\",\n  \"rgb(255, 159, 64)\",\n  \"rgb(255, 205, 86)\",\n  \"rgb(75, 192, 192)\",\n  \"rgb(153, 102, 255)\",\n  \"rgb(201, 203, 207)\"\n  // grey\n];\nvar BACKGROUND_COLORS = /* @__PURE__ */ BORDER_COLORS.map((color2) => color2.replace(\"rgb(\", \"rgba(\").replace(\")\", \", 0.5)\"));\nfunction getBorderColor(i) {\n  return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n  return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n  dataset.borderColor = getBorderColor(i);\n  dataset.backgroundColor = getBackgroundColor(i);\n  return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n  dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n  return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n  dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n  return i;\n}\nfunction getColorizer(chart) {\n  let i = 0;\n  return (dataset, datasetIndex) => {\n    const controller = chart.getDatasetMeta(datasetIndex).controller;\n    if (controller instanceof DoughnutController) {\n      i = colorizeDoughnutDataset(dataset, i);\n    } else if (controller instanceof PolarAreaController) {\n      i = colorizePolarAreaDataset(dataset, i);\n    } else if (controller) {\n      i = colorizeDefaultDataset(dataset, i);\n    }\n  };\n}\nfunction containsColorsDefinitions(descriptors2) {\n  let k;\n  for (k in descriptors2) {\n    if (descriptors2[k].borderColor || descriptors2[k].backgroundColor) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction containsColorsDefinition(descriptor) {\n  return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nfunction containsDefaultColorsDefenitions() {\n  return defaults.borderColor !== \"rgba(0,0,0,0.1)\" || defaults.backgroundColor !== \"rgba(0,0,0,0.1)\";\n}\nvar plugin_colors = {\n  id: \"colors\",\n  defaults: {\n    enabled: true,\n    forceOverride: false\n  },\n  beforeLayout(chart, _args, options) {\n    if (!options.enabled) {\n      return;\n    }\n    const { data: { datasets }, options: chartOptions } = chart.config;\n    const { elements: elements2 } = chartOptions;\n    const containsColorDefenition = containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements2 && containsColorsDefinitions(elements2) || containsDefaultColorsDefenitions();\n    if (!options.forceOverride && containsColorDefenition) {\n      return;\n    }\n    const colorizer = getColorizer(chart);\n    datasets.forEach(colorizer);\n  }\n};\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n  const samples = options.samples || availableWidth;\n  if (samples >= count) {\n    return data.slice(start, start + count);\n  }\n  const decimated = [];\n  const bucketWidth = (count - 2) / (samples - 2);\n  let sampledIndex = 0;\n  const endIndex = start + count - 1;\n  let a = start;\n  let i, maxAreaPoint, maxArea, area, nextA;\n  decimated[sampledIndex++] = data[a];\n  for (i = 0; i < samples - 2; i++) {\n    let avgX = 0;\n    let avgY = 0;\n    let j;\n    const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n    const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n    const avgRangeLength = avgRangeEnd - avgRangeStart;\n    for (j = avgRangeStart; j < avgRangeEnd; j++) {\n      avgX += data[j].x;\n      avgY += data[j].y;\n    }\n    avgX /= avgRangeLength;\n    avgY /= avgRangeLength;\n    const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n    const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n    const { x: pointAx, y: pointAy } = data[a];\n    maxArea = area = -1;\n    for (j = rangeOffs; j < rangeTo; j++) {\n      area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n      if (area > maxArea) {\n        maxArea = area;\n        maxAreaPoint = data[j];\n        nextA = j;\n      }\n    }\n    decimated[sampledIndex++] = maxAreaPoint;\n    a = nextA;\n  }\n  decimated[sampledIndex++] = data[endIndex];\n  return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n  let avgX = 0;\n  let countX = 0;\n  let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n  const decimated = [];\n  const endIndex = start + count - 1;\n  const xMin = data[start].x;\n  const xMax = data[endIndex].x;\n  const dx = xMax - xMin;\n  for (i = start; i < start + count; ++i) {\n    point = data[i];\n    x = (point.x - xMin) / dx * availableWidth;\n    y = point.y;\n    const truncX = x | 0;\n    if (truncX === prevX) {\n      if (y < minY) {\n        minY = y;\n        minIndex = i;\n      } else if (y > maxY) {\n        maxY = y;\n        maxIndex = i;\n      }\n      avgX = (countX * avgX + point.x) / ++countX;\n    } else {\n      const lastIndex = i - 1;\n      if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n        const intermediateIndex1 = Math.min(minIndex, maxIndex);\n        const intermediateIndex2 = Math.max(minIndex, maxIndex);\n        if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex1],\n            x: avgX\n          });\n        }\n        if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex2],\n            x: avgX\n          });\n        }\n      }\n      if (i > 0 && lastIndex !== startIndex) {\n        decimated.push(data[lastIndex]);\n      }\n      decimated.push(point);\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n      minIndex = maxIndex = startIndex = i;\n    }\n  }\n  return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n  if (dataset._decimated) {\n    const data = dataset._data;\n    delete dataset._decimated;\n    delete dataset._data;\n    Object.defineProperty(dataset, \"data\", {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value: data\n    });\n  }\n}\nfunction cleanDecimatedData(chart) {\n  chart.data.datasets.forEach((dataset) => {\n    cleanDecimatedDataset(dataset);\n  });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n  const pointCount = points.length;\n  let start = 0;\n  let count;\n  const { iScale } = meta;\n  const { min, max, minDefined, maxDefined } = iScale.getUserBounds();\n  if (minDefined) {\n    start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n  }\n  if (maxDefined) {\n    count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n  } else {\n    count = pointCount - start;\n  }\n  return {\n    start,\n    count\n  };\n}\nvar plugin_decimation = {\n  id: \"decimation\",\n  defaults: {\n    algorithm: \"min-max\",\n    enabled: false\n  },\n  beforeElementsUpdate: (chart, args, options) => {\n    if (!options.enabled) {\n      cleanDecimatedData(chart);\n      return;\n    }\n    const availableWidth = chart.width;\n    chart.data.datasets.forEach((dataset, datasetIndex) => {\n      const { _data, indexAxis } = dataset;\n      const meta = chart.getDatasetMeta(datasetIndex);\n      const data = _data || dataset.data;\n      if (resolve([\n        indexAxis,\n        chart.options.indexAxis\n      ]) === \"y\") {\n        return;\n      }\n      if (!meta.controller.supportsDecimation) {\n        return;\n      }\n      const xAxis = chart.scales[meta.xAxisID];\n      if (xAxis.type !== \"linear\" && xAxis.type !== \"time\") {\n        return;\n      }\n      if (chart.options.parsing) {\n        return;\n      }\n      let { start, count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n      const threshold = options.threshold || 4 * availableWidth;\n      if (count <= threshold) {\n        cleanDecimatedDataset(dataset);\n        return;\n      }\n      if (isNullOrUndef(_data)) {\n        dataset._data = data;\n        delete dataset.data;\n        Object.defineProperty(dataset, \"data\", {\n          configurable: true,\n          enumerable: true,\n          get: function() {\n            return this._decimated;\n          },\n          set: function(d) {\n            this._data = d;\n          }\n        });\n      }\n      let decimated;\n      switch (options.algorithm) {\n        case \"lttb\":\n          decimated = lttbDecimation(data, start, count, availableWidth, options);\n          break;\n        case \"min-max\":\n          decimated = minMaxDecimation(data, start, count, availableWidth);\n          break;\n        default:\n          throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n      }\n      dataset._decimated = decimated;\n    });\n  },\n  destroy(chart) {\n    cleanDecimatedData(chart);\n  }\n};\nfunction _segments(line, target, property) {\n  const segments = line.segments;\n  const points = line.points;\n  const tpoints = target.points;\n  const parts = [];\n  for (const segment of segments) {\n    let { start, end } = segment;\n    end = _findSegmentEnd(start, end, points);\n    const bounds = _getBounds(property, points[start], points[end], segment.loop);\n    if (!target.segments) {\n      parts.push({\n        source: segment,\n        target: bounds,\n        start: points[start],\n        end: points[end]\n      });\n      continue;\n    }\n    const targetSegments = _boundSegments(target, bounds);\n    for (const tgt of targetSegments) {\n      const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n      const fillSources = _boundSegment(segment, points, subBounds);\n      for (const fillSource of fillSources) {\n        parts.push({\n          source: fillSource,\n          target: tgt,\n          start: {\n            [property]: _getEdge(bounds, subBounds, \"start\", Math.max)\n          },\n          end: {\n            [property]: _getEdge(bounds, subBounds, \"end\", Math.min)\n          }\n        });\n      }\n    }\n  }\n  return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n  if (loop) {\n    return;\n  }\n  let start = first[property];\n  let end = last[property];\n  if (property === \"angle\") {\n    start = _normalizeAngle(start);\n    end = _normalizeAngle(end);\n  }\n  return {\n    property,\n    start,\n    end\n  };\n}\nfunction _pointsFromSegments(boundary, line) {\n  const { x = null, y = null } = boundary || {};\n  const linePoints = line.points;\n  const points = [];\n  line.segments.forEach(({ start, end }) => {\n    end = _findSegmentEnd(start, end, linePoints);\n    const first = linePoints[start];\n    const last = linePoints[end];\n    if (y !== null) {\n      points.push({\n        x: first.x,\n        y\n      });\n      points.push({\n        x: last.x,\n        y\n      });\n    } else if (x !== null) {\n      points.push({\n        x,\n        y: first.y\n      });\n      points.push({\n        x,\n        y: last.y\n      });\n    }\n  });\n  return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n  for (; end > start; end--) {\n    const point = points[end];\n    if (!isNaN(point.x) && !isNaN(point.y)) {\n      break;\n    }\n  }\n  return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n  if (a && b) {\n    return fn(a[prop], b[prop]);\n  }\n  return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction _createBoundaryLine(boundary, line) {\n  let points = [];\n  let _loop = false;\n  if (isArray(boundary)) {\n    _loop = true;\n    points = boundary;\n  } else {\n    points = _pointsFromSegments(boundary, line);\n  }\n  return points.length ? new LineElement({\n    points,\n    options: {\n      tension: 0\n    },\n    _loop,\n    _fullLoop: _loop\n  }) : null;\n}\nfunction _shouldApplyFill(source) {\n  return source && source.fill !== false;\n}\nfunction _resolveTarget(sources, index2, propagate) {\n  const source = sources[index2];\n  let fill2 = source.fill;\n  const visited = [\n    index2\n  ];\n  let target;\n  if (!propagate) {\n    return fill2;\n  }\n  while (fill2 !== false && visited.indexOf(fill2) === -1) {\n    if (!isNumberFinite(fill2)) {\n      return fill2;\n    }\n    target = sources[fill2];\n    if (!target) {\n      return false;\n    }\n    if (target.visible) {\n      return fill2;\n    }\n    visited.push(fill2);\n    fill2 = target.fill;\n  }\n  return false;\n}\nfunction _decodeFill(line, index2, count) {\n  const fill2 = parseFillOption(line);\n  if (isObject(fill2)) {\n    return isNaN(fill2.value) ? false : fill2;\n  }\n  let target = parseFloat(fill2);\n  if (isNumberFinite(target) && Math.floor(target) === target) {\n    return decodeTargetIndex(fill2[0], index2, target, count);\n  }\n  return [\n    \"origin\",\n    \"start\",\n    \"end\",\n    \"stack\",\n    \"shape\"\n  ].indexOf(fill2) >= 0 && fill2;\n}\nfunction decodeTargetIndex(firstCh, index2, target, count) {\n  if (firstCh === \"-\" || firstCh === \"+\") {\n    target = index2 + target;\n  }\n  if (target === index2 || target < 0 || target >= count) {\n    return false;\n  }\n  return target;\n}\nfunction _getTargetPixel(fill2, scale) {\n  let pixel = null;\n  if (fill2 === \"start\") {\n    pixel = scale.bottom;\n  } else if (fill2 === \"end\") {\n    pixel = scale.top;\n  } else if (isObject(fill2)) {\n    pixel = scale.getPixelForValue(fill2.value);\n  } else if (scale.getBasePixel) {\n    pixel = scale.getBasePixel();\n  }\n  return pixel;\n}\nfunction _getTargetValue(fill2, scale, startValue) {\n  let value;\n  if (fill2 === \"start\") {\n    value = startValue;\n  } else if (fill2 === \"end\") {\n    value = scale.options.reverse ? scale.min : scale.max;\n  } else if (isObject(fill2)) {\n    value = fill2.value;\n  } else {\n    value = scale.getBaseValue();\n  }\n  return value;\n}\nfunction parseFillOption(line) {\n  const options = line.options;\n  const fillOption = options.fill;\n  let fill2 = valueOrDefault(fillOption && fillOption.target, fillOption);\n  if (fill2 === void 0) {\n    fill2 = !!options.backgroundColor;\n  }\n  if (fill2 === false || fill2 === null) {\n    return false;\n  }\n  if (fill2 === true) {\n    return \"origin\";\n  }\n  return fill2;\n}\nfunction _buildStackLine(source) {\n  const { scale, index: index2, line } = source;\n  const points = [];\n  const segments = line.segments;\n  const sourcePoints = line.points;\n  const linesBelow = getLinesBelow(scale, index2);\n  linesBelow.push(_createBoundaryLine({\n    x: null,\n    y: scale.bottom\n  }, line));\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    for (let j = segment.start; j <= segment.end; j++) {\n      addPointsBelow(points, sourcePoints[j], linesBelow);\n    }\n  }\n  return new LineElement({\n    points,\n    options: {}\n  });\n}\nfunction getLinesBelow(scale, index2) {\n  const below = [];\n  const metas = scale.getMatchingVisibleMetas(\"line\");\n  for (let i = 0; i < metas.length; i++) {\n    const meta = metas[i];\n    if (meta.index === index2) {\n      break;\n    }\n    if (!meta.hidden) {\n      below.unshift(meta.dataset);\n    }\n  }\n  return below;\n}\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n  const postponed = [];\n  for (let j = 0; j < linesBelow.length; j++) {\n    const line = linesBelow[j];\n    const { first, last, point } = findPoint(line, sourcePoint, \"x\");\n    if (!point || first && last) {\n      continue;\n    }\n    if (first) {\n      postponed.unshift(point);\n    } else {\n      points.push(point);\n      if (!last) {\n        break;\n      }\n    }\n  }\n  points.push(...postponed);\n}\nfunction findPoint(line, sourcePoint, property) {\n  const point = line.interpolate(sourcePoint, property);\n  if (!point) {\n    return {};\n  }\n  const pointValue = point[property];\n  const segments = line.segments;\n  const linePoints = line.points;\n  let first = false;\n  let last = false;\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    const firstValue = linePoints[segment.start][property];\n    const lastValue = linePoints[segment.end][property];\n    if (_isBetween(pointValue, firstValue, lastValue)) {\n      first = pointValue === firstValue;\n      last = pointValue === lastValue;\n      break;\n    }\n  }\n  return {\n    first,\n    last,\n    point\n  };\n}\nvar simpleArc = class {\n  constructor(opts) {\n    this.x = opts.x;\n    this.y = opts.y;\n    this.radius = opts.radius;\n  }\n  pathSegment(ctx, bounds, opts) {\n    const { x, y, radius } = this;\n    bounds = bounds || {\n      start: 0,\n      end: TAU\n    };\n    ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n    return !opts.bounds;\n  }\n  interpolate(point) {\n    const { x, y, radius } = this;\n    const angle = point.angle;\n    return {\n      x: x + Math.cos(angle) * radius,\n      y: y + Math.sin(angle) * radius,\n      angle\n    };\n  }\n};\nfunction _getTarget(source) {\n  const { chart, fill: fill2, line } = source;\n  if (isNumberFinite(fill2)) {\n    return getLineByIndex(chart, fill2);\n  }\n  if (fill2 === \"stack\") {\n    return _buildStackLine(source);\n  }\n  if (fill2 === \"shape\") {\n    return true;\n  }\n  const boundary = computeBoundary(source);\n  if (boundary instanceof simpleArc) {\n    return boundary;\n  }\n  return _createBoundaryLine(boundary, line);\n}\nfunction getLineByIndex(chart, index2) {\n  const meta = chart.getDatasetMeta(index2);\n  const visible = meta && chart.isDatasetVisible(index2);\n  return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n  const scale = source.scale || {};\n  if (scale.getPointPositionForValue) {\n    return computeCircularBoundary(source);\n  }\n  return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n  const { scale = {}, fill: fill2 } = source;\n  const pixel = _getTargetPixel(fill2, scale);\n  if (isNumberFinite(pixel)) {\n    const horizontal = scale.isHorizontal();\n    return {\n      x: horizontal ? pixel : null,\n      y: horizontal ? null : pixel\n    };\n  }\n  return null;\n}\nfunction computeCircularBoundary(source) {\n  const { scale, fill: fill2 } = source;\n  const options = scale.options;\n  const length = scale.getLabels().length;\n  const start = options.reverse ? scale.max : scale.min;\n  const value = _getTargetValue(fill2, scale, start);\n  const target = [];\n  if (options.grid.circular) {\n    const center = scale.getPointPositionForValue(0, start);\n    return new simpleArc({\n      x: center.x,\n      y: center.y,\n      radius: scale.getDistanceFromCenterForValue(value)\n    });\n  }\n  for (let i = 0; i < length; ++i) {\n    target.push(scale.getPointPositionForValue(i, value));\n  }\n  return target;\n}\nfunction _drawfill(ctx, source, area) {\n  const target = _getTarget(source);\n  const { chart, index: index2, line, scale, axis } = source;\n  const lineOpts = line.options;\n  const fillOption = lineOpts.fill;\n  const color2 = lineOpts.backgroundColor;\n  const { above = color2, below = color2 } = fillOption || {};\n  const meta = chart.getDatasetMeta(index2);\n  const clip = getDatasetClipArea(chart, meta);\n  if (target && line.points.length) {\n    clipArea(ctx, area);\n    doFill(ctx, {\n      line,\n      target,\n      above,\n      below,\n      area,\n      scale,\n      axis,\n      clip\n    });\n    unclipArea(ctx);\n  }\n}\nfunction doFill(ctx, cfg) {\n  const { line, target, above, below, area, scale, clip } = cfg;\n  const property = line._loop ? \"angle\" : cfg.axis;\n  ctx.save();\n  let fillColor = below;\n  if (below !== above) {\n    if (property === \"x\") {\n      clipVertical(ctx, target, area.top);\n      fill(ctx, {\n        line,\n        target,\n        color: above,\n        scale,\n        property,\n        clip\n      });\n      ctx.restore();\n      ctx.save();\n      clipVertical(ctx, target, area.bottom);\n    } else if (property === \"y\") {\n      clipHorizontal(ctx, target, area.left);\n      fill(ctx, {\n        line,\n        target,\n        color: below,\n        scale,\n        property,\n        clip\n      });\n      ctx.restore();\n      ctx.save();\n      clipHorizontal(ctx, target, area.right);\n      fillColor = above;\n    }\n  }\n  fill(ctx, {\n    line,\n    target,\n    color: fillColor,\n    scale,\n    property,\n    clip\n  });\n  ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n  const { segments, points } = target;\n  let first = true;\n  let lineLoop = false;\n  ctx.beginPath();\n  for (const segment of segments) {\n    const { start, end } = segment;\n    const firstPoint = points[start];\n    const lastPoint = points[_findSegmentEnd(start, end, points)];\n    if (first) {\n      ctx.moveTo(firstPoint.x, firstPoint.y);\n      first = false;\n    } else {\n      ctx.lineTo(firstPoint.x, clipY);\n      ctx.lineTo(firstPoint.x, firstPoint.y);\n    }\n    lineLoop = !!target.pathSegment(ctx, segment, {\n      move: lineLoop\n    });\n    if (lineLoop) {\n      ctx.closePath();\n    } else {\n      ctx.lineTo(lastPoint.x, clipY);\n    }\n  }\n  ctx.lineTo(target.first().x, clipY);\n  ctx.closePath();\n  ctx.clip();\n}\nfunction clipHorizontal(ctx, target, clipX) {\n  const { segments, points } = target;\n  let first = true;\n  let lineLoop = false;\n  ctx.beginPath();\n  for (const segment of segments) {\n    const { start, end } = segment;\n    const firstPoint = points[start];\n    const lastPoint = points[_findSegmentEnd(start, end, points)];\n    if (first) {\n      ctx.moveTo(firstPoint.x, firstPoint.y);\n      first = false;\n    } else {\n      ctx.lineTo(clipX, firstPoint.y);\n      ctx.lineTo(firstPoint.x, firstPoint.y);\n    }\n    lineLoop = !!target.pathSegment(ctx, segment, {\n      move: lineLoop\n    });\n    if (lineLoop) {\n      ctx.closePath();\n    } else {\n      ctx.lineTo(clipX, lastPoint.y);\n    }\n  }\n  ctx.lineTo(clipX, target.first().y);\n  ctx.closePath();\n  ctx.clip();\n}\nfunction fill(ctx, cfg) {\n  const { line, target, property, color: color2, scale, clip } = cfg;\n  const segments = _segments(line, target, property);\n  for (const { source: src, target: tgt, start, end } of segments) {\n    const { style: { backgroundColor = color2 } = {} } = src;\n    const notShape = target !== true;\n    ctx.save();\n    ctx.fillStyle = backgroundColor;\n    clipBounds(ctx, scale, clip, notShape && _getBounds(property, start, end));\n    ctx.beginPath();\n    const lineLoop = !!line.pathSegment(ctx, src);\n    let loop;\n    if (notShape) {\n      if (lineLoop) {\n        ctx.closePath();\n      } else {\n        interpolatedLineTo(ctx, target, end, property);\n      }\n      const targetLoop = !!target.pathSegment(ctx, tgt, {\n        move: lineLoop,\n        reverse: true\n      });\n      loop = lineLoop && targetLoop;\n      if (!loop) {\n        interpolatedLineTo(ctx, target, start, property);\n      }\n    }\n    ctx.closePath();\n    ctx.fill(loop ? \"evenodd\" : \"nonzero\");\n    ctx.restore();\n  }\n}\nfunction clipBounds(ctx, scale, clip, bounds) {\n  const chartArea = scale.chart.chartArea;\n  const { property, start, end } = bounds || {};\n  if (property === \"x\" || property === \"y\") {\n    let left, top, right, bottom;\n    if (property === \"x\") {\n      left = start;\n      top = chartArea.top;\n      right = end;\n      bottom = chartArea.bottom;\n    } else {\n      left = chartArea.left;\n      top = start;\n      right = chartArea.right;\n      bottom = end;\n    }\n    ctx.beginPath();\n    if (clip) {\n      left = Math.max(left, clip.left);\n      right = Math.min(right, clip.right);\n      top = Math.max(top, clip.top);\n      bottom = Math.min(bottom, clip.bottom);\n    }\n    ctx.rect(left, top, right - left, bottom - top);\n    ctx.clip();\n  }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n  const interpolatedPoint = target.interpolate(point, property);\n  if (interpolatedPoint) {\n    ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n  }\n}\nvar index = {\n  id: \"filler\",\n  afterDatasetsUpdate(chart, _args, options) {\n    const count = (chart.data.datasets || []).length;\n    const sources = [];\n    let meta, i, line, source;\n    for (i = 0; i < count; ++i) {\n      meta = chart.getDatasetMeta(i);\n      line = meta.dataset;\n      source = null;\n      if (line && line.options && line instanceof LineElement) {\n        source = {\n          visible: chart.isDatasetVisible(i),\n          index: i,\n          fill: _decodeFill(line, i, count),\n          chart,\n          axis: meta.controller.options.indexAxis,\n          scale: meta.vScale,\n          line\n        };\n      }\n      meta.$filler = source;\n      sources.push(source);\n    }\n    for (i = 0; i < count; ++i) {\n      source = sources[i];\n      if (!source || source.fill === false) {\n        continue;\n      }\n      source.fill = _resolveTarget(sources, i, options.propagate);\n    }\n  },\n  beforeDraw(chart, _args, options) {\n    const draw2 = options.drawTime === \"beforeDraw\";\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    const area = chart.chartArea;\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n      if (!source) {\n        continue;\n      }\n      source.line.updateControlPoints(area, source.axis);\n      if (draw2 && source.fill) {\n        _drawfill(chart.ctx, source, area);\n      }\n    }\n  },\n  beforeDatasetsDraw(chart, _args, options) {\n    if (options.drawTime !== \"beforeDatasetsDraw\") {\n      return;\n    }\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n      if (_shouldApplyFill(source)) {\n        _drawfill(chart.ctx, source, chart.chartArea);\n      }\n    }\n  },\n  beforeDatasetDraw(chart, args, options) {\n    const source = args.meta.$filler;\n    if (!_shouldApplyFill(source) || options.drawTime !== \"beforeDatasetDraw\") {\n      return;\n    }\n    _drawfill(chart.ctx, source, chart.chartArea);\n  },\n  defaults: {\n    propagate: true,\n    drawTime: \"beforeDatasetDraw\"\n  }\n};\nvar getBoxSize = (labelOpts, fontSize) => {\n  let { boxHeight = fontSize, boxWidth = fontSize } = labelOpts;\n  if (labelOpts.usePointStyle) {\n    boxHeight = Math.min(boxHeight, fontSize);\n    boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n  }\n  return {\n    boxWidth,\n    boxHeight,\n    itemHeight: Math.max(fontSize, boxHeight)\n  };\n};\nvar itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nvar Legend = class extends Element {\n  constructor(config) {\n    super();\n    this._added = false;\n    this.legendHitBoxes = [];\n    this._hoveredItem = null;\n    this.doughnutMode = false;\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this.legendItems = void 0;\n    this.columnSizes = void 0;\n    this.lineWidths = void 0;\n    this.maxHeight = void 0;\n    this.maxWidth = void 0;\n    this.top = void 0;\n    this.bottom = void 0;\n    this.left = void 0;\n    this.right = void 0;\n    this.height = void 0;\n    this.width = void 0;\n    this._margins = void 0;\n    this.position = void 0;\n    this.weight = void 0;\n    this.fullSize = void 0;\n  }\n  update(maxWidth, maxHeight, margins) {\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins;\n    this.setDimensions();\n    this.buildLabels();\n    this.fit();\n  }\n  setDimensions() {\n    if (this.isHorizontal()) {\n      this.width = this.maxWidth;\n      this.left = this._margins.left;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n      this.top = this._margins.top;\n      this.bottom = this.height;\n    }\n  }\n  buildLabels() {\n    const labelOpts = this.options.labels || {};\n    let legendItems = callback(labelOpts.generateLabels, [\n      this.chart\n    ], this) || [];\n    if (labelOpts.filter) {\n      legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n    }\n    if (labelOpts.sort) {\n      legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n    }\n    if (this.options.reverse) {\n      legendItems.reverse();\n    }\n    this.legendItems = legendItems;\n  }\n  fit() {\n    const { options, ctx } = this;\n    if (!options.display) {\n      this.width = this.height = 0;\n      return;\n    }\n    const labelOpts = options.labels;\n    const labelFont = toFont(labelOpts.font);\n    const fontSize = labelFont.size;\n    const titleHeight = this._computeTitleHeight();\n    const { boxWidth, itemHeight } = getBoxSize(labelOpts, fontSize);\n    let width, height;\n    ctx.font = labelFont.string;\n    if (this.isHorizontal()) {\n      width = this.maxWidth;\n      height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n    } else {\n      height = this.maxHeight;\n      width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n    }\n    this.width = Math.min(width, options.maxWidth || this.maxWidth);\n    this.height = Math.min(height, options.maxHeight || this.maxHeight);\n  }\n  _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n    const { ctx, maxWidth, options: { labels: { padding } } } = this;\n    const hitboxes = this.legendHitBoxes = [];\n    const lineWidths = this.lineWidths = [\n      0\n    ];\n    const lineHeight = itemHeight + padding;\n    let totalHeight = titleHeight;\n    ctx.textAlign = \"left\";\n    ctx.textBaseline = \"middle\";\n    let row = -1;\n    let top = -lineHeight;\n    this.legendItems.forEach((legendItem, i) => {\n      const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n      if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n        totalHeight += lineHeight;\n        lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n        top += lineHeight;\n        row++;\n      }\n      hitboxes[i] = {\n        left: 0,\n        top,\n        row,\n        width: itemWidth,\n        height: itemHeight\n      };\n      lineWidths[lineWidths.length - 1] += itemWidth + padding;\n    });\n    return totalHeight;\n  }\n  _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n    const { ctx, maxHeight, options: { labels: { padding } } } = this;\n    const hitboxes = this.legendHitBoxes = [];\n    const columnSizes = this.columnSizes = [];\n    const heightLimit = maxHeight - titleHeight;\n    let totalWidth = padding;\n    let currentColWidth = 0;\n    let currentColHeight = 0;\n    let left = 0;\n    let col = 0;\n    this.legendItems.forEach((legendItem, i) => {\n      const { itemWidth, itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n      if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n        totalWidth += currentColWidth + padding;\n        columnSizes.push({\n          width: currentColWidth,\n          height: currentColHeight\n        });\n        left += currentColWidth + padding;\n        col++;\n        currentColWidth = currentColHeight = 0;\n      }\n      hitboxes[i] = {\n        left,\n        top: currentColHeight,\n        col,\n        width: itemWidth,\n        height: itemHeight\n      };\n      currentColWidth = Math.max(currentColWidth, itemWidth);\n      currentColHeight += itemHeight + padding;\n    });\n    totalWidth += currentColWidth;\n    columnSizes.push({\n      width: currentColWidth,\n      height: currentColHeight\n    });\n    return totalWidth;\n  }\n  adjustHitBoxes() {\n    if (!this.options.display) {\n      return;\n    }\n    const titleHeight = this._computeTitleHeight();\n    const { legendHitBoxes: hitboxes, options: { align, labels: { padding }, rtl } } = this;\n    const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n    if (this.isHorizontal()) {\n      let row = 0;\n      let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n      for (const hitbox of hitboxes) {\n        if (row !== hitbox.row) {\n          row = hitbox.row;\n          left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n        }\n        hitbox.top += this.top + titleHeight + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n        left += hitbox.width + padding;\n      }\n    } else {\n      let col = 0;\n      let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n      for (const hitbox of hitboxes) {\n        if (hitbox.col !== col) {\n          col = hitbox.col;\n          top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n        }\n        hitbox.top = top;\n        hitbox.left += this.left + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n        top += hitbox.height + padding;\n      }\n    }\n  }\n  isHorizontal() {\n    return this.options.position === \"top\" || this.options.position === \"bottom\";\n  }\n  draw() {\n    if (this.options.display) {\n      const ctx = this.ctx;\n      clipArea(ctx, this);\n      this._draw();\n      unclipArea(ctx);\n    }\n  }\n  _draw() {\n    const { options: opts, columnSizes, lineWidths, ctx } = this;\n    const { align, labels: labelOpts } = opts;\n    const defaultColor = defaults.color;\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const labelFont = toFont(labelOpts.font);\n    const { padding } = labelOpts;\n    const fontSize = labelFont.size;\n    const halfFontSize = fontSize / 2;\n    let cursor;\n    this.drawTitle();\n    ctx.textAlign = rtlHelper.textAlign(\"left\");\n    ctx.textBaseline = \"middle\";\n    ctx.lineWidth = 0.5;\n    ctx.font = labelFont.string;\n    const { boxWidth, boxHeight, itemHeight } = getBoxSize(labelOpts, fontSize);\n    const drawLegendBox = function(x, y, legendItem) {\n      if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n        return;\n      }\n      ctx.save();\n      const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n      ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n      ctx.lineCap = valueOrDefault(legendItem.lineCap, \"butt\");\n      ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n      ctx.lineJoin = valueOrDefault(legendItem.lineJoin, \"miter\");\n      ctx.lineWidth = lineWidth;\n      ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n      ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n      if (labelOpts.usePointStyle) {\n        const drawOptions = {\n          radius: boxHeight * Math.SQRT2 / 2,\n          pointStyle: legendItem.pointStyle,\n          rotation: legendItem.rotation,\n          borderWidth: lineWidth\n        };\n        const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n        const centerY = y + halfFontSize;\n        drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n      } else {\n        const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n        const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n        const borderRadius = toTRBLCorners(legendItem.borderRadius);\n        ctx.beginPath();\n        if (Object.values(borderRadius).some((v) => v !== 0)) {\n          addRoundedRectPath(ctx, {\n            x: xBoxLeft,\n            y: yBoxTop,\n            w: boxWidth,\n            h: boxHeight,\n            radius: borderRadius\n          });\n        } else {\n          ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n        }\n        ctx.fill();\n        if (lineWidth !== 0) {\n          ctx.stroke();\n        }\n      }\n      ctx.restore();\n    };\n    const fillText = function(x, y, legendItem) {\n      renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n        strikethrough: legendItem.hidden,\n        textAlign: rtlHelper.textAlign(legendItem.textAlign)\n      });\n    };\n    const isHorizontal = this.isHorizontal();\n    const titleHeight = this._computeTitleHeight();\n    if (isHorizontal) {\n      cursor = {\n        x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n        y: this.top + padding + titleHeight,\n        line: 0\n      };\n    } else {\n      cursor = {\n        x: this.left + padding,\n        y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n        line: 0\n      };\n    }\n    overrideTextDirection(this.ctx, opts.textDirection);\n    const lineHeight = itemHeight + padding;\n    this.legendItems.forEach((legendItem, i) => {\n      ctx.strokeStyle = legendItem.fontColor;\n      ctx.fillStyle = legendItem.fontColor;\n      const textWidth = ctx.measureText(legendItem.text).width;\n      const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n      const width = boxWidth + halfFontSize + textWidth;\n      let x = cursor.x;\n      let y = cursor.y;\n      rtlHelper.setWidth(this.width);\n      if (isHorizontal) {\n        if (i > 0 && x + width + padding > this.right) {\n          y = cursor.y += lineHeight;\n          cursor.line++;\n          x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n        }\n      } else if (i > 0 && y + lineHeight > this.bottom) {\n        x = cursor.x = x + columnSizes[cursor.line].width + padding;\n        cursor.line++;\n        y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n      }\n      const realX = rtlHelper.x(x);\n      drawLegendBox(realX, y, legendItem);\n      x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n      fillText(rtlHelper.x(x), y, legendItem);\n      if (isHorizontal) {\n        cursor.x += width + padding;\n      } else if (typeof legendItem.text !== \"string\") {\n        const fontLineHeight = labelFont.lineHeight;\n        cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n      } else {\n        cursor.y += lineHeight;\n      }\n    });\n    restoreTextDirection(this.ctx, opts.textDirection);\n  }\n  drawTitle() {\n    const opts = this.options;\n    const titleOpts = opts.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n    if (!titleOpts.display) {\n      return;\n    }\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const ctx = this.ctx;\n    const position = titleOpts.position;\n    const halfFontSize = titleFont.size / 2;\n    const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n    let y;\n    let left = this.left;\n    let maxWidth = this.width;\n    if (this.isHorizontal()) {\n      maxWidth = Math.max(...this.lineWidths);\n      y = this.top + topPaddingPlusHalfFontSize;\n      left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n    } else {\n      const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n      y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n    }\n    const x = _alignStartEnd(position, left, left + maxWidth);\n    ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n    ctx.textBaseline = \"middle\";\n    ctx.strokeStyle = titleOpts.color;\n    ctx.fillStyle = titleOpts.color;\n    ctx.font = titleFont.string;\n    renderText(ctx, titleOpts.text, x, y, titleFont);\n  }\n  _computeTitleHeight() {\n    const titleOpts = this.options.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n    return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n  }\n  _getLegendItemAt(x, y) {\n    let i, hitBox, lh;\n    if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n      lh = this.legendHitBoxes;\n      for (i = 0; i < lh.length; ++i) {\n        hitBox = lh[i];\n        if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n          return this.legendItems[i];\n        }\n      }\n    }\n    return null;\n  }\n  handleEvent(e) {\n    const opts = this.options;\n    if (!isListened(e.type, opts)) {\n      return;\n    }\n    const hoveredItem = this._getLegendItemAt(e.x, e.y);\n    if (e.type === \"mousemove\" || e.type === \"mouseout\") {\n      const previous = this._hoveredItem;\n      const sameItem = itemsEqual(previous, hoveredItem);\n      if (previous && !sameItem) {\n        callback(opts.onLeave, [\n          e,\n          previous,\n          this\n        ], this);\n      }\n      this._hoveredItem = hoveredItem;\n      if (hoveredItem && !sameItem) {\n        callback(opts.onHover, [\n          e,\n          hoveredItem,\n          this\n        ], this);\n      }\n    } else if (hoveredItem) {\n      callback(opts.onClick, [\n        e,\n        hoveredItem,\n        this\n      ], this);\n    }\n  }\n};\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n  const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n  const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n  return {\n    itemWidth,\n    itemHeight\n  };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n  let legendItemText = legendItem.text;\n  if (legendItemText && typeof legendItemText !== \"string\") {\n    legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n  }\n  return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n  let itemHeight = _itemHeight;\n  if (typeof legendItem.text !== \"string\") {\n    itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n  }\n  return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n  const labelHeight = legendItem.text ? legendItem.text.length : 0;\n  return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n  if ((type === \"mousemove\" || type === \"mouseout\") && (opts.onHover || opts.onLeave)) {\n    return true;\n  }\n  if (opts.onClick && (type === \"click\" || type === \"mouseup\")) {\n    return true;\n  }\n  return false;\n}\nvar plugin_legend = {\n  id: \"legend\",\n  _element: Legend,\n  start(chart, _args, options) {\n    const legend = chart.legend = new Legend({\n      ctx: chart.ctx,\n      options,\n      chart\n    });\n    layouts.configure(chart, legend, options);\n    layouts.addBox(chart, legend);\n  },\n  stop(chart) {\n    layouts.removeBox(chart, chart.legend);\n    delete chart.legend;\n  },\n  beforeUpdate(chart, _args, options) {\n    const legend = chart.legend;\n    layouts.configure(chart, legend, options);\n    legend.options = options;\n  },\n  afterUpdate(chart) {\n    const legend = chart.legend;\n    legend.buildLabels();\n    legend.adjustHitBoxes();\n  },\n  afterEvent(chart, args) {\n    if (!args.replay) {\n      chart.legend.handleEvent(args.event);\n    }\n  },\n  defaults: {\n    display: true,\n    position: \"top\",\n    align: \"center\",\n    fullSize: true,\n    reverse: false,\n    weight: 1e3,\n    onClick(e, legendItem, legend) {\n      const index2 = legendItem.datasetIndex;\n      const ci = legend.chart;\n      if (ci.isDatasetVisible(index2)) {\n        ci.hide(index2);\n        legendItem.hidden = true;\n      } else {\n        ci.show(index2);\n        legendItem.hidden = false;\n      }\n    },\n    onHover: null,\n    onLeave: null,\n    labels: {\n      color: (ctx) => ctx.chart.options.color,\n      boxWidth: 40,\n      padding: 10,\n      generateLabels(chart) {\n        const datasets = chart.data.datasets;\n        const { labels: { usePointStyle, pointStyle, textAlign, color: color2, useBorderRadius, borderRadius } } = chart.legend.options;\n        return chart._getSortedDatasetMetas().map((meta) => {\n          const style = meta.controller.getStyle(usePointStyle ? 0 : void 0);\n          const borderWidth = toPadding(style.borderWidth);\n          return {\n            text: datasets[meta.index].label,\n            fillStyle: style.backgroundColor,\n            fontColor: color2,\n            hidden: !meta.visible,\n            lineCap: style.borderCapStyle,\n            lineDash: style.borderDash,\n            lineDashOffset: style.borderDashOffset,\n            lineJoin: style.borderJoinStyle,\n            lineWidth: (borderWidth.width + borderWidth.height) / 4,\n            strokeStyle: style.borderColor,\n            pointStyle: pointStyle || style.pointStyle,\n            rotation: style.rotation,\n            textAlign: textAlign || style.textAlign,\n            borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n            datasetIndex: meta.index\n          };\n        }, this);\n      }\n    },\n    title: {\n      color: (ctx) => ctx.chart.options.color,\n      display: false,\n      position: \"center\",\n      text: \"\"\n    }\n  },\n  descriptors: {\n    _scriptable: (name) => !name.startsWith(\"on\"),\n    labels: {\n      _scriptable: (name) => ![\n        \"generateLabels\",\n        \"filter\",\n        \"sort\"\n      ].includes(name)\n    }\n  }\n};\nvar Title = class extends Element {\n  constructor(config) {\n    super();\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this._padding = void 0;\n    this.top = void 0;\n    this.bottom = void 0;\n    this.left = void 0;\n    this.right = void 0;\n    this.width = void 0;\n    this.height = void 0;\n    this.position = void 0;\n    this.weight = void 0;\n    this.fullSize = void 0;\n  }\n  update(maxWidth, maxHeight) {\n    const opts = this.options;\n    this.left = 0;\n    this.top = 0;\n    if (!opts.display) {\n      this.width = this.height = this.right = this.bottom = 0;\n      return;\n    }\n    this.width = this.right = maxWidth;\n    this.height = this.bottom = maxHeight;\n    const lineCount = isArray(opts.text) ? opts.text.length : 1;\n    this._padding = toPadding(opts.padding);\n    const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n    if (this.isHorizontal()) {\n      this.height = textSize;\n    } else {\n      this.width = textSize;\n    }\n  }\n  isHorizontal() {\n    const pos = this.options.position;\n    return pos === \"top\" || pos === \"bottom\";\n  }\n  _drawArgs(offset) {\n    const { top, left, bottom, right, options } = this;\n    const align = options.align;\n    let rotation = 0;\n    let maxWidth, titleX, titleY;\n    if (this.isHorizontal()) {\n      titleX = _alignStartEnd(align, left, right);\n      titleY = top + offset;\n      maxWidth = right - left;\n    } else {\n      if (options.position === \"left\") {\n        titleX = left + offset;\n        titleY = _alignStartEnd(align, bottom, top);\n        rotation = PI * -0.5;\n      } else {\n        titleX = right - offset;\n        titleY = _alignStartEnd(align, top, bottom);\n        rotation = PI * 0.5;\n      }\n      maxWidth = bottom - top;\n    }\n    return {\n      titleX,\n      titleY,\n      maxWidth,\n      rotation\n    };\n  }\n  draw() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    if (!opts.display) {\n      return;\n    }\n    const fontOpts = toFont(opts.font);\n    const lineHeight = fontOpts.lineHeight;\n    const offset = lineHeight / 2 + this._padding.top;\n    const { titleX, titleY, maxWidth, rotation } = this._drawArgs(offset);\n    renderText(ctx, opts.text, 0, 0, fontOpts, {\n      color: opts.color,\n      maxWidth,\n      rotation,\n      textAlign: _toLeftRightCenter(opts.align),\n      textBaseline: \"middle\",\n      translation: [\n        titleX,\n        titleY\n      ]\n    });\n  }\n};\nfunction createTitle(chart, titleOpts) {\n  const title = new Title({\n    ctx: chart.ctx,\n    options: titleOpts,\n    chart\n  });\n  layouts.configure(chart, title, titleOpts);\n  layouts.addBox(chart, title);\n  chart.titleBlock = title;\n}\nvar plugin_title = {\n  id: \"title\",\n  _element: Title,\n  start(chart, _args, options) {\n    createTitle(chart, options);\n  },\n  stop(chart) {\n    const titleBlock = chart.titleBlock;\n    layouts.removeBox(chart, titleBlock);\n    delete chart.titleBlock;\n  },\n  beforeUpdate(chart, _args, options) {\n    const title = chart.titleBlock;\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n  defaults: {\n    align: \"center\",\n    display: false,\n    font: {\n      weight: \"bold\"\n    },\n    fullSize: true,\n    padding: 10,\n    position: \"top\",\n    text: \"\",\n    weight: 2e3\n  },\n  defaultRoutes: {\n    color: \"color\"\n  },\n  descriptors: {\n    _scriptable: true,\n    _indexable: false\n  }\n};\nvar map2 = /* @__PURE__ */ new WeakMap();\nvar plugin_subtitle = {\n  id: \"subtitle\",\n  start(chart, _args, options) {\n    const title = new Title({\n      ctx: chart.ctx,\n      options,\n      chart\n    });\n    layouts.configure(chart, title, options);\n    layouts.addBox(chart, title);\n    map2.set(chart, title);\n  },\n  stop(chart) {\n    layouts.removeBox(chart, map2.get(chart));\n    map2.delete(chart);\n  },\n  beforeUpdate(chart, _args, options) {\n    const title = map2.get(chart);\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n  defaults: {\n    align: \"center\",\n    display: false,\n    font: {\n      weight: \"normal\"\n    },\n    fullSize: true,\n    padding: 0,\n    position: \"top\",\n    text: \"\",\n    weight: 1500\n  },\n  defaultRoutes: {\n    color: \"color\"\n  },\n  descriptors: {\n    _scriptable: true,\n    _indexable: false\n  }\n};\nvar positioners = {\n  average(items) {\n    if (!items.length) {\n      return false;\n    }\n    let i, len;\n    let xSet = /* @__PURE__ */ new Set();\n    let y = 0;\n    let count = 0;\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const pos = el.tooltipPosition();\n        xSet.add(pos.x);\n        y += pos.y;\n        ++count;\n      }\n    }\n    if (count === 0 || xSet.size === 0) {\n      return false;\n    }\n    const xAverage = [\n      ...xSet\n    ].reduce((a, b) => a + b) / xSet.size;\n    return {\n      x: xAverage,\n      y: y / count\n    };\n  },\n  nearest(items, eventPosition) {\n    if (!items.length) {\n      return false;\n    }\n    let x = eventPosition.x;\n    let y = eventPosition.y;\n    let minDistance = Number.POSITIVE_INFINITY;\n    let i, len, nearestElement;\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const center = el.getCenterPoint();\n        const d = distanceBetweenPoints(eventPosition, center);\n        if (d < minDistance) {\n          minDistance = d;\n          nearestElement = el;\n        }\n      }\n    }\n    if (nearestElement) {\n      const tp = nearestElement.tooltipPosition();\n      x = tp.x;\n      y = tp.y;\n    }\n    return {\n      x,\n      y\n    };\n  }\n};\nfunction pushOrConcat(base, toPush) {\n  if (toPush) {\n    if (isArray(toPush)) {\n      Array.prototype.push.apply(base, toPush);\n    } else {\n      base.push(toPush);\n    }\n  }\n  return base;\n}\nfunction splitNewlines(str) {\n  if ((typeof str === \"string\" || str instanceof String) && str.indexOf(\"\\n\") > -1) {\n    return str.split(\"\\n\");\n  }\n  return str;\n}\nfunction createTooltipItem(chart, item) {\n  const { element, datasetIndex, index: index2 } = item;\n  const controller = chart.getDatasetMeta(datasetIndex).controller;\n  const { label, value } = controller.getLabelAndValue(index2);\n  return {\n    chart,\n    label,\n    parsed: controller.getParsed(index2),\n    raw: chart.data.datasets[datasetIndex].data[index2],\n    formattedValue: value,\n    dataset: controller.getDataset(),\n    dataIndex: index2,\n    datasetIndex,\n    element\n  };\n}\nfunction getTooltipSize(tooltip, options) {\n  const ctx = tooltip.chart.ctx;\n  const { body, footer, title } = tooltip;\n  const { boxWidth, boxHeight } = options;\n  const bodyFont = toFont(options.bodyFont);\n  const titleFont = toFont(options.titleFont);\n  const footerFont = toFont(options.footerFont);\n  const titleLineCount = title.length;\n  const footerLineCount = footer.length;\n  const bodyLineItemCount = body.length;\n  const padding = toPadding(options.padding);\n  let height = padding.height;\n  let width = 0;\n  let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n  combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n  if (titleLineCount) {\n    height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n  }\n  if (combinedBodyLength) {\n    const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n    height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n  }\n  if (footerLineCount) {\n    height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n  }\n  let widthPadding = 0;\n  const maxLineWidth = function(line) {\n    width = Math.max(width, ctx.measureText(line).width + widthPadding);\n  };\n  ctx.save();\n  ctx.font = titleFont.string;\n  each(tooltip.title, maxLineWidth);\n  ctx.font = bodyFont.string;\n  each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n  widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n  each(body, (bodyItem) => {\n    each(bodyItem.before, maxLineWidth);\n    each(bodyItem.lines, maxLineWidth);\n    each(bodyItem.after, maxLineWidth);\n  });\n  widthPadding = 0;\n  ctx.font = footerFont.string;\n  each(tooltip.footer, maxLineWidth);\n  ctx.restore();\n  width += padding.width;\n  return {\n    width,\n    height\n  };\n}\nfunction determineYAlign(chart, size) {\n  const { y, height } = size;\n  if (y < height / 2) {\n    return \"top\";\n  } else if (y > chart.height - height / 2) {\n    return \"bottom\";\n  }\n  return \"center\";\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n  const { x, width } = size;\n  const caret = options.caretSize + options.caretPadding;\n  if (xAlign === \"left\" && x + width + caret > chart.width) {\n    return true;\n  }\n  if (xAlign === \"right\" && x - width - caret < 0) {\n    return true;\n  }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n  const { x, width } = size;\n  const { width: chartWidth, chartArea: { left, right } } = chart;\n  let xAlign = \"center\";\n  if (yAlign === \"center\") {\n    xAlign = x <= (left + right) / 2 ? \"left\" : \"right\";\n  } else if (x <= width / 2) {\n    xAlign = \"left\";\n  } else if (x >= chartWidth - width / 2) {\n    xAlign = \"right\";\n  }\n  if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n    xAlign = \"center\";\n  }\n  return xAlign;\n}\nfunction determineAlignment(chart, options, size) {\n  const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n  return {\n    xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n    yAlign\n  };\n}\nfunction alignX(size, xAlign) {\n  let { x, width } = size;\n  if (xAlign === \"right\") {\n    x -= width;\n  } else if (xAlign === \"center\") {\n    x -= width / 2;\n  }\n  return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n  let { y, height } = size;\n  if (yAlign === \"top\") {\n    y += paddingAndSize;\n  } else if (yAlign === \"bottom\") {\n    y -= height + paddingAndSize;\n  } else {\n    y -= height / 2;\n  }\n  return y;\n}\nfunction getBackgroundPoint(options, size, alignment, chart) {\n  const { caretSize, caretPadding, cornerRadius } = options;\n  const { xAlign, yAlign } = alignment;\n  const paddingAndSize = caretSize + caretPadding;\n  const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);\n  let x = alignX(size, xAlign);\n  const y = alignY(size, yAlign, paddingAndSize);\n  if (yAlign === \"center\") {\n    if (xAlign === \"left\") {\n      x += paddingAndSize;\n    } else if (xAlign === \"right\") {\n      x -= paddingAndSize;\n    }\n  } else if (xAlign === \"left\") {\n    x -= Math.max(topLeft, bottomLeft) + caretSize;\n  } else if (xAlign === \"right\") {\n    x += Math.max(topRight, bottomRight) + caretSize;\n  }\n  return {\n    x: _limitValue(x, 0, chart.width - size.width),\n    y: _limitValue(y, 0, chart.height - size.height)\n  };\n}\nfunction getAlignedX(tooltip, align, options) {\n  const padding = toPadding(options.padding);\n  return align === \"center\" ? tooltip.x + tooltip.width / 2 : align === \"right\" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\nfunction getBeforeAfterBodyLines(callback2) {\n  return pushOrConcat([], splitNewlines(callback2));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n  return createContext(parent, {\n    tooltip,\n    tooltipItems,\n    type: \"tooltip\"\n  });\n}\nfunction overrideCallbacks(callbacks, context) {\n  const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n  return override ? callbacks.override(override) : callbacks;\n}\nvar defaultCallbacks = {\n  beforeTitle: noop,\n  title(tooltipItems) {\n    if (tooltipItems.length > 0) {\n      const item = tooltipItems[0];\n      const labels = item.chart.data.labels;\n      const labelCount = labels ? labels.length : 0;\n      if (this && this.options && this.options.mode === \"dataset\") {\n        return item.dataset.label || \"\";\n      } else if (item.label) {\n        return item.label;\n      } else if (labelCount > 0 && item.dataIndex < labelCount) {\n        return labels[item.dataIndex];\n      }\n    }\n    return \"\";\n  },\n  afterTitle: noop,\n  beforeBody: noop,\n  beforeLabel: noop,\n  label(tooltipItem) {\n    if (this && this.options && this.options.mode === \"dataset\") {\n      return tooltipItem.label + \": \" + tooltipItem.formattedValue || tooltipItem.formattedValue;\n    }\n    let label = tooltipItem.dataset.label || \"\";\n    if (label) {\n      label += \": \";\n    }\n    const value = tooltipItem.formattedValue;\n    if (!isNullOrUndef(value)) {\n      label += value;\n    }\n    return label;\n  },\n  labelColor(tooltipItem) {\n    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n    const options = meta.controller.getStyle(tooltipItem.dataIndex);\n    return {\n      borderColor: options.borderColor,\n      backgroundColor: options.backgroundColor,\n      borderWidth: options.borderWidth,\n      borderDash: options.borderDash,\n      borderDashOffset: options.borderDashOffset,\n      borderRadius: 0\n    };\n  },\n  labelTextColor() {\n    return this.options.bodyColor;\n  },\n  labelPointStyle(tooltipItem) {\n    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n    const options = meta.controller.getStyle(tooltipItem.dataIndex);\n    return {\n      pointStyle: options.pointStyle,\n      rotation: options.rotation\n    };\n  },\n  afterLabel: noop,\n  afterBody: noop,\n  beforeFooter: noop,\n  footer: noop,\n  afterFooter: noop\n};\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n  const result = callbacks[name].call(ctx, arg);\n  if (typeof result === \"undefined\") {\n    return defaultCallbacks[name].call(ctx, arg);\n  }\n  return result;\n}\nvar Tooltip = class extends Element {\n  constructor(config) {\n    super();\n    this.opacity = 0;\n    this._active = [];\n    this._eventPosition = void 0;\n    this._size = void 0;\n    this._cachedAnimations = void 0;\n    this._tooltipItems = [];\n    this.$animations = void 0;\n    this.$context = void 0;\n    this.chart = config.chart;\n    this.options = config.options;\n    this.dataPoints = void 0;\n    this.title = void 0;\n    this.beforeBody = void 0;\n    this.body = void 0;\n    this.afterBody = void 0;\n    this.footer = void 0;\n    this.xAlign = void 0;\n    this.yAlign = void 0;\n    this.x = void 0;\n    this.y = void 0;\n    this.height = void 0;\n    this.width = void 0;\n    this.caretX = void 0;\n    this.caretY = void 0;\n    this.labelColors = void 0;\n    this.labelPointStyles = void 0;\n    this.labelTextColors = void 0;\n  }\n  initialize(options) {\n    this.options = options;\n    this._cachedAnimations = void 0;\n    this.$context = void 0;\n  }\n  _resolveAnimations() {\n    const cached = this._cachedAnimations;\n    if (cached) {\n      return cached;\n    }\n    const chart = this.chart;\n    const options = this.options.setContext(this.getContext());\n    const opts = options.enabled && chart.options.animation && options.animations;\n    const animations = new Animations(this.chart, opts);\n    if (opts._cacheable) {\n      this._cachedAnimations = Object.freeze(animations);\n    }\n    return animations;\n  }\n  getContext() {\n    return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n  }\n  getTitle(context, options) {\n    const { callbacks } = options;\n    const beforeTitle = invokeCallbackWithFallback(callbacks, \"beforeTitle\", this, context);\n    const title = invokeCallbackWithFallback(callbacks, \"title\", this, context);\n    const afterTitle = invokeCallbackWithFallback(callbacks, \"afterTitle\", this, context);\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n    lines = pushOrConcat(lines, splitNewlines(title));\n    lines = pushOrConcat(lines, splitNewlines(afterTitle));\n    return lines;\n  }\n  getBeforeBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, \"beforeBody\", this, tooltipItems));\n  }\n  getBody(tooltipItems, options) {\n    const { callbacks } = options;\n    const bodyItems = [];\n    each(tooltipItems, (context) => {\n      const bodyItem = {\n        before: [],\n        lines: [],\n        after: []\n      };\n      const scoped = overrideCallbacks(callbacks, context);\n      pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, \"beforeLabel\", this, context)));\n      pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, \"label\", this, context));\n      pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, \"afterLabel\", this, context)));\n      bodyItems.push(bodyItem);\n    });\n    return bodyItems;\n  }\n  getAfterBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, \"afterBody\", this, tooltipItems));\n  }\n  getFooter(tooltipItems, options) {\n    const { callbacks } = options;\n    const beforeFooter = invokeCallbackWithFallback(callbacks, \"beforeFooter\", this, tooltipItems);\n    const footer = invokeCallbackWithFallback(callbacks, \"footer\", this, tooltipItems);\n    const afterFooter = invokeCallbackWithFallback(callbacks, \"afterFooter\", this, tooltipItems);\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n    lines = pushOrConcat(lines, splitNewlines(footer));\n    lines = pushOrConcat(lines, splitNewlines(afterFooter));\n    return lines;\n  }\n  _createItems(options) {\n    const active = this._active;\n    const data = this.chart.data;\n    const labelColors = [];\n    const labelPointStyles = [];\n    const labelTextColors = [];\n    let tooltipItems = [];\n    let i, len;\n    for (i = 0, len = active.length; i < len; ++i) {\n      tooltipItems.push(createTooltipItem(this.chart, active[i]));\n    }\n    if (options.filter) {\n      tooltipItems = tooltipItems.filter((element, index2, array) => options.filter(element, index2, array, data));\n    }\n    if (options.itemSort) {\n      tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n    }\n    each(tooltipItems, (context) => {\n      const scoped = overrideCallbacks(options.callbacks, context);\n      labelColors.push(invokeCallbackWithFallback(scoped, \"labelColor\", this, context));\n      labelPointStyles.push(invokeCallbackWithFallback(scoped, \"labelPointStyle\", this, context));\n      labelTextColors.push(invokeCallbackWithFallback(scoped, \"labelTextColor\", this, context));\n    });\n    this.labelColors = labelColors;\n    this.labelPointStyles = labelPointStyles;\n    this.labelTextColors = labelTextColors;\n    this.dataPoints = tooltipItems;\n    return tooltipItems;\n  }\n  update(changed, replay) {\n    const options = this.options.setContext(this.getContext());\n    const active = this._active;\n    let properties;\n    let tooltipItems = [];\n    if (!active.length) {\n      if (this.opacity !== 0) {\n        properties = {\n          opacity: 0\n        };\n      }\n    } else {\n      const position = positioners[options.position].call(this, active, this._eventPosition);\n      tooltipItems = this._createItems(options);\n      this.title = this.getTitle(tooltipItems, options);\n      this.beforeBody = this.getBeforeBody(tooltipItems, options);\n      this.body = this.getBody(tooltipItems, options);\n      this.afterBody = this.getAfterBody(tooltipItems, options);\n      this.footer = this.getFooter(tooltipItems, options);\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, size);\n      const alignment = determineAlignment(this.chart, options, positionAndSize);\n      const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n      this.xAlign = alignment.xAlign;\n      this.yAlign = alignment.yAlign;\n      properties = {\n        opacity: 1,\n        x: backgroundPoint.x,\n        y: backgroundPoint.y,\n        width: size.width,\n        height: size.height,\n        caretX: position.x,\n        caretY: position.y\n      };\n    }\n    this._tooltipItems = tooltipItems;\n    this.$context = void 0;\n    if (properties) {\n      this._resolveAnimations().update(this, properties);\n    }\n    if (changed && options.external) {\n      options.external.call(this, {\n        chart: this.chart,\n        tooltip: this,\n        replay\n      });\n    }\n  }\n  drawCaret(tooltipPoint, ctx, size, options) {\n    const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n    ctx.lineTo(caretPosition.x1, caretPosition.y1);\n    ctx.lineTo(caretPosition.x2, caretPosition.y2);\n    ctx.lineTo(caretPosition.x3, caretPosition.y3);\n  }\n  getCaretPosition(tooltipPoint, size, options) {\n    const { xAlign, yAlign } = this;\n    const { caretSize, cornerRadius } = options;\n    const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);\n    const { x: ptX, y: ptY } = tooltipPoint;\n    const { width, height } = size;\n    let x1, x2, x3, y1, y2, y3;\n    if (yAlign === \"center\") {\n      y2 = ptY + height / 2;\n      if (xAlign === \"left\") {\n        x1 = ptX;\n        x2 = x1 - caretSize;\n        y1 = y2 + caretSize;\n        y3 = y2 - caretSize;\n      } else {\n        x1 = ptX + width;\n        x2 = x1 + caretSize;\n        y1 = y2 - caretSize;\n        y3 = y2 + caretSize;\n      }\n      x3 = x1;\n    } else {\n      if (xAlign === \"left\") {\n        x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n      } else if (xAlign === \"right\") {\n        x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n      } else {\n        x2 = this.caretX;\n      }\n      if (yAlign === \"top\") {\n        y1 = ptY;\n        y2 = y1 - caretSize;\n        x1 = x2 - caretSize;\n        x3 = x2 + caretSize;\n      } else {\n        y1 = ptY + height;\n        y2 = y1 + caretSize;\n        x1 = x2 + caretSize;\n        x3 = x2 - caretSize;\n      }\n      y3 = y1;\n    }\n    return {\n      x1,\n      x2,\n      x3,\n      y1,\n      y2,\n      y3\n    };\n  }\n  drawTitle(pt, ctx, options) {\n    const title = this.title;\n    const length = title.length;\n    let titleFont, titleSpacing, i;\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n      pt.x = getAlignedX(this, options.titleAlign, options);\n      ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n      ctx.textBaseline = \"middle\";\n      titleFont = toFont(options.titleFont);\n      titleSpacing = options.titleSpacing;\n      ctx.fillStyle = options.titleColor;\n      ctx.font = titleFont.string;\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n        pt.y += titleFont.lineHeight + titleSpacing;\n        if (i + 1 === length) {\n          pt.y += options.titleMarginBottom - titleSpacing;\n        }\n      }\n    }\n  }\n  _drawColorBox(ctx, pt, i, rtlHelper, options) {\n    const labelColor = this.labelColors[i];\n    const labelPointStyle = this.labelPointStyles[i];\n    const { boxHeight, boxWidth } = options;\n    const bodyFont = toFont(options.bodyFont);\n    const colorX = getAlignedX(this, \"left\", options);\n    const rtlColorX = rtlHelper.x(colorX);\n    const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n    const colorY = pt.y + yOffSet;\n    if (options.usePointStyle) {\n      const drawOptions = {\n        radius: Math.min(boxWidth, boxHeight) / 2,\n        pointStyle: labelPointStyle.pointStyle,\n        rotation: labelPointStyle.rotation,\n        borderWidth: 1\n      };\n      const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n      const centerY = colorY + boxHeight / 2;\n      ctx.strokeStyle = options.multiKeyBackground;\n      ctx.fillStyle = options.multiKeyBackground;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n      ctx.strokeStyle = labelColor.borderColor;\n      ctx.fillStyle = labelColor.backgroundColor;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n    } else {\n      ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n      ctx.strokeStyle = labelColor.borderColor;\n      ctx.setLineDash(labelColor.borderDash || []);\n      ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n      const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n      const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n      const borderRadius = toTRBLCorners(labelColor.borderRadius);\n      if (Object.values(borderRadius).some((v) => v !== 0)) {\n        ctx.beginPath();\n        ctx.fillStyle = options.multiKeyBackground;\n        addRoundedRectPath(ctx, {\n          x: outerX,\n          y: colorY,\n          w: boxWidth,\n          h: boxHeight,\n          radius: borderRadius\n        });\n        ctx.fill();\n        ctx.stroke();\n        ctx.fillStyle = labelColor.backgroundColor;\n        ctx.beginPath();\n        addRoundedRectPath(ctx, {\n          x: innerX,\n          y: colorY + 1,\n          w: boxWidth - 2,\n          h: boxHeight - 2,\n          radius: borderRadius\n        });\n        ctx.fill();\n      } else {\n        ctx.fillStyle = options.multiKeyBackground;\n        ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n        ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n        ctx.fillStyle = labelColor.backgroundColor;\n        ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n      }\n    }\n    ctx.fillStyle = this.labelTextColors[i];\n  }\n  drawBody(pt, ctx, options) {\n    const { body } = this;\n    const { bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding } = options;\n    const bodyFont = toFont(options.bodyFont);\n    let bodyLineHeight = bodyFont.lineHeight;\n    let xLinePadding = 0;\n    const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n    const fillLineOfText = function(line) {\n      ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n      pt.y += bodyLineHeight + bodySpacing;\n    };\n    const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n    let bodyItem, textColor, lines, i, j, ilen, jlen;\n    ctx.textAlign = bodyAlign;\n    ctx.textBaseline = \"middle\";\n    ctx.font = bodyFont.string;\n    pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n    ctx.fillStyle = options.bodyColor;\n    each(this.beforeBody, fillLineOfText);\n    xLinePadding = displayColors && bodyAlignForCalculation !== \"right\" ? bodyAlign === \"center\" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n    for (i = 0, ilen = body.length; i < ilen; ++i) {\n      bodyItem = body[i];\n      textColor = this.labelTextColors[i];\n      ctx.fillStyle = textColor;\n      each(bodyItem.before, fillLineOfText);\n      lines = bodyItem.lines;\n      if (displayColors && lines.length) {\n        this._drawColorBox(ctx, pt, i, rtlHelper, options);\n        bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n      }\n      for (j = 0, jlen = lines.length; j < jlen; ++j) {\n        fillLineOfText(lines[j]);\n        bodyLineHeight = bodyFont.lineHeight;\n      }\n      each(bodyItem.after, fillLineOfText);\n    }\n    xLinePadding = 0;\n    bodyLineHeight = bodyFont.lineHeight;\n    each(this.afterBody, fillLineOfText);\n    pt.y -= bodySpacing;\n  }\n  drawFooter(pt, ctx, options) {\n    const footer = this.footer;\n    const length = footer.length;\n    let footerFont, i;\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n      pt.x = getAlignedX(this, options.footerAlign, options);\n      pt.y += options.footerMarginTop;\n      ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n      ctx.textBaseline = \"middle\";\n      footerFont = toFont(options.footerFont);\n      ctx.fillStyle = options.footerColor;\n      ctx.font = footerFont.string;\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n        pt.y += footerFont.lineHeight + options.footerSpacing;\n      }\n    }\n  }\n  drawBackground(pt, ctx, tooltipSize, options) {\n    const { xAlign, yAlign } = this;\n    const { x, y } = pt;\n    const { width, height } = tooltipSize;\n    const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(options.cornerRadius);\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n    ctx.beginPath();\n    ctx.moveTo(x + topLeft, y);\n    if (yAlign === \"top\") {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width - topRight, y);\n    ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n    if (yAlign === \"center\" && xAlign === \"right\") {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width, y + height - bottomRight);\n    ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n    if (yAlign === \"bottom\") {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + bottomLeft, y + height);\n    ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n    if (yAlign === \"center\" && xAlign === \"left\") {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x, y + topLeft);\n    ctx.quadraticCurveTo(x, y, x + topLeft, y);\n    ctx.closePath();\n    ctx.fill();\n    if (options.borderWidth > 0) {\n      ctx.stroke();\n    }\n  }\n  _updateAnimationTarget(options) {\n    const chart = this.chart;\n    const anims = this.$animations;\n    const animX = anims && anims.x;\n    const animY = anims && anims.y;\n    if (animX || animY) {\n      const position = positioners[options.position].call(this, this._active, this._eventPosition);\n      if (!position) {\n        return;\n      }\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, this._size);\n      const alignment = determineAlignment(chart, options, positionAndSize);\n      const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n      if (animX._to !== point.x || animY._to !== point.y) {\n        this.xAlign = alignment.xAlign;\n        this.yAlign = alignment.yAlign;\n        this.width = size.width;\n        this.height = size.height;\n        this.caretX = position.x;\n        this.caretY = position.y;\n        this._resolveAnimations().update(this, point);\n      }\n    }\n  }\n  _willRender() {\n    return !!this.opacity;\n  }\n  draw(ctx) {\n    const options = this.options.setContext(this.getContext());\n    let opacity = this.opacity;\n    if (!opacity) {\n      return;\n    }\n    this._updateAnimationTarget(options);\n    const tooltipSize = {\n      width: this.width,\n      height: this.height\n    };\n    const pt = {\n      x: this.x,\n      y: this.y\n    };\n    opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n    const padding = toPadding(options.padding);\n    const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n    if (options.enabled && hasTooltipContent) {\n      ctx.save();\n      ctx.globalAlpha = opacity;\n      this.drawBackground(pt, ctx, tooltipSize, options);\n      overrideTextDirection(ctx, options.textDirection);\n      pt.y += padding.top;\n      this.drawTitle(pt, ctx, options);\n      this.drawBody(pt, ctx, options);\n      this.drawFooter(pt, ctx, options);\n      restoreTextDirection(ctx, options.textDirection);\n      ctx.restore();\n    }\n  }\n  getActiveElements() {\n    return this._active || [];\n  }\n  setActiveElements(activeElements, eventPosition) {\n    const lastActive = this._active;\n    const active = activeElements.map(({ datasetIndex, index: index2 }) => {\n      const meta = this.chart.getDatasetMeta(datasetIndex);\n      if (!meta) {\n        throw new Error(\"Cannot find a dataset at index \" + datasetIndex);\n      }\n      return {\n        datasetIndex,\n        element: meta.data[index2],\n        index: index2\n      };\n    });\n    const changed = !_elementsEqual(lastActive, active);\n    const positionChanged = this._positionChanged(active, eventPosition);\n    if (changed || positionChanged) {\n      this._active = active;\n      this._eventPosition = eventPosition;\n      this._ignoreReplayEvents = true;\n      this.update(true);\n    }\n  }\n  handleEvent(e, replay, inChartArea = true) {\n    if (replay && this._ignoreReplayEvents) {\n      return false;\n    }\n    this._ignoreReplayEvents = false;\n    const options = this.options;\n    const lastActive = this._active || [];\n    const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n    const positionChanged = this._positionChanged(active, e);\n    const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n    if (changed) {\n      this._active = active;\n      if (options.enabled || options.external) {\n        this._eventPosition = {\n          x: e.x,\n          y: e.y\n        };\n        this.update(true, replay);\n      }\n    }\n    return changed;\n  }\n  _getActiveElements(e, lastActive, replay, inChartArea) {\n    const options = this.options;\n    if (e.type === \"mouseout\") {\n      return [];\n    }\n    if (!inChartArea) {\n      return lastActive.filter((i) => this.chart.data.datasets[i.datasetIndex] && this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== void 0);\n    }\n    const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n    if (options.reverse) {\n      active.reverse();\n    }\n    return active;\n  }\n  _positionChanged(active, e) {\n    const { caretX, caretY, options } = this;\n    const position = positioners[options.position].call(this, active, e);\n    return position !== false && (caretX !== position.x || caretY !== position.y);\n  }\n};\n__publicField(Tooltip, \"positioners\", positioners);\nvar plugin_tooltip = {\n  id: \"tooltip\",\n  _element: Tooltip,\n  positioners,\n  afterInit(chart, _args, options) {\n    if (options) {\n      chart.tooltip = new Tooltip({\n        chart,\n        options\n      });\n    }\n  },\n  beforeUpdate(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n  reset(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n  afterDraw(chart) {\n    const tooltip = chart.tooltip;\n    if (tooltip && tooltip._willRender()) {\n      const args = {\n        tooltip\n      };\n      if (chart.notifyPlugins(\"beforeTooltipDraw\", {\n        ...args,\n        cancelable: true\n      }) === false) {\n        return;\n      }\n      tooltip.draw(chart.ctx);\n      chart.notifyPlugins(\"afterTooltipDraw\", args);\n    }\n  },\n  afterEvent(chart, args) {\n    if (chart.tooltip) {\n      const useFinalPosition = args.replay;\n      if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n        args.changed = true;\n      }\n    }\n  },\n  defaults: {\n    enabled: true,\n    external: null,\n    position: \"average\",\n    backgroundColor: \"rgba(0,0,0,0.8)\",\n    titleColor: \"#fff\",\n    titleFont: {\n      weight: \"bold\"\n    },\n    titleSpacing: 2,\n    titleMarginBottom: 6,\n    titleAlign: \"left\",\n    bodyColor: \"#fff\",\n    bodySpacing: 2,\n    bodyFont: {},\n    bodyAlign: \"left\",\n    footerColor: \"#fff\",\n    footerSpacing: 2,\n    footerMarginTop: 6,\n    footerFont: {\n      weight: \"bold\"\n    },\n    footerAlign: \"left\",\n    padding: 6,\n    caretPadding: 2,\n    caretSize: 5,\n    cornerRadius: 6,\n    boxHeight: (ctx, opts) => opts.bodyFont.size,\n    boxWidth: (ctx, opts) => opts.bodyFont.size,\n    multiKeyBackground: \"#fff\",\n    displayColors: true,\n    boxPadding: 0,\n    borderColor: \"rgba(0,0,0,0)\",\n    borderWidth: 0,\n    animation: {\n      duration: 400,\n      easing: \"easeOutQuart\"\n    },\n    animations: {\n      numbers: {\n        type: \"number\",\n        properties: [\n          \"x\",\n          \"y\",\n          \"width\",\n          \"height\",\n          \"caretX\",\n          \"caretY\"\n        ]\n      },\n      opacity: {\n        easing: \"linear\",\n        duration: 200\n      }\n    },\n    callbacks: defaultCallbacks\n  },\n  defaultRoutes: {\n    bodyFont: \"font\",\n    footerFont: \"font\",\n    titleFont: \"font\"\n  },\n  descriptors: {\n    _scriptable: (name) => name !== \"filter\" && name !== \"itemSort\" && name !== \"external\",\n    _indexable: false,\n    callbacks: {\n      _scriptable: false,\n      _indexable: false\n    },\n    animation: {\n      _fallback: false\n    },\n    animations: {\n      _fallback: \"animation\"\n    }\n  },\n  additionalOptionScopes: [\n    \"interaction\"\n  ]\n};\nvar plugins = /* @__PURE__ */ Object.freeze({\n  __proto__: null,\n  Colors: plugin_colors,\n  Decimation: plugin_decimation,\n  Filler: index,\n  Legend: plugin_legend,\n  SubTitle: plugin_subtitle,\n  Title: plugin_title,\n  Tooltip: plugin_tooltip\n});\nvar addIfString = (labels, raw, index2, addedLabels) => {\n  if (typeof raw === \"string\") {\n    index2 = labels.push(raw) - 1;\n    addedLabels.unshift({\n      index: index2,\n      label: raw\n    });\n  } else if (isNaN(raw)) {\n    index2 = null;\n  }\n  return index2;\n};\nfunction findOrAddLabel(labels, raw, index2, addedLabels) {\n  const first = labels.indexOf(raw);\n  if (first === -1) {\n    return addIfString(labels, raw, index2, addedLabels);\n  }\n  const last = labels.lastIndexOf(raw);\n  return first !== last ? index2 : first;\n}\nvar validIndex = (index2, max) => index2 === null ? null : _limitValue(Math.round(index2), 0, max);\nfunction _getLabelForValue(value) {\n  const labels = this.getLabels();\n  if (value >= 0 && value < labels.length) {\n    return labels[value];\n  }\n  return value;\n}\nvar CategoryScale = class extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this._startValue = void 0;\n    this._valueRange = 0;\n    this._addedLabels = [];\n  }\n  init(scaleOptions) {\n    const added = this._addedLabels;\n    if (added.length) {\n      const labels = this.getLabels();\n      for (const { index: index2, label } of added) {\n        if (labels[index2] === label) {\n          labels.splice(index2, 1);\n        }\n      }\n      this._addedLabels = [];\n    }\n    super.init(scaleOptions);\n  }\n  parse(raw, index2) {\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    const labels = this.getLabels();\n    index2 = isFinite(index2) && labels[index2] === raw ? index2 : findOrAddLabel(labels, raw, valueOrDefault(index2, raw), this._addedLabels);\n    return validIndex(index2, labels.length - 1);\n  }\n  determineDataLimits() {\n    const { minDefined, maxDefined } = this.getUserBounds();\n    let { min, max } = this.getMinMax(true);\n    if (this.options.bounds === \"ticks\") {\n      if (!minDefined) {\n        min = 0;\n      }\n      if (!maxDefined) {\n        max = this.getLabels().length - 1;\n      }\n    }\n    this.min = min;\n    this.max = max;\n  }\n  buildTicks() {\n    const min = this.min;\n    const max = this.max;\n    const offset = this.options.offset;\n    const ticks = [];\n    let labels = this.getLabels();\n    labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n    this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n    this._startValue = this.min - (offset ? 0.5 : 0);\n    for (let value = min; value <= max; value++) {\n      ticks.push({\n        value\n      });\n    }\n    return ticks;\n  }\n  getLabelForValue(value) {\n    return _getLabelForValue.call(this, value);\n  }\n  configure() {\n    super.configure();\n    if (!this.isHorizontal()) {\n      this._reversePixels = !this._reversePixels;\n    }\n  }\n  getPixelForValue(value) {\n    if (typeof value !== \"number\") {\n      value = this.parse(value);\n    }\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n  getPixelForTick(index2) {\n    const ticks = this.ticks;\n    if (index2 < 0 || index2 > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index2].value);\n  }\n  getValueForPixel(pixel) {\n    return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n  }\n  getBasePixel() {\n    return this.bottom;\n  }\n};\n__publicField(CategoryScale, \"id\", \"category\");\n__publicField(CategoryScale, \"defaults\", {\n  ticks: {\n    callback: _getLabelForValue\n  }\n});\nfunction generateTicks$1(generationOptions, dataRange) {\n  const ticks = [];\n  const MIN_SPACING = 1e-14;\n  const { bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds } = generationOptions;\n  const unit = step || 1;\n  const maxSpaces = maxTicks - 1;\n  const { min: rmin, max: rmax } = dataRange;\n  const minDefined = !isNullOrUndef(min);\n  const maxDefined = !isNullOrUndef(max);\n  const countDefined = !isNullOrUndef(count);\n  const minSpacing = (rmax - rmin) / (maxDigits + 1);\n  let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n  let factor, niceMin, niceMax, numSpaces;\n  if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n    return [\n      {\n        value: rmin\n      },\n      {\n        value: rmax\n      }\n    ];\n  }\n  numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n  if (numSpaces > maxSpaces) {\n    spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n  }\n  if (!isNullOrUndef(precision)) {\n    factor = Math.pow(10, precision);\n    spacing = Math.ceil(spacing * factor) / factor;\n  }\n  if (bounds === \"ticks\") {\n    niceMin = Math.floor(rmin / spacing) * spacing;\n    niceMax = Math.ceil(rmax / spacing) * spacing;\n  } else {\n    niceMin = rmin;\n    niceMax = rmax;\n  }\n  if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1e3)) {\n    numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n    spacing = (max - min) / numSpaces;\n    niceMin = min;\n    niceMax = max;\n  } else if (countDefined) {\n    niceMin = minDefined ? min : niceMin;\n    niceMax = maxDefined ? max : niceMax;\n    numSpaces = count - 1;\n    spacing = (niceMax - niceMin) / numSpaces;\n  } else {\n    numSpaces = (niceMax - niceMin) / spacing;\n    if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1e3)) {\n      numSpaces = Math.round(numSpaces);\n    } else {\n      numSpaces = Math.ceil(numSpaces);\n    }\n  }\n  const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n  factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n  niceMin = Math.round(niceMin * factor) / factor;\n  niceMax = Math.round(niceMax * factor) / factor;\n  let j = 0;\n  if (minDefined) {\n    if (includeBounds && niceMin !== min) {\n      ticks.push({\n        value: min\n      });\n      if (niceMin < min) {\n        j++;\n      }\n      if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n        j++;\n      }\n    } else if (niceMin < min) {\n      j++;\n    }\n  }\n  for (; j < numSpaces; ++j) {\n    const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n    if (maxDefined && tickValue > max) {\n      break;\n    }\n    ticks.push({\n      value: tickValue\n    });\n  }\n  if (maxDefined && includeBounds && niceMax !== max) {\n    if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n      ticks[ticks.length - 1].value = max;\n    } else {\n      ticks.push({\n        value: max\n      });\n    }\n  } else if (!maxDefined || niceMax === max) {\n    ticks.push({\n      value: niceMax\n    });\n  }\n  return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {\n  const rad = toRadians(minRotation);\n  const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 1e-3;\n  const length = 0.75 * minSpacing * (\"\" + value).length;\n  return Math.min(minSpacing / ratio, length);\n}\nvar LinearScaleBase = class extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this.start = void 0;\n    this.end = void 0;\n    this._startValue = void 0;\n    this._endValue = void 0;\n    this._valueRange = 0;\n  }\n  parse(raw, index2) {\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    if ((typeof raw === \"number\" || raw instanceof Number) && !isFinite(+raw)) {\n      return null;\n    }\n    return +raw;\n  }\n  handleTickRangeOptions() {\n    const { beginAtZero } = this.options;\n    const { minDefined, maxDefined } = this.getUserBounds();\n    let { min, max } = this;\n    const setMin = (v) => min = minDefined ? min : v;\n    const setMax = (v) => max = maxDefined ? max : v;\n    if (beginAtZero) {\n      const minSign = sign(min);\n      const maxSign = sign(max);\n      if (minSign < 0 && maxSign < 0) {\n        setMax(0);\n      } else if (minSign > 0 && maxSign > 0) {\n        setMin(0);\n      }\n    }\n    if (min === max) {\n      let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n      setMax(max + offset);\n      if (!beginAtZero) {\n        setMin(min - offset);\n      }\n    }\n    this.min = min;\n    this.max = max;\n  }\n  getTickLimit() {\n    const tickOpts = this.options.ticks;\n    let { maxTicksLimit, stepSize } = tickOpts;\n    let maxTicks;\n    if (stepSize) {\n      maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n      if (maxTicks > 1e3) {\n        console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n        maxTicks = 1e3;\n      }\n    } else {\n      maxTicks = this.computeTickLimit();\n      maxTicksLimit = maxTicksLimit || 11;\n    }\n    if (maxTicksLimit) {\n      maxTicks = Math.min(maxTicksLimit, maxTicks);\n    }\n    return maxTicks;\n  }\n  computeTickLimit() {\n    return Number.POSITIVE_INFINITY;\n  }\n  buildTicks() {\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n    let maxTicks = this.getTickLimit();\n    maxTicks = Math.max(2, maxTicks);\n    const numericGeneratorOptions = {\n      maxTicks,\n      bounds: opts.bounds,\n      min: opts.min,\n      max: opts.max,\n      precision: tickOpts.precision,\n      step: tickOpts.stepSize,\n      count: tickOpts.count,\n      maxDigits: this._maxDigits(),\n      horizontal: this.isHorizontal(),\n      minRotation: tickOpts.minRotation || 0,\n      includeBounds: tickOpts.includeBounds !== false\n    };\n    const dataRange = this._range || this;\n    const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n    if (opts.bounds === \"ticks\") {\n      _setMinAndMaxByKey(ticks, this, \"value\");\n    }\n    if (opts.reverse) {\n      ticks.reverse();\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n    return ticks;\n  }\n  configure() {\n    const ticks = this.ticks;\n    let start = this.min;\n    let end = this.max;\n    super.configure();\n    if (this.options.offset && ticks.length) {\n      const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n      start -= offset;\n      end += offset;\n    }\n    this._startValue = start;\n    this._endValue = end;\n    this._valueRange = end - start;\n  }\n  getLabelForValue(value) {\n    return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n};\nvar LinearScale = class extends LinearScaleBase {\n  determineDataLimits() {\n    const { min, max } = this.getMinMax(true);\n    this.min = isNumberFinite(min) ? min : 0;\n    this.max = isNumberFinite(max) ? max : 1;\n    this.handleTickRangeOptions();\n  }\n  computeTickLimit() {\n    const horizontal = this.isHorizontal();\n    const length = horizontal ? this.width : this.height;\n    const minRotation = toRadians(this.options.ticks.minRotation);\n    const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 1e-3;\n    const tickFont = this._resolveTickFontOptions(0);\n    return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n  }\n  getPixelForValue(value) {\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n  getValueForPixel(pixel) {\n    return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n  }\n};\n__publicField(LinearScale, \"id\", \"linear\");\n__publicField(LinearScale, \"defaults\", {\n  ticks: {\n    callback: Ticks.formatters.numeric\n  }\n});\nvar log10Floor = (v) => Math.floor(log10(v));\nvar changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n  const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n  return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n  const rangeStep = Math.pow(10, rangeExp);\n  const start = Math.floor(min / rangeStep);\n  const end = Math.ceil(max / rangeStep);\n  return end - start;\n}\nfunction startExp(min, max) {\n  const range = max - min;\n  let rangeExp = log10Floor(range);\n  while (steps(min, max, rangeExp) > 10) {\n    rangeExp++;\n  }\n  while (steps(min, max, rangeExp) < 10) {\n    rangeExp--;\n  }\n  return Math.min(rangeExp, log10Floor(min));\n}\nfunction generateTicks(generationOptions, { min, max }) {\n  min = finiteOrDefault(generationOptions.min, min);\n  const ticks = [];\n  const minExp = log10Floor(min);\n  let exp = startExp(min, max);\n  let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n  const stepSize = Math.pow(10, exp);\n  const base = minExp > exp ? Math.pow(10, minExp) : 0;\n  const start = Math.round((min - base) * precision) / precision;\n  const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n  let significand = Math.floor((start - offset) / Math.pow(10, exp));\n  let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n  while (value < max) {\n    ticks.push({\n      value,\n      major: isMajor(value),\n      significand\n    });\n    if (significand >= 10) {\n      significand = significand < 15 ? 15 : 20;\n    } else {\n      significand++;\n    }\n    if (significand >= 20) {\n      exp++;\n      significand = 2;\n      precision = exp >= 0 ? 1 : precision;\n    }\n    value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n  }\n  const lastTick = finiteOrDefault(generationOptions.max, value);\n  ticks.push({\n    value: lastTick,\n    major: isMajor(lastTick),\n    significand\n  });\n  return ticks;\n}\nvar LogarithmicScale = class extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this.start = void 0;\n    this.end = void 0;\n    this._startValue = void 0;\n    this._valueRange = 0;\n  }\n  parse(raw, index2) {\n    const value = LinearScaleBase.prototype.parse.apply(this, [\n      raw,\n      index2\n    ]);\n    if (value === 0) {\n      this._zero = true;\n      return void 0;\n    }\n    return isNumberFinite(value) && value > 0 ? value : null;\n  }\n  determineDataLimits() {\n    const { min, max } = this.getMinMax(true);\n    this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n    this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n    if (this.options.beginAtZero) {\n      this._zero = true;\n    }\n    if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n      this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n    }\n    this.handleTickRangeOptions();\n  }\n  handleTickRangeOptions() {\n    const { minDefined, maxDefined } = this.getUserBounds();\n    let min = this.min;\n    let max = this.max;\n    const setMin = (v) => min = minDefined ? min : v;\n    const setMax = (v) => max = maxDefined ? max : v;\n    if (min === max) {\n      if (min <= 0) {\n        setMin(1);\n        setMax(10);\n      } else {\n        setMin(changeExponent(min, -1));\n        setMax(changeExponent(max, 1));\n      }\n    }\n    if (min <= 0) {\n      setMin(changeExponent(max, -1));\n    }\n    if (max <= 0) {\n      setMax(changeExponent(min, 1));\n    }\n    this.min = min;\n    this.max = max;\n  }\n  buildTicks() {\n    const opts = this.options;\n    const generationOptions = {\n      min: this._userMin,\n      max: this._userMax\n    };\n    const ticks = generateTicks(generationOptions, this);\n    if (opts.bounds === \"ticks\") {\n      _setMinAndMaxByKey(ticks, this, \"value\");\n    }\n    if (opts.reverse) {\n      ticks.reverse();\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n    return ticks;\n  }\n  getLabelForValue(value) {\n    return value === void 0 ? \"0\" : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n  configure() {\n    const start = this.min;\n    super.configure();\n    this._startValue = log10(start);\n    this._valueRange = log10(this.max) - log10(start);\n  }\n  getPixelForValue(value) {\n    if (value === void 0 || value === 0) {\n      value = this.min;\n    }\n    if (value === null || isNaN(value)) {\n      return NaN;\n    }\n    return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n  }\n  getValueForPixel(pixel) {\n    const decimal = this.getDecimalForPixel(pixel);\n    return Math.pow(10, this._startValue + decimal * this._valueRange);\n  }\n};\n__publicField(LogarithmicScale, \"id\", \"logarithmic\");\n__publicField(LogarithmicScale, \"defaults\", {\n  ticks: {\n    callback: Ticks.formatters.logarithmic,\n    major: {\n      enabled: true\n    }\n  }\n});\nfunction getTickBackdropHeight(opts) {\n  const tickOpts = opts.ticks;\n  if (tickOpts.display && opts.display) {\n    const padding = toPadding(tickOpts.backdropPadding);\n    return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n  }\n  return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n  label = isArray(label) ? label : [\n    label\n  ];\n  return {\n    w: _longestText(ctx, font.string, label),\n    h: label.length * font.lineHeight\n  };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n  if (angle === min || angle === max) {\n    return {\n      start: pos - size / 2,\n      end: pos + size / 2\n    };\n  } else if (angle < min || angle > max) {\n    return {\n      start: pos - size,\n      end: pos\n    };\n  }\n  return {\n    start: pos,\n    end: pos + size\n  };\n}\nfunction fitWithPointLabels(scale) {\n  const orig = {\n    l: scale.left + scale._padding.left,\n    r: scale.right - scale._padding.right,\n    t: scale.top + scale._padding.top,\n    b: scale.bottom - scale._padding.bottom\n  };\n  const limits = Object.assign({}, orig);\n  const labelSizes = [];\n  const padding = [];\n  const valueCount = scale._pointLabels.length;\n  const pointLabelOpts = scale.options.pointLabels;\n  const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n  for (let i = 0; i < valueCount; i++) {\n    const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n    padding[i] = opts.padding;\n    const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n    const plFont = toFont(opts.font);\n    const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n    labelSizes[i] = textSize;\n    const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n    const angle = Math.round(toDegrees(angleRadians));\n    const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n    const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n    updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n  }\n  scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n  scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n  const sin = Math.abs(Math.sin(angle));\n  const cos = Math.abs(Math.cos(angle));\n  let x = 0;\n  let y = 0;\n  if (hLimits.start < orig.l) {\n    x = (orig.l - hLimits.start) / sin;\n    limits.l = Math.min(limits.l, orig.l - x);\n  } else if (hLimits.end > orig.r) {\n    x = (hLimits.end - orig.r) / sin;\n    limits.r = Math.max(limits.r, orig.r + x);\n  }\n  if (vLimits.start < orig.t) {\n    y = (orig.t - vLimits.start) / cos;\n    limits.t = Math.min(limits.t, orig.t - y);\n  } else if (vLimits.end > orig.b) {\n    y = (vLimits.end - orig.b) / cos;\n    limits.b = Math.max(limits.b, orig.b + y);\n  }\n}\nfunction createPointLabelItem(scale, index2, itemOpts) {\n  const outerDistance = scale.drawingArea;\n  const { extra, additionalAngle, padding, size } = itemOpts;\n  const pointLabelPosition = scale.getPointPosition(index2, outerDistance + extra + padding, additionalAngle);\n  const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n  const y = yForAngle(pointLabelPosition.y, size.h, angle);\n  const textAlign = getTextAlignForAngle(angle);\n  const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n  return {\n    visible: true,\n    x: pointLabelPosition.x,\n    y,\n    textAlign,\n    left,\n    top: y,\n    right: left + size.w,\n    bottom: y + size.h\n  };\n}\nfunction isNotOverlapped(item, area) {\n  if (!area) {\n    return true;\n  }\n  const { left, top, right, bottom } = item;\n  const apexesInArea = _isPointInArea({\n    x: left,\n    y: top\n  }, area) || _isPointInArea({\n    x: left,\n    y: bottom\n  }, area) || _isPointInArea({\n    x: right,\n    y: top\n  }, area) || _isPointInArea({\n    x: right,\n    y: bottom\n  }, area);\n  return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n  const items = [];\n  const valueCount = scale._pointLabels.length;\n  const opts = scale.options;\n  const { centerPointLabels, display } = opts.pointLabels;\n  const itemOpts = {\n    extra: getTickBackdropHeight(opts) / 2,\n    additionalAngle: centerPointLabels ? PI / valueCount : 0\n  };\n  let area;\n  for (let i = 0; i < valueCount; i++) {\n    itemOpts.padding = padding[i];\n    itemOpts.size = labelSizes[i];\n    const item = createPointLabelItem(scale, i, itemOpts);\n    items.push(item);\n    if (display === \"auto\") {\n      item.visible = isNotOverlapped(item, area);\n      if (item.visible) {\n        area = item;\n      }\n    }\n  }\n  return items;\n}\nfunction getTextAlignForAngle(angle) {\n  if (angle === 0 || angle === 180) {\n    return \"center\";\n  } else if (angle < 180) {\n    return \"left\";\n  }\n  return \"right\";\n}\nfunction leftForTextAlign(x, w, align) {\n  if (align === \"right\") {\n    x -= w;\n  } else if (align === \"center\") {\n    x -= w / 2;\n  }\n  return x;\n}\nfunction yForAngle(y, h, angle) {\n  if (angle === 90 || angle === 270) {\n    y -= h / 2;\n  } else if (angle > 270 || angle < 90) {\n    y -= h;\n  }\n  return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n  const { left, top, right, bottom } = item;\n  const { backdropColor } = opts;\n  if (!isNullOrUndef(backdropColor)) {\n    const borderRadius = toTRBLCorners(opts.borderRadius);\n    const padding = toPadding(opts.backdropPadding);\n    ctx.fillStyle = backdropColor;\n    const backdropLeft = left - padding.left;\n    const backdropTop = top - padding.top;\n    const backdropWidth = right - left + padding.width;\n    const backdropHeight = bottom - top + padding.height;\n    if (Object.values(borderRadius).some((v) => v !== 0)) {\n      ctx.beginPath();\n      addRoundedRectPath(ctx, {\n        x: backdropLeft,\n        y: backdropTop,\n        w: backdropWidth,\n        h: backdropHeight,\n        radius: borderRadius\n      });\n      ctx.fill();\n    } else {\n      ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n    }\n  }\n}\nfunction drawPointLabels(scale, labelCount) {\n  const { ctx, options: { pointLabels } } = scale;\n  for (let i = labelCount - 1; i >= 0; i--) {\n    const item = scale._pointLabelItems[i];\n    if (!item.visible) {\n      continue;\n    }\n    const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n    drawPointLabelBox(ctx, optsAtIndex, item);\n    const plFont = toFont(optsAtIndex.font);\n    const { x, y, textAlign } = item;\n    renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n      color: optsAtIndex.color,\n      textAlign,\n      textBaseline: \"middle\"\n    });\n  }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n  const { ctx } = scale;\n  if (circular) {\n    ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n  } else {\n    let pointPosition = scale.getPointPosition(0, radius);\n    ctx.moveTo(pointPosition.x, pointPosition.y);\n    for (let i = 1; i < labelCount; i++) {\n      pointPosition = scale.getPointPosition(i, radius);\n      ctx.lineTo(pointPosition.x, pointPosition.y);\n    }\n  }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n  const ctx = scale.ctx;\n  const circular = gridLineOpts.circular;\n  const { color: color2, lineWidth } = gridLineOpts;\n  if (!circular && !labelCount || !color2 || !lineWidth || radius < 0) {\n    return;\n  }\n  ctx.save();\n  ctx.strokeStyle = color2;\n  ctx.lineWidth = lineWidth;\n  ctx.setLineDash(borderOpts.dash || []);\n  ctx.lineDashOffset = borderOpts.dashOffset;\n  ctx.beginPath();\n  pathRadiusLine(scale, radius, circular, labelCount);\n  ctx.closePath();\n  ctx.stroke();\n  ctx.restore();\n}\nfunction createPointLabelContext(parent, index2, label) {\n  return createContext(parent, {\n    label,\n    index: index2,\n    type: \"pointLabel\"\n  });\n}\nvar RadialLinearScale = class extends LinearScaleBase {\n  constructor(cfg) {\n    super(cfg);\n    this.xCenter = void 0;\n    this.yCenter = void 0;\n    this.drawingArea = void 0;\n    this._pointLabels = [];\n    this._pointLabelItems = [];\n  }\n  setDimensions() {\n    const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n    const w = this.width = this.maxWidth - padding.width;\n    const h = this.height = this.maxHeight - padding.height;\n    this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n    this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n    this.drawingArea = Math.floor(Math.min(w, h) / 2);\n  }\n  determineDataLimits() {\n    const { min, max } = this.getMinMax(false);\n    this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n    this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n    this.handleTickRangeOptions();\n  }\n  computeTickLimit() {\n    return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n  }\n  generateTickLabels(ticks) {\n    LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n    this._pointLabels = this.getLabels().map((value, index2) => {\n      const label = callback(this.options.pointLabels.callback, [\n        value,\n        index2\n      ], this);\n      return label || label === 0 ? label : \"\";\n    }).filter((v, i) => this.chart.getDataVisibility(i));\n  }\n  fit() {\n    const opts = this.options;\n    if (opts.display && opts.pointLabels.display) {\n      fitWithPointLabels(this);\n    } else {\n      this.setCenterPoint(0, 0, 0, 0);\n    }\n  }\n  setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n    this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n    this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n    this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n  }\n  getIndexAngle(index2) {\n    const angleMultiplier = TAU / (this._pointLabels.length || 1);\n    const startAngle = this.options.startAngle || 0;\n    return _normalizeAngle(index2 * angleMultiplier + toRadians(startAngle));\n  }\n  getDistanceFromCenterForValue(value) {\n    if (isNullOrUndef(value)) {\n      return NaN;\n    }\n    const scalingFactor = this.drawingArea / (this.max - this.min);\n    if (this.options.reverse) {\n      return (this.max - value) * scalingFactor;\n    }\n    return (value - this.min) * scalingFactor;\n  }\n  getValueForDistanceFromCenter(distance) {\n    if (isNullOrUndef(distance)) {\n      return NaN;\n    }\n    const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n    return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n  }\n  getPointLabelContext(index2) {\n    const pointLabels = this._pointLabels || [];\n    if (index2 >= 0 && index2 < pointLabels.length) {\n      const pointLabel = pointLabels[index2];\n      return createPointLabelContext(this.getContext(), index2, pointLabel);\n    }\n  }\n  getPointPosition(index2, distanceFromCenter, additionalAngle = 0) {\n    const angle = this.getIndexAngle(index2) - HALF_PI + additionalAngle;\n    return {\n      x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n      y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n      angle\n    };\n  }\n  getPointPositionForValue(index2, value) {\n    return this.getPointPosition(index2, this.getDistanceFromCenterForValue(value));\n  }\n  getBasePosition(index2) {\n    return this.getPointPositionForValue(index2 || 0, this.getBaseValue());\n  }\n  getPointLabelPosition(index2) {\n    const { left, top, right, bottom } = this._pointLabelItems[index2];\n    return {\n      left,\n      top,\n      right,\n      bottom\n    };\n  }\n  drawBackground() {\n    const { backgroundColor, grid: { circular } } = this.options;\n    if (backgroundColor) {\n      const ctx = this.ctx;\n      ctx.save();\n      ctx.beginPath();\n      pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n      ctx.closePath();\n      ctx.fillStyle = backgroundColor;\n      ctx.fill();\n      ctx.restore();\n    }\n  }\n  drawGrid() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const { angleLines, grid, border } = opts;\n    const labelCount = this._pointLabels.length;\n    let i, offset, position;\n    if (opts.pointLabels.display) {\n      drawPointLabels(this, labelCount);\n    }\n    if (grid.display) {\n      this.ticks.forEach((tick, index2) => {\n        if (index2 !== 0 || index2 === 0 && this.min < 0) {\n          offset = this.getDistanceFromCenterForValue(tick.value);\n          const context = this.getContext(index2);\n          const optsAtIndex = grid.setContext(context);\n          const optsAtIndexBorder = border.setContext(context);\n          drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n        }\n      });\n    }\n    if (angleLines.display) {\n      ctx.save();\n      for (i = labelCount - 1; i >= 0; i--) {\n        const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n        const { color: color2, lineWidth } = optsAtIndex;\n        if (!lineWidth || !color2) {\n          continue;\n        }\n        ctx.lineWidth = lineWidth;\n        ctx.strokeStyle = color2;\n        ctx.setLineDash(optsAtIndex.borderDash);\n        ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n        offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);\n        position = this.getPointPosition(i, offset);\n        ctx.beginPath();\n        ctx.moveTo(this.xCenter, this.yCenter);\n        ctx.lineTo(position.x, position.y);\n        ctx.stroke();\n      }\n      ctx.restore();\n    }\n  }\n  drawBorder() {\n  }\n  drawLabels() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n    if (!tickOpts.display) {\n      return;\n    }\n    const startAngle = this.getIndexAngle(0);\n    let offset, width;\n    ctx.save();\n    ctx.translate(this.xCenter, this.yCenter);\n    ctx.rotate(startAngle);\n    ctx.textAlign = \"center\";\n    ctx.textBaseline = \"middle\";\n    this.ticks.forEach((tick, index2) => {\n      if (index2 === 0 && this.min >= 0 && !opts.reverse) {\n        return;\n      }\n      const optsAtIndex = tickOpts.setContext(this.getContext(index2));\n      const tickFont = toFont(optsAtIndex.font);\n      offset = this.getDistanceFromCenterForValue(this.ticks[index2].value);\n      if (optsAtIndex.showLabelBackdrop) {\n        ctx.font = tickFont.string;\n        width = ctx.measureText(tick.label).width;\n        ctx.fillStyle = optsAtIndex.backdropColor;\n        const padding = toPadding(optsAtIndex.backdropPadding);\n        ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n      }\n      renderText(ctx, tick.label, 0, -offset, tickFont, {\n        color: optsAtIndex.color,\n        strokeColor: optsAtIndex.textStrokeColor,\n        strokeWidth: optsAtIndex.textStrokeWidth\n      });\n    });\n    ctx.restore();\n  }\n  drawTitle() {\n  }\n};\n__publicField(RadialLinearScale, \"id\", \"radialLinear\");\n__publicField(RadialLinearScale, \"defaults\", {\n  display: true,\n  animate: true,\n  position: \"chartArea\",\n  angleLines: {\n    display: true,\n    lineWidth: 1,\n    borderDash: [],\n    borderDashOffset: 0\n  },\n  grid: {\n    circular: false\n  },\n  startAngle: 0,\n  ticks: {\n    showLabelBackdrop: true,\n    callback: Ticks.formatters.numeric\n  },\n  pointLabels: {\n    backdropColor: void 0,\n    backdropPadding: 2,\n    display: true,\n    font: {\n      size: 10\n    },\n    callback(label) {\n      return label;\n    },\n    padding: 5,\n    centerPointLabels: false\n  }\n});\n__publicField(RadialLinearScale, \"defaultRoutes\", {\n  \"angleLines.color\": \"borderColor\",\n  \"pointLabels.color\": \"color\",\n  \"ticks.color\": \"color\"\n});\n__publicField(RadialLinearScale, \"descriptors\", {\n  angleLines: {\n    _fallback: \"grid\"\n  }\n});\nvar INTERVALS = {\n  millisecond: {\n    common: true,\n    size: 1,\n    steps: 1e3\n  },\n  second: {\n    common: true,\n    size: 1e3,\n    steps: 60\n  },\n  minute: {\n    common: true,\n    size: 6e4,\n    steps: 60\n  },\n  hour: {\n    common: true,\n    size: 36e5,\n    steps: 24\n  },\n  day: {\n    common: true,\n    size: 864e5,\n    steps: 30\n  },\n  week: {\n    common: false,\n    size: 6048e5,\n    steps: 4\n  },\n  month: {\n    common: true,\n    size: 2628e6,\n    steps: 12\n  },\n  quarter: {\n    common: false,\n    size: 7884e6,\n    steps: 4\n  },\n  year: {\n    common: true,\n    size: 3154e7\n  }\n};\nvar UNITS = /* @__PURE__ */ Object.keys(INTERVALS);\nfunction sorter(a, b) {\n  return a - b;\n}\nfunction parse(scale, input) {\n  if (isNullOrUndef(input)) {\n    return null;\n  }\n  const adapter = scale._adapter;\n  const { parser, round: round2, isoWeekday } = scale._parseOpts;\n  let value = input;\n  if (typeof parser === \"function\") {\n    value = parser(value);\n  }\n  if (!isNumberFinite(value)) {\n    value = typeof parser === \"string\" ? adapter.parse(value, parser) : adapter.parse(value);\n  }\n  if (value === null) {\n    return null;\n  }\n  if (round2) {\n    value = round2 === \"week\" && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, \"isoWeek\", isoWeekday) : adapter.startOf(value, round2);\n  }\n  return +value;\n}\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n  const ilen = UNITS.length;\n  for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n    const interval = INTERVALS[UNITS[i]];\n    const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n    if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n      return UNITS[i];\n    }\n  }\n  return UNITS[ilen - 1];\n}\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n  for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n    const unit = UNITS[i];\n    if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n      return unit;\n    }\n  }\n  return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\nfunction determineMajorUnit(unit) {\n  for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n    if (INTERVALS[UNITS[i]].common) {\n      return UNITS[i];\n    }\n  }\n}\nfunction addTick(ticks, time, timestamps) {\n  if (!timestamps) {\n    ticks[time] = true;\n  } else if (timestamps.length) {\n    const { lo, hi } = _lookup(timestamps, time);\n    const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n    ticks[timestamp] = true;\n  }\n}\nfunction setMajorTicks(scale, ticks, map3, majorUnit) {\n  const adapter = scale._adapter;\n  const first = +adapter.startOf(ticks[0].value, majorUnit);\n  const last = ticks[ticks.length - 1].value;\n  let major, index2;\n  for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n    index2 = map3[major];\n    if (index2 >= 0) {\n      ticks[index2].major = true;\n    }\n  }\n  return ticks;\n}\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n  const ticks = [];\n  const map3 = {};\n  const ilen = values.length;\n  let i, value;\n  for (i = 0; i < ilen; ++i) {\n    value = values[i];\n    map3[value] = i;\n    ticks.push({\n      value,\n      major: false\n    });\n  }\n  return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map3, majorUnit);\n}\nvar TimeScale = class extends Scale {\n  constructor(props) {\n    super(props);\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n    this._unit = \"day\";\n    this._majorUnit = void 0;\n    this._offsets = {};\n    this._normalized = false;\n    this._parseOpts = void 0;\n  }\n  init(scaleOpts, opts = {}) {\n    const time = scaleOpts.time || (scaleOpts.time = {});\n    const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n    adapter.init(opts);\n    mergeIf(time.displayFormats, adapter.formats());\n    this._parseOpts = {\n      parser: time.parser,\n      round: time.round,\n      isoWeekday: time.isoWeekday\n    };\n    super.init(scaleOpts);\n    this._normalized = opts.normalized;\n  }\n  parse(raw, index2) {\n    if (raw === void 0) {\n      return null;\n    }\n    return parse(this, raw);\n  }\n  beforeLayout() {\n    super.beforeLayout();\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n  }\n  determineDataLimits() {\n    const options = this.options;\n    const adapter = this._adapter;\n    const unit = options.time.unit || \"day\";\n    let { min, max, minDefined, maxDefined } = this.getUserBounds();\n    function _applyBounds(bounds) {\n      if (!minDefined && !isNaN(bounds.min)) {\n        min = Math.min(min, bounds.min);\n      }\n      if (!maxDefined && !isNaN(bounds.max)) {\n        max = Math.max(max, bounds.max);\n      }\n    }\n    if (!minDefined || !maxDefined) {\n      _applyBounds(this._getLabelBounds());\n      if (options.bounds !== \"ticks\" || options.ticks.source !== \"labels\") {\n        _applyBounds(this.getMinMax(false));\n      }\n    }\n    min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n    max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n    this.min = Math.min(min, max - 1);\n    this.max = Math.max(min + 1, max);\n  }\n  _getLabelBounds() {\n    const arr = this.getLabelTimestamps();\n    let min = Number.POSITIVE_INFINITY;\n    let max = Number.NEGATIVE_INFINITY;\n    if (arr.length) {\n      min = arr[0];\n      max = arr[arr.length - 1];\n    }\n    return {\n      min,\n      max\n    };\n  }\n  buildTicks() {\n    const options = this.options;\n    const timeOpts = options.time;\n    const tickOpts = options.ticks;\n    const timestamps = tickOpts.source === \"labels\" ? this.getLabelTimestamps() : this._generate();\n    if (options.bounds === \"ticks\" && timestamps.length) {\n      this.min = this._userMin || timestamps[0];\n      this.max = this._userMax || timestamps[timestamps.length - 1];\n    }\n    const min = this.min;\n    const max = this.max;\n    const ticks = _filterBetween(timestamps, min, max);\n    this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n    this._majorUnit = !tickOpts.major.enabled || this._unit === \"year\" ? void 0 : determineMajorUnit(this._unit);\n    this.initOffsets(timestamps);\n    if (options.reverse) {\n      ticks.reverse();\n    }\n    return ticksFromTimestamps(this, ticks, this._majorUnit);\n  }\n  afterAutoSkip() {\n    if (this.options.offsetAfterAutoskip) {\n      this.initOffsets(this.ticks.map((tick) => +tick.value));\n    }\n  }\n  initOffsets(timestamps = []) {\n    let start = 0;\n    let end = 0;\n    let first, last;\n    if (this.options.offset && timestamps.length) {\n      first = this.getDecimalForValue(timestamps[0]);\n      if (timestamps.length === 1) {\n        start = 1 - first;\n      } else {\n        start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n      }\n      last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n      if (timestamps.length === 1) {\n        end = last;\n      } else {\n        end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n      }\n    }\n    const limit = timestamps.length < 3 ? 0.5 : 0.25;\n    start = _limitValue(start, 0, limit);\n    end = _limitValue(end, 0, limit);\n    this._offsets = {\n      start,\n      end,\n      factor: 1 / (start + 1 + end)\n    };\n  }\n  _generate() {\n    const adapter = this._adapter;\n    const min = this.min;\n    const max = this.max;\n    const options = this.options;\n    const timeOpts = options.time;\n    const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n    const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n    const weekday = minor === \"week\" ? timeOpts.isoWeekday : false;\n    const hasWeekday = isNumber(weekday) || weekday === true;\n    const ticks = {};\n    let first = min;\n    let time, count;\n    if (hasWeekday) {\n      first = +adapter.startOf(first, \"isoWeek\", weekday);\n    }\n    first = +adapter.startOf(first, hasWeekday ? \"day\" : minor);\n    if (adapter.diff(max, min, minor) > 1e5 * stepSize) {\n      throw new Error(min + \" and \" + max + \" are too far apart with stepSize of \" + stepSize + \" \" + minor);\n    }\n    const timestamps = options.ticks.source === \"data\" && this.getDataTimestamps();\n    for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n      addTick(ticks, time, timestamps);\n    }\n    if (time === max || options.bounds === \"ticks\" || count === 1) {\n      addTick(ticks, time, timestamps);\n    }\n    return Object.keys(ticks).sort(sorter).map((x) => +x);\n  }\n  getLabelForValue(value) {\n    const adapter = this._adapter;\n    const timeOpts = this.options.time;\n    if (timeOpts.tooltipFormat) {\n      return adapter.format(value, timeOpts.tooltipFormat);\n    }\n    return adapter.format(value, timeOpts.displayFormats.datetime);\n  }\n  format(value, format) {\n    const options = this.options;\n    const formats = options.time.displayFormats;\n    const unit = this._unit;\n    const fmt = format || formats[unit];\n    return this._adapter.format(value, fmt);\n  }\n  _tickFormatFunction(time, index2, ticks, format) {\n    const options = this.options;\n    const formatter = options.ticks.callback;\n    if (formatter) {\n      return callback(formatter, [\n        time,\n        index2,\n        ticks\n      ], this);\n    }\n    const formats = options.time.displayFormats;\n    const unit = this._unit;\n    const majorUnit = this._majorUnit;\n    const minorFormat = unit && formats[unit];\n    const majorFormat = majorUnit && formats[majorUnit];\n    const tick = ticks[index2];\n    const major = majorUnit && majorFormat && tick && tick.major;\n    return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n  }\n  generateTickLabels(ticks) {\n    let i, ilen, tick;\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      tick.label = this._tickFormatFunction(tick.value, i, ticks);\n    }\n  }\n  getDecimalForValue(value) {\n    return value === null ? NaN : (value - this.min) / (this.max - this.min);\n  }\n  getPixelForValue(value) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForValue(value);\n    return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n  }\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return this.min + pos * (this.max - this.min);\n  }\n  _getLabelSize(label) {\n    const ticksOpts = this.options.ticks;\n    const tickLabelWidth = this.ctx.measureText(label).width;\n    const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n    const cosRotation = Math.cos(angle);\n    const sinRotation = Math.sin(angle);\n    const tickFontSize = this._resolveTickFontOptions(0).size;\n    return {\n      w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n      h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n    };\n  }\n  _getLabelCapacity(exampleTime) {\n    const timeOpts = this.options.time;\n    const displayFormats = timeOpts.displayFormats;\n    const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n    const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n      exampleTime\n    ], this._majorUnit), format);\n    const size = this._getLabelSize(exampleLabel);\n    const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n    return capacity > 0 ? capacity : 1;\n  }\n  getDataTimestamps() {\n    let timestamps = this._cache.data || [];\n    let i, ilen;\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const metas = this.getMatchingVisibleMetas();\n    if (this._normalized && metas.length) {\n      return this._cache.data = metas[0].controller.getAllParsedValues(this);\n    }\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n    }\n    return this._cache.data = this.normalize(timestamps);\n  }\n  getLabelTimestamps() {\n    const timestamps = this._cache.labels || [];\n    let i, ilen;\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const labels = this.getLabels();\n    for (i = 0, ilen = labels.length; i < ilen; ++i) {\n      timestamps.push(parse(this, labels[i]));\n    }\n    return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n  }\n  normalize(values) {\n    return _arrayUnique(values.sort(sorter));\n  }\n};\n__publicField(TimeScale, \"id\", \"time\");\n__publicField(TimeScale, \"defaults\", {\n  bounds: \"data\",\n  adapters: {},\n  time: {\n    parser: false,\n    unit: false,\n    round: false,\n    isoWeekday: false,\n    minUnit: \"millisecond\",\n    displayFormats: {}\n  },\n  ticks: {\n    source: \"auto\",\n    callback: false,\n    major: {\n      enabled: false\n    }\n  }\n});\nfunction interpolate2(table, val, reverse) {\n  let lo = 0;\n  let hi = table.length - 1;\n  let prevSource, nextSource, prevTarget, nextTarget;\n  if (reverse) {\n    if (val >= table[lo].pos && val <= table[hi].pos) {\n      ({ lo, hi } = _lookupByKey(table, \"pos\", val));\n    }\n    ({ pos: prevSource, time: prevTarget } = table[lo]);\n    ({ pos: nextSource, time: nextTarget } = table[hi]);\n  } else {\n    if (val >= table[lo].time && val <= table[hi].time) {\n      ({ lo, hi } = _lookupByKey(table, \"time\", val));\n    }\n    ({ time: prevSource, pos: prevTarget } = table[lo]);\n    ({ time: nextSource, pos: nextTarget } = table[hi]);\n  }\n  const span = nextSource - prevSource;\n  return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nvar TimeSeriesScale = class extends TimeScale {\n  constructor(props) {\n    super(props);\n    this._table = [];\n    this._minPos = void 0;\n    this._tableRange = void 0;\n  }\n  initOffsets() {\n    const timestamps = this._getTimestampsForTable();\n    const table = this._table = this.buildLookupTable(timestamps);\n    this._minPos = interpolate2(table, this.min);\n    this._tableRange = interpolate2(table, this.max) - this._minPos;\n    super.initOffsets(timestamps);\n  }\n  buildLookupTable(timestamps) {\n    const { min, max } = this;\n    const items = [];\n    const table = [];\n    let i, ilen, prev, curr, next;\n    for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n      curr = timestamps[i];\n      if (curr >= min && curr <= max) {\n        items.push(curr);\n      }\n    }\n    if (items.length < 2) {\n      return [\n        {\n          time: min,\n          pos: 0\n        },\n        {\n          time: max,\n          pos: 1\n        }\n      ];\n    }\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      next = items[i + 1];\n      prev = items[i - 1];\n      curr = items[i];\n      if (Math.round((next + prev) / 2) !== curr) {\n        table.push({\n          time: curr,\n          pos: i / (ilen - 1)\n        });\n      }\n    }\n    return table;\n  }\n  _generate() {\n    const min = this.min;\n    const max = this.max;\n    let timestamps = super.getDataTimestamps();\n    if (!timestamps.includes(min) || !timestamps.length) {\n      timestamps.splice(0, 0, min);\n    }\n    if (!timestamps.includes(max) || timestamps.length === 1) {\n      timestamps.push(max);\n    }\n    return timestamps.sort((a, b) => a - b);\n  }\n  _getTimestampsForTable() {\n    let timestamps = this._cache.all || [];\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const data = this.getDataTimestamps();\n    const label = this.getLabelTimestamps();\n    if (data.length && label.length) {\n      timestamps = this.normalize(data.concat(label));\n    } else {\n      timestamps = data.length ? data : label;\n    }\n    timestamps = this._cache.all = timestamps;\n    return timestamps;\n  }\n  getDecimalForValue(value) {\n    return (interpolate2(this._table, value) - this._minPos) / this._tableRange;\n  }\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return interpolate2(this._table, decimal * this._tableRange + this._minPos, true);\n  }\n};\n__publicField(TimeSeriesScale, \"id\", \"timeseries\");\n__publicField(TimeSeriesScale, \"defaults\", TimeScale.defaults);\nvar scales = /* @__PURE__ */ Object.freeze({\n  __proto__: null,\n  CategoryScale,\n  LinearScale,\n  LogarithmicScale,\n  RadialLinearScale,\n  TimeScale,\n  TimeSeriesScale\n});\nvar registerables = [\n  controllers,\n  elements,\n  plugins,\n  scales\n];\n\n// node_modules/chart.js/auto/auto.js\nChart.register(...registerables);\nvar auto_default = Chart;\n\n// src/manywidgets/chart/src/index.ts\nvar PALETTE = [\n  \"#1f77b4\",\n  \"#ff7f0e\",\n  \"#2ca02c\",\n  \"#d62728\",\n  \"#9467bd\",\n  \"#8c564b\",\n  \"#e377c2\",\n  \"#7f7f7f\",\n  \"#bcbd22\",\n  \"#17becf\"\n];\nfunction formatSeriesData(seriesData, defaultType) {\n  return (seriesData || []).map((series, index2) => {\n    const color2 = series.color || PALETTE[index2 % PALETTE.length];\n    const type = series.type || defaultType || \"line\";\n    let data;\n    if (series.data && series.data.length > 0) {\n      if (Array.isArray(series.data[0])) {\n        data = series.data.map((p) => ({ x: p[0], y: p[1] }));\n      } else {\n        data = series.data;\n      }\n    } else {\n      data = [];\n    }\n    const dataset = {\n      label: series.name || `Series ${index2 + 1}`,\n      data,\n      borderColor: color2,\n      backgroundColor: color2 + \"33\",\n      type,\n      fill: series.fill !== void 0 ? series.fill : false,\n      tension: series.tension ?? 0.1,\n      pointRadius: series.pointRadius !== void 0 ? series.pointRadius : 3,\n      pointHoverRadius: 5,\n      borderWidth: series.borderWidth || 2\n    };\n    if (type === \"scatter\") {\n      dataset.showLine = false;\n      dataset.pointRadius = series.pointRadius || 5;\n    }\n    if (type === \"bar\") {\n      dataset.backgroundColor = color2 + \"80\";\n    }\n    return dataset;\n  });\n}\nfunction render({ model, el }) {\n  const container = document.createElement(\"div\");\n  container.className = \"manywidgets-chart\";\n  container.style.width = `${model.get(\"width\")}px`;\n  container.style.height = `${model.get(\"height\")}px`;\n  container.style.position = \"relative\";\n  const canvas = document.createElement(\"canvas\");\n  container.appendChild(canvas);\n  el.appendChild(container);\n  let chart = null;\n  const emitPoint = (trait) => (_event, elements2) => {\n    if (!chart || elements2.length === 0) return;\n    const { datasetIndex, index: index2 } = elements2[0];\n    const dataset = chart.data.datasets[datasetIndex];\n    const point = dataset.data[index2];\n    model.set(trait, {\n      series: datasetIndex,\n      index: index2,\n      x: point.x,\n      y: point.y,\n      label: String(dataset.label ?? \"\")\n    });\n    safeSaveChanges(model);\n  };\n  function buildOptions() {\n    const options = {\n      responsive: true,\n      maintainAspectRatio: false,\n      animation: { duration: model.get(\"animation_enabled\") ? 750 : 0 },\n      interaction: { mode: \"nearest\", intersect: false, axis: \"x\" },\n      plugins: {\n        title: { display: !!model.get(\"title\"), text: model.get(\"title\"), font: { size: 16 } },\n        legend: { display: model.get(\"legend_enabled\") !== false, position: \"top\" },\n        tooltip: {\n          enabled: model.get(\"tooltips_enabled\") !== false,\n          mode: \"index\",\n          intersect: false\n        }\n      },\n      scales: {\n        x: {\n          type: \"linear\",\n          position: \"bottom\",\n          title: { display: !!model.get(\"x_label\"), text: model.get(\"x_label\") }\n        },\n        y: { title: { display: !!model.get(\"y_label\"), text: model.get(\"y_label\") } }\n      },\n      onClick: emitPoint(\"clicked_point\"),\n      onHover: emitPoint(\"hover_point\")\n    };\n    const custom = model.get(\"chart_options\");\n    if (custom) {\n      Object.assign(options, custom);\n      if (custom.scales) Object.assign(options.scales, custom.scales);\n      if (custom.plugins) Object.assign(options.plugins, custom.plugins);\n    }\n    return options;\n  }\n  function build() {\n    chart?.destroy();\n    chart = new auto_default(canvas, {\n      type: model.get(\"chart_type\") || \"line\",\n      data: { datasets: formatSeriesData(model.get(\"series_data\"), model.get(\"chart_type\")) },\n      options: buildOptions()\n    });\n  }\n  function createOrUpdate() {\n    if (!chart) {\n      build();\n    } else {\n      chart.data = { datasets: formatSeriesData(model.get(\"series_data\"), model.get(\"chart_type\")) };\n      chart.options = buildOptions();\n      chart.update();\n    }\n  }\n  if ((model.get(\"series_data\") || []).length > 0) build();\n  onChanges(\n    model,\n    [\n      \"series_data\",\n      \"chart_options\",\n      \"animation_enabled\",\n      \"tooltips_enabled\",\n      \"legend_enabled\",\n      \"title\",\n      \"x_label\",\n      \"y_label\"\n    ],\n    createOrUpdate\n  );\n  onChanges(model, [\"chart_type\"], build);\n  onChanges(model, [\"width\", \"height\"], () => {\n    container.style.width = `${model.get(\"width\")}px`;\n    container.style.height = `${model.get(\"height\")}px`;\n    chart?.resize();\n  });\n  return () => chart?.destroy();\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n/*! Bundled license information:\n\n@kurkle/color/dist/color.esm.js:\n  (*!\n   * @kurkle/color v0.3.4\n   * https://github.com/kurkle/color#readme\n   * (c) 2024 Jukka Kurkela\n   * Released under the MIT License\n   *)\n\nchart.js/dist/chunks/helpers.dataset.js:\nchart.js/dist/chart.js:\n  (*!\n   * Chart.js v4.5.1\n   * https://www.chartjs.org\n   * (c) 2025 Chart.js Contributors\n   * Released under the MIT License\n   *)\n*/\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "animation_enabled": true,
       "chart_options": {
        "scales": {
         "x": {
          "ticks": {
           "autoSkip": false,
           "maxRotation": 60,
           "minRotation": 30
          },
          "type": "category"
         }
        }
       },
       "chart_type": "bar",
       "clicked_point": {},
       "height": 280,
       "hover_point": {},
       "layout": "IPY_MODEL_5c62f451ad9b4fe6afd11241fd7dcacd",
       "legend_enabled": false,
       "series_data": [
        {
         "color": "#E4572E",
         "data": [
          [
           "Gandaki",
           151419.0
          ]
         ],
         "name": "Exposed population (all)",
         "type": "bar"
        }
       ],
       "tabbable": null,
       "title": "Gandaki · flood ≥ 0.5 · 100-yr · current",
       "tooltip": null,
       "tooltips_enabled": true,
       "widget_id": "chart_1",
       "width": 800,
       "x_label": "",
       "y_label": "Exposed population (all)"
      }
     },
     "373352e76f984ab3957b0d4aeb94bfd8": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "2.0.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "2.0.0",
       "_model_name": "VBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "2.0.0",
       "_view_name": "VBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_7e07559a74464b8e92d7bd6b6f443057",
        "IPY_MODEL_cfe8fe833f2a436da2f4ddc9510843e2"
       ],
       "layout": "IPY_MODEL_619eafb115d24823897e0be444515200",
       "tabbable": null,
       "tooltip": null
      }
     },
     "3751cfa831cd4513a494d7e178e0becd": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "39b0c53e85f94f50ba56c3bdbc1f5176": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "413cbca649654f64ac162dbe0c8b7a83": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "4a17df6c89924fd2a464dfbc1d60e8e2": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_f4a9d6ca70e24e2385d2d9d77251826c",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "5c62f451ad9b4fe6afd11241fd7dcacd": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "619eafb115d24823897e0be444515200": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "655aaa71cec94eddbf2f6dd75abccd17": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "688c600b02f84f8d9b01973072fa51ea": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "699e8340aa814f73822aa6dfb1b9fa06": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "6ba9a2dd5c554b2bbd59060024fdff71": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "6f04e500abee4d31a6ec2a945e3e9f7f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": "200px",
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": "auto",
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "745b81af88384cc28af3521c0eceaca7": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "7e07559a74464b8e92d7bd6b6f443057": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "lonboard._map.Map",
       "_css": ".lonboard-tooltip{font-family:var(--jp-ui-font-family);font-size:var(--jp-ui-font-size1)}.lonboard-tooltip table{border-collapse:collapse}.lonboard-tooltip table tr:nth-child(odd){background-color:#fff}.lonboard-tooltip table tr:nth-child(2n){background-color:#f1f1f1}.lonboard-tooltip td{border:1px solid rgb(204,204,204);padding:5px}.lonboard-tooltip td:first-child{font-weight:450}.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 #0000001a}@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}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}}.maplibregl-ctrl button:not(:disabled):active{background-color:#0000000d}.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-globe .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='none' stroke='%23333' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-globe-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='none' stroke='%2333b5e5' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%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(0)}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:#ffffff80;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:#ffffff80;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:#0000000d}.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:#000000bf;-webkit-text-decoration:none;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.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}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.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:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;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 #00000059;box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@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:#0006;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),(pointer:coarse){.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}div.lonboard{color:#11181c;color:hsl(var(--nextui-foreground));background-color:#fff;background-color:hsl(var(--nextui-background));margin:0;line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}div.lonboard *,div.lonboard :before,div.lonboard :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 rgba(0,0,0,0);--tw-ring-shadow: 0 0 rgba(0,0,0,0);--tw-shadow: 0 0 rgba(0,0,0,0);--tw-shadow-colored: 0 0 rgba(0,0,0,0);--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }div.lonboard ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 rgba(0,0,0,0);--tw-ring-shadow: 0 0 rgba(0,0,0,0);--tw-shadow: 0 0 rgba(0,0,0,0);--tw-shadow-colored: 0 0 rgba(0,0,0,0);--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }div.lonboard *,div.lonboard :before,div.lonboard :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}div.lonboard :before,div.lonboard :after{--tw-content: \"\"}div.lonboard html,div.lonboard :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}div.lonboard body{margin:0;line-height:inherit}div.lonboard hr{height:0;color:inherit;border-top-width:1px}div.lonboard abbr:where([title]){text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}div.lonboard h1,div.lonboard h2,div.lonboard h3,div.lonboard h4,div.lonboard h5,div.lonboard h6{font-size:inherit;font-weight:inherit}div.lonboard a{color:inherit;text-decoration:inherit}div.lonboard b,div.lonboard strong{font-weight:bolder}div.lonboard code,div.lonboard kbd,div.lonboard samp,div.lonboard pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}div.lonboard small{font-size:80%}div.lonboard sub,div.lonboard sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}div.lonboard sub{bottom:-.25em}div.lonboard sup{top:-.5em}div.lonboard table{text-indent:0;border-color:inherit;border-collapse:collapse}div.lonboard button,div.lonboard input,div.lonboard optgroup,div.lonboard select,div.lonboard textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}div.lonboard button,div.lonboard select{text-transform:none}div.lonboard button,div.lonboard input:where([type=button]),div.lonboard input:where([type=reset]),div.lonboard input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}div.lonboard :-moz-focusring{outline:auto}div.lonboard :-moz-ui-invalid{box-shadow:none}div.lonboard progress{vertical-align:baseline}div.lonboard ::-webkit-inner-spin-button,div.lonboard ::-webkit-outer-spin-button{height:auto}div.lonboard [type=search]{-webkit-appearance:textfield;outline-offset:-2px}div.lonboard ::-webkit-search-decoration{-webkit-appearance:none}div.lonboard ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}div.lonboard summary{display:list-item}div.lonboard blockquote,div.lonboard dl,div.lonboard dd,div.lonboard h1,div.lonboard h2,div.lonboard h3,div.lonboard h4,div.lonboard h5,div.lonboard h6,div.lonboard hr,div.lonboard figure,div.lonboard p,div.lonboard pre{margin:0}div.lonboard fieldset{margin:0;padding:0}div.lonboard legend{padding:0}div.lonboard ol,div.lonboard ul,div.lonboard menu{list-style:none;margin:0;padding:0}div.lonboard dialog{padding:0}div.lonboard textarea{resize:vertical}div.lonboard input::-moz-placeholder,div.lonboard textarea::-moz-placeholder{opacity:1;color:#9ca3af}div.lonboard input::placeholder,div.lonboard textarea::placeholder{opacity:1;color:#9ca3af}div.lonboard button,div.lonboard [role=button]{cursor:pointer}div.lonboard :disabled{cursor:default}div.lonboard img,div.lonboard svg,div.lonboard video,div.lonboard canvas,div.lonboard audio,div.lonboard iframe,div.lonboard embed,div.lonboard object{display:block;vertical-align:middle}div.lonboard img,div.lonboard video{max-width:100%;height:auto}div.lonboard [hidden]:where(:not([hidden=until-found])){display:none}div.lonboard :root,div.lonboard [data-theme]{color:#11181c;color:hsl(var(--nextui-foreground));background-color:#fff;background-color:hsl(var(--nextui-background))}[data-overlay-container]{height:100%;width:100%;margin-top:-5px}.maplibregl-ctrl-geocoder svg{display:inline-block}div.lonboard .maplibregl-ctrl-geocoder--input{padding:6px 45px}@media screen and (min-width:640px){div.lonboard .maplibregl-ctrl-geocoder--input{padding:6px 35px}}.maplibregl-ctrl-geocoder--input::-webkit-search-cancel-button{display:none}.maplibregl-ctrl-geocoder--button{padding:0;border:none;background:#fff}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-\\[10\\%\\]{bottom:10%}.bottom-\\[5\\%\\]{bottom:5%}.end-1{right:.25rem}.end-1\\.5{right:.375rem}.end-3{right:.75rem}.end-auto{right:auto}.left-0{left:0}.left-1\\/2{left:50%}.left-\\[10\\%\\]{left:10%}.left-\\[5\\%\\]{left:5%}.right-0{right:0}.right-2{right:.5rem}.right-\\[10\\%\\]{right:10%}.right-\\[5\\%\\]{right:5%}.start-0{left:0}.start-1\\.5{left:.375rem}.start-2{left:.5rem}.start-3{left:.75rem}.start-\\[calc\\(var\\(--cursor-hit-x\\)\\*-1\\)\\]{left:calc(var(--cursor-hit-x) * -1)}.start-auto{left:auto}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-\\[10\\%\\]{top:10%}.top-\\[5\\%\\]{top:5%}.top-\\[calc\\(100\\%_\\+_2px\\)\\]{top:calc(100% + 2px)}.top-\\[var\\(--navbar-height\\)\\]{top:var(--navbar-height)}.-z-30{z-index:-30}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\\[1\\]{z-index:1}.order-1{order:1}.order-2{order:2}.order-3{order:3}.-m-2{margin:-.5rem}.-m-2\\.5{margin:-.625rem}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-0{margin-left:0;margin-right:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[calc\\(\\(theme\\(spacing\\.5\\)-theme\\(spacing\\.1\\)\\)\\/2\\)\\]{margin-left:.5rem;margin-right:.5rem}.mx-\\[calc\\(\\(theme\\(spacing\\.6\\)-theme\\(spacing\\.3\\)\\)\\/2\\)\\]{margin-left:.375rem;margin-right:.375rem}.mx-\\[calc\\(\\(theme\\(spacing\\.7\\)-theme\\(spacing\\.5\\)\\)\\/2\\)\\]{margin-left:.25rem;margin-right:.25rem}.my-0{margin-top:0;margin-bottom:0}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-16{margin-top:4rem;margin-bottom:4rem}.my-\\[calc\\(\\(theme\\(spacing\\.5\\)-theme\\(spacing\\.1\\)\\)\\/2\\)\\]{margin-top:.5rem;margin-bottom:.5rem}.my-\\[calc\\(\\(theme\\(spacing\\.6\\)-theme\\(spacing\\.3\\)\\)\\/2\\)\\]{margin-top:.375rem;margin-bottom:.375rem}.my-\\[calc\\(\\(theme\\(spacing\\.7\\)-theme\\(spacing\\.5\\)\\)\\/2\\)\\]{margin-top:.25rem;margin-bottom:.25rem}.my-auto{margin-top:auto;margin-bottom:auto}.-mr-2{margin-right:-.5rem}.-ms-2{margin-left:-.5rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-5{margin-bottom:1.25rem}.mb-px{margin-bottom:1px}.me-2{margin-right:.5rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.ms-2{margin-left:.5rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.inline-grid{display:inline-grid}.hidden{display:none}.\\!h-auto{height:auto!important}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[--visual-viewport-height\\]{height:var(--visual-viewport-height)}.h-\\[100dvh\\]{height:100dvh}.h-\\[2px\\]{height:2px}.h-\\[50\\%\\]{height:50%}.h-\\[calc\\(100dvh_-_var\\(--navbar-height\\)\\)\\]{height:calc(100dvh - var(--navbar-height))}.h-\\[var\\(--navbar-height\\)\\]{height:var(--navbar-height)}.h-\\[var\\(--picker-height\\)\\]{height:var(--picker-height)}.h-auto{height:auto}.h-divider{height:1px;height:var(--nextui-divider-weight)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[20rem\\]{max-height:20rem}.max-h-\\[24rem\\]{max-height:24rem}.max-h-\\[28rem\\]{max-height:28rem}.max-h-\\[32rem\\]{max-height:32rem}.max-h-\\[36rem\\]{max-height:36rem}.max-h-\\[42rem\\]{max-height:42rem}.max-h-\\[48rem\\]{max-height:48rem}.max-h-\\[56rem\\]{max-height:56rem}.max-h-\\[64rem\\]{max-height:64rem}.max-h-\\[calc\\(100\\%_-_8rem\\)\\]{max-height:calc(100% - 8rem)}.max-h-\\[none\\]{max-height:none}.max-h-full{max-height:100%}.min-h-10{min-height:2.5rem}.min-h-12{min-height:3rem}.min-h-14{min-height:3.5rem}.min-h-16{min-height:4rem}.min-h-3{min-height:.75rem}.min-h-3\\.5{min-height:.875rem}.min-h-4{min-height:1rem}.min-h-5{min-height:1.25rem}.min-h-6{min-height:1.5rem}.min-h-7{min-height:1.75rem}.min-h-8{min-height:2rem}.min-h-\\[100dvh\\]{min-height:100dvh}.min-h-\\[32px\\]{min-height:32px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\\[80\\%\\]{width:80%}.w-\\[calc\\(100\\%\\+var\\(--cursor-hit-x\\)\\*2\\)\\]{width:calc(100% + var(--cursor-hit-x) * 2)}.w-\\[calc\\(100\\%_-_16px\\)\\]{width:calc(100% - 16px)}.w-\\[calc\\(100\\%_-_theme\\(spacing\\.6\\)\\)\\]{width:calc(100% - 1.5rem)}.w-\\[calc\\(var\\(--visible-months\\)_\\*_var\\(--calendar-width\\)\\)\\]{width:calc(var(--visible-months) * var(--calendar-width))}.w-auto{width:auto}.w-divider{width:1px;width:var(--nextui-divider-weight)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-screen{width:100vw}.min-w-10{min-width:2.5rem}.min-w-12{min-width:3rem}.min-w-16{min-width:4rem}.min-w-20{min-width:5rem}.min-w-24{min-width:6rem}.min-w-3{min-width:.75rem}.min-w-3\\.5{min-width:.875rem}.min-w-4{min-width:1rem}.min-w-40{min-width:10rem}.min-w-5{min-width:1.25rem}.min-w-6{min-width:1.5rem}.min-w-7{min-width:1.75rem}.min-w-8{min-width:2rem}.min-w-9{min-width:2.25rem}.min-w-\\[200px\\]{min-width:200px}.min-w-full{min-width:100%}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-min{min-width:-moz-min-content;min-width:min-content}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-\\[1024px\\]{max-width:1024px}.max-w-\\[1280px\\]{max-width:1280px}.max-w-\\[1536px\\]{max-width:1536px}.max-w-\\[270px\\]{max-width:270px}.max-w-\\[640px\\]{max-width:640px}.max-w-\\[768px\\]{max-width:768px}.max-w-\\[none\\]{max-width:none}.max-w-fit{max-width:-moz-fit-content;max-width:fit-content}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-initial{flex:0 1 auto}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.basis-0{flex-basis:0px}.table-auto{table-layout:auto}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.origin-center{transform-origin:center}.origin-left{transform-origin:left}.origin-right{transform-origin:right}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(-50%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),-.25rem) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(.25rem,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\/2{--tw-translate-x: 50%;transform:translate(50%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),.25rem) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(0) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(0) scaleY(0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1.05) scaleY(1.05);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.5) scaleY(.5);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.9) scaleY(.9);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes appearance-in{0%{opacity:0;transform:translateZ(0) scale(.95)}60%{opacity:.75;backface-visibility:hidden;webkit-font-smoothing:antialiased;transform:translateZ(0) scale(1.05)}to{opacity:1;transform:translateZ(0) scale(1)}}.animate-\\[appearance-in_1s_infinite\\]{animation:appearance-in 1s infinite}@keyframes drip-expand{0%{opacity:.2;transform:scale(0)}to{opacity:0;transform:scale(2)}}.animate-drip-expand{animation:drip-expand .42s linear}@keyframes indeterminate-bar{0%{transform:translate(-50%) scaleX(.2)}to{transform:translate(100%) scaleX(1)}}.animate-indeterminate-bar{animation:indeterminate-bar 1.5s cubic-bezier(.65,.815,.735,.395) infinite normal none running}.animate-none{animation:none}.animate-spinner-ease-spin{animation:spinner-spin .8s ease infinite}@keyframes spinner-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spinner-linear-spin{animation:spinner-spin .8s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-center{scroll-snap-align:center}.scroll-py-6{scroll-padding-top:1.5rem;scroll-padding-bottom:1.5rem}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\\[minmax\\(0\\,_2fr\\)_minmax\\(0\\,_3fr\\)\\]{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{align-content:center;justify-content:center;place-content:center}.place-items-center{align-items:center;justify-items:center;place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.\\!gap-0{gap:0px!important}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-0{-moz-column-gap:0px;column-gap:0px}.gap-x-0\\.5{-moz-column-gap:.125rem;column-gap:.125rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1\\.5{row-gap:.375rem}.gap-y-2{row-gap:.5rem}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:0rem;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * (1 - var(--tw-space-x-reverse)));margin-left:.125rem;margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-clip{overflow:clip}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{word-wrap:break-word}.\\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-\\[calc\\(theme\\(borderRadius\\.large\\)\\/1\\.5\\)\\]{border-radius:calc(14px / 1.5);border-radius:calc(var(--nextui-radius-large) / 1.5)}.rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.5\\)\\]{border-radius:6px;border-radius:calc(var(--nextui-radius-medium) * .5)}.rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.6\\)\\]{border-radius:calc(12px * .6);border-radius:calc(var(--nextui-radius-medium) * .6)}.rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.7\\)\\]{border-radius:calc(12px * .7);border-radius:calc(var(--nextui-radius-medium) * .7)}.rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\/2\\)\\]{border-radius:6px;border-radius:calc(var(--nextui-radius-medium) / 2)}.rounded-\\[calc\\(theme\\(borderRadius\\.small\\)\\/2\\)\\]{border-radius:4px;border-radius:calc(var(--nextui-radius-small) / 2)}.rounded-full{border-radius:9999px}.rounded-large{border-radius:14px;border-radius:var(--nextui-radius-large)}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-medium{border-radius:12px;border-radius:var(--nextui-radius-medium)}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-small{border-radius:8px;border-radius:var(--nextui-radius-small)}.\\!rounded-e-none{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.\\!rounded-s-none{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.rounded-b-large{border-bottom-right-radius:14px;border-bottom-right-radius:var(--nextui-radius-large);border-bottom-left-radius:14px;border-bottom-left-radius:var(--nextui-radius-large)}.rounded-b-medium{border-bottom-right-radius:12px;border-bottom-right-radius:var(--nextui-radius-medium);border-bottom-left-radius:12px;border-bottom-left-radius:var(--nextui-radius-medium)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-small{border-bottom-right-radius:8px;border-bottom-right-radius:var(--nextui-radius-small);border-bottom-left-radius:8px;border-bottom-left-radius:var(--nextui-radius-small)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-large{border-top-left-radius:14px;border-top-left-radius:var(--nextui-radius-large);border-top-right-radius:14px;border-top-right-radius:var(--nextui-radius-large)}.rounded-t-medium{border-top-left-radius:12px;border-top-left-radius:var(--nextui-radius-medium);border-top-right-radius:12px;border-top-right-radius:var(--nextui-radius-medium)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-t-small{border-top-left-radius:8px;border-top-left-radius:var(--nextui-radius-small);border-top-right-radius:8px;border-top-right-radius:var(--nextui-radius-small)}.border{border-width:1px}.border-0{border-width:0px}.border-1{border-width:1px}.border-2{border-width:2px}.border-3{border-width:3px}.border-medium{border-width:2px;border-width:var(--nextui-border-width-medium)}.border-small{border-width:1px;border-width:var(--nextui-border-width-small)}.border-x-\\[calc\\(theme\\(spacing\\.5\\)\\/2\\)\\]{border-left-width:.625rem;border-right-width:.625rem}.border-x-\\[calc\\(theme\\(spacing\\.6\\)\\/2\\)\\]{border-left-width:.75rem;border-right-width:.75rem}.border-x-\\[calc\\(theme\\(spacing\\.7\\)\\/2\\)\\]{border-left-width:.875rem;border-right-width:.875rem}.border-y-\\[calc\\(theme\\(spacing\\.5\\)\\/2\\)\\]{border-top-width:.625rem;border-bottom-width:.625rem}.border-y-\\[calc\\(theme\\(spacing\\.6\\)\\/2\\)\\]{border-top-width:.75rem;border-bottom-width:.75rem}.border-y-\\[calc\\(theme\\(spacing\\.7\\)\\/2\\)\\]{border-top-width:.875rem;border-bottom-width:.875rem}.border-b{border-bottom-width:1px}.border-b-medium{border-bottom-width:2px;border-bottom-width:var(--nextui-border-width-medium)}.border-solid{border-style:solid}.border-dotted{border-style:dotted}.\\!border-none{border-style:none!important}.border-none{border-style:none}.\\!border-danger{--tw-border-opacity: 1 !important;border-color:#f31260!important;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))!important}.border-background{--tw-border-opacity: 1;border-color:#fff;border-color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-border-opacity)))}.border-danger{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.border-danger-100{--tw-border-opacity: 1;border-color:#fdcede;border-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-border-opacity)))}.border-danger-200{--tw-border-opacity: 1;border-color:#fa9ebe;border-color:hsl(var(--nextui-danger-200) / var(--nextui-danger-200-opacity, var(--tw-border-opacity)))}.border-default{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.border-default-200{--tw-border-opacity: 1;border-color:#e4e4e7;border-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-border-opacity)))}.border-default-300{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-border-opacity)))}.border-divider{--tw-border-opacity: 1;border-color:#12121226;border-color:hsl(var(--nextui-divider) / var(--nextui-divider-opacity, var(--tw-border-opacity)))}.border-foreground{--tw-border-opacity: 1;border-color:#11181c;border-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-border-opacity)))}.border-gray-300{--tw-border-opacity: 1;border-color:#d1d5db;border-color:rgba(209,213,219,var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.border-primary-100{--tw-border-opacity: 1;border-color:#cee4fd;border-color:hsl(var(--nextui-primary-100) / var(--nextui-primary-100-opacity, var(--tw-border-opacity)))}.border-primary-200{--tw-border-opacity: 1;border-color:#98c6fb;border-color:hsl(var(--nextui-primary-200) / var(--nextui-primary-200-opacity, var(--tw-border-opacity)))}.border-secondary{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.border-secondary-100{--tw-border-opacity: 1;border-color:#e3d2f3;border-color:hsl(var(--nextui-secondary-100) / var(--nextui-secondary-100-opacity, var(--tw-border-opacity)))}.border-secondary-200{--tw-border-opacity: 1;border-color:#c9aae9;border-color:hsl(var(--nextui-secondary-200) / var(--nextui-secondary-200-opacity, var(--tw-border-opacity)))}.border-success{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.border-success-100{--tw-border-opacity: 1;border-color:#d2f4e1;border-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-border-opacity)))}.border-success-200{--tw-border-opacity: 1;border-color:#a0e9c0;border-color:hsl(var(--nextui-success-200) / var(--nextui-success-200-opacity, var(--tw-border-opacity)))}.border-success-300{--tw-border-opacity: 1;border-color:#72dfa1;border-color:hsl(var(--nextui-success-300) / var(--nextui-success-300-opacity, var(--tw-border-opacity)))}.border-transparent{border-color:transparent}.border-warning{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.border-warning-100{--tw-border-opacity: 1;border-color:#fdedd3;border-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-border-opacity)))}.border-warning-200{--tw-border-opacity: 1;border-color:#fbdba7;border-color:hsl(var(--nextui-warning-200) / var(--nextui-warning-200-opacity, var(--tw-border-opacity)))}.border-warning-300{--tw-border-opacity: 1;border-color:#f9c97b;border-color:hsl(var(--nextui-warning-300) / var(--nextui-warning-300-opacity, var(--tw-border-opacity)))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.border-y-transparent{border-top-color:transparent;border-bottom-color:transparent}.border-b-current{border-bottom-color:currentColor}.border-b-danger{--tw-border-opacity: 1;border-bottom-color:#f31260;border-bottom-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.border-b-default{--tw-border-opacity: 1;border-bottom-color:#d4d4d8;border-bottom-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.border-b-foreground{--tw-border-opacity: 1;border-bottom-color:#11181c;border-bottom-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-border-opacity)))}.border-b-primary{--tw-border-opacity: 1;border-bottom-color:#0070f0;border-bottom-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.border-b-secondary{--tw-border-opacity: 1;border-bottom-color:#7828c8;border-bottom-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.border-b-success{--tw-border-opacity: 1;border-bottom-color:#18c964;border-bottom-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.border-b-warning{--tw-border-opacity: 1;border-bottom-color:#f5a524;border-bottom-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.border-b-white{--tw-border-opacity: 1;border-bottom-color:#fff;border-bottom-color:rgba(255,255,255,var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-transparent{border-right-color:transparent}.border-s-danger{--tw-border-opacity: 1;border-left-color:#f31260;border-left-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.border-s-foreground{--tw-border-opacity: 1;border-left-color:#11181c;border-left-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-border-opacity)))}.border-s-primary{--tw-border-opacity: 1;border-left-color:#0070f0;border-left-color:#006fee;border-left-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.border-s-secondary{--tw-border-opacity: 1;border-left-color:#7828c8;border-left-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.border-s-success{--tw-border-opacity: 1;border-left-color:#18c964;border-left-color:#17c964;border-left-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.border-s-warning{--tw-border-opacity: 1;border-left-color:#f5a524;border-left-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.border-t-transparent{border-top-color:transparent}.\\!bg-danger-50{--tw-bg-opacity: 1 !important;background-color:#fee7ef!important;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))!important}.\\!bg-transparent{background-color:transparent!important}.bg-background{--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-bg-opacity)))}.bg-background\\/10{background-color:#ffffff1a;background-color:hsl(var(--nextui-background) / .1)}.bg-background\\/70{background-color:#ffffffb3;background-color:hsl(var(--nextui-background) / .7)}.bg-background\\/80{background-color:#fffc;background-color:hsl(var(--nextui-background) / .8)}.bg-content1{--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-content1) / var(--nextui-content1-opacity, var(--tw-bg-opacity)))}.bg-content3{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-content3) / var(--nextui-content3-opacity, var(--tw-bg-opacity)))}.bg-current{background-color:currentColor}.bg-danger{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.bg-danger-100{--tw-bg-opacity: 1;background-color:#fdcede;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))}.bg-danger-50{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.bg-danger\\/20{background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.bg-default{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.bg-default-100{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.bg-default-200{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.bg-default-300\\/50{background-color:#d4d4d880;background-color:hsl(var(--nextui-default-300) / .5)}.bg-default-400{--tw-bg-opacity: 1;background-color:#a1a1aa;background-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-bg-opacity)))}.bg-default-50{--tw-bg-opacity: 1;background-color:#fafafa;background-color:hsl(var(--nextui-default-50) / var(--nextui-default-50-opacity, var(--tw-bg-opacity)))}.bg-default-500{--tw-bg-opacity: 1;background-color:#71717a;background-color:hsl(var(--nextui-default-500) / var(--nextui-default-500-opacity, var(--tw-bg-opacity)))}.bg-default-800{--tw-bg-opacity: 1;background-color:#27272a;background-color:hsl(var(--nextui-default-800) / var(--nextui-default-800-opacity, var(--tw-bg-opacity)))}.bg-default\\/40{background-color:#d4d4d866;background-color:hsl(var(--nextui-default) / .4)}.bg-divider{--tw-bg-opacity: 1;background-color:#12121226;background-color:hsl(var(--nextui-divider) / var(--nextui-divider-opacity, var(--tw-bg-opacity)))}.bg-foreground{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.bg-foreground\\/10{background-color:#11181c1a;background-color:hsl(var(--nextui-foreground) / .1)}.bg-gray-100{--tw-bg-opacity: 1;background-color:#f3f4f6;background-color:rgba(243,244,246,var(--tw-bg-opacity, 1))}.bg-overlay\\/30{background-color:#0000004d;background-color:hsl(var(--nextui-overlay) / .3)}.bg-overlay\\/50{background-color:#00000080;background-color:hsl(var(--nextui-overlay) / .5)}.bg-primary{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.bg-primary-100{--tw-bg-opacity: 1;background-color:#cee4fd;background-color:hsl(var(--nextui-primary-100) / var(--nextui-primary-100-opacity, var(--tw-bg-opacity)))}.bg-primary-50{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.bg-primary\\/20{background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.bg-secondary{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.bg-secondary-100{--tw-bg-opacity: 1;background-color:#e3d2f3;background-color:hsl(var(--nextui-secondary-100) / var(--nextui-secondary-100-opacity, var(--tw-bg-opacity)))}.bg-secondary-50{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.bg-secondary\\/20{background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.bg-success{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.bg-success-100{--tw-bg-opacity: 1;background-color:#d2f4e1;background-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-bg-opacity)))}.bg-success-50{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.bg-success\\/20{background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.bg-transparent{background-color:transparent}.bg-warning{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.bg-warning-100{--tw-bg-opacity: 1;background-color:#fdedd3;background-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-bg-opacity)))}.bg-warning-50{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.bg-warning\\/20{background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.bg-white{--tw-bg-opacity: 1;background-color:#fff;background-color:rgba(255,255,255,var(--tw-bg-opacity, 1))}.bg-stripe-gradient-danger{background-image:linear-gradient(45deg,#fa9ebe 25%,#f31260 25% 50%,#fa9ebe 50% 75%,#f31260 75%,#f31260);background-image:linear-gradient(45deg,hsl(var(--nextui-danger-200)) 25%,hsl(var(--nextui-danger)) 25% 50%,hsl(var(--nextui-danger-200)) 50% 75%,hsl(var(--nextui-danger)) 75%,hsl(var(--nextui-danger)))}.bg-stripe-gradient-default{background-image:linear-gradient(45deg,#e4e4e7 25%,#a1a1aa 25% 50%,#e4e4e7 50% 75%,#a1a1aa 75%,#a1a1aa);background-image:linear-gradient(45deg,hsl(var(--nextui-default-200)) 25%,hsl(var(--nextui-default-400)) 25% 50%,hsl(var(--nextui-default-200)) 50% 75%,hsl(var(--nextui-default-400)) 75%,hsl(var(--nextui-default-400)))}.bg-stripe-gradient-primary{background-image:linear-gradient(45deg,#98c6fb 25%,#0070f0 25% 50%,#98c6fb 50% 75%,#0070f0 75%,#0070f0);background-image:linear-gradient(45deg,hsl(var(--nextui-primary-200)) 25%,hsl(var(--nextui-primary)) 25% 50%,hsl(var(--nextui-primary-200)) 50% 75%,hsl(var(--nextui-primary)) 75%,hsl(var(--nextui-primary)))}.bg-stripe-gradient-secondary{background-image:linear-gradient(45deg,#c9aae9 25%,#7828c8 25% 50%,#c9aae9 50% 75%,#7828c8 75%,#7828c8);background-image:linear-gradient(45deg,hsl(var(--nextui-secondary-200)) 25%,hsl(var(--nextui-secondary)) 25% 50%,hsl(var(--nextui-secondary-200)) 50% 75%,hsl(var(--nextui-secondary)) 75%,hsl(var(--nextui-secondary)))}.bg-stripe-gradient-success{background-image:linear-gradient(45deg,#a0e9c0 25%,#18c964 25% 50%,#a0e9c0 50% 75%,#18c964 75%,#18c964);background-image:linear-gradient(45deg,hsl(var(--nextui-success-200)) 25%,hsl(var(--nextui-success)) 25% 50%,hsl(var(--nextui-success-200)) 50% 75%,hsl(var(--nextui-success)) 75%,hsl(var(--nextui-success)))}.bg-stripe-gradient-warning{background-image:linear-gradient(45deg,#fbdba7 25%,#f5a524 25% 50%,#fbdba7 50% 75%,#f5a524 75%,#f5a524);background-image:linear-gradient(45deg,hsl(var(--nextui-warning-200)) 25%,hsl(var(--nextui-warning)) 25% 50%,hsl(var(--nextui-warning-200)) 50% 75%,hsl(var(--nextui-warning)) 75%,hsl(var(--nextui-warning)))}.bg-stripe-size{background-size:1.25rem 1.25rem}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-current{fill:currentColor}.stroke-current{stroke:currentColor}.stroke-default-300\\/50{stroke:#d4d4d880;stroke:hsl(var(--nextui-default-300) / .5)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-2\\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.\\!px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-0{padding-left:0;padding-right:0}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.\\!pb-0{padding-bottom:0!important}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-1\\.5{padding-bottom:.375rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pe-2{padding-right:.5rem}.pe-6{padding-right:1.5rem}.pl-0\\.5{padding-left:.125rem}.pl-1{padding-left:.25rem}.pl-4{padding-left:1rem}.pl-\\[1px\\]{padding-left:1px}.pr-0\\.5{padding-right:.125rem}.pr-1{padding-right:.25rem}.ps-2{padding-left:.5rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:left}.text-end{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[0\\.55rem\\]{font-size:.55rem}.text-\\[0\\.5rem\\]{font-size:.5rem}.text-\\[0\\.6rem\\]{font-size:.6rem}.text-\\[100\\%\\]{font-size:100%}.text-large{font-size:1.125rem;font-size:var(--nextui-font-size-large);line-height:1.75rem;line-height:var(--nextui-line-height-large)}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-medium{font-size:1rem;font-size:var(--nextui-font-size-medium);line-height:1.5rem;line-height:var(--nextui-line-height-medium)}.text-small{font-size:.875rem;font-size:var(--nextui-font-size-small);line-height:1.25rem;line-height:var(--nextui-line-height-small)}.text-tiny{font-size:.75rem;font-size:var(--nextui-font-size-tiny);line-height:1rem;line-height:var(--nextui-line-height-tiny)}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-extralight{font-weight:200}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) tabular-nums var(--tw-numeric-fraction);font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) tabular-nums var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-\\[1\\.15\\]{line-height:1.15}.leading-\\[32px\\]{line-height:32px}.\\!text-danger{--tw-text-opacity: 1 !important;color:#f31260!important;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))!important}.text-background{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-text-opacity)))}.text-black{--tw-text-opacity: 1;color:#000;color:rgba(0,0,0,var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-danger{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.text-danger-300{--tw-text-opacity: 1;color:#f872a1;color:hsl(var(--nextui-danger-300) / var(--nextui-danger-300-opacity, var(--tw-text-opacity)))}.text-danger-500{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.text-danger-600{--tw-text-opacity: 1;color:#c40e4d;color:hsl(var(--nextui-danger-600) / var(--nextui-danger-600-opacity, var(--tw-text-opacity)))}.text-danger-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.text-danger\\/80{color:#f31260cc;color:hsl(var(--nextui-danger) / .8)}.text-default-400{--tw-text-opacity: 1;color:#a1a1aa;color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-text-opacity)))}.text-default-500{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-default-500) / var(--nextui-default-500-opacity, var(--tw-text-opacity)))}.text-default-600{--tw-text-opacity: 1;color:#52525b;color:hsl(var(--nextui-default-600) / var(--nextui-default-600-opacity, var(--tw-text-opacity)))}.text-default-700{--tw-text-opacity: 1;color:#3f3f46;color:hsl(var(--nextui-default-700) / var(--nextui-default-700-opacity, var(--tw-text-opacity)))}.text-default-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.text-foreground{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.text-foreground-400{--tw-text-opacity: 1;color:#a1a1aa;color:hsl(var(--nextui-foreground-400) / var(--nextui-foreground-400-opacity, var(--tw-text-opacity)))}.text-foreground-500{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-foreground-500) / var(--nextui-foreground-500-opacity, var(--tw-text-opacity)))}.text-foreground-600{--tw-text-opacity: 1;color:#52525b;color:hsl(var(--nextui-foreground-600) / var(--nextui-foreground-600-opacity, var(--tw-text-opacity)))}.text-foreground\\/50{color:#11181c80;color:hsl(var(--nextui-foreground) / .5)}.text-inherit{color:inherit}.text-primary{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.text-primary-300{--tw-text-opacity: 1;color:#67abf9;color:hsl(var(--nextui-primary-300) / var(--nextui-primary-300-opacity, var(--tw-text-opacity)))}.text-primary-500{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary-500) / var(--nextui-primary-500-opacity, var(--tw-text-opacity)))}.text-primary-600{--tw-text-opacity: 1;color:#005ac2;color:hsl(var(--nextui-primary-600) / var(--nextui-primary-600-opacity, var(--tw-text-opacity)))}.text-primary-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.text-primary\\/80{color:#0070f0cc;color:hsl(var(--nextui-primary) / .8)}.text-secondary{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.text-secondary-300{--tw-text-opacity: 1;color:#ad7dde;color:hsl(var(--nextui-secondary-300) / var(--nextui-secondary-300-opacity, var(--tw-text-opacity)))}.text-secondary-500{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary-500) / var(--nextui-secondary-500-opacity, var(--tw-text-opacity)))}.text-secondary-600{--tw-text-opacity: 1;color:#6120a2;color:hsl(var(--nextui-secondary-600) / var(--nextui-secondary-600-opacity, var(--tw-text-opacity)))}.text-secondary-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.text-secondary\\/80{color:#7828c8cc;color:hsl(var(--nextui-secondary) / .8)}.text-success{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.text-success-400{--tw-text-opacity: 1;color:#45d383;color:hsl(var(--nextui-success-400) / var(--nextui-success-400-opacity, var(--tw-text-opacity)))}.text-success-500{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success-500) / var(--nextui-success-500-opacity, var(--tw-text-opacity)))}.text-success-600{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.text-success-700{--tw-text-opacity: 1;color:#0e773b;color:hsl(var(--nextui-success-700) / var(--nextui-success-700-opacity, var(--tw-text-opacity)))}.text-success-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.text-success\\/80{color:#18c964cc;color:hsl(var(--nextui-success) / .8)}.text-transparent{color:transparent}.text-warning{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.text-warning-400{--tw-text-opacity: 1;color:#f7b750;color:hsl(var(--nextui-warning-400) / var(--nextui-warning-400-opacity, var(--tw-text-opacity)))}.text-warning-500{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning-500) / var(--nextui-warning-500-opacity, var(--tw-text-opacity)))}.text-warning-600{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.text-warning-700{--tw-text-opacity: 1;color:#926316;color:hsl(var(--nextui-warning-700) / var(--nextui-warning-700-opacity, var(--tw-text-opacity)))}.text-warning-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.text-warning\\/80{color:#f5a524cc;color:hsl(var(--nextui-warning) / .8)}.text-white{--tw-text-opacity: 1;color:#fff;color:rgba(255,255,255,var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-\\[0\\.0001\\]{opacity:.0001}.opacity-\\[value\\]{opacity:value}.opacity-disabled{opacity:.5;opacity:var(--nextui-disabled-opacity)}.\\!shadow-none{--tw-shadow: 0 0 rgba(0,0,0,0) !important;--tw-shadow-colored: 0 0 rgba(0,0,0,0) !important;box-shadow:0 0 #0000,0 0 #0000,0 0 #0000!important;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)!important}.shadow{--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-\\[0_1px_0px_0_rgba\\(0\\,0\\,0\\,0\\.05\\)\\]{--tw-shadow: 0 1px 0px 0 rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 0px 0 var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px #0000000d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-\\[0px_20px_20px_0px_rgb\\(0_0_0\\/0\\.05\\)\\]{--tw-shadow: 0px 20px 20px 0px rgba(0, 0, 0, .05);--tw-shadow-colored: 0px 20px 20px 0px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 20px 20px #0000000d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-large{--tw-shadow: var(--nextui-box-shadow-large);--tw-shadow-colored: var(--nextui-box-shadow-large);box-shadow:0 0 #0000,0 0 #0000,0 0 30px #0000000a,0 30px 60px #0000001f,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-medium{--tw-shadow: var(--nextui-box-shadow-medium);--tw-shadow-colored: var(--nextui-box-shadow-medium);box-shadow:0 0 #0000,0 0 #0000,0 0 15px #00000008,0 2px 30px #00000014,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 rgba(0,0,0,0);--tw-shadow-colored: 0 0 rgba(0,0,0,0);box-shadow:0 0 #0000,0 0 #0000,0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #0000000d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-small{--tw-shadow: var(--nextui-box-shadow-small);--tw-shadow-colored: var(--nextui-box-shadow-small);box-shadow:0 0 #0000,0 0 #0000,0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.shadow-black\\/5{--tw-shadow-color: rgba(0, 0, 0, .05);--tw-shadow: var(--tw-shadow-colored)}.shadow-danger\\/40{--tw-shadow-color: hsl(var(--nextui-danger) / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-default\\/50{--tw-shadow-color: hsl(var(--nextui-default) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-foreground\\/40{--tw-shadow-color: hsl(var(--nextui-foreground) / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--nextui-primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-secondary\\/40{--tw-shadow-color: hsl(var(--nextui-secondary) / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-success\\/40{--tw-shadow-color: hsl(var(--nextui-success) / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-warning\\/40{--tw-shadow-color: hsl(var(--nextui-warning) / .4);--tw-shadow: var(--tw-shadow-colored)}.\\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),0 0 #0000;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 rgba(0,0,0,0))}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),0 0 #0000;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 rgba(0,0,0,0))}.ring-background{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-ring-opacity)))}.ring-danger{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-ring-opacity)))}.ring-default{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-ring-opacity)))}.ring-focus{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-focus) / var(--nextui-focus-opacity, var(--tw-ring-opacity)))}.ring-primary{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-ring-opacity)))}.ring-secondary{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-ring-opacity)))}.ring-success{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-ring-opacity)))}.ring-transparent{--tw-ring-color: transparent}.ring-warning{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-ring-opacity)))}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--nextui-background) / var(--nextui-background-opacity, 1))}.blur{--tw-blur: blur(8px);filter:blur(8px) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-lg{--tw-blur: blur(16px);filter:blur(16px) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) invert(100%) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.saturate-150{--tw-saturate: saturate(1.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) saturate(1.5) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);backdrop-filter:blur(8px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-lg{--tw-backdrop-blur: blur(16px);backdrop-filter:blur(16px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:blur(12px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:blur(4px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);backdrop-filter:blur(24px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-opacity-disabled{--tw-backdrop-opacity: opacity(var(--nextui-disabled-opacity));backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) opacity(.5) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-saturate-150{--tw-backdrop-saturate: saturate(1.5);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) saturate(1.5) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.\\!transition-none{transition-property:none!important}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-\\[color\\,opacity\\]{transition-property:color,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-\\[transform\\,background-color\\,color\\]{transition-property:transform,background-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-\\[transform\\,color\\,left\\,opacity\\]{transition-property:transform,color,left,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.\\!duration-100{transition-duration:.1s!important}.\\!duration-150{transition-duration:.15s!important}.\\!duration-200{transition-duration:.2s!important}.\\!duration-250{transition-duration:.25s!important}.\\!duration-300{transition-duration:.3s!important}.\\!duration-500{transition-duration:.5s!important}.duration-150{transition-duration:.15s}.\\!ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)!important}.\\!ease-soft-spring{transition-timing-function:cubic-bezier(.155,1.105,.295,1.12)!important}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-auto{will-change:auto}.will-change-transform{will-change:transform}:root,.light,[data-theme=light]{--csstools-color-scheme--light: initial;color-scheme:light;--nextui-background: 0 0% 100%;--nextui-foreground-50: 0 0% 98.04%;--nextui-foreground-100: 240 4.76% 95.88%;--nextui-foreground-200: 240 5.88% 90%;--nextui-foreground-300: 240 4.88% 83.92%;--nextui-foreground-400: 240 5.03% 64.9%;--nextui-foreground-500: 240 3.83% 46.08%;--nextui-foreground-600: 240 5.2% 33.92%;--nextui-foreground-700: 240 5.26% 26.08%;--nextui-foreground-800: 240 3.7% 15.88%;--nextui-foreground-900: 240 5.88% 10%;--nextui-foreground: 201.81999999999994 24.44% 8.82%;--nextui-divider: 0 0% 6.67%;--nextui-divider-opacity: .15;--nextui-focus: 212.01999999999998 100% 46.67%;--nextui-overlay: 0 0% 0%;--nextui-content1: 0 0% 100%;--nextui-content1-foreground: 201.81999999999994 24.44% 8.82%;--nextui-content2: 240 4.76% 95.88%;--nextui-content2-foreground: 240 3.7% 15.88%;--nextui-content3: 240 5.88% 90%;--nextui-content3-foreground: 240 5.26% 26.08%;--nextui-content4: 240 4.88% 83.92%;--nextui-content4-foreground: 240 5.2% 33.92%;--nextui-default-50: 0 0% 98.04%;--nextui-default-100: 240 4.76% 95.88%;--nextui-default-200: 240 5.88% 90%;--nextui-default-300: 240 4.88% 83.92%;--nextui-default-400: 240 5.03% 64.9%;--nextui-default-500: 240 3.83% 46.08%;--nextui-default-600: 240 5.2% 33.92%;--nextui-default-700: 240 5.26% 26.08%;--nextui-default-800: 240 3.7% 15.88%;--nextui-default-900: 240 5.88% 10%;--nextui-default-foreground: 0 0% 0%;--nextui-default: 240 4.88% 83.92%;--nextui-primary-50: 212.5 92.31% 94.9%;--nextui-primary-100: 211.84000000000003 92.45% 89.61%;--nextui-primary-200: 211.84000000000003 92.45% 79.22%;--nextui-primary-300: 212.24 92.45% 68.82%;--nextui-primary-400: 212.14 92.45% 58.43%;--nextui-primary-500: 212.01999999999998 100% 46.67%;--nextui-primary-600: 212.14 100% 38.43%;--nextui-primary-700: 212.24 100% 28.82%;--nextui-primary-800: 211.84000000000003 100% 19.22%;--nextui-primary-900: 211.84000000000003 100% 9.61%;--nextui-primary-foreground: 0 0% 100%;--nextui-primary: 212.01999999999998 100% 46.67%;--nextui-secondary-50: 270 61.54% 94.9%;--nextui-secondary-100: 270 59.26% 89.41%;--nextui-secondary-200: 270 59.26% 78.82%;--nextui-secondary-300: 270 59.26% 68.24%;--nextui-secondary-400: 270 59.26% 57.65%;--nextui-secondary-500: 270 66.67% 47.06%;--nextui-secondary-600: 270 66.67% 37.65%;--nextui-secondary-700: 270 66.67% 28.24%;--nextui-secondary-800: 270 66.67% 18.82%;--nextui-secondary-900: 270 66.67% 9.41%;--nextui-secondary-foreground: 0 0% 100%;--nextui-secondary: 270 66.67% 47.06%;--nextui-success-50: 146.66999999999996 64.29% 94.51%;--nextui-success-100: 145.71000000000004 61.4% 88.82%;--nextui-success-200: 146.2 61.74% 77.45%;--nextui-success-300: 145.78999999999996 62.57% 66.47%;--nextui-success-400: 146.01 62.45% 55.1%;--nextui-success-500: 145.96000000000004 79.46% 43.92%;--nextui-success-600: 146.01 79.89% 35.1%;--nextui-success-700: 145.78999999999996 79.26% 26.47%;--nextui-success-800: 146.2 79.78% 17.45%;--nextui-success-900: 145.71000000000004 77.78% 8.82%;--nextui-success-foreground: 0 0% 0%;--nextui-success: 145.96000000000004 79.46% 43.92%;--nextui-warning-50: 54.55000000000001 91.67% 95.29%;--nextui-warning-100: 37.139999999999986 91.3% 90.98%;--nextui-warning-200: 37.139999999999986 91.3% 81.96%;--nextui-warning-300: 36.95999999999998 91.24% 73.14%;--nextui-warning-400: 37.00999999999999 91.26% 64.12%;--nextui-warning-500: 37.02999999999997 91.27% 55.1%;--nextui-warning-600: 37.00999999999999 74.22% 44.12%;--nextui-warning-700: 36.95999999999998 73.96% 33.14%;--nextui-warning-800: 37.139999999999986 75% 21.96%;--nextui-warning-900: 37.139999999999986 75% 10.98%;--nextui-warning-foreground: 0 0% 0%;--nextui-warning: 37.02999999999997 91.27% 55.1%;--nextui-danger-50: 339.13 92% 95.1%;--nextui-danger-100: 340 91.84% 90.39%;--nextui-danger-200: 339.3299999999999 90% 80.39%;--nextui-danger-300: 339.11 90.6% 70.78%;--nextui-danger-400: 339 90% 60.78%;--nextui-danger-500: 339.20000000000005 90.36% 51.18%;--nextui-danger-600: 339 86.54% 40.78%;--nextui-danger-700: 339.11 85.99% 30.78%;--nextui-danger-800: 339.3299999999999 86.54% 20.39%;--nextui-danger-900: 340 84.91% 10.39%;--nextui-danger-foreground: 0 0% 100%;--nextui-danger: 339.20000000000005 90.36% 51.18%;--nextui-divider-weight: 1px;--nextui-disabled-opacity: .5;--nextui-font-size-tiny: .75rem;--nextui-font-size-small: .875rem;--nextui-font-size-medium: 1rem;--nextui-font-size-large: 1.125rem;--nextui-line-height-tiny: 1rem;--nextui-line-height-small: 1.25rem;--nextui-line-height-medium: 1.5rem;--nextui-line-height-large: 1.75rem;--nextui-radius-small: 8px;--nextui-radius-medium: 12px;--nextui-radius-large: 14px;--nextui-border-width-small: 1px;--nextui-border-width-medium: 2px;--nextui-border-width-large: 3px;--nextui-box-shadow-small: 0px 0px 5px 0px rgba(0, 0, 0, .02), 0px 2px 10px 0px rgba(0, 0, 0, .06), 0px 0px 1px 0px rgba(0, 0, 0, .3);--nextui-box-shadow-medium: 0px 0px 15px 0px rgba(0, 0, 0, .03), 0px 2px 30px 0px rgba(0, 0, 0, .08), 0px 0px 1px 0px rgba(0, 0, 0, .3);--nextui-box-shadow-large: 0px 0px 30px 0px rgba(0, 0, 0, .04), 0px 30px 60px 0px rgba(0, 0, 0, .12), 0px 0px 1px 0px rgba(0, 0, 0, .3);--nextui-hover-opacity: .8}.dark,[data-theme=dark]{--csstools-color-scheme--light: ;color-scheme:dark;--nextui-background: 0 0% 0%;--nextui-foreground-50: 240 5.88% 10%;--nextui-foreground-100: 240 3.7% 15.88%;--nextui-foreground-200: 240 5.26% 26.08%;--nextui-foreground-300: 240 5.2% 33.92%;--nextui-foreground-400: 240 3.83% 46.08%;--nextui-foreground-500: 240 5.03% 64.9%;--nextui-foreground-600: 240 4.88% 83.92%;--nextui-foreground-700: 240 5.88% 90%;--nextui-foreground-800: 240 4.76% 95.88%;--nextui-foreground-900: 0 0% 98.04%;--nextui-foreground: 210 5.56% 92.94%;--nextui-focus: 212.01999999999998 100% 46.67%;--nextui-overlay: 0 0% 0%;--nextui-divider: 0 0% 100%;--nextui-divider-opacity: .15;--nextui-content1: 240 5.88% 10%;--nextui-content1-foreground: 0 0% 98.04%;--nextui-content2: 240 3.7% 15.88%;--nextui-content2-foreground: 240 4.76% 95.88%;--nextui-content3: 240 5.26% 26.08%;--nextui-content3-foreground: 240 5.88% 90%;--nextui-content4: 240 5.2% 33.92%;--nextui-content4-foreground: 240 4.88% 83.92%;--nextui-default-50: 240 5.88% 10%;--nextui-default-100: 240 3.7% 15.88%;--nextui-default-200: 240 5.26% 26.08%;--nextui-default-300: 240 5.2% 33.92%;--nextui-default-400: 240 3.83% 46.08%;--nextui-default-500: 240 5.03% 64.9%;--nextui-default-600: 240 4.88% 83.92%;--nextui-default-700: 240 5.88% 90%;--nextui-default-800: 240 4.76% 95.88%;--nextui-default-900: 0 0% 98.04%;--nextui-default-foreground: 0 0% 100%;--nextui-default: 240 5.26% 26.08%;--nextui-primary-50: 211.84000000000003 100% 9.61%;--nextui-primary-100: 211.84000000000003 100% 19.22%;--nextui-primary-200: 212.24 100% 28.82%;--nextui-primary-300: 212.14 100% 38.43%;--nextui-primary-400: 212.01999999999998 100% 46.67%;--nextui-primary-500: 212.14 92.45% 58.43%;--nextui-primary-600: 212.24 92.45% 68.82%;--nextui-primary-700: 211.84000000000003 92.45% 79.22%;--nextui-primary-800: 211.84000000000003 92.45% 89.61%;--nextui-primary-900: 212.5 92.31% 94.9%;--nextui-primary-foreground: 0 0% 100%;--nextui-primary: 212.01999999999998 100% 46.67%;--nextui-secondary-50: 270 66.67% 9.41%;--nextui-secondary-100: 270 66.67% 18.82%;--nextui-secondary-200: 270 66.67% 28.24%;--nextui-secondary-300: 270 66.67% 37.65%;--nextui-secondary-400: 270 66.67% 47.06%;--nextui-secondary-500: 270 59.26% 57.65%;--nextui-secondary-600: 270 59.26% 68.24%;--nextui-secondary-700: 270 59.26% 78.82%;--nextui-secondary-800: 270 59.26% 89.41%;--nextui-secondary-900: 270 61.54% 94.9%;--nextui-secondary-foreground: 0 0% 100%;--nextui-secondary: 270 59.26% 57.65%;--nextui-success-50: 145.71000000000004 77.78% 8.82%;--nextui-success-100: 146.2 79.78% 17.45%;--nextui-success-200: 145.78999999999996 79.26% 26.47%;--nextui-success-300: 146.01 79.89% 35.1%;--nextui-success-400: 145.96000000000004 79.46% 43.92%;--nextui-success-500: 146.01 62.45% 55.1%;--nextui-success-600: 145.78999999999996 62.57% 66.47%;--nextui-success-700: 146.2 61.74% 77.45%;--nextui-success-800: 145.71000000000004 61.4% 88.82%;--nextui-success-900: 146.66999999999996 64.29% 94.51%;--nextui-success-foreground: 0 0% 0%;--nextui-success: 145.96000000000004 79.46% 43.92%;--nextui-warning-50: 37.139999999999986 75% 10.98%;--nextui-warning-100: 37.139999999999986 75% 21.96%;--nextui-warning-200: 36.95999999999998 73.96% 33.14%;--nextui-warning-300: 37.00999999999999 74.22% 44.12%;--nextui-warning-400: 37.02999999999997 91.27% 55.1%;--nextui-warning-500: 37.00999999999999 91.26% 64.12%;--nextui-warning-600: 36.95999999999998 91.24% 73.14%;--nextui-warning-700: 37.139999999999986 91.3% 81.96%;--nextui-warning-800: 37.139999999999986 91.3% 90.98%;--nextui-warning-900: 54.55000000000001 91.67% 95.29%;--nextui-warning-foreground: 0 0% 0%;--nextui-warning: 37.02999999999997 91.27% 55.1%;--nextui-danger-50: 340 84.91% 10.39%;--nextui-danger-100: 339.3299999999999 86.54% 20.39%;--nextui-danger-200: 339.11 85.99% 30.78%;--nextui-danger-300: 339 86.54% 40.78%;--nextui-danger-400: 339.20000000000005 90.36% 51.18%;--nextui-danger-500: 339 90% 60.78%;--nextui-danger-600: 339.11 90.6% 70.78%;--nextui-danger-700: 339.3299999999999 90% 80.39%;--nextui-danger-800: 340 91.84% 90.39%;--nextui-danger-900: 339.13 92% 95.1%;--nextui-danger-foreground: 0 0% 100%;--nextui-danger: 339.20000000000005 90.36% 51.18%;--nextui-divider-weight: 1px;--nextui-disabled-opacity: .5;--nextui-font-size-tiny: .75rem;--nextui-font-size-small: .875rem;--nextui-font-size-medium: 1rem;--nextui-font-size-large: 1.125rem;--nextui-line-height-tiny: 1rem;--nextui-line-height-small: 1.25rem;--nextui-line-height-medium: 1.5rem;--nextui-line-height-large: 1.75rem;--nextui-radius-small: 8px;--nextui-radius-medium: 12px;--nextui-radius-large: 14px;--nextui-border-width-small: 1px;--nextui-border-width-medium: 2px;--nextui-border-width-large: 3px;--nextui-box-shadow-small: 0px 0px 5px 0px rgba(0, 0, 0, .05), 0px 2px 10px 0px rgba(0, 0, 0, .2), inset 0px 0px 1px 0px rgba(255, 255, 255, .15);--nextui-box-shadow-medium: 0px 0px 15px 0px rgba(0, 0, 0, .06), 0px 2px 30px 0px rgba(0, 0, 0, .22), inset 0px 0px 1px 0px rgba(255, 255, 255, .15);--nextui-box-shadow-large: 0px 0px 30px 0px rgba(0, 0, 0, .07), 0px 30px 60px 0px rgba(0, 0, 0, .26), inset 0px 0px 1px 0px rgba(255, 255, 255, .15);--nextui-hover-opacity: .9}.leading-inherit{line-height:inherit}.bg-img-inherit{background-image:inherit}.bg-clip-inherit{background-clip:inherit}.text-fill-inherit{-webkit-text-fill-color:inherit}.tap-highlight-transparent{-webkit-tap-highlight-color:transparent}.input-search-cancel-button-none::-webkit-search-cancel-button{-webkit-appearance:none}.transition-background{transition-property:background;transition-timing-function:ease;transition-duration:.25s}.transition-colors-opacity{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s}.transition-width{transition-property:width;transition-timing-function:ease;transition-duration:.25s}.transition-height{transition-property:height;transition-timing-function:ease;transition-duration:.25s}.transition-size{transition-property:width,height;transition-timing-function:ease;transition-duration:.25s}.transition-left{transition-property:left;transition-timing-function:ease;transition-duration:.25s}.transition-transform-opacity{transition-property:transform,opacity;transition-timing-function:ease;transition-duration:.25s}.transition-transform-background{transition-property:transform,background;transition-timing-function:ease;transition-duration:.25s}.transition-transform-colors{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:ease;transition-duration:.25s}.transition-transform-colors-opacity{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-default{-ms-overflow-style:auto;scrollbar-width:auto}.scrollbar-default::-webkit-scrollbar{display:block}.\\[--cursor-hit-x\\:8px\\]{--cursor-hit-x: 8px}.\\[--picker-height\\:224px\\]{--picker-height: 224px}.\\[--scale-enter\\:100\\%\\]{--scale-enter: 100%}.\\[--scale-exit\\:100\\%\\]{--scale-exit: 100%}.\\[--scroll-shadow-size\\:100px\\]{--scroll-shadow-size: 100px}.\\[--slide-enter\\:0px\\]{--slide-enter: 0px}.\\[--slide-exit\\:80px\\]{--slide-exit: 80px}.\\[mask-image\\:linear-gradient\\(\\#000\\,\\#000\\,transparent_0\\,\\#000_var\\(--scroll-shadow-size\\)\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\]{-webkit-mask-image:linear-gradient(#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent)}.file\\:cursor-pointer::file-selector-button{cursor:pointer}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.placeholder\\:text-danger::-moz-placeholder{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.placeholder\\:text-danger::placeholder{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.placeholder\\:text-foreground-500::-moz-placeholder{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-foreground-500) / var(--nextui-foreground-500-opacity, var(--tw-text-opacity)))}.placeholder\\:text-foreground-500::placeholder{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-foreground-500) / var(--nextui-foreground-500-opacity, var(--tw-text-opacity)))}.placeholder\\:text-primary::-moz-placeholder{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.placeholder\\:text-primary::placeholder{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.placeholder\\:text-secondary::-moz-placeholder{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.placeholder\\:text-secondary::placeholder{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.placeholder\\:text-success-600::-moz-placeholder{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.placeholder\\:text-success-600::placeholder{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.placeholder\\:text-warning-600::-moz-placeholder{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.placeholder\\:text-warning-600::placeholder{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-0:before{content:var(--tw-content);inset:0}.before\\:z-0:before{content:var(--tw-content);z-index:0}.before\\:z-\\[-1\\]:before{content:var(--tw-content);z-index:-1}.before\\:box-border:before{content:var(--tw-content);box-sizing:border-box}.before\\:block:before{content:var(--tw-content);display:block}.before\\:hidden:before{content:var(--tw-content);display:none}.before\\:h-0\\.5:before{content:var(--tw-content);height:.125rem}.before\\:h-11:before{content:var(--tw-content);height:2.75rem}.before\\:h-2\\.5:before{content:var(--tw-content);height:.625rem}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:w-0:before{content:var(--tw-content);width:0px}.before\\:w-11:before{content:var(--tw-content);width:2.75rem}.before\\:w-2\\.5:before{content:var(--tw-content);width:.625rem}.before\\:w-6:before{content:var(--tw-content);width:1.5rem}.before\\:-translate-x-full:before{content:var(--tw-content);--tw-translate-x: -100%;transform:translate(-100%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:-translate-y-1:before{content:var(--tw-content);--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),-.25rem) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:rotate-0:before{content:var(--tw-content);--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(0) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(45deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes shimmer{to{content:var(--tw-content);transform:translate(100%)}}.before\\:animate-\\[shimmer_2s_infinite\\]:before{content:var(--tw-content);animation:shimmer 2s infinite}.before\\:animate-none:before{content:var(--tw-content);animation:none}.before\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.5\\)\\]:before{content:var(--tw-content);border-radius:6px;border-radius:calc(var(--nextui-radius-medium) * .5)}.before\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.6\\)\\]:before{content:var(--tw-content);border-radius:calc(12px * .6);border-radius:calc(var(--nextui-radius-medium) * .6)}.before\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.7\\)\\]:before{content:var(--tw-content);border-radius:calc(12px * .7);border-radius:calc(var(--nextui-radius-medium) * .7)}.before\\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\\:rounded-none:before{content:var(--tw-content);border-radius:0}.before\\:rounded-sm:before{content:var(--tw-content);border-radius:.125rem}.before\\:border-2:before{content:var(--tw-content);border-width:2px}.before\\:border-t:before{content:var(--tw-content);border-top-width:1px}.before\\:border-solid:before{content:var(--tw-content);border-style:solid}.before\\:border-content4\\/30:before{content:var(--tw-content);border-color:#d4d4d84d;border-color:hsl(var(--nextui-content4) / .3)}.before\\:border-danger:before{content:var(--tw-content);--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.before\\:border-default:before{content:var(--tw-content);--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.before\\:bg-content1:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-content1) / var(--nextui-content1-opacity, var(--tw-bg-opacity)))}.before\\:bg-current:before{content:var(--tw-content);background-color:currentColor}.before\\:bg-danger:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.before\\:bg-danger\\/20:before{content:var(--tw-content);background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.before\\:bg-default\\/60:before{content:var(--tw-content);background-color:#d4d4d899;background-color:hsl(var(--nextui-default) / .6)}.before\\:bg-foreground:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.before\\:bg-primary\\/20:before{content:var(--tw-content);background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.before\\:bg-secondary:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.before\\:bg-secondary\\/20:before{content:var(--tw-content);background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.before\\:bg-success:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.before\\:bg-success\\/20:before{content:var(--tw-content);background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.before\\:bg-warning:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.before\\:bg-warning\\/20:before{content:var(--tw-content);background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.before\\:bg-gradient-to-r:before{content:var(--tw-content);background-image:linear-gradient(to right,var(--tw-gradient-stops))}.before\\:from-transparent:before{content:var(--tw-content);--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgba(0, 0, 0, 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.before\\:via-content4:before{content:var(--tw-content);--tw-gradient-to: hsl(var(--nextui-content4) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--nextui-content4) / var(--nextui-content4-opacity, 1)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.before\\:to-transparent:before{content:var(--tw-content);--tw-gradient-to: transparent var(--tw-gradient-to-position)}.before\\:opacity-0:before{content:var(--tw-content);opacity:0}.before\\:opacity-100:before{content:var(--tw-content);opacity:1}.before\\:shadow-small:before{content:var(--tw-content);--tw-shadow: var(--nextui-box-shadow-small);--tw-shadow-colored: var(--nextui-box-shadow-small);box-shadow:0 0 #0000,0 0 #0000,0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.before\\:transition-colors:before{content:var(--tw-content);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.before\\:transition-none:before{content:var(--tw-content);transition-property:none}.before\\:transition-transform:before{content:var(--tw-content);transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.before\\:duration-150:before{content:var(--tw-content);transition-duration:.15s}.before\\:content-\\[\\'\\'\\]:before{--tw-content: \"\";content:\"\";content:var(--tw-content)}.before\\:transition-width:before{content:var(--tw-content);transition-property:width;transition-timing-function:ease;transition-duration:.25s}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:0}.after\\:-bottom-1:after{content:var(--tw-content);bottom:-.25rem}.after\\:-bottom-\\[2px\\]:after{content:var(--tw-content);bottom:-2px}.after\\:bottom-0:after{content:var(--tw-content);bottom:0}.after\\:left-0:after{content:var(--tw-content);left:0}.after\\:left-1\\/2:after{content:var(--tw-content);left:50%}.after\\:right-0:after{content:var(--tw-content);right:0}.after\\:top-0:after{content:var(--tw-content);top:0}.after\\:-z-10:after{content:var(--tw-content);z-index:-10}.after\\:z-0:after{content:var(--tw-content);z-index:0}.after\\:ml-0\\.5:after{content:var(--tw-content);margin-left:.125rem}.after\\:ms-0\\.5:after{content:var(--tw-content);margin-left:.125rem}.after\\:block:after{content:var(--tw-content);display:block}.after\\:h-0:after{content:var(--tw-content);height:0px}.after\\:h-4:after{content:var(--tw-content);height:1rem}.after\\:h-5:after{content:var(--tw-content);height:1.25rem}.after\\:h-\\[2px\\]:after{content:var(--tw-content);height:2px}.after\\:h-divider:after{content:var(--tw-content);height:1px;height:var(--nextui-divider-weight)}.after\\:h-full:after{content:var(--tw-content);height:100%}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:w-0:after{content:var(--tw-content);width:0px}.after\\:w-4:after{content:var(--tw-content);width:1rem}.after\\:w-5:after{content:var(--tw-content);width:1.25rem}.after\\:w-6:after{content:var(--tw-content);width:1.5rem}.after\\:w-\\[80\\%\\]:after{content:var(--tw-content);width:80%}.after\\:w-full:after{content:var(--tw-content);width:100%}.after\\:origin-center:after{content:var(--tw-content);transform-origin:center}.after\\:-translate-x-1\\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(-50%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:translate-y-1:after{content:var(--tw-content);--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),.25rem) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:rotate-0:after{content:var(--tw-content);--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(0) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:scale-50:after{content:var(--tw-content);--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.5) scaleY(.5);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.large\\)\\/2\\)\\]:after{content:var(--tw-content);border-radius:7px;border-radius:calc(var(--nextui-radius-large) / 2)}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.5\\)\\]:after{content:var(--tw-content);border-radius:6px;border-radius:calc(var(--nextui-radius-medium) * .5)}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.6\\)\\]:after{content:var(--tw-content);border-radius:calc(12px * .6);border-radius:calc(var(--nextui-radius-medium) * .6)}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\*0\\.7\\)\\]:after{content:var(--tw-content);border-radius:calc(12px * .7);border-radius:calc(var(--nextui-radius-medium) * .7)}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.medium\\)\\/3\\)\\]:after{content:var(--tw-content);border-radius:4px;border-radius:calc(var(--nextui-radius-medium) / 3)}.after\\:rounded-\\[calc\\(theme\\(borderRadius\\.small\\)\\/3\\)\\]:after{content:var(--tw-content);border-radius:calc(8px / 3);border-radius:calc(var(--nextui-radius-small) / 3)}.after\\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\\:rounded-none:after{content:var(--tw-content);border-radius:0}.after\\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}.after\\:\\!bg-danger:after{content:var(--tw-content);--tw-bg-opacity: 1 !important;background-color:#f31260!important;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))!important}.after\\:bg-background:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-bg-opacity)))}.after\\:bg-content1:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-content1) / var(--nextui-content1-opacity, var(--tw-bg-opacity)))}.after\\:bg-content3:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-content3) / var(--nextui-content3-opacity, var(--tw-bg-opacity)))}.after\\:bg-current:after{content:var(--tw-content);background-color:currentColor}.after\\:bg-danger:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.after\\:bg-default:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.after\\:bg-default-foreground:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#000;background-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-bg-opacity)))}.after\\:bg-divider:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#12121226;background-color:hsl(var(--nextui-divider) / var(--nextui-divider-opacity, var(--tw-bg-opacity)))}.after\\:bg-foreground:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.after\\:bg-primary:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.after\\:bg-secondary:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.after\\:bg-success:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.after\\:bg-warning:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.after\\:text-danger:after{content:var(--tw-content);--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.after\\:text-danger-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.after\\:text-default-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.after\\:text-primary-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.after\\:text-secondary-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.after\\:text-success-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.after\\:text-warning-foreground:after{content:var(--tw-content);--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:shadow-\\[0_1px_0px_0_rgba\\(0\\,0\\,0\\,0\\.05\\)\\]:after{content:var(--tw-content);--tw-shadow: 0 1px 0px 0 rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 0px 0 var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px #0000000d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.after\\:shadow-small:after{content:var(--tw-content);--tw-shadow: var(--nextui-box-shadow-small);--tw-shadow-colored: var(--nextui-box-shadow-small);box-shadow:0 0 #0000,0 0 #0000,0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.after\\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.after\\:transition-none:after{content:var(--tw-content);transition-property:none}.after\\:transition-transform:after{content:var(--tw-content);transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.after\\:\\!duration-200:after{content:var(--tw-content);transition-duration:.2s!important}.after\\:duration-150:after{content:var(--tw-content);transition-duration:.15s}.after\\:\\!ease-linear:after{content:var(--tw-content);transition-timing-function:linear!important}.after\\:content-\\[\\'\\'\\]:after{--tw-content: \"\";content:\"\";content:var(--tw-content)}.after\\:content-\\[\\'\\*\\'\\]:after{--tw-content: \"*\";content:\"*\";content:var(--tw-content)}.after\\:transition-background:after{content:var(--tw-content);transition-property:background;transition-timing-function:ease;transition-duration:.25s}.after\\:transition-width:after{content:var(--tw-content);transition-property:width;transition-timing-function:ease;transition-duration:.25s}.after\\:transition-height:after{content:var(--tw-content);transition-property:height;transition-timing-function:ease;transition-duration:.25s}.after\\:transition-transform-opacity:after{content:var(--tw-content);transition-property:transform,opacity;transition-timing-function:ease;transition-duration:.25s}.first\\:-ml-0\\.5:first-child{margin-left:-.125rem}.first\\:mt-2:first-child{margin-top:.5rem}.first\\:rounded-s-full:first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.first\\:rounded-s-large:first-child{border-top-left-radius:14px;border-top-left-radius:var(--nextui-radius-large);border-bottom-left-radius:14px;border-bottom-left-radius:var(--nextui-radius-large)}.first\\:rounded-s-lg:first-child{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.first\\:rounded-s-medium:first-child{border-top-left-radius:12px;border-top-left-radius:var(--nextui-radius-medium);border-bottom-left-radius:12px;border-bottom-left-radius:var(--nextui-radius-medium)}.first\\:rounded-s-none:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.first\\:rounded-s-small:first-child{border-top-left-radius:8px;border-top-left-radius:var(--nextui-radius-small);border-bottom-left-radius:8px;border-bottom-left-radius:var(--nextui-radius-small)}.first\\:before\\:rounded-s-lg:first-child:before{content:var(--tw-content);border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.last\\:rounded-e-full:last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.last\\:rounded-e-large:last-child{border-top-right-radius:14px;border-top-right-radius:var(--nextui-radius-large);border-bottom-right-radius:14px;border-bottom-right-radius:var(--nextui-radius-large)}.last\\:rounded-e-lg:last-child{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.last\\:rounded-e-medium:last-child{border-top-right-radius:12px;border-top-right-radius:var(--nextui-radius-medium);border-bottom-right-radius:12px;border-bottom-right-radius:var(--nextui-radius-medium)}.last\\:rounded-e-none:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.last\\:rounded-e-small:last-child{border-top-right-radius:8px;border-top-right-radius:var(--nextui-radius-small);border-bottom-right-radius:8px;border-bottom-right-radius:var(--nextui-radius-small)}.last\\:before\\:rounded-e-lg:last-child:before{content:var(--tw-content);border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.first-of-type\\:rounded-e-none:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0}.last-of-type\\:rounded-s-none:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0}.autofill\\:bg-transparent:-webkit-autofill{background-color:transparent}.autofill\\:bg-transparent:autofill{background-color:transparent}.focus-within\\:border-danger:focus-within{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.focus-within\\:border-default-400:focus-within{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.focus-within\\:border-default-foreground:focus-within{--tw-border-opacity: 1;border-color:#000;border-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-border-opacity)))}.focus-within\\:border-primary:focus-within{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.focus-within\\:border-secondary:focus-within{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.focus-within\\:border-success:focus-within{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.focus-within\\:border-warning:focus-within{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.focus-within\\:bg-danger-50:focus-within{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.focus-within\\:bg-primary-50:focus-within{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.focus-within\\:bg-secondary-50:focus-within{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.focus-within\\:bg-success-50:focus-within{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.focus-within\\:bg-warning-50:focus-within{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.focus-within\\:after\\:w-full:focus-within:after{content:var(--tw-content);width:100%}.hover\\:-translate-x-0:hover{--tw-translate-x: -0px;transform:translate(-0px,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1.25) scaleY(1.25);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-danger:hover{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.hover\\:border-default:hover{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.hover\\:border-default-300:hover{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-border-opacity)))}.hover\\:border-default-400:hover{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.hover\\:border-primary:hover{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.hover\\:border-secondary:hover{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.hover\\:border-success:hover{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.hover\\:border-warning:hover{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.hover\\:\\!bg-foreground:hover{--tw-bg-opacity: 1 !important;background-color:#11181c!important;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))!important}.hover\\:bg-danger:hover{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.hover\\:bg-danger-50:hover{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.hover\\:bg-default-100:hover{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.hover\\:bg-default-200:hover{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.hover\\:bg-primary-50:hover{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.hover\\:bg-secondary-50:hover{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.hover\\:bg-success-50:hover{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.hover\\:bg-warning-50:hover{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:\\!opacity-100:hover{opacity:1!important}.hover\\:opacity-100:hover{opacity:1}.hover\\:opacity-80:hover{opacity:.8}.hover\\:after\\:bg-danger\\/20:hover:after{content:var(--tw-content);background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.hover\\:after\\:bg-foreground\\/10:hover:after{content:var(--tw-content);background-color:#11181c1a;background-color:hsl(var(--nextui-foreground) / .1)}.hover\\:after\\:bg-primary\\/20:hover:after{content:var(--tw-content);background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.hover\\:after\\:bg-secondary\\/20:hover:after{content:var(--tw-content);background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.hover\\:after\\:bg-success\\/20:hover:after{content:var(--tw-content);background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.hover\\:after\\:bg-warning\\/20:hover:after{content:var(--tw-content);background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.hover\\:after\\:opacity-100:hover:after{content:var(--tw-content);opacity:1}.focus-within\\:hover\\:border-danger:hover:focus-within{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:border-default-foreground:hover:focus-within{--tw-border-opacity: 1;border-color:#000;border-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:border-primary:hover:focus-within{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:border-secondary:hover:focus-within{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:border-success:hover:focus-within{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:border-warning:hover:focus-within{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.focus-within\\:hover\\:bg-default-100:hover:focus-within{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.focus\\:bg-danger-400\\/50:focus{background-color:#f5428180;background-color:hsl(var(--nextui-danger-400) / .5)}.focus\\:bg-default-400\\/50:focus{background-color:#a1a1aa80;background-color:hsl(var(--nextui-default-400) / .5)}.focus\\:bg-primary-400\\/50:focus{background-color:#318df680;background-color:hsl(var(--nextui-primary-400) / .5)}.focus\\:bg-secondary-400\\/50:focus{background-color:#9455d380;background-color:hsl(var(--nextui-secondary-400) / .5)}.focus\\:bg-success-400\\/50:focus{background-color:#45d38380;background-color:hsl(var(--nextui-success-400) / .5)}.focus\\:bg-warning-400\\/50:focus{background-color:#f7b75080;background-color:hsl(var(--nextui-warning-400) / .5)}.focus\\:underline:focus{text-decoration-line:underline}.focus\\:shadow-sm:focus{--tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #0000000d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.focus-visible\\:z-10:focus-visible{z-index:10}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-focus:focus-visible{outline-color:#0070f0;outline-color:hsl(var(--nextui-focus) / var(--nextui-focus-opacity, 1))}.active\\:bg-default-200:active{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.active\\:bg-default-300:active{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-bg-opacity)))}.active\\:underline:active{text-decoration-line:underline}.active\\:\\!opacity-70:active{opacity:.7!important}.active\\:opacity-disabled:active{opacity:.5;opacity:var(--nextui-disabled-opacity)}.disabled\\:cursor-default:disabled{cursor:default}.group:hover .group-hover\\:block{display:block}.group:hover .group-hover\\:hidden{display:none}.group:hover .group-hover\\:border-current{border-color:currentColor}.group:hover .group-hover\\:text-current{color:currentColor}.has-\\[\\:disabled\\]\\:opacity-60:has(:disabled){opacity:.6}.aria-expanded\\:scale-\\[0\\.97\\][aria-expanded=true]{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.97) scaleY(.97);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.aria-expanded\\:opacity-70[aria-expanded=true]{opacity:.7}.data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[loaded\\=true\\]\\:pointer-events-auto[data-loaded=true],.data-\\[visible\\=true\\]\\:pointer-events-auto[data-visible=true]{pointer-events:auto}.data-\\[focus-visible\\=true\\]\\:z-10[data-focus-visible=true],.data-\\[focused\\=true\\]\\:z-10[data-focused=true]{z-index:10}.data-\\[has-label\\=true\\]\\:mt-\\[calc\\(theme\\(fontSize\\.small\\)_\\+_10px\\)\\][data-has-label=true]{margin-top:calc(.875rem + 10px);margin-top:calc(var(--nextui-font-size-small) + 10px)}.data-\\[has-label\\=true\\]\\:mt-\\[calc\\(theme\\(fontSize\\.small\\)_\\+_12px\\)\\][data-has-label=true]{margin-top:calc(.875rem + 12px);margin-top:calc(var(--nextui-font-size-small) + 12px)}.data-\\[has-label\\=true\\]\\:mt-\\[calc\\(theme\\(fontSize\\.small\\)_\\+_8px\\)\\][data-has-label=true]{margin-top:calc(.875rem + 8px);margin-top:calc(var(--nextui-font-size-small) + 8px)}.data-\\[open\\=true\\]\\:block[data-open=true]{display:block}.data-\\[open\\=true\\]\\:flex[data-open=true]{display:flex}.data-\\[hidden\\=true\\]\\:hidden[data-hidden=true],.data-\\[inert\\=true\\]\\:hidden[data-inert=true]{display:none}.data-\\[justify\\=end\\]\\:flex-grow[data-justify=end],.data-\\[justify\\=start\\]\\:flex-grow[data-justify=start]{flex-grow:1}.data-\\[justify\\=end\\]\\:basis-0[data-justify=end],.data-\\[justify\\=start\\]\\:basis-0[data-justify=start]{flex-basis:0px}.data-\\[focus-visible\\=true\\]\\:-translate-x-3[data-focus-visible=true],.data-\\[hover\\=true\\]\\:-translate-x-3[data-hover=true]{--tw-translate-x: -.75rem;transform:translate(-.75rem,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[hover\\=true\\]\\:translate-x-0[data-hover=true]{--tw-translate-x: 0px;transform:translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[before\\=true\\]\\:rotate-180[data-before=true],.data-\\[direction\\=ascending\\]\\:rotate-180[data-direction=ascending]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[open\\=true\\]\\:-rotate-90[data-open=true]{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(-90deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[open\\=true\\]\\:rotate-180[data-open=true]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[active\\=true\\]\\:scale-110[data-active=true]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1.1) scaleY(1.1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[invisible\\=true\\]\\:scale-0[data-invisible=true]{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(0) scaleY(0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[pressed\\=true\\]\\:scale-100[data-pressed=true]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[pressed\\=true\\]\\:scale-\\[0\\.97\\][data-pressed=true]{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.97) scaleY(.97);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\=true\\]\\:cursor-default[data-disabled=true]{cursor:default}.data-\\[disabled\\=true\\]\\:cursor-not-allowed[data-disabled=true]{cursor:not-allowed}.data-\\[dragging\\=true\\]\\:cursor-grabbing[data-dragging=true]{cursor:grabbing}.data-\\[readonly\\=true\\]\\:cursor-default[data-readonly=true]{cursor:default}.data-\\[sortable\\=true\\]\\:cursor-pointer[data-sortable=true]{cursor:pointer}.data-\\[unavailable\\=true\\]\\:cursor-default[data-unavailable=true]{cursor:default}.data-\\[visible\\=true\\]\\:cursor-pointer[data-visible=true]{cursor:pointer}.data-\\[orientation\\=horizontal\\]\\:flex-row[data-orientation=horizontal]{flex-direction:row}.data-\\[has-helper\\=true\\]\\:items-start[data-has-helper=true]{align-items:flex-start}.data-\\[justify\\=start\\]\\:justify-start[data-justify=start]{justify-content:flex-start}.data-\\[justify\\=end\\]\\:justify-end[data-justify=end]{justify-content:flex-end}.data-\\[justify\\=center\\]\\:justify-center[data-justify=center]{justify-content:center}.data-\\[loaded\\=true\\]\\:overflow-visible[data-loaded=true]{overflow:visible}.data-\\[has-multiple-rows\\=true\\]\\:rounded-large[data-has-multiple-rows=true]{border-radius:14px;border-radius:var(--nextui-radius-large)}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:rounded-full[data-range-selection=true][data-selection-end=true][data-selected=true],.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:rounded-full[data-range-selection=true][data-selection-start=true][data-selected=true]{border-radius:9999px}.data-\\[menu-open\\=true\\]\\:border-none[data-menu-open=true]{border-style:none}.data-\\[active\\=true\\]\\:border-danger[data-active=true]{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-danger-400[data-active=true]{--tw-border-opacity: 1;border-color:#f54281;border-color:hsl(var(--nextui-danger-400) / var(--nextui-danger-400-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-default-300[data-active=true]{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-default-400[data-active=true]{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-foreground[data-active=true]{--tw-border-opacity: 1;border-color:#11181c;border-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-primary[data-active=true]{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-secondary[data-active=true]{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-success[data-active=true]{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:border-warning[data-active=true]{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-danger[data-focus=true]{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-default-400[data-focus=true]{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-default-foreground[data-focus=true]{--tw-border-opacity: 1;border-color:#000;border-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-primary[data-focus=true]{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-secondary[data-focus=true]{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-success[data-focus=true]{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.data-\\[focus\\=true\\]\\:border-warning[data-focus=true]{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-danger[data-hover=true]{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-default[data-hover=true]{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-default-400[data-hover=true]{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-primary[data-hover=true]{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-secondary[data-hover=true]{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-success[data-hover=true]{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.data-\\[hover\\=true\\]\\:border-warning[data-hover=true]{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-danger[data-open=true]{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-default-400[data-open=true]{--tw-border-opacity: 1;border-color:#a1a1aa;border-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-default-foreground[data-open=true]{--tw-border-opacity: 1;border-color:#000;border-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-primary[data-open=true]{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-secondary[data-open=true]{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-success[data-open=true]{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.data-\\[open\\=true\\]\\:border-warning[data-open=true]{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.data-\\[active\\=true\\]\\:bg-danger[data-active=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-danger-100[data-active=true]{--tw-bg-opacity: 1;background-color:#fdcede;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-danger-200[data-active=true]{--tw-bg-opacity: 1;background-color:#fa9ebe;background-color:hsl(var(--nextui-danger-200) / var(--nextui-danger-200-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-default-200[data-active=true]{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-default-400[data-active=true]{--tw-bg-opacity: 1;background-color:#a1a1aa;background-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-primary[data-active=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-primary-200[data-active=true]{--tw-bg-opacity: 1;background-color:#98c6fb;background-color:hsl(var(--nextui-primary-200) / var(--nextui-primary-200-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-secondary[data-active=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-secondary-200[data-active=true]{--tw-bg-opacity: 1;background-color:#c9aae9;background-color:hsl(var(--nextui-secondary-200) / var(--nextui-secondary-200-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-success[data-active=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-success-200[data-active=true]{--tw-bg-opacity: 1;background-color:#a0e9c0;background-color:hsl(var(--nextui-success-200) / var(--nextui-success-200-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-warning[data-active=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[active\\=true\\]\\:bg-warning-200[data-active=true]{--tw-bg-opacity: 1;background-color:#fbdba7;background-color:hsl(var(--nextui-warning-200) / var(--nextui-warning-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:\\!bg-danger[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#f31260!important;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-danger-100[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#fdcede!important;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-default[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#d4d4d8!important;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-primary[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#0070f0!important;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-secondary[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#7828c8!important;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-success[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#18c964!important;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!bg-warning[data-hover=true]{--tw-bg-opacity: 1 !important;background-color:#f5a524!important;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))!important}.data-\\[hover\\=true\\]\\:bg-content2[data-hover=true]{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-content2) / var(--nextui-content2-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-danger[data-hover=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-danger-100[data-hover=true]{--tw-bg-opacity: 1;background-color:#fdcede;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-danger-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-danger\\/20[data-hover=true]{background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.data-\\[hover\\=true\\]\\:bg-default[data-hover=true]{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-default-100[data-hover=true]{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-default-200[data-hover=true]{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-default\\/40[data-hover=true]{background-color:#d4d4d866;background-color:hsl(var(--nextui-default) / .4)}.data-\\[hover\\=true\\]\\:bg-foreground-200[data-hover=true]{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-foreground-200) / var(--nextui-foreground-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-primary[data-hover=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-primary-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-primary\\/20[data-hover=true]{background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.data-\\[hover\\=true\\]\\:bg-secondary[data-hover=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-secondary-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-secondary\\/20[data-hover=true]{background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.data-\\[hover\\=true\\]\\:bg-success[data-hover=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-success-100[data-hover=true]{--tw-bg-opacity: 1;background-color:#d2f4e1;background-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-success-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-success\\/20[data-hover=true]{background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.data-\\[hover\\=true\\]\\:bg-transparent[data-hover=true]{background-color:transparent}.data-\\[hover\\=true\\]\\:bg-warning[data-hover=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-warning-100[data-hover=true]{--tw-bg-opacity: 1;background-color:#fdedd3;background-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-warning-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\=true\\]\\:bg-warning\\/20[data-hover=true]{background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.data-\\[hover\\]\\:bg-danger-200[data-hover]{--tw-bg-opacity: 1;background-color:#fa9ebe;background-color:hsl(var(--nextui-danger-200) / var(--nextui-danger-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-danger-50[data-hover]{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-default-100[data-hover]{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-primary-200[data-hover]{--tw-bg-opacity: 1;background-color:#98c6fb;background-color:hsl(var(--nextui-primary-200) / var(--nextui-primary-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-primary-50[data-hover]{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-secondary-200[data-hover]{--tw-bg-opacity: 1;background-color:#c9aae9;background-color:hsl(var(--nextui-secondary-200) / var(--nextui-secondary-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-secondary-50[data-hover]{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-success-200[data-hover]{--tw-bg-opacity: 1;background-color:#a0e9c0;background-color:hsl(var(--nextui-success-200) / var(--nextui-success-200-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-success-50[data-hover]{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-warning-100[data-hover]{--tw-bg-opacity: 1;background-color:#fdedd3;background-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-bg-opacity)))}.data-\\[hover\\]\\:bg-warning-200[data-hover]{--tw-bg-opacity: 1;background-color:#fbdba7;background-color:hsl(var(--nextui-warning-200) / var(--nextui-warning-200-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=false\\]\\:bg-default-200[data-in-range=false]{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-background\\/50[data-in-range=true]{background-color:#ffffff80;background-color:hsl(var(--nextui-background) / .5)}.data-\\[in-range\\=true\\]\\:bg-danger[data-in-range=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-foreground[data-in-range=true]{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-primary[data-in-range=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-secondary[data-in-range=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-success[data-in-range=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[in-range\\=true\\]\\:bg-warning[data-in-range=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[loaded\\=true\\]\\:\\!bg-transparent[data-loaded=true]{background-color:transparent!important}.data-\\[selected\\=true\\]\\:bg-danger[data-selected=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-default[data-selected=true]{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-foreground[data-selected=true]{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-primary[data-selected=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-secondary[data-selected=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-success[data-selected=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:bg-warning[data-selected=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-danger[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-foreground[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-primary[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-secondary[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-success[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-warning[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:data-\\[outside-month\\=true\\]\\:bg-transparent[data-outside-month=true][data-range-selection=true][data-selected=true]{background-color:transparent}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-danger[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-primary[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-secondary[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-success[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-warning[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-danger[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-primary[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-secondary[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-success[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:bg-warning[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[has-end-content\\=true\\]\\:pe-1\\.5[data-has-end-content=true]{padding-right:.375rem}.data-\\[has-helper\\=true\\]\\:pb-\\[calc\\(theme\\(fontSize\\.tiny\\)_\\+8px\\)\\][data-has-helper=true],.data-\\[has-helper\\=true\\]\\:pb-\\[calc\\(theme\\(fontSize\\.tiny\\)_\\+_8px\\)\\][data-has-helper=true]{padding-bottom:calc(.75rem + 8px);padding-bottom:calc(var(--nextui-font-size-tiny) + 8px)}.data-\\[has-start-content\\=true\\]\\:ps-1\\.5[data-has-start-content=true]{padding-left:.375rem}.data-\\[has-title\\=true\\]\\:pt-1[data-has-title=true]{padding-top:.25rem}.data-\\[active\\=true\\]\\:font-semibold[data-active=true]{font-weight:600}.data-\\[active\\=true\\]\\:text-danger-foreground[data-active=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[active\\=true\\]\\:text-default-foreground[data-active=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[active\\=true\\]\\:text-primary-foreground[data-active=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[active\\=true\\]\\:text-secondary-foreground[data-active=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[active\\=true\\]\\:text-success-foreground[data-active=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[active\\=true\\]\\:text-warning-foreground[data-active=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[disabled\\=true\\]\\:text-default-300[data-disabled=true]{--tw-text-opacity: 1;color:#d4d4d8;color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-danger-300[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#f872a1;color:hsl(var(--nextui-danger-300) / var(--nextui-danger-300-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-foreground-500[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-foreground-500) / var(--nextui-foreground-500-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-primary-300[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#67abf9;color:hsl(var(--nextui-primary-300) / var(--nextui-primary-300-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-secondary-300[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#ad7dde;color:hsl(var(--nextui-secondary-300) / var(--nextui-secondary-300-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-success-400[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#45d383;color:hsl(var(--nextui-success-400) / var(--nextui-success-400-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:data-\\[placeholder\\=true\\]\\:text-warning-400[data-placeholder=true][data-editable=true]{--tw-text-opacity: 1;color:#f7b750;color:hsl(var(--nextui-warning-400) / var(--nextui-warning-400-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-danger[data-editable=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-foreground[data-editable=true]{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-primary[data-editable=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-secondary[data-editable=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-success-600[data-editable=true]{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:text-warning-600[data-editable=true]{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.data-\\[has-value\\=true\\]\\:text-default-foreground[data-has-value=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:\\!text-danger-foreground[data-hover=true]{--tw-text-opacity: 1 !important;color:#fff!important;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!text-primary-foreground[data-hover=true]{--tw-text-opacity: 1 !important;color:#fff!important;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!text-secondary-foreground[data-hover=true]{--tw-text-opacity: 1 !important;color:#fff!important;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!text-success-foreground[data-hover=true]{--tw-text-opacity: 1 !important;color:#000!important;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))!important}.data-\\[hover\\=true\\]\\:\\!text-warning-foreground[data-hover=true]{--tw-text-opacity: 1 !important;color:#000!important;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))!important}.data-\\[hover\\=true\\]\\:text-danger[data-hover=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-danger-500[data-hover=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-danger-foreground[data-hover=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-default-500[data-hover=true]{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-default-500) / var(--nextui-default-500-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-default-foreground[data-hover=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-foreground-400[data-hover=true]{--tw-text-opacity: 1;color:#a1a1aa;color:hsl(var(--nextui-foreground-400) / var(--nextui-foreground-400-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-foreground-600[data-hover=true]{--tw-text-opacity: 1;color:#52525b;color:hsl(var(--nextui-foreground-600) / var(--nextui-foreground-600-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-primary[data-hover=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-primary-400[data-hover=true]{--tw-text-opacity: 1;color:#318df6;color:hsl(var(--nextui-primary-400) / var(--nextui-primary-400-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-primary-foreground[data-hover=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-secondary[data-hover=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-secondary-400[data-hover=true]{--tw-text-opacity: 1;color:#9455d3;color:hsl(var(--nextui-secondary-400) / var(--nextui-secondary-400-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-secondary-foreground[data-hover=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-success[data-hover=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-success-600[data-hover=true]{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-success-foreground[data-hover=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-warning[data-hover=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-warning-600[data-hover=true]{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.data-\\[hover\\=true\\]\\:text-warning-foreground[data-hover=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[invalid\\=true\\]\\:data-\\[editable\\=true\\]\\:text-danger[data-editable=true][data-invalid=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[invalid\\=true\\]\\:text-danger-300[data-invalid=true]{--tw-text-opacity: 1;color:#f872a1;color:hsl(var(--nextui-danger-300) / var(--nextui-danger-300-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-background[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-danger-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-primary-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-secondary-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-success-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-warning-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:data-\\[outside-month\\=true\\]\\:text-default-300[data-outside-month=true][data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#d4d4d8;color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-danger-500[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-foreground[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-primary[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-secondary[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-600[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-warning-500[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning-500) / var(--nextui-warning-500-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-background[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-danger-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-primary-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-secondary-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-warning-foreground[data-range-selection=true][data-selection-end=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-background[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-danger-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-primary-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-secondary-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-warning-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-background[data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-danger[data-selected=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-danger-foreground[data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-default-foreground[data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-primary[data-selected=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-primary-foreground[data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-secondary[data-selected=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-secondary-foreground[data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-success-600[data-selected=true]{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-success-foreground[data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-warning-600[data-selected=true]{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.data-\\[selected\\=true\\]\\:text-warning-foreground[data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[unavailable\\=true\\]\\:text-default-300[data-unavailable=true]{--tw-text-opacity: 1;color:#d4d4d8;color:hsl(var(--nextui-default-300) / var(--nextui-default-300-opacity, var(--tw-text-opacity)))}.data-\\[unavailable\\=true\\]\\:line-through[data-unavailable=true]{text-decoration-line:line-through}.data-\\[disabled\\=true\\]\\:data-\\[outside-month\\=true\\]\\:opacity-0[data-outside-month=true][data-disabled=true]{opacity:0}.data-\\[disabled\\=true\\]\\:opacity-30[data-disabled=true]{opacity:.3}.data-\\[hover-unselected\\=true\\]\\:opacity-disabled[data-hover-unselected=true]{opacity:.5;opacity:var(--nextui-disabled-opacity)}.data-\\[hover\\=true\\]\\:opacity-hover[data-hover=true]{opacity:.8;opacity:var(--nextui-hover-opacity)}.data-\\[in-range\\=true\\]\\:opacity-100[data-in-range=true]{opacity:1}.data-\\[invisible\\=true\\]\\:opacity-0[data-invisible=true]{opacity:0}.data-\\[loaded\\=true\\]\\:opacity-100[data-loaded=true],.data-\\[moving\\]\\:opacity-100[data-moving]{opacity:1}.data-\\[pressed\\=true\\]\\:opacity-50[data-pressed=true]{opacity:.5}.data-\\[pressed\\=true\\]\\:opacity-70[data-pressed=true]{opacity:.7}.data-\\[visible\\=true\\]\\:opacity-100[data-visible=true]{opacity:1}.data-\\[active\\=true\\]\\:shadow-md[data-active=true]{--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.data-\\[hover\\=true\\]\\:shadow-lg[data-hover=true]{--tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:shadow-md[data-selection-end=true][data-selected=true],.data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:shadow-md[data-selection-start=true][data-selected=true],.data-\\[selected\\=true\\]\\:shadow-md[data-selected=true]{--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.data-\\[selected\\=true\\]\\:shadow-none[data-selected=true]{--tw-shadow: 0 0 rgba(0,0,0,0);--tw-shadow-colored: 0 0 rgba(0,0,0,0);box-shadow:0 0 #0000,0 0 #0000,0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.data-\\[active\\=true\\]\\:shadow-danger\\/40[data-active=true]{--tw-shadow-color: hsl(var(--nextui-danger) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[active\\=true\\]\\:shadow-default\\/50[data-active=true]{--tw-shadow-color: hsl(var(--nextui-default) / .5);--tw-shadow: var(--tw-shadow-colored)}.data-\\[active\\=true\\]\\:shadow-primary\\/40[data-active=true]{--tw-shadow-color: hsl(var(--nextui-primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[active\\=true\\]\\:shadow-secondary\\/40[data-active=true]{--tw-shadow-color: hsl(var(--nextui-secondary) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[active\\=true\\]\\:shadow-success\\/40[data-active=true]{--tw-shadow-color: hsl(var(--nextui-success) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[active\\=true\\]\\:shadow-warning\\/40[data-active=true]{--tw-shadow-color: hsl(var(--nextui-warning) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-danger\\/30[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-danger) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-default\\/50[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-default) / .5);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-primary\\/30[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-primary) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-secondary\\/30[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-secondary) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-success\\/30[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-success) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[hover\\=true\\]\\:shadow-warning\\/30[data-hover=true]{--tw-shadow-color: hsl(var(--nextui-warning) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-danger\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-danger) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-foreground\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-foreground) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-primary\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-secondary\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-secondary) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-success\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-success) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selected\\=true\\]\\:shadow-warning\\/40[data-selected=true]{--tw-shadow-color: hsl(var(--nextui-warning) / .4);--tw-shadow: var(--tw-shadow-colored)}.data-\\[focus-visible\\=true\\]\\:outline-2[data-focus-visible=true]{outline-width:2px}.data-\\[focus-visible\\=true\\]\\:outline-offset-2[data-focus-visible=true]{outline-offset:2px}.data-\\[focus-visible\\=true\\]\\:outline-focus[data-focus-visible=true]{outline-color:#0070f0;outline-color:hsl(var(--nextui-focus) / var(--nextui-focus-opacity, 1))}.data-\\[focus-visible\\]\\:outline-danger-foreground[data-focus-visible]{outline-color:#fff;outline-color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, 1))}.data-\\[focus-visible\\]\\:outline-default-foreground[data-focus-visible]{outline-color:#000;outline-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, 1))}.data-\\[focus-visible\\]\\:outline-primary-foreground[data-focus-visible]{outline-color:#fff;outline-color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, 1))}.data-\\[focus-visible\\]\\:outline-secondary-foreground[data-focus-visible]{outline-color:#fff;outline-color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, 1))}.data-\\[focus-visible\\]\\:outline-success-foreground[data-focus-visible]{outline-color:#000;outline-color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, 1))}.data-\\[focus-visible\\]\\:outline-warning-foreground[data-focus-visible]{outline-color:#000;outline-color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, 1))}.data-\\[menu-open\\=true\\]\\:backdrop-blur-xl[data-menu-open=true]{--tw-backdrop-blur: blur(24px);backdrop-filter:blur(24px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.data-\\[disabled\\=true\\]\\:transition-none[data-disabled=true]{transition-property:none}.data-\\[hover\\=true\\]\\:transition-colors[data-hover=true]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.data-\\[moving\\=true\\]\\:transition-transform[data-moving=true]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.data-\\[hide-scroll\\=true\\]\\:scrollbar-hide[data-hide-scroll=true]{-ms-overflow-style:none;scrollbar-width:none}.data-\\[hide-scroll\\=true\\]\\:scrollbar-hide[data-hide-scroll=true]::-webkit-scrollbar{display:none}.data-\\[top-bottom-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(\\#000\\,\\#000\\,transparent_0\\,\\#000_var\\(--scroll-shadow-size\\)\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-top-bottom-scroll=true]{-webkit-mask-image:linear-gradient(#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[top-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(0deg\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-top-scroll=true]{-webkit-mask-image:linear-gradient(0deg,#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(0deg,#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[bottom-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(180deg\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-bottom-scroll=true]{-webkit-mask-image:linear-gradient(180deg,#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(180deg,#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[left-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(270deg\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-left-scroll=true]{-webkit-mask-image:linear-gradient(270deg,#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(270deg,#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[right-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(90deg\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-right-scroll=true]{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[left-right-scroll\\=true\\]\\:\\[mask-image\\:linear-gradient\\(to_right\\,\\#000\\,\\#000\\,transparent_0\\,\\#000_var\\(--scroll-shadow-size\\)\\,\\#000_calc\\(100\\%_-_var\\(--scroll-shadow-size\\)\\)\\,transparent\\)\\][data-left-right-scroll=true]{-webkit-mask-image:linear-gradient(to right,#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent);mask-image:linear-gradient(to right,#000,#000,transparent 0,#000 var(--scroll-shadow-size),#000 calc(100% - var(--scroll-shadow-size)),transparent)}.data-\\[placement\\=bottom-end\\]\\:before\\:-top-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=bottom-end]:before{content:var(--tw-content);top:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=bottom-end\\]\\:before\\:right-3[data-placement=bottom-end]:before{content:var(--tw-content);right:.75rem}.data-\\[placement\\=bottom-start\\]\\:before\\:-top-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=bottom-start]:before{content:var(--tw-content);top:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=bottom-start\\]\\:before\\:left-3[data-placement=bottom-start]:before{content:var(--tw-content);left:.75rem}.data-\\[placement\\=bottom\\]\\:before\\:-top-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=bottom]:before{content:var(--tw-content);top:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=bottom\\]\\:before\\:left-1\\/2[data-placement=bottom]:before{content:var(--tw-content);left:50%}.data-\\[placement\\=left-end\\]\\:before\\:-right-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_3px\\)\\][data-placement=left-end]:before{content:var(--tw-content);right:calc((.3125rem - 3px)*-1)}.data-\\[placement\\=left-end\\]\\:before\\:bottom-1\\/4[data-placement=left-end]:before{content:var(--tw-content);bottom:25%}.data-\\[placement\\=left-start\\]\\:before\\:-right-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_3px\\)\\][data-placement=left-start]:before{content:var(--tw-content);right:calc((.3125rem - 3px)*-1)}.data-\\[placement\\=left-start\\]\\:before\\:top-1\\/4[data-placement=left-start]:before{content:var(--tw-content);top:25%}.data-\\[placement\\=left\\]\\:before\\:-right-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_2px\\)\\][data-placement=left]:before{content:var(--tw-content);right:calc((.3125rem - 2px)*-1)}.data-\\[placement\\=left\\]\\:before\\:top-1\\/2[data-placement=left]:before{content:var(--tw-content);top:50%}.data-\\[placement\\=right-end\\]\\:before\\:-left-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_3px\\)\\][data-placement=right-end]:before{content:var(--tw-content);left:calc((.3125rem - 3px)*-1)}.data-\\[placement\\=right-end\\]\\:before\\:bottom-1\\/4[data-placement=right-end]:before{content:var(--tw-content);bottom:25%}.data-\\[placement\\=right-start\\]\\:before\\:-left-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_3px\\)\\][data-placement=right-start]:before{content:var(--tw-content);left:calc((.3125rem - 3px)*-1)}.data-\\[placement\\=right-start\\]\\:before\\:top-1\\/4[data-placement=right-start]:before{content:var(--tw-content);top:25%}.data-\\[placement\\=right\\]\\:before\\:-left-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_2px\\)\\][data-placement=right]:before{content:var(--tw-content);left:calc((.3125rem - 2px)*-1)}.data-\\[placement\\=right\\]\\:before\\:top-1\\/2[data-placement=right]:before{content:var(--tw-content);top:50%}.data-\\[placement\\=top-end\\]\\:before\\:-bottom-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=top-end]:before{content:var(--tw-content);bottom:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=top-end\\]\\:before\\:right-3[data-placement=top-end]:before{content:var(--tw-content);right:.75rem}.data-\\[placement\\=top-start\\]\\:before\\:-bottom-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=top-start]:before{content:var(--tw-content);bottom:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=top-start\\]\\:before\\:left-3[data-placement=top-start]:before{content:var(--tw-content);left:.75rem}.data-\\[placement\\=top\\]\\:before\\:-bottom-\\[calc\\(theme\\(spacing\\.5\\)\\/4_-_1\\.5px\\)\\][data-placement=top]:before{content:var(--tw-content);bottom:calc((.3125rem - 1.5px)*-1)}.data-\\[placement\\=top\\]\\:before\\:left-1\\/2[data-placement=top]:before{content:var(--tw-content);left:50%}.data-\\[loaded\\=true\\]\\:before\\:-z-10[data-loaded=true]:before{content:var(--tw-content);z-index:-10}.data-\\[arrow\\=true\\]\\:before\\:block[data-arrow=true]:before{content:var(--tw-content);display:block}.data-\\[outside-month\\=true\\]\\:before\\:hidden[data-outside-month=true]:before{content:var(--tw-content);display:none}.data-\\[placement\\=bottom\\]\\:before\\:-translate-x-1\\/2[data-placement=bottom]:before{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(-50%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[placement\\=left\\]\\:before\\:-translate-y-1\\/2[data-placement=left]:before{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[placement\\=right\\]\\:before\\:-translate-y-1\\/2[data-placement=right]:before{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[placement\\=top\\]\\:before\\:-translate-x-1\\/2[data-placement=top]:before{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(-50%,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[loaded\\=true\\]\\:before\\:animate-none[data-loaded=true]:before{content:var(--tw-content);animation:none}.data-\\[range-end\\=true\\]\\:before\\:rounded-r-full[data-range-end=true]:before{content:var(--tw-content);border-top-right-radius:9999px;border-bottom-right-radius:9999px}.data-\\[range-start\\=true\\]\\:before\\:rounded-l-full[data-range-start=true]:before{content:var(--tw-content);border-top-left-radius:9999px;border-bottom-left-radius:9999px}.data-\\[selection-end\\=true\\]\\:before\\:rounded-r-full[data-selection-end=true]:before{content:var(--tw-content);border-top-right-radius:9999px;border-bottom-right-radius:9999px}.data-\\[selection-start\\=true\\]\\:before\\:rounded-l-full[data-selection-start=true]:before{content:var(--tw-content);border-top-left-radius:9999px;border-bottom-left-radius:9999px}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-danger-50[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-foreground\\/10[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);background-color:#11181c1a;background-color:hsl(var(--nextui-foreground) / .1)}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-primary-50[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-secondary-50[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-success-100[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#d2f4e1;background-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-warning-100[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fdedd3;background-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-bg-opacity)))}.data-\\[loaded\\=true\\]\\:before\\:opacity-0[data-loaded=true]:before{content:var(--tw-content);opacity:0}.data-\\[selected\\=true\\]\\:before\\:opacity-100[data-selected=true]:before{content:var(--tw-content);opacity:1}.data-\\[active\\=true\\]\\:after\\:w-full[data-active=true]:after{content:var(--tw-content);width:100%}.data-\\[focus\\=true\\]\\:after\\:w-full[data-focus=true]:after{content:var(--tw-content);width:100%}.data-\\[open\\=true\\]\\:after\\:w-full[data-open=true]:after{content:var(--tw-content);width:100%}.data-\\[dragging\\=true\\]\\:after\\:scale-100[data-dragging=true]:after{content:var(--tw-content);--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[dragging\\=true\\]\\:after\\:scale-80[data-dragging=true]:after{content:var(--tw-content);--tw-scale-x: .8;--tw-scale-y: .8;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.8) scaleY(.8);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[active\\=true\\]\\:after\\:bg-danger-400[data-active=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f54281;background-color:hsl(var(--nextui-danger-400) / var(--nextui-danger-400-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-danger[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-foreground[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#11181c;background-color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-primary[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-secondary[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-success[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selected\\=true\\]\\:after\\:bg-warning[data-selected=true]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[loaded\\=true\\]\\:after\\:opacity-0[data-loaded=true]:after{content:var(--tw-content);opacity:0}.data-\\[selected\\=true\\]\\:after\\:opacity-100[data-selected=true]:after{content:var(--tw-content);opacity:1}.data-\\[selectable\\=true\\]\\:focus\\:border-danger:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:border-default:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#d4d4d8;border-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-border-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:border-primary:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:border-secondary:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:border-success:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:border-warning:focus[data-selectable=true]{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.data-\\[invalid\\=true\\]\\:focus\\:bg-danger-400\\/50:focus[data-invalid=true]{background-color:#f5428180;background-color:hsl(var(--nextui-danger-400) / .5)}.data-\\[selectable\\=true\\]\\:focus\\:bg-danger:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-danger\\/20:focus[data-selectable=true]{background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.data-\\[selectable\\=true\\]\\:focus\\:bg-default:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-default-100:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-default\\/40:focus[data-selectable=true]{background-color:#d4d4d866;background-color:hsl(var(--nextui-default) / .4)}.data-\\[selectable\\=true\\]\\:focus\\:bg-primary:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-primary\\/20:focus[data-selectable=true]{background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.data-\\[selectable\\=true\\]\\:focus\\:bg-secondary:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-secondary\\/20:focus[data-selectable=true]{background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.data-\\[selectable\\=true\\]\\:focus\\:bg-success:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-success\\/20:focus[data-selectable=true]{background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.data-\\[selectable\\=true\\]\\:focus\\:bg-warning:focus[data-selectable=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:bg-warning\\/20:focus[data-selectable=true]{background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.data-\\[editable\\=true\\]\\:focus\\:text-danger:focus[data-editable=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-default-foreground:focus[data-editable=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-primary:focus[data-editable=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-secondary:focus[data-editable=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-success:focus[data-editable=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-success-600:focus[data-editable=true]{--tw-text-opacity: 1;color:#12a150;color:hsl(var(--nextui-success-600) / var(--nextui-success-600-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-warning:focus[data-editable=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.data-\\[editable\\=true\\]\\:focus\\:text-warning-600:focus[data-editable=true]{--tw-text-opacity: 1;color:#c3841d;color:hsl(var(--nextui-warning-600) / var(--nextui-warning-600-opacity, var(--tw-text-opacity)))}.data-\\[invalid\\=true\\]\\:data-\\[editable\\=true\\]\\:focus\\:text-danger:focus[data-editable=true][data-invalid=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-danger:focus[data-selectable=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-danger-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-default-500:focus[data-selectable=true]{--tw-text-opacity: 1;color:#71717a;color:hsl(var(--nextui-default-500) / var(--nextui-default-500-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-default-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-primary:focus[data-selectable=true]{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-primary-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-secondary:focus[data-selectable=true]{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-secondary-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-success:focus[data-selectable=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-success-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-warning:focus[data-selectable=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:text-warning-foreground:focus[data-selectable=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.data-\\[selectable\\=true\\]\\:focus\\:shadow-danger\\/30:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-danger) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selectable\\=true\\]\\:focus\\:shadow-default\\/50:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-default) / .5);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selectable\\=true\\]\\:focus\\:shadow-primary\\/30:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-primary) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selectable\\=true\\]\\:focus\\:shadow-secondary\\/30:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-secondary) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selectable\\=true\\]\\:focus\\:shadow-success\\/30:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-success) / .3);--tw-shadow: var(--tw-shadow-colored)}.data-\\[selectable\\=true\\]\\:focus\\:shadow-warning\\/30:focus[data-selectable=true]{--tw-shadow-color: hsl(var(--nextui-warning) / .3);--tw-shadow: var(--tw-shadow-colored)}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:pointer-events-auto,.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:pointer-events-auto{pointer-events:auto}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:start-0,.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:start-0{left:0}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:z-10{z-index:10}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:ms-4{margin-left:1rem}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:ms-5{margin-left:1.25rem}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:ms-6{margin-left:1.5rem}.group[data-selected][data-pressed] .group-data-\\[selected\\]\\:group-data-\\[pressed\\]\\:ml-3{margin-left:.75rem}.group[data-selected][data-pressed] .group-data-\\[selected\\]\\:group-data-\\[pressed\\]\\:ml-4{margin-left:1rem}.group[data-selected][data-pressed] .group-data-\\[selected\\]\\:group-data-\\[pressed\\]\\:ml-5{margin-left:1.25rem}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:block,.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:block{display:block}.group[data-has-helper=true] .group-data-\\[has-helper\\=true\\]\\:flex{display:flex}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:hidden{display:none}.group[data-pressed=true] .group-data-\\[pressed\\=true\\]\\:w-5{width:1.25rem}.group[data-pressed=true] .group-data-\\[pressed\\=true\\]\\:w-6{width:1.5rem}.group[data-pressed=true] .group-data-\\[pressed\\=true\\]\\:w-7{width:1.75rem}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.small\\)\\/2_\\+_20px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-small) / 2 + 20px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .4375rem + 20px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.small\\)\\/2_\\+_24px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-small) / 2 + 24px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .4375rem + 24px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_\\+_16px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-tiny) / 2 + 16px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .375rem + 16px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_3\\.5px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 3.5px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 3.5px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_4px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 4px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 4px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_6px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 6px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 6px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_6px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 6px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_8px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 8px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_8px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 8px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 10px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_5px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 5px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 5px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_8px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 8px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_8px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 8px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 10px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.small\\)\\/2_\\+_20px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-small) / 2 + 20px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .4375rem + 20px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.small\\)\\/2_\\+_24px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-small) / 2 + 24px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .4375rem + 24px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(100\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_\\+_16px\\)\\]{--tw-translate-y: calc(calc(100% + var(--nextui-font-size-tiny) / 2 + 16px) * -1);transform:translate(var(--tw-translate-x),calc((100% + .375rem + 16px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_3\\.5px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 3.5px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 3.5px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_4px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 4px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 4px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_6px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 6px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 6px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_6px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 6px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_8px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 8px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.small\\)\\/2_-_8px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-small) / 2 - 8px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .4375rem - 10px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_5px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 5px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 5px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_8px\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 8px) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 8px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:-translate-y-\\[calc\\(50\\%_\\+_theme\\(fontSize\\.tiny\\)\\/2_-_8px_-_theme\\(borderWidth\\.medium\\)\\)\\]{--tw-translate-y: calc(calc(50% + var(--nextui-font-size-tiny) / 2 - 8px - var(--nextui-border-width-medium)) * -1);transform:translate(var(--tw-translate-x),calc((50% + .375rem - 10px)*-1)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:translate-x-3{--tw-translate-x: .75rem;transform:translate(.75rem,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-copied=true] .group-data-\\[copied\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-copied=true] .group-data-\\[copied\\=true\\]\\:scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.5) scaleY(.5);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:scale-85,.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:scale-85{--tw-scale-x: .85;--tw-scale-y: .85;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.85) scaleY(.85);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-pressed=true] .group-data-\\[pressed\\=true\\]\\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(.95) scaleY(.95);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\\/tr[data-disabled=true] .group-data-\\[disabled\\=true\\]\\/tr\\:cursor-not-allowed{cursor:not-allowed}.group[data-has-multiple-months=true] .group-data-\\[has-multiple-months\\=true\\]\\:flex-row{flex-direction:row}.group[data-has-label=true] .group-data-\\[has-label\\=true\\]\\:items-start{align-items:flex-start}.group[data-has-label=true] .group-data-\\[has-label\\=true\\]\\:items-end{align-items:flex-end}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:\\!border-danger{--tw-border-opacity: 1 !important;border-color:#f31260!important;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))!important}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-danger{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-default-foreground{--tw-border-opacity: 1;border-color:#000;border-color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-primary{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-secondary{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-success{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:border-warning{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:border-danger,.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-danger{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-default-500{--tw-border-opacity: 1;border-color:#71717a;border-color:hsl(var(--nextui-default-500) / var(--nextui-default-500-opacity, var(--tw-border-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-primary{--tw-border-opacity: 1;border-color:#0070f0;border-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-border-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-secondary{--tw-border-opacity: 1;border-color:#7828c8;border-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-border-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-success{--tw-border-opacity: 1;border-color:#18c964;border-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-border-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:border-warning{--tw-border-opacity: 1;border-color:#f5a524;border-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-border-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:\\!bg-danger-50{--tw-bg-opacity: 1 !important;background-color:#fee7ef!important;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))!important}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-danger-50{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-default-100{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-default-200{--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-primary-50{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-secondary-50{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-success-50{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:bg-warning-50{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.group[data-hover-unselected=true] .group-data-\\[hover-unselected\\=true\\]\\:bg-default-100{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:bg-danger-50{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-danger{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-default-400{--tw-bg-opacity: 1;background-color:#a1a1aa;background-color:hsl(var(--nextui-default-400) / var(--nextui-default-400-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-primary{--tw-bg-opacity: 1;background-color:#0070f0;background-color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-secondary{--tw-bg-opacity: 1;background-color:#7828c8;background-color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-success{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:bg-warning{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.group[data-has-helper=true] .group-data-\\[has-helper\\=true\\]\\:pt-2{padding-top:.5rem}.group[data-has-helper=true] .group-data-\\[has-helper\\=true\\]\\:pt-3{padding-top:.75rem}.group[data-has-helper=true] .group-data-\\[has-helper\\=true\\]\\:pt-4,.group[data-has-label=true] .group-data-\\[has-label\\=true\\]\\:pt-4{padding-top:1rem}.group[data-has-label=true] .group-data-\\[has-label\\=true\\]\\:pt-5{padding-top:1.25rem}.group\\/tr[data-disabled=true] .group-data-\\[disabled\\=true\\]\\/tr\\:text-foreground-300{--tw-text-opacity: 1;color:#d4d4d8;color:hsl(var(--nextui-foreground-300) / var(--nextui-foreground-300-opacity, var(--tw-text-opacity)))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:text-default-600{--tw-text-opacity: 1;color:#52525b;color:hsl(var(--nextui-default-600) / var(--nextui-default-600-opacity, var(--tw-text-opacity)))}.group[data-filled-within=true] .group-data-\\[filled-within\\=true\\]\\:text-foreground{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:text-default-600{--tw-text-opacity: 1;color:#52525b;color:hsl(var(--nextui-default-600) / var(--nextui-default-600-opacity, var(--tw-text-opacity)))}.group[data-filled=true] .group-data-\\[filled\\=true\\]\\:text-foreground{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:text-default-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:text-foreground{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:text-danger,.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-danger{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-danger-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-default-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-default-foreground) / var(--nextui-default-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-foreground{--tw-text-opacity: 1;color:#11181c;color:hsl(var(--nextui-foreground) / var(--nextui-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-primary{--tw-text-opacity: 1;color:#0070f0;color:hsl(var(--nextui-primary) / var(--nextui-primary-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-primary-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-primary-foreground) / var(--nextui-primary-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-secondary{--tw-text-opacity: 1;color:#7828c8;color:hsl(var(--nextui-secondary) / var(--nextui-secondary-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-secondary-foreground{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-secondary-foreground) / var(--nextui-secondary-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-success{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-success-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-warning{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:text-warning-foreground{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.group[data-copied=true] .group-data-\\[copied\\=true\\]\\:opacity-0{opacity:0}.group[data-copied=true] .group-data-\\[copied\\=true\\]\\:opacity-100{opacity:1}.group[data-has-value=true] .group-data-\\[has-value\\=true\\]\\:opacity-70{opacity:.7}.group\\/th[data-hover=true] .group-data-\\[hover\\=true\\]\\/th\\:opacity-100,.group[data-loaded=true] .group-data-\\[loaded\\=true\\]\\:opacity-100{opacity:1}.group[data-pressed=true] .group-data-\\[pressed\\=true\\]\\:opacity-70{opacity:.7}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:opacity-0{opacity:0}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:opacity-100{opacity:1}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:opacity-60{opacity:.6}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),0 0 #0000;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 rgba(0,0,0,0))}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:ring-focus{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--nextui-focus) / var(--nextui-focus-opacity, var(--tw-ring-opacity)))}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:ring-offset-2{--tw-ring-offset-width: 2px}.group[data-focus-visible=true] .group-data-\\[focus-visible\\=true\\]\\:ring-offset-background{--tw-ring-offset-color: hsl(var(--nextui-background) / var(--nextui-background-opacity, 1))}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:before\\:-z-10:before{content:var(--tw-content);z-index:-10}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:before\\:w-full:before{content:var(--tw-content);width:100%}.group[data-open=true] .group-data-\\[open\\=true\\]\\:before\\:translate-y-px:before{content:var(--tw-content);--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),1px) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-open=true] .group-data-\\[open\\=true\\]\\:before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(45deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\\/tr[data-middle=true] .group-data-\\[middle\\=true\\]\\/tr\\:before\\:rounded-none:before{content:var(--tw-content);border-radius:0}.group[data-hover=true] .group-data-\\[hover\\=true\\]\\:before\\:bg-default-100:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:before\\:bg-default-100:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:before\\:opacity-100:before{content:var(--tw-content);opacity:1}.group[data-required=true] .group-data-\\[required\\=true\\]\\:after\\:ml-0\\.5:after{content:var(--tw-content);margin-left:.125rem}.group[data-focus=true] .group-data-\\[focus\\=true\\]\\:after\\:w-full:after{content:var(--tw-content);width:100%}.group[data-open=true] .group-data-\\[open\\=true\\]\\:after\\:translate-y-0:after{content:var(--tw-content);--tw-translate-y: 0px;transform:translate(var(--tw-translate-x)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-open=true] .group-data-\\[open\\=true\\]\\:after\\:-rotate-45:after{content:var(--tw-content);--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(-45deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:after\\:scale-100:after{content:var(--tw-content);--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:after\\:bg-danger:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.group[data-required=true] .group-data-\\[required\\=true\\]\\:after\\:text-danger:after{content:var(--tw-content);--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-text-opacity)))}.group[data-selected=true] .group-data-\\[selected\\=true\\]\\:after\\:opacity-100:after{content:var(--tw-content);opacity:1}.group[data-required=true] .group-data-\\[required\\=true\\]\\:after\\:content-\\[\\'\\*\\'\\]:after{--tw-content: \"*\";content:\"*\";content:var(--tw-content)}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:hover\\:border-danger:hover{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:hover\\:bg-danger-100:hover{--tw-bg-opacity: 1;background-color:#fdcede;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:focus-within\\:hover\\:border-danger:hover:focus-within{--tw-border-opacity: 1;border-color:#f31260;border-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-border-opacity)))}.group[data-invalid=true] .group-data-\\[invalid\\=true\\]\\:focus-within\\:hover\\:bg-danger-50:hover:focus-within{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.group\\/tr[aria-selected=false][data-hover=true] .group-aria-\\[selected\\=false\\]\\/tr\\:group-data-\\[hover\\=true\\]\\/tr\\:before\\:bg-default-100:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.group\\/tr[aria-selected=false][data-hover=true] .group-aria-\\[selected\\=false\\]\\/tr\\:group-data-\\[hover\\=true\\]\\/tr\\:before\\:opacity-70:before{content:var(--tw-content);opacity:.7}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-danger\\/20[data-selected=true]:before{content:var(--tw-content);background-color:#f3126033;background-color:hsl(var(--nextui-danger) / .2)}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-default\\/60[data-selected=true]:before{content:var(--tw-content);background-color:#d4d4d899;background-color:hsl(var(--nextui-default) / .6)}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-primary\\/20[data-selected=true]:before{content:var(--tw-content);background-color:#0070f033;background-color:hsl(var(--nextui-primary) / .2)}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-secondary\\/20[data-selected=true]:before{content:var(--tw-content);background-color:#7828c833;background-color:hsl(var(--nextui-secondary) / .2)}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-success\\/20[data-selected=true]:before{content:var(--tw-content);background-color:#18c96433;background-color:hsl(var(--nextui-success) / .2)}.group\\/tr[data-odd=true] .group-data-\\[odd\\=true\\]\\/tr\\:data-\\[selected\\=true\\]\\/tr\\:before\\:bg-warning\\/20[data-selected=true]:before{content:var(--tw-content);background-color:#f5a52433;background-color:hsl(var(--nextui-warning) / .2)}.peer[data-filled=true]~.peer-data-\\[filled\\=true\\]\\:pointer-events-auto{pointer-events:auto}.peer[data-filled=true]~.peer-data-\\[filled\\=true\\]\\:block{display:block}.peer[data-filled=true]~.peer-data-\\[filled\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer[data-filled=true]~.peer-data-\\[filled\\=true\\]\\:opacity-70{opacity:.7}@media(prefers-reduced-motion:reduce){.motion-reduce\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(1) scaleY(1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.motion-reduce\\:transition-none{transition-property:none}.motion-reduce\\:after\\:transition-none:after{content:var(--tw-content);transition-property:none}}.dark .dark\\:border-danger-100{--tw-border-opacity: 1;border-color:#fdcede;border-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-border-opacity)))}.dark .dark\\:border-default-200{--tw-border-opacity: 1;border-color:#e4e4e7;border-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-border-opacity)))}.dark .dark\\:border-primary-100{--tw-border-opacity: 1;border-color:#cee4fd;border-color:hsl(var(--nextui-primary-100) / var(--nextui-primary-100-opacity, var(--tw-border-opacity)))}.dark .dark\\:border-success-100{--tw-border-opacity: 1;border-color:#d2f4e1;border-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-border-opacity)))}.dark .dark\\:border-warning-100{--tw-border-opacity: 1;border-color:#fdedd3;border-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-border-opacity)))}.dark .dark\\:bg-background{--tw-bg-opacity: 1;background-color:#fff;background-color:hsl(var(--nextui-background) / var(--nextui-background-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-background\\/20{background-color:#fff3;background-color:hsl(var(--nextui-background) / .2)}.dark .dark\\:bg-content2{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-content2) / var(--nextui-content2-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-danger-100{--tw-bg-opacity: 1;background-color:#fdcede;background-color:hsl(var(--nextui-danger-100) / var(--nextui-danger-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-danger-50{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-danger-50\\/50{background-color:#fee7ef80;background-color:hsl(var(--nextui-danger-50) / .5)}.dark .dark\\:bg-default{--tw-bg-opacity: 1;background-color:#d4d4d8;background-color:hsl(var(--nextui-default) / var(--nextui-default-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-default-100{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-default-50\\/50{background-color:#fafafa80;background-color:hsl(var(--nextui-default-50) / .5)}.dark .dark\\:bg-primary-100{--tw-bg-opacity: 1;background-color:#cee4fd;background-color:hsl(var(--nextui-primary-100) / var(--nextui-primary-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-primary-50{--tw-bg-opacity: 1;background-color:#e7f1fe;background-color:hsl(var(--nextui-primary-50) / var(--nextui-primary-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-primary-50\\/50{background-color:#e7f1fe80;background-color:hsl(var(--nextui-primary-50) / .5)}.dark .dark\\:bg-secondary-100{--tw-bg-opacity: 1;background-color:#e3d2f3;background-color:hsl(var(--nextui-secondary-100) / var(--nextui-secondary-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-secondary-50{--tw-bg-opacity: 1;background-color:#f2eafa;background-color:hsl(var(--nextui-secondary-50) / var(--nextui-secondary-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-secondary-50\\/50{background-color:#f2eafa80;background-color:hsl(var(--nextui-secondary-50) / .5)}.dark .dark\\:bg-success-100{--tw-bg-opacity: 1;background-color:#d2f4e1;background-color:hsl(var(--nextui-success-100) / var(--nextui-success-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-success-50{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-success-50\\/50{background-color:#eafaf180;background-color:hsl(var(--nextui-success-50) / .5)}.dark .dark\\:bg-transparent{background-color:transparent}.dark .dark\\:bg-warning-100{--tw-bg-opacity: 1;background-color:#fdedd3;background-color:hsl(var(--nextui-warning-100) / var(--nextui-warning-100-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-warning-50{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:bg-warning-50\\/50{background-color:#fefce780;background-color:hsl(var(--nextui-warning-50) / .5)}.dark .dark\\:text-danger-500{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:text-success{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.dark .dark\\:text-warning{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-danger-500::-moz-placeholder{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-danger-500::placeholder{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-success::-moz-placeholder{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-success::placeholder{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-warning::-moz-placeholder{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.dark .dark\\:placeholder\\:text-warning::placeholder{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.dark .dark\\:before\\:via-default-700\\/10:before{content:var(--tw-content);--tw-gradient-to: hsl(var(--nextui-default-700) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--nextui-default-700) / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark .dark\\:after\\:bg-content2:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-content2) / var(--nextui-content2-opacity, var(--tw-bg-opacity)))}.dark .dark\\:focus\\:bg-danger-400\\/20:focus{background-color:#f5428133;background-color:hsl(var(--nextui-danger-400) / .2)}.dark .dark\\:focus\\:bg-success-400\\/20:focus{background-color:#45d38333;background-color:hsl(var(--nextui-success-400) / .2)}.dark .dark\\:focus\\:bg-warning-400\\/20:focus{background-color:#f7b75033;background-color:hsl(var(--nextui-warning-400) / .2)}.dark .dark\\:data-\\[hover\\=true\\]\\:bg-content2[data-hover=true]{--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-content2) / var(--nextui-content2-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:bg-danger-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#fee7ef;background-color:hsl(var(--nextui-danger-50) / var(--nextui-danger-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:bg-success-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:bg-warning-50[data-hover=true]{--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-danger[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f31260;background-color:hsl(var(--nextui-danger) / var(--nextui-danger-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-success[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#18c964;background-color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:bg-warning[data-hover=true][data-selected=true]{--tw-bg-opacity: 1;background-color:#f5a524;background-color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:text-danger-500[data-hover=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:text-success-500[data-hover=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success-500) / var(--nextui-success-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[hover\\=true\\]\\:text-warning-500[data-hover=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning-500) / var(--nextui-warning-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-danger-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#fff;color:hsl(var(--nextui-danger-foreground) / var(--nextui-danger-foreground-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-success-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[hover\\=true\\]\\:text-warning-foreground[data-hover=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-warning-foreground) / var(--nextui-warning-foreground-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-500[data-range-selection=true][data-selected=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success-500) / var(--nextui-success-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[selection-end\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-foreground[data-range-selection=true][data-selection-end=true][data-selected=true],.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[selection-start\\=true\\]\\:data-\\[range-selection\\=true\\]\\:text-success-foreground[data-range-selection=true][data-selection-start=true][data-selected=true]{--tw-text-opacity: 1;color:#000;color:hsl(var(--nextui-success-foreground) / var(--nextui-success-foreground-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:text-danger-500[data-selected=true]{--tw-text-opacity: 1;color:#f31260;color:hsl(var(--nextui-danger-500) / var(--nextui-danger-500-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:text-success[data-selected=true]{--tw-text-opacity: 1;color:#18c964;color:hsl(var(--nextui-success) / var(--nextui-success-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:text-warning[data-selected=true]{--tw-text-opacity: 1;color:#f5a524;color:hsl(var(--nextui-warning) / var(--nextui-warning-opacity, var(--tw-text-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-success-50[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#eafaf1;background-color:hsl(var(--nextui-success-50) / var(--nextui-success-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[selected\\=true\\]\\:data-\\[range-selection\\=true\\]\\:before\\:bg-warning-50[data-range-selection=true][data-selected=true]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#fefce7;background-color:hsl(var(--nextui-warning-50) / var(--nextui-warning-50-opacity, var(--tw-bg-opacity)))}.dark .dark\\:data-\\[invalid\\=true\\]\\:focus\\:bg-danger-400\\/20[data-invalid=true]:focus{background-color:#f5428133;background-color:hsl(var(--nextui-danger-400) / .2)}@media(min-width:640px){.sm\\:m-0{margin:0}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:mx-6{margin-left:1.5rem;margin-right:1.5rem}.sm\\:my-0{margin-top:0;margin-bottom:0}.sm\\:my-16{margin-top:4rem;margin-bottom:4rem}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:\\[--scale-enter\\:100\\%\\]{--scale-enter: 100%}.sm\\:\\[--scale-exit\\:103\\%\\]{--scale-exit: 103%}.sm\\:\\[--slide-enter\\:0px\\]{--slide-enter: 0px}.sm\\:\\[--slide-exit\\:0px\\]{--slide-exit: 0px}.sm\\:data-\\[visible\\=true\\]\\:pointer-events-none[data-visible=true]{pointer-events:none}.sm\\:data-\\[visible\\=true\\]\\:opacity-0[data-visible=true]{opacity:0}.group[data-hover=true] .sm\\:group-data-\\[hover\\=true\\]\\:data-\\[visible\\=true\\]\\:pointer-events-auto[data-visible=true]{pointer-events:auto}.group[data-hover=true] .sm\\:group-data-\\[hover\\=true\\]\\:data-\\[visible\\=true\\]\\:opacity-100[data-visible=true]{opacity:1}}.rtl\\:left-2:where([dir=rtl],[dir=rtl] *){left:.5rem}.rtl\\:right-auto:where([dir=rtl],[dir=rtl] *){right:auto}.rtl\\:origin-top-right:where([dir=rtl],[dir=rtl] *){transform-origin:top right}.rtl\\:-rotate-180:where([dir=rtl],[dir=rtl] *){--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(-180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rtl\\:rotate-180:where([dir=rtl],[dir=rtl] *){--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rtl\\:flex-row-reverse:where([dir=rtl],[dir=rtl] *){flex-direction:row-reverse}.rtl\\:space-x-reverse:where([dir=rtl],[dir=rtl] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 1}.rtl\\:data-\\[focus-visible\\=true\\]\\:translate-x-3[data-focus-visible=true]:where([dir=rtl],[dir=rtl] *){--tw-translate-x: .75rem;transform:translate(.75rem,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rtl\\:data-\\[hover\\=true\\]\\:translate-x-3[data-hover=true]:where([dir=rtl],[dir=rtl] *){--tw-translate-x: .75rem;transform:translate(.75rem,var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rtl\\:data-\\[open\\=true\\]\\:-rotate-90[data-open=true]:where([dir=rtl],[dir=rtl] *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(-90deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&\\+\\.border-medium\\.border-danger\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-danger{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\+\\.border-medium\\.border-default\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-default{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\+\\.border-medium\\.border-primary\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-primary{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\+\\.border-medium\\.border-secondary\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-secondary{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\+\\.border-medium\\.border-success\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-success{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\+\\.border-medium\\.border-warning\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.medium\\)\\*-1\\)\\]+.border-medium.border-warning{margin-left:-2px;margin-left:calc(var(--nextui-border-width-medium) * -1)}.\\[\\&\\:not\\(\\:first-child\\)\\:not\\(\\:last-child\\)\\]\\:rounded-none:not(:first-child):not(:last-child){border-radius:0}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:-ml-1:not(:first-child){margin-left:-.25rem}.\\[\\&\\:not\\(\\:first-of-type\\)\\:not\\(\\:last-of-type\\)\\]\\:rounded-none:not(:first-of-type):not(:last-of-type){border-radius:0}.\\[\\&\\:not\\(\\:first-of-type\\)\\]\\:ms-\\[calc\\(theme\\(borderWidth\\.2\\)\\*-1\\)\\]:not(:first-of-type){margin-left:-2px}.\\[\\&\\>\\*\\]\\:relative>*{position:relative}.\\[\\&\\>svg\\]\\:max-w-\\[theme\\(spacing\\.8\\)\\]>svg{max-width:2rem}.\\[\\&\\>tr\\]\\:first\\:rounded-lg:first-child>tr{border-radius:.5rem}.\\[\\&\\>tr\\]\\:first\\:shadow-small:first-child>tr{--tw-shadow: var(--nextui-box-shadow-small);--tw-shadow-colored: var(--nextui-box-shadow-small);box-shadow:0 0 #0000,0 0 #0000,0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.\\[\\&\\[data-hover\\=true\\]\\:not\\(\\[data-active\\=true\\]\\)\\]\\:bg-default-100[data-hover=true]:not([data-active=true]){--tw-bg-opacity: 1;background-color:#f4f4f5;background-color:hsl(var(--nextui-default-100) / var(--nextui-default-100-opacity, var(--tw-bg-opacity)))}.\\[\\&\\[data-hover\\=true\\]\\:not\\(\\[data-active\\=true\\]\\)\\]\\:bg-default-200[data-hover=true]:not([data-active=true]){--tw-bg-opacity: 1;background-color:#e4e4e7;background-color:hsl(var(--nextui-default-200) / var(--nextui-default-200-opacity, var(--tw-bg-opacity)))}.\\[\\&_\\.chevron-icon\\]\\:flex-none .chevron-icon{flex:none}.\\[\\&_\\.chevron-icon\\]\\:rotate-180 .chevron-icon{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_\\.chevron-icon\\]\\:transition-transform .chevron-icon{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.25s}.\\[\\&_td\\]\\:block td{display:block}.maplibregl-ctrl-geocoder,.maplibregl-ctrl-geocoder *,.maplibregl-ctrl-geocoder *:after,.maplibregl-ctrl-geocoder *:before{box-sizing:border-box}.maplibregl-ctrl-geocoder{font-size:18px;line-height:24px;font-family:Open Sans,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;width:100%;min-width:240px;z-index:1;border-radius:4px;transition:width .25s,min-width .25s}.maplibregl-ctrl-geocoder--input{font:inherit;width:100%;border:0;background-color:transparent;margin:0;height:50px;color:#404040;color:#000000bf;padding:6px 45px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maplibregl-ctrl-geocoder--input::-ms-clear{display:none}.maplibregl-ctrl-geocoder--input:focus{color:#404040;color:#000000bf;outline:0;box-shadow:none;outline:thin dotted}.maplibregl-ctrl-geocoder .maplibregl-ctrl-geocoder--pin-right>*{z-index:2;position:absolute;right:8px;top:7px;display:none}.maplibregl-ctrl-geocoder,.maplibregl-ctrl-geocoder .suggestions{box-shadow:0 0 10px 2px #0000001a}.maplibregl-ctrl-geocoder.maplibregl-ctrl-geocoder--collapsed{width:50px;min-width:50px;transition:width .25s,min-width .25s}.maplibregl-ctrl-geocoder .suggestions{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:110%;top:calc(100% + 6px);z-index:1000;overflow:hidden;font-size:15px}.maplibregl-ctrl-bottom-left .suggestions,.maplibregl-ctrl-bottom-right .suggestions{top:auto;bottom:100%}.maplibregl-ctrl-geocoder .suggestions>li>a{cursor:default;display:block;padding:6px 12px;color:#404040}.maplibregl-ctrl-geocoder .suggestions>.active>a,.maplibregl-ctrl-geocoder .suggestions>li>a:hover{color:#404040;background-color:#f3f3f3;-webkit-text-decoration:none;text-decoration:none;cursor:pointer}.maplibregl-ctrl-geocoder--suggestion{display:flex;flex-direction:row;align-items:center}.maplibregl-ctrl-geocoder--suggestion-icon{min-width:30px;min-height:24px;max-width:30px;max-height:24px;padding-right:12px}.maplibregl-ctrl-geocoder--suggestion-info{display:flex;flex-direction:column}.maplibregl-ctrl-geocoder--suggestion-match{font-weight:700}.maplibregl-ctrl-geocoder--suggestion-title,.maplibregl-ctrl-geocoder--suggestion-address{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.maplibregl-ctrl-geocoder--result{display:flex;flex-direction:row;align-items:center}.maplibregl-ctrl-geocoder--result-icon{min-width:30px;min-height:24px;max-width:30px;max-height:24px;padding-right:12px}.maplibregl-ctrl-geocoder--result-title{font-weight:700}.maplibregl-ctrl-geocoder--result-title,.maplibregl-ctrl-geocoder--result-address{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.maplibregl-ctrl-geocoder--icon{display:inline-block;vertical-align:middle;speak:none;fill:#757575;top:15px}.maplibregl-ctrl-geocoder--icon-search{position:absolute;top:13px;left:12px;width:23px;height:23px}.maplibregl-ctrl-geocoder--button{padding:0;margin:0;border:none;cursor:pointer;background:#fff;line-height:1}.maplibregl-ctrl-geocoder--icon-close{width:20px;height:20px;margin-top:8px;margin-right:3px}.maplibregl-ctrl-geocoder--button:hover .maplibregl-ctrl-geocoder--icon-close{fill:#909090}.maplibregl-ctrl-geocoder--icon-loading{width:26px;height:26px;margin-top:5px;margin-right:0;animation:rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media screen and (min-width:640px){.maplibregl-ctrl-geocoder.maplibregl-ctrl-geocoder--collapsed{width:36px;min-width:36px}.maplibregl-ctrl-geocoder{width:33.3333%;font-size:15px;line-height:20px;max-width:360px}.maplibregl-ctrl-geocoder .suggestions{font-size:13px}.maplibregl-ctrl-geocoder--icon{top:8px}.maplibregl-ctrl-geocoder--icon-close{width:16px;height:16px;margin-top:3px;margin-right:0}.maplibregl-ctrl-geocoder--icon-search{left:7px;width:20px;height:20px}.maplibregl-ctrl-geocoder--input{height:36px;padding:6px 35px}.maplibregl-ctrl-geocoder--icon-loading{width:26px;height:26px;margin-top:-2px;margin-right:-5px}.maplibre-gl-geocoder--error{color:#909090;padding:6px 12px;font-size:16px;text-align:center}}\n",
       "_dom_classes": [],
       "_esm": "var P7t=Object.create;var Qj=Object.defineProperty;var C7t=Object.getOwnPropertyDescriptor;var I7t=Object.getOwnPropertyNames;var k7t=Object.getPrototypeOf,R7t=Object.prototype.hasOwnProperty;var BR=(e=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(e,{get:(t,r)=>(typeof require<\"u\"?require:t)[r]}):e)(function(e){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+e+'\" is not supported')});var Et=(e,t)=>()=>(e&&(t=e(e=0)),t);var Nr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ql=(e,t)=>{for(var r in t)Qj(e,r,{get:t[r],enumerable:!0})},D7t=(e,t,r,i)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of I7t(t))!R7t.call(e,n)&&n!==r&&Qj(e,n,{get:()=>t[n],enumerable:!(i=C7t(t,n))||i.enumerable});return e};var xe=(e,t,r)=>(r=e!=null?P7t(k7t(e)):{},D7t(t||!e||!e.__esModule?Qj(r,\"default\",{value:e,enumerable:!0}):r,e));var Kst=Nr(Pi=>{\"use strict\";var e$=Symbol.for(\"react.transitional.element\"),O7t=Symbol.for(\"react.portal\"),L7t=Symbol.for(\"react.fragment\"),B7t=Symbol.for(\"react.strict_mode\"),F7t=Symbol.for(\"react.profiler\"),N7t=Symbol.for(\"react.consumer\"),z7t=Symbol.for(\"react.context\"),U7t=Symbol.for(\"react.forward_ref\"),V7t=Symbol.for(\"react.suspense\"),j7t=Symbol.for(\"react.memo\"),Wst=Symbol.for(\"react.lazy\"),$7t=Symbol.for(\"react.activity\"),Vst=Symbol.iterator;function G7t(e){return e===null||typeof e!=\"object\"?null:(e=Vst&&e[Vst]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var qst={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hst=Object.assign,Yst={};function iw(e,t,r){this.props=e,this.context=t,this.refs=Yst,this.updater=r||qst}iw.prototype.isReactComponent={};iw.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=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,e,t,\"setState\")};iw.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function Xst(){}Xst.prototype=iw.prototype;function r$(e,t,r){this.props=e,this.context=t,this.refs=Yst,this.updater=r||qst}var i$=r$.prototype=new Xst;i$.constructor=r$;Hst(i$,iw.prototype);i$.isPureReactComponent=!0;var jst=Array.isArray;function t$(){}var Bo={H:null,A:null,T:null,S:null},Zst=Object.prototype.hasOwnProperty;function n$(e,t,r){var i=r.ref;return{$$typeof:e$,type:e,key:t,ref:i!==void 0?i:null,props:r}}function W7t(e,t){return n$(e.type,t,e.props)}function o$(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===e$}function q7t(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(r){return t[r]})}var $st=/\\/+/g;function Jj(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?q7t(\"\"+e.key):t.toString(36)}function H7t(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(t$,t$):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function rw(e,t,r,i,n){var o=typeof e;(o===\"undefined\"||o===\"boolean\")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case\"bigint\":case\"string\":case\"number\":s=!0;break;case\"object\":switch(e.$$typeof){case e$:case O7t:s=!0;break;case Wst:return s=e._init,rw(s(e._payload),t,r,i,n)}}if(s)return n=n(e),s=i===\"\"?\".\"+Jj(e,0):i,jst(n)?(r=\"\",s!=null&&(r=s.replace($st,\"$&/\")+\"/\"),rw(n,t,r,\"\",function(p){return p})):n!=null&&(o$(n)&&(n=W7t(n,r+(n.key==null||e&&e.key===n.key?\"\":(\"\"+n.key).replace($st,\"$&/\")+\"/\")+s)),t.push(n)),1;s=0;var a=i===\"\"?\".\":i+\":\";if(jst(e))for(var h=0;h<e.length;h++)i=e[h],o=a+Jj(i,h),s+=rw(i,t,r,o,n);else if(h=G7t(e),typeof h==\"function\")for(e=h.call(e),h=0;!(i=e.next()).done;)i=i.value,o=a+Jj(i,h++),s+=rw(i,t,r,o,n);else if(o===\"object\"){if(typeof e.then==\"function\")return rw(H7t(e),t,r,i,n);throw t=String(e),Error(\"Objects are not valid as a React child (found: \"+(t===\"[object Object]\"?\"object with keys {\"+Object.keys(e).join(\", \")+\"}\":t)+\"). If you meant to render a collection of children, use an array instead.\")}return s}function FR(e,t,r){if(e==null)return e;var i=[],n=0;return rw(e,i,\"\",\"\",function(o){return t.call(r,o,n++)}),i}function Y7t(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Gst=typeof reportError==\"function\"?reportError:function(e){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var t=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof e==\"object\"&&e!==null&&typeof e.message==\"string\"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",e);return}console.error(e)},X7t={map:FR,forEach:function(e,t,r){FR(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return FR(e,function(){t++}),t},toArray:function(e){return FR(e,function(t){return t})||[]},only:function(e){if(!o$(e))throw Error(\"React.Children.only expected to receive a single React element child.\");return e}};Pi.Activity=$7t;Pi.Children=X7t;Pi.Component=iw;Pi.Fragment=L7t;Pi.Profiler=F7t;Pi.PureComponent=r$;Pi.StrictMode=B7t;Pi.Suspense=V7t;Pi.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bo;Pi.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Bo.H.useMemoCache(e)}};Pi.cache=function(e){return function(){return e.apply(null,arguments)}};Pi.cacheSignal=function(){return null};Pi.cloneElement=function(e,t,r){if(e==null)throw Error(\"The argument must be a React element, but you passed \"+e+\".\");var i=Hst({},e.props),n=e.key;if(t!=null)for(o in t.key!==void 0&&(n=\"\"+t.key),t)!Zst.call(t,o)||o===\"key\"||o===\"__self\"||o===\"__source\"||o===\"ref\"&&t.ref===void 0||(i[o]=t[o]);var o=arguments.length-2;if(o===1)i.children=r;else if(1<o){for(var s=Array(o),a=0;a<o;a++)s[a]=arguments[a+2];i.children=s}return n$(e.type,n,i)};Pi.createContext=function(e){return e={$$typeof:z7t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:N7t,_context:e},e};Pi.createElement=function(e,t,r){var i,n={},o=null;if(t!=null)for(i in t.key!==void 0&&(o=\"\"+t.key),t)Zst.call(t,i)&&i!==\"key\"&&i!==\"__self\"&&i!==\"__source\"&&(n[i]=t[i]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var a=Array(s),h=0;h<s;h++)a[h]=arguments[h+2];n.children=a}if(e&&e.defaultProps)for(i in s=e.defaultProps,s)n[i]===void 0&&(n[i]=s[i]);return n$(e,o,n)};Pi.createRef=function(){return{current:null}};Pi.forwardRef=function(e){return{$$typeof:U7t,render:e}};Pi.isValidElement=o$;Pi.lazy=function(e){return{$$typeof:Wst,_payload:{_status:-1,_result:e},_init:Y7t}};Pi.memo=function(e,t){return{$$typeof:j7t,type:e,compare:t===void 0?null:t}};Pi.startTransition=function(e){var t=Bo.T,r={};Bo.T=r;try{var i=e(),n=Bo.S;n!==null&&n(r,i),typeof i==\"object\"&&i!==null&&typeof i.then==\"function\"&&i.then(t$,Gst)}catch(o){Gst(o)}finally{t!==null&&r.types!==null&&(t.types=r.types),Bo.T=t}};Pi.unstable_useCacheRefresh=function(){return Bo.H.useCacheRefresh()};Pi.use=function(e){return Bo.H.use(e)};Pi.useActionState=function(e,t,r){return Bo.H.useActionState(e,t,r)};Pi.useCallback=function(e,t){return Bo.H.useCallback(e,t)};Pi.useContext=function(e){return Bo.H.useContext(e)};Pi.useDebugValue=function(){};Pi.useDeferredValue=function(e,t){return Bo.H.useDeferredValue(e,t)};Pi.useEffect=function(e,t){return Bo.H.useEffect(e,t)};Pi.useEffectEvent=function(e){return Bo.H.useEffectEvent(e)};Pi.useId=function(){return Bo.H.useId()};Pi.useImperativeHandle=function(e,t,r){return Bo.H.useImperativeHandle(e,t,r)};Pi.useInsertionEffect=function(e,t){return Bo.H.useInsertionEffect(e,t)};Pi.useLayoutEffect=function(e,t){return Bo.H.useLayoutEffect(e,t)};Pi.useMemo=function(e,t){return Bo.H.useMemo(e,t)};Pi.useOptimistic=function(e,t){return Bo.H.useOptimistic(e,t)};Pi.useReducer=function(e,t,r){return Bo.H.useReducer(e,t,r)};Pi.useRef=function(e){return Bo.H.useRef(e)};Pi.useState=function(e){return Bo.H.useState(e)};Pi.useSyncExternalStore=function(e,t,r){return Bo.H.useSyncExternalStore(e,t,r)};Pi.useTransition=function(){return Bo.H.useTransition()};Pi.version=\"19.2.4\"});var ze=Nr((Qye,Qst)=>{\"use strict\";Qst.exports=Kst()});var lat=Nr($o=>{\"use strict\";function c$(e,t){var r=e.length;e.push(t);t:for(;0<r;){var i=r-1>>>1,n=e[i];if(0<NR(n,t))e[i]=t,e[r]=n,r=i;else break t}}function o0(e){return e.length===0?null:e[0]}function UR(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;t:for(var i=0,n=e.length,o=n>>>1;i<o;){var s=2*(i+1)-1,a=e[s],h=s+1,p=e[h];if(0>NR(a,r))h<n&&0>NR(p,a)?(e[i]=p,e[h]=r,i=h):(e[i]=a,e[s]=r,i=s);else if(h<n&&0>NR(p,r))e[i]=p,e[h]=r,i=h;else break t}}return t}function NR(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}$o.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Jst=performance,$o.unstable_now=function(){return Jst.now()}):(s$=Date,tat=s$.now(),$o.unstable_now=function(){return s$.now()-tat});var Jst,s$,tat,og=[],Ey=[],Z7t=1,dd=null,Jl=3,u$=!1,ZM=!1,KM=!1,h$=!1,iat=typeof setTimeout==\"function\"?setTimeout:null,nat=typeof clearTimeout==\"function\"?clearTimeout:null,eat=typeof setImmediate<\"u\"?setImmediate:null;function zR(e){for(var t=o0(Ey);t!==null;){if(t.callback===null)UR(Ey);else if(t.startTime<=e)UR(Ey),t.sortIndex=t.expirationTime,c$(og,t);else break;t=o0(Ey)}}function d$(e){if(KM=!1,zR(e),!ZM)if(o0(og)!==null)ZM=!0,ow||(ow=!0,nw());else{var t=o0(Ey);t!==null&&f$(d$,t.startTime-e)}}var ow=!1,QM=-1,oat=5,sat=-1;function aat(){return h$?!0:!($o.unstable_now()-sat<oat)}function a$(){if(h$=!1,ow){var e=$o.unstable_now();sat=e;var t=!0;try{t:{ZM=!1,KM&&(KM=!1,nat(QM),QM=-1),u$=!0;var r=Jl;try{e:{for(zR(e),dd=o0(og);dd!==null&&!(dd.expirationTime>e&&aat());){var i=dd.callback;if(typeof i==\"function\"){dd.callback=null,Jl=dd.priorityLevel;var n=i(dd.expirationTime<=e);if(e=$o.unstable_now(),typeof n==\"function\"){dd.callback=n,zR(e),t=!0;break e}dd===o0(og)&&UR(og),zR(e)}else UR(og);dd=o0(og)}if(dd!==null)t=!0;else{var o=o0(Ey);o!==null&&f$(d$,o.startTime-e),t=!1}}break t}finally{dd=null,Jl=r,u$=!1}t=void 0}}finally{t?nw():ow=!1}}}var nw;typeof eat==\"function\"?nw=function(){eat(a$)}:typeof MessageChannel<\"u\"?(l$=new MessageChannel,rat=l$.port2,l$.port1.onmessage=a$,nw=function(){rat.postMessage(null)}):nw=function(){iat(a$,0)};var l$,rat;function f$(e,t){QM=iat(function(){e($o.unstable_now())},t)}$o.unstable_IdlePriority=5;$o.unstable_ImmediatePriority=1;$o.unstable_LowPriority=4;$o.unstable_NormalPriority=3;$o.unstable_Profiling=null;$o.unstable_UserBlockingPriority=2;$o.unstable_cancelCallback=function(e){e.callback=null};$o.unstable_forceFrameRate=function(e){0>e||125<e?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):oat=0<e?Math.floor(1e3/e):5};$o.unstable_getCurrentPriorityLevel=function(){return Jl};$o.unstable_next=function(e){switch(Jl){case 1:case 2:case 3:var t=3;break;default:t=Jl}var r=Jl;Jl=t;try{return e()}finally{Jl=r}};$o.unstable_requestPaint=function(){h$=!0};$o.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=Jl;Jl=e;try{return t()}finally{Jl=r}};$o.unstable_scheduleCallback=function(e,t,r){var i=$o.unstable_now();switch(typeof r==\"object\"&&r!==null?(r=r.delay,r=typeof r==\"number\"&&0<r?i+r:i):r=i,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=r+n,e={id:Z7t++,callback:t,priorityLevel:e,startTime:r,expirationTime:n,sortIndex:-1},r>i?(e.sortIndex=r,c$(Ey,e),o0(og)===null&&e===o0(Ey)&&(KM?(nat(QM),QM=-1):KM=!0,f$(d$,r-i))):(e.sortIndex=n,c$(og,e),ZM||u$||(ZM=!0,ow||(ow=!0,nw()))),e};$o.unstable_shouldYield=aat;$o.unstable_wrapCallback=function(e){var t=Jl;return function(){var r=Jl;Jl=t;try{return e.apply(this,arguments)}finally{Jl=r}}}});var uat=Nr((t1e,cat)=>{\"use strict\";cat.exports=lat()});var dat=Nr(Ec=>{\"use strict\";var K7t=ze();function hat(e){var t=\"https://react.dev/errors/\"+e;if(1<arguments.length){t+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+=\"&args[]=\"+encodeURIComponent(arguments[r])}return\"Minified React error #\"+e+\"; visit \"+t+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function Py(){}var Mc={d:{f:Py,r:function(){throw Error(hat(522))},D:Py,C:Py,L:Py,m:Py,X:Py,S:Py,M:Py},p:0,findDOMNode:null},Q7t=Symbol.for(\"react.portal\");function J7t(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Q7t,key:i==null?null:\"\"+i,children:e,containerInfo:t,implementation:r}}var JM=K7t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function VR(e,t){if(e===\"font\")return\"\";if(typeof t==\"string\")return t===\"use-credentials\"?t:\"\"}Ec.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mc;Ec.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(hat(299));return J7t(e,t,null,r)};Ec.flushSync=function(e){var t=JM.T,r=Mc.p;try{if(JM.T=null,Mc.p=2,e)return e()}finally{JM.T=t,Mc.p=r,Mc.d.f()}};Ec.preconnect=function(e,t){typeof e==\"string\"&&(t?(t=t.crossOrigin,t=typeof t==\"string\"?t===\"use-credentials\"?t:\"\":void 0):t=null,Mc.d.C(e,t))};Ec.prefetchDNS=function(e){typeof e==\"string\"&&Mc.d.D(e)};Ec.preinit=function(e,t){if(typeof e==\"string\"&&t&&typeof t.as==\"string\"){var r=t.as,i=VR(r,t.crossOrigin),n=typeof t.integrity==\"string\"?t.integrity:void 0,o=typeof t.fetchPriority==\"string\"?t.fetchPriority:void 0;r===\"style\"?Mc.d.S(e,typeof t.precedence==\"string\"?t.precedence:void 0,{crossOrigin:i,integrity:n,fetchPriority:o}):r===\"script\"&&Mc.d.X(e,{crossOrigin:i,integrity:n,fetchPriority:o,nonce:typeof t.nonce==\"string\"?t.nonce:void 0})}};Ec.preinitModule=function(e,t){if(typeof e==\"string\")if(typeof t==\"object\"&&t!==null){if(t.as==null||t.as===\"script\"){var r=VR(t.as,t.crossOrigin);Mc.d.M(e,{crossOrigin:r,integrity:typeof t.integrity==\"string\"?t.integrity:void 0,nonce:typeof t.nonce==\"string\"?t.nonce:void 0})}}else t==null&&Mc.d.M(e)};Ec.preload=function(e,t){if(typeof e==\"string\"&&typeof t==\"object\"&&t!==null&&typeof t.as==\"string\"){var r=t.as,i=VR(r,t.crossOrigin);Mc.d.L(e,r,{crossOrigin:i,integrity:typeof t.integrity==\"string\"?t.integrity:void 0,nonce:typeof t.nonce==\"string\"?t.nonce:void 0,type:typeof t.type==\"string\"?t.type:void 0,fetchPriority:typeof t.fetchPriority==\"string\"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==\"string\"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==\"string\"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==\"string\"?t.imageSizes:void 0,media:typeof t.media==\"string\"?t.media:void 0})}};Ec.preloadModule=function(e,t){if(typeof e==\"string\")if(t){var r=VR(t.as,t.crossOrigin);Mc.d.m(e,{as:typeof t.as==\"string\"&&t.as!==\"script\"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity==\"string\"?t.integrity:void 0})}else Mc.d.m(e)};Ec.requestFormReset=function(e){Mc.d.r(e)};Ec.unstable_batchedUpdates=function(e,t){return e(t)};Ec.useFormState=function(e,t,r){return JM.H.useFormState(e,t,r)};Ec.useFormStatus=function(){return JM.H.useHostTransitionStatus()};Ec.version=\"19.2.4\"});var t5=Nr((r1e,pat)=>{\"use strict\";function fat(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fat)}catch(e){console.error(e)}}fat(),pat.exports=dat()});var Mht=Nr(dD=>{\"use strict\";var Ma=uat(),Ult=ze(),tDt=t5();function Fe(e){var t=\"https://react.dev/errors/\"+e;if(1<arguments.length){t+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+=\"&args[]=\"+encodeURIComponent(arguments[r])}return\"Minified React error #\"+e+\"; visit \"+t+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function Vlt(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function U5(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function jlt(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $lt(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function mat(e){if(U5(e)!==e)throw Error(Fe(188))}function eDt(e){var t=e.alternate;if(!t){if(t=U5(e),t===null)throw Error(Fe(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var o=n.alternate;if(o===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===r)return mat(n),e;if(o===i)return mat(n),t;o=o.sibling}throw Error(Fe(188))}if(r.return!==i.return)r=n,i=o;else{for(var s=!1,a=n.child;a;){if(a===r){s=!0,r=n,i=o;break}if(a===i){s=!0,i=n,r=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===r){s=!0,r=o,i=n;break}if(a===i){s=!0,i=o,r=n;break}a=a.sibling}if(!s)throw Error(Fe(189))}}if(r.alternate!==i)throw Error(Fe(190))}if(r.tag!==3)throw Error(Fe(188));return r.stateNode.current===r?e:t}function Glt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Glt(e),t!==null)return t;e=e.sibling}return null}var zo=Object.assign,rDt=Symbol.for(\"react.element\"),jR=Symbol.for(\"react.transitional.element\"),l5=Symbol.for(\"react.portal\"),hw=Symbol.for(\"react.fragment\"),Wlt=Symbol.for(\"react.strict_mode\"),H$=Symbol.for(\"react.profiler\"),qlt=Symbol.for(\"react.consumer\"),fg=Symbol.for(\"react.context\"),jG=Symbol.for(\"react.forward_ref\"),Y$=Symbol.for(\"react.suspense\"),X$=Symbol.for(\"react.suspense_list\"),$G=Symbol.for(\"react.memo\"),Cy=Symbol.for(\"react.lazy\"),Z$=Symbol.for(\"react.activity\"),iDt=Symbol.for(\"react.memo_cache_sentinel\"),gat=Symbol.iterator;function e5(e){return e===null||typeof e!=\"object\"?null:(e=gat&&e[gat]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var nDt=Symbol.for(\"react.client.reference\");function K$(e){if(e==null)return null;if(typeof e==\"function\")return e.$$typeof===nDt?null:e.displayName||e.name||null;if(typeof e==\"string\")return e;switch(e){case hw:return\"Fragment\";case H$:return\"Profiler\";case Wlt:return\"StrictMode\";case Y$:return\"Suspense\";case X$:return\"SuspenseList\";case Z$:return\"Activity\"}if(typeof e==\"object\")switch(e.$$typeof){case l5:return\"Portal\";case fg:return e.displayName||\"Context\";case qlt:return(e._context.displayName||\"Context\")+\".Consumer\";case jG:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||\"\",e=e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\"),e;case $G:return t=e.displayName||null,t!==null?t:K$(e.type)||\"Memo\";case Cy:t=e._payload,e=e._init;try{return K$(e(t))}catch{}}return null}var c5=Array.isArray,hi=Ult.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pn=tDt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mv={pending:!1,data:null,method:null,action:null},Q$=[],dw=-1;function u0(e){return{current:e}}function Ja(e){0>dw||(e.current=Q$[dw],Q$[dw]=null,dw--)}function To(e,t){dw++,Q$[dw]=e.current,e.current=t}var c0=u0(null),M5=u0(null),Uy=u0(null),b7=u0(null);function x7(e,t){switch(To(Uy,t),To(M5,e),To(c0,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wlt(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wlt(t),e=dht(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ja(c0),To(c0,e)}function Iw(){Ja(c0),Ja(M5),Ja(Uy)}function J$(e){e.memoizedState!==null&&To(b7,e);var t=c0.current,r=dht(t,e.type);t!==r&&(To(M5,e),To(c0,r))}function w7(e){M5.current===e&&(Ja(c0),Ja(M5)),b7.current===e&&(Ja(b7),F5._currentValue=Mv)}var p$,Aat;function xv(e){if(p$===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\\n( *(at )?)/);p$=t&&t[1]||\"\",Aat=-1<r.stack.indexOf(`\n    at`)?\" (<anonymous>)\":-1<r.stack.indexOf(\"@\")?\"@unknown:0:0\":\"\"}return`\n`+p$+e+Aat}var m$=!1;function g$(e,t){if(!e||m$)return\"\";m$=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(w,[])}catch(R){var C=R}Reflect.construct(e,[],w)}else{try{w.call()}catch(R){C=R}e.call(w.prototype)}}else{try{throw Error()}catch(R){C=R}(w=e())&&typeof w.catch==\"function\"&&w.catch(function(){})}}catch(R){if(R&&C&&typeof R.stack==\"string\")return[R.stack,C.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName=\"DetermineComponentFrameRoot\";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,\"name\");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,\"name\",{value:\"DetermineComponentFrameRoot\"});var o=i.DetermineComponentFrameRoot(),s=o[0],a=o[1];if(s&&a){var h=s.split(`\n`),p=a.split(`\n`);for(n=i=0;i<h.length&&!h[i].includes(\"DetermineComponentFrameRoot\");)i++;for(;n<p.length&&!p[n].includes(\"DetermineComponentFrameRoot\");)n++;if(i===h.length||n===p.length)for(i=h.length-1,n=p.length-1;1<=i&&0<=n&&h[i]!==p[n];)n--;for(;1<=i&&0<=n;i--,n--)if(h[i]!==p[n]){if(i!==1||n!==1)do if(i--,n--,0>n||h[i]!==p[n]){var g=`\n`+h[i].replace(\" at new \",\" at \");return e.displayName&&g.includes(\"<anonymous>\")&&(g=g.replace(\"<anonymous>\",e.displayName)),g}while(1<=i&&0<=n);break}}}finally{m$=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:\"\")?xv(r):\"\"}function oDt(e,t){switch(e.tag){case 26:case 27:case 5:return xv(e.type);case 16:return xv(\"Lazy\");case 13:return e.child!==t&&t!==null?xv(\"Suspense Fallback\"):xv(\"Suspense\");case 19:return xv(\"SuspenseList\");case 0:case 15:return g$(e.type,!1);case 11:return g$(e.type.render,!1);case 1:return g$(e.type,!0);case 31:return xv(\"Activity\");default:return\"\"}}function yat(e){try{var t=\"\",r=null;do t+=oDt(e,r),r=e,e=e.return;while(e);return t}catch(i){return`\nError generating stack: `+i.message+`\n`+i.stack}}var tG=Object.prototype.hasOwnProperty,GG=Ma.unstable_scheduleCallback,A$=Ma.unstable_cancelCallback,sDt=Ma.unstable_shouldYield,aDt=Ma.unstable_requestPaint,uh=Ma.unstable_now,lDt=Ma.unstable_getCurrentPriorityLevel,Hlt=Ma.unstable_ImmediatePriority,Ylt=Ma.unstable_UserBlockingPriority,T7=Ma.unstable_NormalPriority,cDt=Ma.unstable_LowPriority,Xlt=Ma.unstable_IdlePriority,uDt=Ma.log,hDt=Ma.unstable_setDisableYieldValue,V5=null,hh=null;function Ly(e){if(typeof uDt==\"function\"&&hDt(e),hh&&typeof hh.setStrictMode==\"function\")try{hh.setStrictMode(V5,e)}catch{}}var dh=Math.clz32?Math.clz32:pDt,dDt=Math.log,fDt=Math.LN2;function pDt(e){return e>>>=0,e===0?32:31-(dDt(e)/fDt|0)|0}var $R=256,GR=262144,WR=4194304;function wv(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Z7(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var n=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=i&134217727;return a!==0?(i=a&~o,i!==0?n=wv(i):(s&=a,s!==0?n=wv(s):r||(r=a&~e,r!==0&&(n=wv(r))))):(a=i&~o,a!==0?n=wv(a):s!==0?n=wv(s):r||(r=i&~e,r!==0&&(n=wv(r)))),n===0?0:t!==0&&t!==n&&(t&o)===0&&(o=n&-n,r=t&-t,o>=r||o===32&&(r&4194048)!==0)?t:n}function j5(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mDt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Zlt(){var e=WR;return WR<<=1,(WR&62914560)===0&&(WR=4194304),e}function y$(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function $5(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gDt(e,t,r,i,n,o){var s=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var a=e.entanglements,h=e.expirationTimes,p=e.hiddenUpdates;for(r=s&~r;0<r;){var g=31-dh(r),w=1<<g;a[g]=0,h[g]=-1;var C=p[g];if(C!==null)for(p[g]=null,g=0;g<C.length;g++){var R=C[g];R!==null&&(R.lane&=-536870913)}r&=~w}i!==0&&Klt(e,i,0),o!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=o&~(s&~t))}function Klt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-dh(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function Qlt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-dh(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}function Jlt(e,t){var r=t&-t;return r=(r&42)!==0?1:WG(r),(r&(e.suspendedLanes|t))!==0?0:r}function WG(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function qG(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tct(){var e=Pn.p;return e!==0?e:(e=window.event,e===void 0?32:wht(e.type))}function _at(e,t){var r=Pn.p;try{return Pn.p=e,t()}finally{Pn.p=r}}var Jy=Math.random().toString(36).slice(2),Sl=\"__reactFiber$\"+Jy,Au=\"__reactProps$\"+Jy,Vw=\"__reactContainer$\"+Jy,eG=\"__reactEvents$\"+Jy,ADt=\"__reactListeners$\"+Jy,yDt=\"__reactHandles$\"+Jy,vat=\"__reactResources$\"+Jy,G5=\"__reactMarker$\"+Jy;function HG(e){delete e[Sl],delete e[Au],delete e[eG],delete e[ADt],delete e[yDt]}function fw(e){var t=e[Sl];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Vw]||r[Sl]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Plt(e);e!==null;){if(r=e[Sl])return r;e=Plt(e)}return t}e=r,r=e.parentNode}return null}function jw(e){if(e=e[Sl]||e[Vw]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function u5(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Fe(33))}function ww(e){var t=e[vat];return t||(t=e[vat]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Qa(e){e[G5]=!0}var ect=new Set,rct={};function Bv(e,t){kw(e,t),kw(e+\"Capture\",t)}function kw(e,t){for(rct[e]=t,e=0;e<t.length;e++)ect.add(t[e])}var _Dt=RegExp(\"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"),bat={},xat={};function vDt(e){return tG.call(xat,e)?!0:tG.call(bat,e)?!1:_Dt.test(e)?xat[e]=!0:(bat[e]=!0,!1)}function s7(e,t,r){if(vDt(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case\"undefined\":case\"function\":case\"symbol\":e.removeAttribute(t);return;case\"boolean\":var i=t.toLowerCase().slice(0,5);if(i!==\"data-\"&&i!==\"aria-\"){e.removeAttribute(t);return}}e.setAttribute(t,\"\"+r)}}function qR(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":e.removeAttribute(t);return}e.setAttribute(t,\"\"+r)}}function sg(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":e.removeAttribute(r);return}e.setAttributeNS(t,r,\"\"+i)}}function pd(e){switch(typeof e){case\"bigint\":case\"boolean\":case\"number\":case\"string\":case\"undefined\":return e;case\"object\":return e;default:return\"\"}}function ict(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\"input\"&&(t===\"checkbox\"||t===\"radio\")}function bDt(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<\"u\"&&typeof i.get==\"function\"&&typeof i.set==\"function\"){var n=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(s){r=\"\"+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(s){r=\"\"+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rG(e){if(!e._valueTracker){var t=ict(e)?\"checked\":\"value\";e._valueTracker=bDt(e,t,\"\"+e[t])}}function nct(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i=\"\";return e&&(i=ict(e)?e.checked?\"true\":\"false\":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function S7(e){if(e=e||(typeof document<\"u\"?document:void 0),typeof e>\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}var xDt=/[\\n\"\\\\]/g;function Ad(e){return e.replace(xDt,function(t){return\"\\\\\"+t.charCodeAt(0).toString(16)+\" \"})}function iG(e,t,r,i,n,o,s,a){e.name=\"\",s!=null&&typeof s!=\"function\"&&typeof s!=\"symbol\"&&typeof s!=\"boolean\"?e.type=s:e.removeAttribute(\"type\"),t!=null?s===\"number\"?(t===0&&e.value===\"\"||e.value!=t)&&(e.value=\"\"+pd(t)):e.value!==\"\"+pd(t)&&(e.value=\"\"+pd(t)):s!==\"submit\"&&s!==\"reset\"||e.removeAttribute(\"value\"),t!=null?nG(e,s,pd(t)):r!=null?nG(e,s,pd(r)):i!=null&&e.removeAttribute(\"value\"),n==null&&o!=null&&(e.defaultChecked=!!o),n!=null&&(e.checked=n&&typeof n!=\"function\"&&typeof n!=\"symbol\"),a!=null&&typeof a!=\"function\"&&typeof a!=\"symbol\"&&typeof a!=\"boolean\"?e.name=\"\"+pd(a):e.removeAttribute(\"name\")}function oct(e,t,r,i,n,o,s,a){if(o!=null&&typeof o!=\"function\"&&typeof o!=\"symbol\"&&typeof o!=\"boolean\"&&(e.type=o),t!=null||r!=null){if(!(o!==\"submit\"&&o!==\"reset\"||t!=null)){rG(e);return}r=r!=null?\"\"+pd(r):\"\",t=t!=null?\"\"+pd(t):r,a||t===e.value||(e.value=t),e.defaultValue=t}i=i??n,i=typeof i!=\"function\"&&typeof i!=\"symbol\"&&!!i,e.checked=a?e.checked:!!i,e.defaultChecked=!!i,s!=null&&typeof s!=\"function\"&&typeof s!=\"symbol\"&&typeof s!=\"boolean\"&&(e.name=s),rG(e)}function nG(e,t,r){t===\"number\"&&S7(e.ownerDocument)===e||e.defaultValue===\"\"+r||(e.defaultValue=\"\"+r)}function Tw(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t[\"$\"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty(\"$\"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=\"\"+pd(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function sct(e,t,r){if(t!=null&&(t=\"\"+pd(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?\"\"+pd(r):\"\"}function act(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(Fe(92));if(c5(i)){if(1<i.length)throw Error(Fe(93));i=i[0]}r=i}r==null&&(r=\"\"),t=r}r=pd(t),e.defaultValue=r,i=e.textContent,i===r&&i!==\"\"&&i!==null&&(e.value=i),rG(e)}function Rw(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var wDt=new Set(\"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\" \"));function wat(e,t,r){var i=t.indexOf(\"--\")===0;r==null||typeof r==\"boolean\"||r===\"\"?i?e.setProperty(t,\"\"):t===\"float\"?e.cssFloat=\"\":e[t]=\"\":i?e.setProperty(t,r):typeof r!=\"number\"||r===0||wDt.has(t)?t===\"float\"?e.cssFloat=r:e[t]=(\"\"+r).trim():e[t]=r+\"px\"}function lct(e,t,r){if(t!=null&&typeof t!=\"object\")throw Error(Fe(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf(\"--\")===0?e.setProperty(i,\"\"):i===\"float\"?e.cssFloat=\"\":e[i]=\"\");for(var n in t)i=t[n],t.hasOwnProperty(n)&&r[n]!==i&&wat(e,n,i)}else for(var o in t)t.hasOwnProperty(o)&&wat(e,o,t[o])}function YG(e){if(e.indexOf(\"-\")===-1)return!1;switch(e){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var TDt=new Map([[\"acceptCharset\",\"accept-charset\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"],[\"crossOrigin\",\"crossorigin\"],[\"accentHeight\",\"accent-height\"],[\"alignmentBaseline\",\"alignment-baseline\"],[\"arabicForm\",\"arabic-form\"],[\"baselineShift\",\"baseline-shift\"],[\"capHeight\",\"cap-height\"],[\"clipPath\",\"clip-path\"],[\"clipRule\",\"clip-rule\"],[\"colorInterpolation\",\"color-interpolation\"],[\"colorInterpolationFilters\",\"color-interpolation-filters\"],[\"colorProfile\",\"color-profile\"],[\"colorRendering\",\"color-rendering\"],[\"dominantBaseline\",\"dominant-baseline\"],[\"enableBackground\",\"enable-background\"],[\"fillOpacity\",\"fill-opacity\"],[\"fillRule\",\"fill-rule\"],[\"floodColor\",\"flood-color\"],[\"floodOpacity\",\"flood-opacity\"],[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"fontSizeAdjust\",\"font-size-adjust\"],[\"fontStretch\",\"font-stretch\"],[\"fontStyle\",\"font-style\"],[\"fontVariant\",\"font-variant\"],[\"fontWeight\",\"font-weight\"],[\"glyphName\",\"glyph-name\"],[\"glyphOrientationHorizontal\",\"glyph-orientation-horizontal\"],[\"glyphOrientationVertical\",\"glyph-orientation-vertical\"],[\"horizAdvX\",\"horiz-adv-x\"],[\"horizOriginX\",\"horiz-origin-x\"],[\"imageRendering\",\"image-rendering\"],[\"letterSpacing\",\"letter-spacing\"],[\"lightingColor\",\"lighting-color\"],[\"markerEnd\",\"marker-end\"],[\"markerMid\",\"marker-mid\"],[\"markerStart\",\"marker-start\"],[\"overlinePosition\",\"overline-position\"],[\"overlineThickness\",\"overline-thickness\"],[\"paintOrder\",\"paint-order\"],[\"panose-1\",\"panose-1\"],[\"pointerEvents\",\"pointer-events\"],[\"renderingIntent\",\"rendering-intent\"],[\"shapeRendering\",\"shape-rendering\"],[\"stopColor\",\"stop-color\"],[\"stopOpacity\",\"stop-opacity\"],[\"strikethroughPosition\",\"strikethrough-position\"],[\"strikethroughThickness\",\"strikethrough-thickness\"],[\"strokeDasharray\",\"stroke-dasharray\"],[\"strokeDashoffset\",\"stroke-dashoffset\"],[\"strokeLinecap\",\"stroke-linecap\"],[\"strokeLinejoin\",\"stroke-linejoin\"],[\"strokeMiterlimit\",\"stroke-miterlimit\"],[\"strokeOpacity\",\"stroke-opacity\"],[\"strokeWidth\",\"stroke-width\"],[\"textAnchor\",\"text-anchor\"],[\"textDecoration\",\"text-decoration\"],[\"textRendering\",\"text-rendering\"],[\"transformOrigin\",\"transform-origin\"],[\"underlinePosition\",\"underline-position\"],[\"underlineThickness\",\"underline-thickness\"],[\"unicodeBidi\",\"unicode-bidi\"],[\"unicodeRange\",\"unicode-range\"],[\"unitsPerEm\",\"units-per-em\"],[\"vAlphabetic\",\"v-alphabetic\"],[\"vHanging\",\"v-hanging\"],[\"vIdeographic\",\"v-ideographic\"],[\"vMathematical\",\"v-mathematical\"],[\"vectorEffect\",\"vector-effect\"],[\"vertAdvY\",\"vert-adv-y\"],[\"vertOriginX\",\"vert-origin-x\"],[\"vertOriginY\",\"vert-origin-y\"],[\"wordSpacing\",\"word-spacing\"],[\"writingMode\",\"writing-mode\"],[\"xmlnsXlink\",\"xmlns:xlink\"],[\"xHeight\",\"x-height\"]]),SDt=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;function a7(e){return SDt.test(\"\"+e)?\"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\":e}function pg(){}var oG=null;function XG(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pw=null,Sw=null;function Tat(e){var t=jw(e);if(t&&(e=t.stateNode)){var r=e[Au]||null;t:switch(e=t.stateNode,t.type){case\"input\":if(iG(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type===\"radio\"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name=\"'+Ad(\"\"+t)+'\"][type=\"radio\"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=i[Au]||null;if(!n)throw Error(Fe(90));iG(i,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<r.length;t++)i=r[t],i.form===e.form&&nct(i)}break t;case\"textarea\":sct(e,r.value,r.defaultValue);break t;case\"select\":t=r.value,t!=null&&Tw(e,!!r.multiple,t,!1)}}}var _$=!1;function cct(e,t,r){if(_$)return e(t,r);_$=!0;try{var i=e(t);return i}finally{if(_$=!1,(pw!==null||Sw!==null)&&(lD(),pw&&(t=pw,e=Sw,Sw=pw=null,Tat(t),e)))for(t=0;t<e.length;t++)Tat(e[t])}}function E5(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Au]||null;if(i===null)return null;r=i[t];t:switch(t){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(i=!i.disabled)||(e=e.type,i=!(e===\"button\"||e===\"input\"||e===\"select\"||e===\"textarea\")),e=!i;break t;default:e=!1}if(e)return null;if(r&&typeof r!=\"function\")throw Error(Fe(231,t,typeof r));return r}var _g=!(typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),sG=!1;if(_g)try{sw={},Object.defineProperty(sw,\"passive\",{get:function(){sG=!0}}),window.addEventListener(\"test\",sw,sw),window.removeEventListener(\"test\",sw,sw)}catch{sG=!1}var sw,By=null,ZG=null,l7=null;function uct(){if(l7)return l7;var e,t=ZG,r=t.length,i,n=\"value\"in By?By.value:By.textContent,o=n.length;for(e=0;e<r&&t[e]===n[e];e++);var s=r-e;for(i=1;i<=s&&t[r-i]===n[o-i];i++);return l7=n.slice(e,1<i?1-i:void 0)}function c7(e){var t=e.keyCode;return\"charCode\"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function HR(){return!0}function Sat(){return!1}function yu(e){function t(r,i,n,o,s){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?HR:Sat,this.isPropagationStopped=Sat,this}return zo(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!=\"unknown\"&&(r.returnValue=!1),this.isDefaultPrevented=HR)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!=\"unknown\"&&(r.cancelBubble=!0),this.isPropagationStopped=HR)},persist:function(){},isPersistent:HR}),t}var Fv={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},K7=yu(Fv),W5=zo({},Fv,{view:0,detail:0}),MDt=yu(W5),v$,b$,r5,Q7=zo({},W5,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:KG,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return\"movementX\"in e?e.movementX:(e!==r5&&(r5&&e.type===\"mousemove\"?(v$=e.screenX-r5.screenX,b$=e.screenY-r5.screenY):b$=v$=0,r5=e),v$)},movementY:function(e){return\"movementY\"in e?e.movementY:b$}}),Mat=yu(Q7),EDt=zo({},Q7,{dataTransfer:0}),PDt=yu(EDt),CDt=zo({},W5,{relatedTarget:0}),x$=yu(CDt),IDt=zo({},Fv,{animationName:0,elapsedTime:0,pseudoElement:0}),kDt=yu(IDt),RDt=zo({},Fv,{clipboardData:function(e){return\"clipboardData\"in e?e.clipboardData:window.clipboardData}}),DDt=yu(RDt),ODt=zo({},Fv,{data:0}),Eat=yu(ODt),LDt={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},BDt={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},FDt={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function NDt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=FDt[e])?!!t[e]:!1}function KG(){return NDt}var zDt=zo({},W5,{key:function(e){if(e.key){var t=LDt[e.key]||e.key;if(t!==\"Unidentified\")return t}return e.type===\"keypress\"?(e=c7(e),e===13?\"Enter\":String.fromCharCode(e)):e.type===\"keydown\"||e.type===\"keyup\"?BDt[e.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:KG,charCode:function(e){return e.type===\"keypress\"?c7(e):0},keyCode:function(e){return e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0},which:function(e){return e.type===\"keypress\"?c7(e):e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0}}),UDt=yu(zDt),VDt=zo({},Q7,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pat=yu(VDt),jDt=zo({},W5,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:KG}),$Dt=yu(jDt),GDt=zo({},Fv,{propertyName:0,elapsedTime:0,pseudoElement:0}),WDt=yu(GDt),qDt=zo({},Q7,{deltaX:function(e){return\"deltaX\"in e?e.deltaX:\"wheelDeltaX\"in e?-e.wheelDeltaX:0},deltaY:function(e){return\"deltaY\"in e?e.deltaY:\"wheelDeltaY\"in e?-e.wheelDeltaY:\"wheelDelta\"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),HDt=yu(qDt),YDt=zo({},Fv,{newState:0,oldState:0}),XDt=yu(YDt),ZDt=[9,13,27,32],QG=_g&&\"CompositionEvent\"in window,f5=null;_g&&\"documentMode\"in document&&(f5=document.documentMode);var KDt=_g&&\"TextEvent\"in window&&!f5,hct=_g&&(!QG||f5&&8<f5&&11>=f5),Cat=\" \",Iat=!1;function dct(e,t){switch(e){case\"keyup\":return ZDt.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function fct(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var mw=!1;function QDt(e,t){switch(e){case\"compositionend\":return fct(t);case\"keypress\":return t.which!==32?null:(Iat=!0,Cat);case\"textInput\":return e=t.data,e===Cat&&Iat?null:e;default:return null}}function JDt(e,t){if(mw)return e===\"compositionend\"||!QG&&dct(e,t)?(e=uct(),l7=ZG=By=null,mw=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case\"compositionend\":return hct&&t.locale!==\"ko\"?null:t.data;default:return null}}var tOt={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function kat(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===\"input\"?!!tOt[e.type]:t===\"textarea\"}function pct(e,t,r,i){pw?Sw?Sw.push(i):Sw=[i]:pw=i,t=$7(t,\"onChange\"),0<t.length&&(r=new K7(\"onChange\",\"change\",null,r,i),e.push({event:r,listeners:t}))}var p5=null,P5=null;function eOt(e){cht(e,0)}function J7(e){var t=u5(e);if(nct(t))return e}function Rat(e,t){if(e===\"change\")return t}var mct=!1;_g&&(_g?(XR=\"oninput\"in document,XR||(w$=document.createElement(\"div\"),w$.setAttribute(\"oninput\",\"return;\"),XR=typeof w$.oninput==\"function\"),YR=XR):YR=!1,mct=YR&&(!document.documentMode||9<document.documentMode));var YR,XR,w$;function Dat(){p5&&(p5.detachEvent(\"onpropertychange\",gct),P5=p5=null)}function gct(e){if(e.propertyName===\"value\"&&J7(P5)){var t=[];pct(t,P5,e,XG(e)),cct(eOt,t)}}function rOt(e,t,r){e===\"focusin\"?(Dat(),p5=t,P5=r,p5.attachEvent(\"onpropertychange\",gct)):e===\"focusout\"&&Dat()}function iOt(e){if(e===\"selectionchange\"||e===\"keyup\"||e===\"keydown\")return J7(P5)}function nOt(e,t){if(e===\"click\")return J7(t)}function oOt(e,t){if(e===\"input\"||e===\"change\")return J7(t)}function sOt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ph=typeof Object.is==\"function\"?Object.is:sOt;function C5(e,t){if(ph(e,t))return!0;if(typeof e!=\"object\"||e===null||typeof t!=\"object\"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!tG.call(t,n)||!ph(e[n],t[n]))return!1}return!0}function Oat(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lat(e,t){var r=Oat(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=Oat(r)}}function Act(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Act(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yct(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=S7(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href==\"string\"}catch{r=!1}if(r)e=t.contentWindow;else break;t=S7(e.document)}return t}function JG(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var aOt=_g&&\"documentMode\"in document&&11>=document.documentMode,gw=null,aG=null,m5=null,lG=!1;function Bat(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;lG||gw==null||gw!==S7(i)||(i=gw,\"selectionStart\"in i&&JG(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),m5&&C5(m5,i)||(m5=i,i=$7(aG,\"onSelect\"),0<i.length&&(t=new K7(\"onSelect\",\"select\",null,t,r),e.push({event:t,listeners:i}),t.target=gw)))}function bv(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r[\"Webkit\"+e]=\"webkit\"+t,r[\"Moz\"+e]=\"moz\"+t,r}var Aw={animationend:bv(\"Animation\",\"AnimationEnd\"),animationiteration:bv(\"Animation\",\"AnimationIteration\"),animationstart:bv(\"Animation\",\"AnimationStart\"),transitionrun:bv(\"Transition\",\"TransitionRun\"),transitionstart:bv(\"Transition\",\"TransitionStart\"),transitioncancel:bv(\"Transition\",\"TransitionCancel\"),transitionend:bv(\"Transition\",\"TransitionEnd\")},T$={},_ct={};_g&&(_ct=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Aw.animationend.animation,delete Aw.animationiteration.animation,delete Aw.animationstart.animation),\"TransitionEvent\"in window||delete Aw.transitionend.transition);function Nv(e){if(T$[e])return T$[e];if(!Aw[e])return e;var t=Aw[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in _ct)return T$[e]=t[r];return e}var vct=Nv(\"animationend\"),bct=Nv(\"animationiteration\"),xct=Nv(\"animationstart\"),lOt=Nv(\"transitionrun\"),cOt=Nv(\"transitionstart\"),uOt=Nv(\"transitioncancel\"),wct=Nv(\"transitionend\"),Tct=new Map,cG=\"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");cG.push(\"scrollEnd\");function Df(e,t){Tct.set(e,t),Bv(t,[e])}var M7=typeof reportError==\"function\"?reportError:function(e){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var t=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof e==\"object\"&&e!==null&&typeof e.message==\"string\"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",e);return}console.error(e)},fd=[],yw=0,tW=0;function tD(){for(var e=yw,t=tW=yw=0;t<e;){var r=fd[t];fd[t++]=null;var i=fd[t];fd[t++]=null;var n=fd[t];fd[t++]=null;var o=fd[t];if(fd[t++]=null,i!==null&&n!==null){var s=i.pending;s===null?n.next=n:(n.next=s.next,s.next=n),i.pending=n}o!==0&&Sct(r,n,o)}}function eD(e,t,r,i){fd[yw++]=e,fd[yw++]=t,fd[yw++]=r,fd[yw++]=i,tW|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function eW(e,t,r,i){return eD(e,t,r,i),E7(e)}function zv(e,t){return eD(e,null,null,t),E7(e)}function Sct(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var n=!1,o=e.return;o!==null;)o.childLanes|=r,i=o.alternate,i!==null&&(i.childLanes|=r),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(n=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,n&&t!==null&&(n=31-dh(r),e=o.hiddenUpdates,i=e[n],i===null?e[n]=[t]:i.push(t),t.lane=r|536870912),o):null}function E7(e){if(50<T5)throw T5=0,IG=null,Error(Fe(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _w={};function hOt(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lh(e,t,r,i){return new hOt(e,t,r,i)}function rW(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gg(e,t){var r=e.alternate;return r===null?(r=lh(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Mct(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function u7(e,t,r,i,n,o){var s=0;if(i=e,typeof e==\"function\")rW(e)&&(s=1);else if(typeof e==\"string\")s=pLt(e,r,c0.current)?26:e===\"html\"||e===\"head\"||e===\"body\"?27:5;else t:switch(e){case Z$:return e=lh(31,r,t,n),e.elementType=Z$,e.lanes=o,e;case hw:return Ev(r.children,n,o,t);case Wlt:s=8,n|=24;break;case H$:return e=lh(12,r,t,n|2),e.elementType=H$,e.lanes=o,e;case Y$:return e=lh(13,r,t,n),e.elementType=Y$,e.lanes=o,e;case X$:return e=lh(19,r,t,n),e.elementType=X$,e.lanes=o,e;default:if(typeof e==\"object\"&&e!==null)switch(e.$$typeof){case fg:s=10;break t;case qlt:s=9;break t;case jG:s=11;break t;case $G:s=14;break t;case Cy:s=16,i=null;break t}s=29,r=Error(Fe(130,e===null?\"null\":typeof e,\"\")),i=null}return t=lh(s,r,t,n),t.elementType=e,t.type=i,t.lanes=o,t}function Ev(e,t,r,i){return e=lh(7,e,i,t),e.lanes=r,e}function S$(e,t,r){return e=lh(6,e,null,t),e.lanes=r,e}function Ect(e){var t=lh(18,null,null,0);return t.stateNode=e,t}function M$(e,t,r){return t=lh(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fat=new WeakMap;function yd(e,t){if(typeof e==\"object\"&&e!==null){var r=Fat.get(e);return r!==void 0?r:(t={value:e,source:t,stack:yat(t)},Fat.set(e,t),t)}return{value:e,source:t,stack:yat(t)}}var vw=[],bw=0,P7=null,I5=0,md=[],gd=0,Xy=null,s0=1,a0=\"\";function hg(e,t){vw[bw++]=I5,vw[bw++]=P7,P7=e,I5=t}function Pct(e,t,r){md[gd++]=s0,md[gd++]=a0,md[gd++]=Xy,Xy=e;var i=s0;e=a0;var n=32-dh(i)-1;i&=~(1<<n),r+=1;var o=32-dh(t)+n;if(30<o){var s=n-n%5;o=(i&(1<<s)-1).toString(32),i>>=s,n-=s,s0=1<<32-dh(t)+n|r<<n|i,a0=o+e}else s0=1<<o|r<<n|i,a0=e}function iW(e){e.return!==null&&(hg(e,1),Pct(e,1,0))}function nW(e){for(;e===P7;)P7=vw[--bw],vw[bw]=null,I5=vw[--bw],vw[bw]=null;for(;e===Xy;)Xy=md[--gd],md[gd]=null,a0=md[--gd],md[gd]=null,s0=md[--gd],md[gd]=null}function Cct(e,t){md[gd++]=s0,md[gd++]=a0,md[gd++]=Xy,s0=t.id,a0=t.overflow,Xy=e}var Ml=null,No=null,nn=!1,Vy=null,_d=!1,uG=Error(Fe(519));function Zy(e){var t=Error(Fe(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\"text\":\"HTML\",\"\"));throw k5(yd(t,e)),uG}function Nat(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[Sl]=e,t[Au]=i,r){case\"dialog\":Gi(\"cancel\",t),Gi(\"close\",t);break;case\"iframe\":case\"object\":case\"embed\":Gi(\"load\",t);break;case\"video\":case\"audio\":for(r=0;r<L5.length;r++)Gi(L5[r],t);break;case\"source\":Gi(\"error\",t);break;case\"img\":case\"image\":case\"link\":Gi(\"error\",t),Gi(\"load\",t);break;case\"details\":Gi(\"toggle\",t);break;case\"input\":Gi(\"invalid\",t),oct(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case\"select\":Gi(\"invalid\",t);break;case\"textarea\":Gi(\"invalid\",t),act(t,i.value,i.defaultValue,i.children)}r=i.children,typeof r!=\"string\"&&typeof r!=\"number\"&&typeof r!=\"bigint\"||t.textContent===\"\"+r||i.suppressHydrationWarning===!0||hht(t.textContent,r)?(i.popover!=null&&(Gi(\"beforetoggle\",t),Gi(\"toggle\",t)),i.onScroll!=null&&Gi(\"scroll\",t),i.onScrollEnd!=null&&Gi(\"scrollend\",t),i.onClick!=null&&(t.onclick=pg),t=!0):t=!1,t||Zy(e,!0)}function zat(e){for(Ml=e.return;Ml;)switch(Ml.tag){case 5:case 31:case 13:_d=!1;return;case 27:case 3:_d=!0;return;default:Ml=Ml.return}}function aw(e){if(e!==Ml)return!1;if(!nn)return zat(e),nn=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!==\"form\"&&r!==\"button\")||LG(e.type,e.memoizedProps)),r=!r),r&&No&&Zy(e),zat(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Fe(317));No=Elt(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Fe(317));No=Elt(e)}else t===27?(t=No,t1(e.type)?(e=zG,zG=null,No=e):No=t):No=Ml?bd(e.stateNode.nextSibling):null;return!0}function kv(){No=Ml=null,nn=!1}function E$(){var e=Vy;return e!==null&&(mu===null?mu=e:mu.push.apply(mu,e),Vy=null),e}function k5(e){Vy===null?Vy=[e]:Vy.push(e)}var hG=u0(null),Uv=null,mg=null;function ky(e,t,r){To(hG,t._currentValue),t._currentValue=r}function Ag(e){e._currentValue=hG.current,Ja(hG)}function dG(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function fG(e,t,r,i){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var o=n.dependencies;if(o!==null){var s=n.child;o=o.firstContext;t:for(;o!==null;){var a=o;o=n;for(var h=0;h<t.length;h++)if(a.context===t[h]){o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),dG(o.return,r,e),i||(s=null);break t}o=a.next}}else if(n.tag===18){if(s=n.return,s===null)throw Error(Fe(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),dG(s,r,e),s=null}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===e){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}}function $w(e,t,r,i){e=null;for(var n=t,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var s=n.alternate;if(s===null)throw Error(Fe(387));if(s=s.memoizedProps,s!==null){var a=n.type;ph(n.pendingProps.value,s.value)||(e!==null?e.push(a):e=[a])}}else if(n===b7.current){if(s=n.alternate,s===null)throw Error(Fe(387));s.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(F5):e=[F5])}n=n.return}e!==null&&fG(t,e,r,i),t.flags|=262144}function C7(e){for(e=e.firstContext;e!==null;){if(!ph(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Rv(e){Uv=e,mg=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function El(e){return Ict(Uv,e)}function ZR(e,t){return Uv===null&&Rv(e),Ict(e,t)}function Ict(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},mg===null){if(e===null)throw Error(Fe(308));mg=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else mg=mg.next=t;return r}var dOt=typeof AbortController<\"u\"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},fOt=Ma.unstable_scheduleCallback,pOt=Ma.unstable_NormalPriority,da={$$typeof:fg,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oW(){return{controller:new dOt,data:new Map,refCount:0}}function q5(e){e.refCount--,e.refCount===0&&fOt(pOt,function(){e.controller.abort()})}var g5=null,pG=0,Dw=0,Mw=null;function mOt(e,t){if(g5===null){var r=g5=[];pG=0,Dw=IW(),Mw={status:\"pending\",value:void 0,then:function(i){r.push(i)}}}return pG++,t.then(Uat,Uat),t}function Uat(){if(--pG===0&&g5!==null){Mw!==null&&(Mw.status=\"fulfilled\");var e=g5;g5=null,Dw=0,Mw=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gOt(e,t){var r=[],i={status:\"pending\",value:null,reason:null,then:function(n){r.push(n)}};return e.then(function(){i.status=\"fulfilled\",i.value=t;for(var n=0;n<r.length;n++)(0,r[n])(t)},function(n){for(i.status=\"rejected\",i.reason=n,n=0;n<r.length;n++)(0,r[n])(void 0)}),i}var Vat=hi.S;hi.S=function(e,t){Gut=uh(),typeof t==\"object\"&&t!==null&&typeof t.then==\"function\"&&mOt(e,t),Vat!==null&&Vat(e,t)};var Pv=u0(null);function sW(){var e=Pv.current;return e!==null?e:uo.pooledCache}function h7(e,t){t===null?To(Pv,Pv.current):To(Pv,t.pool)}function kct(){var e=sW();return e===null?null:{parent:da._currentValue,pool:e}}var Gw=Error(Fe(460)),aW=Error(Fe(474)),rD=Error(Fe(542)),I7={then:function(){}};function jat(e){return e=e.status,e===\"fulfilled\"||e===\"rejected\"}function Rct(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(pg,pg),t=r),t.status){case\"fulfilled\":return t.value;case\"rejected\":throw e=t.reason,Gat(e),e;default:if(typeof t.status==\"string\")t.then(pg,pg);else{if(e=uo,e!==null&&100<e.shellSuspendCounter)throw Error(Fe(482));e=t,e.status=\"pending\",e.then(function(i){if(t.status===\"pending\"){var n=t;n.status=\"fulfilled\",n.value=i}},function(i){if(t.status===\"pending\"){var n=t;n.status=\"rejected\",n.reason=i}})}switch(t.status){case\"fulfilled\":return t.value;case\"rejected\":throw e=t.reason,Gat(e),e}throw Cv=t,Gw}}function Tv(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"?(Cv=r,Gw):r}}var Cv=null;function $at(){if(Cv===null)throw Error(Fe(459));var e=Cv;return Cv=null,e}function Gat(e){if(e===Gw||e===rD)throw Error(Fe(483))}var Ew=null,R5=0;function KR(e){var t=R5;return R5+=1,Ew===null&&(Ew=[]),Rct(Ew,e,t)}function i5(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function QR(e,t){throw t.$$typeof===rDt?Error(Fe(525)):(e=Object.prototype.toString.call(t),Error(Fe(31,e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e)))}function Dct(e){function t(H,Q){if(e){var tt=H.deletions;tt===null?(H.deletions=[Q],H.flags|=16):tt.push(Q)}}function r(H,Q){if(!e)return null;for(;Q!==null;)t(H,Q),Q=Q.sibling;return null}function i(H){for(var Q=new Map;H!==null;)H.key!==null?Q.set(H.key,H):Q.set(H.index,H),H=H.sibling;return Q}function n(H,Q){return H=gg(H,Q),H.index=0,H.sibling=null,H}function o(H,Q,tt){return H.index=tt,e?(tt=H.alternate,tt!==null?(tt=tt.index,tt<Q?(H.flags|=67108866,Q):tt):(H.flags|=67108866,Q)):(H.flags|=1048576,Q)}function s(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function a(H,Q,tt,rt){return Q===null||Q.tag!==6?(Q=S$(tt,H.mode,rt),Q.return=H,Q):(Q=n(Q,tt),Q.return=H,Q)}function h(H,Q,tt,rt){var at=tt.type;return at===hw?g(H,Q,tt.props.children,rt,tt.key):Q!==null&&(Q.elementType===at||typeof at==\"object\"&&at!==null&&at.$$typeof===Cy&&Tv(at)===Q.type)?(Q=n(Q,tt.props),i5(Q,tt),Q.return=H,Q):(Q=u7(tt.type,tt.key,tt.props,null,H.mode,rt),i5(Q,tt),Q.return=H,Q)}function p(H,Q,tt,rt){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==tt.containerInfo||Q.stateNode.implementation!==tt.implementation?(Q=M$(tt,H.mode,rt),Q.return=H,Q):(Q=n(Q,tt.children||[]),Q.return=H,Q)}function g(H,Q,tt,rt,at){return Q===null||Q.tag!==7?(Q=Ev(tt,H.mode,rt,at),Q.return=H,Q):(Q=n(Q,tt),Q.return=H,Q)}function w(H,Q,tt){if(typeof Q==\"string\"&&Q!==\"\"||typeof Q==\"number\"||typeof Q==\"bigint\")return Q=S$(\"\"+Q,H.mode,tt),Q.return=H,Q;if(typeof Q==\"object\"&&Q!==null){switch(Q.$$typeof){case jR:return tt=u7(Q.type,Q.key,Q.props,null,H.mode,tt),i5(tt,Q),tt.return=H,tt;case l5:return Q=M$(Q,H.mode,tt),Q.return=H,Q;case Cy:return Q=Tv(Q),w(H,Q,tt)}if(c5(Q)||e5(Q))return Q=Ev(Q,H.mode,tt,null),Q.return=H,Q;if(typeof Q.then==\"function\")return w(H,KR(Q),tt);if(Q.$$typeof===fg)return w(H,ZR(H,Q),tt);QR(H,Q)}return null}function C(H,Q,tt,rt){var at=Q!==null?Q.key:null;if(typeof tt==\"string\"&&tt!==\"\"||typeof tt==\"number\"||typeof tt==\"bigint\")return at!==null?null:a(H,Q,\"\"+tt,rt);if(typeof tt==\"object\"&&tt!==null){switch(tt.$$typeof){case jR:return tt.key===at?h(H,Q,tt,rt):null;case l5:return tt.key===at?p(H,Q,tt,rt):null;case Cy:return tt=Tv(tt),C(H,Q,tt,rt)}if(c5(tt)||e5(tt))return at!==null?null:g(H,Q,tt,rt,null);if(typeof tt.then==\"function\")return C(H,Q,KR(tt),rt);if(tt.$$typeof===fg)return C(H,Q,ZR(H,tt),rt);QR(H,tt)}return null}function R(H,Q,tt,rt,at){if(typeof rt==\"string\"&&rt!==\"\"||typeof rt==\"number\"||typeof rt==\"bigint\")return H=H.get(tt)||null,a(Q,H,\"\"+rt,at);if(typeof rt==\"object\"&&rt!==null){switch(rt.$$typeof){case jR:return H=H.get(rt.key===null?tt:rt.key)||null,h(Q,H,rt,at);case l5:return H=H.get(rt.key===null?tt:rt.key)||null,p(Q,H,rt,at);case Cy:return rt=Tv(rt),R(H,Q,tt,rt,at)}if(c5(rt)||e5(rt))return H=H.get(tt)||null,g(Q,H,rt,at,null);if(typeof rt.then==\"function\")return R(H,Q,tt,KR(rt),at);if(rt.$$typeof===fg)return R(H,Q,tt,ZR(Q,rt),at);QR(Q,rt)}return null}function z(H,Q,tt,rt){for(var at=null,et=null,lt=Q,J=Q=0,ft=null;lt!==null&&J<tt.length;J++){lt.index>J?(ft=lt,lt=null):ft=lt.sibling;var dt=C(H,lt,tt[J],rt);if(dt===null){lt===null&&(lt=ft);break}e&&lt&&dt.alternate===null&&t(H,lt),Q=o(dt,Q,J),et===null?at=dt:et.sibling=dt,et=dt,lt=ft}if(J===tt.length)return r(H,lt),nn&&hg(H,J),at;if(lt===null){for(;J<tt.length;J++)lt=w(H,tt[J],rt),lt!==null&&(Q=o(lt,Q,J),et===null?at=lt:et.sibling=lt,et=lt);return nn&&hg(H,J),at}for(lt=i(lt);J<tt.length;J++)ft=R(lt,H,J,tt[J],rt),ft!==null&&(e&&ft.alternate!==null&&lt.delete(ft.key===null?J:ft.key),Q=o(ft,Q,J),et===null?at=ft:et.sibling=ft,et=ft);return e&&lt.forEach(function(Mt){return t(H,Mt)}),nn&&hg(H,J),at}function W(H,Q,tt,rt){if(tt==null)throw Error(Fe(151));for(var at=null,et=null,lt=Q,J=Q=0,ft=null,dt=tt.next();lt!==null&&!dt.done;J++,dt=tt.next()){lt.index>J?(ft=lt,lt=null):ft=lt.sibling;var Mt=C(H,lt,dt.value,rt);if(Mt===null){lt===null&&(lt=ft);break}e&&lt&&Mt.alternate===null&&t(H,lt),Q=o(Mt,Q,J),et===null?at=Mt:et.sibling=Mt,et=Mt,lt=ft}if(dt.done)return r(H,lt),nn&&hg(H,J),at;if(lt===null){for(;!dt.done;J++,dt=tt.next())dt=w(H,dt.value,rt),dt!==null&&(Q=o(dt,Q,J),et===null?at=dt:et.sibling=dt,et=dt);return nn&&hg(H,J),at}for(lt=i(lt);!dt.done;J++,dt=tt.next())dt=R(lt,H,J,dt.value,rt),dt!==null&&(e&&dt.alternate!==null&&lt.delete(dt.key===null?J:dt.key),Q=o(dt,Q,J),et===null?at=dt:et.sibling=dt,et=dt);return e&&lt.forEach(function(Ft){return t(H,Ft)}),nn&&hg(H,J),at}function Y(H,Q,tt,rt){if(typeof tt==\"object\"&&tt!==null&&tt.type===hw&&tt.key===null&&(tt=tt.props.children),typeof tt==\"object\"&&tt!==null){switch(tt.$$typeof){case jR:t:{for(var at=tt.key;Q!==null;){if(Q.key===at){if(at=tt.type,at===hw){if(Q.tag===7){r(H,Q.sibling),rt=n(Q,tt.props.children),rt.return=H,H=rt;break t}}else if(Q.elementType===at||typeof at==\"object\"&&at!==null&&at.$$typeof===Cy&&Tv(at)===Q.type){r(H,Q.sibling),rt=n(Q,tt.props),i5(rt,tt),rt.return=H,H=rt;break t}r(H,Q);break}else t(H,Q);Q=Q.sibling}tt.type===hw?(rt=Ev(tt.props.children,H.mode,rt,tt.key),rt.return=H,H=rt):(rt=u7(tt.type,tt.key,tt.props,null,H.mode,rt),i5(rt,tt),rt.return=H,H=rt)}return s(H);case l5:t:{for(at=tt.key;Q!==null;){if(Q.key===at)if(Q.tag===4&&Q.stateNode.containerInfo===tt.containerInfo&&Q.stateNode.implementation===tt.implementation){r(H,Q.sibling),rt=n(Q,tt.children||[]),rt.return=H,H=rt;break t}else{r(H,Q);break}else t(H,Q);Q=Q.sibling}rt=M$(tt,H.mode,rt),rt.return=H,H=rt}return s(H);case Cy:return tt=Tv(tt),Y(H,Q,tt,rt)}if(c5(tt))return z(H,Q,tt,rt);if(e5(tt)){if(at=e5(tt),typeof at!=\"function\")throw Error(Fe(150));return tt=at.call(tt),W(H,Q,tt,rt)}if(typeof tt.then==\"function\")return Y(H,Q,KR(tt),rt);if(tt.$$typeof===fg)return Y(H,Q,ZR(H,tt),rt);QR(H,tt)}return typeof tt==\"string\"&&tt!==\"\"||typeof tt==\"number\"||typeof tt==\"bigint\"?(tt=\"\"+tt,Q!==null&&Q.tag===6?(r(H,Q.sibling),rt=n(Q,tt),rt.return=H,H=rt):(r(H,Q),rt=S$(tt,H.mode,rt),rt.return=H,H=rt),s(H)):r(H,Q)}return function(H,Q,tt,rt){try{R5=0;var at=Y(H,Q,tt,rt);return Ew=null,at}catch(lt){if(lt===Gw||lt===rD)throw lt;var et=lh(29,lt,null,H.mode);return et.lanes=rt,et.return=H,et}}}var Dv=Dct(!0),Oct=Dct(!1),Iy=!1;function lW(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mG(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function jy(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $y(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(En&2)!==0){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,t=E7(e),Sct(e,null,r),t}return eD(e,i,t,r),E7(e)}function A5(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Qlt(e,r)}}function P$(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var s={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};o===null?n=o=s:o=o.next=s,r=r.next}while(r!==null);o===null?n=o=t:o=o.next=t}else n=o=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var gG=!1;function y5(){if(gG){var e=Mw;if(e!==null)throw e}}function _5(e,t,r,i){gG=!1;var n=e.updateQueue;Iy=!1;var o=n.firstBaseUpdate,s=n.lastBaseUpdate,a=n.shared.pending;if(a!==null){n.shared.pending=null;var h=a,p=h.next;h.next=null,s===null?o=p:s.next=p,s=h;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==s&&(a===null?g.firstBaseUpdate=p:a.next=p,g.lastBaseUpdate=h))}if(o!==null){var w=n.baseState;s=0,g=p=h=null,a=o;do{var C=a.lane&-536870913,R=C!==a.lane;if(R?(Ki&C)===C:(i&C)===C){C!==0&&C===Dw&&(gG=!0),g!==null&&(g=g.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});t:{var z=e,W=a;C=t;var Y=r;switch(W.tag){case 1:if(z=W.payload,typeof z==\"function\"){w=z.call(Y,w,C);break t}w=z;break t;case 3:z.flags=z.flags&-65537|128;case 0:if(z=W.payload,C=typeof z==\"function\"?z.call(Y,w,C):z,C==null)break t;w=zo({},w,C);break t;case 2:Iy=!0}}C=a.callback,C!==null&&(e.flags|=64,R&&(e.flags|=8192),R=n.callbacks,R===null?n.callbacks=[C]:R.push(C))}else R={lane:C,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(p=g=R,h=w):g=g.next=R,s|=C;if(a=a.next,a===null){if(a=n.shared.pending,a===null)break;R=a,a=R.next,R.next=null,n.lastBaseUpdate=R,n.shared.pending=null}}while(!0);g===null&&(h=w),n.baseState=h,n.firstBaseUpdate=p,n.lastBaseUpdate=g,o===null&&(n.shared.lanes=0),Qy|=s,e.lanes=s,e.memoizedState=w}}function Lct(e,t){if(typeof e!=\"function\")throw Error(Fe(191,e));e.call(t)}function Bct(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Lct(r[e],t)}var Ow=u0(null),k7=u0(0);function Wat(e,t){e=wg,To(k7,e),To(Ow,t),wg=e|t.baseLanes}function AG(){To(k7,wg),To(Ow,Ow.current)}function cW(){wg=k7.current,Ja(Ow),Ja(k7)}var mh=u0(null),vd=null;function Ry(e){var t=e.alternate;To(Us,Us.current&1),To(mh,e),vd===null&&(t===null||Ow.current!==null||t.memoizedState!==null)&&(vd=e)}function yG(e){To(Us,Us.current),To(mh,e),vd===null&&(vd=e)}function Fct(e){e.tag===22?(To(Us,Us.current),To(mh,e),vd===null&&(vd=e)):Dy(e)}function Dy(){To(Us,Us.current),To(mh,mh.current)}function ah(e){Ja(mh),vd===e&&(vd=null),Ja(Us)}var Us=u0(0);function R7(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||FG(r)||NG(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===\"forwards\"||t.memoizedProps.revealOrder===\"backwards\"||t.memoizedProps.revealOrder===\"unstable_legacy-backwards\"||t.memoizedProps.revealOrder===\"together\")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vg=0,Ri=null,Kn=null,ua=null,D7=!1,Pw=!1,Ov=!1,O7=0,D5=0,Cw=null,AOt=0;function gs(){throw Error(Fe(321))}function uW(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!ph(e[r],t[r]))return!1;return!0}function hW(e,t,r,i,n,o){return vg=o,Ri=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,hi.H=e===null||e.memoizedState===null?put:xW,Ov=!1,o=r(i,n),Ov=!1,Pw&&(o=zct(t,r,i,n)),Nct(e),o}function Nct(e){hi.H=O5;var t=Kn!==null&&Kn.next!==null;if(vg=0,ua=Kn=Ri=null,D7=!1,D5=0,Cw=null,t)throw Error(Fe(300));e===null||fa||(e=e.dependencies,e!==null&&C7(e)&&(fa=!0))}function zct(e,t,r,i){Ri=e;var n=0;do{if(Pw&&(Cw=null),D5=0,Pw=!1,25<=n)throw Error(Fe(301));if(n+=1,ua=Kn=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}hi.H=mut,o=t(r,i)}while(Pw);return o}function yOt(){var e=hi.H,t=e.useState()[0];return t=typeof t.then==\"function\"?H5(t):t,e=e.useState()[0],(Kn!==null?Kn.memoizedState:null)!==e&&(Ri.flags|=1024),t}function dW(){var e=O7!==0;return O7=0,e}function fW(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function pW(e){if(D7){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}D7=!1}vg=0,ua=Kn=Ri=null,Pw=!1,D5=O7=0,Cw=null}function Pc(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ua===null?Ri.memoizedState=ua=e:ua=ua.next=e,ua}function Vs(){if(Kn===null){var e=Ri.alternate;e=e!==null?e.memoizedState:null}else e=Kn.next;var t=ua===null?Ri.memoizedState:ua.next;if(t!==null)ua=t,Kn=e;else{if(e===null)throw Ri.alternate===null?Error(Fe(467)):Error(Fe(310));Kn=e,e={memoizedState:Kn.memoizedState,baseState:Kn.baseState,baseQueue:Kn.baseQueue,queue:Kn.queue,next:null},ua===null?Ri.memoizedState=ua=e:ua=ua.next=e}return ua}function iD(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function H5(e){var t=D5;return D5+=1,Cw===null&&(Cw=[]),e=Rct(Cw,e,t),t=Ri,(ua===null?t.memoizedState:ua.next)===null&&(t=t.alternate,hi.H=t===null||t.memoizedState===null?put:xW),e}function nD(e){if(e!==null&&typeof e==\"object\"){if(typeof e.then==\"function\")return H5(e);if(e.$$typeof===fg)return El(e)}throw Error(Fe(438,String(e)))}function mW(e){var t=null,r=Ri.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=Ri.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=iD(),Ri.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=iDt;return t.index++,r}function bg(e,t){return typeof t==\"function\"?t(e):t}function d7(e){var t=Vs();return gW(t,Kn,e)}function gW(e,t,r){var i=e.queue;if(i===null)throw Error(Fe(311));i.lastRenderedReducer=r;var n=e.baseQueue,o=i.pending;if(o!==null){if(n!==null){var s=n.next;n.next=o.next,o.next=s}t.baseQueue=n=o,i.pending=null}if(o=e.baseState,n===null)e.memoizedState=o;else{t=n.next;var a=s=null,h=null,p=t,g=!1;do{var w=p.lane&-536870913;if(w!==p.lane?(Ki&w)===w:(vg&w)===w){var C=p.revertLane;if(C===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),w===Dw&&(g=!0);else if((vg&C)===C){p=p.next,C===Dw&&(g=!0);continue}else w={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},h===null?(a=h=w,s=o):h=h.next=w,Ri.lanes|=C,Qy|=C;w=p.action,Ov&&r(o,w),o=p.hasEagerState?p.eagerState:r(o,w)}else C={lane:w,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},h===null?(a=h=C,s=o):h=h.next=C,Ri.lanes|=w,Qy|=w;p=p.next}while(p!==null&&p!==t);if(h===null?s=o:h.next=a,!ph(o,e.memoizedState)&&(fa=!0,g&&(r=Mw,r!==null)))throw r;e.memoizedState=o,e.baseState=s,e.baseQueue=h,i.lastRenderedState=o}return n===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function C$(e){var t=Vs(),r=t.queue;if(r===null)throw Error(Fe(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,o=t.memoizedState;if(n!==null){r.pending=null;var s=n=n.next;do o=e(o,s.action),s=s.next;while(s!==n);ph(o,t.memoizedState)||(fa=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,i]}function Uct(e,t,r){var i=Ri,n=Vs(),o=nn;if(o){if(r===void 0)throw Error(Fe(407));r=r()}else r=t();var s=!ph((Kn||n).memoizedState,r);if(s&&(n.memoizedState=r,fa=!0),n=n.queue,AW($ct.bind(null,i,n,e),[e]),n.getSnapshot!==t||s||ua!==null&&ua.memoizedState.tag&1){if(i.flags|=2048,Lw(9,{destroy:void 0},jct.bind(null,i,n,r,t),null),uo===null)throw Error(Fe(349));o||(vg&127)!==0||Vct(i,t,r)}return r}function Vct(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ri.updateQueue,t===null?(t=iD(),Ri.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function jct(e,t,r,i){t.value=r,t.getSnapshot=i,Gct(t)&&Wct(e)}function $ct(e,t,r){return r(function(){Gct(t)&&Wct(e)})}function Gct(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ph(e,r)}catch{return!0}}function Wct(e){var t=zv(e,2);t!==null&&gu(t,e,2)}function _G(e){var t=Pc();if(typeof e==\"function\"){var r=e;if(e=r(),Ov){Ly(!0);try{r()}finally{Ly(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bg,lastRenderedState:e},t}function qct(e,t,r,i){return e.baseState=r,gW(e,Kn,typeof i==\"function\"?i:bg)}function _Ot(e,t,r,i,n){if(sD(e))throw Error(Fe(485));if(e=t.action,e!==null){var o={payload:n,action:e,next:null,isTransition:!0,status:\"pending\",value:null,reason:null,listeners:[],then:function(s){o.listeners.push(s)}};hi.T!==null?r(!0):o.isTransition=!1,i(o),r=t.pending,r===null?(o.next=t.pending=o,Hct(t,o)):(o.next=r.next,t.pending=r.next=o)}}function Hct(e,t){var r=t.action,i=t.payload,n=e.state;if(t.isTransition){var o=hi.T,s={};hi.T=s;try{var a=r(n,i),h=hi.S;h!==null&&h(s,a),qat(e,t,a)}catch(p){vG(e,t,p)}finally{o!==null&&s.types!==null&&(o.types=s.types),hi.T=o}}else try{o=r(n,i),qat(e,t,o)}catch(p){vG(e,t,p)}}function qat(e,t,r){r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"?r.then(function(i){Hat(e,t,i)},function(i){return vG(e,t,i)}):Hat(e,t,r)}function Hat(e,t,r){t.status=\"fulfilled\",t.value=r,Yct(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Hct(e,r)))}function vG(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status=\"rejected\",t.reason=r,Yct(t),t=t.next;while(t!==i)}e.action=null}function Yct(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xct(e,t){return t}function Yat(e,t){if(nn){var r=uo.formState;if(r!==null){t:{var i=Ri;if(nn){if(No){e:{for(var n=No,o=_d;n.nodeType!==8;){if(!o){n=null;break e}if(n=bd(n.nextSibling),n===null){n=null;break e}}o=n.data,n=o===\"F!\"||o===\"F\"?n:null}if(n){No=bd(n.nextSibling),i=n.data===\"F!\";break t}}Zy(i)}i=!1}i&&(t=r[0])}}return r=Pc(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xct,lastRenderedState:t},r.queue=i,r=hut.bind(null,Ri,i),i.dispatch=r,i=_G(!1),o=bW.bind(null,Ri,!1,i.queue),i=Pc(),n={state:t,dispatch:null,action:e,pending:null},i.queue=n,r=_Ot.bind(null,Ri,n,o,r),n.dispatch=r,i.memoizedState=e,[t,r,!1]}function Xat(e){var t=Vs();return Zct(t,Kn,e)}function Zct(e,t,r){if(t=gW(e,t,Xct)[0],e=d7(bg)[0],typeof t==\"object\"&&t!==null&&typeof t.then==\"function\")try{var i=H5(t)}catch(s){throw s===Gw?rD:s}else i=t;t=Vs();var n=t.queue,o=n.dispatch;return r!==t.memoizedState&&(Ri.flags|=2048,Lw(9,{destroy:void 0},vOt.bind(null,n,r),null)),[i,o,e]}function vOt(e,t){e.action=t}function Zat(e){var t=Vs(),r=Kn;if(r!==null)return Zct(t,r,e);Vs(),t=t.memoizedState,r=Vs();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function Lw(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=Ri.updateQueue,t===null&&(t=iD(),Ri.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function Kct(){return Vs().memoizedState}function f7(e,t,r,i){var n=Pc();Ri.flags|=e,n.memoizedState=Lw(1|t,{destroy:void 0},r,i===void 0?null:i)}function oD(e,t,r,i){var n=Vs();i=i===void 0?null:i;var o=n.memoizedState.inst;Kn!==null&&i!==null&&uW(i,Kn.memoizedState.deps)?n.memoizedState=Lw(t,o,r,i):(Ri.flags|=e,n.memoizedState=Lw(1|t,o,r,i))}function Kat(e,t){f7(8390656,8,e,t)}function AW(e,t){oD(2048,8,e,t)}function bOt(e){Ri.flags|=4;var t=Ri.updateQueue;if(t===null)t=iD(),Ri.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Qct(e){var t=Vs().memoizedState;return bOt({ref:t,nextImpl:e}),function(){if((En&2)!==0)throw Error(Fe(440));return t.impl.apply(void 0,arguments)}}function Jct(e,t){return oD(4,2,e,t)}function tut(e,t){return oD(4,4,e,t)}function eut(e,t){if(typeof t==\"function\"){e=e();var r=t(e);return function(){typeof r==\"function\"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rut(e,t,r){r=r!=null?r.concat([e]):null,oD(4,4,eut.bind(null,t,e),r)}function yW(){}function iut(e,t){var r=Vs();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&uW(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function nut(e,t){var r=Vs();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&uW(t,i[1]))return i[0];if(i=e(),Ov){Ly(!0);try{e()}finally{Ly(!1)}}return r.memoizedState=[i,t],i}function _W(e,t,r){return r===void 0||(vg&1073741824)!==0&&(Ki&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=qut(),Ri.lanes|=e,Qy|=e,r)}function out(e,t,r,i){return ph(r,t)?r:Ow.current!==null?(e=_W(e,r,i),ph(e,t)||(fa=!0),e):(vg&42)===0||(vg&1073741824)!==0&&(Ki&261930)===0?(fa=!0,e.memoizedState=r):(e=qut(),Ri.lanes|=e,Qy|=e,t)}function sut(e,t,r,i,n){var o=Pn.p;Pn.p=o!==0&&8>o?o:8;var s=hi.T,a={};hi.T=a,bW(e,!1,t,r);try{var h=n(),p=hi.S;if(p!==null&&p(a,h),h!==null&&typeof h==\"object\"&&typeof h.then==\"function\"){var g=gOt(h,i);v5(e,t,g,fh(e))}else v5(e,t,i,fh(e))}catch(w){v5(e,t,{then:function(){},status:\"rejected\",reason:w},fh())}finally{Pn.p=o,s!==null&&a.types!==null&&(s.types=a.types),hi.T=s}}function xOt(){}function bG(e,t,r,i){if(e.tag!==5)throw Error(Fe(476));var n=aut(e).queue;sut(e,n,t,Mv,r===null?xOt:function(){return lut(e),r(i)})}function aut(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Mv,baseState:Mv,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bg,lastRenderedState:Mv},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bg,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lut(e){var t=aut(e);t.next===null&&(t=e.alternate.memoizedState),v5(e,t.next.queue,{},fh())}function vW(){return El(F5)}function cut(){return Vs().memoizedState}function uut(){return Vs().memoizedState}function wOt(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=fh();e=jy(r);var i=$y(t,e,r);i!==null&&(gu(i,t,r),A5(i,t,r)),t={cache:oW()},e.payload=t;return}t=t.return}}function TOt(e,t,r){var i=fh();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sD(e)?dut(t,r):(r=eW(e,t,r,i),r!==null&&(gu(r,e,i),fut(r,t,i)))}function hut(e,t,r){var i=fh();v5(e,t,r,i)}function v5(e,t,r,i){var n={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(sD(e))dut(t,n);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,r);if(n.hasEagerState=!0,n.eagerState=a,ph(a,s))return eD(e,t,n,0),uo===null&&tD(),!1}catch{}if(r=eW(e,t,n,i),r!==null)return gu(r,e,i),fut(r,t,i),!0}return!1}function bW(e,t,r,i){if(i={lane:2,revertLane:IW(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},sD(e)){if(t)throw Error(Fe(479))}else t=eW(e,r,i,2),t!==null&&gu(t,e,2)}function sD(e){var t=e.alternate;return e===Ri||t!==null&&t===Ri}function dut(e,t){Pw=D7=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function fut(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Qlt(e,r)}}var O5={readContext:El,use:nD,useCallback:gs,useContext:gs,useEffect:gs,useImperativeHandle:gs,useLayoutEffect:gs,useInsertionEffect:gs,useMemo:gs,useReducer:gs,useRef:gs,useState:gs,useDebugValue:gs,useDeferredValue:gs,useTransition:gs,useSyncExternalStore:gs,useId:gs,useHostTransitionStatus:gs,useFormState:gs,useActionState:gs,useOptimistic:gs,useMemoCache:gs,useCacheRefresh:gs};O5.useEffectEvent=gs;var put={readContext:El,use:nD,useCallback:function(e,t){return Pc().memoizedState=[e,t===void 0?null:t],e},useContext:El,useEffect:Kat,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,f7(4194308,4,eut.bind(null,t,e),r)},useLayoutEffect:function(e,t){return f7(4194308,4,e,t)},useInsertionEffect:function(e,t){f7(4,2,e,t)},useMemo:function(e,t){var r=Pc();t=t===void 0?null:t;var i=e();if(Ov){Ly(!0);try{e()}finally{Ly(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=Pc();if(r!==void 0){var n=r(t);if(Ov){Ly(!0);try{r(t)}finally{Ly(!1)}}}else n=t;return i.memoizedState=i.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=TOt.bind(null,Ri,e),[i.memoizedState,e]},useRef:function(e){var t=Pc();return e={current:e},t.memoizedState=e},useState:function(e){e=_G(e);var t=e.queue,r=hut.bind(null,Ri,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:yW,useDeferredValue:function(e,t){var r=Pc();return _W(r,e,t)},useTransition:function(){var e=_G(!1);return e=sut.bind(null,Ri,e.queue,!0,!1),Pc().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=Ri,n=Pc();if(nn){if(r===void 0)throw Error(Fe(407));r=r()}else{if(r=t(),uo===null)throw Error(Fe(349));(Ki&127)!==0||Vct(i,t,r)}n.memoizedState=r;var o={value:r,getSnapshot:t};return n.queue=o,Kat($ct.bind(null,i,o,e),[e]),i.flags|=2048,Lw(9,{destroy:void 0},jct.bind(null,i,o,r,t),null),r},useId:function(){var e=Pc(),t=uo.identifierPrefix;if(nn){var r=a0,i=s0;r=(i&~(1<<32-dh(i)-1)).toString(32)+r,t=\"_\"+t+\"R_\"+r,r=O7++,0<r&&(t+=\"H\"+r.toString(32)),t+=\"_\"}else r=AOt++,t=\"_\"+t+\"r_\"+r.toString(32)+\"_\";return e.memoizedState=t},useHostTransitionStatus:vW,useFormState:Yat,useActionState:Yat,useOptimistic:function(e){var t=Pc();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=bW.bind(null,Ri,!0,r),r.dispatch=t,[e,t]},useMemoCache:mW,useCacheRefresh:function(){return Pc().memoizedState=wOt.bind(null,Ri)},useEffectEvent:function(e){var t=Pc(),r={impl:e};return t.memoizedState=r,function(){if((En&2)!==0)throw Error(Fe(440));return r.impl.apply(void 0,arguments)}}},xW={readContext:El,use:nD,useCallback:iut,useContext:El,useEffect:AW,useImperativeHandle:rut,useInsertionEffect:Jct,useLayoutEffect:tut,useMemo:nut,useReducer:d7,useRef:Kct,useState:function(){return d7(bg)},useDebugValue:yW,useDeferredValue:function(e,t){var r=Vs();return out(r,Kn.memoizedState,e,t)},useTransition:function(){var e=d7(bg)[0],t=Vs().memoizedState;return[typeof e==\"boolean\"?e:H5(e),t]},useSyncExternalStore:Uct,useId:cut,useHostTransitionStatus:vW,useFormState:Xat,useActionState:Xat,useOptimistic:function(e,t){var r=Vs();return qct(r,Kn,e,t)},useMemoCache:mW,useCacheRefresh:uut};xW.useEffectEvent=Qct;var mut={readContext:El,use:nD,useCallback:iut,useContext:El,useEffect:AW,useImperativeHandle:rut,useInsertionEffect:Jct,useLayoutEffect:tut,useMemo:nut,useReducer:C$,useRef:Kct,useState:function(){return C$(bg)},useDebugValue:yW,useDeferredValue:function(e,t){var r=Vs();return Kn===null?_W(r,e,t):out(r,Kn.memoizedState,e,t)},useTransition:function(){var e=C$(bg)[0],t=Vs().memoizedState;return[typeof e==\"boolean\"?e:H5(e),t]},useSyncExternalStore:Uct,useId:cut,useHostTransitionStatus:vW,useFormState:Zat,useActionState:Zat,useOptimistic:function(e,t){var r=Vs();return Kn!==null?qct(r,Kn,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:mW,useCacheRefresh:uut};mut.useEffectEvent=Qct;function I$(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:zo({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xG={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=fh(),n=jy(i);n.payload=t,r!=null&&(n.callback=r),t=$y(e,n,i),t!==null&&(gu(t,e,i),A5(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=fh(),n=jy(i);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=$y(e,n,i),t!==null&&(gu(t,e,i),A5(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=fh(),i=jy(r);i.tag=2,t!=null&&(i.callback=t),t=$y(e,i,r),t!==null&&(gu(t,e,r),A5(t,e,r))}};function Qat(e,t,r,i,n,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate==\"function\"?e.shouldComponentUpdate(i,o,s):t.prototype&&t.prototype.isPureReactComponent?!C5(r,i)||!C5(n,o):!0}function Jat(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps==\"function\"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps==\"function\"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&xG.enqueueReplaceState(t,t.state,null)}function Lv(e,t){var r=t;if(\"ref\"in t){r={};for(var i in t)i!==\"ref\"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=zo({},r));for(var n in e)r[n]===void 0&&(r[n]=e[n])}return r}function gut(e){M7(e)}function Aut(e){console.error(e)}function yut(e){M7(e)}function L7(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function tlt(e,t,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function wG(e,t,r){return r=jy(r),r.tag=3,r.payload={element:null},r.callback=function(){L7(e,t)},r}function _ut(e){return e=jy(e),e.tag=3,e}function vut(e,t,r,i){var n=r.type.getDerivedStateFromError;if(typeof n==\"function\"){var o=i.value;e.payload=function(){return n(o)},e.callback=function(){tlt(t,r,i)}}var s=r.stateNode;s!==null&&typeof s.componentDidCatch==\"function\"&&(e.callback=function(){tlt(t,r,i),typeof n!=\"function\"&&(Gy===null?Gy=new Set([this]):Gy.add(this));var a=i.stack;this.componentDidCatch(i.value,{componentStack:a!==null?a:\"\"})})}function SOt(e,t,r,i,n){if(r.flags|=32768,i!==null&&typeof i==\"object\"&&typeof i.then==\"function\"){if(t=r.alternate,t!==null&&$w(t,r,n,!0),r=mh.current,r!==null){switch(r.tag){case 31:case 13:return vd===null?U7():r.alternate===null&&As===0&&(As=3),r.flags&=-257,r.flags|=65536,r.lanes=n,i===I7?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),V$(e,i,n)),!1;case 22:return r.flags|=65536,i===I7?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),V$(e,i,n)),!1}throw Error(Fe(435,r.tag))}return V$(e,i,n),U7(),!1}if(nn)return t=mh.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,i!==uG&&(e=Error(Fe(422),{cause:i}),k5(yd(e,r)))):(i!==uG&&(t=Error(Fe(423),{cause:i}),k5(yd(t,r))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,i=yd(i,r),n=wG(e.stateNode,i,n),P$(e,n),As!==4&&(As=2)),!1;var o=Error(Fe(520),{cause:i});if(o=yd(o,r),w5===null?w5=[o]:w5.push(o),As!==4&&(As=2),t===null)return!0;i=yd(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=n&-n,r.lanes|=e,e=wG(r.stateNode,i,e),P$(r,e),!1;case 1:if(t=r.type,o=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError==\"function\"||o!==null&&typeof o.componentDidCatch==\"function\"&&(Gy===null||!Gy.has(o))))return r.flags|=65536,n&=-n,r.lanes|=n,n=_ut(n),vut(n,e,r,i),P$(r,n),!1}r=r.return}while(r!==null);return!1}var wW=Error(Fe(461)),fa=!1;function Tl(e,t,r,i){t.child=e===null?Oct(t,null,r,i):Dv(t,e.child,r,i)}function elt(e,t,r,i,n){r=r.render;var o=t.ref;if(\"ref\"in i){var s={};for(var a in i)a!==\"ref\"&&(s[a]=i[a])}else s=i;return Rv(t),i=hW(e,t,r,s,o,n),a=dW(),e!==null&&!fa?(fW(e,t,n),xg(e,t,n)):(nn&&a&&iW(t),t.flags|=1,Tl(e,t,i,n),t.child)}function rlt(e,t,r,i,n){if(e===null){var o=r.type;return typeof o==\"function\"&&!rW(o)&&o.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=o,but(e,t,o,i,n)):(e=u7(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!TW(e,n)){var s=o.memoizedProps;if(r=r.compare,r=r!==null?r:C5,r(s,i)&&e.ref===t.ref)return xg(e,t,n)}return t.flags|=1,e=gg(o,i),e.ref=t.ref,e.return=t,t.child=e}function but(e,t,r,i,n){if(e!==null){var o=e.memoizedProps;if(C5(o,i)&&e.ref===t.ref)if(fa=!1,t.pendingProps=i=o,TW(e,n))(e.flags&131072)!==0&&(fa=!0);else return t.lanes=e.lanes,xg(e,t,n)}return TG(e,t,r,i,n)}function xut(e,t,r,i){var n=i.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode===\"hidden\"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|r:r,e!==null){for(i=t.child=e.child,n=0;i!==null;)n=n|i.lanes|i.childLanes,i=i.sibling;i=n&~o}else i=0,t.child=null;return ilt(e,t,o,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&h7(t,o!==null?o.cachePool:null),o!==null?Wat(t,o):AG(),Fct(t);else return i=t.lanes=536870912,ilt(e,t,o!==null?o.baseLanes|r:r,r,i)}else o!==null?(h7(t,o.cachePool),Wat(t,o),Dy(t),t.memoizedState=null):(e!==null&&h7(t,null),AG(),Dy(t));return Tl(e,t,n,r),t.child}function h5(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ilt(e,t,r,i,n){var o=sW();return o=o===null?null:{parent:da._currentValue,pool:o},t.memoizedState={baseLanes:r,cachePool:o},e!==null&&h7(t,null),AG(),Fct(t),e!==null&&$w(e,t,i,!0),t.childLanes=n,null}function p7(e,t){return t=B7({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nlt(e,t,r){return Dv(t,e.child,null,r),e=p7(t,t.pendingProps),e.flags|=2,ah(t),t.memoizedState=null,e}function MOt(e,t,r){var i=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nn){if(i.mode===\"hidden\")return e=p7(t,i),t.lanes=536870912,h5(null,e);if(yG(t),(e=No)?(e=pht(e,_d),e=e!==null&&e.data===\"&\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xy!==null?{id:s0,overflow:a0}:null,retryLane:536870912,hydrationErrors:null},r=Ect(e),r.return=t,t.child=r,Ml=t,No=null)):e=null,e===null)throw Zy(t);return t.lanes=536870912,null}return p7(t,i)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(yG(t),n)if(t.flags&256)t.flags&=-257,t=nlt(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Fe(558));else if(fa||$w(e,t,r,!1),n=(r&e.childLanes)!==0,fa||n){if(i=uo,i!==null&&(s=Jlt(i,r),s!==0&&s!==o.retryLane))throw o.retryLane=s,zv(e,s),gu(i,e,s),wW;U7(),t=nlt(e,t,r)}else e=o.treeContext,No=bd(s.nextSibling),Ml=t,nn=!0,Vy=null,_d=!1,e!==null&&Cct(t,e),t=p7(t,i),t.flags|=4096;return t}return e=gg(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function m7(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!=\"function\"&&typeof r!=\"object\")throw Error(Fe(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function TG(e,t,r,i,n){return Rv(t),r=hW(e,t,r,i,void 0,n),i=dW(),e!==null&&!fa?(fW(e,t,n),xg(e,t,n)):(nn&&i&&iW(t),t.flags|=1,Tl(e,t,r,n),t.child)}function olt(e,t,r,i,n,o){return Rv(t),t.updateQueue=null,r=zct(t,i,r,n),Nct(e),i=dW(),e!==null&&!fa?(fW(e,t,o),xg(e,t,o)):(nn&&i&&iW(t),t.flags|=1,Tl(e,t,r,o),t.child)}function slt(e,t,r,i,n){if(Rv(t),t.stateNode===null){var o=_w,s=r.contextType;typeof s==\"object\"&&s!==null&&(o=El(s)),o=new r(i,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=xG,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=i,o.state=t.memoizedState,o.refs={},lW(t),s=r.contextType,o.context=typeof s==\"object\"&&s!==null?El(s):_w,o.state=t.memoizedState,s=r.getDerivedStateFromProps,typeof s==\"function\"&&(I$(t,r,s,i),o.state=t.memoizedState),typeof r.getDerivedStateFromProps==\"function\"||typeof o.getSnapshotBeforeUpdate==\"function\"||typeof o.UNSAFE_componentWillMount!=\"function\"&&typeof o.componentWillMount!=\"function\"||(s=o.state,typeof o.componentWillMount==\"function\"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==\"function\"&&o.UNSAFE_componentWillMount(),s!==o.state&&xG.enqueueReplaceState(o,o.state,null),_5(t,i,o,n),y5(),o.state=t.memoizedState),typeof o.componentDidMount==\"function\"&&(t.flags|=4194308),i=!0}else if(e===null){o=t.stateNode;var a=t.memoizedProps,h=Lv(r,a);o.props=h;var p=o.context,g=r.contextType;s=_w,typeof g==\"object\"&&g!==null&&(s=El(g));var w=r.getDerivedStateFromProps;g=typeof w==\"function\"||typeof o.getSnapshotBeforeUpdate==\"function\",a=t.pendingProps!==a,g||typeof o.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof o.componentWillReceiveProps!=\"function\"||(a||p!==s)&&Jat(t,o,i,s),Iy=!1;var C=t.memoizedState;o.state=C,_5(t,i,o,n),y5(),p=t.memoizedState,a||C!==p||Iy?(typeof w==\"function\"&&(I$(t,r,w,i),p=t.memoizedState),(h=Iy||Qat(t,r,h,i,C,p,s))?(g||typeof o.UNSAFE_componentWillMount!=\"function\"&&typeof o.componentWillMount!=\"function\"||(typeof o.componentWillMount==\"function\"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==\"function\"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==\"function\"&&(t.flags|=4194308)):(typeof o.componentDidMount==\"function\"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=p),o.props=i,o.state=p,o.context=s,i=h):(typeof o.componentDidMount==\"function\"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,mG(e,t),s=t.memoizedProps,g=Lv(r,s),o.props=g,w=t.pendingProps,C=o.context,p=r.contextType,h=_w,typeof p==\"object\"&&p!==null&&(h=El(p)),a=r.getDerivedStateFromProps,(p=typeof a==\"function\"||typeof o.getSnapshotBeforeUpdate==\"function\")||typeof o.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof o.componentWillReceiveProps!=\"function\"||(s!==w||C!==h)&&Jat(t,o,i,h),Iy=!1,C=t.memoizedState,o.state=C,_5(t,i,o,n),y5();var R=t.memoizedState;s!==w||C!==R||Iy||e!==null&&e.dependencies!==null&&C7(e.dependencies)?(typeof a==\"function\"&&(I$(t,r,a,i),R=t.memoizedState),(g=Iy||Qat(t,r,g,i,C,R,h)||e!==null&&e.dependencies!==null&&C7(e.dependencies))?(p||typeof o.UNSAFE_componentWillUpdate!=\"function\"&&typeof o.componentWillUpdate!=\"function\"||(typeof o.componentWillUpdate==\"function\"&&o.componentWillUpdate(i,R,h),typeof o.UNSAFE_componentWillUpdate==\"function\"&&o.UNSAFE_componentWillUpdate(i,R,h)),typeof o.componentDidUpdate==\"function\"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==\"function\"&&(t.flags|=1024)):(typeof o.componentDidUpdate!=\"function\"||s===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=\"function\"||s===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=R),o.props=i,o.state=R,o.context=h,i=g):(typeof o.componentDidUpdate!=\"function\"||s===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=\"function\"||s===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,m7(e,t),i=(t.flags&128)!==0,o||i?(o=t.stateNode,r=i&&typeof r.getDerivedStateFromError!=\"function\"?null:o.render(),t.flags|=1,e!==null&&i?(t.child=Dv(t,e.child,null,n),t.child=Dv(t,null,r,n)):Tl(e,t,r,n),t.memoizedState=o.state,e=t.child):e=xg(e,t,n),e}function alt(e,t,r,i){return kv(),t.flags|=256,Tl(e,t,r,i),t.child}var k$={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function R$(e){return{baseLanes:e,cachePool:kct()}}function D$(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=ch),e}function wut(e,t,r){var i=t.pendingProps,n=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(Us.current&2)!==0),s&&(n=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(nn){if(n?Ry(t):Dy(t),(e=No)?(e=pht(e,_d),e=e!==null&&e.data!==\"&\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xy!==null?{id:s0,overflow:a0}:null,retryLane:536870912,hydrationErrors:null},r=Ect(e),r.return=t,t.child=r,Ml=t,No=null)):e=null,e===null)throw Zy(t);return NG(e)?t.lanes=32:t.lanes=536870912,null}var a=i.children;return i=i.fallback,n?(Dy(t),n=t.mode,a=B7({mode:\"hidden\",children:a},n),i=Ev(i,n,r,null),a.return=t,i.return=t,a.sibling=i,t.child=a,i=t.child,i.memoizedState=R$(r),i.childLanes=D$(e,s,r),t.memoizedState=k$,h5(null,i)):(Ry(t),SG(t,a))}var h=e.memoizedState;if(h!==null&&(a=h.dehydrated,a!==null)){if(o)t.flags&256?(Ry(t),t.flags&=-257,t=O$(e,t,r)):t.memoizedState!==null?(Dy(t),t.child=e.child,t.flags|=128,t=null):(Dy(t),a=i.fallback,n=t.mode,i=B7({mode:\"visible\",children:i.children},n),a=Ev(a,n,r,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,Dv(t,e.child,null,r),i=t.child,i.memoizedState=R$(r),i.childLanes=D$(e,s,r),t.memoizedState=k$,t=h5(null,i));else if(Ry(t),NG(a)){if(s=a.nextSibling&&a.nextSibling.dataset,s)var p=s.dgst;s=p,i=Error(Fe(419)),i.stack=\"\",i.digest=s,k5({value:i,source:null,stack:null}),t=O$(e,t,r)}else if(fa||$w(e,t,r,!1),s=(r&e.childLanes)!==0,fa||s){if(s=uo,s!==null&&(i=Jlt(s,r),i!==0&&i!==h.retryLane))throw h.retryLane=i,zv(e,i),gu(s,e,i),wW;FG(a)||U7(),t=O$(e,t,r)}else FG(a)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,No=bd(a.nextSibling),Ml=t,nn=!0,Vy=null,_d=!1,e!==null&&Cct(t,e),t=SG(t,i.children),t.flags|=4096);return t}return n?(Dy(t),a=i.fallback,n=t.mode,h=e.child,p=h.sibling,i=gg(h,{mode:\"hidden\",children:i.children}),i.subtreeFlags=h.subtreeFlags&65011712,p!==null?a=gg(p,a):(a=Ev(a,n,r,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,h5(null,i),i=t.child,a=e.child.memoizedState,a===null?a=R$(r):(n=a.cachePool,n!==null?(h=da._currentValue,n=n.parent!==h?{parent:h,pool:h}:n):n=kct(),a={baseLanes:a.baseLanes|r,cachePool:n}),i.memoizedState=a,i.childLanes=D$(e,s,r),t.memoizedState=k$,h5(e.child,i)):(Ry(t),r=e.child,e=r.sibling,r=gg(r,{mode:\"visible\",children:i.children}),r.return=t,r.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=r,t.memoizedState=null,r)}function SG(e,t){return t=B7({mode:\"visible\",children:t},e.mode),t.return=e,e.child=t}function B7(e,t){return e=lh(22,e,null,t),e.lanes=0,e}function O$(e,t,r){return Dv(t,e.child,null,r),e=SG(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function llt(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),dG(e.return,t,r)}function L$(e,t,r,i,n,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n,treeForkCount:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=r,s.tailMode=n,s.treeForkCount=o)}function Tut(e,t,r){var i=t.pendingProps,n=i.revealOrder,o=i.tail;i=i.children;var s=Us.current,a=(s&2)!==0;if(a?(s=s&1|2,t.flags|=128):s&=1,To(Us,s),Tl(e,t,i,r),i=nn?I5:0,!a&&e!==null&&(e.flags&128)!==0)t:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&llt(e,r,t);else if(e.tag===19)llt(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case\"forwards\":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&R7(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),L$(t,!1,n,r,o,i);break;case\"backwards\":case\"unstable_legacy-backwards\":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&R7(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}L$(t,!0,r,null,o,i);break;case\"together\":L$(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function xg(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Qy|=t.lanes,(r&t.childLanes)===0)if(e!==null){if($w(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Fe(153));if(t.child!==null){for(e=t.child,r=gg(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=gg(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function TW(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&C7(e)))}function EOt(e,t,r){switch(t.tag){case 3:x7(t,t.stateNode.containerInfo),ky(t,da,e.memoizedState.cache),kv();break;case 27:case 5:J$(t);break;case 4:x7(t,t.stateNode.containerInfo);break;case 10:ky(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yG(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Ry(t),t.flags|=128,null):(r&t.child.childLanes)!==0?wut(e,t,r):(Ry(t),e=xg(e,t,r),e!==null?e.sibling:null);Ry(t);break;case 19:var n=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||($w(e,t,r,!1),i=(r&t.childLanes)!==0),n){if(i)return Tut(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),To(Us,Us.current),i)break;return null;case 22:return t.lanes=0,xut(e,t,r,t.pendingProps);case 24:ky(t,da,e.memoizedState.cache)}return xg(e,t,r)}function Sut(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)fa=!0;else{if(!TW(e,r)&&(t.flags&128)===0)return fa=!1,EOt(e,t,r);fa=(e.flags&131072)!==0}else fa=!1,nn&&(t.flags&1048576)!==0&&Pct(t,I5,t.index);switch(t.lanes=0,t.tag){case 16:t:{var i=t.pendingProps;if(e=Tv(t.elementType),t.type=e,typeof e==\"function\")rW(e)?(i=Lv(e,i),t.tag=1,t=slt(null,t,e,i,r)):(t.tag=0,t=TG(null,t,e,i,r));else{if(e!=null){var n=e.$$typeof;if(n===jG){t.tag=11,t=elt(null,t,e,i,r);break t}else if(n===$G){t.tag=14,t=rlt(null,t,e,i,r);break t}}throw t=K$(e)||e,Error(Fe(306,t,\"\"))}}return t;case 0:return TG(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,n=Lv(i,t.pendingProps),slt(e,t,i,n,r);case 3:t:{if(x7(t,t.stateNode.containerInfo),e===null)throw Error(Fe(387));i=t.pendingProps;var o=t.memoizedState;n=o.element,mG(e,t),_5(t,i,null,r);var s=t.memoizedState;if(i=s.cache,ky(t,da,i),i!==o.cache&&fG(t,[da],r,!0),y5(),i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=alt(e,t,i,r);break t}else if(i!==n){n=yd(Error(Fe(424)),t),k5(n),t=alt(e,t,i,r);break t}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName===\"HTML\"?e.ownerDocument.body:e,No=bd(e.firstChild),Ml=t,nn=!0,Vy=null,_d=!0,r=Oct(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(kv(),i===n){t=xg(e,t,r);break t}Tl(e,t,i,r)}t=t.child}return t;case 26:return m7(e,t),e===null?(r=Ilt(t.type,null,t.pendingProps,null))?t.memoizedState=r:nn||(r=t.type,e=t.pendingProps,i=G7(Uy.current).createElement(r),i[Sl]=t,i[Au]=e,Pl(i,r,e),Qa(i),t.stateNode=i):t.memoizedState=Ilt(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J$(t),e===null&&nn&&(i=t.stateNode=mht(t.type,t.pendingProps,Uy.current),Ml=t,_d=!0,n=No,t1(t.type)?(zG=n,No=bd(i.firstChild)):No=n),Tl(e,t,t.pendingProps.children,r),m7(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nn&&((n=i=No)&&(i=eLt(i,t.type,t.pendingProps,_d),i!==null?(t.stateNode=i,Ml=t,No=bd(i.firstChild),_d=!1,n=!0):n=!1),n||Zy(t)),J$(t),n=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,LG(n,o)?i=null:s!==null&&LG(n,s)&&(t.flags|=32),t.memoizedState!==null&&(n=hW(e,t,yOt,null,null,r),F5._currentValue=n),m7(e,t),Tl(e,t,i,r),t.child;case 6:return e===null&&nn&&((e=r=No)&&(r=rLt(r,t.pendingProps,_d),r!==null?(t.stateNode=r,Ml=t,No=null,e=!0):e=!1),e||Zy(t)),null;case 13:return wut(e,t,r);case 4:return x7(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Dv(t,null,i,r):Tl(e,t,i,r),t.child;case 11:return elt(e,t,t.type,t.pendingProps,r);case 7:return Tl(e,t,t.pendingProps,r),t.child;case 8:return Tl(e,t,t.pendingProps.children,r),t.child;case 12:return Tl(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,ky(t,t.type,i.value),Tl(e,t,i.children,r),t.child;case 9:return n=t.type._context,i=t.pendingProps.children,Rv(t),n=El(n),i=i(n),t.flags|=1,Tl(e,t,i,r),t.child;case 14:return rlt(e,t,t.type,t.pendingProps,r);case 15:return but(e,t,t.type,t.pendingProps,r);case 19:return Tut(e,t,r);case 31:return MOt(e,t,r);case 22:return xut(e,t,r,t.pendingProps);case 24:return Rv(t),i=El(da),e===null?(n=sW(),n===null&&(n=uo,o=oW(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=r),n=o),t.memoizedState={parent:i,cache:n},lW(t),ky(t,da,n)):((e.lanes&r)!==0&&(mG(e,t),_5(t,null,null,r),y5()),n=e.memoizedState,o=t.memoizedState,n.parent!==i?(n={parent:i,cache:i},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),ky(t,da,i)):(i=o.cache,ky(t,da,i),i!==n.cache&&fG(t,[da],r,!0))),Tl(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(Fe(156,t.tag))}function ag(e){e.flags|=4}function B$(e,t,r,i,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Xut())e.flags|=8192;else throw Cv=I7,aW}else e.flags&=-16777217}function clt(e,t){if(t.type!==\"stylesheet\"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yht(t))if(Xut())e.flags|=8192;else throw Cv=I7,aW}function JR(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zlt():536870912,e.lanes|=t,Bw|=t)}function n5(e,t){if(!nn)switch(e.tailMode){case\"hidden\":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case\"collapsed\":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Fo(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&65011712,i|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function POt(e,t,r){var i=t.pendingProps;switch(nW(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fo(t),null;case 1:return Fo(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ag(da),Iw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(aw(t)?ag(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,E$())),Fo(t),null;case 26:var n=t.type,o=t.memoizedState;return e===null?(ag(t),o!==null?(Fo(t),clt(t,o)):(Fo(t),B$(t,n,null,i,r))):o?o!==e.memoizedState?(ag(t),Fo(t),clt(t,o)):(Fo(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ag(t),Fo(t),B$(t,n,e,i,r)),null;case 27:if(w7(t),r=Uy.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ag(t);else{if(!i){if(t.stateNode===null)throw Error(Fe(166));return Fo(t),null}e=c0.current,aw(t)?Nat(t,e):(e=mht(n,i,r),t.stateNode=e,ag(t))}return Fo(t),null;case 5:if(w7(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ag(t);else{if(!i){if(t.stateNode===null)throw Error(Fe(166));return Fo(t),null}if(o=c0.current,aw(t))Nat(t,o);else{var s=G7(Uy.current);switch(o){case 1:o=s.createElementNS(\"http://www.w3.org/2000/svg\",n);break;case 2:o=s.createElementNS(\"http://www.w3.org/1998/Math/MathML\",n);break;default:switch(n){case\"svg\":o=s.createElementNS(\"http://www.w3.org/2000/svg\",n);break;case\"math\":o=s.createElementNS(\"http://www.w3.org/1998/Math/MathML\",n);break;case\"script\":o=s.createElement(\"div\"),o.innerHTML=\"<script><\\/script>\",o=o.removeChild(o.firstChild);break;case\"select\":o=typeof i.is==\"string\"?s.createElement(\"select\",{is:i.is}):s.createElement(\"select\"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is==\"string\"?s.createElement(n,{is:i.is}):s.createElement(n)}}o[Sl]=t,o[Au]=i;t:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break t;for(;s.sibling===null;){if(s.return===null||s.return===t)break t;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;t:switch(Pl(o,n,i),n){case\"button\":case\"input\":case\"select\":case\"textarea\":i=!!i.autoFocus;break t;case\"img\":i=!0;break t;default:i=!1}i&&ag(t)}}return Fo(t),B$(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ag(t);else{if(typeof i!=\"string\"&&t.stateNode===null)throw Error(Fe(166));if(e=Uy.current,aw(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,n=Ml,n!==null)switch(n.tag){case 27:case 5:i=n.memoizedProps}e[Sl]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||hht(e.nodeValue,r)),e||Zy(t,!0)}else e=G7(e).createTextNode(i),e[Sl]=t,t.stateNode=e}return Fo(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=aw(t),r!==null){if(e===null){if(!i)throw Error(Fe(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Fe(557));e[Sl]=t}else kv(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fo(t),e=!1}else r=E$(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(ah(t),t):(ah(t),null);if((t.flags&128)!==0)throw Error(Fe(558))}return Fo(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=aw(t),i!==null&&i.dehydrated!==null){if(e===null){if(!n)throw Error(Fe(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Fe(317));n[Sl]=t}else kv(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fo(t),n=!1}else n=E$(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(ah(t),t):(ah(t),null)}return ah(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,n=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(n=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==n&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),JR(t,t.updateQueue),Fo(t),null);case 4:return Iw(),e===null&&kW(t.stateNode.containerInfo),Fo(t),null;case 10:return Ag(t.type),Fo(t),null;case 19:if(Ja(Us),i=t.memoizedState,i===null)return Fo(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)n5(i,!1);else{if(As!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=R7(e),o!==null){for(t.flags|=128,n5(i,!1),e=o.updateQueue,t.updateQueue=e,JR(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Mct(r,e),r=r.sibling;return To(Us,Us.current&1|2),nn&&hg(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&uh()>N7&&(t.flags|=128,n=!0,n5(i,!1),t.lanes=4194304)}else{if(!n)if(e=R7(o),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,JR(t,e),n5(i,!0),i.tail===null&&i.tailMode===\"hidden\"&&!o.alternate&&!nn)return Fo(t),null}else 2*uh()-i.renderingStartTime>N7&&r!==536870912&&(t.flags|=128,n=!0,n5(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=uh(),e.sibling=null,r=Us.current,To(Us,n?r&1|2:r&1),nn&&hg(t,i.treeForkCount),e):(Fo(t),null);case 22:case 23:return ah(t),cW(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(r&536870912)!==0&&(t.flags&128)===0&&(Fo(t),t.subtreeFlags&6&&(t.flags|=8192)):Fo(t),r=t.updateQueue,r!==null&&JR(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&Ja(Pv),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ag(da),Fo(t),null;case 25:return null;case 30:return null}throw Error(Fe(156,t.tag))}function COt(e,t){switch(nW(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ag(da),Iw(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return w7(t),null;case 31:if(t.memoizedState!==null){if(ah(t),t.alternate===null)throw Error(Fe(340));kv()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ah(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Fe(340));kv()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ja(Us),null;case 4:return Iw(),null;case 10:return Ag(t.type),null;case 22:case 23:return ah(t),cW(),e!==null&&Ja(Pv),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ag(da),null;case 25:return null;default:return null}}function Mut(e,t){switch(nW(t),t.tag){case 3:Ag(da),Iw();break;case 26:case 27:case 5:w7(t);break;case 4:Iw();break;case 31:t.memoizedState!==null&&ah(t);break;case 13:ah(t);break;case 19:Ja(Us);break;case 10:Ag(t.type);break;case 22:case 23:ah(t),cW(),e!==null&&Ja(Pv);break;case 24:Ag(da)}}function Y5(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){i=void 0;var o=r.create,s=r.inst;i=o(),s.destroy=i}r=r.next}while(r!==n)}}catch(a){Vn(t,t.return,a)}}function Ky(e,t,r){try{var i=t.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var o=n.next;i=o;do{if((i.tag&e)===e){var s=i.inst,a=s.destroy;if(a!==void 0){s.destroy=void 0,n=t;var h=r,p=a;try{p()}catch(g){Vn(n,h,g)}}}i=i.next}while(i!==o)}}catch(g){Vn(t,t.return,g)}}function Eut(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Bct(t,r)}catch(i){Vn(e,e.return,i)}}}function Put(e,t,r){r.props=Lv(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){Vn(e,t,i)}}function b5(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r==\"function\"?e.refCleanup=r(i):r.current=i}}catch(n){Vn(e,t,n)}}function l0(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i==\"function\")try{i()}catch(n){Vn(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r==\"function\")try{r(null)}catch(n){Vn(e,t,n)}else r.current=null}function Cut(e){var t=e.type,r=e.memoizedProps,i=e.stateNode;try{t:switch(t){case\"button\":case\"input\":case\"select\":case\"textarea\":r.autoFocus&&i.focus();break t;case\"img\":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(n){Vn(e,e.return,n)}}function F$(e,t,r){try{var i=e.stateNode;XOt(i,e.type,r,t),i[Au]=t}catch(n){Vn(e,e.return,n)}}function Iut(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&t1(e.type)||e.tag===4}function N$(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Iut(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&t1(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function MG(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName===\"HTML\"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName===\"HTML\"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=pg));else if(i!==4&&(i===27&&t1(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(MG(e,t,r),e=e.sibling;e!==null;)MG(e,t,r),e=e.sibling}function F7(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&t1(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(F7(e,t,r),e=e.sibling;e!==null;)F7(e,t,r),e=e.sibling}function kut(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Pl(t,i,r),t[Sl]=e,t[Au]=r}catch(o){Vn(e,e.return,o)}}var dg=!1,ha=!1,z$=!1,ult=typeof WeakSet==\"function\"?WeakSet:Set,Ka=null;function IOt(e,t){if(e=e.containerInfo,DG=Y7,e=yct(e),JG(e)){if(\"selectionStart\"in e)var r={start:e.selectionStart,end:e.selectionEnd};else t:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break t}var s=0,a=-1,h=-1,p=0,g=0,w=e,C=null;e:for(;;){for(var R;w!==r||n!==0&&w.nodeType!==3||(a=s+n),w!==o||i!==0&&w.nodeType!==3||(h=s+i),w.nodeType===3&&(s+=w.nodeValue.length),(R=w.firstChild)!==null;)C=w,w=R;for(;;){if(w===e)break e;if(C===r&&++p===n&&(a=s),C===o&&++g===i&&(h=s),(R=w.nextSibling)!==null)break;w=C,C=w.parentNode}w=R}r=a===-1||h===-1?null:{start:a,end:h}}else r=null}r=r||{start:0,end:0}}else r=null;for(OG={focusedElem:e,selectionRange:r},Y7=!1,Ka=t;Ka!==null;)if(t=Ka,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ka=e;else for(;Ka!==null;){switch(t=Ka,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)n=e[r],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,r=t,n=o.memoizedProps,o=o.memoizedState,i=r.stateNode;try{var z=Lv(r.type,n);e=i.getSnapshotBeforeUpdate(z,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(W){Vn(r,r.return,W)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)BG(e);else if(r===1)switch(e.nodeName){case\"HEAD\":case\"HTML\":case\"BODY\":BG(e);break;default:e.textContent=\"\"}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(Fe(163))}if(e=t.sibling,e!==null){e.return=t.return,Ka=e;break}Ka=t.return}}function Rut(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:cg(e,r),i&4&&Y5(5,r);break;case 1:if(cg(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(s){Vn(r,r.return,s)}else{var n=Lv(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Vn(r,r.return,s)}}i&64&&Eut(r),i&512&&b5(r,r.return);break;case 3:if(cg(e,r),i&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{Bct(e,t)}catch(s){Vn(r,r.return,s)}}break;case 27:t===null&&i&4&&kut(r);case 26:case 5:cg(e,r),t===null&&i&4&&Cut(r),i&512&&b5(r,r.return);break;case 12:cg(e,r);break;case 31:cg(e,r),i&4&&Lut(e,r);break;case 13:cg(e,r),i&4&&But(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=zOt.bind(null,r),iLt(e,r))));break;case 22:if(i=r.memoizedState!==null||dg,!i){t=t!==null&&t.memoizedState!==null||ha,n=dg;var o=ha;dg=i,(ha=t)&&!o?ug(e,r,(r.subtreeFlags&8772)!==0):cg(e,r),dg=n,ha=o}break;case 30:break;default:cg(e,r)}}function Dut(e){var t=e.alternate;t!==null&&(e.alternate=null,Dut(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&HG(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Go=null,pu=!1;function lg(e,t,r){for(r=r.child;r!==null;)Out(e,t,r),r=r.sibling}function Out(e,t,r){if(hh&&typeof hh.onCommitFiberUnmount==\"function\")try{hh.onCommitFiberUnmount(V5,r)}catch{}switch(r.tag){case 26:ha||l0(r,t),lg(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ha||l0(r,t);var i=Go,n=pu;t1(r.type)&&(Go=r.stateNode,pu=!1),lg(e,t,r),S5(r.stateNode),Go=i,pu=n;break;case 5:ha||l0(r,t);case 6:if(i=Go,n=pu,Go=null,lg(e,t,r),Go=i,pu=n,Go!==null)if(pu)try{(Go.nodeType===9?Go.body:Go.nodeName===\"HTML\"?Go.ownerDocument.body:Go).removeChild(r.stateNode)}catch(o){Vn(r,t,o)}else try{Go.removeChild(r.stateNode)}catch(o){Vn(r,t,o)}break;case 18:Go!==null&&(pu?(e=Go,Slt(e.nodeType===9?e.body:e.nodeName===\"HTML\"?e.ownerDocument.body:e,r.stateNode),Uw(e)):Slt(Go,r.stateNode));break;case 4:i=Go,n=pu,Go=r.stateNode.containerInfo,pu=!0,lg(e,t,r),Go=i,pu=n;break;case 0:case 11:case 14:case 15:Ky(2,r,t),ha||Ky(4,r,t),lg(e,t,r);break;case 1:ha||(l0(r,t),i=r.stateNode,typeof i.componentWillUnmount==\"function\"&&Put(r,t,i)),lg(e,t,r);break;case 21:lg(e,t,r);break;case 22:ha=(i=ha)||r.memoizedState!==null,lg(e,t,r),ha=i;break;default:lg(e,t,r)}}function Lut(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uw(e)}catch(r){Vn(t,t.return,r)}}}function But(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uw(e)}catch(r){Vn(t,t.return,r)}}function kOt(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ult),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ult),t;default:throw Error(Fe(435,e.tag))}}function t7(e,t){var r=kOt(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var n=UOt.bind(null,e,i);i.then(n,n)}})}function du(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i],o=e,s=t,a=s;t:for(;a!==null;){switch(a.tag){case 27:if(t1(a.type)){Go=a.stateNode,pu=!1;break t}break;case 5:Go=a.stateNode,pu=!1;break t;case 3:case 4:Go=a.stateNode.containerInfo,pu=!0;break t}a=a.return}if(Go===null)throw Error(Fe(160));Out(o,s,n),Go=null,pu=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fut(t,e),t=t.sibling}var Rf=null;function Fut(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:du(t,e),fu(e),i&4&&(Ky(3,e,e.return),Y5(3,e),Ky(5,e,e.return));break;case 1:du(t,e),fu(e),i&512&&(ha||r===null||l0(r,r.return)),i&64&&dg&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var n=Rf;if(du(t,e),fu(e),i&512&&(ha||r===null||l0(r,r.return)),i&4){var o=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){t:{i=e.type,r=e.memoizedProps,n=n.ownerDocument||n;e:switch(i){case\"title\":o=n.getElementsByTagName(\"title\")[0],(!o||o[G5]||o[Sl]||o.namespaceURI===\"http://www.w3.org/2000/svg\"||o.hasAttribute(\"itemprop\"))&&(o=n.createElement(i),n.head.insertBefore(o,n.querySelector(\"head > title\"))),Pl(o,i,r),o[Sl]=e,Qa(o),i=o;break t;case\"link\":var s=Rlt(\"link\",\"href\",n).get(i+(r.href||\"\"));if(s){for(var a=0;a<s.length;a++)if(o=s[a],o.getAttribute(\"href\")===(r.href==null||r.href===\"\"?null:r.href)&&o.getAttribute(\"rel\")===(r.rel==null?null:r.rel)&&o.getAttribute(\"title\")===(r.title==null?null:r.title)&&o.getAttribute(\"crossorigin\")===(r.crossOrigin==null?null:r.crossOrigin)){s.splice(a,1);break e}}o=n.createElement(i),Pl(o,i,r),n.head.appendChild(o);break;case\"meta\":if(s=Rlt(\"meta\",\"content\",n).get(i+(r.content||\"\"))){for(a=0;a<s.length;a++)if(o=s[a],o.getAttribute(\"content\")===(r.content==null?null:\"\"+r.content)&&o.getAttribute(\"name\")===(r.name==null?null:r.name)&&o.getAttribute(\"property\")===(r.property==null?null:r.property)&&o.getAttribute(\"http-equiv\")===(r.httpEquiv==null?null:r.httpEquiv)&&o.getAttribute(\"charset\")===(r.charSet==null?null:r.charSet)){s.splice(a,1);break e}}o=n.createElement(i),Pl(o,i,r),n.head.appendChild(o);break;default:throw Error(Fe(468,i))}o[Sl]=e,Qa(o),i=o}e.stateNode=i}else Dlt(n,e.type,e.stateNode);else e.stateNode=klt(n,i,e.memoizedProps);else o!==i?(o===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):o.count--,i===null?Dlt(n,e.type,e.stateNode):klt(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&F$(e,e.memoizedProps,r.memoizedProps)}break;case 27:du(t,e),fu(e),i&512&&(ha||r===null||l0(r,r.return)),r!==null&&i&4&&F$(e,e.memoizedProps,r.memoizedProps);break;case 5:if(du(t,e),fu(e),i&512&&(ha||r===null||l0(r,r.return)),e.flags&32){n=e.stateNode;try{Rw(n,\"\")}catch(z){Vn(e,e.return,z)}}i&4&&e.stateNode!=null&&(n=e.memoizedProps,F$(e,n,r!==null?r.memoizedProps:n)),i&1024&&(z$=!0);break;case 6:if(du(t,e),fu(e),i&4){if(e.stateNode===null)throw Error(Fe(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(z){Vn(e,e.return,z)}}break;case 3:if(y7=null,n=Rf,Rf=W7(t.containerInfo),du(t,e),Rf=n,fu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Uw(t.containerInfo)}catch(z){Vn(e,e.return,z)}z$&&(z$=!1,Nut(e));break;case 4:i=Rf,Rf=W7(e.stateNode.containerInfo),du(t,e),fu(e),Rf=i;break;case 12:du(t,e),fu(e);break;case 31:du(t,e),fu(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,t7(e,i)));break;case 13:du(t,e),fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(aD=uh()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,t7(e,i)));break;case 22:n=e.memoizedState!==null;var h=r!==null&&r.memoizedState!==null,p=dg,g=ha;if(dg=p||n,ha=g||h,du(t,e),ha=g,dg=p,fu(e),i&8192)t:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(r===null||h||dg||ha||Sv(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){h=r=t;try{if(o=h.stateNode,n)s=o.style,typeof s.setProperty==\"function\"?s.setProperty(\"display\",\"none\",\"important\"):s.display=\"none\";else{a=h.stateNode;var w=h.memoizedProps.style,C=w!=null&&w.hasOwnProperty(\"display\")?w.display:null;a.style.display=C==null||typeof C==\"boolean\"?\"\":(\"\"+C).trim()}}catch(z){Vn(h,h.return,z)}}}else if(t.tag===6){if(r===null){h=t;try{h.stateNode.nodeValue=n?\"\":h.memoizedProps}catch(z){Vn(h,h.return,z)}}}else if(t.tag===18){if(r===null){h=t;try{var R=h.stateNode;n?Mlt(R,!0):Mlt(h.stateNode,!1)}catch(z){Vn(h,h.return,z)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,t7(e,r))));break;case 19:du(t,e),fu(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,t7(e,i)));break;case 30:break;case 21:break;default:du(t,e),fu(e)}}function fu(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(Iut(i)){r=i;break}i=i.return}if(r==null)throw Error(Fe(160));switch(r.tag){case 27:var n=r.stateNode,o=N$(e);F7(e,o,n);break;case 5:var s=r.stateNode;r.flags&32&&(Rw(s,\"\"),r.flags&=-33);var a=N$(e);F7(e,a,s);break;case 3:case 4:var h=r.stateNode.containerInfo,p=N$(e);MG(e,p,h);break;default:throw Error(Fe(161))}}catch(g){Vn(e,e.return,g)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nut(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nut(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function cg(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Rut(e,t.alternate,t),t=t.sibling}function Sv(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ky(4,t,t.return),Sv(t);break;case 1:l0(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount==\"function\"&&Put(t,t.return,r),Sv(t);break;case 27:S5(t.stateNode);case 26:case 5:l0(t,t.return),Sv(t);break;case 22:t.memoizedState===null&&Sv(t);break;case 30:Sv(t);break;default:Sv(t)}e=e.sibling}}function ug(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,n=e,o=t,s=o.flags;switch(o.tag){case 0:case 11:case 15:ug(n,o,r),Y5(4,o);break;case 1:if(ug(n,o,r),i=o,n=i.stateNode,typeof n.componentDidMount==\"function\")try{n.componentDidMount()}catch(p){Vn(i,i.return,p)}if(i=o,n=i.updateQueue,n!==null){var a=i.stateNode;try{var h=n.shared.hiddenCallbacks;if(h!==null)for(n.shared.hiddenCallbacks=null,n=0;n<h.length;n++)Lct(h[n],a)}catch(p){Vn(i,i.return,p)}}r&&s&64&&Eut(o),b5(o,o.return);break;case 27:kut(o);case 26:case 5:ug(n,o,r),r&&i===null&&s&4&&Cut(o),b5(o,o.return);break;case 12:ug(n,o,r);break;case 31:ug(n,o,r),r&&s&4&&Lut(n,o);break;case 13:ug(n,o,r),r&&s&4&&But(n,o);break;case 22:o.memoizedState===null&&ug(n,o,r),b5(o,o.return);break;case 30:break;default:ug(n,o,r)}t=t.sibling}}function SW(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&q5(r))}function MW(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&q5(e))}function kf(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zut(e,t,r,i),t=t.sibling}function zut(e,t,r,i){var n=t.flags;switch(t.tag){case 0:case 11:case 15:kf(e,t,r,i),n&2048&&Y5(9,t);break;case 1:kf(e,t,r,i);break;case 3:kf(e,t,r,i),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&q5(e)));break;case 12:if(n&2048){kf(e,t,r,i),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,a=o.onPostCommit;typeof a==\"function\"&&a(s,t.alternate===null?\"mount\":\"update\",e.passiveEffectDuration,-0)}catch(h){Vn(t,t.return,h)}}else kf(e,t,r,i);break;case 31:kf(e,t,r,i);break;case 13:kf(e,t,r,i);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState!==null?o._visibility&2?kf(e,t,r,i):x5(e,t):o._visibility&2?kf(e,t,r,i):(o._visibility|=2,cw(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),n&2048&&SW(s,t);break;case 24:kf(e,t,r,i),n&2048&&MW(t.alternate,t);break;default:kf(e,t,r,i)}}function cw(e,t,r,i,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,s=t,a=r,h=i,p=s.flags;switch(s.tag){case 0:case 11:case 15:cw(o,s,a,h,n),Y5(8,s);break;case 23:break;case 22:var g=s.stateNode;s.memoizedState!==null?g._visibility&2?cw(o,s,a,h,n):x5(o,s):(g._visibility|=2,cw(o,s,a,h,n)),n&&p&2048&&SW(s.alternate,s);break;case 24:cw(o,s,a,h,n),n&&p&2048&&MW(s.alternate,s);break;default:cw(o,s,a,h,n)}t=t.sibling}}function x5(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,n=i.flags;switch(i.tag){case 22:x5(r,i),n&2048&&SW(i.alternate,i);break;case 24:x5(r,i),n&2048&&MW(i.alternate,i);break;default:x5(r,i)}t=t.sibling}}var d5=8192;function lw(e,t,r){if(e.subtreeFlags&d5)for(e=e.child;e!==null;)Uut(e,t,r),e=e.sibling}function Uut(e,t,r){switch(e.tag){case 26:lw(e,t,r),e.flags&d5&&e.memoizedState!==null&&mLt(r,Rf,e.memoizedState,e.memoizedProps);break;case 5:lw(e,t,r);break;case 3:case 4:var i=Rf;Rf=W7(e.stateNode.containerInfo),lw(e,t,r),Rf=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=d5,d5=16777216,lw(e,t,r),d5=i):lw(e,t,r));break;default:lw(e,t,r)}}function Vut(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function o5(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Ka=i,$ut(i,e)}Vut(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jut(e),e=e.sibling}function jut(e){switch(e.tag){case 0:case 11:case 15:o5(e),e.flags&2048&&Ky(9,e,e.return);break;case 3:o5(e);break;case 12:o5(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,g7(e)):o5(e);break;default:o5(e)}}function g7(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Ka=i,$ut(i,e)}Vut(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ky(8,t,t.return),g7(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,g7(t));break;default:g7(t)}e=e.sibling}}function $ut(e,t){for(;Ka!==null;){var r=Ka;switch(r.tag){case 0:case 11:case 15:Ky(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:q5(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,Ka=i;else t:for(r=e;Ka!==null;){i=Ka;var n=i.sibling,o=i.return;if(Dut(i),i===r){Ka=null;break t}if(n!==null){n.return=o,Ka=n;break t}Ka=o}}}var ROt={getCacheForType:function(e){var t=El(da),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return El(da).controller.signal}},DOt=typeof WeakMap==\"function\"?WeakMap:Map,En=0,uo=null,Wi=null,Ki=0,Un=0,sh=null,Fy=!1,Ww=!1,EW=!1,wg=0,As=0,Qy=0,Iv=0,PW=0,ch=0,Bw=0,w5=null,mu=null,EG=!1,aD=0,Gut=0,N7=1/0,z7=null,Gy=null,Sa=0,Wy=null,Fw=null,yg=0,PG=0,CG=null,Wut=null,T5=0,IG=null;function fh(){return(En&2)!==0&&Ki!==0?Ki&-Ki:hi.T!==null?IW():tct()}function qut(){if(ch===0)if((Ki&536870912)===0||nn){var e=GR;GR<<=1,(GR&3932160)===0&&(GR=262144),ch=e}else ch=536870912;return e=mh.current,e!==null&&(e.flags|=32),ch}function gu(e,t,r){(e===uo&&(Un===2||Un===9)||e.cancelPendingCommit!==null)&&(Nw(e,0),Ny(e,Ki,ch,!1)),$5(e,r),((En&2)===0||e!==uo)&&(e===uo&&((En&2)===0&&(Iv|=r),As===4&&Ny(e,Ki,ch,!1)),h0(e))}function Hut(e,t,r){if((En&6)!==0)throw Error(Fe(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||j5(e,t),n=i?BOt(e,t):U$(e,t,!0),o=i;do{if(n===0){Ww&&!i&&Ny(e,t,0,!1);break}else{if(r=e.current.alternate,o&&!OOt(r)){n=U$(e,t,!1),o=!1;continue}if(n===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;t:{var a=e;n=w5;var h=a.current.memoizedState.isDehydrated;if(h&&(Nw(a,s).flags|=256),s=U$(a,s,!1),s!==2){if(EW&&!h){a.errorRecoveryDisabledLanes|=o,Iv|=o,n=4;break t}o=mu,mu=n,o!==null&&(mu===null?mu=o:mu.push.apply(mu,o))}n=s}if(o=!1,n!==2)continue}}if(n===1){Nw(e,0),Ny(e,t,0,!0);break}t:{switch(i=e,o=n,o){case 0:case 1:throw Error(Fe(345));case 4:if((t&4194048)!==t)break;case 6:Ny(i,t,ch,!Fy);break t;case 2:mu=null;break;case 3:case 5:break;default:throw Error(Fe(329))}if((t&62914560)===t&&(n=aD+300-uh(),10<n)){if(Ny(i,t,ch,!Fy),Z7(i,0,!0)!==0)break t;yg=t,i.timeoutHandle=fht(hlt.bind(null,i,r,mu,z7,EG,t,ch,Iv,Bw,Fy,o,\"Throttled\",-0,0),n);break t}hlt(i,r,mu,z7,EG,t,ch,Iv,Bw,Fy,o,null,-0,0)}}break}while(!0);h0(e)}function hlt(e,t,r,i,n,o,s,a,h,p,g,w,C,R){if(e.timeoutHandle=-1,w=t.subtreeFlags,w&8192||(w&16785408)===16785408){w={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pg},Uut(t,o,w);var z=(o&62914560)===o?aD-uh():(o&4194048)===o?Gut-uh():0;if(z=gLt(w,z),z!==null){yg=o,e.cancelPendingCommit=z(flt.bind(null,e,t,o,r,i,n,s,a,h,g,w,null,C,R)),Ny(e,o,s,!p);return}}flt(e,t,o,r,i,n,s,a,h)}function OOt(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var n=r[i],o=n.getSnapshot;n=n.value;try{if(!ph(o(),n))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ny(e,t,r,i){t&=~PW,t&=~Iv,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var n=t;0<n;){var o=31-dh(n),s=1<<o;i[o]=-1,n&=~s}r!==0&&Klt(e,r,t)}function lD(){return(En&6)===0?(X5(0,!1),!1):!0}function CW(){if(Wi!==null){if(Un===0)var e=Wi.return;else e=Wi,mg=Uv=null,pW(e),Ew=null,R5=0,e=Wi;for(;e!==null;)Mut(e.alternate,e),e=e.return;Wi=null}}function Nw(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,QOt(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),yg=0,CW(),uo=e,Wi=r=gg(e.current,null),Ki=t,Un=0,sh=null,Fy=!1,Ww=j5(e,t),EW=!1,Bw=ch=PW=Iv=Qy=As=0,mu=w5=null,EG=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var n=31-dh(i),o=1<<n;t|=e[n],i&=~o}return wg=t,tD(),r}function Yut(e,t){Ri=null,hi.H=O5,t===Gw||t===rD?(t=$at(),Un=3):t===aW?(t=$at(),Un=4):Un=t===wW?8:t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"?6:1,sh=t,Wi===null&&(As=1,L7(e,yd(t,e.current)))}function Xut(){var e=mh.current;return e===null?!0:(Ki&4194048)===Ki?vd===null:(Ki&62914560)===Ki||(Ki&536870912)!==0?e===vd:!1}function Zut(){var e=hi.H;return hi.H=O5,e===null?O5:e}function Kut(){var e=hi.A;return hi.A=ROt,e}function U7(){As=4,Fy||(Ki&4194048)!==Ki&&mh.current!==null||(Ww=!0),(Qy&134217727)===0&&(Iv&134217727)===0||uo===null||Ny(uo,Ki,ch,!1)}function U$(e,t,r){var i=En;En|=2;var n=Zut(),o=Kut();(uo!==e||Ki!==t)&&(z7=null,Nw(e,t)),t=!1;var s=As;t:do try{if(Un!==0&&Wi!==null){var a=Wi,h=sh;switch(Un){case 8:CW(),s=6;break t;case 3:case 2:case 9:case 6:mh.current===null&&(t=!0);var p=Un;if(Un=0,sh=null,xw(e,a,h,p),r&&Ww){s=0;break t}break;default:p=Un,Un=0,sh=null,xw(e,a,h,p)}}LOt(),s=As;break}catch(g){Yut(e,g)}while(!0);return t&&e.shellSuspendCounter++,mg=Uv=null,En=i,hi.H=n,hi.A=o,Wi===null&&(uo=null,Ki=0,tD()),s}function LOt(){for(;Wi!==null;)Qut(Wi)}function BOt(e,t){var r=En;En|=2;var i=Zut(),n=Kut();uo!==e||Ki!==t?(z7=null,N7=uh()+500,Nw(e,t)):Ww=j5(e,t);t:do try{if(Un!==0&&Wi!==null){t=Wi;var o=sh;e:switch(Un){case 1:Un=0,sh=null,xw(e,t,o,1);break;case 2:case 9:if(jat(o)){Un=0,sh=null,dlt(t);break}t=function(){Un!==2&&Un!==9||uo!==e||(Un=7),h0(e)},o.then(t,t);break t;case 3:Un=7;break t;case 4:Un=5;break t;case 7:jat(o)?(Un=0,sh=null,dlt(t)):(Un=0,sh=null,xw(e,t,o,7));break;case 5:var s=null;switch(Wi.tag){case 26:s=Wi.memoizedState;case 5:case 27:var a=Wi;if(s?yht(s):a.stateNode.complete){Un=0,sh=null;var h=a.sibling;if(h!==null)Wi=h;else{var p=a.return;p!==null?(Wi=p,cD(p)):Wi=null}break e}}Un=0,sh=null,xw(e,t,o,5);break;case 6:Un=0,sh=null,xw(e,t,o,6);break;case 8:CW(),As=6;break t;default:throw Error(Fe(462))}}FOt();break}catch(g){Yut(e,g)}while(!0);return mg=Uv=null,hi.H=i,hi.A=n,En=r,Wi!==null?0:(uo=null,Ki=0,tD(),As)}function FOt(){for(;Wi!==null&&!sDt();)Qut(Wi)}function Qut(e){var t=Sut(e.alternate,e,wg);e.memoizedProps=e.pendingProps,t===null?cD(e):Wi=t}function dlt(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=olt(r,t,t.pendingProps,t.type,void 0,Ki);break;case 11:t=olt(r,t,t.pendingProps,t.type.render,t.ref,Ki);break;case 5:pW(t);default:Mut(r,t),t=Wi=Mct(t,wg),t=Sut(r,t,wg)}e.memoizedProps=e.pendingProps,t===null?cD(e):Wi=t}function xw(e,t,r,i){mg=Uv=null,pW(t),Ew=null,R5=0;var n=t.return;try{if(SOt(e,n,t,r,Ki)){As=1,L7(e,yd(r,e.current)),Wi=null;return}}catch(o){if(n!==null)throw Wi=n,o;As=1,L7(e,yd(r,e.current)),Wi=null;return}t.flags&32768?(nn||i===1?e=!0:Ww||(Ki&536870912)!==0?e=!1:(Fy=e=!0,(i===2||i===9||i===3||i===6)&&(i=mh.current,i!==null&&i.tag===13&&(i.flags|=16384))),Jut(t,e)):cD(t)}function cD(e){var t=e;do{if((t.flags&32768)!==0){Jut(t,Fy);return}e=t.return;var r=POt(t.alternate,t,wg);if(r!==null){Wi=r;return}if(t=t.sibling,t!==null){Wi=t;return}Wi=t=e}while(t!==null);As===0&&(As=5)}function Jut(e,t){do{var r=COt(e.alternate,e);if(r!==null){r.flags&=32767,Wi=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Wi=e;return}Wi=e=r}while(e!==null);As=6,Wi=null}function flt(e,t,r,i,n,o,s,a,h){e.cancelPendingCommit=null;do uD();while(Sa!==0);if((En&6)!==0)throw Error(Fe(327));if(t!==null){if(t===e.current)throw Error(Fe(177));if(o=t.lanes|t.childLanes,o|=tW,gDt(e,r,o,s,a,h),e===uo&&(Wi=uo=null,Ki=0),Fw=t,Wy=e,yg=r,PG=o,CG=n,Wut=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,VOt(T7,function(){return nht(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=hi.T,hi.T=null,n=Pn.p,Pn.p=2,s=En,En|=4;try{IOt(e,t,r)}finally{En=s,Pn.p=n,hi.T=i}}Sa=1,tht(),eht(),rht()}}function tht(){if(Sa===1){Sa=0;var e=Wy,t=Fw,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=hi.T,hi.T=null;var i=Pn.p;Pn.p=2;var n=En;En|=4;try{Fut(t,e);var o=OG,s=yct(e.containerInfo),a=o.focusedElem,h=o.selectionRange;if(s!==a&&a&&a.ownerDocument&&Act(a.ownerDocument.documentElement,a)){if(h!==null&&JG(a)){var p=h.start,g=h.end;if(g===void 0&&(g=p),\"selectionStart\"in a)a.selectionStart=p,a.selectionEnd=Math.min(g,a.value.length);else{var w=a.ownerDocument||document,C=w&&w.defaultView||window;if(C.getSelection){var R=C.getSelection(),z=a.textContent.length,W=Math.min(h.start,z),Y=h.end===void 0?W:Math.min(h.end,z);!R.extend&&W>Y&&(s=Y,Y=W,W=s);var H=Lat(a,W),Q=Lat(a,Y);if(H&&Q&&(R.rangeCount!==1||R.anchorNode!==H.node||R.anchorOffset!==H.offset||R.focusNode!==Q.node||R.focusOffset!==Q.offset)){var tt=w.createRange();tt.setStart(H.node,H.offset),R.removeAllRanges(),W>Y?(R.addRange(tt),R.extend(Q.node,Q.offset)):(tt.setEnd(Q.node,Q.offset),R.addRange(tt))}}}}for(w=[],R=a;R=R.parentNode;)R.nodeType===1&&w.push({element:R,left:R.scrollLeft,top:R.scrollTop});for(typeof a.focus==\"function\"&&a.focus(),a=0;a<w.length;a++){var rt=w[a];rt.element.scrollLeft=rt.left,rt.element.scrollTop=rt.top}}Y7=!!DG,OG=DG=null}finally{En=n,Pn.p=i,hi.T=r}}e.current=t,Sa=2}}function eht(){if(Sa===2){Sa=0;var e=Wy,t=Fw,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=hi.T,hi.T=null;var i=Pn.p;Pn.p=2;var n=En;En|=4;try{Rut(e,t.alternate,t)}finally{En=n,Pn.p=i,hi.T=r}}Sa=3}}function rht(){if(Sa===4||Sa===3){Sa=0,aDt();var e=Wy,t=Fw,r=yg,i=Wut;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Sa=5:(Sa=0,Fw=Wy=null,iht(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Gy=null),qG(r),t=t.stateNode,hh&&typeof hh.onCommitFiberRoot==\"function\")try{hh.onCommitFiberRoot(V5,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=hi.T,n=Pn.p,Pn.p=2,hi.T=null;try{for(var o=e.onRecoverableError,s=0;s<i.length;s++){var a=i[s];o(a.value,{componentStack:a.stack})}}finally{hi.T=t,Pn.p=n}}(yg&3)!==0&&uD(),h0(e),n=e.pendingLanes,(r&261930)!==0&&(n&42)!==0?e===IG?T5++:(T5=0,IG=e):T5=0,X5(0,!1)}}function iht(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,q5(t)))}function uD(){return tht(),eht(),rht(),nht()}function nht(){if(Sa!==5)return!1;var e=Wy,t=PG;PG=0;var r=qG(yg),i=hi.T,n=Pn.p;try{Pn.p=32>r?32:r,hi.T=null,r=CG,CG=null;var o=Wy,s=yg;if(Sa=0,Fw=Wy=null,yg=0,(En&6)!==0)throw Error(Fe(331));var a=En;if(En|=4,jut(o.current),zut(o,o.current,s,r),En=a,X5(0,!1),hh&&typeof hh.onPostCommitFiberRoot==\"function\")try{hh.onPostCommitFiberRoot(V5,o)}catch{}return!0}finally{Pn.p=n,hi.T=i,iht(e,t)}}function plt(e,t,r){t=yd(r,t),t=wG(e.stateNode,t,2),e=$y(e,t,2),e!==null&&($5(e,2),h0(e))}function Vn(e,t,r){if(e.tag===3)plt(e,e,r);else for(;t!==null;){if(t.tag===3){plt(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof i.componentDidCatch==\"function\"&&(Gy===null||!Gy.has(i))){e=yd(r,e),r=_ut(2),i=$y(t,r,2),i!==null&&(vut(r,i,t,e),$5(i,2),h0(i));break}}t=t.return}}function V$(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new DOt;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(EW=!0,n.add(r),e=NOt.bind(null,e,t,r),t.then(e,e))}function NOt(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,uo===e&&(Ki&r)===r&&(As===4||As===3&&(Ki&62914560)===Ki&&300>uh()-aD?(En&2)===0&&Nw(e,0):PW|=r,Bw===Ki&&(Bw=0)),h0(e)}function oht(e,t){t===0&&(t=Zlt()),e=zv(e,t),e!==null&&($5(e,t),h0(e))}function zOt(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),oht(e,r)}function UOt(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(Fe(314))}i!==null&&i.delete(t),oht(e,r)}function VOt(e,t){return GG(e,t)}var V7=null,uw=null,kG=!1,j7=!1,j$=!1,zy=0;function h0(e){e!==uw&&e.next===null&&(uw===null?V7=uw=e:uw=uw.next=e),j7=!0,kG||(kG=!0,$Ot())}function X5(e,t){if(!j$&&j7){j$=!0;do for(var r=!1,i=V7;i!==null;){if(!t)if(e!==0){var n=i.pendingLanes;if(n===0)var o=0;else{var s=i.suspendedLanes,a=i.pingedLanes;o=(1<<31-dh(42|e)+1)-1,o&=n&~(s&~a),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(r=!0,mlt(i,o))}else o=Ki,o=Z7(i,i===uo?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||j5(i,o)||(r=!0,mlt(i,o));i=i.next}while(r);j$=!1}}function jOt(){sht()}function sht(){j7=kG=!1;var e=0;zy!==0&&KOt()&&(e=zy);for(var t=uh(),r=null,i=V7;i!==null;){var n=i.next,o=aht(i,t);o===0?(i.next=null,r===null?V7=n:r.next=n,n===null&&(uw=r)):(r=i,(e!==0||(o&3)!==0)&&(j7=!0)),i=n}Sa!==0&&Sa!==5||X5(e,!1),zy!==0&&(zy=0)}function aht(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var s=31-dh(o),a=1<<s,h=n[s];h===-1?((a&r)===0||(a&i)!==0)&&(n[s]=mDt(a,t)):h<=t&&(e.expiredLanes|=a),o&=~a}if(t=uo,r=Ki,r=Z7(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(Un===2||Un===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&A$(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||j5(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&A$(i),qG(r)){case 2:case 8:r=Ylt;break;case 32:r=T7;break;case 268435456:r=Xlt;break;default:r=T7}return i=lht.bind(null,e),r=GG(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&A$(i),e.callbackPriority=2,e.callbackNode=null,2}function lht(e,t){if(Sa!==0&&Sa!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(uD()&&e.callbackNode!==r)return null;var i=Ki;return i=Z7(e,e===uo?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Hut(e,i,t),aht(e,uh()),e.callbackNode!=null&&e.callbackNode===r?lht.bind(null,e):null)}function mlt(e,t){if(uD())return null;Hut(e,t,!0)}function $Ot(){JOt(function(){(En&6)!==0?GG(Hlt,jOt):sht()})}function IW(){if(zy===0){var e=Dw;e===0&&(e=$R,$R<<=1,($R&261888)===0&&($R=256)),zy=e}return zy}function glt(e){return e==null||typeof e==\"symbol\"||typeof e==\"boolean\"?null:typeof e==\"function\"?e:a7(\"\"+e)}function Alt(e,t){var r=t.ownerDocument.createElement(\"input\");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute(\"form\",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function GOt(e,t,r,i,n){if(t===\"submit\"&&r&&r.stateNode===n){var o=glt((n[Au]||null).action),s=i.submitter;s&&(t=(t=s[Au]||null)?glt(t.formAction):s.getAttribute(\"formAction\"),t!==null&&(o=t,s=null));var a=new K7(\"action\",\"action\",null,i,n);e.push({event:a,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(zy!==0){var h=s?Alt(n,s):new FormData(n);bG(r,{pending:!0,data:h,method:n.method,action:o},null,h)}}else typeof o==\"function\"&&(a.preventDefault(),h=s?Alt(n,s):new FormData(n),bG(r,{pending:!0,data:h,method:n.method,action:o},o,h))},currentTarget:n}]})}}for(e7=0;e7<cG.length;e7++)r7=cG[e7],ylt=r7.toLowerCase(),_lt=r7[0].toUpperCase()+r7.slice(1),Df(ylt,\"on\"+_lt);var r7,ylt,_lt,e7;Df(vct,\"onAnimationEnd\");Df(bct,\"onAnimationIteration\");Df(xct,\"onAnimationStart\");Df(\"dblclick\",\"onDoubleClick\");Df(\"focusin\",\"onFocus\");Df(\"focusout\",\"onBlur\");Df(lOt,\"onTransitionRun\");Df(cOt,\"onTransitionStart\");Df(uOt,\"onTransitionCancel\");Df(wct,\"onTransitionEnd\");kw(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]);kw(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]);kw(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]);kw(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]);Bv(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \"));Bv(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \"));Bv(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]);Bv(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \"));Bv(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \"));Bv(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var L5=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),WOt=new Set(\"beforetoggle cancel close invalid load scroll scrollend toggle\".split(\" \").concat(L5));function cht(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;t:{var o=void 0;if(t)for(var s=i.length-1;0<=s;s--){var a=i[s],h=a.instance,p=a.currentTarget;if(a=a.listener,h!==o&&n.isPropagationStopped())break t;o=a,n.currentTarget=p;try{o(n)}catch(g){M7(g)}n.currentTarget=null,o=h}else for(s=0;s<i.length;s++){if(a=i[s],h=a.instance,p=a.currentTarget,a=a.listener,h!==o&&n.isPropagationStopped())break t;o=a,n.currentTarget=p;try{o(n)}catch(g){M7(g)}n.currentTarget=null,o=h}}}}function Gi(e,t){var r=t[eG];r===void 0&&(r=t[eG]=new Set);var i=e+\"__bubble\";r.has(i)||(uht(t,e,2,!1),r.add(i))}function $$(e,t,r){var i=0;t&&(i|=4),uht(r,e,i,t)}var i7=\"_reactListening\"+Math.random().toString(36).slice(2);function kW(e){if(!e[i7]){e[i7]=!0,ect.forEach(function(r){r!==\"selectionchange\"&&(WOt.has(r)||$$(r,!1,e),$$(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[i7]||(t[i7]=!0,$$(\"selectionchange\",!1,t))}}function uht(e,t,r,i){switch(wht(t)){case 2:var n=_Lt;break;case 8:n=vLt;break;default:n=LW}r=n.bind(null,t,r,e),n=void 0,!sG||t!==\"touchstart\"&&t!==\"touchmove\"&&t!==\"wheel\"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function G$(e,t,r,i,n){var o=i;if((t&1)===0&&(t&2)===0&&i!==null)t:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var a=i.stateNode.containerInfo;if(a===n)break;if(s===4)for(s=i.return;s!==null;){var h=s.tag;if((h===3||h===4)&&s.stateNode.containerInfo===n)return;s=s.return}for(;a!==null;){if(s=fw(a),s===null)return;if(h=s.tag,h===5||h===6||h===26||h===27){i=o=s;continue t}a=a.parentNode}}i=i.return}cct(function(){var p=o,g=XG(r),w=[];t:{var C=Tct.get(e);if(C!==void 0){var R=K7,z=e;switch(e){case\"keypress\":if(c7(r)===0)break t;case\"keydown\":case\"keyup\":R=UDt;break;case\"focusin\":z=\"focus\",R=x$;break;case\"focusout\":z=\"blur\",R=x$;break;case\"beforeblur\":case\"afterblur\":R=x$;break;case\"click\":if(r.button===2)break t;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":R=Mat;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":R=PDt;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":R=$Dt;break;case vct:case bct:case xct:R=kDt;break;case wct:R=WDt;break;case\"scroll\":case\"scrollend\":R=MDt;break;case\"wheel\":R=HDt;break;case\"copy\":case\"cut\":case\"paste\":R=DDt;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":R=Pat;break;case\"toggle\":case\"beforetoggle\":R=XDt}var W=(t&4)!==0,Y=!W&&(e===\"scroll\"||e===\"scrollend\"),H=W?C!==null?C+\"Capture\":null:C;W=[];for(var Q=p,tt;Q!==null;){var rt=Q;if(tt=rt.stateNode,rt=rt.tag,rt!==5&&rt!==26&&rt!==27||tt===null||H===null||(rt=E5(Q,H),rt!=null&&W.push(B5(Q,rt,tt))),Y)break;Q=Q.return}0<W.length&&(C=new R(C,z,null,r,g),w.push({event:C,listeners:W}))}}if((t&7)===0){t:{if(C=e===\"mouseover\"||e===\"pointerover\",R=e===\"mouseout\"||e===\"pointerout\",C&&r!==oG&&(z=r.relatedTarget||r.fromElement)&&(fw(z)||z[Vw]))break t;if((R||C)&&(C=g.window===g?g:(C=g.ownerDocument)?C.defaultView||C.parentWindow:window,R?(z=r.relatedTarget||r.toElement,R=p,z=z?fw(z):null,z!==null&&(Y=U5(z),W=z.tag,z!==Y||W!==5&&W!==27&&W!==6)&&(z=null)):(R=null,z=p),R!==z)){if(W=Mat,rt=\"onMouseLeave\",H=\"onMouseEnter\",Q=\"mouse\",(e===\"pointerout\"||e===\"pointerover\")&&(W=Pat,rt=\"onPointerLeave\",H=\"onPointerEnter\",Q=\"pointer\"),Y=R==null?C:u5(R),tt=z==null?C:u5(z),C=new W(rt,Q+\"leave\",R,r,g),C.target=Y,C.relatedTarget=tt,rt=null,fw(g)===p&&(W=new W(H,Q+\"enter\",z,r,g),W.target=tt,W.relatedTarget=Y,rt=W),Y=rt,R&&z)e:{for(W=qOt,H=R,Q=z,tt=0,rt=H;rt;rt=W(rt))tt++;rt=0;for(var at=Q;at;at=W(at))rt++;for(;0<tt-rt;)H=W(H),tt--;for(;0<rt-tt;)Q=W(Q),rt--;for(;tt--;){if(H===Q||Q!==null&&H===Q.alternate){W=H;break e}H=W(H),Q=W(Q)}W=null}else W=null;R!==null&&vlt(w,C,R,W,!1),z!==null&&Y!==null&&vlt(w,Y,z,W,!0)}}t:{if(C=p?u5(p):window,R=C.nodeName&&C.nodeName.toLowerCase(),R===\"select\"||R===\"input\"&&C.type===\"file\")var et=Rat;else if(kat(C))if(mct)et=oOt;else{et=iOt;var lt=rOt}else R=C.nodeName,!R||R.toLowerCase()!==\"input\"||C.type!==\"checkbox\"&&C.type!==\"radio\"?p&&YG(p.elementType)&&(et=Rat):et=nOt;if(et&&(et=et(e,p))){pct(w,et,r,g);break t}lt&&lt(e,C,p),e===\"focusout\"&&p&&C.type===\"number\"&&p.memoizedProps.value!=null&&nG(C,\"number\",C.value)}switch(lt=p?u5(p):window,e){case\"focusin\":(kat(lt)||lt.contentEditable===\"true\")&&(gw=lt,aG=p,m5=null);break;case\"focusout\":m5=aG=gw=null;break;case\"mousedown\":lG=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":lG=!1,Bat(w,r,g);break;case\"selectionchange\":if(aOt)break;case\"keydown\":case\"keyup\":Bat(w,r,g)}var J;if(QG)t:{switch(e){case\"compositionstart\":var ft=\"onCompositionStart\";break t;case\"compositionend\":ft=\"onCompositionEnd\";break t;case\"compositionupdate\":ft=\"onCompositionUpdate\";break t}ft=void 0}else mw?dct(e,r)&&(ft=\"onCompositionEnd\"):e===\"keydown\"&&r.keyCode===229&&(ft=\"onCompositionStart\");ft&&(hct&&r.locale!==\"ko\"&&(mw||ft!==\"onCompositionStart\"?ft===\"onCompositionEnd\"&&mw&&(J=uct()):(By=g,ZG=\"value\"in By?By.value:By.textContent,mw=!0)),lt=$7(p,ft),0<lt.length&&(ft=new Eat(ft,e,null,r,g),w.push({event:ft,listeners:lt}),J?ft.data=J:(J=fct(r),J!==null&&(ft.data=J)))),(J=KDt?QDt(e,r):JDt(e,r))&&(ft=$7(p,\"onBeforeInput\"),0<ft.length&&(lt=new Eat(\"onBeforeInput\",\"beforeinput\",null,r,g),w.push({event:lt,listeners:ft}),lt.data=J)),GOt(w,e,p,r,g)}cht(w,t)})}function B5(e,t,r){return{instance:e,listener:t,currentTarget:r}}function $7(e,t){for(var r=t+\"Capture\",i=[];e!==null;){var n=e,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=E5(e,r),n!=null&&i.unshift(B5(e,n,o)),n=E5(e,t),n!=null&&i.push(B5(e,n,o))),e.tag===3)return i;e=e.return}return[]}function qOt(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function vlt(e,t,r,i,n){for(var o=t._reactName,s=[];r!==null&&r!==i;){var a=r,h=a.alternate,p=a.stateNode;if(a=a.tag,h!==null&&h===i)break;a!==5&&a!==26&&a!==27||p===null||(h=p,n?(p=E5(r,o),p!=null&&s.unshift(B5(r,p,h))):n||(p=E5(r,o),p!=null&&s.push(B5(r,p,h)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var HOt=/\\r\\n?/g,YOt=/\\u0000|\\uFFFD/g;function blt(e){return(typeof e==\"string\"?e:\"\"+e).replace(HOt,`\n`).replace(YOt,\"\")}function hht(e,t){return t=blt(t),blt(e)===t}function Zn(e,t,r,i,n,o){switch(r){case\"children\":typeof i==\"string\"?t===\"body\"||t===\"textarea\"&&i===\"\"||Rw(e,i):(typeof i==\"number\"||typeof i==\"bigint\")&&t!==\"body\"&&Rw(e,\"\"+i);break;case\"className\":qR(e,\"class\",i);break;case\"tabIndex\":qR(e,\"tabindex\",i);break;case\"dir\":case\"role\":case\"viewBox\":case\"width\":case\"height\":qR(e,r,i);break;case\"style\":lct(e,i,o);break;case\"data\":if(t!==\"object\"){qR(e,\"data\",i);break}case\"src\":case\"href\":if(i===\"\"&&(t!==\"a\"||r!==\"href\")){e.removeAttribute(r);break}if(i==null||typeof i==\"function\"||typeof i==\"symbol\"||typeof i==\"boolean\"){e.removeAttribute(r);break}i=a7(\"\"+i),e.setAttribute(r,i);break;case\"action\":case\"formAction\":if(typeof i==\"function\"){e.setAttribute(r,\"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')\");break}else typeof o==\"function\"&&(r===\"formAction\"?(t!==\"input\"&&Zn(e,t,\"name\",n.name,n,null),Zn(e,t,\"formEncType\",n.formEncType,n,null),Zn(e,t,\"formMethod\",n.formMethod,n,null),Zn(e,t,\"formTarget\",n.formTarget,n,null)):(Zn(e,t,\"encType\",n.encType,n,null),Zn(e,t,\"method\",n.method,n,null),Zn(e,t,\"target\",n.target,n,null)));if(i==null||typeof i==\"symbol\"||typeof i==\"boolean\"){e.removeAttribute(r);break}i=a7(\"\"+i),e.setAttribute(r,i);break;case\"onClick\":i!=null&&(e.onclick=pg);break;case\"onScroll\":i!=null&&Gi(\"scroll\",e);break;case\"onScrollEnd\":i!=null&&Gi(\"scrollend\",e);break;case\"dangerouslySetInnerHTML\":if(i!=null){if(typeof i!=\"object\"||!(\"__html\"in i))throw Error(Fe(61));if(r=i.__html,r!=null){if(n.children!=null)throw Error(Fe(60));e.innerHTML=r}}break;case\"multiple\":e.multiple=i&&typeof i!=\"function\"&&typeof i!=\"symbol\";break;case\"muted\":e.muted=i&&typeof i!=\"function\"&&typeof i!=\"symbol\";break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"defaultValue\":case\"defaultChecked\":case\"innerHTML\":case\"ref\":break;case\"autoFocus\":break;case\"xlinkHref\":if(i==null||typeof i==\"function\"||typeof i==\"boolean\"||typeof i==\"symbol\"){e.removeAttribute(\"xlink:href\");break}r=a7(\"\"+i),e.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",r);break;case\"contentEditable\":case\"spellCheck\":case\"draggable\":case\"value\":case\"autoReverse\":case\"externalResourcesRequired\":case\"focusable\":case\"preserveAlpha\":i!=null&&typeof i!=\"function\"&&typeof i!=\"symbol\"?e.setAttribute(r,\"\"+i):e.removeAttribute(r);break;case\"inert\":case\"allowFullScreen\":case\"async\":case\"autoPlay\":case\"controls\":case\"default\":case\"defer\":case\"disabled\":case\"disablePictureInPicture\":case\"disableRemotePlayback\":case\"formNoValidate\":case\"hidden\":case\"loop\":case\"noModule\":case\"noValidate\":case\"open\":case\"playsInline\":case\"readOnly\":case\"required\":case\"reversed\":case\"scoped\":case\"seamless\":case\"itemScope\":i&&typeof i!=\"function\"&&typeof i!=\"symbol\"?e.setAttribute(r,\"\"):e.removeAttribute(r);break;case\"capture\":case\"download\":i===!0?e.setAttribute(r,\"\"):i!==!1&&i!=null&&typeof i!=\"function\"&&typeof i!=\"symbol\"?e.setAttribute(r,i):e.removeAttribute(r);break;case\"cols\":case\"rows\":case\"size\":case\"span\":i!=null&&typeof i!=\"function\"&&typeof i!=\"symbol\"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case\"rowSpan\":case\"start\":i==null||typeof i==\"function\"||typeof i==\"symbol\"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case\"popover\":Gi(\"beforetoggle\",e),Gi(\"toggle\",e),s7(e,\"popover\",i);break;case\"xlinkActuate\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:actuate\",i);break;case\"xlinkArcrole\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:arcrole\",i);break;case\"xlinkRole\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:role\",i);break;case\"xlinkShow\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:show\",i);break;case\"xlinkTitle\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:title\",i);break;case\"xlinkType\":sg(e,\"http://www.w3.org/1999/xlink\",\"xlink:type\",i);break;case\"xmlBase\":sg(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:base\",i);break;case\"xmlLang\":sg(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:lang\",i);break;case\"xmlSpace\":sg(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:space\",i);break;case\"is\":s7(e,\"is\",i);break;case\"innerText\":case\"textContent\":break;default:(!(2<r.length)||r[0]!==\"o\"&&r[0]!==\"O\"||r[1]!==\"n\"&&r[1]!==\"N\")&&(r=TDt.get(r)||r,s7(e,r,i))}}function RG(e,t,r,i,n,o){switch(r){case\"style\":lct(e,i,o);break;case\"dangerouslySetInnerHTML\":if(i!=null){if(typeof i!=\"object\"||!(\"__html\"in i))throw Error(Fe(61));if(r=i.__html,r!=null){if(n.children!=null)throw Error(Fe(60));e.innerHTML=r}}break;case\"children\":typeof i==\"string\"?Rw(e,i):(typeof i==\"number\"||typeof i==\"bigint\")&&Rw(e,\"\"+i);break;case\"onScroll\":i!=null&&Gi(\"scroll\",e);break;case\"onScrollEnd\":i!=null&&Gi(\"scrollend\",e);break;case\"onClick\":i!=null&&(e.onclick=pg);break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"innerHTML\":case\"ref\":break;case\"innerText\":case\"textContent\":break;default:if(!rct.hasOwnProperty(r))t:{if(r[0]===\"o\"&&r[1]===\"n\"&&(n=r.endsWith(\"Capture\"),t=r.slice(2,n?r.length-7:void 0),o=e[Au]||null,o=o!=null?o[r]:null,typeof o==\"function\"&&e.removeEventListener(t,o,n),typeof i==\"function\")){typeof o!=\"function\"&&o!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,n);break t}r in e?e[r]=i:i===!0?e.setAttribute(r,\"\"):s7(e,r,i)}}}function Pl(e,t,r){switch(t){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"img\":Gi(\"error\",e),Gi(\"load\",e);var i=!1,n=!1,o;for(o in r)if(r.hasOwnProperty(o)){var s=r[o];if(s!=null)switch(o){case\"src\":i=!0;break;case\"srcSet\":n=!0;break;case\"children\":case\"dangerouslySetInnerHTML\":throw Error(Fe(137,t));default:Zn(e,t,o,s,r,null)}}n&&Zn(e,t,\"srcSet\",r.srcSet,r,null),i&&Zn(e,t,\"src\",r.src,r,null);return;case\"input\":Gi(\"invalid\",e);var a=o=s=n=null,h=null,p=null;for(i in r)if(r.hasOwnProperty(i)){var g=r[i];if(g!=null)switch(i){case\"name\":n=g;break;case\"type\":s=g;break;case\"checked\":h=g;break;case\"defaultChecked\":p=g;break;case\"value\":o=g;break;case\"defaultValue\":a=g;break;case\"children\":case\"dangerouslySetInnerHTML\":if(g!=null)throw Error(Fe(137,t));break;default:Zn(e,t,i,g,r,null)}}oct(e,o,a,h,p,s,n,!1);return;case\"select\":Gi(\"invalid\",e),i=s=o=null;for(n in r)if(r.hasOwnProperty(n)&&(a=r[n],a!=null))switch(n){case\"value\":o=a;break;case\"defaultValue\":s=a;break;case\"multiple\":i=a;default:Zn(e,t,n,a,r,null)}t=o,r=s,e.multiple=!!i,t!=null?Tw(e,!!i,t,!1):r!=null&&Tw(e,!!i,r,!0);return;case\"textarea\":Gi(\"invalid\",e),o=n=i=null;for(s in r)if(r.hasOwnProperty(s)&&(a=r[s],a!=null))switch(s){case\"value\":i=a;break;case\"defaultValue\":n=a;break;case\"children\":o=a;break;case\"dangerouslySetInnerHTML\":if(a!=null)throw Error(Fe(91));break;default:Zn(e,t,s,a,r,null)}act(e,i,n,o);return;case\"option\":for(h in r)r.hasOwnProperty(h)&&(i=r[h],i!=null)&&(h===\"selected\"?e.selected=i&&typeof i!=\"function\"&&typeof i!=\"symbol\":Zn(e,t,h,i,r,null));return;case\"dialog\":Gi(\"beforetoggle\",e),Gi(\"toggle\",e),Gi(\"cancel\",e),Gi(\"close\",e);break;case\"iframe\":case\"object\":Gi(\"load\",e);break;case\"video\":case\"audio\":for(i=0;i<L5.length;i++)Gi(L5[i],e);break;case\"image\":Gi(\"error\",e),Gi(\"load\",e);break;case\"details\":Gi(\"toggle\",e);break;case\"embed\":case\"source\":case\"link\":Gi(\"error\",e),Gi(\"load\",e);case\"area\":case\"base\":case\"br\":case\"col\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"track\":case\"wbr\":case\"menuitem\":for(p in r)if(r.hasOwnProperty(p)&&(i=r[p],i!=null))switch(p){case\"children\":case\"dangerouslySetInnerHTML\":throw Error(Fe(137,t));default:Zn(e,t,p,i,r,null)}return;default:if(YG(t)){for(g in r)r.hasOwnProperty(g)&&(i=r[g],i!==void 0&&RG(e,t,g,i,r,void 0));return}}for(a in r)r.hasOwnProperty(a)&&(i=r[a],i!=null&&Zn(e,t,a,i,r,null))}function XOt(e,t,r,i){switch(t){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"input\":var n=null,o=null,s=null,a=null,h=null,p=null,g=null;for(R in r){var w=r[R];if(r.hasOwnProperty(R)&&w!=null)switch(R){case\"checked\":break;case\"value\":break;case\"defaultValue\":h=w;default:i.hasOwnProperty(R)||Zn(e,t,R,null,i,w)}}for(var C in i){var R=i[C];if(w=r[C],i.hasOwnProperty(C)&&(R!=null||w!=null))switch(C){case\"type\":o=R;break;case\"name\":n=R;break;case\"checked\":p=R;break;case\"defaultChecked\":g=R;break;case\"value\":s=R;break;case\"defaultValue\":a=R;break;case\"children\":case\"dangerouslySetInnerHTML\":if(R!=null)throw Error(Fe(137,t));break;default:R!==w&&Zn(e,t,C,R,i,w)}}iG(e,s,a,h,p,g,o,n);return;case\"select\":R=s=a=C=null;for(o in r)if(h=r[o],r.hasOwnProperty(o)&&h!=null)switch(o){case\"value\":break;case\"multiple\":R=h;default:i.hasOwnProperty(o)||Zn(e,t,o,null,i,h)}for(n in i)if(o=i[n],h=r[n],i.hasOwnProperty(n)&&(o!=null||h!=null))switch(n){case\"value\":C=o;break;case\"defaultValue\":a=o;break;case\"multiple\":s=o;default:o!==h&&Zn(e,t,n,o,i,h)}t=a,r=s,i=R,C!=null?Tw(e,!!r,C,!1):!!i!=!!r&&(t!=null?Tw(e,!!r,t,!0):Tw(e,!!r,r?[]:\"\",!1));return;case\"textarea\":R=C=null;for(a in r)if(n=r[a],r.hasOwnProperty(a)&&n!=null&&!i.hasOwnProperty(a))switch(a){case\"value\":break;case\"children\":break;default:Zn(e,t,a,null,i,n)}for(s in i)if(n=i[s],o=r[s],i.hasOwnProperty(s)&&(n!=null||o!=null))switch(s){case\"value\":C=n;break;case\"defaultValue\":R=n;break;case\"children\":break;case\"dangerouslySetInnerHTML\":if(n!=null)throw Error(Fe(91));break;default:n!==o&&Zn(e,t,s,n,i,o)}sct(e,C,R);return;case\"option\":for(var z in r)C=r[z],r.hasOwnProperty(z)&&C!=null&&!i.hasOwnProperty(z)&&(z===\"selected\"?e.selected=!1:Zn(e,t,z,null,i,C));for(h in i)C=i[h],R=r[h],i.hasOwnProperty(h)&&C!==R&&(C!=null||R!=null)&&(h===\"selected\"?e.selected=C&&typeof C!=\"function\"&&typeof C!=\"symbol\":Zn(e,t,h,C,i,R));return;case\"img\":case\"link\":case\"area\":case\"base\":case\"br\":case\"col\":case\"embed\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"source\":case\"track\":case\"wbr\":case\"menuitem\":for(var W in r)C=r[W],r.hasOwnProperty(W)&&C!=null&&!i.hasOwnProperty(W)&&Zn(e,t,W,null,i,C);for(p in i)if(C=i[p],R=r[p],i.hasOwnProperty(p)&&C!==R&&(C!=null||R!=null))switch(p){case\"children\":case\"dangerouslySetInnerHTML\":if(C!=null)throw Error(Fe(137,t));break;default:Zn(e,t,p,C,i,R)}return;default:if(YG(t)){for(var Y in r)C=r[Y],r.hasOwnProperty(Y)&&C!==void 0&&!i.hasOwnProperty(Y)&&RG(e,t,Y,void 0,i,C);for(g in i)C=i[g],R=r[g],!i.hasOwnProperty(g)||C===R||C===void 0&&R===void 0||RG(e,t,g,C,i,R);return}}for(var H in r)C=r[H],r.hasOwnProperty(H)&&C!=null&&!i.hasOwnProperty(H)&&Zn(e,t,H,null,i,C);for(w in i)C=i[w],R=r[w],!i.hasOwnProperty(w)||C===R||C==null&&R==null||Zn(e,t,w,C,i,R)}function xlt(e){switch(e){case\"css\":case\"script\":case\"font\":case\"img\":case\"image\":case\"input\":case\"link\":return!0;default:return!1}}function ZOt(){if(typeof performance.getEntriesByType==\"function\"){for(var e=0,t=0,r=performance.getEntriesByType(\"resource\"),i=0;i<r.length;i++){var n=r[i],o=n.transferSize,s=n.initiatorType,a=n.duration;if(o&&a&&xlt(s)){for(s=0,a=n.responseEnd,i+=1;i<r.length;i++){var h=r[i],p=h.startTime;if(p>a)break;var g=h.transferSize,w=h.initiatorType;g&&xlt(w)&&(h=h.responseEnd,s+=g*(h<a?1:(a-p)/(h-p)))}if(--i,t+=8*(o+s)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==\"number\")?e:5}var DG=null,OG=null;function G7(e){return e.nodeType===9?e:e.ownerDocument}function wlt(e){switch(e){case\"http://www.w3.org/2000/svg\":return 1;case\"http://www.w3.org/1998/Math/MathML\":return 2;default:return 0}}function dht(e,t){if(e===0)switch(t){case\"svg\":return 1;case\"math\":return 2;default:return 0}return e===1&&t===\"foreignObject\"?0:e}function LG(e,t){return e===\"textarea\"||e===\"noscript\"||typeof t.children==\"string\"||typeof t.children==\"number\"||typeof t.children==\"bigint\"||typeof t.dangerouslySetInnerHTML==\"object\"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var W$=null;function KOt(){var e=window.event;return e&&e.type===\"popstate\"?e===W$?!1:(W$=e,!0):(W$=null,!1)}var fht=typeof setTimeout==\"function\"?setTimeout:void 0,QOt=typeof clearTimeout==\"function\"?clearTimeout:void 0,Tlt=typeof Promise==\"function\"?Promise:void 0,JOt=typeof queueMicrotask==\"function\"?queueMicrotask:typeof Tlt<\"u\"?function(e){return Tlt.resolve(null).then(e).catch(tLt)}:fht;function tLt(e){setTimeout(function(){throw e})}function t1(e){return e===\"head\"}function Slt(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r===\"/$\"||r===\"/&\"){if(i===0){e.removeChild(n),Uw(t);return}i--}else if(r===\"$\"||r===\"$?\"||r===\"$~\"||r===\"$!\"||r===\"&\")i++;else if(r===\"html\")S5(e.ownerDocument.documentElement);else if(r===\"head\"){r=e.ownerDocument.head,S5(r);for(var o=r.firstChild;o;){var s=o.nextSibling,a=o.nodeName;o[G5]||a===\"SCRIPT\"||a===\"STYLE\"||a===\"LINK\"&&o.rel.toLowerCase()===\"stylesheet\"||r.removeChild(o),o=s}}else r===\"body\"&&S5(e.ownerDocument.body);r=n}while(r);Uw(t)}function Mlt(e,t){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display=\"none\"):(r.style.display=r._stashedDisplay||\"\",r.getAttribute(\"style\")===\"\"&&r.removeAttribute(\"style\")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=\"\"):r.nodeValue=r._stashedText||\"\"),i&&i.nodeType===8)if(r=i.data,r===\"/$\"){if(e===0)break;e--}else r!==\"$\"&&r!==\"$?\"&&r!==\"$~\"&&r!==\"$!\"||e++;r=i}while(r)}function BG(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case\"HTML\":case\"HEAD\":case\"BODY\":BG(r),HG(r);continue;case\"SCRIPT\":case\"STYLE\":continue;case\"LINK\":if(r.rel.toLowerCase()===\"stylesheet\")continue}e.removeChild(r)}}function eLt(e,t,r,i){for(;e.nodeType===1;){var n=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!==\"INPUT\"||e.type!==\"hidden\"))break}else if(i){if(!e[G5])switch(t){case\"meta\":if(!e.hasAttribute(\"itemprop\"))break;return e;case\"link\":if(o=e.getAttribute(\"rel\"),o===\"stylesheet\"&&e.hasAttribute(\"data-precedence\"))break;if(o!==n.rel||e.getAttribute(\"href\")!==(n.href==null||n.href===\"\"?null:n.href)||e.getAttribute(\"crossorigin\")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute(\"title\")!==(n.title==null?null:n.title))break;return e;case\"style\":if(e.hasAttribute(\"data-precedence\"))break;return e;case\"script\":if(o=e.getAttribute(\"src\"),(o!==(n.src==null?null:n.src)||e.getAttribute(\"type\")!==(n.type==null?null:n.type)||e.getAttribute(\"crossorigin\")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&e.hasAttribute(\"async\")&&!e.hasAttribute(\"itemprop\"))break;return e;default:return e}}else if(t===\"input\"&&e.type===\"hidden\"){var o=n.name==null?null:\"\"+n.name;if(n.type===\"hidden\"&&e.getAttribute(\"name\")===o)return e}else return e;if(e=bd(e.nextSibling),e===null)break}return null}function rLt(e,t,r){if(t===\"\")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==\"INPUT\"||e.type!==\"hidden\")&&!r||(e=bd(e.nextSibling),e===null))return null;return e}function pht(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==\"INPUT\"||e.type!==\"hidden\")&&!t||(e=bd(e.nextSibling),e===null))return null;return e}function FG(e){return e.data===\"$?\"||e.data===\"$~\"}function NG(e){return e.data===\"$!\"||e.data===\"$?\"&&e.ownerDocument.readyState!==\"loading\"}function iLt(e,t){var r=e.ownerDocument;if(e.data===\"$~\")e._reactRetry=t;else if(e.data!==\"$?\"||r.readyState!==\"loading\")t();else{var i=function(){t(),r.removeEventListener(\"DOMContentLoaded\",i)};r.addEventListener(\"DOMContentLoaded\",i),e._reactRetry=i}}function bd(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===\"$\"||t===\"$!\"||t===\"$?\"||t===\"$~\"||t===\"&\"||t===\"F!\"||t===\"F\")break;if(t===\"/$\"||t===\"/&\")return null}}return e}var zG=null;function Elt(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r===\"/$\"||r===\"/&\"){if(t===0)return bd(e.nextSibling);t--}else r!==\"$\"&&r!==\"$!\"&&r!==\"$?\"&&r!==\"$~\"&&r!==\"&\"||t++}e=e.nextSibling}return null}function Plt(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r===\"$\"||r===\"$!\"||r===\"$?\"||r===\"$~\"||r===\"&\"){if(t===0)return e;t--}else r!==\"/$\"&&r!==\"/&\"||t++}e=e.previousSibling}return null}function mht(e,t,r){switch(t=G7(r),e){case\"html\":if(e=t.documentElement,!e)throw Error(Fe(452));return e;case\"head\":if(e=t.head,!e)throw Error(Fe(453));return e;case\"body\":if(e=t.body,!e)throw Error(Fe(454));return e;default:throw Error(Fe(451))}}function S5(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);HG(e)}var xd=new Map,Clt=new Set;function W7(e){return typeof e.getRootNode==\"function\"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tg=Pn.d;Pn.d={f:nLt,r:oLt,D:sLt,C:aLt,L:lLt,m:cLt,X:hLt,S:uLt,M:dLt};function nLt(){var e=Tg.f(),t=lD();return e||t}function oLt(e){var t=jw(e);t!==null&&t.tag===5&&t.type===\"form\"?lut(t):Tg.r(e)}var qw=typeof document>\"u\"?null:document;function ght(e,t,r){var i=qw;if(i&&typeof t==\"string\"&&t){var n=Ad(t);n='link[rel=\"'+e+'\"][href=\"'+n+'\"]',typeof r==\"string\"&&(n+='[crossorigin=\"'+r+'\"]'),Clt.has(n)||(Clt.add(n),e={rel:e,crossOrigin:r,href:t},i.querySelector(n)===null&&(t=i.createElement(\"link\"),Pl(t,\"link\",e),Qa(t),i.head.appendChild(t)))}}function sLt(e){Tg.D(e),ght(\"dns-prefetch\",e,null)}function aLt(e,t){Tg.C(e,t),ght(\"preconnect\",e,t)}function lLt(e,t,r){Tg.L(e,t,r);var i=qw;if(i&&e&&t){var n='link[rel=\"preload\"][as=\"'+Ad(t)+'\"]';t===\"image\"&&r&&r.imageSrcSet?(n+='[imagesrcset=\"'+Ad(r.imageSrcSet)+'\"]',typeof r.imageSizes==\"string\"&&(n+='[imagesizes=\"'+Ad(r.imageSizes)+'\"]')):n+='[href=\"'+Ad(e)+'\"]';var o=n;switch(t){case\"style\":o=zw(e);break;case\"script\":o=Hw(e)}xd.has(o)||(e=zo({rel:\"preload\",href:t===\"image\"&&r&&r.imageSrcSet?void 0:e,as:t},r),xd.set(o,e),i.querySelector(n)!==null||t===\"style\"&&i.querySelector(Z5(o))||t===\"script\"&&i.querySelector(K5(o))||(t=i.createElement(\"link\"),Pl(t,\"link\",e),Qa(t),i.head.appendChild(t)))}}function cLt(e,t){Tg.m(e,t);var r=qw;if(r&&e){var i=t&&typeof t.as==\"string\"?t.as:\"script\",n='link[rel=\"modulepreload\"][as=\"'+Ad(i)+'\"][href=\"'+Ad(e)+'\"]',o=n;switch(i){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":o=Hw(e)}if(!xd.has(o)&&(e=zo({rel:\"modulepreload\",href:e},t),xd.set(o,e),r.querySelector(n)===null)){switch(i){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(r.querySelector(K5(o)))return}i=r.createElement(\"link\"),Pl(i,\"link\",e),Qa(i),r.head.appendChild(i)}}}function uLt(e,t,r){Tg.S(e,t,r);var i=qw;if(i&&e){var n=ww(i).hoistableStyles,o=zw(e);t=t||\"default\";var s=n.get(o);if(!s){var a={loading:0,preload:null};if(s=i.querySelector(Z5(o)))a.loading=5;else{e=zo({rel:\"stylesheet\",href:e,\"data-precedence\":t},r),(r=xd.get(o))&&RW(e,r);var h=s=i.createElement(\"link\");Qa(h),Pl(h,\"link\",e),h._p=new Promise(function(p,g){h.onload=p,h.onerror=g}),h.addEventListener(\"load\",function(){a.loading|=1}),h.addEventListener(\"error\",function(){a.loading|=2}),a.loading|=4,A7(s,t,i)}s={type:\"stylesheet\",instance:s,count:1,state:a},n.set(o,s)}}}function hLt(e,t){Tg.X(e,t);var r=qw;if(r&&e){var i=ww(r).hoistableScripts,n=Hw(e),o=i.get(n);o||(o=r.querySelector(K5(n)),o||(e=zo({src:e,async:!0},t),(t=xd.get(n))&&DW(e,t),o=r.createElement(\"script\"),Qa(o),Pl(o,\"link\",e),r.head.appendChild(o)),o={type:\"script\",instance:o,count:1,state:null},i.set(n,o))}}function dLt(e,t){Tg.M(e,t);var r=qw;if(r&&e){var i=ww(r).hoistableScripts,n=Hw(e),o=i.get(n);o||(o=r.querySelector(K5(n)),o||(e=zo({src:e,async:!0,type:\"module\"},t),(t=xd.get(n))&&DW(e,t),o=r.createElement(\"script\"),Qa(o),Pl(o,\"link\",e),r.head.appendChild(o)),o={type:\"script\",instance:o,count:1,state:null},i.set(n,o))}}function Ilt(e,t,r,i){var n=(n=Uy.current)?W7(n):null;if(!n)throw Error(Fe(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof r.precedence==\"string\"&&typeof r.href==\"string\"?(t=zw(r.href),r=ww(n).hoistableStyles,i=r.get(t),i||(i={type:\"style\",instance:null,count:0,state:null},r.set(t,i)),i):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(r.rel===\"stylesheet\"&&typeof r.href==\"string\"&&typeof r.precedence==\"string\"){e=zw(r.href);var o=ww(n).hoistableStyles,s=o.get(e);if(s||(n=n.ownerDocument||n,s={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=n.querySelector(Z5(e)))&&!o._p&&(s.instance=o,s.state.loading=5),xd.has(e)||(r={rel:\"preload\",as:\"style\",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},xd.set(e,r),o||fLt(n,e,r,s.state))),t&&i===null)throw Error(Fe(528,\"\"));return s}if(t&&i!==null)throw Error(Fe(529,\"\"));return null;case\"script\":return t=r.async,r=r.src,typeof r==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(t=Hw(r),r=ww(n).hoistableScripts,i=r.get(t),i||(i={type:\"script\",instance:null,count:0,state:null},r.set(t,i)),i):{type:\"void\",instance:null,count:0,state:null};default:throw Error(Fe(444,e))}}function zw(e){return'href=\"'+Ad(e)+'\"'}function Z5(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function Aht(e){return zo({},e,{\"data-precedence\":e.precedence,precedence:null})}function fLt(e,t,r,i){e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")?i.loading=1:(t=e.createElement(\"link\"),i.preload=t,t.addEventListener(\"load\",function(){return i.loading|=1}),t.addEventListener(\"error\",function(){return i.loading|=2}),Pl(t,\"link\",r),Qa(t),e.head.appendChild(t))}function Hw(e){return'[src=\"'+Ad(e)+'\"]'}function K5(e){return\"script[async]\"+e}function klt(e,t,r){if(t.count++,t.instance===null)switch(t.type){case\"style\":var i=e.querySelector('style[data-href~=\"'+Ad(r.href)+'\"]');if(i)return t.instance=i,Qa(i),i;var n=zo({},r,{\"data-href\":r.href,\"data-precedence\":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement(\"style\"),Qa(i),Pl(i,\"style\",n),A7(i,r.precedence,e),t.instance=i;case\"stylesheet\":n=zw(r.href);var o=e.querySelector(Z5(n));if(o)return t.state.loading|=4,t.instance=o,Qa(o),o;i=Aht(r),(n=xd.get(n))&&RW(i,n),o=(e.ownerDocument||e).createElement(\"link\"),Qa(o);var s=o;return s._p=new Promise(function(a,h){s.onload=a,s.onerror=h}),Pl(o,\"link\",i),t.state.loading|=4,A7(o,r.precedence,e),t.instance=o;case\"script\":return o=Hw(r.src),(n=e.querySelector(K5(o)))?(t.instance=n,Qa(n),n):(i=r,(n=xd.get(o))&&(i=zo({},r),DW(i,n)),e=e.ownerDocument||e,n=e.createElement(\"script\"),Qa(n),Pl(n,\"link\",i),e.head.appendChild(n),t.instance=n);case\"void\":return null;default:throw Error(Fe(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,A7(i,r.precedence,e));return t.instance}function A7(e,t,r){for(var i=r.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),n=i.length?i[i.length-1]:null,o=n,s=0;s<i.length;s++){var a=i[s];if(a.dataset.precedence===t)o=a;else if(o!==n)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function RW(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function DW(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var y7=null;function Rlt(e,t,r){if(y7===null){var i=new Map,n=y7=new Map;n.set(r,i)}else n=y7,i=n.get(r),i||(i=new Map,n.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),n=0;n<r.length;n++){var o=r[n];if(!(o[G5]||o[Sl]||e===\"link\"&&o.getAttribute(\"rel\")===\"stylesheet\")&&o.namespaceURI!==\"http://www.w3.org/2000/svg\"){var s=o.getAttribute(t)||\"\";s=e+s;var a=i.get(s);a?a.push(o):i.set(s,[o])}}return i}function Dlt(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t===\"title\"?e.querySelector(\"head > title\"):null)}function pLt(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function yht(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function mLt(e,t,r,i){if(r.type===\"stylesheet\"&&(typeof i.media!=\"string\"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var n=zw(i.href),o=t.querySelector(Z5(n));if(o){t=o._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=q7.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=o,Qa(o);return}o=t.ownerDocument||t,i=Aht(i),(n=xd.get(n))&&RW(i,n),o=o.createElement(\"link\"),Qa(o);var s=o;s._p=new Promise(function(a,h){s.onload=a,s.onerror=h}),Pl(o,\"link\",i),r.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=q7.bind(e),t.addEventListener(\"load\",r),t.addEventListener(\"error\",r))}}var q$=0;function gLt(e,t){return e.stylesheets&&e.count===0&&_7(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&_7(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&q$===0&&(q$=62500*ZOt());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_7(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>q$?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(n)}}:null}function q7(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_7(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var H7=null;function _7(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,H7=new Map,t.forEach(ALt,e),H7=null,q7.call(e))}function ALt(e,t){if(!(t.state.loading&4)){var r=H7.get(e);if(r)var i=r.get(null);else{r=new Map,H7.set(e,r);for(var n=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),o=0;o<n.length;o++){var s=n[o];(s.nodeName===\"LINK\"||s.getAttribute(\"media\")!==\"not all\")&&(r.set(s.dataset.precedence,s),i=s)}i&&r.set(null,i)}n=t.instance,s=n.getAttribute(\"data-precedence\"),o=r.get(s)||i,o===i&&r.set(null,n),r.set(s,n),this.count++,i=q7.bind(this),n.addEventListener(\"load\",i),n.addEventListener(\"error\",i),o?o.parentNode.insertBefore(n,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var F5={$$typeof:fg,Provider:null,Consumer:null,_currentValue:Mv,_currentValue2:Mv,_threadCount:0};function yLt(e,t,r,i,n,o,s,a,h){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=y$(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=y$(0),this.hiddenUpdates=y$(null),this.identifierPrefix=i,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function _ht(e,t,r,i,n,o,s,a,h,p,g,w){return e=new yLt(e,t,r,s,h,p,g,w,a),t=1,o===!0&&(t|=24),o=lh(3,null,null,t),e.current=o,o.stateNode=e,t=oW(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:r,cache:t},lW(o),e}function vht(e){return e?(e=_w,e):_w}function bht(e,t,r,i,n,o){n=vht(n),i.context===null?i.context=n:i.pendingContext=n,i=jy(t),i.payload={element:r},o=o===void 0?null:o,o!==null&&(i.callback=o),r=$y(e,i,t),r!==null&&(gu(r,e,t),A5(r,e,t))}function Olt(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function OW(e,t){Olt(e,t),(e=e.alternate)&&Olt(e,t)}function xht(e){if(e.tag===13||e.tag===31){var t=zv(e,67108864);t!==null&&gu(t,e,67108864),OW(e,67108864)}}function Llt(e){if(e.tag===13||e.tag===31){var t=fh();t=WG(t);var r=zv(e,t);r!==null&&gu(r,e,t),OW(e,t)}}var Y7=!0;function _Lt(e,t,r,i){var n=hi.T;hi.T=null;var o=Pn.p;try{Pn.p=2,LW(e,t,r,i)}finally{Pn.p=o,hi.T=n}}function vLt(e,t,r,i){var n=hi.T;hi.T=null;var o=Pn.p;try{Pn.p=8,LW(e,t,r,i)}finally{Pn.p=o,hi.T=n}}function LW(e,t,r,i){if(Y7){var n=UG(i);if(n===null)G$(e,t,i,X7,r),Blt(e,i);else if(xLt(n,e,t,r,i))i.stopPropagation();else if(Blt(e,i),t&4&&-1<bLt.indexOf(e)){for(;n!==null;){var o=jw(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var s=wv(o.pendingLanes);if(s!==0){var a=o;for(a.pendingLanes|=2,a.entangledLanes|=2;s;){var h=1<<31-dh(s);a.entanglements[1]|=h,s&=~h}h0(o),(En&6)===0&&(N7=uh()+500,X5(0,!1))}}break;case 31:case 13:a=zv(o,2),a!==null&&gu(a,o,2),lD(),OW(o,2)}if(o=UG(i),o===null&&G$(e,t,i,X7,r),o===n)break;n=o}n!==null&&i.stopPropagation()}else G$(e,t,i,null,r)}}function UG(e){return e=XG(e),BW(e)}var X7=null;function BW(e){if(X7=null,e=fw(e),e!==null){var t=U5(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=jlt(t),e!==null)return e;e=null}else if(r===31){if(e=$lt(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return X7=e,null}function wht(e){switch(e){case\"beforetoggle\":case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"toggle\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 2;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 8;case\"message\":switch(lDt()){case Hlt:return 2;case Ylt:return 8;case T7:case cDt:return 32;case Xlt:return 268435456;default:return 32}default:return 32}}var VG=!1,qy=null,Hy=null,Yy=null,N5=new Map,z5=new Map,Oy=[],bLt=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset\".split(\" \");function Blt(e,t){switch(e){case\"focusin\":case\"focusout\":qy=null;break;case\"dragenter\":case\"dragleave\":Hy=null;break;case\"mouseover\":case\"mouseout\":Yy=null;break;case\"pointerover\":case\"pointerout\":N5.delete(t.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":z5.delete(t.pointerId)}}function s5(e,t,r,i,n,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:o,targetContainers:[n]},t!==null&&(t=jw(t),t!==null&&xht(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function xLt(e,t,r,i,n){switch(t){case\"focusin\":return qy=s5(qy,e,t,r,i,n),!0;case\"dragenter\":return Hy=s5(Hy,e,t,r,i,n),!0;case\"mouseover\":return Yy=s5(Yy,e,t,r,i,n),!0;case\"pointerover\":var o=n.pointerId;return N5.set(o,s5(N5.get(o)||null,e,t,r,i,n)),!0;case\"gotpointercapture\":return o=n.pointerId,z5.set(o,s5(z5.get(o)||null,e,t,r,i,n)),!0}return!1}function Tht(e){var t=fw(e.target);if(t!==null){var r=U5(t);if(r!==null){if(t=r.tag,t===13){if(t=jlt(r),t!==null){e.blockedOn=t,_at(e.priority,function(){Llt(r)});return}}else if(t===31){if(t=$lt(r),t!==null){e.blockedOn=t,_at(e.priority,function(){Llt(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function v7(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=UG(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);oG=i,r.target.dispatchEvent(i),oG=null}else return t=jw(r),t!==null&&xht(t),e.blockedOn=r,!1;t.shift()}return!0}function Flt(e,t,r){v7(e)&&r.delete(t)}function wLt(){VG=!1,qy!==null&&v7(qy)&&(qy=null),Hy!==null&&v7(Hy)&&(Hy=null),Yy!==null&&v7(Yy)&&(Yy=null),N5.forEach(Flt),z5.forEach(Flt)}function n7(e,t){e.blockedOn===t&&(e.blockedOn=null,VG||(VG=!0,Ma.unstable_scheduleCallback(Ma.unstable_NormalPriority,wLt)))}var o7=null;function Nlt(e){o7!==e&&(o7=e,Ma.unstable_scheduleCallback(Ma.unstable_NormalPriority,function(){o7===e&&(o7=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],n=e[t+2];if(typeof i!=\"function\"){if(BW(i||r)===null)continue;break}var o=jw(r);o!==null&&(e.splice(t,3),t-=3,bG(o,{pending:!0,data:n,method:r.method,action:i},i,n))}}))}function Uw(e){function t(h){return n7(h,e)}qy!==null&&n7(qy,e),Hy!==null&&n7(Hy,e),Yy!==null&&n7(Yy,e),N5.forEach(t),z5.forEach(t);for(var r=0;r<Oy.length;r++){var i=Oy[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Oy.length&&(r=Oy[0],r.blockedOn===null);)Tht(r),r.blockedOn===null&&Oy.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var n=r[i],o=r[i+1],s=n[Au]||null;if(typeof o==\"function\")s||Nlt(r);else if(s){var a=null;if(o&&o.hasAttribute(\"formAction\")){if(n=o,s=o[Au]||null)a=s.formAction;else if(BW(n)!==null)continue}else a=s.action;typeof a==\"function\"?r[i+1]=a:(r.splice(i,3),i-=3),Nlt(r)}}}function Sht(){function e(o){o.canIntercept&&o.info===\"react-transition\"&&o.intercept({handler:function(){return new Promise(function(s){return n=s})},focusReset:\"manual\",scroll:\"manual\"})}function t(){n!==null&&(n(),n=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:\"react-transition\",history:\"replace\"})}}if(typeof navigation==\"object\"){var i=!1,n=null;return navigation.addEventListener(\"navigate\",e),navigation.addEventListener(\"navigatesuccess\",t),navigation.addEventListener(\"navigateerror\",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener(\"navigate\",e),navigation.removeEventListener(\"navigatesuccess\",t),navigation.removeEventListener(\"navigateerror\",t),n!==null&&(n(),n=null)}}}function FW(e){this._internalRoot=e}hD.prototype.render=FW.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Fe(409));var r=t.current,i=fh();bht(r,i,e,t,null,null)};hD.prototype.unmount=FW.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bht(e.current,2,null,e,null,null),lD(),t[Vw]=null}};function hD(e){this._internalRoot=e}hD.prototype.unstable_scheduleHydration=function(e){if(e){var t=tct();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Oy.length&&t!==0&&t<Oy[r].priority;r++);Oy.splice(r,0,e),r===0&&Tht(e)}};var zlt=Ult.version;if(zlt!==\"19.2.4\")throw Error(Fe(527,zlt,\"19.2.4\"));Pn.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==\"function\"?Error(Fe(188)):(e=Object.keys(e).join(\",\"),Error(Fe(268,e)));return e=eDt(t),e=e!==null?Glt(e):null,e=e===null?null:e.stateNode,e};var TLt={bundleType:0,version:\"19.2.4\",rendererPackageName:\"react-dom\",currentDispatcherRef:hi,reconcilerVersion:\"19.2.4\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&(a5=__REACT_DEVTOOLS_GLOBAL_HOOK__,!a5.isDisabled&&a5.supportsFiber))try{V5=a5.inject(TLt),hh=a5}catch{}var a5;dD.createRoot=function(e,t){if(!Vlt(e))throw Error(Fe(299));var r=!1,i=\"\",n=gut,o=Aut,s=yut;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=_ht(e,1,!1,null,null,r,i,null,n,o,s,Sht),e[Vw]=t.current,kW(e),new FW(t)};dD.hydrateRoot=function(e,t,r){if(!Vlt(e))throw Error(Fe(299));var i=!1,n=\"\",o=gut,s=Aut,a=yut,h=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onUncaughtError!==void 0&&(o=r.onUncaughtError),r.onCaughtError!==void 0&&(s=r.onCaughtError),r.onRecoverableError!==void 0&&(a=r.onRecoverableError),r.formState!==void 0&&(h=r.formState)),t=_ht(e,1,!0,t,r??null,i,n,h,o,s,a,Sht),t.context=vht(null),r=t.current,i=fh(),i=WG(i),n=jy(i),n.callback=null,$y(r,n,i),r=i,t.current.lanes=r,$5(t,r),h0(t),e[Vw]=t.current,kW(e),new hD(t)};dD.version=\"19.2.4\"});var Cht=Nr((n1e,Pht)=>{\"use strict\";function Eht(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Eht)}catch(e){console.error(e)}}Eht(),Pht.exports=Mht()});var fD,kLt,pD,RLt,Oht,NW=Et(()=>{fD=globalThis,kLt=globalThis.document||{},pD=globalThis.process||{},RLt=globalThis.console,Oht=globalThis.navigator||{}});function mD(e){if(typeof window<\"u\"&&window.process?.type===\"renderer\"||typeof process<\"u\"&&process.versions?.electron)return!0;let t=typeof navigator<\"u\"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf(\"Electron\")>=0)}var zW=Et(()=>{});function Cc(){return!(typeof process==\"object\"&&String(process)===\"[object process]\"&&!process?.browser)||mD()}var UW=Et(()=>{zW()});function VW(e){return!e&&!Cc()?\"Node\":mD(e)?\"Electron\":(e||Oht.userAgent||\"\").indexOf(\"Edge\")>-1?\"Edge\":globalThis.chrome?\"Chrome\":globalThis.safari?\"Safari\":globalThis.mozInnerScreenX?\"Firefox\":\"Unknown\"}var Lht=Et(()=>{UW();zW();NW()});var jW,r1=Et(()=>{NW();UW();Lht();jW=\"4.1.1\"});function Yw(e,t){if(!e)throw new Error(t||\"Assertion failed\")}var $W=Et(()=>{});function GW(e){if(!e)return 0;let t;switch(typeof e){case\"number\":t=e;break;case\"object\":t=e.logLevel||e.priority||0;break;default:return 0}return Yw(Number.isFinite(t)&&t>=0),t}function Bht(e){let{logLevel:t,message:r}=e;e.logLevel=GW(t);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==r;);switch(typeof t){case\"string\":case\"function\":r!==void 0&&i.unshift(r),e.message=t;break;case\"object\":Object.assign(e,t);break;default:}typeof e.message==\"function\"&&(e.message=e.message());let n=typeof e.message;return Yw(n===\"string\"||n===\"object\"),Object.assign(e,{args:i},e.opts)}var Fht=Et(()=>{$W()});var jv,gD,Nht=Et(()=>{Fht();jv=()=>{},gD=class{constructor({level:t=0}={}){this.userData={},this._onceCache=new Set,this._level=t}set level(t){this.setLevel(t)}get level(){return this.getLevel()}setLevel(t){return this._level=t,this}getLevel(){return this._level}warn(t,...r){return this._log(\"warn\",0,t,r,{once:!0})}error(t,...r){return this._log(\"error\",0,t,r)}log(t,r,...i){return this._log(\"log\",t,r,i)}info(t,r,...i){return this._log(\"info\",t,r,i)}once(t,r,...i){return this._log(\"once\",t,r,i,{once:!0})}_log(t,r,i,n,o={}){let s=Bht({logLevel:r,message:i,args:this._buildArgs(r,i,n),opts:o});return this._createLogFunction(t,s,o)}_buildArgs(t,r,i){return[t,r,...i]}_createLogFunction(t,r,i){if(!this._shouldLog(r.logLevel))return jv;let n=this._getOnceTag(i.tag??r.tag??r.message);if((i.once||r.once)&&n!==void 0){if(this._onceCache.has(n))return jv;this._onceCache.add(n)}return this._emit(t,r)}_shouldLog(t){return this.getLevel()>=GW(t)}_getOnceTag(t){if(t!==void 0)try{return typeof t==\"string\"?t:String(t)}catch{return}}}});function OLt(e){try{let t=window[e],r=\"__storage_test__\";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var AD,zht=Et(()=>{AD=class{constructor(t,r,i=\"sessionStorage\"){this.storage=OLt(i),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}}});function Uht(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Vht(e,t=8){let r=Math.max(t-e.length,0);return`${\" \".repeat(r)}${e}`}var jht=Et(()=>{});function $ht(e){return typeof e!=\"string\"?e:(e=e.toUpperCase(),yD[e]||yD.WHITE)}function Ght(e,t,r){return!Cc&&typeof e==\"string\"&&(t&&(e=`\\x1B[${$ht(t)}m${e}\\x1B[39m`),r&&(e=`\\x1B[${$ht(r)+LLt}m${e}\\x1B[49m`)),e}var yD,LLt,Wht=Et(()=>{r1();(function(e){e[e.BLACK=30]=\"BLACK\",e[e.RED=31]=\"RED\",e[e.GREEN=32]=\"GREEN\",e[e.YELLOW=33]=\"YELLOW\",e[e.BLUE=34]=\"BLUE\",e[e.MAGENTA=35]=\"MAGENTA\",e[e.CYAN=36]=\"CYAN\",e[e.WHITE=37]=\"WHITE\",e[e.BRIGHT_BLACK=90]=\"BRIGHT_BLACK\",e[e.BRIGHT_RED=91]=\"BRIGHT_RED\",e[e.BRIGHT_GREEN=92]=\"BRIGHT_GREEN\",e[e.BRIGHT_YELLOW=93]=\"BRIGHT_YELLOW\",e[e.BRIGHT_BLUE=94]=\"BRIGHT_BLUE\",e[e.BRIGHT_MAGENTA=95]=\"BRIGHT_MAGENTA\",e[e.BRIGHT_CYAN=96]=\"BRIGHT_CYAN\",e[e.BRIGHT_WHITE=97]=\"BRIGHT_WHITE\"})(yD||(yD={}));LLt=10});function qht(e,t=[\"constructor\"]){let r=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(r),n=e;for(let o of i){let s=n[o];typeof s==\"function\"&&(t.find(a=>o===a)||(n[o]=s.bind(e)))}}var Hht=Et(()=>{});function Xw(){let e;if(Cc()&&fD.performance)e=fD?.performance?.now?.();else if(\"hrtime\"in pD){let t=pD?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Yht=Et(()=>{r1()});function BLt(e,t,r){if(typeof t==\"string\"){let i=r.time?Vht(Uht(r.total)):\"\";t=r.time?`${e}: ${i}  ${t}`:`${e}: ${t}`,t=Ght(t,r.color,r.background)}return t}function FLt(e){for(let t in e)for(let r in e[t])return r||\"untitled\";return\"empty\"}var Zw,WW,Ic,qW=Et(()=>{r1();Nht();zht();jht();Wht();Hht();$W();Yht();Zw={debug:Cc()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},WW={enabled:!0,level:0},Ic=class extends gD{constructor({id:t}={id:\"\"}){super({level:0}),this.VERSION=jW,this._startTs=Xw(),this._deltaTs=Xw(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new AD(`__probe-${this.id}__`,{[this.id]:WW}),this.timeStamp(`${this.id} started`),qht(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((Xw()-this._startTs).toPrecision(10))}getDelta(){return Number((Xw()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._updateConfiguration({enabled:t}),this}setLevel(t){return this._updateConfiguration({level:t}),this}get(t){return this._getConfiguration()[t]}set(t,r){this._updateConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){if(!t)throw new Error(r||\"Assertion failed\")}warn(t,...r){return this._log(\"warn\",0,t,r,{method:Zw.warn,once:!0})}error(t,...r){return this._log(\"error\",0,t,r,{method:Zw.error})}deprecated(t,r){return this.warn(`\\`${t}\\` is deprecated and will be removed in a later version. Use \\`${r}\\` instead`)}removed(t,r){return this.error(`\\`${t}\\` has been removed. Use \\`${r}\\` instead`)}probe(t,r,...i){return this._log(\"log\",t,r,i,{method:Zw.log,time:!0,once:!0})}log(t,r,...i){return this._log(\"log\",t,r,i,{method:Zw.debug})}info(t,r,...i){return this._log(\"info\",t,r,i,{method:console.info})}once(t,r,...i){return this._log(\"once\",t,r,i,{method:Zw.debug||Zw.info,once:!0})}table(t,r,i){return r?this._log(\"table\",t,r,i&&[i]||[],{method:console.table||jv,tag:FLt(r)}):jv}time(t,r){return this._log(\"time\",t,r,[],{method:console.time?console.time:console.info})}timeEnd(t,r){return this._log(\"time\",t,r,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(t,r){return this._log(\"time\",t,r,[],{method:console.timeStamp||jv})}group(t,r,i={collapsed:!1}){let n=(i.collapsed?console.groupCollapsed:console.group)||console.info;return this._log(\"group\",t,r,[],{method:n})}groupCollapsed(t,r,i={}){return this.group(t,r,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._log(\"groupEnd\",t,\"\",[],{method:console.groupEnd||jv})}withGroup(t,r,i){this.group(t,r)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&super._shouldLog(t)}_emit(t,r){let i=r.method;Yw(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Xw();let n=BLt(this.id,r.message,r);return i.bind(console,n,...r.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(WW),this._storage.config[this.id]}_updateConfiguration(t){let r=this._storage.config[this.id]||{...WW};this._storage.setConfiguration({[this.id]:{...r,...t}})}};Ic.VERSION=jW});var Xht=Et(()=>{globalThis.probe={}});var $1e,J5=Et(()=>{qW();qW();Xht();$1e=new Ic({id:\"@probe.gl/log\"})});function rE(){let e;if(typeof window<\"u\"&&window.performance)e=window.performance.now();else if(typeof process<\"u\"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var aq=Et(()=>{});var Gv,lq=Et(()=>{aq();Gv=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=rE(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(rE()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}});var vu,ndt=Et(()=>{lq();vu=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r=\"count\"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:i}=t,n=this.stats[r];return n||(t instanceof Gv?n=t:n=new Gv(r,i),this.stats[r]=n),n}}});var Qw=Et(()=>{ndt();lq();aq()});var Bq,ID,Fq=Et(()=>{Qw();Bq=class{stats=new Map;getStats(t){return this.get(t)}get(t){return this.stats.has(t)||this.stats.set(t,new vu({id:t})),this.stats.get(t)}},ID=new Bq});var Ie,Sg=Et(()=>{J5();Ie=new Ic({id:\"luma.gl\"})});function o1(e=\"id\"){Nq[e]=Nq[e]||1;let t=Nq[e]++;return`${e}-${t}`}var Nq,pE=Et(()=>{Nq={}});function vBt(e,t){let r={...t};for(let i in e)e[i]!==void 0&&(r[i]=e[i]);return r}var wi,Rc=Et(()=>{pE();wi=class{static defaultProps={id:\"undefined\",handle:void 0,userData:void 0};toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:\"${this.id}\"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(t,r,i){if(!t)throw new Error(\"no device\");this._device=t,this.props=vBt(r,i);let n=this.props.id!==\"undefined\"?this.props.id:o1(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(t){this._attachedResources.add(t)}detachResource(t){this._attachedResources.delete(t)}destroyAttachedResource(t){this._attachedResources.delete(t)&&t.destroy()}destroyAttachedResources(){for(let t of Object.values(this._attachedResources))t.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let t=this._device.statsManager.getStats(\"Resource Counts\"),r=this[Symbol.toStringTag];t.get(`${r}s Active`).decrementCount()}trackAllocatedMemory(t,r=this[Symbol.toStringTag]){let i=this._device.statsManager.getStats(\"Resource Counts\");i.get(\"GPU Memory\").addCount(t),i.get(`${r} Memory`).addCount(t),this.allocatedBytes=t}trackDeallocatedMemory(t=this[Symbol.toStringTag]){let r=this._device.statsManager.getStats(\"Resource Counts\");r.get(\"GPU Memory\").subtractCount(this.allocatedBytes),r.get(`${t} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let t=this._device.statsManager.getStats(\"Resource Counts\"),r=this[Symbol.toStringTag];t.get(\"Resources Created\").incrementCount(),t.get(`${r}s Created`).incrementCount(),t.get(`${r}s Active`).incrementCount()}}});var on,kD=Et(()=>{Rc();on=class e extends wi{static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;get[Symbol.toStringTag](){return\"Buffer\"}usage;indexType;updateTimestamp;constructor(t,r){let i={...r};(r.usage||0)&e.INDEX&&!r.indexType&&(r.data instanceof Uint32Array?i.indexType=\"uint32\":r.data instanceof Uint16Array?i.indexType=\"uint16\":r.data instanceof Uint8Array&&(i.indexType=\"uint8\")),delete i.data,super(t,i,e.defaultProps),this.usage=i.usage||0,this.indexType=i.indexType,this.updateTimestamp=t.incrementTimestamp()}clone(t){return this.device.createBuffer({...this.props,...t})}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(t,r,i){let n=ArrayBuffer.isView(t)?t.buffer:t,o=Math.min(t?t.byteLength:i,e.DEBUG_DATA_MAX_LENGTH);n===null?this.debugData=new ArrayBuffer(o):r===0&&i===n.byteLength?this.debugData=n.slice(0,o):this.debugData=n.slice(r,r+o)}static defaultProps={...wi.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:\"uint16\",onMapped:void 0}}});function mE(e){let[t,r,i]=Uq[e],n=e.includes(\"norm\"),o=!n&&!e.startsWith(\"float\"),s=e.startsWith(\"s\");return{signedType:t,primitiveType:r,byteLength:i,normalized:n,integer:o,signed:s}}function zq(e){let t=e;switch(t){case\"uint8\":return\"unorm8\";case\"sint8\":return\"snorm8\";case\"uint16\":return\"unorm16\";case\"sint16\":return\"snorm16\";default:return t}}function Aft(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}function Xv(e){let t=ArrayBuffer.isView(e)?e.constructor:e;if(t===Uint8ClampedArray)return\"uint8\";let r=Object.values(Uq).find(i=>t===i[4]);if(!r)throw new Error(t.name);return r[0]}function Zv(e){let[,,,,t]=Uq[e];return t}var Uq,gE=Et(()=>{Uq={uint8:[\"uint8\",\"u32\",1,!1,Uint8Array],sint8:[\"sint8\",\"i32\",1,!1,Int8Array],unorm8:[\"uint8\",\"f32\",1,!0,Uint8Array],snorm8:[\"sint8\",\"f32\",1,!0,Int8Array],uint16:[\"uint16\",\"u32\",2,!1,Uint16Array],sint16:[\"sint16\",\"i32\",2,!1,Int16Array],unorm16:[\"uint16\",\"u32\",2,!0,Uint16Array],snorm16:[\"sint16\",\"i32\",2,!0,Int16Array],float16:[\"float16\",\"f16\",2,!1,Uint16Array],float32:[\"float32\",\"f32\",4,!1,Float32Array],uint32:[\"uint32\",\"u32\",4,!1,Uint32Array],sint32:[\"sint32\",\"i32\",4,!1,Int32Array]}});function i3(e){let t;e.endsWith(\"-webgl\")&&(e.replace(\"-webgl\",\"\"),t=!0);let[r,i]=e.split(\"x\"),n=r,o=i?parseInt(i):1,s=mE(n),a={type:n,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(a.webglOnly=!0),a}function yft(e,t,r){let i=r?zq(e):e;switch(i){case\"unorm8\":return t===1?\"unorm8\":t===3?\"unorm8x3-webgl\":`${i}x${t}`;case\"snorm8\":case\"uint8\":case\"sint8\":case\"uint16\":case\"sint16\":case\"unorm16\":case\"snorm16\":case\"float16\":if(t===1||t===3)throw new Error(`size: ${t}`);return`${i}x${t}`;default:return t===1?i:`${i}x${t}`}}function Vq(e,t,r){if(!t||t>4)throw new Error(`size ${t}`);let i=t,n=Xv(e);return yft(n,i,r)}function _ft(e){let t;switch(e.primitiveType){case\"f32\":t=\"float32\";break;case\"i32\":t=\"sint32\";break;case\"u32\":t=\"uint32\";break;case\"f16\":return e.components<=2?\"float16x2\":\"float16x4\"}return e.components===1?t:`${t}x${e.components}`}var RD=Et(()=>{gE()});function qq(e){let t=SBt[e];if(!t)throw new Error(`Unsupported texture format ${e}`);return t}var tc,Qn,m0,bBt,DD,jq,OD,$q,xBt,Gq,AE,Wq,LD,vft,wBt,TBt,SBt,bft=Et(()=>{tc=\"texture-compression-bc\",Qn=\"texture-compression-astc\",m0=\"texture-compression-etc2\",bBt=\"texture-compression-etc1-webgl\",DD=\"texture-compression-pvrtc-webgl\",jq=\"texture-compression-atc-webgl\",OD=\"float32-renderable-webgl\",$q=\"float16-renderable-webgl\",xBt=\"rgb9e5ufloat-renderable-webgl\",Gq=\"snorm8-renderable-webgl\",AE=\"norm16-renderable-webgl\",Wq=\"snorm16-renderable-webgl\",LD=\"float32-filterable\",vft=\"float16-filterable-webgl\";wBt={r8unorm:{},rg8unorm:{},\"rgb8unorm-webgl\":{},rgba8unorm:{},\"rgba8unorm-srgb\":{},r8snorm:{render:Gq},rg8snorm:{render:Gq},\"rgb8snorm-webgl\":{},rgba8snorm:{render:Gq},r8uint:{},rg8uint:{},rgba8uint:{},r8sint:{},rg8sint:{},rgba8sint:{},bgra8unorm:{},\"bgra8unorm-srgb\":{},r16unorm:{f:AE},rg16unorm:{render:AE},\"rgb16unorm-webgl\":{f:AE},rgba16unorm:{render:AE},r16snorm:{f:Wq},rg16snorm:{render:Wq},\"rgb16snorm-webgl\":{f:AE},rgba16snorm:{render:Wq},r16uint:{},rg16uint:{},rgba16uint:{},r16sint:{},rg16sint:{},rgba16sint:{},r16float:{render:$q,filter:\"float16-filterable-webgl\"},rg16float:{render:$q,filter:vft},rgba16float:{render:$q,filter:vft},r32uint:{},rg32uint:{},rgba32uint:{},r32sint:{},rg32sint:{},rgba32sint:{},r32float:{render:OD,filter:LD},rg32float:{render:!1,filter:LD},\"rgb32float-webgl\":{render:OD,filter:LD},rgba32float:{render:OD,filter:LD},\"rgba4unorm-webgl\":{channels:\"rgba\",bitsPerChannel:[4,4,4,4],packed:!0},\"rgb565unorm-webgl\":{channels:\"rgb\",bitsPerChannel:[5,6,5,0],packed:!0},\"rgb5a1unorm-webgl\":{channels:\"rgba\",bitsPerChannel:[5,5,5,1],packed:!0},rgb9e5ufloat:{channels:\"rgb\",packed:!0,render:xBt},rg11b10ufloat:{channels:\"rgb\",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:OD},rgb10a2unorm:{channels:\"rgba\",bitsPerChannel:[10,10,10,2],packed:!0,p:1},rgb10a2uint:{channels:\"rgba\",bitsPerChannel:[10,10,10,2],packed:!0,p:1},stencil8:{attachment:\"stencil\",bitsPerChannel:[8,0,0,0],dataType:\"uint8\"},depth16unorm:{attachment:\"depth\",bitsPerChannel:[16,0,0,0],dataType:\"uint16\"},depth24plus:{attachment:\"depth\",bitsPerChannel:[24,0,0,0],dataType:\"uint32\"},depth32float:{attachment:\"depth\",bitsPerChannel:[32,0,0,0],dataType:\"float32\"},\"depth24plus-stencil8\":{attachment:\"depth-stencil\",bitsPerChannel:[24,8,0,0],packed:!0},\"depth32float-stencil8\":{attachment:\"depth-stencil\",bitsPerChannel:[32,8,0,0],packed:!0}},TBt={\"bc1-rgb-unorm-webgl\":{f:tc},\"bc1-rgb-unorm-srgb-webgl\":{f:tc},\"bc1-rgba-unorm\":{f:tc},\"bc1-rgba-unorm-srgb\":{f:tc},\"bc2-rgba-unorm\":{f:tc},\"bc2-rgba-unorm-srgb\":{f:tc},\"bc3-rgba-unorm\":{f:tc},\"bc3-rgba-unorm-srgb\":{f:tc},\"bc4-r-unorm\":{f:tc},\"bc4-r-snorm\":{f:tc},\"bc5-rg-unorm\":{f:tc},\"bc5-rg-snorm\":{f:tc},\"bc6h-rgb-ufloat\":{f:tc},\"bc6h-rgb-float\":{f:tc},\"bc7-rgba-unorm\":{f:tc},\"bc7-rgba-unorm-srgb\":{f:tc},\"etc2-rgb8unorm\":{f:m0},\"etc2-rgb8unorm-srgb\":{f:m0},\"etc2-rgb8a1unorm\":{f:m0},\"etc2-rgb8a1unorm-srgb\":{f:m0},\"etc2-rgba8unorm\":{f:m0},\"etc2-rgba8unorm-srgb\":{f:m0},\"eac-r11unorm\":{f:m0},\"eac-r11snorm\":{f:m0},\"eac-rg11unorm\":{f:m0},\"eac-rg11snorm\":{f:m0},\"astc-4x4-unorm\":{f:Qn},\"astc-4x4-unorm-srgb\":{f:Qn},\"astc-5x4-unorm\":{f:Qn},\"astc-5x4-unorm-srgb\":{f:Qn},\"astc-5x5-unorm\":{f:Qn},\"astc-5x5-unorm-srgb\":{f:Qn},\"astc-6x5-unorm\":{f:Qn},\"astc-6x5-unorm-srgb\":{f:Qn},\"astc-6x6-unorm\":{f:Qn},\"astc-6x6-unorm-srgb\":{f:Qn},\"astc-8x5-unorm\":{f:Qn},\"astc-8x5-unorm-srgb\":{f:Qn},\"astc-8x6-unorm\":{f:Qn},\"astc-8x6-unorm-srgb\":{f:Qn},\"astc-8x8-unorm\":{f:Qn},\"astc-8x8-unorm-srgb\":{f:Qn},\"astc-10x5-unorm\":{f:Qn},\"astc-10x5-unorm-srgb\":{f:Qn},\"astc-10x6-unorm\":{f:Qn},\"astc-10x6-unorm-srgb\":{f:Qn},\"astc-10x8-unorm\":{f:Qn},\"astc-10x8-unorm-srgb\":{f:Qn},\"astc-10x10-unorm\":{f:Qn},\"astc-10x10-unorm-srgb\":{f:Qn},\"astc-12x10-unorm\":{f:Qn},\"astc-12x10-unorm-srgb\":{f:Qn},\"astc-12x12-unorm\":{f:Qn},\"astc-12x12-unorm-srgb\":{f:Qn},\"pvrtc-rgb4unorm-webgl\":{f:DD},\"pvrtc-rgba4unorm-webgl\":{f:DD},\"pvrtc-rbg2unorm-webgl\":{f:DD},\"pvrtc-rgba2unorm-webgl\":{f:DD},\"etc1-rbg-unorm-webgl\":{f:bBt},\"atc-rgb-unorm-webgl\":{f:jq},\"atc-rgba-unorm-webgl\":{f:jq},\"atc-rgbai-unorm-webgl\":{f:jq}},SBt={...wBt,...TBt}});function xft(e){let t=PBt(e);if(Mg.isCompressed(e)){t.channels=\"rgb\",t.components=3,t.bytesPerPixel=1,t.srgb=!1,t.compressed=!0;let i=CBt(e);i&&(t.blockWidth=i.blockWidth,t.blockHeight=i.blockHeight)}let r=EBt.exec(e);if(r){let[,i,n,o,s,a]=r,h=`${o}${n}`,p=mE(h),g=p.byteLength*8,w=i.length,C=[g,w>=2?g:0,w>=3?g:0,w>=4?g:0];t={format:e,attachment:t.attachment,dataType:p.signedType,components:w,channels:i,integer:p.integer,signed:p.signed,normalized:p.normalized,bitsPerChannel:C,bytesPerPixel:p.byteLength*i.length,packed:t.packed,srgb:t.srgb},a===\"-webgl\"&&(t.webgl=!0),s===\"-srgb\"&&(t.srgb=!0)}return e.endsWith(\"-webgl\")&&(t.webgl=!0),e.endsWith(\"-srgb\")&&(t.srgb=!0),t}function PBt(e){let t=qq(e),r=t.bytesPerPixel||1,i=t.bitsPerChannel||[8,8,8,8];return delete t.bitsPerChannel,delete t.bytesPerPixel,delete t.f,delete t.render,delete t.filter,delete t.blend,delete t.store,{...t,format:e,attachment:t.attachment||\"color\",channels:t.channels||\"r\",components:t.components||t.channels?.length||1,bytesPerPixel:r,bitsPerChannel:i,dataType:t.dataType||\"uint8\",srgb:t.srgb??!1,packed:t.packed??!1,webgl:t.webgl??!1,integer:t.integer??!1,signed:t.signed??!1,normalized:t.normalized??!1,compressed:t.compressed??!1}}function CBt(e){let r=/.*-(\\d+)x(\\d+)-.*/.exec(e);if(r){let[,i,n]=r;return{blockWidth:Number(i),blockHeight:Number(n)}}return null}var MBt,EBt,BD,Mg,Hq=Et(()=>{gE();bft();MBt=[\"bc1\",\"bc2\",\"bc3\",\"bc4\",\"bc5\",\"bc6\",\"bc7\",\"etc1\",\"etc2\",\"eac\",\"atc\",\"astc\",\"pvrtc\"],EBt=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/,BD=class{getInfo(t){return xft(t)}isColor(t){return t.startsWith(\"rgba\")||t.startsWith(\"bgra\")||t.startsWith(\"rgb\")}isDepthStencil(t){return t.startsWith(\"depth\")||t.startsWith(\"stencil\")}isCompressed(t){return MBt.some(r=>t.startsWith(r))}getCapabilities(t){let r=qq(t),i={format:t,create:r.f??!0,render:r.render??!0,filter:r.filter??!0,blend:r.blend??!0,store:r.store??!0},n=xft(t),o=t.startsWith(\"depth\")||t.startsWith(\"stencil\"),s=n?.signed,a=n?.integer,h=n?.webgl;return i.render&&=!s,i.filter&&=!o&&!s&&!a&&!h,i}},Mg=new BD});function wft(e){return typeof ImageData<\"u\"&&e instanceof ImageData||typeof ImageBitmap<\"u\"&&e instanceof ImageBitmap||typeof HTMLImageElement<\"u\"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<\"u\"&&e instanceof HTMLVideoElement||typeof VideoFrame<\"u\"&&e instanceof VideoFrame||typeof HTMLCanvasElement<\"u\"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<\"u\"&&e instanceof OffscreenCanvas}function Tft(e){if(typeof ImageData<\"u\"&&e instanceof ImageData||typeof ImageBitmap<\"u\"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<\"u\"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<\"u\"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<\"u\"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<\"u\"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<\"u\"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error(\"Unknown image type\")}var Sft=Et(()=>{});var yE,_E,Of,Yq=Et(()=>{Fq();Sg();pE();kD();RD();Hq();Sft();yE=class{},_E=class{features;disabledFeatures;constructor(t=[],r){this.features=new Set(t),this.disabledFeatures=r||{}}*[Symbol.iterator](){yield*this.features}has(t){return!this.disabledFeatures?.[t]&&this.features.has(t)}},Of=class e{static defaultProps={id:null,powerPreference:\"high-performance\",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(t,r)=>{},onResize:(t,r)=>{let[i,n]=t.getDevicePixelSize();Ie.log(1,`${t} resized => ${i}x${n}px`)()},onPositionChange:(t,r)=>{let[i,n]=t.getPosition();Ie.log(1,`${t} repositioned => ${i},${n}`)()},onVisibilityChange:t=>Ie.log(1,`${t} Visibility changed ${t.isVisible}`)(),onDevicePixelRatioChange:(t,r)=>Ie.log(1,`${t} DPR changed ${r.oldRatio} => ${t.devicePixelRatio}`)(),debug:Ie.get(\"debug\")||void 0,debugShaders:Ie.get(\"debug-shaders\")||void 0,debugFramebuffers:!!Ie.get(\"debug-framebuffers\"),debugFactories:!!Ie.get(\"debug-factories\"),debugWebGL:!!Ie.get(\"debug-webgl\"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:\"unused\",_initializeFeatures:!0,_disabledFeatures:{\"compilation-status-async-webgl\":!0},_handle:void 0};get[Symbol.toStringTag](){return\"Device\"}toString(){return`Device(${this.id})`}id;props;userData={};statsManager=ID;timestamp=0;_reused=!1;_lumaData={};_textureCaps={};constructor(t){this.props={...e.defaultProps,...t},this.id=this.props.id||o1(this[Symbol.toStringTag].toLowerCase())}getVertexFormatInfo(t){return i3(t)}isVertexFormatSupported(t){return!0}getTextureFormatInfo(t){return Mg.getInfo(t)}getTextureFormatCapabilities(t){let r=this._textureCaps[t];if(!r){let i=this._getDeviceTextureFormatCapabilities(t);r=this._getDeviceSpecificTextureFormatCapabilities(i),this._textureCaps[t]=r}return r}getMipLevelCount(t,r,i=1){let n=Math.max(t,r,i);return 1+Math.floor(Math.log2(n))}isExternalImage(t){return wft(t)}getExternalImageSize(t){return Tft(t)}isTextureFormatSupported(t){return this.getTextureFormatCapabilities(t).create}isTextureFormatFilterable(t){return this.getTextureFormatCapabilities(t).filter}isTextureFormatRenderable(t){return this.getTextureFormatCapabilities(t).render}isTextureFormatCompressed(t){return Mg.isCompressed(t)}pushDebugGroup(t){this.commandEncoder.pushDebugGroup(t)}popDebugGroup(){this.commandEncoder?.popDebugGroup()}insertDebugMarker(t){this.commandEncoder?.insertDebugMarker(t)}loseDevice(){return!1}incrementTimestamp(){return this.timestamp++}reportError(t,r,...i){return this.props.onError(t,r)?()=>{}:Ie.error(t.message,r,...i)}debug(){if(this.props.debug)debugger;else Ie.once(0,`'Type luma.log.set({debug: true}) in console to enable debug breakpoints',\nor create a device with the 'debug: true' prop.`)()}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error(\"Device has no default CanvasContext. See props.createCanvasContext\");return this.canvasContext}beginRenderPass(t){return this.commandEncoder.beginRenderPass(t)}beginComputePass(t){return this.commandEncoder.beginComputePass(t)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(t,r){throw new Error(\"not implemented\")}readPixelsToBufferWebGL(t,r){throw new Error(\"not implemented\")}setParametersWebGL(t){throw new Error(\"not implemented\")}getParametersWebGL(t){throw new Error(\"not implemented\")}withParametersWebGL(t,r){throw new Error(\"not implemented\")}clearWebGL(t){throw new Error(\"not implemented\")}resetWebGL(){throw new Error(\"not implemented\")}static _getCanvasContextProps(t){return t.createCanvasContext===!0?{}:t.createCanvasContext}_getDeviceTextureFormatCapabilities(t){let r=Mg.getCapabilities(t),i=o=>(typeof o==\"string\"?this.features.has(o):o)??!0,n=i(r.create);return{format:t,create:n,render:n&&i(r.render),filter:n&&i(r.filter),blend:n&&i(r.blend),store:n&&i(r.store)}}_normalizeBufferProps(t){(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});let r={...t};if((t.usage||0)&on.INDEX&&(t.indexType||(t.data instanceof Uint32Array?r.indexType=\"uint32\":t.data instanceof Uint16Array?r.indexType=\"uint16\":t.data instanceof Uint8Array&&(r.data=new Uint16Array(t.data),r.indexType=\"uint16\")),!r.indexType))throw new Error(\"indices buffer content must be of type uint16 or uint32\");return r}}});var IBt,Mft,Xq,n3,Eft=Et(()=>{Yq();Fq();Sg();IBt=\"set luma.log.level=1 (or higher) to trace rendering\",Mft=\"No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.\",Xq=class e{static defaultProps={...Of.defaultProps,type:\"best-available\",adapters:void 0,waitForPageLoad:!0};stats=ID;log=Ie;VERSION=\"9.2.6\";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Ie.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Ie.error(\"'yarn why @luma.gl/core' can help identify the source of the conflict\")(),new Error(\"luma.gl - multiple versions detected: see console log\");Ie.error(\"This version of luma.gl has already been initialized\")()}Ie.log(1,`${this.VERSION} - ${IBt}`)(),globalThis.luma=this}async createDevice(t={}){let r={...e.defaultProps,...t},i=this.selectAdapter(r.type,r.adapters);if(!i)throw new Error(Mft);return r.waitForPageLoad&&await i.pageLoaded,await i.create(r)}async attachDevice(t,r){let i=this._getTypeFromHandle(t,r.adapters),n=i&&this.selectAdapter(i,r.adapters);if(!n)throw new Error(Mft);return await n?.attach?.(t,r)}registerAdapters(t){for(let r of t)this.preregisteredAdapters.set(r.type,r)}getSupportedAdapters(t=[]){let r=this._getAdapterMap(t);return Array.from(r).map(([,i])=>i).filter(i=>i.isSupported?.()).map(i=>i.type)}getBestAvailableAdapterType(t=[]){let r=[\"webgpu\",\"webgl\",\"null\"],i=this._getAdapterMap(t);for(let n of r)if(i.get(n)?.isSupported?.())return n;return null}selectAdapter(t,r=[]){let i=t;t===\"best-available\"&&(i=this.getBestAvailableAdapterType(r));let n=this._getAdapterMap(r);return i&&n.get(i)||null}enforceWebGL2(t=!0,r=[]){let n=this._getAdapterMap(r).get(\"webgl\");n||Ie.warn(\"enforceWebGL2: webgl adapter not found\")(),n?.enforceWebGL2?.(t)}setDefaultDeviceProps(t){Object.assign(e.defaultProps,t)}_getAdapterMap(t=[]){let r=new Map(this.preregisteredAdapters);for(let i of t)r.set(i.type,i);return r}_getTypeFromHandle(t,r=[]){return t instanceof WebGL2RenderingContext?\"webgl\":typeof GPUDevice<\"u\"&&t instanceof GPUDevice||t?.queue?\"webgpu\":t===null?\"null\":(t instanceof WebGLRenderingContext?Ie.warn(\"WebGL1 is not supported\",t)():Ie.warn(\"Unknown handle type\",t)(),null)}},n3=new Xq});function DBt(){return FD||(RBt()||typeof window>\"u\"?FD=Promise.resolve():FD=new Promise(e=>window.addEventListener(\"load\",()=>e()))),FD}var vE,kBt,RBt,FD,Pft=Et(()=>{r1();vE=class{get pageLoaded(){return DBt()}},kBt=Cc()&&typeof document<\"u\",RBt=()=>kBt&&document.readyState===\"complete\",FD=null});function Cft(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}var Ift=Et(()=>{});function OBt(e){if(typeof e==\"string\"){let t=document.getElementById(e);if(!t)throw new Error(`${e} is not an HTML element`);return t}return e||document.body}function LBt(e){let t=document.getElementById(e);if(!o3.isHTMLCanvas(t))throw new Error(\"Object is not a canvas element\");return t}function BBt(e){let{width:t,height:r}=e,i=document.createElement(\"canvas\");i.id=o1(\"lumagl-auto-created-canvas\"),i.width=t||1,i.height=r||1,i.style.width=Number.isFinite(t)?`${t}px`:\"100%\",i.style.height=Number.isFinite(r)?`${r}px`:\"100%\",e?.visible||(i.style.visibility=\"hidden\");let n=OBt(e?.container||null);return n.insertBefore(i,n.firstChild),i}function FBt(e,t,r,i,n){let o=e,s=kft(o[0],t,r),a=Rft(o[1],t,i,n),h=kft(o[0]+1,t,r),p=h===r-1?h:h-1;h=Rft(o[1]+1,t,i,n);let g;return n?(h=h===0?h:h+1,g=a,a=h):g=h===i-1?h:h-1,{x:s,y:a,width:Math.max(p-s+1,1),height:Math.max(g-a+1,1)}}function kft(e,t,r){return Math.min(Math.round(e*t),r-1)}function Rft(e,t,r,i){return i?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}var o3,Dft=Et(()=>{r1();pE();Ift();o3=class e{static isHTMLCanvas(t){return typeof HTMLCanvasElement<\"u\"&&t instanceof HTMLCanvasElement}static isOffscreenCanvas(t){return typeof OffscreenCanvas<\"u\"&&t instanceof OffscreenCanvas}static defaultProps={id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:\"opaque\",colorSpace:\"srgb\",trackPosition:!1};id;props;canvas;htmlCanvas;offscreenCanvas;type;initialized;isInitialized=!1;isVisible=!0;cssWidth;cssHeight;devicePixelRatio;devicePixelWidth;devicePixelHeight;drawingBufferWidth;drawingBufferHeight;_initializedResolvers=Cft();_resizeObserver;_intersectionObserver;_position;destroyed=!1;toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(t){if(this.props={...e.defaultProps,...t},t=this.props,this.initialized=this._initializedResolvers.promise,Cc()?t.canvas?typeof t.canvas==\"string\"?this.canvas=LBt(t.canvas):this.canvas=t.canvas:this.canvas=BBt(t):this.canvas={width:t.width||1,height:t.height||1},e.isHTMLCanvas(this.canvas)?(this.id=t.id||this.canvas.id,this.type=\"html-canvas\",this.htmlCanvas=this.canvas):e.isOffscreenCanvas(this.canvas)?(this.id=t.id||\"offscreen-canvas\",this.type=\"offscreen-canvas\",this.offscreenCanvas=this.canvas):(this.id=t.id||\"node-canvas-context\",this.type=\"node\"),this.cssWidth=this.htmlCanvas?.clientWidth||this.canvas.width,this.cssHeight=this.htmlCanvas?.clientHeight||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],e.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(r=>this._handleIntersection(r)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(r=>this._handleResize(r));try{this._resizeObserver.observe(this.canvas,{box:\"device-pixel-content-box\"})}catch{this._resizeObserver.observe(this.canvas,{box:\"content-box\"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}destroy(){this.destroyed=!0}setProps(t){return\"useDevicePixels\"in t&&(this.props.useDevicePixels=t.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){let t=this.device.limits.maxTextureDimension2D;return[t,t]}setDrawingBufferSize(t,r){this.canvas.width=t,this.canvas.height=r,this.drawingBufferWidth=t,this.drawingBufferHeight=r}getDevicePixelRatio(){return typeof window<\"u\"&&window.devicePixelRatio||1}cssToDevicePixels(t,r=!0){let i=this.cssToDeviceRatio(),[n,o]=this.getDrawingBufferSize();return FBt(t,i,n,o,r)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){let[t,r]=this.getDevicePixelSize();return t/r}cssToDeviceRatio(){try{let[t]=this.getDrawingBufferSize(),[r]=this.getCSSSize();return r?t/r:1}catch{return 1}}resize(t){this.setDrawingBufferSize(t.width,t.height)}_setAutoCreatedCanvasId(t){this.htmlCanvas?.id===\"lumagl-auto-created-canvas\"&&(this.htmlCanvas.id=t)}_handleIntersection(t){let r=t.find(n=>n.target===this.canvas);if(!r)return;let i=r.isIntersecting;this.isVisible!==i&&(this.isVisible=i,this.device.props.onVisibilityChange(this))}_handleResize(t){let r=t.find(h=>h.target===this.canvas);if(!r)return;this.cssWidth=r.contentBoxSize[0].inlineSize,this.cssHeight=r.contentBoxSize[0].blockSize;let i=this.getDevicePixelSize(),n=r.devicePixelContentBoxSize?.[0].inlineSize||r.contentBoxSize[0].inlineSize*devicePixelRatio,o=r.devicePixelContentBoxSize?.[0].blockSize||r.contentBoxSize[0].blockSize*devicePixelRatio,[s,a]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(n,s)),this.devicePixelHeight=Math.max(1,Math.min(o,a)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:i})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels==\"number\"){let t=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*t,this.cssHeight*t)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){let t=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:t}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener(\"change\",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(t=100){let r=setInterval(()=>{this.destroyed?clearInterval(r):this.updatePosition()},t)}updatePosition(){let t=this.htmlCanvas?.getBoundingClientRect();if(t){let r=[t.left,t.top];if(this._position??=r,r[0]!==this._position[0]||r[1]!==this._position[1]){let n=this._position;this._position=r,this.device.props.onPositionChange?.(this,{oldPosition:n})}}}}});var Lf,Zq=Et(()=>{Rc();Lf=class e extends wi{static defaultProps={...wi.defaultProps,type:\"color-sampler\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\",addressModeW:\"clamp-to-edge\",magFilter:\"nearest\",minFilter:\"nearest\",mipmapFilter:\"none\",lodMinClamp:0,lodMaxClamp:32,compare:\"less-equal\",maxAnisotropy:1};get[Symbol.toStringTag](){return\"Sampler\"}constructor(t,r){r=e.normalizeProps(t,r),super(t,r,e.defaultProps)}static normalizeProps(t,r){return r}}});var NBt,Jo,Kq=Et(()=>{Rc();Zq();Sg();NBt={\"1d\":\"1d\",\"2d\":\"2d\",\"2d-array\":\"2d\",cube:\"2d\",\"cube-array\":\"2d\",\"3d\":\"3d\"},Jo=class e extends wi{static SAMPLE=4;static STORAGE=8;static RENDER=16;static COPY_SRC=1;static COPY_DST=2;static TEXTURE=4;static RENDER_ATTACHMENT=16;dimension;baseDimension;format;width;height;depth;mipLevels;updateTimestamp;get[Symbol.toStringTag](){return\"Texture\"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}constructor(t,r){if(r=e.normalizeProps(t,r),super(t,r,e.defaultProps),this.dimension=this.props.dimension,this.baseDimension=NBt[this.dimension],this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.mipLevels=this.props.mipLevels,this.props.width===void 0||this.props.height===void 0)if(t.isExternalImage(r.data)){let i=t.getExternalImageSize(r.data);this.width=i?.width||1,this.height=i?.height||1}else this.width=1,this.height=1,(this.props.width===void 0||this.props.height===void 0)&&Ie.warn(`${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`)();this.updateTimestamp=t.incrementTimestamp()}setSampler(t){this.sampler=t instanceof Lf?t:this.device.createSampler(t)}clone(t){return this.device.createTexture({...this.props,...t})}static normalizeProps(t,r){let i={...r},{width:n,height:o}=i;return typeof n==\"number\"&&(i.width=Math.max(1,Math.ceil(n))),typeof o==\"number\"&&(i.height=Math.max(1,Math.ceil(o))),i}_initializeData(t){this.device.isExternalImage(t)?this.copyExternalImage({image:t,width:this.width,height:this.height,depth:this.depth,mipLevel:0,x:0,y:0,z:0,aspect:\"all\",colorSpace:\"srgb\",premultipliedAlpha:!1,flipY:!1}):t&&this.copyImageData({data:t,mipLevel:0,x:0,y:0,z:0,aspect:\"all\"})}_normalizeCopyImageDataOptions(t){let{width:r,height:i,depth:n}=this,o={...e.defaultCopyDataOptions,width:r,height:i,depth:n,...t},s=this.device.getTextureFormatInfo(this.format);if(!t.bytesPerRow&&!s.bytesPerPixel)throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);return o.bytesPerRow=t.bytesPerRow||r*(s.bytesPerPixel||4),o.rowsPerImage=t.rowsPerImage||i,o}_normalizeCopyExternalImageOptions(t){let r=this.device.getExternalImageSize(t.image),i={...e.defaultCopyExternalImageOptions,...r,...t};return i.width=Math.min(i.width,this.width-i.x),i.height=Math.min(i.height,this.height-i.y),i}static defaultProps={...wi.defaultProps,data:null,dimension:\"2d\",format:\"rgba8unorm\",usage:e.TEXTURE|e.RENDER_ATTACHMENT|e.COPY_DST,width:void 0,height:void 0,depth:1,mipLevels:1,samples:void 0,sampler:{},view:void 0};static defaultCopyDataOptions={data:void 0,byteOffset:0,bytesPerRow:void 0,rowsPerImage:void 0,mipLevel:0,x:0,y:0,z:0,aspect:\"all\"};static defaultCopyExternalImageOptions={image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:\"all\",colorSpace:\"srgb\",premultipliedAlpha:!1,flipY:!1}}});var Kv,Oft=Et(()=>{Rc();Kv=class e extends wi{get[Symbol.toStringTag](){return\"TextureView\"}constructor(t,r){super(t,r,e.defaultProps)}static defaultProps={...wi.defaultProps,format:void 0,dimension:void 0,aspect:\"all\",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0}}});function Lft(e,t,r){let i=\"\",n=t.split(/\\r?\\n/),o=e.slice().sort((s,a)=>s.lineNum-a.lineNum);switch(r?.showSourceCode||\"no\"){case\"all\":let s=0;for(let a=1;a<=n.length;a++)for(i+=Bft(n[a-1],a,r);o.length>s&&o[s].lineNum===a;){let h=o[s++];i+=Qq(h,n,h.lineNum,{...r,inlineSource:!1})}for(;o.length>s;){let a=o[s++];i+=Qq(a,[],0,{...r,inlineSource:!1})}return i;case\"issues\":case\"no\":for(let a of e)i+=Qq(a,n,a.lineNum,{inlineSource:r?.showSourceCode!==\"no\"});return i}}function Qq(e,t,r,i){if(i?.inlineSource){let o=zBt(t,r),s=e.linePos>0?`${\" \".repeat(e.linePos+5)}^^^\n`:\"\";return`\n${o}${s}${e.type.toUpperCase()}: ${e.message}\n\n`}let n=e.type===\"error\"?\"red\":\"#8B4000\";return i?.html?`<div class='luma-compiler-log-error' style=\"color:${n};\"><b> ${e.type.toUpperCase()}: ${e.message}</b></div>`:`${e.type.toUpperCase()}: ${e.message}`}function zBt(e,t,r){let i=\"\";for(let n=t-2;n<=t;n++){let o=e[n-1];o!==void 0&&(i+=Bft(o,t,r))}return i}function Bft(e,t,r){let i=r?.html?VBt(e):e;return`${UBt(String(t),4)}: ${i}${r?.html?\"<br/>\":`\n`}`}function UBt(e,t){let r=\"\";for(let i=e.length;i<t;++i)r+=\" \";return r+e}function VBt(e){return e.replaceAll(\"&\",\"&amp;\").replaceAll(\"<\",\"&lt;\").replaceAll(\">\",\"&gt;\").replaceAll('\"',\"&quot;\").replaceAll(\"'\",\"&#039;\")}var Fft=Et(()=>{});function jBt(e){return $Bt(e.source)||e.id||o1(`unnamed ${e.stage}-shader`)}function $Bt(e,t=\"unnamed\"){let i=/#define[\\s*]SHADER_NAME[\\s*]([A-Za-z0-9_-]+)[\\s*]/.exec(e);return i?i[1]:t}var Qv,Nft=Et(()=>{Rc();pE();Fft();Qv=class e extends wi{get[Symbol.toStringTag](){return\"Shader\"}stage;source;compilationStatus=\"pending\";constructor(t,r){r={...r,debugShaders:r.debugShaders||t.props.debugShaders||\"errors\"},super(t,{id:jBt(r),...r},e.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){let t=this.props.debugShaders;switch(t){case\"never\":return;case\"errors\":if(this.compilationStatus===\"success\")return;break;case\"warnings\":case\"always\":break}let r=await this.getCompilationInfo();t===\"warnings\"&&r?.length===0||this._displayShaderLog(r,this.id)}_displayShaderLog(t,r){if(typeof document>\"u\"||!document?.createElement)return;let i=r,n=`${this.stage} shader \"${i}\"`,o=Lft(t,this.source,{showSourceCode:\"all\",html:!0}),s=this.getTranslatedSource();s&&(o+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style=\"user-select:text;\"><pre>${s}</pre></code>`);let a=document.createElement(\"Button\");a.innerHTML=`\n<h1>Compilation error in ${n}</h1><br /><br />\n<code style=\"user-select:text;\"><pre>\n${o}\n</pre></code>`,a.style.top=\"10px\",a.style.left=\"10px\",a.style.position=\"absolute\",a.style.zIndex=\"9999\",a.style.width=\"100%\",a.style.textAlign=\"left\",document.body.appendChild(a),document.getElementsByClassName(\"luma-compiler-log-error\")[0]?.scrollIntoView(),a.onclick=()=>{let p=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(p)}}static defaultProps={...wi.defaultProps,language:\"auto\",stage:void 0,source:\"\",sourceMap:null,entryPoint:\"main\",debugShaders:void 0}}});var Jv,zft=Et(()=>{Rc();Kq();Sg();Jv=class e extends wi{get[Symbol.toStringTag](){return\"Framebuffer\"}width;height;constructor(t,r={}){super(t,r,e.defaultProps),this.width=this.props.width,this.height=this.props.height}clone(t){let r=this.colorAttachments.map(n=>n.texture.clone(t)),i=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(t);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:i})}resize(t){let r=!t;if(t){let[i,n]=Array.isArray(t)?t:[t.width,t.height];r=r||n!==this.height||i!==this.width,this.width=i,this.height=n}r&&(Ie.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error(\"Framebuffer has noattachments\");this.colorAttachments=this.props.colorAttachments.map((r,i)=>{if(typeof r==\"string\"){let n=this.createColorTexture(r,i);return this.attachResource(n),n.view}return r instanceof Jo?r.view:r});let t=this.props.depthStencilAttachment;if(t)if(typeof t==\"string\"){let r=this.createDepthStencilTexture(t);this.attachResource(r),this.depthStencilAttachment=r.view}else t instanceof Jo?this.depthStencilAttachment=t.view:this.depthStencilAttachment=t}createColorTexture(t,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:Jo.RENDER_ATTACHMENT,format:t,width:this.width,height:this.height,sampler:{magFilter:\"linear\",minFilter:\"linear\"}})}createDepthStencilTexture(t){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:Jo.RENDER_ATTACHMENT,format:t,width:this.width,height:this.height})}resizeAttachments(t,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){let n=this.colorAttachments[i].texture.clone({width:t,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=n.view,this.attachResource(n.view)}if(this.depthStencilAttachment){let i=this.depthStencilAttachment.texture.clone({width:t,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i.view,this.attachResource(i)}this.updateAttachments()}static defaultProps={...wi.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null}}});var Bf,Uft=Et(()=>{Rc();Bf=class e extends wi{get[Symbol.toStringTag](){return\"RenderPipeline\"}shaderLayout;bufferLayout;linkStatus=\"pending\";hash=\"\";constructor(t,r){super(t,r,e.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}static defaultProps={...wi.defaultProps,vs:null,vertexEntryPoint:\"vertexMain\",vsConstants:{},fs:null,fragmentEntryPoint:\"fragmentMain\",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:\"triangle-list\",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}}}});var bE,Vft=Et(()=>{Rc();bE=class e extends wi{static defaultClearColor=[0,0,0,1];static defaultClearDepth=1;static defaultClearStencil=0;get[Symbol.toStringTag](){return\"RenderPass\"}constructor(t,r){r=e.normalizeProps(t,r),super(t,r,e.defaultProps)}static normalizeProps(t,r){return r}static defaultProps={...wi.defaultProps,framebuffer:null,parameters:void 0,clearColor:e.defaultClearColor,clearColors:void 0,clearDepth:e.defaultClearDepth,clearStencil:e.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0}}});var s3,jft=Et(()=>{Rc();s3=class e extends wi{get[Symbol.toStringTag](){return\"ComputePipeline\"}hash=\"\";shaderLayout;constructor(t,r){super(t,r,e.defaultProps),this.shaderLayout=r.shaderLayout}static defaultProps={...wi.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0}}});var xE,$ft=Et(()=>{Rc();xE=class e extends wi{get[Symbol.toStringTag](){return\"CommandEncoder\"}constructor(t,r){super(t,r,e.defaultProps)}static defaultProps={...wi.defaultProps,measureExecutionTime:void 0}}});var wE,Gft=Et(()=>{Rc();wE=class e extends wi{get[Symbol.toStringTag](){return\"CommandBuffer\"}constructor(t,r){super(t,r,e.defaultProps)}static defaultProps={...wi.defaultProps}}});function TE(e){return qBt[e]}function Jq(e){let[t,r]=WBt[e],i=t===\"i32\"||t===\"u32\",n=t!==\"u32\",o=GBt[t]*r;return{primitiveType:t,components:r,byteLength:o,integer:i,signed:n}}var GBt,WBt,qBt,HBt,wwe,ND=Et(()=>{GBt={f32:4,f16:2,i32:4,u32:4},WBt={f32:[\"f32\",1],\"vec2<f32>\":[\"f32\",2],\"vec3<f32>\":[\"f32\",3],\"vec4<f32>\":[\"f32\",4],f16:[\"f16\",1],\"vec2<f16>\":[\"f16\",2],\"vec3<f16>\":[\"f16\",3],\"vec4<f16>\":[\"f16\",4],i32:[\"i32\",1],\"vec2<i32>\":[\"i32\",2],\"vec3<i32>\":[\"i32\",3],\"vec4<i32>\":[\"i32\",4],u32:[\"u32\",1],\"vec2<u32>\":[\"u32\",2],\"vec3<u32>\":[\"u32\",3],\"vec4<u32>\":[\"u32\",4]},qBt={f32:{type:\"f32\",components:1},f16:{type:\"f16\",components:1},i32:{type:\"i32\",components:1},u32:{type:\"u32\",components:1},\"vec2<f32>\":{type:\"f32\",components:2},\"vec3<f32>\":{type:\"f32\",components:3},\"vec4<f32>\":{type:\"f32\",components:4},\"vec2<f16>\":{type:\"f16\",components:2},\"vec3<f16>\":{type:\"f16\",components:3},\"vec4<f16>\":{type:\"f16\",components:4},\"vec2<i32>\":{type:\"i32\",components:2},\"vec3<i32>\":{type:\"i32\",components:3},\"vec4<i32>\":{type:\"i32\",components:4},\"vec2<u32>\":{type:\"u32\",components:2},\"vec3<u32>\":{type:\"u32\",components:3},\"vec4<u32>\":{type:\"u32\",components:4},\"mat2x2<f32>\":{type:\"f32\",components:4},\"mat2x3<f32>\":{type:\"f32\",components:6},\"mat2x4<f32>\":{type:\"f32\",components:8},\"mat3x2<f32>\":{type:\"f32\",components:6},\"mat3x3<f32>\":{type:\"f32\",components:9},\"mat3x4<f32>\":{type:\"f32\",components:12},\"mat4x2<f32>\":{type:\"f32\",components:8},\"mat4x3<f32>\":{type:\"f32\",components:12},\"mat4x4<f32>\":{type:\"f32\",components:16},\"mat2x2<f16>\":{type:\"f16\",components:4},\"mat2x3<f16>\":{type:\"f16\",components:6},\"mat2x4<f16>\":{type:\"f16\",components:8},\"mat3x2<f16>\":{type:\"f16\",components:6},\"mat3x3<f16>\":{type:\"f16\",components:9},\"mat3x4<f16>\":{type:\"f16\",components:12},\"mat4x2<f16>\":{type:\"f16\",components:8},\"mat4x3<f16>\":{type:\"f16\",components:12},\"mat4x4<f16>\":{type:\"f16\",components:16},\"mat2x2<i32>\":{type:\"i32\",components:4},\"mat2x3<i32>\":{type:\"i32\",components:6},\"mat2x4<i32>\":{type:\"i32\",components:8},\"mat3x2<i32>\":{type:\"i32\",components:6},\"mat3x3<i32>\":{type:\"i32\",components:9},\"mat3x4<i32>\":{type:\"i32\",components:12},\"mat4x2<i32>\":{type:\"i32\",components:8},\"mat4x3<i32>\":{type:\"i32\",components:12},\"mat4x4<i32>\":{type:\"i32\",components:16},\"mat2x2<u32>\":{type:\"u32\",components:4},\"mat2x3<u32>\":{type:\"u32\",components:6},\"mat2x4<u32>\":{type:\"u32\",components:8},\"mat3x2<u32>\":{type:\"u32\",components:6},\"mat3x3<u32>\":{type:\"u32\",components:9},\"mat3x4<u32>\":{type:\"u32\",components:12},\"mat4x2<u32>\":{type:\"u32\",components:8},\"mat4x3<u32>\":{type:\"u32\",components:12},\"mat4x4<u32>\":{type:\"u32\",components:16}},HBt={vec2i:\"vec2<i32>\",vec3i:\"vec3<i32>\",vec4i:\"vec4<i32>\",vec2u:\"vec2<u32>\",vec3u:\"vec3<u32>\",vec4u:\"vec4<u32>\",vec2f:\"vec2<f32>\",vec3f:\"vec3<f32>\",vec4f:\"vec4<f32>\",vec2h:\"vec2<f16>\",vec3h:\"vec3<f16>\",vec4h:\"vec4<f16>\"},wwe={...HBt,mat2x2f:\"mat2x2<f32>\",mat2x3f:\"mat2x3<f32>\",mat2x4f:\"mat2x4<f32>\",mat3x2f:\"mat3x2<f32>\",mat3x3f:\"mat3x3<f32>\",mat3x4f:\"mat3x4<f32>\",mat4x2f:\"mat4x2<f32>\",mat4x3f:\"mat4x3<f32>\",mat4x4f:\"mat4x4<f32>\",mat2x2i:\"mat2x2<i32>\",mat2x3i:\"mat2x3<i32>\",mat2x4i:\"mat2x4<i32>\",mat3x2i:\"mat3x2<i32>\",mat3x3i:\"mat3x3<i32>\",mat3x4i:\"mat3x4<i32>\",mat4x2i:\"mat4x2<i32>\",mat4x3i:\"mat4x3<i32>\",mat4x4i:\"mat4x4<i32>\",mat2x2u:\"mat2x2<u32>\",mat2x3u:\"mat2x3<u32>\",mat2x4u:\"mat2x4<u32>\",mat3x2u:\"mat3x2<u32>\",mat3x3u:\"mat3x3<u32>\",mat3x4u:\"mat3x4<u32>\",mat4x2u:\"mat4x2<u32>\",mat4x3u:\"mat4x3<u32>\",mat4x4u:\"mat4x4<u32>\",mat2x2h:\"mat2x2<f16>\",mat2x3h:\"mat2x3<f16>\",mat2x4h:\"mat2x4<f16>\",mat3x2h:\"mat3x2<f16>\",mat3x3h:\"mat3x3<f16>\",mat3x4h:\"mat3x4<f16>\",mat4x2h:\"mat4x2<f16>\",mat4x3h:\"mat4x3<f16>\",mat4x4h:\"mat4x4<f16>\"}});function zD(e,t){let r={};for(let i of e.attributes){let n=YBt(e,t,i.name);n&&(r[i.name]=n)}return r}function Wft(e,t,r=16){let i=zD(e,t),n=new Array(r).fill(null);for(let o of Object.values(i))n[o.location]=o;return n}function YBt(e,t,r){let i=XBt(e,r),n=ZBt(t,r);if(!i)return null;let o=Jq(i.type),s=_ft(o),a=n?.vertexFormat||s,h=i3(a);return{attributeName:n?.attributeName||i.name,bufferName:n?.bufferName||i.name,location:i.location,shaderType:i.type,primitiveType:o.primitiveType,shaderComponents:o.components,vertexFormat:a,bufferDataType:h.type,bufferComponents:h.components,normalized:h.normalized,integer:o.integer,stepMode:n?.stepMode||i.stepMode||\"vertex\",byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function XBt(e,t){let r=e.attributes.find(i=>i.name===t);return r||Ie.warn(`shader layout attribute \"${t}\" not present in shader`),r||null}function ZBt(e,t){KBt(e);let r=QBt(e,t);return r||(r=JBt(e,t),r)?r:(Ie.warn(`layout for attribute \"${t}\" not present in buffer layout`),null)}function KBt(e){for(let t of e)(t.attributes&&t.format||!t.attributes&&!t.format)&&Ie.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function QBt(e,t){for(let r of e)if(r.format&&r.name===t)return{attributeName:r.name,bufferName:t,stepMode:r.stepMode,vertexFormat:r.format,byteOffset:0,byteStride:r.byteStride||0};return null}function JBt(e,t){for(let r of e){let i=r.byteStride;if(typeof r.byteStride!=\"number\")for(let o of r.attributes||[]){let s=i3(o.format);i+=s.byteLength}let n=r.attributes?.find(o=>o.attribute===t);if(n)return{attributeName:n.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:n.format,byteOffset:n.byteOffset,byteStride:i}}return null}var tH=Et(()=>{Sg();ND();RD()});var SE,qft=Et(()=>{tH();Rc();SE=class e extends wi{static defaultProps={...wi.defaultProps,shaderLayout:void 0,bufferLayout:[]};get[Symbol.toStringTag](){return\"VertexArray\"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(t,r){super(t,r,e.defaultProps),this.maxVertexAttributes=t.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=Wft(r.shaderLayout,r.bufferLayout,this.maxVertexAttributes)}setConstantWebGL(t,r){this.device.reportError(new Error(\"constant attributes not supported\"),this)()}}});var ME,Hft=Et(()=>{Rc();ME=class e extends wi{static defaultProps={...wi.defaultProps,layout:void 0,buffers:{}};get[Symbol.toStringTag](){return\"TransformFeedback\"}constructor(t,r){super(t,r,e.defaultProps)}}});var EE,Yft=Et(()=>{Rc();EE=class e extends wi{get[Symbol.toStringTag](){return\"QuerySet\"}constructor(t,r){super(t,r,e.defaultProps)}static defaultProps={...wi.defaultProps,type:void 0,count:void 0}}});function eH(e){return(!UD||UD.byteLength<e)&&(UD=new ArrayBuffer(e)),UD}function rH(e,t){let r=eH(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}var UD,iH=Et(()=>{});function tFt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a3(e){return Array.isArray(e)?e.length===0||typeof e[0]==\"number\":tFt(e)}var nH=Et(()=>{});var eFt,VD,Xft=Et(()=>{gE();ND();iH();nH();Sg();eFt=1024,VD=class{layout={};byteLength;constructor(t,r={}){let i=0;for(let[o,s]of Object.entries(t)){let a=TE(s),{type:h,components:p}=a,g=p*(r?.[o]??1);i=Aft(i,g);let w=i;i+=g,this.layout[o]={type:h,size:g,offset:w}}i+=(4-i%4)%4;let n=i*4;this.byteLength=Math.max(n,eFt)}getData(t){let r=eH(this.byteLength),i={i32:new Int32Array(r),u32:new Uint32Array(r),f32:new Float32Array(r),f16:new Uint16Array(r)};for(let[n,o]of Object.entries(t)){let s=this.layout[n];if(!s){Ie.warn(`Supplied uniform value ${n} not present in uniform block layout`)();continue}let{type:a,size:h,offset:p}=s,g=i[a];if(h===1){if(typeof o!=\"number\"&&typeof o!=\"boolean\"){Ie.warn(`Supplied value for single component uniform ${n} is not a number: ${o}`)();continue}g[p]=Number(o)}else{if(!a3(o)){Ie.warn(`Supplied value for multi component / array uniform ${n} is not a numeric array: ${o}`)();continue}g.set(o,p)}}return new Uint8Array(r,0,this.byteLength)}has(t){return!!this.layout[t]}get(t){return this.layout[t]}}});function Zft(e,t,r=16){if(e!==t)return!1;let i=e,n=t;if(!a3(i))return!1;if(a3(n)&&i.length===n.length){for(let o=0;o<i.length;++o)if(n[o]!==i[o])return!1}return!0}function Kft(e){return a3(e)?e.slice():e}var Qft=Et(()=>{nH()});var jD,Jft=Et(()=>{Qft();jD=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw=\"initialized\";constructor(t){if(this.name=t?.name||\"unnamed\",t?.name&&t?.shaderLayout){let r=t?.shaderLayout.bindings?.find(n=>n.type===\"uniform\"&&n.name===t?.name);if(!r)throw new Error(t?.name);let i=r;for(let n of i.uniforms||[])this.bindingLayout[n.name]=n}}setUniforms(t){for(let[r,i]of Object.entries(t))this._setUniform(r,i),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${r}=${i}`)}setNeedsRedraw(t){this.needsRedraw=this.needsRedraw||t}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(t,r){Zft(this.uniforms[t],r)||(this.uniforms[t]=Kft(r),this.modifiedUniforms[t]=!0,this.modified=!0)}}});var PE,tpt=Et(()=>{kD();Sg();Jft();Xft();PE=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(t){for(let[r,i]of Object.entries(t)){let n=r,o=new VD(i.uniformTypes??{},i.uniformSizes??{});this.uniformBufferLayouts.set(n,o);let s=new jD({name:r});s.setUniforms(i.defaultUniforms||{}),this.uniformBlocks.set(n,s)}}destroy(){for(let t of this.uniformBuffers.values())t.destroy()}setUniforms(t){for(let[r,i]of Object.entries(t))this.uniformBlocks.get(r)?.setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(t){return this.uniformBufferLayouts.get(t)?.byteLength||0}getUniformBufferData(t){let r=this.uniformBlocks.get(t)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(t)?.getData(r)}createUniformBuffer(t,r,i){i&&this.setUniforms(i);let n=this.getUniformBufferByteLength(r),o=t.createBuffer({usage:on.UNIFORM|on.COPY_DST,byteLength:n}),s=this.getUniformBufferData(r);return o.write(s),o}getManagedUniformBuffer(t,r){if(!this.uniformBuffers.get(r)){let i=this.getUniformBufferByteLength(r),n=t.createBuffer({usage:on.UNIFORM|on.COPY_DST,byteLength:i});this.uniformBuffers.set(r,n)}return this.uniformBuffers.get(r)}updateUniformBuffers(){let t=!1;for(let r of this.uniformBlocks.keys()){let i=this.updateUniformBuffer(r);t||=i}return t&&Ie.log(3,`UniformStore.updateUniformBuffers(): ${t}`)(),t}updateUniformBuffer(t){let r=this.uniformBlocks.get(t),i=this.uniformBuffers.get(t),n=!1;if(i&&r?.needsRedraw){n||=r.needsRedraw;let o=this.getUniformBufferData(t);i=this.uniformBuffers.get(t),i?.write(o);let s=this.uniformBlocks.get(t)?.getAllUniforms();Ie.log(4,`Writing to uniform buffer ${String(t)}`,o,s)()}return n}}});var Ci=Et(()=>{Eft();Pft();Yq();Dft();kD();Kq();Oft();Nft();Zq();zft();Uft();Vft();jft();$ft();Gft();qft();Hft();Yft();tpt();gE();ND();RD();Hq();Sg();iH();tH()});var A1,Cmt=Et(()=>{(function(e){e[e.DEPTH_BUFFER_BIT=256]=\"DEPTH_BUFFER_BIT\",e[e.STENCIL_BUFFER_BIT=1024]=\"STENCIL_BUFFER_BIT\",e[e.COLOR_BUFFER_BIT=16384]=\"COLOR_BUFFER_BIT\",e[e.POINTS=0]=\"POINTS\",e[e.LINES=1]=\"LINES\",e[e.LINE_LOOP=2]=\"LINE_LOOP\",e[e.LINE_STRIP=3]=\"LINE_STRIP\",e[e.TRIANGLES=4]=\"TRIANGLES\",e[e.TRIANGLE_STRIP=5]=\"TRIANGLE_STRIP\",e[e.TRIANGLE_FAN=6]=\"TRIANGLE_FAN\",e[e.ZERO=0]=\"ZERO\",e[e.ONE=1]=\"ONE\",e[e.SRC_COLOR=768]=\"SRC_COLOR\",e[e.ONE_MINUS_SRC_COLOR=769]=\"ONE_MINUS_SRC_COLOR\",e[e.SRC_ALPHA=770]=\"SRC_ALPHA\",e[e.ONE_MINUS_SRC_ALPHA=771]=\"ONE_MINUS_SRC_ALPHA\",e[e.DST_ALPHA=772]=\"DST_ALPHA\",e[e.ONE_MINUS_DST_ALPHA=773]=\"ONE_MINUS_DST_ALPHA\",e[e.DST_COLOR=774]=\"DST_COLOR\",e[e.ONE_MINUS_DST_COLOR=775]=\"ONE_MINUS_DST_COLOR\",e[e.SRC_ALPHA_SATURATE=776]=\"SRC_ALPHA_SATURATE\",e[e.CONSTANT_COLOR=32769]=\"CONSTANT_COLOR\",e[e.ONE_MINUS_CONSTANT_COLOR=32770]=\"ONE_MINUS_CONSTANT_COLOR\",e[e.CONSTANT_ALPHA=32771]=\"CONSTANT_ALPHA\",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]=\"ONE_MINUS_CONSTANT_ALPHA\",e[e.FUNC_ADD=32774]=\"FUNC_ADD\",e[e.FUNC_SUBTRACT=32778]=\"FUNC_SUBTRACT\",e[e.FUNC_REVERSE_SUBTRACT=32779]=\"FUNC_REVERSE_SUBTRACT\",e[e.BLEND_EQUATION=32777]=\"BLEND_EQUATION\",e[e.BLEND_EQUATION_RGB=32777]=\"BLEND_EQUATION_RGB\",e[e.BLEND_EQUATION_ALPHA=34877]=\"BLEND_EQUATION_ALPHA\",e[e.BLEND_DST_RGB=32968]=\"BLEND_DST_RGB\",e[e.BLEND_SRC_RGB=32969]=\"BLEND_SRC_RGB\",e[e.BLEND_DST_ALPHA=32970]=\"BLEND_DST_ALPHA\",e[e.BLEND_SRC_ALPHA=32971]=\"BLEND_SRC_ALPHA\",e[e.BLEND_COLOR=32773]=\"BLEND_COLOR\",e[e.ARRAY_BUFFER_BINDING=34964]=\"ARRAY_BUFFER_BINDING\",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]=\"ELEMENT_ARRAY_BUFFER_BINDING\",e[e.LINE_WIDTH=2849]=\"LINE_WIDTH\",e[e.ALIASED_POINT_SIZE_RANGE=33901]=\"ALIASED_POINT_SIZE_RANGE\",e[e.ALIASED_LINE_WIDTH_RANGE=33902]=\"ALIASED_LINE_WIDTH_RANGE\",e[e.CULL_FACE_MODE=2885]=\"CULL_FACE_MODE\",e[e.FRONT_FACE=2886]=\"FRONT_FACE\",e[e.DEPTH_RANGE=2928]=\"DEPTH_RANGE\",e[e.DEPTH_WRITEMASK=2930]=\"DEPTH_WRITEMASK\",e[e.DEPTH_CLEAR_VALUE=2931]=\"DEPTH_CLEAR_VALUE\",e[e.DEPTH_FUNC=2932]=\"DEPTH_FUNC\",e[e.STENCIL_CLEAR_VALUE=2961]=\"STENCIL_CLEAR_VALUE\",e[e.STENCIL_FUNC=2962]=\"STENCIL_FUNC\",e[e.STENCIL_FAIL=2964]=\"STENCIL_FAIL\",e[e.STENCIL_PASS_DEPTH_FAIL=2965]=\"STENCIL_PASS_DEPTH_FAIL\",e[e.STENCIL_PASS_DEPTH_PASS=2966]=\"STENCIL_PASS_DEPTH_PASS\",e[e.STENCIL_REF=2967]=\"STENCIL_REF\",e[e.STENCIL_VALUE_MASK=2963]=\"STENCIL_VALUE_MASK\",e[e.STENCIL_WRITEMASK=2968]=\"STENCIL_WRITEMASK\",e[e.STENCIL_BACK_FUNC=34816]=\"STENCIL_BACK_FUNC\",e[e.STENCIL_BACK_FAIL=34817]=\"STENCIL_BACK_FAIL\",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]=\"STENCIL_BACK_PASS_DEPTH_FAIL\",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]=\"STENCIL_BACK_PASS_DEPTH_PASS\",e[e.STENCIL_BACK_REF=36003]=\"STENCIL_BACK_REF\",e[e.STENCIL_BACK_VALUE_MASK=36004]=\"STENCIL_BACK_VALUE_MASK\",e[e.STENCIL_BACK_WRITEMASK=36005]=\"STENCIL_BACK_WRITEMASK\",e[e.VIEWPORT=2978]=\"VIEWPORT\",e[e.SCISSOR_BOX=3088]=\"SCISSOR_BOX\",e[e.COLOR_CLEAR_VALUE=3106]=\"COLOR_CLEAR_VALUE\",e[e.COLOR_WRITEMASK=3107]=\"COLOR_WRITEMASK\",e[e.UNPACK_ALIGNMENT=3317]=\"UNPACK_ALIGNMENT\",e[e.PACK_ALIGNMENT=3333]=\"PACK_ALIGNMENT\",e[e.MAX_TEXTURE_SIZE=3379]=\"MAX_TEXTURE_SIZE\",e[e.MAX_VIEWPORT_DIMS=3386]=\"MAX_VIEWPORT_DIMS\",e[e.SUBPIXEL_BITS=3408]=\"SUBPIXEL_BITS\",e[e.RED_BITS=3410]=\"RED_BITS\",e[e.GREEN_BITS=3411]=\"GREEN_BITS\",e[e.BLUE_BITS=3412]=\"BLUE_BITS\",e[e.ALPHA_BITS=3413]=\"ALPHA_BITS\",e[e.DEPTH_BITS=3414]=\"DEPTH_BITS\",e[e.STENCIL_BITS=3415]=\"STENCIL_BITS\",e[e.POLYGON_OFFSET_UNITS=10752]=\"POLYGON_OFFSET_UNITS\",e[e.POLYGON_OFFSET_FACTOR=32824]=\"POLYGON_OFFSET_FACTOR\",e[e.TEXTURE_BINDING_2D=32873]=\"TEXTURE_BINDING_2D\",e[e.SAMPLE_BUFFERS=32936]=\"SAMPLE_BUFFERS\",e[e.SAMPLES=32937]=\"SAMPLES\",e[e.SAMPLE_COVERAGE_VALUE=32938]=\"SAMPLE_COVERAGE_VALUE\",e[e.SAMPLE_COVERAGE_INVERT=32939]=\"SAMPLE_COVERAGE_INVERT\",e[e.COMPRESSED_TEXTURE_FORMATS=34467]=\"COMPRESSED_TEXTURE_FORMATS\",e[e.VENDOR=7936]=\"VENDOR\",e[e.RENDERER=7937]=\"RENDERER\",e[e.VERSION=7938]=\"VERSION\",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]=\"IMPLEMENTATION_COLOR_READ_TYPE\",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]=\"IMPLEMENTATION_COLOR_READ_FORMAT\",e[e.BROWSER_DEFAULT_WEBGL=37444]=\"BROWSER_DEFAULT_WEBGL\",e[e.STATIC_DRAW=35044]=\"STATIC_DRAW\",e[e.STREAM_DRAW=35040]=\"STREAM_DRAW\",e[e.DYNAMIC_DRAW=35048]=\"DYNAMIC_DRAW\",e[e.ARRAY_BUFFER=34962]=\"ARRAY_BUFFER\",e[e.ELEMENT_ARRAY_BUFFER=34963]=\"ELEMENT_ARRAY_BUFFER\",e[e.BUFFER_SIZE=34660]=\"BUFFER_SIZE\",e[e.BUFFER_USAGE=34661]=\"BUFFER_USAGE\",e[e.CURRENT_VERTEX_ATTRIB=34342]=\"CURRENT_VERTEX_ATTRIB\",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]=\"VERTEX_ATTRIB_ARRAY_ENABLED\",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]=\"VERTEX_ATTRIB_ARRAY_SIZE\",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]=\"VERTEX_ATTRIB_ARRAY_STRIDE\",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]=\"VERTEX_ATTRIB_ARRAY_TYPE\",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]=\"VERTEX_ATTRIB_ARRAY_NORMALIZED\",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]=\"VERTEX_ATTRIB_ARRAY_POINTER\",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]=\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\",e[e.CULL_FACE=2884]=\"CULL_FACE\",e[e.FRONT=1028]=\"FRONT\",e[e.BACK=1029]=\"BACK\",e[e.FRONT_AND_BACK=1032]=\"FRONT_AND_BACK\",e[e.BLEND=3042]=\"BLEND\",e[e.DEPTH_TEST=2929]=\"DEPTH_TEST\",e[e.DITHER=3024]=\"DITHER\",e[e.POLYGON_OFFSET_FILL=32823]=\"POLYGON_OFFSET_FILL\",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]=\"SAMPLE_ALPHA_TO_COVERAGE\",e[e.SAMPLE_COVERAGE=32928]=\"SAMPLE_COVERAGE\",e[e.SCISSOR_TEST=3089]=\"SCISSOR_TEST\",e[e.STENCIL_TEST=2960]=\"STENCIL_TEST\",e[e.NO_ERROR=0]=\"NO_ERROR\",e[e.INVALID_ENUM=1280]=\"INVALID_ENUM\",e[e.INVALID_VALUE=1281]=\"INVALID_VALUE\",e[e.INVALID_OPERATION=1282]=\"INVALID_OPERATION\",e[e.OUT_OF_MEMORY=1285]=\"OUT_OF_MEMORY\",e[e.CONTEXT_LOST_WEBGL=37442]=\"CONTEXT_LOST_WEBGL\",e[e.CW=2304]=\"CW\",e[e.CCW=2305]=\"CCW\",e[e.DONT_CARE=4352]=\"DONT_CARE\",e[e.FASTEST=4353]=\"FASTEST\",e[e.NICEST=4354]=\"NICEST\",e[e.GENERATE_MIPMAP_HINT=33170]=\"GENERATE_MIPMAP_HINT\",e[e.BYTE=5120]=\"BYTE\",e[e.UNSIGNED_BYTE=5121]=\"UNSIGNED_BYTE\",e[e.SHORT=5122]=\"SHORT\",e[e.UNSIGNED_SHORT=5123]=\"UNSIGNED_SHORT\",e[e.INT=5124]=\"INT\",e[e.UNSIGNED_INT=5125]=\"UNSIGNED_INT\",e[e.FLOAT=5126]=\"FLOAT\",e[e.DOUBLE=5130]=\"DOUBLE\",e[e.DEPTH_COMPONENT=6402]=\"DEPTH_COMPONENT\",e[e.ALPHA=6406]=\"ALPHA\",e[e.RGB=6407]=\"RGB\",e[e.RGBA=6408]=\"RGBA\",e[e.LUMINANCE=6409]=\"LUMINANCE\",e[e.LUMINANCE_ALPHA=6410]=\"LUMINANCE_ALPHA\",e[e.UNSIGNED_SHORT_4_4_4_4=32819]=\"UNSIGNED_SHORT_4_4_4_4\",e[e.UNSIGNED_SHORT_5_5_5_1=32820]=\"UNSIGNED_SHORT_5_5_5_1\",e[e.UNSIGNED_SHORT_5_6_5=33635]=\"UNSIGNED_SHORT_5_6_5\",e[e.FRAGMENT_SHADER=35632]=\"FRAGMENT_SHADER\",e[e.VERTEX_SHADER=35633]=\"VERTEX_SHADER\",e[e.COMPILE_STATUS=35713]=\"COMPILE_STATUS\",e[e.DELETE_STATUS=35712]=\"DELETE_STATUS\",e[e.LINK_STATUS=35714]=\"LINK_STATUS\",e[e.VALIDATE_STATUS=35715]=\"VALIDATE_STATUS\",e[e.ATTACHED_SHADERS=35717]=\"ATTACHED_SHADERS\",e[e.ACTIVE_ATTRIBUTES=35721]=\"ACTIVE_ATTRIBUTES\",e[e.ACTIVE_UNIFORMS=35718]=\"ACTIVE_UNIFORMS\",e[e.MAX_VERTEX_ATTRIBS=34921]=\"MAX_VERTEX_ATTRIBS\",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]=\"MAX_VERTEX_UNIFORM_VECTORS\",e[e.MAX_VARYING_VECTORS=36348]=\"MAX_VARYING_VECTORS\",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]=\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]=\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]=\"MAX_TEXTURE_IMAGE_UNITS\",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]=\"MAX_FRAGMENT_UNIFORM_VECTORS\",e[e.SHADER_TYPE=35663]=\"SHADER_TYPE\",e[e.SHADING_LANGUAGE_VERSION=35724]=\"SHADING_LANGUAGE_VERSION\",e[e.CURRENT_PROGRAM=35725]=\"CURRENT_PROGRAM\",e[e.NEVER=512]=\"NEVER\",e[e.LESS=513]=\"LESS\",e[e.EQUAL=514]=\"EQUAL\",e[e.LEQUAL=515]=\"LEQUAL\",e[e.GREATER=516]=\"GREATER\",e[e.NOTEQUAL=517]=\"NOTEQUAL\",e[e.GEQUAL=518]=\"GEQUAL\",e[e.ALWAYS=519]=\"ALWAYS\",e[e.KEEP=7680]=\"KEEP\",e[e.REPLACE=7681]=\"REPLACE\",e[e.INCR=7682]=\"INCR\",e[e.DECR=7683]=\"DECR\",e[e.INVERT=5386]=\"INVERT\",e[e.INCR_WRAP=34055]=\"INCR_WRAP\",e[e.DECR_WRAP=34056]=\"DECR_WRAP\",e[e.NEAREST=9728]=\"NEAREST\",e[e.LINEAR=9729]=\"LINEAR\",e[e.NEAREST_MIPMAP_NEAREST=9984]=\"NEAREST_MIPMAP_NEAREST\",e[e.LINEAR_MIPMAP_NEAREST=9985]=\"LINEAR_MIPMAP_NEAREST\",e[e.NEAREST_MIPMAP_LINEAR=9986]=\"NEAREST_MIPMAP_LINEAR\",e[e.LINEAR_MIPMAP_LINEAR=9987]=\"LINEAR_MIPMAP_LINEAR\",e[e.TEXTURE_MAG_FILTER=10240]=\"TEXTURE_MAG_FILTER\",e[e.TEXTURE_MIN_FILTER=10241]=\"TEXTURE_MIN_FILTER\",e[e.TEXTURE_WRAP_S=10242]=\"TEXTURE_WRAP_S\",e[e.TEXTURE_WRAP_T=10243]=\"TEXTURE_WRAP_T\",e[e.TEXTURE_2D=3553]=\"TEXTURE_2D\",e[e.TEXTURE=5890]=\"TEXTURE\",e[e.TEXTURE_CUBE_MAP=34067]=\"TEXTURE_CUBE_MAP\",e[e.TEXTURE_BINDING_CUBE_MAP=34068]=\"TEXTURE_BINDING_CUBE_MAP\",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=\"TEXTURE_CUBE_MAP_POSITIVE_X\",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=\"TEXTURE_CUBE_MAP_NEGATIVE_X\",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=\"TEXTURE_CUBE_MAP_POSITIVE_Y\",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=\"TEXTURE_CUBE_MAP_POSITIVE_Z\",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=\"TEXTURE_CUBE_MAP_NEGATIVE_Z\",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]=\"MAX_CUBE_MAP_TEXTURE_SIZE\",e[e.TEXTURE0=33984]=\"TEXTURE0\",e[e.ACTIVE_TEXTURE=34016]=\"ACTIVE_TEXTURE\",e[e.REPEAT=10497]=\"REPEAT\",e[e.CLAMP_TO_EDGE=33071]=\"CLAMP_TO_EDGE\",e[e.MIRRORED_REPEAT=33648]=\"MIRRORED_REPEAT\",e[e.TEXTURE_WIDTH=4096]=\"TEXTURE_WIDTH\",e[e.TEXTURE_HEIGHT=4097]=\"TEXTURE_HEIGHT\",e[e.FLOAT_VEC2=35664]=\"FLOAT_VEC2\",e[e.FLOAT_VEC3=35665]=\"FLOAT_VEC3\",e[e.FLOAT_VEC4=35666]=\"FLOAT_VEC4\",e[e.INT_VEC2=35667]=\"INT_VEC2\",e[e.INT_VEC3=35668]=\"INT_VEC3\",e[e.INT_VEC4=35669]=\"INT_VEC4\",e[e.BOOL=35670]=\"BOOL\",e[e.BOOL_VEC2=35671]=\"BOOL_VEC2\",e[e.BOOL_VEC3=35672]=\"BOOL_VEC3\",e[e.BOOL_VEC4=35673]=\"BOOL_VEC4\",e[e.FLOAT_MAT2=35674]=\"FLOAT_MAT2\",e[e.FLOAT_MAT3=35675]=\"FLOAT_MAT3\",e[e.FLOAT_MAT4=35676]=\"FLOAT_MAT4\",e[e.SAMPLER_2D=35678]=\"SAMPLER_2D\",e[e.SAMPLER_CUBE=35680]=\"SAMPLER_CUBE\",e[e.LOW_FLOAT=36336]=\"LOW_FLOAT\",e[e.MEDIUM_FLOAT=36337]=\"MEDIUM_FLOAT\",e[e.HIGH_FLOAT=36338]=\"HIGH_FLOAT\",e[e.LOW_INT=36339]=\"LOW_INT\",e[e.MEDIUM_INT=36340]=\"MEDIUM_INT\",e[e.HIGH_INT=36341]=\"HIGH_INT\",e[e.FRAMEBUFFER=36160]=\"FRAMEBUFFER\",e[e.RENDERBUFFER=36161]=\"RENDERBUFFER\",e[e.RGBA4=32854]=\"RGBA4\",e[e.RGB5_A1=32855]=\"RGB5_A1\",e[e.RGB565=36194]=\"RGB565\",e[e.DEPTH_COMPONENT16=33189]=\"DEPTH_COMPONENT16\",e[e.STENCIL_INDEX=6401]=\"STENCIL_INDEX\",e[e.STENCIL_INDEX8=36168]=\"STENCIL_INDEX8\",e[e.DEPTH_STENCIL=34041]=\"DEPTH_STENCIL\",e[e.RENDERBUFFER_WIDTH=36162]=\"RENDERBUFFER_WIDTH\",e[e.RENDERBUFFER_HEIGHT=36163]=\"RENDERBUFFER_HEIGHT\",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]=\"RENDERBUFFER_INTERNAL_FORMAT\",e[e.RENDERBUFFER_RED_SIZE=36176]=\"RENDERBUFFER_RED_SIZE\",e[e.RENDERBUFFER_GREEN_SIZE=36177]=\"RENDERBUFFER_GREEN_SIZE\",e[e.RENDERBUFFER_BLUE_SIZE=36178]=\"RENDERBUFFER_BLUE_SIZE\",e[e.RENDERBUFFER_ALPHA_SIZE=36179]=\"RENDERBUFFER_ALPHA_SIZE\",e[e.RENDERBUFFER_DEPTH_SIZE=36180]=\"RENDERBUFFER_DEPTH_SIZE\",e[e.RENDERBUFFER_STENCIL_SIZE=36181]=\"RENDERBUFFER_STENCIL_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]=\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]=\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]=\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]=\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\",e[e.COLOR_ATTACHMENT0=36064]=\"COLOR_ATTACHMENT0\",e[e.DEPTH_ATTACHMENT=36096]=\"DEPTH_ATTACHMENT\",e[e.STENCIL_ATTACHMENT=36128]=\"STENCIL_ATTACHMENT\",e[e.DEPTH_STENCIL_ATTACHMENT=33306]=\"DEPTH_STENCIL_ATTACHMENT\",e[e.NONE=0]=\"NONE\",e[e.FRAMEBUFFER_COMPLETE=36053]=\"FRAMEBUFFER_COMPLETE\",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]=\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]=\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]=\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\",e[e.FRAMEBUFFER_UNSUPPORTED=36061]=\"FRAMEBUFFER_UNSUPPORTED\",e[e.FRAMEBUFFER_BINDING=36006]=\"FRAMEBUFFER_BINDING\",e[e.RENDERBUFFER_BINDING=36007]=\"RENDERBUFFER_BINDING\",e[e.READ_FRAMEBUFFER=36008]=\"READ_FRAMEBUFFER\",e[e.DRAW_FRAMEBUFFER=36009]=\"DRAW_FRAMEBUFFER\",e[e.MAX_RENDERBUFFER_SIZE=34024]=\"MAX_RENDERBUFFER_SIZE\",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]=\"INVALID_FRAMEBUFFER_OPERATION\",e[e.UNPACK_FLIP_Y_WEBGL=37440]=\"UNPACK_FLIP_Y_WEBGL\",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]=\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]=\"UNPACK_COLORSPACE_CONVERSION_WEBGL\",e[e.READ_BUFFER=3074]=\"READ_BUFFER\",e[e.UNPACK_ROW_LENGTH=3314]=\"UNPACK_ROW_LENGTH\",e[e.UNPACK_SKIP_ROWS=3315]=\"UNPACK_SKIP_ROWS\",e[e.UNPACK_SKIP_PIXELS=3316]=\"UNPACK_SKIP_PIXELS\",e[e.PACK_ROW_LENGTH=3330]=\"PACK_ROW_LENGTH\",e[e.PACK_SKIP_ROWS=3331]=\"PACK_SKIP_ROWS\",e[e.PACK_SKIP_PIXELS=3332]=\"PACK_SKIP_PIXELS\",e[e.TEXTURE_BINDING_3D=32874]=\"TEXTURE_BINDING_3D\",e[e.UNPACK_SKIP_IMAGES=32877]=\"UNPACK_SKIP_IMAGES\",e[e.UNPACK_IMAGE_HEIGHT=32878]=\"UNPACK_IMAGE_HEIGHT\",e[e.MAX_3D_TEXTURE_SIZE=32883]=\"MAX_3D_TEXTURE_SIZE\",e[e.MAX_ELEMENTS_VERTICES=33e3]=\"MAX_ELEMENTS_VERTICES\",e[e.MAX_ELEMENTS_INDICES=33001]=\"MAX_ELEMENTS_INDICES\",e[e.MAX_TEXTURE_LOD_BIAS=34045]=\"MAX_TEXTURE_LOD_BIAS\",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]=\"MAX_FRAGMENT_UNIFORM_COMPONENTS\",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]=\"MAX_VERTEX_UNIFORM_COMPONENTS\",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]=\"MAX_ARRAY_TEXTURE_LAYERS\",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]=\"MIN_PROGRAM_TEXEL_OFFSET\",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]=\"MAX_PROGRAM_TEXEL_OFFSET\",e[e.MAX_VARYING_COMPONENTS=35659]=\"MAX_VARYING_COMPONENTS\",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]=\"FRAGMENT_SHADER_DERIVATIVE_HINT\",e[e.RASTERIZER_DISCARD=35977]=\"RASTERIZER_DISCARD\",e[e.VERTEX_ARRAY_BINDING=34229]=\"VERTEX_ARRAY_BINDING\",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]=\"MAX_VERTEX_OUTPUT_COMPONENTS\",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]=\"MAX_FRAGMENT_INPUT_COMPONENTS\",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]=\"MAX_SERVER_WAIT_TIMEOUT\",e[e.MAX_ELEMENT_INDEX=36203]=\"MAX_ELEMENT_INDEX\",e[e.RED=6403]=\"RED\",e[e.RGB8=32849]=\"RGB8\",e[e.RGBA8=32856]=\"RGBA8\",e[e.RGB10_A2=32857]=\"RGB10_A2\",e[e.TEXTURE_3D=32879]=\"TEXTURE_3D\",e[e.TEXTURE_WRAP_R=32882]=\"TEXTURE_WRAP_R\",e[e.TEXTURE_MIN_LOD=33082]=\"TEXTURE_MIN_LOD\",e[e.TEXTURE_MAX_LOD=33083]=\"TEXTURE_MAX_LOD\",e[e.TEXTURE_BASE_LEVEL=33084]=\"TEXTURE_BASE_LEVEL\",e[e.TEXTURE_MAX_LEVEL=33085]=\"TEXTURE_MAX_LEVEL\",e[e.TEXTURE_COMPARE_MODE=34892]=\"TEXTURE_COMPARE_MODE\",e[e.TEXTURE_COMPARE_FUNC=34893]=\"TEXTURE_COMPARE_FUNC\",e[e.SRGB=35904]=\"SRGB\",e[e.SRGB8=35905]=\"SRGB8\",e[e.SRGB8_ALPHA8=35907]=\"SRGB8_ALPHA8\",e[e.COMPARE_REF_TO_TEXTURE=34894]=\"COMPARE_REF_TO_TEXTURE\",e[e.RGBA32F=34836]=\"RGBA32F\",e[e.RGB32F=34837]=\"RGB32F\",e[e.RGBA16F=34842]=\"RGBA16F\",e[e.RGB16F=34843]=\"RGB16F\",e[e.TEXTURE_2D_ARRAY=35866]=\"TEXTURE_2D_ARRAY\",e[e.TEXTURE_BINDING_2D_ARRAY=35869]=\"TEXTURE_BINDING_2D_ARRAY\",e[e.R11F_G11F_B10F=35898]=\"R11F_G11F_B10F\",e[e.RGB9_E5=35901]=\"RGB9_E5\",e[e.RGBA32UI=36208]=\"RGBA32UI\",e[e.RGB32UI=36209]=\"RGB32UI\",e[e.RGBA16UI=36214]=\"RGBA16UI\",e[e.RGB16UI=36215]=\"RGB16UI\",e[e.RGBA8UI=36220]=\"RGBA8UI\",e[e.RGB8UI=36221]=\"RGB8UI\",e[e.RGBA32I=36226]=\"RGBA32I\",e[e.RGB32I=36227]=\"RGB32I\",e[e.RGBA16I=36232]=\"RGBA16I\",e[e.RGB16I=36233]=\"RGB16I\",e[e.RGBA8I=36238]=\"RGBA8I\",e[e.RGB8I=36239]=\"RGB8I\",e[e.RED_INTEGER=36244]=\"RED_INTEGER\",e[e.RGB_INTEGER=36248]=\"RGB_INTEGER\",e[e.RGBA_INTEGER=36249]=\"RGBA_INTEGER\",e[e.R8=33321]=\"R8\",e[e.RG8=33323]=\"RG8\",e[e.R16F=33325]=\"R16F\",e[e.R32F=33326]=\"R32F\",e[e.RG16F=33327]=\"RG16F\",e[e.RG32F=33328]=\"RG32F\",e[e.R8I=33329]=\"R8I\",e[e.R8UI=33330]=\"R8UI\",e[e.R16I=33331]=\"R16I\",e[e.R16UI=33332]=\"R16UI\",e[e.R32I=33333]=\"R32I\",e[e.R32UI=33334]=\"R32UI\",e[e.RG8I=33335]=\"RG8I\",e[e.RG8UI=33336]=\"RG8UI\",e[e.RG16I=33337]=\"RG16I\",e[e.RG16UI=33338]=\"RG16UI\",e[e.RG32I=33339]=\"RG32I\",e[e.RG32UI=33340]=\"RG32UI\",e[e.R8_SNORM=36756]=\"R8_SNORM\",e[e.RG8_SNORM=36757]=\"RG8_SNORM\",e[e.RGB8_SNORM=36758]=\"RGB8_SNORM\",e[e.RGBA8_SNORM=36759]=\"RGBA8_SNORM\",e[e.RGB10_A2UI=36975]=\"RGB10_A2UI\",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]=\"TEXTURE_IMMUTABLE_FORMAT\",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]=\"TEXTURE_IMMUTABLE_LEVELS\",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=\"UNSIGNED_INT_2_10_10_10_REV\",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=\"UNSIGNED_INT_10F_11F_11F_REV\",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=\"UNSIGNED_INT_5_9_9_9_REV\",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=\"FLOAT_32_UNSIGNED_INT_24_8_REV\",e[e.UNSIGNED_INT_24_8=34042]=\"UNSIGNED_INT_24_8\",e[e.HALF_FLOAT=5131]=\"HALF_FLOAT\",e[e.RG=33319]=\"RG\",e[e.RG_INTEGER=33320]=\"RG_INTEGER\",e[e.INT_2_10_10_10_REV=36255]=\"INT_2_10_10_10_REV\",e[e.CURRENT_QUERY=34917]=\"CURRENT_QUERY\",e[e.QUERY_RESULT=34918]=\"QUERY_RESULT\",e[e.QUERY_RESULT_AVAILABLE=34919]=\"QUERY_RESULT_AVAILABLE\",e[e.ANY_SAMPLES_PASSED=35887]=\"ANY_SAMPLES_PASSED\",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]=\"ANY_SAMPLES_PASSED_CONSERVATIVE\",e[e.MAX_DRAW_BUFFERS=34852]=\"MAX_DRAW_BUFFERS\",e[e.DRAW_BUFFER0=34853]=\"DRAW_BUFFER0\",e[e.DRAW_BUFFER1=34854]=\"DRAW_BUFFER1\",e[e.DRAW_BUFFER2=34855]=\"DRAW_BUFFER2\",e[e.DRAW_BUFFER3=34856]=\"DRAW_BUFFER3\",e[e.DRAW_BUFFER4=34857]=\"DRAW_BUFFER4\",e[e.DRAW_BUFFER5=34858]=\"DRAW_BUFFER5\",e[e.DRAW_BUFFER6=34859]=\"DRAW_BUFFER6\",e[e.DRAW_BUFFER7=34860]=\"DRAW_BUFFER7\",e[e.DRAW_BUFFER8=34861]=\"DRAW_BUFFER8\",e[e.DRAW_BUFFER9=34862]=\"DRAW_BUFFER9\",e[e.DRAW_BUFFER10=34863]=\"DRAW_BUFFER10\",e[e.DRAW_BUFFER11=34864]=\"DRAW_BUFFER11\",e[e.DRAW_BUFFER12=34865]=\"DRAW_BUFFER12\",e[e.DRAW_BUFFER13=34866]=\"DRAW_BUFFER13\",e[e.DRAW_BUFFER14=34867]=\"DRAW_BUFFER14\",e[e.DRAW_BUFFER15=34868]=\"DRAW_BUFFER15\",e[e.MAX_COLOR_ATTACHMENTS=36063]=\"MAX_COLOR_ATTACHMENTS\",e[e.COLOR_ATTACHMENT1=36065]=\"COLOR_ATTACHMENT1\",e[e.COLOR_ATTACHMENT2=36066]=\"COLOR_ATTACHMENT2\",e[e.COLOR_ATTACHMENT3=36067]=\"COLOR_ATTACHMENT3\",e[e.COLOR_ATTACHMENT4=36068]=\"COLOR_ATTACHMENT4\",e[e.COLOR_ATTACHMENT5=36069]=\"COLOR_ATTACHMENT5\",e[e.COLOR_ATTACHMENT6=36070]=\"COLOR_ATTACHMENT6\",e[e.COLOR_ATTACHMENT7=36071]=\"COLOR_ATTACHMENT7\",e[e.COLOR_ATTACHMENT8=36072]=\"COLOR_ATTACHMENT8\",e[e.COLOR_ATTACHMENT9=36073]=\"COLOR_ATTACHMENT9\",e[e.COLOR_ATTACHMENT10=36074]=\"COLOR_ATTACHMENT10\",e[e.COLOR_ATTACHMENT11=36075]=\"COLOR_ATTACHMENT11\",e[e.COLOR_ATTACHMENT12=36076]=\"COLOR_ATTACHMENT12\",e[e.COLOR_ATTACHMENT13=36077]=\"COLOR_ATTACHMENT13\",e[e.COLOR_ATTACHMENT14=36078]=\"COLOR_ATTACHMENT14\",e[e.COLOR_ATTACHMENT15=36079]=\"COLOR_ATTACHMENT15\",e[e.SAMPLER_3D=35679]=\"SAMPLER_3D\",e[e.SAMPLER_2D_SHADOW=35682]=\"SAMPLER_2D_SHADOW\",e[e.SAMPLER_2D_ARRAY=36289]=\"SAMPLER_2D_ARRAY\",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]=\"SAMPLER_2D_ARRAY_SHADOW\",e[e.SAMPLER_CUBE_SHADOW=36293]=\"SAMPLER_CUBE_SHADOW\",e[e.INT_SAMPLER_2D=36298]=\"INT_SAMPLER_2D\",e[e.INT_SAMPLER_3D=36299]=\"INT_SAMPLER_3D\",e[e.INT_SAMPLER_CUBE=36300]=\"INT_SAMPLER_CUBE\",e[e.INT_SAMPLER_2D_ARRAY=36303]=\"INT_SAMPLER_2D_ARRAY\",e[e.UNSIGNED_INT_SAMPLER_2D=36306]=\"UNSIGNED_INT_SAMPLER_2D\",e[e.UNSIGNED_INT_SAMPLER_3D=36307]=\"UNSIGNED_INT_SAMPLER_3D\",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]=\"UNSIGNED_INT_SAMPLER_CUBE\",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]=\"UNSIGNED_INT_SAMPLER_2D_ARRAY\",e[e.MAX_SAMPLES=36183]=\"MAX_SAMPLES\",e[e.SAMPLER_BINDING=35097]=\"SAMPLER_BINDING\",e[e.PIXEL_PACK_BUFFER=35051]=\"PIXEL_PACK_BUFFER\",e[e.PIXEL_UNPACK_BUFFER=35052]=\"PIXEL_UNPACK_BUFFER\",e[e.PIXEL_PACK_BUFFER_BINDING=35053]=\"PIXEL_PACK_BUFFER_BINDING\",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]=\"PIXEL_UNPACK_BUFFER_BINDING\",e[e.COPY_READ_BUFFER=36662]=\"COPY_READ_BUFFER\",e[e.COPY_WRITE_BUFFER=36663]=\"COPY_WRITE_BUFFER\",e[e.COPY_READ_BUFFER_BINDING=36662]=\"COPY_READ_BUFFER_BINDING\",e[e.COPY_WRITE_BUFFER_BINDING=36663]=\"COPY_WRITE_BUFFER_BINDING\",e[e.FLOAT_MAT2x3=35685]=\"FLOAT_MAT2x3\",e[e.FLOAT_MAT2x4=35686]=\"FLOAT_MAT2x4\",e[e.FLOAT_MAT3x2=35687]=\"FLOAT_MAT3x2\",e[e.FLOAT_MAT3x4=35688]=\"FLOAT_MAT3x4\",e[e.FLOAT_MAT4x2=35689]=\"FLOAT_MAT4x2\",e[e.FLOAT_MAT4x3=35690]=\"FLOAT_MAT4x3\",e[e.UNSIGNED_INT_VEC2=36294]=\"UNSIGNED_INT_VEC2\",e[e.UNSIGNED_INT_VEC3=36295]=\"UNSIGNED_INT_VEC3\",e[e.UNSIGNED_INT_VEC4=36296]=\"UNSIGNED_INT_VEC4\",e[e.UNSIGNED_NORMALIZED=35863]=\"UNSIGNED_NORMALIZED\",e[e.SIGNED_NORMALIZED=36764]=\"SIGNED_NORMALIZED\",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]=\"VERTEX_ATTRIB_ARRAY_INTEGER\",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]=\"VERTEX_ATTRIB_ARRAY_DIVISOR\",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]=\"TRANSFORM_FEEDBACK_BUFFER_MODE\",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]=\"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS\",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]=\"TRANSFORM_FEEDBACK_VARYINGS\",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]=\"TRANSFORM_FEEDBACK_BUFFER_START\",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]=\"TRANSFORM_FEEDBACK_BUFFER_SIZE\",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]=\"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN\",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]=\"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS\",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]=\"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS\",e[e.INTERLEAVED_ATTRIBS=35980]=\"INTERLEAVED_ATTRIBS\",e[e.SEPARATE_ATTRIBS=35981]=\"SEPARATE_ATTRIBS\",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]=\"TRANSFORM_FEEDBACK_BUFFER\",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]=\"TRANSFORM_FEEDBACK_BUFFER_BINDING\",e[e.TRANSFORM_FEEDBACK=36386]=\"TRANSFORM_FEEDBACK\",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]=\"TRANSFORM_FEEDBACK_PAUSED\",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]=\"TRANSFORM_FEEDBACK_ACTIVE\",e[e.TRANSFORM_FEEDBACK_BINDING=36389]=\"TRANSFORM_FEEDBACK_BINDING\",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]=\"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]=\"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]=\"FRAMEBUFFER_ATTACHMENT_RED_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]=\"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]=\"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]=\"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]=\"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]=\"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\",e[e.FRAMEBUFFER_DEFAULT=33304]=\"FRAMEBUFFER_DEFAULT\",e[e.DEPTH24_STENCIL8=35056]=\"DEPTH24_STENCIL8\",e[e.DRAW_FRAMEBUFFER_BINDING=36006]=\"DRAW_FRAMEBUFFER_BINDING\",e[e.READ_FRAMEBUFFER_BINDING=36010]=\"READ_FRAMEBUFFER_BINDING\",e[e.RENDERBUFFER_SAMPLES=36011]=\"RENDERBUFFER_SAMPLES\",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]=\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]=\"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\",e[e.UNIFORM_BUFFER=35345]=\"UNIFORM_BUFFER\",e[e.UNIFORM_BUFFER_BINDING=35368]=\"UNIFORM_BUFFER_BINDING\",e[e.UNIFORM_BUFFER_START=35369]=\"UNIFORM_BUFFER_START\",e[e.UNIFORM_BUFFER_SIZE=35370]=\"UNIFORM_BUFFER_SIZE\",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]=\"MAX_VERTEX_UNIFORM_BLOCKS\",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]=\"MAX_FRAGMENT_UNIFORM_BLOCKS\",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]=\"MAX_COMBINED_UNIFORM_BLOCKS\",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]=\"MAX_UNIFORM_BUFFER_BINDINGS\",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]=\"MAX_UNIFORM_BLOCK_SIZE\",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]=\"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS\",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]=\"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS\",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]=\"UNIFORM_BUFFER_OFFSET_ALIGNMENT\",e[e.ACTIVE_UNIFORM_BLOCKS=35382]=\"ACTIVE_UNIFORM_BLOCKS\",e[e.UNIFORM_TYPE=35383]=\"UNIFORM_TYPE\",e[e.UNIFORM_SIZE=35384]=\"UNIFORM_SIZE\",e[e.UNIFORM_BLOCK_INDEX=35386]=\"UNIFORM_BLOCK_INDEX\",e[e.UNIFORM_OFFSET=35387]=\"UNIFORM_OFFSET\",e[e.UNIFORM_ARRAY_STRIDE=35388]=\"UNIFORM_ARRAY_STRIDE\",e[e.UNIFORM_MATRIX_STRIDE=35389]=\"UNIFORM_MATRIX_STRIDE\",e[e.UNIFORM_IS_ROW_MAJOR=35390]=\"UNIFORM_IS_ROW_MAJOR\",e[e.UNIFORM_BLOCK_BINDING=35391]=\"UNIFORM_BLOCK_BINDING\",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]=\"UNIFORM_BLOCK_DATA_SIZE\",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]=\"UNIFORM_BLOCK_ACTIVE_UNIFORMS\",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]=\"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES\",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]=\"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER\",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]=\"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER\",e[e.OBJECT_TYPE=37138]=\"OBJECT_TYPE\",e[e.SYNC_CONDITION=37139]=\"SYNC_CONDITION\",e[e.SYNC_STATUS=37140]=\"SYNC_STATUS\",e[e.SYNC_FLAGS=37141]=\"SYNC_FLAGS\",e[e.SYNC_FENCE=37142]=\"SYNC_FENCE\",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]=\"SYNC_GPU_COMMANDS_COMPLETE\",e[e.UNSIGNALED=37144]=\"UNSIGNALED\",e[e.SIGNALED=37145]=\"SIGNALED\",e[e.ALREADY_SIGNALED=37146]=\"ALREADY_SIGNALED\",e[e.TIMEOUT_EXPIRED=37147]=\"TIMEOUT_EXPIRED\",e[e.CONDITION_SATISFIED=37148]=\"CONDITION_SATISFIED\",e[e.WAIT_FAILED=37149]=\"WAIT_FAILED\",e[e.SYNC_FLUSH_COMMANDS_BIT=1]=\"SYNC_FLUSH_COMMANDS_BIT\",e[e.COLOR=6144]=\"COLOR\",e[e.DEPTH=6145]=\"DEPTH\",e[e.STENCIL=6146]=\"STENCIL\",e[e.MIN=32775]=\"MIN\",e[e.MAX=32776]=\"MAX\",e[e.DEPTH_COMPONENT24=33190]=\"DEPTH_COMPONENT24\",e[e.STREAM_READ=35041]=\"STREAM_READ\",e[e.STREAM_COPY=35042]=\"STREAM_COPY\",e[e.STATIC_READ=35045]=\"STATIC_READ\",e[e.STATIC_COPY=35046]=\"STATIC_COPY\",e[e.DYNAMIC_READ=35049]=\"DYNAMIC_READ\",e[e.DYNAMIC_COPY=35050]=\"DYNAMIC_COPY\",e[e.DEPTH_COMPONENT32F=36012]=\"DEPTH_COMPONENT32F\",e[e.DEPTH32F_STENCIL8=36013]=\"DEPTH32F_STENCIL8\",e[e.INVALID_INDEX=4294967295]=\"INVALID_INDEX\",e[e.TIMEOUT_IGNORED=-1]=\"TIMEOUT_IGNORED\",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]=\"MAX_CLIENT_WAIT_TIMEOUT_WEBGL\",e[e.UNMASKED_VENDOR_WEBGL=37445]=\"UNMASKED_VENDOR_WEBGL\",e[e.UNMASKED_RENDERER_WEBGL=37446]=\"UNMASKED_RENDERER_WEBGL\",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]=\"MAX_TEXTURE_MAX_ANISOTROPY_EXT\",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]=\"TEXTURE_MAX_ANISOTROPY_EXT\",e[e.R16_EXT=33322]=\"R16_EXT\",e[e.RG16_EXT=33324]=\"RG16_EXT\",e[e.RGB16_EXT=32852]=\"RGB16_EXT\",e[e.RGBA16_EXT=32859]=\"RGBA16_EXT\",e[e.R16_SNORM_EXT=36760]=\"R16_SNORM_EXT\",e[e.RG16_SNORM_EXT=36761]=\"RG16_SNORM_EXT\",e[e.RGB16_SNORM_EXT=36762]=\"RGB16_SNORM_EXT\",e[e.RGBA16_SNORM_EXT=36763]=\"RGBA16_SNORM_EXT\",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]=\"COMPRESSED_RGB_S3TC_DXT1_EXT\",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]=\"COMPRESSED_RGBA_S3TC_DXT1_EXT\",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]=\"COMPRESSED_RGBA_S3TC_DXT3_EXT\",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]=\"COMPRESSED_RGBA_S3TC_DXT5_EXT\",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]=\"COMPRESSED_SRGB_S3TC_DXT1_EXT\",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]=\"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT\",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]=\"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT\",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]=\"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT\",e[e.COMPRESSED_RED_RGTC1_EXT=36283]=\"COMPRESSED_RED_RGTC1_EXT\",e[e.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]=\"COMPRESSED_SIGNED_RED_RGTC1_EXT\",e[e.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]=\"COMPRESSED_RED_GREEN_RGTC2_EXT\",e[e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]=\"COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT\",e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]=\"COMPRESSED_RGBA_BPTC_UNORM_EXT\",e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]=\"COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT\",e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]=\"COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT\",e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]=\"COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT\",e[e.COMPRESSED_R11_EAC=37488]=\"COMPRESSED_R11_EAC\",e[e.COMPRESSED_SIGNED_R11_EAC=37489]=\"COMPRESSED_SIGNED_R11_EAC\",e[e.COMPRESSED_RG11_EAC=37490]=\"COMPRESSED_RG11_EAC\",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]=\"COMPRESSED_SIGNED_RG11_EAC\",e[e.COMPRESSED_RGB8_ETC2=37492]=\"COMPRESSED_RGB8_ETC2\",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]=\"COMPRESSED_RGBA8_ETC2_EAC\",e[e.COMPRESSED_SRGB8_ETC2=37494]=\"COMPRESSED_SRGB8_ETC2\",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]=\"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]=\"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]=\"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]=\"COMPRESSED_RGB_PVRTC_4BPPV1_IMG\",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]=\"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]=\"COMPRESSED_RGB_PVRTC_2BPPV1_IMG\",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]=\"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]=\"COMPRESSED_RGB_ETC1_WEBGL\",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]=\"COMPRESSED_RGB_ATC_WEBGL\",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]=\"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL\",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]=\"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]=\"COMPRESSED_RGBA_ASTC_4x4_KHR\",e[e.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]=\"COMPRESSED_RGBA_ASTC_5x4_KHR\",e[e.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]=\"COMPRESSED_RGBA_ASTC_5x5_KHR\",e[e.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]=\"COMPRESSED_RGBA_ASTC_6x5_KHR\",e[e.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]=\"COMPRESSED_RGBA_ASTC_6x6_KHR\",e[e.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]=\"COMPRESSED_RGBA_ASTC_8x5_KHR\",e[e.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]=\"COMPRESSED_RGBA_ASTC_8x6_KHR\",e[e.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]=\"COMPRESSED_RGBA_ASTC_8x8_KHR\",e[e.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]=\"COMPRESSED_RGBA_ASTC_10x5_KHR\",e[e.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]=\"COMPRESSED_RGBA_ASTC_10x6_KHR\",e[e.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]=\"COMPRESSED_RGBA_ASTC_10x8_KHR\",e[e.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]=\"COMPRESSED_RGBA_ASTC_10x10_KHR\",e[e.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]=\"COMPRESSED_RGBA_ASTC_12x10_KHR\",e[e.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]=\"COMPRESSED_RGBA_ASTC_12x12_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR\",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]=\"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR\",e[e.QUERY_COUNTER_BITS_EXT=34916]=\"QUERY_COUNTER_BITS_EXT\",e[e.CURRENT_QUERY_EXT=34917]=\"CURRENT_QUERY_EXT\",e[e.QUERY_RESULT_EXT=34918]=\"QUERY_RESULT_EXT\",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]=\"QUERY_RESULT_AVAILABLE_EXT\",e[e.TIME_ELAPSED_EXT=35007]=\"TIME_ELAPSED_EXT\",e[e.TIMESTAMP_EXT=36392]=\"TIMESTAMP_EXT\",e[e.GPU_DISJOINT_EXT=36795]=\"GPU_DISJOINT_EXT\",e[e.COMPLETION_STATUS_KHR=37297]=\"COMPLETION_STATUS_KHR\",e[e.DEPTH_CLAMP_EXT=34383]=\"DEPTH_CLAMP_EXT\",e[e.FIRST_VERTEX_CONVENTION_WEBGL=36429]=\"FIRST_VERTEX_CONVENTION_WEBGL\",e[e.LAST_VERTEX_CONVENTION_WEBGL=36430]=\"LAST_VERTEX_CONVENTION_WEBGL\",e[e.PROVOKING_VERTEX_WEBL=36431]=\"PROVOKING_VERTEX_WEBL\",e[e.POLYGON_MODE_WEBGL=2880]=\"POLYGON_MODE_WEBGL\",e[e.POLYGON_OFFSET_LINE_WEBGL=10754]=\"POLYGON_OFFSET_LINE_WEBGL\",e[e.LINE_WEBGL=6913]=\"LINE_WEBGL\",e[e.FILL_WEBGL=6914]=\"FILL_WEBGL\",e[e.MAX_CLIP_DISTANCES_WEBGL=3378]=\"MAX_CLIP_DISTANCES_WEBGL\",e[e.MAX_CULL_DISTANCES_WEBGL=33529]=\"MAX_CULL_DISTANCES_WEBGL\",e[e.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]=\"MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL\",e[e.CLIP_DISTANCE0_WEBGL=12288]=\"CLIP_DISTANCE0_WEBGL\",e[e.CLIP_DISTANCE1_WEBGL=12289]=\"CLIP_DISTANCE1_WEBGL\",e[e.CLIP_DISTANCE2_WEBGL=12290]=\"CLIP_DISTANCE2_WEBGL\",e[e.CLIP_DISTANCE3_WEBGL=12291]=\"CLIP_DISTANCE3_WEBGL\",e[e.CLIP_DISTANCE4_WEBGL=12292]=\"CLIP_DISTANCE4_WEBGL\",e[e.CLIP_DISTANCE5_WEBGL=12293]=\"CLIP_DISTANCE5_WEBGL\",e[e.CLIP_DISTANCE6_WEBGL=12294]=\"CLIP_DISTANCE6_WEBGL\",e[e.CLIP_DISTANCE7_WEBGL=12295]=\"CLIP_DISTANCE7_WEBGL\",e[e.POLYGON_OFFSET_CLAMP_EXT=36379]=\"POLYGON_OFFSET_CLAMP_EXT\",e[e.LOWER_LEFT_EXT=36001]=\"LOWER_LEFT_EXT\",e[e.UPPER_LEFT_EXT=36002]=\"UPPER_LEFT_EXT\",e[e.NEGATIVE_ONE_TO_ONE_EXT=37726]=\"NEGATIVE_ONE_TO_ONE_EXT\",e[e.ZERO_TO_ONE_EXT=37727]=\"ZERO_TO_ONE_EXT\",e[e.CLIP_ORIGIN_EXT=37724]=\"CLIP_ORIGIN_EXT\",e[e.CLIP_DEPTH_MODE_EXT=37725]=\"CLIP_DEPTH_MODE_EXT\",e[e.SRC1_COLOR_WEBGL=35065]=\"SRC1_COLOR_WEBGL\",e[e.SRC1_ALPHA_WEBGL=34185]=\"SRC1_ALPHA_WEBGL\",e[e.ONE_MINUS_SRC1_COLOR_WEBGL=35066]=\"ONE_MINUS_SRC1_COLOR_WEBGL\",e[e.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]=\"ONE_MINUS_SRC1_ALPHA_WEBGL\",e[e.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]=\"MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL\",e[e.MIRROR_CLAMP_TO_EDGE_EXT=34627]=\"MIRROR_CLAMP_TO_EDGE_EXT\"})(A1||(A1={}))});var Imt=Et(()=>{Cmt()});function kmt(e=!0){let t=HTMLCanvasElement.prototype;if(!e&&t.originalGetContext){t.getContext=t.originalGetContext,t.originalGetContext=void 0;return}t.originalGetContext=t.getContext,t.getContext=function(r,i){if(r===\"webgl\"||r===\"experimental-webgl\"){let n=this.originalGetContext(\"webgl2\",i);return n instanceof HTMLElement&&Ljt(n),n}return this.originalGetContext(r,i)}}function Ljt(e){e.getExtension(\"EXT_color_buffer_float\");let t={...kjt,WEBGL_disjoint_timer_query:e.getExtension(\"EXT_disjoint_timer_query_webgl2\"),WEBGL_draw_buffers:Rjt(e),OES_vertex_array_object:Djt(e),ANGLE_instanced_arrays:Ojt(e)},r=e.getExtension;e.getExtension=function(n){let o=r.call(e,n);return o||(n in t?t[n]:null)};let i=e.getSupportedExtensions;e.getSupportedExtensions=function(){return(i.apply(e)||[])?.concat(Object.keys(t))}}var kjt,Rjt,Djt,Ojt,Rmt=Et(()=>{kjt={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},Rjt=e=>({drawBuffersWEBGL(t){return e.drawBuffers(t)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),Djt=e=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return e.createVertexArray()},deleteVertexArrayOES(t){return e.deleteVertexArray(t)},isVertexArrayOES(t){return e.isVertexArray(t)},bindVertexArrayOES(t){return e.bindVertexArray(t)}}),Ojt=e=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...t){return e.drawArraysInstanced(...t)},drawElementsInstancedANGLE(...t){return e.drawElementsInstanced(...t)},vertexAttribDivisorANGLE(...t){return e.vertexAttribDivisor(...t)}})});async function AL(e,t){let r=document.getElementsByTagName(\"head\")[0];if(!r)throw new Error(\"loadScript\");let i=document.createElement(\"script\");return i.setAttribute(\"type\",\"text/javascript\"),i.setAttribute(\"src\",e),t&&(i.id=t),new Promise((n,o)=>{i.onload=n,i.onerror=s=>o(new Error(`Unable to load script '${e}': ${s}`)),r.appendChild(i)})}var tX=Et(()=>{});async function Omt(e){if(!globalThis.SPECTOR)try{await AL(e.debugSpectorJSUrl||yL.debugSpectorJSUrl)}catch(t){Ie.warn(String(t))}}function Lmt(e){if(e={...yL,...e},!e.debugSpectorJS)return null;if(!bh&&globalThis.SPECTOR&&!globalThis.luma?.spector){Ie.probe(Bjt,\"SPECTOR found and initialized. Start with `luma.spector.displayUI()`\")();let{Spector:t}=globalThis.SPECTOR;bh=new t,globalThis.luma&&(globalThis.luma.spector=bh)}if(!bh)return null;if(Dmt||(Dmt=!0,bh.spyCanvases(),bh?.onCaptureStarted.add(t=>Ie.info(\"Spector capture started:\",t)()),bh?.onCapture.add(t=>{Ie.info(\"Spector capture complete:\",t)(),bh?.getResultUI(),bh?.resultView.display(),bh?.resultView.addCapture(t)})),e.gl){let t=e.gl,r=t.device;bh?.startCapture(e.gl,500),t.device=r,new Promise(i=>setTimeout(i,2e3)).then(i=>{Ie.info(\"Spector capture stopped after 2 seconds\")(),bh?.stopCapture()})}return bh}var Bjt,bh,Dmt,yL,eX=Et(()=>{Ci();tX();Bjt=1,bh=null,Dmt=!1,yL={debugSpectorJS:Ie.get(\"debug-spectorjs\"),debugSpectorJSUrl:\"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js\",gl:void 0}});function Fmt(e){return e.luma=e.luma||{},e.luma}async function Nmt(){Cc()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await AL(Fjt))}function zmt(e,t={}){return t.debugWebGL||t.traceWebGL?zjt(e,t):Njt(e)}function Njt(e){let t=Fmt(e);return t.realContext?t.realContext:e}function zjt(e,t){if(!globalThis.WebGLDebugUtils)return Ie.warn(\"webgl-debug not loaded\")(),e;let r=Fmt(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init({...A1,...e});let i=globalThis.WebGLDebugUtils.makeDebugContext(e,Ujt.bind(null,t),Vjt.bind(null,t));for(let s in A1)!(s in i)&&typeof A1[s]==\"number\"&&(i[s]=A1[s]);class n{}Object.setPrototypeOf(i,Object.getPrototypeOf(e)),Object.setPrototypeOf(n,i);let o=Object.create(n);return r.realContext=e,r.debugContext=o,o.debug=!0,o}function Bmt(e,t){t=Array.from(t).map(i=>i===void 0?\"undefined\":i);let r=globalThis.WebGLDebugUtils.glFunctionArgsToString(e,t);return r=`${r.slice(0,100)}${r.length>100?\"...\":\"\"}`,`gl.${e}(${r})`}function Ujt(e,t,r,i){i=Array.from(i).map(a=>a===void 0?\"undefined\":a);let n=globalThis.WebGLDebugUtils.glEnumToString(t),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,i),s=`${n} in gl.${r}(${o})`;Ie.error(s)();debugger}function Vjt(e,t,r){let i=\"\";Ie.level>=1&&(i=Bmt(t,r),e.traceWebGL&&Ie.log(1,i)());for(let n of r)if(n===void 0){i=i||Bmt(t,r);debugger}}var Fjt,rX=Et(()=>{Ci();Imt();r1();tX();Fjt=\"https://unpkg.com/webgl-debug@2.0.1/index.js\"});function iX(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ws(e,t,r){return t[e]!==void 0?t[e]:r[e]}var xP,ma,Umt,xh,Vmt,bP,jmt,$mt,nX,w0,oX,Gmt,sX=Et(()=>{xP={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ma=(e,t,r)=>t?e.enable(r):e.disable(r),Umt=(e,t,r)=>e.hint(r,t),xh=(e,t,r)=>e.pixelStorei(r,t),Vmt=(e,t,r)=>{let i=r===36006?36009:36008;return e.bindFramebuffer(i,t)},bP=(e,t,r)=>{let n={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[r];e.bindBuffer(n,t)};jmt={3042:ma,32773:(e,t)=>e.blendColor(...t),32777:\"blendEquation\",34877:\"blendEquation\",32969:\"blendFunc\",32968:\"blendFunc\",32971:\"blendFunc\",32970:\"blendFunc\",3106:(e,t)=>e.clearColor(...t),3107:(e,t)=>e.colorMask(...t),2884:ma,2885:(e,t)=>e.cullFace(t),2929:ma,2931:(e,t)=>e.clearDepth(t),2932:(e,t)=>e.depthFunc(t),2928:(e,t)=>e.depthRange(...t),2930:(e,t)=>e.depthMask(t),3024:ma,35723:Umt,35725:(e,t)=>e.useProgram(t),36007:(e,t)=>e.bindRenderbuffer(36161,t),36389:(e,t)=>e.bindTransformFeedback?.(36386,t),34229:(e,t)=>e.bindVertexArray(t),36006:Vmt,36010:Vmt,34964:bP,36662:bP,36663:bP,35053:bP,35055:bP,2886:(e,t)=>e.frontFace(t),33170:Umt,2849:(e,t)=>e.lineWidth(t),32823:ma,32824:\"polygonOffset\",10752:\"polygonOffset\",35977:ma,32926:ma,32928:ma,32938:\"sampleCoverage\",32939:\"sampleCoverage\",3089:ma,3088:(e,t)=>e.scissor(...t),2960:ma,2961:(e,t)=>e.clearStencil(t),2968:(e,t)=>e.stencilMaskSeparate(1028,t),36005:(e,t)=>e.stencilMaskSeparate(1029,t),2962:\"stencilFuncFront\",2967:\"stencilFuncFront\",2963:\"stencilFuncFront\",34816:\"stencilFuncBack\",36003:\"stencilFuncBack\",36004:\"stencilFuncBack\",2964:\"stencilOpFront\",2965:\"stencilOpFront\",2966:\"stencilOpFront\",34817:\"stencilOpBack\",34818:\"stencilOpBack\",34819:\"stencilOpBack\",2978:(e,t)=>e.viewport(...t),34383:ma,10754:ma,12288:ma,12289:ma,12290:ma,12291:ma,12292:ma,12293:ma,12294:ma,12295:ma,3333:xh,3317:xh,37440:xh,37441:xh,37443:xh,3330:xh,3332:xh,3331:xh,3314:xh,32878:xh,3316:xh,3315:xh,32877:xh,framebuffer:(e,t)=>{let r=t&&\"handle\"in t?t.handle:t;return e.bindFramebuffer(36160,r)},blend:(e,t)=>t?e.enable(3042):e.disable(3042),blendColor:(e,t)=>e.blendColor(...t),blendEquation:(e,t)=>{let r=typeof t==\"number\"?[t,t]:t;e.blendEquationSeparate(...r)},blendFunc:(e,t)=>{let r=t?.length===2?[...t,...t]:t;e.blendFuncSeparate(...r)},clearColor:(e,t)=>e.clearColor(...t),clearDepth:(e,t)=>e.clearDepth(t),clearStencil:(e,t)=>e.clearStencil(t),colorMask:(e,t)=>e.colorMask(...t),cull:(e,t)=>t?e.enable(2884):e.disable(2884),cullFace:(e,t)=>e.cullFace(t),depthTest:(e,t)=>t?e.enable(2929):e.disable(2929),depthFunc:(e,t)=>e.depthFunc(t),depthMask:(e,t)=>e.depthMask(t),depthRange:(e,t)=>e.depthRange(...t),dither:(e,t)=>t?e.enable(3024):e.disable(3024),derivativeHint:(e,t)=>{e.hint(35723,t)},frontFace:(e,t)=>e.frontFace(t),mipmapHint:(e,t)=>e.hint(33170,t),lineWidth:(e,t)=>e.lineWidth(t),polygonOffsetFill:(e,t)=>t?e.enable(32823):e.disable(32823),polygonOffset:(e,t)=>e.polygonOffset(...t),sampleCoverage:(e,t)=>e.sampleCoverage(t[0],t[1]||!1),scissorTest:(e,t)=>t?e.enable(3089):e.disable(3089),scissor:(e,t)=>e.scissor(...t),stencilTest:(e,t)=>t?e.enable(2960):e.disable(2960),stencilMask:(e,t)=>{t=iX(t)?t:[t,t];let[r,i]=t;e.stencilMaskSeparate(1028,r),e.stencilMaskSeparate(1029,i)},stencilFunc:(e,t)=>{t=iX(t)&&t.length===3?[...t,...t]:t;let[r,i,n,o,s,a]=t;e.stencilFuncSeparate(1028,r,i,n),e.stencilFuncSeparate(1029,o,s,a)},stencilOp:(e,t)=>{t=iX(t)&&t.length===3?[...t,...t]:t;let[r,i,n,o,s,a]=t;e.stencilOpSeparate(1028,r,i,n),e.stencilOpSeparate(1029,o,s,a)},viewport:(e,t)=>e.viewport(...t)};$mt={blendEquation:(e,t,r)=>e.blendEquationSeparate(ws(32777,t,r),ws(34877,t,r)),blendFunc:(e,t,r)=>e.blendFuncSeparate(ws(32969,t,r),ws(32968,t,r),ws(32971,t,r),ws(32970,t,r)),polygonOffset:(e,t,r)=>e.polygonOffset(ws(32824,t,r),ws(10752,t,r)),sampleCoverage:(e,t,r)=>e.sampleCoverage(ws(32938,t,r),ws(32939,t,r)),stencilFuncFront:(e,t,r)=>e.stencilFuncSeparate(1028,ws(2962,t,r),ws(2967,t,r),ws(2963,t,r)),stencilFuncBack:(e,t,r)=>e.stencilFuncSeparate(1029,ws(34816,t,r),ws(36003,t,r),ws(36004,t,r)),stencilOpFront:(e,t,r)=>e.stencilOpSeparate(1028,ws(2964,t,r),ws(2965,t,r),ws(2966,t,r)),stencilOpBack:(e,t,r)=>e.stencilOpSeparate(1029,ws(34817,t,r),ws(34818,t,r),ws(34819,t,r))},nX={enable:(e,t)=>e({[t]:!0}),disable:(e,t)=>e({[t]:!1}),pixelStorei:(e,t,r)=>e({[t]:r}),hint:(e,t,r)=>e({[t]:r}),useProgram:(e,t)=>e({35725:t}),bindRenderbuffer:(e,t,r)=>e({36007:r}),bindTransformFeedback:(e,t,r)=>e({36389:r}),bindVertexArray:(e,t)=>e({34229:t}),bindFramebuffer:(e,t,r)=>{switch(t){case 36160:return e({36006:r,36010:r});case 36009:return e({36006:r});case 36008:return e({36010:r});default:return null}},bindBuffer:(e,t,r)=>{let i={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[t];return i?e({[i]:r}):{valueChanged:!0}},blendColor:(e,t,r,i,n)=>e({32773:new Float32Array([t,r,i,n])}),blendEquation:(e,t)=>e({32777:t,34877:t}),blendEquationSeparate:(e,t,r)=>e({32777:t,34877:r}),blendFunc:(e,t,r)=>e({32969:t,32968:r,32971:t,32970:r}),blendFuncSeparate:(e,t,r,i,n)=>e({32969:t,32968:r,32971:i,32970:n}),clearColor:(e,t,r,i,n)=>e({3106:new Float32Array([t,r,i,n])}),clearDepth:(e,t)=>e({2931:t}),clearStencil:(e,t)=>e({2961:t}),colorMask:(e,t,r,i,n)=>e({3107:[t,r,i,n]}),cullFace:(e,t)=>e({2885:t}),depthFunc:(e,t)=>e({2932:t}),depthRange:(e,t,r)=>e({2928:new Float32Array([t,r])}),depthMask:(e,t)=>e({2930:t}),frontFace:(e,t)=>e({2886:t}),lineWidth:(e,t)=>e({2849:t}),polygonOffset:(e,t,r)=>e({32824:t,10752:r}),sampleCoverage:(e,t,r)=>e({32938:t,32939:r}),scissor:(e,t,r,i,n)=>e({3088:new Int32Array([t,r,i,n])}),stencilMask:(e,t)=>e({2968:t,36005:t}),stencilMaskSeparate:(e,t,r)=>e({[t===1028?2968:36005]:r}),stencilFunc:(e,t,r,i)=>e({2962:t,2967:r,2963:i,34816:t,36003:r,36004:i}),stencilFuncSeparate:(e,t,r,i,n)=>e({[t===1028?2962:34816]:r,[t===1028?2967:36003]:i,[t===1028?2963:36004]:n}),stencilOp:(e,t,r,i)=>e({2964:t,2965:r,2966:i,34817:t,34818:r,34819:i}),stencilOpSeparate:(e,t,r,i,n)=>e({[t===1028?2964:34817]:r,[t===1028?2965:34818]:i,[t===1028?2966:34819]:n}),viewport:(e,t,r,i,n)=>e({2978:[t,r,i,n]})},w0=(e,t)=>e.isEnabled(t),oX={3042:w0,2884:w0,2929:w0,3024:w0,32823:w0,32926:w0,32928:w0,3089:w0,2960:w0,35977:w0},Gmt=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068])});function Hf(e,t){if(jjt(t))return;let r={};for(let n in t){let o=Number(n),s=jmt[n];s&&(typeof s==\"string\"?r[s]=!0:s(e,t[n],o))}let i=e.state&&e.state.cache;if(i)for(let n in r){let o=$mt[n];o(e,t,i)}}function _L(e,t=xP){if(typeof t==\"number\"){let n=t,o=oX[n];return o?o(e,n):e.getParameter(n)}let r=Array.isArray(t)?t:Object.keys(t),i={};for(let n of r){let o=oX[n];i[n]=o?o(e,Number(n)):e.getParameter(Number(n))}return i}function Wmt(e){Hf(e,xP)}function jjt(e){for(let t in e)return!1;return!0}var N3=Et(()=>{sX()});function Hmt(e,t){if(e===t)return!0;if(qmt(e)&&qmt(t)&&e.length===t.length){for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}return!1}function qmt(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var Ymt=Et(()=>{});function Xmt(e,t){let r=e[t].bind(e);e[t]=function(n){if(n===void 0||Gmt.has(n))return r(n);let o=Yf.get(e);return n in o.cache||(o.cache[n]=r(n)),o.enable?o.cache[n]:r(n)},Object.defineProperty(e[t],\"name\",{value:`${t}-from-cache`,configurable:!1})}function $jt(e,t,r){if(!e[t])return;let i=e[t].bind(e);e[t]=function(...o){let s=Yf.get(e),{valueChanged:a,oldValue:h}=r(s._updateCache,...o);return a&&i(...o),h},Object.defineProperty(e[t],\"name\",{value:`${t}-to-cache`,configurable:!1})}function Gjt(e){let t=e.useProgram.bind(e);e.useProgram=function(i){let n=Yf.get(e);n.program!==i&&(t(i),n.program=i)}}var Yf,aX=Et(()=>{N3();Ymt();sX();Yf=class{static get(t){return t.state}gl;program=null;stateStack=[];enable=!0;cache=null;log;initialized=!1;constructor(t,r){this.gl=t,this.log=r?.log||(()=>{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){let t=this.stateStack[this.stateStack.length-1];Hf(this.gl,t),this.stateStack.pop()}trackState(t,r){if(this.cache=r?.copyState?_L(t):Object.assign({},xP),this.initialized)throw new Error(\"WebGLStateTracker\");this.initialized=!0,this.gl.state=this,Gjt(t);for(let i in nX){let n=nX[i];$jt(t,i,n)}Xmt(t,\"getParameter\"),Xmt(t,\"isEnabled\")}_updateCache(t){let r=!1,i,n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(let o in t){let s=t[o],a=this.cache[o];Hmt(s,a)||(r=!0,i=a,n&&!(o in n)&&(n[o]=a),this.cache[o]=s)}return{valueChanged:r,oldValue:i}}}});function Zmt(e,t,r){let i=\"\",n={preserveDrawingBuffer:!0,...r},o=null;if(o||=e.getContext(\"webgl2\",n),n.failIfMajorPerformanceCaveat&&(i||=\"Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.\"),!o&&!r.failIfMajorPerformanceCaveat&&(n.failIfMajorPerformanceCaveat=!1,o=e.getContext(\"webgl2\",n),o.luma||={},o.luma.softwareRenderer=!0),o||(o=e.getContext(\"webgl\",{}),o&&(o=null,i||=\"Your browser only supports WebGL1\")),!o)throw i||=\"Your browser does not support WebGL\",new Error(`Failed to create WebGL context: ${i}`);let{onContextLost:s,onContextRestored:a}=t;return e.addEventListener(\"webglcontextlost\",h=>s(h),!1),e.addEventListener(\"webglcontextrestored\",h=>a(h),!1),o.luma||={},o}var Kmt=Et(()=>{});function T0(e,t,r){return r[t]===void 0&&(r[t]=e.getExtension(t)||null),r[t]}var wP=Et(()=>{});function Qmt(e,t){let r=e.getParameter(7936),i=e.getParameter(7937);T0(e,\"WEBGL_debug_renderer_info\",t);let n=t.WEBGL_debug_renderer_info,o=e.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),s=e.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),a=o||r,h=s||i,p=e.getParameter(7938),g=Jmt(a,h),w=Wjt(a,h),C=qjt(a,h);return{type:\"webgl\",gpu:g,gpuType:C,gpuBackend:w,vendor:a,renderer:h,version:p,shadingLanguage:\"glsl\",shadingLanguageVersion:300}}function Jmt(e,t){return/NVIDIA/i.exec(e)||/NVIDIA/i.exec(t)?\"nvidia\":/INTEL/i.exec(e)||/INTEL/i.exec(t)?\"intel\":/Apple/i.exec(e)||/Apple/i.exec(t)?\"apple\":/AMD/i.exec(e)||/AMD/i.exec(t)||/ATI/i.exec(e)||/ATI/i.exec(t)?\"amd\":/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t)?\"software\":\"unknown\"}function Wjt(e,t){return/Metal/i.exec(e)||/Metal/i.exec(t)?\"metal\":/ANGLE/i.exec(e)||/ANGLE/i.exec(t)?\"opengl\":\"unknown\"}function qjt(e,t){if(/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t))return\"cpu\";switch(Jmt(e,t)){case\"intel\":return\"integrated\";case\"software\":return\"cpu\";case\"unknown\":return\"unknown\";default:return\"discrete\"}}var tgt=Et(()=>{wP()});function vL(e){switch(e){case\"uint8\":return 5121;case\"sint8\":return 5120;case\"unorm8\":return 5121;case\"snorm8\":return 5120;case\"uint16\":return 5123;case\"sint16\":return 5122;case\"unorm16\":return 5123;case\"snorm16\":return 5122;case\"uint32\":return 5125;case\"sint32\":return 5124;case\"float16\":return 5131;case\"float32\":return 5126}throw new Error(String(e))}var lX=Et(()=>{});function igt(e){return e in bL}function ngt(e,t,r){return(bL[t]||[]).every(n=>T0(e,n,r))}function ogt(e,t,r){let i=t.create,n=cX[t.format];return n?.gl===void 0&&(i=!1),n?.x&&(i=i&&!!T0(e,n.x,r)),{format:t.format,create:i&&t.create,render:i&&t.render,filter:i&&t.filter,blend:i&&t.blend,store:i&&t.store}}function xL(e){let t=cX[e],r=t$t(e),i=Mg.getInfo(e);return i.compressed&&(t.dataFormat=r),{internalFormat:r,format:t?.dataFormat||Jjt(i.channels,i.integer,i.normalized,r),type:i.dataType?vL(i.dataType):t?.types?.[0]||5121,compressed:i.compressed||!1}}function sgt(e){switch(Mg.getInfo(e).attachment){case\"depth\":return 36096;case\"stencil\":return 36128;case\"depth-stencil\":return 33306;default:throw new Error(`Not a depth stencil format: ${e}`)}}function Jjt(e,t,r,i){if(i===6408||i===6407)return i;switch(e){case\"r\":return t&&!r?36244:6403;case\"rg\":return t&&!r?33320:33319;case\"rgb\":return t&&!r?36248:6407;case\"rgba\":return t&&!r?36249:6408;case\"bgra\":throw new Error(\"bgra pixels not supported by WebGL\");default:return 6408}}function t$t(e){let r=cX[e]?.gl;if(r===void 0)throw new Error(`Unsupported texture format ${e}`);return r}var TP,SP,z3,U3,Hjt,Yjt,Xjt,Zjt,Kjt,egt,rgt,Qjt,bL,cX,V3=Et(()=>{Ci();wP();lX();TP=\"WEBGL_compressed_texture_s3tc\",SP=\"WEBGL_compressed_texture_s3tc_srgb\",z3=\"EXT_texture_compression_rgtc\",U3=\"EXT_texture_compression_bptc\",Hjt=\"WEBGL_compressed_texture_etc\",Yjt=\"WEBGL_compressed_texture_astc\",Xjt=\"WEBGL_compressed_texture_etc1\",Zjt=\"WEBGL_compressed_texture_pvrtc\",Kjt=\"WEBGL_compressed_texture_atc\",egt=\"EXT_texture_norm16\",rgt=\"EXT_render_snorm\",Qjt=\"EXT_color_buffer_float\",bL={\"float32-renderable-webgl\":[\"EXT_color_buffer_float\"],\"float16-renderable-webgl\":[\"EXT_color_buffer_half_float\"],\"rgb9e5ufloat-renderable-webgl\":[\"WEBGL_render_shared_exponent\"],\"snorm8-renderable-webgl\":[rgt],\"norm16-renderable-webgl\":[egt],\"snorm16-renderable-webgl\":[egt,rgt],\"float32-filterable\":[\"OES_texture_float_linear\"],\"float16-filterable-webgl\":[\"OES_texture_half_float_linear\"],\"texture-filterable-anisotropic-webgl\":[\"EXT_texture_filter_anisotropic\"],\"texture-blend-float-webgl\":[\"EXT_float_blend\"],\"texture-compression-bc\":[TP,SP,z3,U3],\"texture-compression-bc5-webgl\":[z3],\"texture-compression-bc7-webgl\":[U3],\"texture-compression-etc2\":[Hjt],\"texture-compression-astc\":[Yjt],\"texture-compression-etc1-webgl\":[Xjt],\"texture-compression-pvrtc-webgl\":[Zjt],\"texture-compression-atc-webgl\":[Kjt]};cX={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},r16unorm:{gl:33322,rb:!0},r16snorm:{gl:36760},\"rgba4unorm-webgl\":{gl:32854,rb:!0},\"rgb565unorm-webgl\":{gl:36194,rb:!0},\"rgb5a1unorm-webgl\":{gl:32855,rb:!0},\"rgb8unorm-webgl\":{gl:32849},\"rgb8snorm-webgl\":{gl:36758},rgba8unorm:{gl:32856},\"rgba8unorm-srgb\":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},\"bgra8unorm-srgb\":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},rg16unorm:{gl:33324},rg16snorm:{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},rgb10a2uint:{gl:36975,rb:!0},\"rgb16unorm-webgl\":{gl:32852},\"rgb16snorm-webgl\":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},rgba16unorm:{gl:32859,rb:!0},rgba16snorm:{gl:36763},\"rgb32float-webgl\":{gl:34837,x:Qjt,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},\"depth24plus-stencil8\":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},\"depth32float-stencil8\":{gl:36013,dataFormat:34041,types:[36269],rb:!0},\"bc1-rgb-unorm-webgl\":{gl:33776,x:TP},\"bc1-rgb-unorm-srgb-webgl\":{gl:35916,x:SP},\"bc1-rgba-unorm\":{gl:33777,x:TP},\"bc1-rgba-unorm-srgb\":{gl:35916,x:SP},\"bc2-rgba-unorm\":{gl:33778,x:TP},\"bc2-rgba-unorm-srgb\":{gl:35918,x:SP},\"bc3-rgba-unorm\":{gl:33779,x:TP},\"bc3-rgba-unorm-srgb\":{gl:35919,x:SP},\"bc4-r-unorm\":{gl:36283,x:z3},\"bc4-r-snorm\":{gl:36284,x:z3},\"bc5-rg-unorm\":{gl:36285,x:z3},\"bc5-rg-snorm\":{gl:36286,x:z3},\"bc6h-rgb-ufloat\":{gl:36495,x:U3},\"bc6h-rgb-float\":{gl:36494,x:U3},\"bc7-rgba-unorm\":{gl:36492,x:U3},\"bc7-rgba-unorm-srgb\":{gl:36493,x:U3},\"etc2-rgb8unorm\":{gl:37492},\"etc2-rgb8unorm-srgb\":{gl:37494},\"etc2-rgb8a1unorm\":{gl:37496},\"etc2-rgb8a1unorm-srgb\":{gl:37497},\"etc2-rgba8unorm\":{gl:37493},\"etc2-rgba8unorm-srgb\":{gl:37495},\"eac-r11unorm\":{gl:37488},\"eac-r11snorm\":{gl:37489},\"eac-rg11unorm\":{gl:37490},\"eac-rg11snorm\":{gl:37491},\"astc-4x4-unorm\":{gl:37808},\"astc-4x4-unorm-srgb\":{gl:37840},\"astc-5x4-unorm\":{gl:37809},\"astc-5x4-unorm-srgb\":{gl:37841},\"astc-5x5-unorm\":{gl:37810},\"astc-5x5-unorm-srgb\":{gl:37842},\"astc-6x5-unorm\":{gl:37811},\"astc-6x5-unorm-srgb\":{gl:37843},\"astc-6x6-unorm\":{gl:37812},\"astc-6x6-unorm-srgb\":{gl:37844},\"astc-8x5-unorm\":{gl:37813},\"astc-8x5-unorm-srgb\":{gl:37845},\"astc-8x6-unorm\":{gl:37814},\"astc-8x6-unorm-srgb\":{gl:37846},\"astc-8x8-unorm\":{gl:37815},\"astc-8x8-unorm-srgb\":{gl:37847},\"astc-10x5-unorm\":{gl:37819},\"astc-10x5-unorm-srgb\":{gl:37851},\"astc-10x6-unorm\":{gl:37817},\"astc-10x6-unorm-srgb\":{gl:37849},\"astc-10x8-unorm\":{gl:37818},\"astc-10x8-unorm-srgb\":{gl:37850},\"astc-10x10-unorm\":{gl:37819},\"astc-10x10-unorm-srgb\":{gl:37851},\"astc-12x10-unorm\":{gl:37820},\"astc-12x10-unorm-srgb\":{gl:37852},\"astc-12x12-unorm\":{gl:37821},\"astc-12x12-unorm-srgb\":{gl:37853},\"pvrtc-rgb4unorm-webgl\":{gl:35840},\"pvrtc-rgba4unorm-webgl\":{gl:35842},\"pvrtc-rbg2unorm-webgl\":{gl:35841},\"pvrtc-rgba2unorm-webgl\":{gl:35843},\"etc1-rbg-unorm-webgl\":{gl:36196},\"atc-rgb-unorm-webgl\":{gl:35986},\"atc-rgba-unorm-webgl\":{gl:35986},\"atc-rgbai-unorm-webgl\":{gl:34798}}});var agt,wL,lgt=Et(()=>{Ci();wP();V3();agt={\"depth-clip-control\":\"EXT_depth_clamp\",\"timer-query-webgl\":\"EXT_disjoint_timer_query_webgl2\",\"compilation-status-async-webgl\":\"KHR_parallel_shader_compile\",\"polygon-mode-webgl\":\"WEBGL_polygon_mode\",\"provoking-vertex-webgl\":\"WEBGL_provoking_vertex\",\"shader-clip-cull-distance-webgl\":\"WEBGL_clip_cull_distance\",\"shader-noperspective-interpolation-webgl\":\"NV_shader_noperspective_interpolation\",\"shader-conservative-depth-webgl\":\"EXT_conservative_depth\"},wL=class extends _E{gl;extensions;testedFeatures=new Set;constructor(t,r,i){super([],i),this.gl=t,this.extensions=r,T0(t,\"EXT_color_buffer_float\",r)}*[Symbol.iterator](){let t=this.getFeatures();for(let r of t)this.has(r)&&(yield r);return[]}has(t){return this.disabledFeatures?.[t]?!1:(this.testedFeatures.has(t)||(this.testedFeatures.add(t),igt(t)&&ngt(this.gl,t,this.extensions)&&this.features.add(t),this.getWebGLFeature(t)&&this.features.add(t)),this.features.has(t))}initializeFeatures(){let t=this.getFeatures().filter(r=>r!==\"polygon-mode-webgl\");for(let r of t)this.has(r)}getFeatures(){return[...Object.keys(agt),...Object.keys(bL)]}getWebGLFeature(t){let r=agt[t];return typeof r==\"string\"?!!T0(this.gl,r,this.extensions):!!r}}});var TL,cgt=Et(()=>{Ci();TL=class extends yE{get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderVariables(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}gl;limits={};constructor(t){super(),this.gl=t}getParameter(t){return this.limits[t]===void 0&&(this.limits[t]=this.gl.getParameter(t)),this.limits[t]||0}}});function e$t(e){return e<34069?e+34069:e}function r$t(e){switch(e){case 36053:return\"success\";case 36054:return\"Mismatched attachments\";case 36055:return\"No attachments\";case 36057:return\"Height/width mismatch\";case 36061:return\"Unsupported or split attachments\";case 36182:return\"Samples mismatch\";default:return`${e}`}}var S0,SL=Et(()=>{Ci();V3();S0=class extends Jv{device;gl;handle;colorAttachments=[];depthStencilAttachment=null;constructor(t,r){super(t,r);let i=r.handle===null;this.device=t,this.gl=t.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),i||(t._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){let t=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r<this.colorAttachments.length;++r){let i=this.colorAttachments[r];if(i){let n=36064+r;this._attachTextureView(n,i)}}if(this.depthStencilAttachment){let r=sgt(this.depthStencilAttachment.props.format);this._attachTextureView(r,this.depthStencilAttachment)}if(this.device.props.debug){let r=this.gl.checkFramebufferStatus(36160);if(r!==36053)throw new Error(`Framebuffer ${r$t(r)}`)}this.gl.bindFramebuffer(36160,t)}_attachTextureView(t,r){let{gl:i}=this.device,{texture:n}=r,o=r.props.baseMipLevel,s=r.props.baseArrayLayer;switch(i.bindTexture(n.glTarget,n.handle),n.glTarget){case 35866:case 32879:i.framebufferTextureLayer(36160,t,n.handle,o,s);break;case 34067:let a=e$t(s);i.framebufferTexture2D(36160,t,a,n.handle,o);break;case 3553:i.framebufferTexture2D(36160,t,3553,n.handle,o);break;default:throw new Error(\"Illegal texture type\")}i.bindTexture(n.glTarget,null)}}});var ML,ugt=Et(()=>{Ci();SL();ML=class extends o3{device;handle=null;_framebuffer=null;get[Symbol.toStringTag](){return\"WebGLCanvasContext\"}constructor(t,r){super(r),this.device=t,this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this._updateDevice()}getCurrentFramebuffer(){return this._framebuffer=this._framebuffer||new S0(this.device,{handle:null}),this._framebuffer}_updateDevice(){}}});function hgt(e=\"id\"){uX[e]=uX[e]||1;let t=uX[e]++;return`${e}-${t}`}var uX,dgt=Et(()=>{uX={}});function i$t(e){return e&on.INDEX?34963:e&on.VERTEX?34962:e&on.UNIFORM?35345:34962}function n$t(e){return e&on.INDEX||e&on.VERTEX?35044:e&on.UNIFORM?35048:35044}var Xf,EL=Et(()=>{Ci();Xf=class extends on{device;gl;handle;glTarget;glUsage;glIndexType=5123;byteLength=0;bytesUsed=0;constructor(t,r={}){super(t,r),this.device=t,this.gl=this.device.gl;let i=typeof r==\"object\"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),t._setWebGLDebugMetadata(this.handle,this,{spector:{...this.props,data:typeof this.props.data}}),this.glTarget=i$t(this.props.usage),this.glUsage=n$t(this.props.usage),this.glIndexType=this.props.indexType===\"uint32\"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}_initWithData(t,r=0,i=t.byteLength+r){let n=this.glTarget;this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.glUsage),this.gl.bufferSubData(n,r,t),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(t,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(t){let r=t;t===0&&(r=new Float32Array(0));let i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=t,this.byteLength=t,this._setDebugData(null,0,t),this.trackAllocatedMemory(t),this}write(t,r=0){let i=ArrayBuffer.isView(t)?t:new Uint8Array(t),n=0,o=void 0,s=36663;this.gl.bindBuffer(s,this.handle),n!==0||o!==void 0?this.gl.bufferSubData(s,r,i,n,o):this.gl.bufferSubData(s,r,i),this.gl.bindBuffer(s,null),this._setDebugData(t,r,t.byteLength)}async mapAndWriteAsync(t,r=0,i=this.byteLength-r){let n=new ArrayBuffer(i);await t(n,\"copied\"),this.write(n,r)}async readAsync(t=0,r){return this.readSyncWebGL(t,r)}async mapAndReadAsync(t,r=0,i){let n=await this.readAsync(r,i);return await t(n.buffer,\"copied\")}readSyncWebGL(t=0,r){r=r??this.byteLength-t;let i=new Uint8Array(r),n=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,i,n,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,t,r),i}}});function pgt(e){let t=e.split(/\\r?\\n/),r=[];for(let i of t){if(i.length<=1)continue;let n=i.split(\":\");if(n.length===2){let[w,C]=n;r.push({message:C.trim(),type:fgt(w),lineNum:0,linePos:0});continue}let[o,s,a,...h]=n,p=parseInt(a,10);isNaN(p)&&(p=0);let g=parseInt(s,10);isNaN(g)&&(g=0),r.push({message:h.join(\":\").trim(),type:fgt(o),lineNum:p,linePos:g})}return r}function fgt(e){let t=[\"warning\",\"error\",\"info\"],r=e.toLowerCase();return t.includes(r)?r:\"info\"}var mgt=Et(()=>{});var PL,ggt=Et(()=>{Ci();mgt();PL=class extends Qv{device;handle;constructor(t,r){switch(super(t,r),this.device=t,this.props.stage){case\"vertex\":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case\"fragment\":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}t._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0,this.handle.destroyed=!0)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>(this._getCompilationStatus(),this.compilationStatus))}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){let t=this.device.gl.getShaderInfoLog(this.handle);return t?pgt(t):[]}getTranslatedSource(){return this.device.getExtension(\"WEBGL_debug_shaders\").WEBGL_debug_shaders?.getTranslatedShaderSource(this.handle)||null}async _compile(t){t=t.startsWith(\"#version \")?t:`#version 300 es\n${t}`;let{gl:r}=this.device;if(r.shaderSource(this.handle,t),r.compileShader(this.handle),!this.device.props.debug){this.compilationStatus=\"pending\";return}if(!this.device.features.has(\"compilation-status-async-webgl\")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus===\"error\")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Ie.once(1,\"Shader compilation is asynchronous\")(),await this._waitForCompilationComplete(),Ie.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let t=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has(\"compilation-status-async-webgl\")){await t(10);return}let{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await t(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?\"success\":\"error\"}}});function ygt(e,t,r,i){if(l$t(t))return i(e);let n=e;n.pushState();try{return o$t(e,t),Hf(n.gl,r),i(e)}finally{n.popState()}}function o$t(e,t){let r=e,{gl:i}=r;if(t.cullMode)switch(t.cullMode){case\"none\":i.disable(2884);break;case\"front\":i.enable(2884),i.cullFace(1028);break;case\"back\":i.enable(2884),i.cullFace(1029);break}if(t.frontFace&&i.frontFace(_b(\"frontFace\",t.frontFace,{ccw:2305,cw:2304})),t.unclippedDepth&&e.features.has(\"depth-clip-control\")&&i.enable(34383),t.depthBias!==void 0&&(i.enable(32823),i.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0)),t.provokingVertex&&e.features.has(\"provoking-vertex-webgl\")){let o=r.getExtension(\"WEBGL_provoking_vertex\").WEBGL_provoking_vertex,s=_b(\"provokingVertex\",t.provokingVertex,{first:36429,last:36430});o?.provokingVertexWEBGL(s)}if((t.polygonMode||t.polygonOffsetLine)&&e.features.has(\"polygon-mode-webgl\")){if(t.polygonMode){let o=r.getExtension(\"WEBGL_polygon_mode\").WEBGL_polygon_mode,s=_b(\"polygonMode\",t.polygonMode,{fill:6914,line:6913});o?.polygonModeWEBGL(1028,s),o?.polygonModeWEBGL(1029,s)}t.polygonOffsetLine&&i.enable(10754)}if(e.features.has(\"shader-clip-cull-distance-webgl\")&&(t.clipDistance0&&i.enable(12288),t.clipDistance1&&i.enable(12289),t.clipDistance2&&i.enable(12290),t.clipDistance3&&i.enable(12291),t.clipDistance4&&i.enable(12292),t.clipDistance5&&i.enable(12293),t.clipDistance6&&i.enable(12294),t.clipDistance7&&i.enable(12295)),t.depthWriteEnabled!==void 0&&i.depthMask(a$t(\"depthWriteEnabled\",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!==\"always\"?i.enable(2929):i.disable(2929),i.depthFunc(IL(\"depthCompare\",t.depthCompare))),t.stencilWriteMask){let n=t.stencilWriteMask;i.stencilMaskSeparate(1028,n),i.stencilMaskSeparate(1029,n)}if(t.stencilReadMask&&Ie.warn(\"stencilReadMask not supported under WebGL\"),t.stencilCompare){let n=t.stencilReadMask||4294967295,o=IL(\"depthCompare\",t.stencilCompare);t.stencilCompare!==\"always\"?i.enable(2960):i.disable(2960),i.stencilFuncSeparate(1028,o,0,n),i.stencilFuncSeparate(1029,o,0,n)}if(t.stencilPassOperation&&t.stencilFailOperation&&t.stencilDepthFailOperation){let n=hX(\"stencilPassOperation\",t.stencilPassOperation),o=hX(\"stencilFailOperation\",t.stencilFailOperation),s=hX(\"stencilDepthFailOperation\",t.stencilDepthFailOperation);i.stencilOpSeparate(1028,o,s,n),i.stencilOpSeparate(1029,o,s,n)}switch(t.blend){case!0:i.enable(3042);break;case!1:i.disable(3042);break;default:}if(t.blendColorOperation||t.blendAlphaOperation){let n=Agt(\"blendColorOperation\",t.blendColorOperation||\"add\"),o=Agt(\"blendAlphaOperation\",t.blendAlphaOperation||\"add\");i.blendEquationSeparate(n,o);let s=CL(\"blendColorSrcFactor\",t.blendColorSrcFactor||\"one\"),a=CL(\"blendColorDstFactor\",t.blendColorDstFactor||\"zero\"),h=CL(\"blendAlphaSrcFactor\",t.blendAlphaSrcFactor||\"one\"),p=CL(\"blendAlphaDstFactor\",t.blendAlphaDstFactor||\"zero\");i.blendFuncSeparate(s,a,h,p)}}function IL(e,t){return _b(e,t,{never:512,less:513,equal:514,\"less-equal\":515,greater:516,\"not-equal\":517,\"greater-equal\":518,always:519})}function hX(e,t){return _b(e,t,{keep:7680,zero:0,replace:7681,invert:5386,\"increment-clamp\":7682,\"decrement-clamp\":7683,\"increment-wrap\":34055,\"decrement-wrap\":34056})}function Agt(e,t){return _b(e,t,{add:32774,subtract:32778,\"reverse-subtract\":32779,min:32775,max:32776})}function CL(e,t,r=\"color\"){return _b(e,t,{one:1,zero:0,src:768,\"one-minus-src\":769,dst:774,\"one-minus-dst\":775,\"src-alpha\":770,\"one-minus-src-alpha\":771,\"dst-alpha\":772,\"one-minus-dst-alpha\":773,\"src-alpha-saturated\":776,constant:r===\"color\"?32769:32771,\"one-minus-constant\":r===\"color\"?32770:32772,src1:768,\"one-minus-src1\":769,\"src1-alpha\":770,\"one-minus-src1-alpha\":771})}function s$t(e,t){return`Illegal parameter ${t} for ${e}`}function _b(e,t,r){if(!(t in r))throw new Error(s$t(e,t));return r[t]}function a$t(e,t){return t}function l$t(e){let t=!0;for(let r in e){t=!1;break}return t}var dX=Et(()=>{Ci();N3()});function kL(e){let t={};return e.addressModeU&&(t[10242]=fX(e.addressModeU)),e.addressModeV&&(t[10243]=fX(e.addressModeV)),e.addressModeW&&(t[32882]=fX(e.addressModeW)),e.magFilter&&(t[10240]=pX(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[10241]=c$t(e.minFilter||\"linear\",e.mipmapFilter)),e.lodMinClamp!==void 0&&(t[33082]=e.lodMinClamp),e.lodMaxClamp!==void 0&&(t[33083]=e.lodMaxClamp),e.type===\"comparison-sampler\"&&(t[34892]=34894),e.compare&&(t[34893]=IL(\"compare\",e.compare)),e.maxAnisotropy&&(t[34046]=e.maxAnisotropy),t}function fX(e){switch(e){case\"clamp-to-edge\":return 33071;case\"repeat\":return 10497;case\"mirror-repeat\":return 33648}}function pX(e){switch(e){case\"nearest\":return 9728;case\"linear\":return 9729}}function c$t(e,t=\"none\"){if(!t)return pX(e);switch(t){case\"none\":return pX(e);case\"nearest\":switch(e){case\"nearest\":return 9984;case\"linear\":return 9985}break;case\"linear\":switch(e){case\"nearest\":return 9986;case\"linear\":return 9987}}}var mX=Et(()=>{dX()});var RL,_gt=Et(()=>{Ci();mX();RL=class extends Lf{device;handle;parameters;constructor(t,r){super(t,r),this.device=t,this.parameters=kL(r),this.handle=r.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(t){for(let[r,i]of Object.entries(t)){let n=Number(r);switch(n){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,n,i);break;default:this.device.gl.samplerParameteri(this.handle,n,i);break}}}}});function y1(e,t,r){if(u$t(t))return r(e);let{nocatch:i=!0}=t,n=Yf.get(e);n.push(),Hf(e,t);let o;if(i)o=r(e),n.pop();else try{o=r(e)}finally{n.pop()}return o}function u$t(e){for(let t in e)return!1;return!0}var DL=Et(()=>{N3();aX()});var M0,gX=Et(()=>{Ci();M0=class extends Kv{device;gl;handle;texture;constructor(t,r){super(t,{...Jo.defaultProps,...r}),this.device=t,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}}});function h$t(e){switch(e){case\"1d\":break;case\"2d\":return 3553;case\"3d\":return 32879;case\"cube\":return 34067;case\"2d-array\":return 35866;case\"cube-array\":break}throw new Error(e)}function vgt(e,t,r){return t===\"cube\"?34069+r:e}var E0,OL=Et(()=>{Ci();V3();mX();DL();gX();E0=class extends Jo{device;gl;handle;sampler=void 0;view;glTarget;glFormat;glType;glInternalFormat;compressed;_textureUnit=0;constructor(t,r){super(t,r),this.device=t,this.gl=this.device.gl;let i=xL(this.props.format);this.glTarget=h$t(this.props.dimension),this.glInternalFormat=i.internalFormat,this.glFormat=i.format,this.glType=i.type,this.compressed=i.compressed,this.handle=this.props.handle||this.gl.createTexture(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.gl.bindTexture(this.glTarget,this.handle);let{dimension:n,width:o,height:s,depth:a,mipLevels:h,glTarget:p,glInternalFormat:g}=this;switch(n){case\"2d\":case\"cube\":this.gl.texStorage2D(p,h,g,o,s);break;case\"2d-array\":case\"3d\":this.gl.texStorage3D(p,h,g,o,s,a);break;default:throw new Error(n)}this.gl.bindTexture(this.glTarget,null),this._initializeData(r.data),this.setSampler(this.props.sampler),this.view=new M0(this.device,{...this.props,texture:this}),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory(\"Texture\"),this.destroyed=!0)}createView(t){return new M0(this.device,{...t,texture:this})}setSampler(t={}){super.setSampler(t);let r=kL(this.sampler.props);this._setSamplerParameters(r)}copyImageData(t){let r=this._normalizeCopyImageDataOptions(t),i=r.data,{width:n,height:o,depth:s}=this,{mipLevel:a=0,byteOffset:h=0,x:p=0,y:g=0,z:w=0}=r,{glFormat:C,glType:R,compressed:z}=this,W=vgt(this.glTarget,this.dimension,w),Y;if(!this.compressed){let{bytesPerPixel:Q}=this.device.getTextureFormatInfo(this.format);if(Q){if(r.bytesPerRow%Q!==0)throw new Error(`bytesPerRow (${r.bytesPerRow}) must be a multiple of bytesPerPixel (${Q}) for ${this.format}`);Y=r.bytesPerRow/Q}}let H=this.compressed?{}:{...Y!==void 0?{3314:Y}:{},32878:r.rowsPerImage};this.gl.bindTexture(W,this.handle),y1(this.gl,H,()=>{switch(this.dimension){case\"2d\":case\"cube\":z?this.gl.compressedTexSubImage2D(W,a,p,g,n,o,C,i,h):this.gl.texSubImage2D(W,a,p,g,n,o,C,R,i,h);break;case\"2d-array\":case\"3d\":z?this.gl.compressedTexSubImage3D(W,a,p,g,w,n,o,s,C,i,h):this.gl.texSubImage3D(W,a,p,g,w,n,o,s,C,R,i,h);break;default:}}),this.gl.bindTexture(W,null)}copyExternalImage(t){let r=this._normalizeCopyExternalImageOptions(t);if(r.sourceX||r.sourceY)throw new Error(\"WebGL does not support sourceX/sourceY)\");let{glFormat:i,glType:n}=this,{image:o,depth:s,mipLevel:a,x:h,y:p,z:g,width:w,height:C}=r,R=vgt(this.glTarget,this.dimension,s),z=r.flipY?{37440:!0}:{};return this.gl.bindTexture(this.glTarget,this.handle),y1(this.gl,z,()=>{switch(this.dimension){case\"2d\":case\"cube\":this.gl.texSubImage2D(R,a,h,p,w,C,i,n,o);break;case\"2d-array\":case\"3d\":this.gl.texSubImage3D(R,a,h,p,g,w,C,s,i,n,o);break;default:}}),this.gl.bindTexture(this.glTarget,null),{width:r.width,height:r.height}}generateMipmapsWebGL(t){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(Ie.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!t?.force)))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(i){Ie.warn(`Error generating mipmap for ${this}: ${i.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}_setSamplerParameters(t){Ie.log(2,`${this.id} sampler parameters`,this.device.getGLKeys(t))(),this.gl.bindTexture(this.glTarget,this.handle);for(let[r,i]of Object.entries(t)){let n=Number(r),o=i;switch(n){case 33082:case 33083:this.gl.texParameterf(this.glTarget,n,o);break;case 10240:case 10241:this.gl.texParameteri(this.glTarget,n,o);break;case 10242:case 10243:case 32882:this.gl.texParameteri(this.glTarget,n,o);break;case 34046:this.device.features.has(\"texture-filterable-anisotropic-webgl\")&&this.gl.texParameteri(this.glTarget,n,o);break;case 34892:case 34893:this.gl.texParameteri(this.glTarget,n,o);break}}this.gl.bindTexture(this.glTarget,null)}_getActiveUnit(){return this.gl.getParameter(34016)-33984}_bind(t){let{gl:r}=this;return t!==void 0&&(this._textureUnit=t,r.activeTexture(33984+t)),r.bindTexture(this.glTarget,this.handle),t}_unbind(t){let{gl:r}=this;return t!==void 0&&(this._textureUnit=t,r.activeTexture(33984+t)),r.bindTexture(this.glTarget,null),t}}});function bgt(e){return f$t[e]}function LL(e){return d$t[e]}function xgt(e){return!!Tgt[e]}function wgt(e){return Tgt[e]}var d$t,Tgt,f$t,AX=Et(()=>{d$t={5126:\"f32\",35664:\"vec2<f32>\",35665:\"vec3<f32>\",35666:\"vec4<f32>\",5124:\"i32\",35667:\"vec2<i32>\",35668:\"vec3<i32>\",35669:\"vec4<i32>\",5125:\"u32\",36294:\"vec2<u32>\",36295:\"vec3<u32>\",36296:\"vec4<u32>\",35670:\"f32\",35671:\"vec2<f32>\",35672:\"vec3<f32>\",35673:\"vec4<f32>\",35674:\"mat2x2<f32>\",35685:\"mat2x3<f32>\",35686:\"mat2x4<f32>\",35687:\"mat3x2<f32>\",35675:\"mat3x3<f32>\",35688:\"mat3x4<f32>\",35689:\"mat4x2<f32>\",35690:\"mat4x3<f32>\",35676:\"mat4x4<f32>\"},Tgt={35678:{viewDimension:\"2d\",sampleType:\"float\"},35680:{viewDimension:\"cube\",sampleType:\"float\"},35679:{viewDimension:\"3d\",sampleType:\"float\"},35682:{viewDimension:\"3d\",sampleType:\"depth\"},36289:{viewDimension:\"2d-array\",sampleType:\"float\"},36292:{viewDimension:\"2d-array\",sampleType:\"depth\"},36293:{viewDimension:\"cube\",sampleType:\"float\"},36298:{viewDimension:\"2d\",sampleType:\"sint\"},36299:{viewDimension:\"3d\",sampleType:\"sint\"},36300:{viewDimension:\"cube\",sampleType:\"sint\"},36303:{viewDimension:\"2d-array\",sampleType:\"uint\"},36306:{viewDimension:\"2d\",sampleType:\"uint\"},36307:{viewDimension:\"3d\",sampleType:\"uint\"},36308:{viewDimension:\"cube\",sampleType:\"uint\"},36311:{viewDimension:\"2d-array\",sampleType:\"uint\"}},f$t={uint8:5121,sint8:5120,unorm8:5121,snorm8:5120,uint16:5123,sint16:5122,unorm16:5123,snorm16:5122,uint32:5125,sint32:5124,float16:5131,float32:5126}});function Sgt(e,t){let r={attributes:[],bindings:[]};r.attributes=p$t(e,t);let i=A$t(e,t);for(let a of i){let h=a.uniforms.map(p=>({name:p.name,format:p.format,byteOffset:p.byteOffset,byteStride:p.byteStride,arrayLength:p.arrayLength}));r.bindings.push({type:\"uniform\",name:a.name,group:0,location:a.location,visibility:(a.vertex?1:0)&(a.fragment?2:0),minBindingSize:a.byteLength,uniforms:h})}let n=g$t(e,t),o=0;for(let a of n)if(xgt(a.type)){let{viewDimension:h,sampleType:p}=wgt(a.type);r.bindings.push({type:\"texture\",name:a.name,group:0,location:o,viewDimension:h,sampleType:p}),a.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=m$t(e,t);return s?.length&&(r.varyings=s),r}function p$t(e,t){let r=[],i=e.getProgramParameter(t,35721);for(let n=0;n<i;n++){let o=e.getActiveAttrib(t,n);if(!o)throw new Error(\"activeInfo\");let{name:s,type:a}=o,h=e.getAttribLocation(t,s);if(h>=0){let p=LL(a),g=/instance/i.test(s)?\"instance\":\"vertex\";r.push({name:s,location:h,stepMode:g,type:p})}}return r.sort((n,o)=>n.location-o.location),r}function m$t(e,t){let r=[],i=e.getProgramParameter(t,35971);for(let n=0;n<i;n++){let o=e.getTransformFeedbackVarying(t,n);if(!o)throw new Error(\"activeInfo\");let{name:s,type:a,size:h}=o,p=LL(a),{type:g,components:w}=TE(p);r.push({location:n,name:s,type:g,size:h*w})}return r.sort((n,o)=>n.location-o.location),r}function g$t(e,t){let r=[],i=e.getProgramParameter(t,35718);for(let n=0;n<i;n++){let o=e.getActiveUniform(t,n);if(!o)throw new Error(\"activeInfo\");let{name:s,size:a,type:h}=o,{name:p,isArray:g}=y$t(s),w=e.getUniformLocation(t,p),C={location:w,name:p,size:a,type:h,isArray:g};if(r.push(C),C.size>1)for(let R=0;R<C.size;R++){let z=`${p}[${R}]`;w=e.getUniformLocation(t,z);let W={...C,name:z,location:w};r.push(W)}}return r}function A$t(e,t){let r=(o,s)=>e.getActiveUniformBlockParameter(t,o,s),i=[],n=e.getProgramParameter(t,35382);for(let o=0;o<n;o++){let s={name:e.getActiveUniformBlockName(t,o)||\"\",location:r(o,35391),byteLength:r(o,35392),vertex:r(o,35396),fragment:r(o,35398),uniformCount:r(o,35394),uniforms:[]},a=r(o,35395)||[],h=e.getActiveUniforms(t,a,35383),p=e.getActiveUniforms(t,a,35384),g=e.getActiveUniforms(t,a,35387),w=e.getActiveUniforms(t,a,35388);for(let C=0;C<s.uniformCount;++C){let R=e.getActiveUniform(t,a[C]);if(!R)throw new Error(\"activeInfo\");let z=LL(h[C]);s.uniforms.push({name:R.name,format:z,type:h[C],arrayLength:p[C],byteOffset:g[C],byteStride:w[C]})}i.push(s)}return i.sort((o,s)=>o.location-s.location),i}function y$t(e){if(e[e.length-1]!==\"]\")return{name:e,length:1,isArray:!1};let r=/([^[]*)(\\[[0-9]+\\])?/.exec(e);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${e}`);return{name:r[1],length:r[2]?1:0,isArray:!!r[2]}}var Mgt=Et(()=>{Ci();AX()});function Egt(e,t,r,i){let n=e,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o==\"number\"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!=\"number\")throw new Error(\"samplers must be set to integers\");return e.uniform1i(t,i);case 5126:return e.uniform1fv(t,s);case 35664:return e.uniform2fv(t,s);case 35665:return e.uniform3fv(t,s);case 35666:return e.uniform4fv(t,s);case 5124:return e.uniform1iv(t,s);case 35667:return e.uniform2iv(t,s);case 35668:return e.uniform3iv(t,s);case 35669:return e.uniform4iv(t,s);case 35670:return e.uniform1iv(t,s);case 35671:return e.uniform2iv(t,s);case 35672:return e.uniform3iv(t,s);case 35673:return e.uniform4iv(t,s);case 5125:return n.uniform1uiv(t,s,1);case 36294:return n.uniform2uiv(t,s,2);case 36295:return n.uniform3uiv(t,s,3);case 36296:return n.uniform4uiv(t,s,4);case 35674:return e.uniformMatrix2fv(t,!1,s);case 35675:return e.uniformMatrix3fv(t,!1,s);case 35676:return e.uniformMatrix4fv(t,!1,s);case 35685:return n.uniformMatrix2x3fv(t,!1,s);case 35686:return n.uniformMatrix2x4fv(t,!1,s);case 35687:return n.uniformMatrix3x2fv(t,!1,s);case 35688:return n.uniformMatrix3x4fv(t,!1,s);case 35689:return n.uniformMatrix4x2fv(t,!1,s);case 35690:return n.uniformMatrix4x3fv(t,!1,s)}throw new Error(\"Illegal uniform\")}var Pgt=Et(()=>{});function Cgt(e){switch(e){case\"point-list\":return 0;case\"line-list\":return 1;case\"line-strip\":return 3;case\"triangle-list\":return 4;case\"triangle-strip\":return 5;default:throw new Error(e)}}function Igt(e){switch(e){case\"point-list\":return 0;case\"line-list\":return 1;case\"line-strip\":return 1;case\"triangle-list\":return 4;case\"triangle-strip\":return 4;default:throw new Error(e)}}var yX=Et(()=>{});function _$t(e,t){let r={...e,attributes:e.attributes.map(i=>({...i}))};for(let i of t?.attributes||[]){let n=r.attributes.find(o=>o.name===i.name);n?(n.type=i.type||n.type,n.stepMode=i.stepMode||n.stepMode):Ie.warn(`shader layout attribute ${i.name} not present in shader`)}return r}var kgt,BL,Rgt=Et(()=>{Ci();Mgt();dX();Pgt();EL();SL();OL();gX();yX();kgt=4,BL=class extends Bf{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};get[Symbol.toStringTag](){return\"WEBGLRenderPipeline\"}constructor(t,r){super(t,r),this.device=t,this.handle=this.props.handle||this.device.gl.createProgram(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:{id:this.props.id}}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,n)),this._linkShaders(),Ie.time(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Sgt(this.device.gl,this.handle),Ie.timeEnd(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=r.shaderLayout?_$t(this.introspectedLayout,r.shaderLayout):this.introspectedLayout}destroy(){this.handle&&(this.device.gl.useProgram(null),this.device.gl.deleteProgram(this.handle),this.destroyed=!0,this.handle.destroyed=!0,this.handle=null)}setBindings(t,r){for(let[i,n]of Object.entries(t)){let o=this.shaderLayout.bindings.find(s=>s.name===i)||this.shaderLayout.bindings.find(s=>s.name===`${i}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(a=>`\"${a.name}\"`).join(\", \");r?.disableWarnings||Ie.warn(`No binding \"${i}\" in render pipeline \"${this.id}\", expected one of ${s}`,n)();continue}switch(n||Ie.warn(`Unsetting binding \"${i}\" in render pipeline \"${this.id}\"`)(),o.type){case\"uniform\":if(!(n instanceof Xf)&&!(n.buffer instanceof Xf))throw new Error(\"buffer value\");break;case\"texture\":if(!(n instanceof M0||n instanceof E0||n instanceof S0))throw new Error(`${this} Bad texture binding for ${i}`);break;case\"sampler\":Ie.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(o.type)}this.bindings[i]=n}}draw(t){let{renderPass:r,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:a,isInstanced:h=!1,firstVertex:p=0,transformFeedback:g}=t,w=Cgt(n),C=!!o.indexBuffer,R=o.indexBuffer?.glIndexType;if(this.linkStatus!==\"success\")return Ie.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return Ie.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),g&&g.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let z=r;return ygt(this.device,i,z.glParameters,()=>{C&&h?this.device.gl.drawElementsInstanced(w,s||0,R,p,a||0):C?this.device.gl.drawElements(w,s||0,R,p):h?this.device.gl.drawArraysInstanced(w,p,s||0,a||0):this.device.gl.drawArrays(w,p,s||0),g&&g.end()}),o.unbindAfterRender(r),!0}async _linkShaders(){let{gl:t}=this.device;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Ie.time(kgt,`linkProgram for ${this.id}`)(),t.linkProgram(this.handle),Ie.timeEnd(kgt,`linkProgram for ${this.id}`)(),Ie.level,!this.device.features.has(\"compilation-status-async-webgl\")){let i=this._getLinkStatus();this._reportLinkStatus(i);return}Ie.once(1,\"RenderPipeline linking is asynchronous\")(),await this._waitForLinkComplete(),Ie.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(t){switch(t){case\"success\":return;default:let r=t===\"link-error\"?\"Link error\":\"Validation error\";switch(this.vs.compilationStatus){case\"error\":throw this.vs.debugShader(),new Error(`${this} ${r} during compilation of ${this.vs}`);case\"pending\":await this.vs.asyncCompilationStatus,this.vs.debugShader();break;case\"success\":break}switch(this.fs?.compilationStatus){case\"error\":throw this.fs.debugShader(),new Error(`${this} ${r} during compilation of ${this.fs}`);case\"pending\":await this.fs.asyncCompilationStatus,this.fs.debugShader();break;case\"success\":break}let i=this.device.gl.getProgramInfoLog(this.handle);this.device.reportError(new Error(`${r} during ${t}: ${i}`),this)(),this.device.debug()}}_getLinkStatus(){let{gl:t}=this.device;return t.getProgramParameter(this.handle,35714)?(t.validateProgram(this.handle),t.getProgramParameter(this.handle,35715)?(this.linkStatus=\"success\",\"success\"):(this.linkStatus=\"error\",\"validation-error\")):(this.linkStatus=\"error\",\"link-error\")}async _waitForLinkComplete(){let t=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has(\"compilation-status-async-webgl\")){await t(10);return}let{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await t(10)}}_areTexturesRenderable(){let t=!0;for(let r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,\"\")]&&(Ie.warn(`Binding ${r.name} not found in ${this.id}`)(),t=!1);return t}_applyBindings(){if(this.linkStatus!==\"success\")return;let{gl:t}=this.device;t.useProgram(this.handle);let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,\"\")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case\"uniform\":let{name:s}=n,a=t.getUniformBlockIndex(this.handle,s);if(a===4294967295)throw new Error(`Invalid uniform block name ${s}`);t.uniformBlockBinding(this.handle,i,a),o instanceof Xf?t.bindBufferBase(35345,i,o.handle):t.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case\"texture\":if(!(o instanceof M0||o instanceof E0||o instanceof S0))throw new Error(\"texture\");let h;if(o instanceof M0)h=o.texture;else if(o instanceof E0)h=o;else if(o instanceof S0&&o.colorAttachments[0]instanceof M0)Ie.warn(\"Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead\")(),h=o.colorAttachments[0].texture;else throw new Error(\"No texture\");t.activeTexture(33984+r),t.bindTexture(h.glTarget,h.handle),r+=1;break;case\"sampler\":break;case\"storage\":case\"read-only-storage\":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let t of this.shaderLayout.uniforms||[]){let{name:r,location:i,type:n,textureUnit:o}=t,s=this.uniforms[r]??o;s!==void 0&&Egt(this.device.gl,i,n,s)}}}});function v$t(e,t){let r=t.sourceBuffer,i=t.destinationBuffer;e.gl.bindBuffer(36662,r.handle),e.gl.bindBuffer(36663,i.handle),e.gl.copyBufferSubData(36662,36663,t.sourceOffset??0,t.destinationOffset??0,t.size),e.gl.bindBuffer(36662,null),e.gl.bindBuffer(36663,null)}function b$t(e,t){throw new Error(\"Not implemented\")}function x$t(e,t){let{sourceTexture:r,mipLevel:i=0,aspect:n=\"all\",width:o=t.sourceTexture.width,height:s=t.sourceTexture.height,depthOrArrayLayers:a=0,origin:h=[0,0],destinationBuffer:p,byteOffset:g=0,bytesPerRow:w,rowsPerImage:C}=t;if(n!==\"all\")throw new Error(\"aspect not supported in WebGL\");if(i!==0||a!==0||w||C)throw new Error(\"not implemented\");let{framebuffer:R,destroyFramebuffer:z}=Dgt(r),W;try{let Y=p,H=o||R.width,Q=s||R.height,tt=xL(R.colorAttachments[0].texture.props.format),rt=tt.format,at=tt.type;e.gl.bindBuffer(35051,Y.handle),W=e.gl.bindFramebuffer(36160,R.handle),e.gl.readPixels(h[0],h[1],H,Q,rt,at,g)}finally{e.gl.bindBuffer(35051,null),W!==void 0&&e.gl.bindFramebuffer(36160,W),z&&R.destroy()}}function w$t(e,t){let{sourceTexture:r,destinationMipLevel:i=0,origin:n=[0,0],destinationOrigin:o=[0,0],destinationTexture:s}=t,{width:a=t.destinationTexture.width,height:h=t.destinationTexture.height}=t,{framebuffer:p,destroyFramebuffer:g}=Dgt(r),[w,C]=n,[R,z,W]=o,Y=e.gl.bindFramebuffer(36160,p.handle),H,Q;if(s instanceof E0)H=s,a=Number.isFinite(a)?a:H.width,h=Number.isFinite(h)?h:H.height,H._bind(0),Q=H.glTarget;else throw new Error(\"invalid destination\");switch(Q){case 3553:case 34067:e.gl.copyTexSubImage2D(Q,i,R,z,w,C,a,h);break;case 35866:case 32879:e.gl.copyTexSubImage3D(Q,i,R,z,W,w,C,a,h);break;default:}H&&H._unbind(),e.gl.bindFramebuffer(36160,Y),g&&p.destroy()}function Dgt(e){if(e instanceof Jo){let{width:t,height:r,id:i}=e;return{framebuffer:e.device.createFramebuffer({id:`framebuffer-for-${i}`,width:t,height:r,colorAttachments:[e]}),destroyFramebuffer:!0}}return{framebuffer:e,destroyFramebuffer:!1}}var FL,Ogt=Et(()=>{Ci();OL();V3();FL=class extends wE{device;handle=null;commands=[];constructor(t){super(t,{}),this.device=t}_executeCommands(t=this.commands){for(let r of t)switch(r.name){case\"copy-buffer-to-buffer\":v$t(this.device,r.options);break;case\"copy-buffer-to-texture\":b$t(this.device,r.options);break;case\"copy-texture-to-buffer\":x$t(this.device,r.options);break;case\"copy-texture-to-texture\":w$t(this.device,r.options);break;default:throw new Error(r.name)}}}});var T$t,NL,Lgt=Et(()=>{Ci();DL();N3();T$t=[1,2,4,8],NL=class extends bE{device;handle=null;glParameters={};constructor(t,r){super(t,r),this.device=t;let i;if(!r?.parameters?.viewport)if(r?.framebuffer){let{width:o,height:s}=r.framebuffer;i=[0,0,o,s]}else{let[o,s]=t.getDefaultCanvasContext().getDrawingBufferSize();i=[0,0,o,s]}this.device.pushState(),this.setParameters({viewport:i,...this.props.parameters});let n=this.props.framebuffer;if(this.props.framebuffer&&n?.handle){let o=this.props.framebuffer.colorAttachments.map((s,a)=>36064+a);this.device.gl.drawBuffers(o)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(t){}popDebugGroup(){}insertDebugMarker(t){}setParameters(t={}){let r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,t.viewport&&(t.viewport.length>=6?(r.viewport=t.viewport.slice(0,4),r.depthRange=[t.viewport[4],t.viewport[5]]):r.viewport=t.viewport),t.scissorRect&&(r.scissorTest=!0,r.scissor=t.scissorRect),t.blendConstant&&(r.blendColor=t.blendConstant),t.stencilReference&&(console.warn(\"RenderPassParameters.stencilReference not yet implemented in WebGL\"),r[2967]=t.stencilReference),\"colorMask\"in t&&(r.colorMask=T$t.map(i=>!!(i&t.colorMask))),this.glParameters=r,Hf(this.device.gl,r)}beginOcclusionQuery(t){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let t={...this.glParameters},r=0;this.props.clearColors&&this.props.clearColors.forEach((i,n)=>{i&&this.clearColorBuffer(n,i)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,t.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,t.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,t.clearStencil=this.props.clearStencil),r!==0&&y1(this.device.gl,t,()=>{this.device.gl.clear(r)})}clearColorBuffer(t=0,r=[0,0,0,0]){y1(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,t,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,t,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,t,r);break;default:throw new Error(\"clearColorBuffer: color must be typed array\")}})}}});var MP,Bgt=Et(()=>{Ci();Ogt();Lgt();MP=class extends xE{device;handle=null;commandBuffer;constructor(t,r){super(t,r),this.device=t,this.commandBuffer=new FL(t)}destroy(){}finish(){return this.commandBuffer}beginRenderPass(t){return new NL(this.device,t)}beginComputePass(t){throw new Error(\"ComputePass not supported in WebGL\")}copyBufferToBuffer(t){this.commandBuffer.commands.push({name:\"copy-buffer-to-buffer\",options:t})}copyBufferToTexture(t){this.commandBuffer.commands.push({name:\"copy-buffer-to-texture\",options:t})}copyTextureToBuffer(t){this.commandBuffer.commands.push({name:\"copy-texture-to-buffer\",options:t})}copyTextureToTexture(t){this.commandBuffer.commands.push({name:\"copy-texture-to-texture\",options:t})}pushDebugGroup(t){}popDebugGroup(){}insertDebugMarker(t){}resolveQuerySet(t,r,i){}}});function Fgt(e){let{target:t,source:r,start:i=0,count:n=1}=e,o=r.length,s=n*o,a=0;for(let h=i;a<o;a++)t[h++]=r[a];for(;a<s;)a<s-a?(t.copyWithin(i+a,i,i+a),a*=2):(t.copyWithin(i+a,i,i+s-a),a=s);return e.target}var Ngt=Et(()=>{});function S$t(e){return Array.isArray(e)?new Float32Array(e):e}function M$t(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}var zL,zgt=Et(()=>{Ci();r1();lX();Ngt();zL=class e extends SE{get[Symbol.toStringTag](){return\"VertexArray\"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(t){return VW()===\"Chrome\"}constructor(t,r){super(t,r),this.device=t,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(t){let r=t;if(r&&r.glTarget!==34963)throw new Error(\"Use .setBuffer()\");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(t,r){let i=r;if(i.glTarget===34963)throw new Error(\"Use .setIndexBuffer()\");let{size:n,type:o,stride:s,offset:a,normalized:h,integer:p,divisor:g}=this._getAccessor(t);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),p?this.device.gl.vertexAttribIPointer(t,n,o,s,a):this.device.gl.vertexAttribPointer(t,n,o,h,s,a),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(t),this.device.gl.vertexAttribDivisor(t,g||0),this.attributes[t]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(t,r){this._enable(t,!1),this.attributes[t]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let t=0;t<this.maxVertexAttributes;++t){let r=this.attributes[t];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(t,r)}}_getAccessor(t){let r=this.attributeInfos[t];if(!r)throw new Error(`Unknown attribute location ${t}`);let i=vL(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode===\"instance\"?1:0}}_enable(t,r=!0){let n=e.isConstantAttributeZeroSupported(this.device)||t!==0;(r||n)&&(t=Number(t),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(t):this.device.gl.disableVertexAttribArray(t),this.device.gl.bindVertexArray(null))}getConstantBuffer(t,r){let i=S$t(r),n=i.byteLength*t,o=i.length*t;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s||=!M$t(i,this.bufferValue),s){let a=rH(r.constructor,o);Fgt({target:a,source:i,start:0,count:o}),this.buffer.write(a),this.bufferValue=r}return this.buffer}}});function Ugt(e){return typeof e==\"number\"?Number.isInteger(e):/^\\d+$/.test(e)}var UL,Vgt=Et(()=>{Ci();VL();yX();UL=class extends ME{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(t,r){super(t,r),this.device=t,this.gl=t.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(t=\"point-list\"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(Igt(t))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(t){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in t)this.setBuffer(r,t[r])})}setBuffer(t,r){let i=this._getVaryingIndex(t),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[t]=n,Ie.warn(`${this.id} unusedBuffers varying buffer ${t}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(t){if(Ugt(t))return this.buffers[t]||null;let r=this._getVaryingIndex(t);return r>=0?this.buffers[r]:null}bind(t=this.handle){if(typeof t!=\"function\")return this.gl.bindTransformFeedback(36386,t),this;let r;return this._bound?r=t():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=t(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(t){if(t instanceof Xf)return{buffer:t,byteOffset:0,byteLength:t.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=t.buffer.byteLength}=t;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(t){if(Ugt(t))return Number(t);for(let r of this.layout.varyings||[])if(t===r.name)return r.location;return-1}_bindBuffers(){for(let t in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[t]);this._bindBuffer(Number(t),r,n,i)}}_unbindBuffers(){for(let t in this.buffers)this.gl.bindBufferBase(35982,Number(t),null)}_bindBuffer(t,r,i=0,n){let o=r&&r.handle;!o||n===void 0?this.gl.bindBufferBase(35982,t,o):this.gl.bindBufferRange(35982,t,o,i,n)}}});var jL,jgt=Et(()=>{Ci();jL=class extends EE{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return\"Query\"}constructor(t,r){if(super(t,r),this.device=t,r.count>1)throw new Error(\"WebGL QuerySet can only have one value\");let i=this.device.gl.createQuery();if(!i)throw new Error(\"WebGL query not supported\");this.handle=i,Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(t){return this._begin(t?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(t){this._queryPending||(this.target=t,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;let t=this.device.gl.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,n)=>{let o=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>t?(n(\"Timed out\"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}}});function _X(e){switch(e){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function $gt(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}var Ggt=Et(()=>{});function Wgt(e){return E$t[e]}var E$t,qgt=Et(()=>{E$t={5124:\"sint32\",5125:\"uint32\",5122:\"sint16\",5123:\"uint16\",5120:\"sint8\",5121:\"uint8\",5126:\"float32\",5131:\"float16\",33635:\"uint16\",32819:\"uint16\",32820:\"uint16\",33640:\"uint32\",35899:\"uint32\",35902:\"uint32\",34042:\"uint32\",36269:\"uint32\"}});function Hgt(e,t){let{sourceX:r=0,sourceY:i=0,sourceAttachment:n=0}=t||{},{target:o=null,sourceWidth:s,sourceHeight:a,sourceDepth:h,sourceFormat:p,sourceType:g}=t||{},{framebuffer:w,deleteFramebuffer:C}=Xgt(e),{gl:R,handle:z}=w;s||=w.width,a||=w.height;let W=w.colorAttachments[n]?.texture;if(!W)throw new Error(`Invalid framebuffer attachment ${n}`);h=W?.depth||1,p||=W?.glFormat||6408,g||=W?.glType||5121,o=C$t(o,g,p,s,a,h);let Y=Xv(o);g=g||bgt(Y);let H=R.bindFramebuffer(36160,z);return R.readBuffer(36064+n),R.readPixels(r,i,s,a,p,g,o),R.readBuffer(36064),R.bindFramebuffer(36160,H||null),C&&w.destroy(),o}function Ygt(e,t){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=t||{},{sourceWidth:a,sourceHeight:h,sourceType:p}=t||{},{framebuffer:g,deleteFramebuffer:w}=Xgt(e);a=a||g.width,h=h||g.height;let C=g;p=p||5121;let R=r;if(!R){let W=_X(o),Y=$gt(p),H=s+a*h*W*Y;R=C.device.createBuffer({byteLength:H})}let z=e.device.createCommandEncoder();return z.copyTextureToBuffer({sourceTexture:e,width:a,height:h,origin:[i,n],destinationBuffer:R,byteOffset:s}),z.destroy(),w&&g.destroy(),R}function Xgt(e){return e instanceof Jv?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:P$t(e),deleteFramebuffer:!0}}function P$t(e,t){let{device:r,width:i,height:n,id:o}=e;return r.createFramebuffer({...t,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[e]})}function C$t(e,t,r,i,n,o){if(e)return e;t||=5121;let s=Wgt(t),a=Zv(s),h=_X(r);return new a(i*n*h)}var Zgt=Et(()=>{Ci();AX();Ggt();qgt()});var vX={};Ql(vX,{WebGLDevice:()=>vb});function I$t(e,t,r){switch(r.length){case 1:e.gl.vertexAttrib1fv(t,r);break;case 2:e.gl.vertexAttrib2fv(t,r);break;case 3:e.gl.vertexAttrib3fv(t,r);break;case 4:e.gl.vertexAttrib4fv(t,r);break;default:}}function k$t(e,t,r){e.gl.vertexAttribI4iv(t,r)}function R$t(e,t,r){e.gl.vertexAttribI4uiv(t,r)}function D$t(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}var vb,$L=Et(()=>{Ci();aX();Kmt();tgt();lgt();cgt();ugt();eX();rX();V3();dgt();EL();ggt();_gt();OL();SL();Rgt();Bgt();zgt();Vgt();jgt();Zgt();N3();DL();wP();vb=class extends Of{type=\"webgl\";handle;features;limits;info;canvasContext;preferredColorFormat=\"rgba8unorm\";preferredDepthFormat=\"depth24plus\";commandEncoder;lost;_resolveContextLost;gl;_constants;_extensions={};_polyfilled=!1;spectorJS;get[Symbol.toStringTag](){return\"WebGLDevice\"}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}isVertexFormatSupported(t){return t!==\"unorm8x4-bgra\"}constructor(t){super({...t,id:t.id||hgt(\"webgl-device\")});let r=Of._getCanvasContextProps(t);if(!r)throw new Error(\"WebGLDevice requires props.createCanvasContext to be set\");let i=r.canvas?.gl?.device;if(i)throw new Error(`WebGL context already attached to device ${i.id}`);this.canvasContext=new ML(this,r),this.lost=new Promise(g=>{this._resolveContextLost=g});let n={...t.webgl};r.alphaMode===\"premultiplied\"&&(n.premultipliedAlpha=!0),t.powerPreference!==void 0&&(n.powerPreference=t.powerPreference);let s=this.props._handle||Zmt(this.canvasContext.canvas,{onContextLost:g=>this._resolveContextLost?.({reason:\"destroyed\",message:\"Entered sleep mode, or too many apps or browser tabs are using the GPU.\"}),onContextRestored:g=>console.log(\"WebGL context restored\")},n);if(!s)throw new Error(\"WebGL context creation failed\");if(i=s.device,i){if(t._reuseDevices)return Ie.log(1,`Not creating a new Device, instead returning a reference to Device ${i.id} already attached to WebGL context`,i)(),i._reused=!0,i;throw new Error(`WebGL context already attached to device ${i.id}`)}this.handle=s,this.gl=s,this.spectorJS=Lmt({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=Qmt(this.gl,this._extensions),this.limits=new TL(this.gl),this.features=new wL(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),new Yf(this.gl,{log:(...g)=>Ie.log(1,...g)()}).trackState(this.gl,{copyState:!1});let h=t.debugWebGL||t.debug,p=t.debugWebGL;h&&(this.gl=zmt(this.gl,{debugWebGL:h,traceWebGL:p}),Ie.warn(\"WebGL debug mode activated. Performance reduced.\")(),t.debugWebGL&&(Ie.level=Math.max(Ie.level,1))),this.commandEncoder=new MP(this,{id:`${this}-command-encoder`})}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}getTextureByteAlignment(){return 4}createCanvasContext(t){throw new Error(\"WebGL only supports a single canvas\")}createBuffer(t){let r=this._normalizeBufferProps(t);return new Xf(this,r)}createTexture(t){return new E0(this,t)}createExternalTexture(t){throw new Error(\"createExternalTexture() not implemented\")}createSampler(t){return new RL(this,t)}createShader(t){return new PL(this,t)}createFramebuffer(t){return new S0(this,t)}createVertexArray(t){return new zL(this,t)}createTransformFeedback(t){return new UL(this,t)}createQuerySet(t){return new jL(this,t)}createRenderPipeline(t){return new BL(this,t)}createComputePipeline(t){throw new Error(\"ComputePipeline not supported in WebGL\")}createCommandEncoder(t={}){return new MP(this,t)}submit(t){t||(t=this.commandEncoder.finish(),this.commandEncoder.destroy(),this.commandEncoder=this.createCommandEncoder({id:`${this.id}-default-encoder`})),t._executeCommands()}readPixelsToArrayWebGL(t,r){return Hgt(t,r)}readPixelsToBufferWebGL(t,r){return Ygt(t,r)}setParametersWebGL(t){Hf(this.gl,t)}getParametersWebGL(t){return _L(this.gl,t)}withParametersWebGL(t,r){return y1(this.gl,t,r)}resetWebGL(){Ie.warn(\"WebGLDevice.resetWebGL is deprecated, use only for debugging\")(),Wmt(this.gl)}_getDeviceSpecificTextureFormatCapabilities(t){return ogt(this.gl,t,this._extensions)}loseDevice(){let t=!1,i=this.getExtension(\"WEBGL_lose_context\").WEBGL_lose_context;return i&&(t=!0,i.loseContext()),this._resolveContextLost?.({reason:\"destroyed\",message:\"Application triggered context loss\"}),t}pushState(){Yf.get(this.gl).push()}popState(){Yf.get(this.gl).pop()}getGLKey(t,r){let i=Number(t);for(let n in this.gl)if(this.gl[n]===i)return`GL.${n}`;return r?.emptyIfUnknown?\"\":String(t)}getGLKeys(t){let r={emptyIfUnknown:!0};return Object.entries(t).reduce((i,[n,o])=>(i[`${n}:${this.getGLKey(n,r)}`]=`${o}:${this.getGLKey(o,r)}`,i),{})}setConstantAttributeWebGL(t,r){let i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);let n=this._constants[t];switch(n&&D$t(n,r)&&Ie.info(1,`setConstantAttributeWebGL(${t}) could have been skipped, value unchanged`)(),this._constants[t]=r,r.constructor){case Float32Array:I$t(this,t,r);break;case Int32Array:k$t(this,t,r);break;case Uint32Array:R$t(this,t,r);break;default:throw new Error(\"constant\")}}getExtension(t){return T0(this.gl,t,this._extensions),this._extensions}_setWebGLDebugMetadata(t,r,i){t.luma=r;let n={props:i.spector,id:i.spector.id};t.__SPECTOR_Metadata=n}}});function O$t(e){return typeof WebGL2RenderingContext<\"u\"&&e instanceof WebGL2RenderingContext?!0:!!(e&&Number.isFinite(e._version))}var GL,bX,EP,Kgt=Et(()=>{Ci();Rmt();eX();rX();GL=1,bX=class extends vE{type=\"webgl\";constructor(){super(),Of.defaultProps={...Of.defaultProps,...yL}}enforceWebGL2(t){kmt(t)}isSupported(){return typeof WebGL2RenderingContext<\"u\"}isDeviceHandle(t){return typeof WebGL2RenderingContext<\"u\"&&t instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<\"u\"&&t instanceof WebGLRenderingContext&&Ie.warn(\"WebGL1 is not supported\",t)(),!1)}async attach(t,r={}){let{WebGLDevice:i}=await Promise.resolve().then(()=>($L(),vX));if(t instanceof i)return t;if(t?.device instanceof i)return t.device;if(!O$t(t))throw new Error(\"Invalid WebGL2RenderingContext\");let n=r.createCanvasContext===!0?{}:r.createCanvasContext;return new i({...r,_handle:t,createCanvasContext:{canvas:t.canvas,autoResize:!1,...n}})}async create(t={}){let{WebGLDevice:r}=await Promise.resolve().then(()=>($L(),vX));Ie.groupCollapsed(GL,\"WebGLDevice created\")();try{let i=[];(t.debugWebGL||t.debug)&&i.push(Nmt()),t.debugSpectorJS&&i.push(Omt(t));let n=await Promise.allSettled(i);for(let a of n)a.status===\"rejected\"&&Ie.error(`Failed to initialize debug libraries ${a.reason}`)();let o=new r(t),s=`${o._reused?\"Reusing\":\"Created\"} device with WebGL2 ${o.props.debug?\"debug \":\"\"}context: ${o.info.vendor}, ${o.info.renderer} for canvas: ${o.canvasContext.id}`;return Ie.probe(GL,s)(),Ie.table(GL,o.info)(),o}finally{Ie.groupEnd(GL)()}}};EP=new bX});var VL=Et(()=>{Kgt();$L();EL()});var Myt=Nr((eBe,qX)=>{\"use strict\";qX.exports=_9;qX.exports.default=_9;function _9(e,t,r){r=r||2;var i=t&&t.length,n=i?t[0]*r:e.length,o=wyt(e,0,n,r,!0),s=[];if(!o||o.next===o.prev)return s;var a,h,p,g,w,C,R;if(i&&(o=xWt(e,t,o,r)),e.length>80*r){a=p=e[0],h=g=e[1];for(var z=r;z<n;z+=r)w=e[z],C=e[z+1],w<a&&(a=w),C<h&&(h=C),w>p&&(p=w),C>g&&(g=C);R=Math.max(p-a,g-h),R=R!==0?32767/R:0}return hC(o,s,r,a,h,R,0),s}function wyt(e,t,r,i,n){var o,s;if(n===WX(e,t,r,i)>0)for(o=t;o<r;o+=i)s=xyt(o,e[o],e[o+1],s);else for(o=r-i;o>=t;o-=i)s=xyt(o,e[o],e[o+1],s);return s&&v9(s,s.next)&&(fC(s),s=s.next),s}function Eb(e,t){if(!e)return e;t||(t=e);var r=e,i;do if(i=!1,!r.steiner&&(v9(r,r.next)||is(r.prev,r,r.next)===0)){if(fC(r),r=t=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==t);return t}function hC(e,t,r,i,n,o,s){if(e){!s&&o&&EWt(e,i,n,o);for(var a=e,h,p;e.prev!==e.next;){if(h=e.prev,p=e.next,o?_Wt(e,i,n,o):yWt(e)){t.push(h.i/r|0),t.push(e.i/r|0),t.push(p.i/r|0),fC(e),e=p.next,a=p.next;continue}if(e=p,e===a){s?s===1?(e=vWt(Eb(e),t,r),hC(e,t,r,i,n,o,2)):s===2&&bWt(e,t,r,i,n,o):hC(Eb(e),t,r,i,n,o,1);break}}}}function yWt(e){var t=e.prev,r=e,i=e.next;if(is(t,r,i)>=0)return!1;for(var n=t.x,o=r.x,s=i.x,a=t.y,h=r.y,p=i.y,g=n<o?n<s?n:s:o<s?o:s,w=a<h?a<p?a:p:h<p?h:p,C=n>o?n>s?n:s:o>s?o:s,R=a>h?a>p?a:p:h>p?h:p,z=i.next;z!==t;){if(z.x>=g&&z.x<=C&&z.y>=w&&z.y<=R&&H3(n,a,o,h,s,p,z.x,z.y)&&is(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function _Wt(e,t,r,i){var n=e.prev,o=e,s=e.next;if(is(n,o,s)>=0)return!1;for(var a=n.x,h=o.x,p=s.x,g=n.y,w=o.y,C=s.y,R=a<h?a<p?a:p:h<p?h:p,z=g<w?g<C?g:C:w<C?w:C,W=a>h?a>p?a:p:h>p?h:p,Y=g>w?g>C?g:C:w>C?w:C,H=$X(R,z,t,r,i),Q=$X(W,Y,t,r,i),tt=e.prevZ,rt=e.nextZ;tt&&tt.z>=H&&rt&&rt.z<=Q;){if(tt.x>=R&&tt.x<=W&&tt.y>=z&&tt.y<=Y&&tt!==n&&tt!==s&&H3(a,g,h,w,p,C,tt.x,tt.y)&&is(tt.prev,tt,tt.next)>=0||(tt=tt.prevZ,rt.x>=R&&rt.x<=W&&rt.y>=z&&rt.y<=Y&&rt!==n&&rt!==s&&H3(a,g,h,w,p,C,rt.x,rt.y)&&is(rt.prev,rt,rt.next)>=0))return!1;rt=rt.nextZ}for(;tt&&tt.z>=H;){if(tt.x>=R&&tt.x<=W&&tt.y>=z&&tt.y<=Y&&tt!==n&&tt!==s&&H3(a,g,h,w,p,C,tt.x,tt.y)&&is(tt.prev,tt,tt.next)>=0)return!1;tt=tt.prevZ}for(;rt&&rt.z<=Q;){if(rt.x>=R&&rt.x<=W&&rt.y>=z&&rt.y<=Y&&rt!==n&&rt!==s&&H3(a,g,h,w,p,C,rt.x,rt.y)&&is(rt.prev,rt,rt.next)>=0)return!1;rt=rt.nextZ}return!0}function vWt(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!v9(n,o)&&Tyt(n,i,i.next,o)&&dC(n,o)&&dC(o,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),fC(i),fC(i.next),i=e=o),i=i.next}while(i!==e);return Eb(i)}function bWt(e,t,r,i,n,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&IWt(s,a)){var h=Syt(s,a);s=Eb(s,s.next),h=Eb(h,h.next),hC(s,t,r,i,n,o,0),hC(h,t,r,i,n,o,0);return}a=a.next}s=s.next}while(s!==e)}function xWt(e,t,r,i){var n=[],o,s,a,h,p;for(o=0,s=t.length;o<s;o++)a=t[o]*i,h=o<s-1?t[o+1]*i:e.length,p=wyt(e,a,h,i,!1),p===p.next&&(p.steiner=!0),n.push(CWt(p));for(n.sort(wWt),o=0;o<n.length;o++)r=TWt(n[o],r);return r}function wWt(e,t){return e.x-t.x}function TWt(e,t){var r=SWt(e,t);if(!r)return t;var i=Syt(r,e);return Eb(i,i.next),Eb(r,r.next)}function SWt(e,t){var r=t,i=e.x,n=e.y,o=-1/0,s;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var a=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>o&&(o=a,s=r.x<r.next.x?r:r.next,a===i))return s}r=r.next}while(r!==t);if(!s)return null;var h=s,p=s.x,g=s.y,w=1/0,C;r=s;do i>=r.x&&r.x>=p&&i!==r.x&&H3(n<g?i:o,n,p,g,n<g?o:i,n,r.x,r.y)&&(C=Math.abs(n-r.y)/(i-r.x),dC(r,e)&&(C<w||C===w&&(r.x>s.x||r.x===s.x&&MWt(s,r)))&&(s=r,w=C)),r=r.next;while(r!==h);return s}function MWt(e,t){return is(e.prev,e,t.prev)<0&&is(t.next,e,e.next)<0}function EWt(e,t,r,i){var n=e;do n.z===0&&(n.z=$X(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,PWt(n)}function PWt(e){var t,r,i,n,o,s,a,h,p=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,i=r,a=0,t=0;t<p&&(a++,i=i.nextZ,!!i);t++);for(h=p;a>0||h>0&&i;)a!==0&&(h===0||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,p*=2}while(s>1);return e}function $X(e,t,r,i,n){return e=(e-r)*n|0,t=(t-i)*n|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function CWt(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function H3(e,t,r,i,n,o,s,a){return(n-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function IWt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!kWt(e,t)&&(dC(e,t)&&dC(t,e)&&RWt(e,t)&&(is(e.prev,e,t.prev)||is(e,t.prev,t))||v9(e,t)&&is(e.prev,e,e.next)>0&&is(t.prev,t,t.next)>0)}function is(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v9(e,t){return e.x===t.x&&e.y===t.y}function Tyt(e,t,r,i){var n=y9(is(e,t,r)),o=y9(is(e,t,i)),s=y9(is(r,i,e)),a=y9(is(r,i,t));return!!(n!==o&&s!==a||n===0&&A9(e,r,t)||o===0&&A9(e,i,t)||s===0&&A9(r,e,i)||a===0&&A9(r,t,i))}function A9(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function y9(e){return e>0?1:e<0?-1:0}function kWt(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Tyt(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function dC(e,t){return is(e.prev,e,e.next)<0?is(e,t,e.next)>=0&&is(e,e.prev,t)>=0:is(e,t,e.prev)<0||is(e,e.next,t)<0}function RWt(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}function Syt(e,t){var r=new GX(e.i,e.x,e.y),i=new GX(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function xyt(e,t,r,i){var n=new GX(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function fC(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function GX(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}_9.deviation=function(e,t,r,i){var n=t&&t.length,o=n?t[0]*r:e.length,s=Math.abs(WX(e,0,o,r));if(n)for(var a=0,h=t.length;a<h;a++){var p=t[a]*r,g=a<h-1?t[a+1]*r:e.length;s-=Math.abs(WX(e,p,g,r))}var w=0;for(a=0;a<i.length;a+=3){var C=i[a]*r,R=i[a+1]*r,z=i[a+2]*r;w+=Math.abs((e[C]-e[z])*(e[R+1]-e[C+1])-(e[C]-e[R])*(e[z+1]-e[C+1]))}return s===0&&w===0?0:Math.abs((w-s)/s)};function WX(e,t,r,i){for(var n=0,o=t,s=r-i;o<r;o+=i)n+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return n}_9.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var s=0;s<t;s++)r.vertices.push(e[n][o][s]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r}});var w_t=Nr(rB=>{\"use strict\";var cHt=Symbol.for(\"react.transitional.element\"),uHt=Symbol.for(\"react.fragment\");function x_t(e,t,r){var i=null;if(r!==void 0&&(i=\"\"+r),t.key!==void 0&&(i=\"\"+t.key),\"key\"in t){r={};for(var n in t)n!==\"key\"&&(r[n]=t[n])}else r=t;return t=r.ref,{$$typeof:cHt,type:e,key:i,ref:t!==void 0?t:null,props:r}}rB.Fragment=uHt;rB.jsx=x_t;rB.jsxs=x_t});var fo=Nr((WVe,T_t)=>{\"use strict\";T_t.exports=w_t()});var S_t,iB,KZ=Et(()=>{\"use client\";S_t=xe(ze(),1),iB=(0,S_t.createContext)({})});function k1(e){let t=(0,M_t.useRef)(null);return t.current===null&&(t.current=e()),t.current}var M_t,WC=Et(()=>{\"use client\";M_t=xe(ze(),1)});var E_t,P_t=Et(()=>{E_t=typeof window<\"u\"});var nB,oB,QZ=Et(()=>{\"use client\";nB=xe(ze(),1);P_t();oB=E_t?nB.useLayoutEffect:nB.useEffect});var C_t,R1,qC=Et(()=>{\"use client\";C_t=xe(ze(),1),R1=(0,C_t.createContext)(null)});function I_t(e,t){e.indexOf(t)===-1&&e.push(t)}function k_t(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var R_t=Et(()=>{});var Fc,D_t=Et(()=>{Fc=(e,t,r)=>r>t?t:r<e?e:r});var Yg,O0,JZ=Et(()=>{Yg=()=>{},O0=()=>{}});var nl,O_t=Et(()=>{nl={}});var HC,L_t=Et(()=>{HC=e=>/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(e)});function tK(e){return typeof e==\"object\"&&e!==null}var B_t=Et(()=>{});var YC,F_t=Et(()=>{YC=e=>/^0[^.\\s]+$/u.test(e)});function XC(e){let t;return()=>(t===void 0&&(t=e()),t)}var N_t=Et(()=>{});var Eh,sB=Et(()=>{Eh=e=>e});var hHt,Xg,z_t=Et(()=>{hHt=(e,t)=>r=>t(e(r)),Xg=(...e)=>e.reduce(hHt)});var ZC,U_t=Et(()=>{ZC=(e,t,r)=>{let i=t-e;return i===0?1:(r-e)/i}});var Bb,V_t=Et(()=>{R_t();Bb=class{constructor(){this.subscriptions=[]}add(t){return I_t(this.subscriptions,t),()=>k_t(this.subscriptions,t)}notify(t,r,i){let n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](t,r,i);else for(let o=0;o<n;o++){let s=this.subscriptions[o];s&&s(t,r,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}});var ol,oc,j_t=Et(()=>{ol=e=>e*1e3,oc=e=>e/1e3});function KC(e,t){return t?e*(1e3/t):0}var $_t=Et(()=>{});function pHt(e,t,r,i,n){let o,s,a=0;do s=t+(r-t)/2,o=G_t(s,i,n)-e,o>0?r=s:t=s;while(Math.abs(o)>dHt&&++a<fHt);return s}function D1(e,t,r,i){if(e===t&&r===i)return Eh;let n=o=>pHt(o,0,1,e,r);return o=>o===0||o===1?o:G_t(n(o),t,i)}var G_t,dHt,fHt,aB=Et(()=>{sB();G_t=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,dHt=1e-7,fHt=12});var lB,eK=Et(()=>{lB=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2});var cB,rK=Et(()=>{cB=e=>t=>1-e(1-t)});var uB,h4,QC,hB=Et(()=>{aB();eK();rK();uB=D1(.33,1.53,.69,.99),h4=cB(uB),QC=lB(h4)});var JC,iK=Et(()=>{hB();JC=e=>e>=1?1:(e*=2)<1?.5*h4(e):.5*(2-Math.pow(2,-10*(e-1)))});var t6,nK,e6,oK=Et(()=>{eK();rK();t6=e=>1-Math.sin(Math.acos(e)),nK=cB(t6),e6=lB(t6)});var sK,aK,r6,lK=Et(()=>{aB();sK=D1(.42,0,1,1),aK=D1(0,0,.58,1),r6=D1(.42,0,.58,1)});var cK,W_t=Et(()=>{cK=e=>Array.isArray(e)&&typeof e[0]!=\"number\"});var i6,uK=Et(()=>{i6=e=>Array.isArray(e)&&typeof e[0]==\"number\"});var q_t,mHt,dB,H_t=Et(()=>{JZ();sB();iK();hB();oK();aB();lK();uK();q_t={linear:Eh,easeIn:sK,easeInOut:r6,easeOut:aK,circIn:t6,circInOut:e6,circOut:nK,backIn:h4,backInOut:QC,backOut:uB,anticipate:JC},mHt=e=>typeof e==\"string\",dB=e=>{if(i6(e)){O0(e.length===4,\"Cubic bezier arrays must contain four numerical values.\",\"cubic-bezier-length\");let[t,r,i,n]=e;return D1(t,r,i,n)}else if(mHt(e))return O0(q_t[e]!==void 0,`Invalid easing type '${e}'`,\"invalid-easing-type\"),q_t[e];return e}});var mn=Et(()=>{D_t();JZ();O_t();L_t();B_t();F_t();N_t();sB();z_t();U_t();V_t();j_t();$_t();iK();hB();oK();lK();uK();W_t();H_t()});var n6,Y_t=Et(()=>{n6=[\"setup\",\"read\",\"resolveKeyframes\",\"preUpdate\",\"update\",\"preRender\",\"render\",\"postRender\"]});var d4,hK=Et(()=>{d4={value:null,addProjectionMetrics:null}});function X_t(e,t){let r=new Set,i=new Set,n=!1,o=!1,s=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},h=0;function p(w){s.has(w)&&(g.schedule(w),e()),h++,w(a)}let g={schedule:(w,C=!1,R=!1)=>{let W=R&&n?r:i;return C&&s.add(w),W.add(w),w},cancel:w=>{i.delete(w),s.delete(w)},process:w=>{if(a=w,n){o=!0;return}n=!0;let C=r;r=i,i=C,r.forEach(p),t&&d4.value&&d4.value.frameloop[t].push(h),h=0,r.clear(),n=!1,o&&(o=!1,g.process(w))}};return g}var Z_t=Et(()=>{hK()});function fB(e,t){let r=!1,i=!0,n={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,s=n6.reduce((tt,rt)=>(tt[rt]=X_t(o,t?rt:void 0),tt),{}),{setup:a,read:h,resolveKeyframes:p,preUpdate:g,update:w,preRender:C,render:R,postRender:z}=s,W=()=>{let tt=nl.useManualTiming,rt=tt?n.timestamp:performance.now();r=!1,tt||(n.delta=i?1e3/60:Math.max(Math.min(rt-n.timestamp,gHt),1)),n.timestamp=rt,n.isProcessing=!0,a.process(n),h.process(n),p.process(n),g.process(n),w.process(n),C.process(n),R.process(n),z.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(W))},Y=()=>{r=!0,i=!0,n.isProcessing||e(W)};return{schedule:n6.reduce((tt,rt)=>{let at=s[rt];return tt[rt]=(et,lt=!1,J=!1)=>(r||Y(),at.schedule(et,lt,J)),tt},{}),cancel:tt=>{for(let rt=0;rt<n6.length;rt++)s[n6[rt]].cancel(tt)},state:n,steps:s}}var gHt,dK=Et(()=>{mn();Y_t();Z_t();gHt=40});var Ys,f4,Fb,AHt,Zg=Et(()=>{mn();dK();({schedule:Ys,cancel:f4,state:Fb,steps:AHt}=fB(typeof requestAnimationFrame<\"u\"?requestAnimationFrame:Eh,!0))});function yHt(){pB=void 0}var pB,Ia,Nb=Et(()=>{mn();Zg();Ia={now:()=>(pB===void 0&&Ia.set(Fb.isProcessing||nl.useManualTiming?Fb.timestamp:performance.now()),pB),set:e=>{pB=e,queueMicrotask(yHt)}}});var p4,fK=Et(()=>{p4={layout:0,mainThread:0,waapi:0}});function pK(e){return typeof e!=\"string\"?!1:e.split(\"/*\")[0].includes(\"var(--\")}var K_t,mB,_Ht,m4,vHt,g4=Et(()=>{K_t=e=>t=>typeof t==\"string\"&&t.startsWith(e),mB=K_t(\"--\"),_Ht=K_t(\"var(--\"),m4=e=>_Ht(e)?vHt.test(e.split(\"/*\")[0].trim()):!1,vHt=/var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu});var L0,Kg,o6,O1=Et(()=>{mn();L0={test:e=>typeof e==\"number\",parse:parseFloat,transform:e=>e},Kg={...L0,transform:e=>Fc(0,1,e)},o6={...L0,default:1}});var L1,gB=Et(()=>{L1=e=>Math.round(e*1e5)/1e5});var A4,AB=Et(()=>{A4=/-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu});function Q_t(e){return e==null}var J_t=Et(()=>{});var tvt,evt=Et(()=>{tvt=/^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu});var y4,yB,_B=Et(()=>{AB();J_t();evt();y4=(e,t)=>r=>!!(typeof r==\"string\"&&tvt.test(r)&&r.startsWith(e)||t&&!Q_t(r)&&Object.prototype.hasOwnProperty.call(r,t)),yB=(e,t,r)=>i=>{if(typeof i!=\"string\")return i;let[n,o,s,a]=i.match(A4);return{[e]:parseFloat(n),[t]:parseFloat(o),[r]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}}});var bHt,mK,B0,vB=Et(()=>{mn();O1();gB();_B();bHt=e=>Fc(0,255,e),mK={...L0,transform:e=>Math.round(bHt(e))},B0={test:y4(\"rgb\",\"red\"),parse:yB(\"red\",\"green\",\"blue\"),transform:({red:e,green:t,blue:r,alpha:i=1})=>\"rgba(\"+mK.transform(e)+\", \"+mK.transform(t)+\", \"+mK.transform(r)+\", \"+L1(Kg.transform(i))+\")\"}});function xHt(e){let t=\"\",r=\"\",i=\"\",n=\"\";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),i=e.substring(5,7),n=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),i=e.substring(3,4),n=e.substring(4,5),t+=t,r+=r,i+=i,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var s6,gK=Et(()=>{vB();_B();s6={test:y4(\"#\"),parse:xHt,transform:B0.transform}});var a6,F0,B1,xr,rvt,ivt,AK,zb=Et(()=>{a6=e=>({test:t=>typeof t==\"string\"&&t.endsWith(e)&&t.split(\" \").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),F0=a6(\"deg\"),B1=a6(\"%\"),xr=a6(\"px\"),rvt=a6(\"vh\"),ivt=a6(\"vw\"),AK={...B1,parse:e=>B1.parse(e)/100,transform:e=>B1.transform(e*100)}});var F1,yK=Et(()=>{O1();zb();gB();_B();F1={test:y4(\"hsl\",\"hue\"),parse:yB(\"hue\",\"saturation\",\"lightness\"),transform:({hue:e,saturation:t,lightness:r,alpha:i=1})=>\"hsla(\"+Math.round(e)+\", \"+B1.transform(L1(t))+\", \"+B1.transform(L1(r))+\", \"+L1(Kg.transform(i))+\")\"}});var Wo,l6=Et(()=>{gK();yK();vB();Wo={test:e=>B0.test(e)||s6.test(e)||F1.test(e),parse:e=>B0.test(e)?B0.parse(e):F1.test(e)?F1.parse(e):s6.parse(e),transform:e=>typeof e==\"string\"?e:e.hasOwnProperty(\"red\")?B0.transform(e):F1.transform(e),getAnimatableNone:e=>{let t=Wo.parse(e);return t.alpha=0,Wo.transform(t)}}});var nvt,ovt=Et(()=>{nvt=/(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu});function wHt(e){return isNaN(e)&&typeof e==\"string\"&&(e.match(A4)?.length||0)+(e.match(nvt)?.length||0)>0}function N1(e){let t=e.toString(),r=[],i={color:[],number:[],var:[]},n=[],o=0,a=t.replace(MHt,h=>(Wo.test(h)?(i.color.push(o),n.push(lvt),r.push(Wo.parse(h))):h.startsWith(SHt)?(i.var.push(o),n.push(THt),r.push(h)):(i.number.push(o),n.push(avt),r.push(parseFloat(h))),++o,svt)).split(svt);return{values:r,split:a,indexes:i,types:n}}function EHt(e){return N1(e).values}function cvt({split:e,types:t}){let r=e.length;return i=>{let n=\"\";for(let o=0;o<r;o++)if(n+=e[o],i[o]!==void 0){let s=t[o];s===avt?n+=L1(i[o]):s===lvt?n+=Wo.transform(i[o]):n+=i[o]}return n}}function PHt(e){return cvt(N1(e))}function kHt(e){let t=N1(e);return cvt(t)(t.values.map((i,n)=>IHt(i,t.split[n])))}var avt,lvt,THt,SHt,svt,MHt,CHt,IHt,ka,N0=Et(()=>{l6();ovt();AB();gB();avt=\"number\",lvt=\"color\",THt=\"var\",SHt=\"var(\",svt=\"${}\",MHt=/var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;CHt=e=>typeof e==\"number\"?0:Wo.test(e)?Wo.getAnimatableNone(e):e,IHt=(e,t)=>typeof e==\"number\"?t?.trim().endsWith(\"/\")?e:0:CHt(e);ka={test:wHt,parse:EHt,createTransformer:PHt,getAnimatableNone:kHt}});function _K(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function uvt({hue:e,saturation:t,lightness:r,alpha:i}){e/=360,t/=100,r/=100;let n=0,o=0,s=0;if(!t)n=o=s=r;else{let a=r<.5?r*(1+t):r+t-r*t,h=2*r-a;n=_K(h,a,e+1/3),o=_K(h,a,e),s=_K(h,a,e-1/3)}return{red:Math.round(n*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}var hvt=Et(()=>{});function _4(e,t){return r=>r>0?t:e}var vK=Et(()=>{});var z0,v4=Et(()=>{z0=(e,t,r)=>e+(t-e)*r});function dvt(e){let t=DHt(e);if(Yg(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,\"color-not-animatable\"),!t)return!1;let r=t.parse(e);return t===F1&&(r=uvt(r)),r}var bK,RHt,DHt,xK,fvt=Et(()=>{mn();gK();yK();hvt();vB();vK();v4();bK=(e,t,r)=>{let i=e*e,n=r*(t*t-i)+i;return n<0?0:Math.sqrt(n)},RHt=[s6,B0,F1],DHt=e=>RHt.find(t=>t.test(e));xK=(e,t)=>{let r=dvt(e),i=dvt(t);if(!r||!i)return _4(e,t);let n={...r};return o=>(n.red=bK(r.red,i.red,o),n.green=bK(r.green,i.green,o),n.blue=bK(r.blue,i.blue,o),n.alpha=z0(r.alpha,i.alpha,o),B0.transform(n))}});function pvt(e,t){return bB.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}var bB,mvt=Et(()=>{bB=new Set([\"none\",\"hidden\"])});function OHt(e,t){return r=>z0(e,t,r)}function xB(e){return typeof e==\"number\"?OHt:typeof e==\"string\"?m4(e)?_4:Wo.test(e)?xK:FHt:Array.isArray(e)?gvt:typeof e==\"object\"?Wo.test(e)?xK:LHt:_4}function gvt(e,t){let r=[...e],i=r.length,n=e.map((o,s)=>xB(o)(o,t[s]));return o=>{for(let s=0;s<i;s++)r[s]=n[s](o);return r}}function LHt(e,t){let r={...e,...t},i={};for(let n in r)e[n]!==void 0&&t[n]!==void 0&&(i[n]=xB(e[n])(e[n],t[n]));return n=>{for(let o in i)r[o]=i[o](n);return r}}function BHt(e,t){let r=[],i={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let o=t.types[n],s=e.indexes[o][i[o]],a=e.values[s]??0;r[n]=a,i[o]++}return r}var FHt,Avt=Et(()=>{mn();g4();l6();N0();fvt();vK();v4();mvt();FHt=(e,t)=>{let r=ka.createTransformer(t),i=N1(e),n=N1(t);return i.indexes.var.length===n.indexes.var.length&&i.indexes.color.length===n.indexes.color.length&&i.indexes.number.length>=n.indexes.number.length?bB.has(e)&&!n.values.length||bB.has(t)&&!i.values.length?pvt(e,t):Xg(gvt(BHt(i,n),n.values),r):(Yg(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\"complex-values-different\"),_4(e,t))}});function wB(e,t,r){return typeof e==\"number\"&&typeof t==\"number\"&&typeof r==\"number\"?z0(e,t,r):xB(e)(e,t)}var wK=Et(()=>{Avt();v4()});var yvt,_vt=Et(()=>{Nb();Zg();yvt=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>Ys.update(t,r),stop:()=>f4(t),now:()=>Fb.isProcessing?Fb.timestamp:Ia.now()}}});var TB,TK=Et(()=>{TB=(e,t,r=10)=>{let i=\"\",n=Math.max(Math.round(t/r),2);for(let o=0;o<n;o++)i+=Math.round(e(o/(n-1))*1e4)/1e4+\", \";return`linear(${i.substring(0,i.length-2)})`}});function b4(e){let t=0,r=50,i=e.next(t);for(;!i.done&&t<2e4;)t+=r,i=e.next(t);return t>=2e4?1/0:t}var SB=Et(()=>{});function vvt(e,t=100,r){let i=r({...e,keyframes:[0,t]}),n=Math.min(b4(i),2e4);return{type:\"keyframes\",ease:o=>i.next(n*o).value/t,duration:oc(n)}}var bvt=Et(()=>{mn();SB()});function EK(e,t){return e*Math.sqrt(1-t*t)}function zHt(e,t,r){let i=r;for(let n=1;n<NHt;n++)i=i-e(i)/t(i);return i}function UHt({duration:e=os.duration,bounce:t=os.bounce,velocity:r=os.velocity,mass:i=os.mass}){let n,o;Yg(e<=ol(os.maxDuration),\"Spring duration must be 10 seconds or less\",\"spring-duration-limit\");let s=1-t;s=Fc(os.minDamping,os.maxDamping,s),e=Fc(os.minDuration,os.maxDuration,oc(e)),s<1?(n=p=>{let g=p*s,w=g*e,C=g-r,R=EK(p,s),z=Math.exp(-w);return MK-C/R*z},o=p=>{let w=p*s*e,C=w*r+r,R=Math.pow(s,2)*Math.pow(p,2)*e,z=Math.exp(-w),W=EK(Math.pow(p,2),s);return(-n(p)+MK>0?-1:1)*((C-R)*z)/W}):(n=p=>{let g=Math.exp(-p*e),w=(p-r)*e+1;return-MK+g*w},o=p=>{let g=Math.exp(-p*e),w=(r-p)*(e*e);return g*w});let a=5/e,h=zHt(n,o,a);if(e=ol(e),isNaN(h))return{stiffness:os.stiffness,damping:os.damping,duration:e};{let p=Math.pow(h,2)*i;return{stiffness:p,damping:s*2*Math.sqrt(i*p),duration:e}}}function xvt(e,t){return t.some(r=>e[r]!==void 0)}function $Ht(e){let t={velocity:os.velocity,stiffness:os.stiffness,damping:os.damping,mass:os.mass,isResolvedFromDuration:!1,...e};if(!xvt(e,jHt)&&xvt(e,VHt))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,i=2*Math.PI/(r*1.2),n=i*i,o=2*Fc(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:os.mass,stiffness:n,damping:o}}else{let r=UHt({...e,velocity:0});t={...t,...r,mass:os.mass},t.isResolvedFromDuration=!0}return t}function x4(e=os.visualDuration,t=os.bounce){let r=typeof e!=\"object\"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:n}=r,o=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],a={done:!1,value:o},{stiffness:h,damping:p,mass:g,duration:w,velocity:C,isResolvedFromDuration:R}=$Ht({...r,velocity:-oc(r.velocity||0)}),z=C||0,W=p/(2*Math.sqrt(h*g)),Y=s-o,H=oc(Math.sqrt(h/g)),Q=Math.abs(Y)<5;i||(i=Q?os.restSpeed.granular:os.restSpeed.default),n||(n=Q?os.restDelta.granular:os.restDelta.default);let tt,rt,at,et,lt,J;if(W<1)at=EK(H,W),et=(z+W*H*Y)/at,tt=dt=>{let Mt=Math.exp(-W*H*dt);return s-Mt*(et*Math.sin(at*dt)+Y*Math.cos(at*dt))},lt=W*H*et+Y*at,J=W*H*Y-et*at,rt=dt=>Math.exp(-W*H*dt)*(lt*Math.sin(at*dt)+J*Math.cos(at*dt));else if(W===1){tt=Mt=>s-Math.exp(-H*Mt)*(Y+(z+H*Y)*Mt);let dt=z+H*Y;rt=Mt=>Math.exp(-H*Mt)*(H*dt*Mt-z)}else{let dt=H*Math.sqrt(W*W-1);tt=$t=>{let Yt=Math.exp(-W*H*$t),_e=Math.min(dt*$t,300);return s-Yt*((z+W*H*Y)*Math.sinh(_e)+dt*Y*Math.cosh(_e))/dt};let Mt=(z+W*H*Y)/dt,Ft=W*H*Mt-Y*dt,Nt=W*H*Y-Mt*dt;rt=$t=>{let Yt=Math.exp(-W*H*$t),_e=Math.min(dt*$t,300);return Yt*(Ft*Math.sinh(_e)+Nt*Math.cosh(_e))}}let ft={calculatedDuration:R&&w||null,velocity:dt=>ol(rt(dt)),next:dt=>{if(!R&&W<1){let Ft=Math.exp(-W*H*dt),Nt=Math.sin(at*dt),$t=Math.cos(at*dt),Yt=s-Ft*(et*Nt+Y*$t),_e=ol(Ft*(lt*Nt+J*$t));return a.done=Math.abs(_e)<=i&&Math.abs(s-Yt)<=n,a.value=a.done?s:Yt,a}let Mt=tt(dt);if(R)a.done=dt>=w;else{let Ft=ol(rt(dt));a.done=Math.abs(Ft)<=i&&Math.abs(s-Mt)<=n}return a.value=a.done?s:Mt,a},toString:()=>{let dt=Math.min(b4(ft),2e4),Mt=TB(Ft=>ft.next(dt*Ft).value,dt,30);return dt+\"ms \"+Mt},toTransition:()=>{}};return ft}var os,NHt,MK,VHt,jHt,PK=Et(()=>{mn();TK();SB();bvt();os={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};NHt=12;MK=.001;VHt=[\"duration\",\"bounce\"],jHt=[\"stiffness\",\"damping\",\"mass\"];x4.applyToOptions=e=>{let t=vvt(e,100,x4);return e.ease=t.ease,e.duration=ol(t.duration),e.type=\"keyframes\",e}});function MB(e,t,r){let i=Math.max(t-GHt,0);return KC(r-e(i),t-i)}var GHt,CK=Et(()=>{mn();GHt=5});function c6({keyframes:e,velocity:t=0,power:r=.8,timeConstant:i=325,bounceDamping:n=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:h,restDelta:p=.5,restSpeed:g}){let w=e[0],C={done:!1,value:w},R=J=>a!==void 0&&J<a||h!==void 0&&J>h,z=J=>a===void 0?h:h===void 0||Math.abs(a-J)<Math.abs(h-J)?a:h,W=r*t,Y=w+W,H=s===void 0?Y:s(Y);H!==Y&&(W=H-w);let Q=J=>-W*Math.exp(-J/i),tt=J=>H+Q(J),rt=J=>{let ft=Q(J),dt=tt(J);C.done=Math.abs(ft)<=p,C.value=C.done?H:dt},at,et,lt=J=>{R(C.value)&&(at=J,et=x4({keyframes:[C.value,z(C.value)],velocity:MB(tt,J,C.value),damping:n,stiffness:o,restDelta:p,restSpeed:g}))};return lt(0),{calculatedDuration:null,next:J=>{let ft=!1;return!et&&at===void 0&&(ft=!0,rt(J),lt(J)),at!==void 0&&J>=at?et.next(J-at):(!ft&&rt(J),C)}}}var IK=Et(()=>{PK();CK()});function WHt(e,t,r){let i=[],n=r||nl.mix||wB,o=e.length-1;for(let s=0;s<o;s++){let a=n(e[s],e[s+1]);if(t){let h=Array.isArray(t)?t[s]||Eh:t;a=Xg(h,a)}i.push(a)}return i}function wvt(e,t,{clamp:r=!0,ease:i,mixer:n}={}){let o=e.length;if(O0(o===t.length,\"Both input and output ranges must be the same length\",\"range-length\"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=WHt(t,i,n),h=a.length,p=g=>{if(s&&g<e[0])return t[0];let w=0;if(h>1)for(;w<e.length-2&&!(g<e[w+1]);w++);let C=ZC(e[w],e[w+1],g);return a[w](C)};return r?g=>p(Fc(e[0],e[o-1],g)):p}var Tvt=Et(()=>{mn();wK()});function Svt(e,t){let r=e[e.length-1];for(let i=1;i<=t;i++){let n=ZC(0,t,i);e.push(z0(r,1,n))}}var Mvt=Et(()=>{mn();v4()});function Evt(e){let t=[0];return Svt(t,e.length-1),t}var Pvt=Et(()=>{Mvt()});function Cvt(e,t){return e.map(r=>r*t)}var Ivt=Et(()=>{});function qHt(e,t){return e.map(()=>t||r6).splice(0,e.length-1)}function Ub({duration:e=300,keyframes:t,times:r,ease:i=\"easeInOut\"}){let n=cK(i)?i.map(dB):dB(i),o={done:!1,value:t[0]},s=Cvt(r&&r.length===t.length?r:Evt(t),e),a=wvt(s,t,{ease:Array.isArray(n)?n:qHt(t,n)});return{calculatedDuration:e,next:h=>(o.value=a(h),o.done=h>=e,o)}}var kK=Et(()=>{mn();Tvt();Pvt();Ivt()});function z1(e,{repeat:t,repeatType:r=\"loop\"},i,n=1){let o=e.filter(HHt),a=n<0||t&&r!==\"loop\"&&t%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}var HHt,u6=Et(()=>{HHt=e=>e!==null});function EB(e){typeof e.type==\"string\"&&(e.type=YHt[e.type])}var YHt,RK=Et(()=>{IK();kK();PK();YHt={decay:c6,inertia:c6,tween:Ub,keyframes:Ub,spring:x4}});var U1,PB=Et(()=>{U1=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}});var XHt,Qg,CB=Et(()=>{mn();Nb();fK();wK();_vt();IK();kK();SB();CK();u6();RK();PB();XHt=e=>e/100,Qg=class extends U1{constructor(t){super(),this.state=\"idle\",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:r}=this.options;r&&r.updatedAt!==Ia.now()&&this.tick(Ia.now()),this.isStopped=!0,this.state!==\"idle\"&&(this.teardown(),this.options.onStop?.())},p4.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;EB(t);let{type:r=Ub,repeat:i=0,repeatDelay:n=0,repeatType:o,velocity:s=0}=t,{keyframes:a}=t,h=r||Ub;h!==Ub&&typeof a[0]!=\"number\"&&(this.mixKeyframes=Xg(XHt,wB(a[0],a[1])),a=[0,100]);let p=h({...t,keyframes:a});o===\"mirror\"&&(this.mirroredGenerator=h({...t,keyframes:[...a].reverse(),velocity:-s})),p.calculatedDuration===null&&(p.calculatedDuration=b4(p));let{calculatedDuration:g}=p;this.calculatedDuration=g,this.resolvedDuration=g+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=p}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:i,totalDuration:n,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:h}=this;if(this.startTime===null)return i.next(0);let{delay:p=0,keyframes:g,repeat:w,repeatType:C,repeatDelay:R,type:z,onUpdate:W,finalKeyframe:Y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let H=this.currentTime-p*(this.playbackSpeed>=0?1:-1),Q=this.playbackSpeed>=0?H<0:H>n;this.currentTime=Math.max(H,0),this.state===\"finished\"&&this.holdTime===null&&(this.currentTime=n);let tt=this.currentTime,rt=i;if(w){let J=Math.min(this.currentTime,n)/a,ft=Math.floor(J),dt=J%1;!dt&&J>=1&&(dt=1),dt===1&&ft--,ft=Math.min(ft,w+1),ft%2&&(C===\"reverse\"?(dt=1-dt,R&&(dt-=R/a)):C===\"mirror\"&&(rt=s)),tt=Fc(0,1,dt)*a}let at;Q?(this.delayState.value=g[0],at=this.delayState):at=rt.next(tt),o&&!Q&&(at.value=o(at.value));let{done:et}=at;!Q&&h!==null&&(et=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let lt=this.holdTime===null&&(this.state===\"finished\"||this.state===\"running\"&&et);return lt&&z!==c6&&(at.value=z1(g,this.options,Y,this.speed)),W&&W(at.value),lt&&this.finish(),at}then(t,r){return this.finished.then(t,r)}get duration(){return oc(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+oc(t)}get time(){return oc(this.currentTime)}set time(t){t=ol(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=\"paused\",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return MB(i=>this.generator.next(i).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(Ia.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=oc(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=yvt,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),this.options.onPlay?.();let i=this.driver.now();this.state===\"finished\"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=r??i),this.state===\"finished\"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=\"running\",this.driver.start()}pause(){this.state=\"paused\",this.updateTime(Ia.now()),this.holdTime=this.currentTime}complete(){this.state!==\"running\"&&this.play(),this.state=\"finished\",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=\"finished\",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=\"idle\",this.stopDriver(),this.startTime=this.holdTime=null,p4.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type=\"keyframes\",this.options.ease=\"linear\",this.initAnimation()),this.driver?.stop(),t.observe(this)}}});function kvt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Rvt=Et(()=>{});function IB(e){return e.includes(\"scale\")?1:0}function kB(e,t){if(!e||e===\"none\")return IB(t);let r=e.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u),i,n;if(r)i=KHt,n=r;else{let a=e.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);i=ZHt,n=a}if(!n)return IB(t);let o=i[t],s=n[1].split(\",\").map(QHt);return typeof o==\"function\"?o(s):s[o]}function QHt(e){return parseFloat(e.trim())}var Vb,DK,ZHt,OK,Dvt,Ovt,Lvt,KHt,Bvt,LK=Et(()=>{Vb=e=>e*180/Math.PI,DK=e=>{let t=Vb(Math.atan2(e[1],e[0]));return OK(t)},ZHt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:DK,rotateZ:DK,skewX:e=>Vb(Math.atan(e[1])),skewY:e=>Vb(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},OK=e=>(e=e%360,e<0&&(e+=360),e),Dvt=DK,Ovt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Lvt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),KHt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ovt,scaleY:Lvt,scale:e=>(Ovt(e)+Lvt(e))/2,rotateX:e=>OK(Vb(Math.atan2(e[6],e[5]))),rotateY:e=>OK(Vb(Math.atan2(-e[2],e[0]))),rotateZ:Dvt,rotate:Dvt,skewX:e=>Vb(Math.atan(e[4])),skewY:e=>Vb(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};Bvt=(e,t)=>{let{transform:r=\"none\"}=getComputedStyle(e);return kB(r,t)}});var U0,Nd,tp=Et(()=>{U0=[\"transformPerspective\",\"x\",\"y\",\"z\",\"translateX\",\"translateY\",\"translateZ\",\"scale\",\"scaleX\",\"scaleY\",\"rotate\",\"rotateX\",\"rotateY\",\"rotateZ\",\"skew\",\"skewX\",\"skewY\"],Nd=new Set(U0)});function Fvt(e){let t=[];return tYt.forEach(r=>{let i=e.getValue(r);i!==void 0&&(t.push([r,i.get()]),i.set(r.startsWith(\"scale\")?1:0))}),t}var BK,JHt,tYt,Jg,FK=Et(()=>{LK();tp();O1();zb();BK=e=>e===L0||e===xr,JHt=new Set([\"x\",\"y\",\"z\"]),tYt=U0.filter(e=>!JHt.has(e));Jg={width:({x:e},{paddingLeft:t=\"0\",paddingRight:r=\"0\",boxSizing:i})=>{let n=e.max-e.min;return i===\"border-box\"?n:n-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t=\"0\",paddingBottom:r=\"0\",boxSizing:i})=>{let n=e.max-e.min;return i===\"border-box\"?n:n-parseFloat(t)-parseFloat(r)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>kB(t,\"x\"),y:(e,{transform:t})=>kB(t,\"y\")};Jg.translateX=Jg.x;Jg.translateY=Jg.y});function Nvt(){if(zK){let e=Array.from(jb).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),r=new Map;t.forEach(i=>{let n=Fvt(i);n.length&&(r.set(i,n),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();let n=r.get(i);n&&n.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}zK=!1,NK=!1,jb.forEach(e=>e.complete(UK)),jb.clear()}function zvt(){jb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zK=!0)})}function Uvt(){UK=!0,zvt(),Nvt(),UK=!1}var jb,NK,zK,UK,V1,RB=Et(()=>{Rvt();FK();Zg();jb=new Set,NK=!1,zK=!1,UK=!1;V1=class{constructor(t,r,i,n,o,s=!1){this.state=\"pending\",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=i,this.motionValue=n,this.element=o,this.isAsync=s}scheduleResolve(){this.state=\"scheduled\",this.isAsync?(jb.add(this),NK||(NK=!0,Ys.read(zvt),Ys.resolveKeyframes(Nvt))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:i,motionValue:n}=this;if(t[0]===null){let o=n?.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(i&&r){let a=i.readValue(r,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),n&&o===void 0&&n.set(t[0])}kvt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state=\"complete\",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),jb.delete(this)}cancel(){this.state===\"scheduled\"&&(jb.delete(this),this.state=\"pending\")}resume(){this.state===\"pending\"&&this.scheduleResolve()}}});var Vvt,jvt=Et(()=>{Vvt=e=>e.startsWith(\"--\")});function DB(e,t,r){Vvt(t)?e.style.setProperty(t,r):e.style[t]=r}var VK=Et(()=>{jvt()});var $vt,Gvt=Et(()=>{$vt={}});function OB(e,t){let r=XC(e);return()=>$vt[t]??r()}var jK=Et(()=>{mn();Gvt()});var Wvt,qvt=Et(()=>{jK();Wvt=OB(()=>window.ScrollTimeline!==void 0,\"scrollTimeline\")});var LB,$K=Et(()=>{jK();LB=OB(()=>{try{document.createElement(\"div\").animate({opacity:0},{easing:\"linear(0, 1)\"})}catch{return!1}return!0},\"linearEasing\")});var $b,GK=Et(()=>{$b=([e,t,r,i])=>`cubic-bezier(${e}, ${t}, ${r}, ${i})`});var WK,Hvt=Et(()=>{GK();WK={linear:\"linear\",ease:\"ease\",easeIn:\"ease-in\",easeOut:\"ease-out\",easeInOut:\"ease-in-out\",circIn:$b([0,.65,.55,1]),circOut:$b([.55,0,1,.45]),backIn:$b([.31,.01,.66,-.59]),backOut:$b([.33,1.53,.69,.99])}});function qK(e,t){if(e)return typeof e==\"function\"?LB()?TB(e,t):\"ease-out\":i6(e)?$b(e):Array.isArray(e)?e.map(r=>qK(r,t)||WK.easeOut):WK[e]}var Yvt=Et(()=>{mn();$K();TK();GK();Hvt()});function Xvt(e,t,r,{delay:i=0,duration:n=300,repeat:o=0,repeatType:s=\"loop\",ease:a=\"easeOut\",times:h}={},p=void 0){let g={[t]:r};h&&(g.offset=h);let w=qK(a,n);Array.isArray(w)&&(g.easing=w),d4.value&&p4.waapi++;let C={delay:i,duration:n,easing:Array.isArray(w)?\"linear\":w,fill:\"both\",iterations:o+1,direction:s===\"reverse\"?\"alternate\":\"normal\"};p&&(C.pseudoElement=p);let R=e.animate(g,C);return d4.value&&R.finished.finally(()=>{p4.waapi--}),R}var Zvt=Et(()=>{fK();hK();Yvt()});function BB(e){return typeof e==\"function\"&&\"applyToOptions\"in e}var HK=Et(()=>{});function Kvt({type:e,...t}){return BB(e)&&LB()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease=\"easeOut\"),t)}var Qvt=Et(()=>{$K();HK()});var w4,YK=Et(()=>{mn();VK();qvt();u6();PB();Zvt();Qvt();w4=class extends U1{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:i,keyframes:n,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:h}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,O0(typeof t.type!=\"string\",`Mini animate() doesn't support \"type\" as a string.`,\"mini-spring\");let p=Kvt(t);this.animation=Xvt(r,i,n,p,o),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){let g=z1(n,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(g),DB(r,i,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===\"finished\"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t===\"idle\"||t===\"finished\"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return oc(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+oc(t)}get time(){return oc(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ol(t),r&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?\"finished\":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:i,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:\"linear\"}),this.animation.onfinish=null,t&&Wvt()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),i&&(this.animation.rangeEnd=i),Eh):n(this)}}});function eYt(e){return e in Jvt}function tbt(e){typeof e.ease==\"string\"&&eYt(e.ease)&&(e.ease=Jvt[e.ease])}var Jvt,ebt=Et(()=>{mn();Jvt={anticipate:JC,backInOut:QC,circInOut:e6}});var XK,FB,rbt=Et(()=>{mn();Nb();VK();CB();YK();RK();ebt();XK=10,FB=class extends w4{constructor(t){tbt(t),EB(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:i,onComplete:n,element:o,...s}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Qg({...s,autoplay:!1}),h=Math.max(XK,Ia.now()-this.startTime),p=Fc(0,XK,h-XK),g=a.sample(h).value,{name:w}=this.options;o&&w&&DB(o,w,g),r.setWithVelocity(a.sample(Math.max(0,h-p)).value,g,p),a.stop()}}});var ZK,ibt=Et(()=>{N0();ZK=(e,t)=>t===\"zIndex\"?!1:!!(typeof e==\"number\"||Array.isArray(e)||typeof e==\"string\"&&(ka.test(e)||e===\"0\")&&!e.startsWith(\"url(\"))});function rYt(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function nbt(e,t,r,i){let n=e[0];if(n===null)return!1;if(t===\"display\"||t===\"visibility\")return!0;let o=e[e.length-1],s=ZK(n,t),a=ZK(o,t);return Yg(s===a,`You are trying to animate ${t} from \"${n}\" to \"${o}\". \"${s?o:n}\" is not an animatable value.`,\"value-not-animatable\"),!s||!a?!1:rYt(e)||(r===\"spring\"||BB(r))&&i}var obt=Et(()=>{mn();HK();ibt()});function h6(e){e.duration=0,e.type=\"keyframes\"}var KK=Et(()=>{});var NB,QK=Et(()=>{NB=new Set([\"opacity\",\"clipPath\",\"filter\",\"transform\"])});function sbt(e){for(let t=0;t<e.length;t++)if(typeof e[t]==\"string\"&&iYt.test(e[t]))return!0;return!1}var iYt,abt=Et(()=>{iYt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/});function lbt(e){let{motionValue:t,name:r,repeatDelay:i,repeatType:n,damping:o,type:s,keyframes:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:p,transformTemplate:g}=t.owner.getProps();return oYt()&&r&&(NB.has(r)||nYt.has(r)&&sbt(a))&&(r!==\"transform\"||!g)&&!p&&!i&&n!==\"mirror\"&&o!==0&&s!==\"inertia\"}var nYt,oYt,cbt=Et(()=>{mn();QK();abt();nYt=new Set([\"color\",\"backgroundColor\",\"outlineColor\",\"fill\",\"stroke\",\"borderColor\",\"borderTopColor\",\"borderRightColor\",\"borderBottomColor\",\"borderLeftColor\"]),oYt=XC(()=>Object.hasOwnProperty.call(Element.prototype,\"animate\"))});var sYt,zB,ubt=Et(()=>{mn();Nb();CB();u6();RB();rbt();obt();KK();PB();cbt();sYt=40,zB=class extends U1{constructor({autoplay:t=!0,delay:r=0,type:i=\"keyframes\",repeat:n=0,repeatDelay:o=0,repeatType:s=\"loop\",keyframes:a,name:h,motionValue:p,element:g,...w}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ia.now();let C={autoplay:t,delay:r,type:i,repeat:n,repeatDelay:o,repeatType:s,name:h,motionValue:p,element:g,...w},R=g?.KeyframeResolver||V1;this.keyframeResolver=new R(a,(z,W,Y)=>this.onKeyframesResolved(z,W,C,!Y),h,p,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,r,i,n){this.keyframeResolver=void 0;let{name:o,type:s,velocity:a,delay:h,isHandoff:p,onUpdate:g}=i;this.resolvedAt=Ia.now();let w=!0;nbt(t,o,s,a)||(w=!1,(nl.instantAnimations||!h)&&g?.(z1(t,i,r)),t[0]=t[t.length-1],h6(i),i.repeat=0);let R={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>sYt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...i,keyframes:t},z=w&&!p&&lbt(R),W=R.motionValue?.owner?.current,Y;if(z)try{Y=new FB({...R,element:W})}catch{Y=new Qg(R)}else Y=new Qg(R);Y.finished.then(()=>{this.notifyFinished()}).catch(Eh),this.pendingTimeline&&(this.stopTimeline=Y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=Y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Uvt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}});function UB(e,t,r,i=0,n=1){let o=Array.from(e).sort((p,g)=>p.sortNodePosition(g)).indexOf(t),s=e.size,a=(s-1)*i;return typeof r==\"function\"?r(o,s):n===1?o*i:a-o*i}var JK=Et(()=>{});function lYt(e){let t=aYt.exec(e);if(!t)return[,];let[,r,i,n]=t;return[`--${r??i}`,n]}function tQ(e,t,r=1){O0(r<=cYt,`Max CSS variable fallback depth detected in property \"${e}\". This may indicate a circular fallback dependency.`,\"max-css-var-depth\");let[i,n]=lYt(e);if(!i)return;let o=window.getComputedStyle(t).getPropertyValue(i);if(o){let s=o.trim();return HC(s)?parseFloat(s):s}return m4(n)?tQ(n,t,r+1):n}var aYt,cYt,hbt=Et(()=>{mn();g4();aYt=/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;cYt=4});var uYt,hYt,dYt,fYt,dbt,fbt=Et(()=>{tp();uYt={type:\"spring\",stiffness:500,damping:25,restSpeed:10},hYt=e=>({type:\"spring\",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dYt={type:\"keyframes\",duration:.8},fYt={type:\"keyframes\",ease:[.25,.1,.35,1],duration:.3},dbt=(e,{keyframes:t})=>t.length>2?dYt:Nd.has(e)?e.startsWith(\"scale\")?hYt(t[1]):uYt:fYt});function Gb(e,t){if(e?.inherit&&t){let{inherit:r,...i}=e;return{...t,...i}}return e}var VB=Et(()=>{});function jB(e,t){let r=e?.[t]??e?.default??e;return r!==e?Gb(r,e):r}var eQ=Et(()=>{VB()});function pbt(e){for(let t in e)if(!pYt.has(t))return!0;return!1}var pYt,mbt=Et(()=>{pYt=new Set([\"when\",\"delay\",\"delayChildren\",\"staggerChildren\",\"staggerDirection\",\"repeat\",\"repeatType\",\"repeatDelay\",\"from\",\"elapsed\"])});var gbt,Abt=Et(()=>{mn();ubt();CB();eQ();KK();fbt();u6();mbt();Zg();gbt=(e,t,r,i={},n,o)=>s=>{let a=jB(i,e)||{},h=a.delay||i.delay||0,{elapsed:p=0}=i;p=p-ol(h);let g={keyframes:Array.isArray(r)?r:[null,r],ease:\"easeOut\",velocity:t.getVelocity(),...a,delay:-p,onUpdate:C=>{t.set(C),a.onUpdate&&a.onUpdate(C)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:n};pbt(a)||Object.assign(g,dbt(e,g)),g.duration&&(g.duration=ol(g.duration)),g.repeatDelay&&(g.repeatDelay=ol(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let w=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(h6(g),g.delay===0&&(w=!0)),(nl.instantAnimations||nl.skipAnimations||n?.shouldSkipAnimations)&&(w=!0,h6(g),g.delay=0),g.allowFlatten=!a.type&&!a.ease,w&&!o&&t.get()!==void 0){let C=z1(g.keyframes,a);if(C!==void 0){Ys.update(()=>{g.onUpdate(C),g.onComplete()});return}}return a.isSync?new Qg(g):new zB(g)}});function ybt(e){let t=[{},{}];return e?.values.forEach((r,i)=>{t[0][i]=r.get(),t[1][i]=r.getVelocity()}),t}function Wb(e,t,r,i){if(typeof t==\"function\"){let[n,o]=ybt(i);t=t(r!==void 0?r:e.custom,n,o)}if(typeof t==\"string\"&&(t=e.variants&&e.variants[t]),typeof t==\"function\"){let[n,o]=ybt(i);t=t(r!==void 0?r:e.custom,n,o)}return t}var $B=Et(()=>{});function Ph(e,t,r){let i=e.getProps();return Wb(i,t,r!==void 0?r:i.custom,e)}var T4=Et(()=>{$B()});var GB,rQ=Et(()=>{tp();GB=new Set([\"width\",\"height\",\"top\",\"left\",\"right\",\"bottom\",...U0])});function qb(e,t){return new iQ(e,t)}var _bt,mYt,vbt,iQ,WB=Et(()=>{mn();Nb();Zg();_bt=30,mYt=e=>!isNaN(parseFloat(e)),vbt={current:void 0},iQ=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let n=Ia.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Ia.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=mYt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on(\"change\",t)}on(t,r){this.events[t]||(this.events[t]=new Bb);let i=this.events[t].add(r);return t===\"change\"?()=>{i(),Ys.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,i){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return vbt.current&&vbt.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Ia.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_bt)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,_bt);return KC(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}});var d6,nQ=Et(()=>{d6=e=>Array.isArray(e)});function gYt(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,qb(r))}function AYt(e){return d6(e)?e[e.length-1]||0:e}function bbt(e,t){let r=Ph(e,t),{transitionEnd:i={},transition:n={},...o}=r||{};o={...o,...i};for(let s in o){let a=AYt(o[s]);gYt(e,s,a)}}var xbt=Et(()=>{WB();T4();nQ()});var po,tA=Et(()=>{po=e=>!!(e&&e.getVelocity)});function wbt(e){return!!(po(e)&&e.add)}var Tbt=Et(()=>{tA()});function Sbt(e,t){let r=e.getValue(\"willChange\");if(wbt(r))return r.add(t);if(!r&&nl.WillChange){let i=new nl.WillChange(\"auto\");e.addValue(\"willChange\",i),i.add(t)}}var Mbt=Et(()=>{mn();Tbt()});function S4(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var qB=Et(()=>{});var Ebt,f6,oQ=Et(()=>{qB();Ebt=\"framerAppearId\",f6=\"data-\"+S4(Ebt)});function Pbt(e){return e.props[f6]}var Cbt=Et(()=>{oQ()});function yYt({protectedKeys:e,needsAnimating:t},r){let i=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,i}function HB(e,t,{delay:r=0,transitionOverride:i,type:n}={}){let{transition:o,transitionEnd:s,...a}=t,h=e.getDefaultTransition();o=o?Gb(o,h):h;let p=o?.reduceMotion;i&&(o=i);let g=[],w=n&&e.animationState&&e.animationState.getState()[n];for(let C in a){let R=e.getValue(C,e.latestValues[C]??null),z=a[C];if(z===void 0||w&&yYt(w,C))continue;let W={delay:r,...jB(o||{},C)},Y=R.get();if(Y!==void 0&&!R.isAnimating()&&!Array.isArray(z)&&z===Y&&!W.velocity){Ys.update(()=>R.set(z));continue}let H=!1;if(window.MotionHandoffAnimation){let rt=Pbt(e);if(rt){let at=window.MotionHandoffAnimation(rt,C,Ys);at!==null&&(W.startTime=at,H=!0)}}Sbt(e,C);let Q=p??e.shouldReduceMotion;R.start(gbt(C,R,z,Q&&GB.has(C)?{type:!1}:W,e,H));let tt=R.animation;tt&&g.push(tt)}if(s){let C=()=>Ys.update(()=>{s&&bbt(e,s)});g.length?Promise.all(g).then(C):C()}return g}var sQ=Et(()=>{eQ();VB();rQ();xbt();Mbt();Cbt();Abt();Zg()});function YB(e,t,r={}){let i=Ph(e,t,r.type===\"exit\"?e.presenceContext?.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(n=r.transitionOverride);let o=i?()=>Promise.all(HB(e,i,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(h=0)=>{let{delayChildren:p=0,staggerChildren:g,staggerDirection:w}=n;return _Yt(e,t,h,p,g,w,r)}:()=>Promise.resolve(),{when:a}=n;if(a){let[h,p]=a===\"beforeChildren\"?[o,s]:[s,o];return h().then(()=>p())}else return Promise.all([o(),s(r.delay)])}function _Yt(e,t,r=0,i=0,n=0,o=1,s){let a=[];for(let h of e.variantChildren)h.notify(\"AnimationStart\",t),a.push(YB(h,t,{...s,delay:r+(typeof i==\"function\"?0:i)+UB(e.variantChildren,h,i,n,o)}).then(()=>h.notify(\"AnimationComplete\",t)));return Promise.all(a)}var Ibt=Et(()=>{T4();JK();sQ()});function kbt(e,t,r={}){e.notify(\"AnimationStart\",t);let i;if(Array.isArray(t)){let n=t.map(o=>YB(e,o,r));i=Promise.all(n)}else if(typeof t==\"string\")i=YB(e,t,r);else{let n=typeof t==\"function\"?Ph(e,t,r.custom):t;i=Promise.all(HB(e,n,r))}return i.then(()=>{e.notify(\"AnimationComplete\",t)})}var Rbt=Et(()=>{T4();sQ();Ibt()});var Dbt,Obt=Et(()=>{Dbt={test:e=>e===\"auto\",parse:e=>e}});var XB,aQ=Et(()=>{XB=e=>t=>t.test(e)});var lQ,cQ,uQ=Et(()=>{Obt();O1();zb();aQ();lQ=[L0,xr,B1,F0,ivt,rvt,Dbt],cQ=e=>lQ.find(XB(e))});function Lbt(e){return typeof e==\"number\"?e===0:e!==null?e===\"none\"||e===\"0\"||YC(e):!0}var Bbt=Et(()=>{mn()});function bYt(e){let[t,r]=e.slice(0,-1).split(\"(\");if(t===\"drop-shadow\")return e;let[i]=r.match(A4)||[];if(!i)return e;let n=r.replace(i,\"\"),o=vYt.has(t)?1:0;return i!==r&&(o*=100),t+\"(\"+o+n+\")\"}var vYt,xYt,p6,hQ=Et(()=>{N0();AB();vYt=new Set([\"brightness\",\"contrast\",\"saturate\",\"opacity\"]);xYt=/\\b([a-z-]*)\\(.*?\\)/gu,p6={...ka,getAnimatableNone:e=>{let t=e.match(xYt);return t?t.map(bYt).join(\" \"):e}}});var m6,dQ=Et(()=>{N0();m6={...ka,getAnimatableNone:e=>{let t=ka.parse(e);return ka.createTransformer(e)(t.map(i=>typeof i==\"number\"?0:typeof i==\"object\"?{...i,alpha:1}:i))}}});var fQ,Fbt=Et(()=>{O1();fQ={...L0,transform:Math.round}});var Nbt,zbt=Et(()=>{O1();zb();Nbt={rotate:F0,rotateX:F0,rotateY:F0,rotateZ:F0,scale:o6,scaleX:o6,scaleY:o6,scaleZ:o6,skew:F0,skewX:F0,skewY:F0,distance:xr,translateX:xr,translateY:xr,translateZ:xr,x:xr,y:xr,z:xr,perspective:xr,transformPerspective:xr,opacity:Kg,originX:AK,originY:AK,originZ:xr}});var M4,ZB=Et(()=>{Fbt();O1();zb();zbt();M4={borderWidth:xr,borderTopWidth:xr,borderRightWidth:xr,borderBottomWidth:xr,borderLeftWidth:xr,borderRadius:xr,borderTopLeftRadius:xr,borderTopRightRadius:xr,borderBottomRightRadius:xr,borderBottomLeftRadius:xr,width:xr,maxWidth:xr,height:xr,maxHeight:xr,top:xr,right:xr,bottom:xr,left:xr,inset:xr,insetBlock:xr,insetBlockStart:xr,insetBlockEnd:xr,insetInline:xr,insetInlineStart:xr,insetInlineEnd:xr,padding:xr,paddingTop:xr,paddingRight:xr,paddingBottom:xr,paddingLeft:xr,paddingBlock:xr,paddingBlockStart:xr,paddingBlockEnd:xr,paddingInline:xr,paddingInlineStart:xr,paddingInlineEnd:xr,margin:xr,marginTop:xr,marginRight:xr,marginBottom:xr,marginLeft:xr,marginBlock:xr,marginBlockStart:xr,marginBlockEnd:xr,marginInline:xr,marginInlineStart:xr,marginInlineEnd:xr,fontSize:xr,backgroundPositionX:xr,backgroundPositionY:xr,...Nbt,zIndex:fQ,fillOpacity:Kg,strokeOpacity:Kg,numOctaves:fQ}});var wYt,KB,pQ=Et(()=>{l6();hQ();dQ();ZB();wYt={...M4,color:Wo,backgroundColor:Wo,outlineColor:Wo,fill:Wo,stroke:Wo,borderColor:Wo,borderTopColor:Wo,borderRightColor:Wo,borderBottomColor:Wo,borderLeftColor:Wo,filter:p6,WebkitFilter:p6,mask:m6,WebkitMask:m6},KB=e=>wYt[e]});function QB(e,t){let r=KB(e);return TYt.has(r)||(r=ka),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var TYt,mQ=Et(()=>{N0();hQ();dQ();pQ();TYt=new Set([p6,m6])});function Ubt(e,t,r){let i=0,n;for(;i<e.length&&!n;){let o=e[i];typeof o==\"string\"&&!SYt.has(o)&&N1(o).values.length&&(n=e[i]),i++}if(n&&r)for(let o of t)e[o]=QB(r,n)}var SYt,Vbt=Et(()=>{N0();mQ();SYt=new Set([\"auto\",\"none\",\"0\"])});var JB,jbt=Et(()=>{rQ();uQ();hbt();g4();RB();Bbt();Vbt();FK();JB=class extends V1{constructor(t,r,i,n,o){super(t,r,i,n,o,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:i}=this;if(!r||!r.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let w=t[g];if(typeof w==\"string\"&&(w=w.trim(),m4(w))){let C=tQ(w,r.current);C!==void 0&&(t[g]=C),g===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!GB.has(i)||t.length!==2)return;let[n,o]=t,s=cQ(n),a=cQ(o),h=pK(n),p=pK(o);if(h!==p&&Jg[i]){this.needsMeasurement=!0;return}if(s!==a)if(BK(s)&&BK(a))for(let g=0;g<t.length;g++){let w=t[g];typeof w==\"string\"&&(t[g]=parseFloat(w))}else Jg[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,i=[];for(let n=0;n<t.length;n++)(t[n]===null||Lbt(t[n]))&&i.push(n);i.length&&Ubt(t,i,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:i}=this;if(!t||!t.current)return;i===\"height\"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jg[i](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let n=r[r.length-1];n!==void 0&&t.getValue(i,n).jump(n,!1)}measureEndState(){let{element:t,name:r,unresolvedKeyframes:i}=this;if(!t||!t.current)return;let n=t.getValue(r);n&&n.jump(this.measuredOrigin,!1);let o=i.length-1,s=i[o];i[o]=Jg[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,h])=>{t.getValue(a).set(h)}),this.resolveNoneKeyframes()}}});function $bt(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==\"string\"){let i=document;t&&(i=t.current);let n=r?.[e]??i.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e).filter(i=>i!=null)}var Gbt=Et(()=>{});var tF,gQ=Et(()=>{tF=(e,t)=>t&&typeof e==\"number\"?t.transform(e):e});function Hb(e){return tK(e)&&\"offsetHeight\"in e&&!(\"ownerSVGElement\"in e)}var AQ=Et(()=>{mn()});var Wbt,nXe,qbt=Et(()=>{dK();({schedule:Wbt,cancel:nXe}=fB(queueMicrotask,!1))});function eF(){return Hbt.x||Hbt.y}var Hbt,yQ=Et(()=>{Hbt={x:!1,y:!1}});function rF(e,t){let r=$bt(e),i=new AbortController,n={passive:!0,...t,signal:i.signal};return[r,n,()=>i.abort()]}var _Q=Et(()=>{Gbt()});function MYt(e){return!(e.pointerType===\"touch\"||eF())}function vQ(e,t,r={}){let[i,n,o]=rF(e,r);return i.forEach(s=>{let a=!1,h=!1,p,g=()=>{s.removeEventListener(\"pointerleave\",z)},w=Y=>{p&&(p(Y),p=void 0),g()},C=Y=>{a=!1,window.removeEventListener(\"pointerup\",C),window.removeEventListener(\"pointercancel\",C),h&&(h=!1,w(Y))},R=()=>{a=!0,window.addEventListener(\"pointerup\",C,n),window.addEventListener(\"pointercancel\",C,n)},z=Y=>{if(Y.pointerType!==\"touch\"){if(a){h=!0;return}w(Y)}},W=Y=>{if(!MYt(Y))return;h=!1;let H=t(s,Y);typeof H==\"function\"&&(p=H,s.addEventListener(\"pointerleave\",z,n))};s.addEventListener(\"pointerenter\",W,n),s.addEventListener(\"pointerdown\",R,n)}),o}var Ybt=Et(()=>{yQ();_Q()});var bQ,Xbt=Et(()=>{bQ=(e,t)=>t?e===t?!0:bQ(e,t.parentElement):!1});var Zbt,Kbt=Et(()=>{Zbt=e=>e.pointerType===\"mouse\"?typeof e.button!=\"number\"||e.button<=0:e.isPrimary!==!1});function Qbt(e){return EYt.has(e.tagName)||e.isContentEditable===!0}var EYt,Jbt=Et(()=>{EYt=new Set([\"BUTTON\",\"INPUT\",\"SELECT\",\"TEXTAREA\",\"A\"])});var E4,xQ=Et(()=>{E4=new WeakSet});function txt(e){return t=>{t.key===\"Enter\"&&e(t)}}function wQ(e,t){e.dispatchEvent(new PointerEvent(\"pointer\"+t,{isPrimary:!0,bubbles:!0}))}var ext,rxt=Et(()=>{xQ();ext=(e,t)=>{let r=e.currentTarget;if(!r)return;let i=txt(()=>{if(E4.has(r))return;wQ(r,\"down\");let n=txt(()=>{wQ(r,\"up\")}),o=()=>wQ(r,\"cancel\");r.addEventListener(\"keyup\",n,t),r.addEventListener(\"blur\",o,t)});r.addEventListener(\"keydown\",i,t),r.addEventListener(\"blur\",()=>r.removeEventListener(\"keydown\",i),t)}});function ixt(e){return Zbt(e)&&!eF()}function TQ(e,t,r={}){let[i,n,o]=rF(e,r),s=a=>{let h=a.currentTarget;if(!ixt(a)||nxt.has(a))return;E4.add(h),r.stopPropagation&&nxt.add(a);let p=t(h,a),g=(R,z)=>{window.removeEventListener(\"pointerup\",w),window.removeEventListener(\"pointercancel\",C),E4.has(h)&&E4.delete(h),ixt(R)&&typeof p==\"function\"&&p(R,{success:z})},w=R=>{g(R,h===window||h===document||r.useGlobalTarget||bQ(h,R.target))},C=R=>{g(R,!1)};window.addEventListener(\"pointerup\",w,n),window.addEventListener(\"pointercancel\",C,n)};return i.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener(\"pointerdown\",s,n),Hb(a)&&(a.addEventListener(\"focus\",p=>ext(p,n)),!Qbt(a)&&!a.hasAttribute(\"tabindex\")&&(a.tabIndex=0))}),o}var nxt,oxt=Et(()=>{AQ();yQ();Xbt();Kbt();_Q();Jbt();rxt();xQ();nxt=new WeakSet});var PYt,sxt,axt=Et(()=>{l6();N0();uQ();aQ();PYt=[...lQ,Wo,ka],sxt=e=>PYt.find(XB(e))});var lxt,iF,SQ=Et(()=>{lxt=()=>({min:0,max:0}),iF=()=>({x:lxt(),y:lxt()})});var cxt,uxt=Et(()=>{cxt=new WeakMap});function eA(e){return e!==null&&typeof e==\"object\"&&typeof e.start==\"function\"}var nF=Et(()=>{});function V0(e){return typeof e==\"string\"||Array.isArray(e)}var g6=Et(()=>{});var oF,A6,sF=Et(()=>{oF=[\"animate\",\"whileInView\",\"whileFocus\",\"whileHover\",\"whileTap\",\"whileDrag\",\"exit\"],A6=[\"initial\",...oF]});function j1(e){return eA(e.animate)||A6.some(t=>V0(e[t]))}function y6(e){return!!(j1(e)||e.variants)}var MQ=Et(()=>{nF();g6();sF()});function hxt(e,t,r){for(let i in t){let n=t[i],o=r[i];if(po(n))e.addValue(i,n);else if(po(o))e.addValue(i,qb(n,{owner:e}));else if(o!==n)if(e.hasValue(i)){let s=e.getValue(i);s.liveStyle===!0?s.jump(n):s.hasAnimated||s.set(n)}else{let s=e.getStaticValue(i);e.addValue(i,qb(s!==void 0?s:n,{owner:e}))}}for(let i in r)t[i]===void 0&&e.removeValue(i);return t}var dxt=Et(()=>{WB();tA()});var _6,aF,EQ=Et(()=>{_6={current:null},aF={current:!1}});function fxt(){if(aF.current=!0,!!CYt)if(window.matchMedia){let e=window.matchMedia(\"(prefers-reduced-motion)\"),t=()=>_6.current=e.matches;e.addEventListener(\"change\",t),t()}else _6.current=!1}var CYt,pxt=Et(()=>{EQ();CYt=typeof window<\"u\"});function b6(e){lF=e}function PQ(){return lF}var mxt,lF,v6,CQ=Et(()=>{mn();RB();YK();QK();qbt();Nb();SQ();WB();N0();mQ();axt();tA();uxt();MQ();tp();dxt();pxt();$B();EQ();Zg();mxt=[\"AnimationStart\",\"AnimationComplete\",\"Update\",\"BeforeLayoutMeasure\",\"LayoutMeasure\",\"LayoutAnimationStart\",\"LayoutAnimationComplete\"],lF={};v6=class{scrapeMotionValuesFromProps(t,r,i){return{}}constructor({parent:t,props:r,presenceContext:i,reducedMotionConfig:n,skipAnimations:o,blockInitialAnimation:s,visualState:a},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=V1,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(\"Update\",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let R=Ia.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,Ys.render(this.render,!1,!0))};let{latestValues:p,renderState:g}=a;this.latestValues=p,this.baseTarget={...p},this.initialValues=r.initial?{...p}:{},this.renderState=g,this.parent=t,this.props=r,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=o,this.options=h,this.blockInitialAnimation=!!s,this.isControllingVariants=j1(r),this.isVariantNode=y6(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:w,...C}=this.scrapeMotionValuesFromProps(r,{},this);for(let R in C){let z=C[R];p[R]!==void 0&&po(z)&&z.set(p[R])}}mount(t){if(this.hasBeenMounted)for(let r in this.initialValues)this.values.get(r)?.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=t,cxt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig===\"never\"?this.shouldReduceMotion=!1:this.reducedMotionConfig===\"always\"?this.shouldReduceMotion=!0:(aF.current||fxt(),this.shouldReduceMotion=_6.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),f4(this.notifyUpdate),f4(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&NB.has(t)&&this.current instanceof HTMLElement){let{factory:s,keyframes:a,times:h,ease:p,duration:g}=r.accelerate,w=new w4({element:this.current,name:t,keyframes:a,times:h,ease:p,duration:ol(g)}),C=s(w);this.valueSubscriptions.set(t,()=>{C(),w.cancel()});return}let i=Nd.has(t);i&&this.onBindTransform&&this.onBindTransform();let n=r.on(\"change\",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ys.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),o;typeof window<\"u\"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{n(),o&&o(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t=\"animation\";for(t in lF){let r=lF[t];if(!r)continue;let{isEnabled:i,Feature:n}=r;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(this)),this.features[t]){let o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):iF()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let i=0;i<mxt.length;i++){let n=mxt[i];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let o=\"on\"+n,s=t[o];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=hxt(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let i=this.values.get(t);r!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&r!==void 0&&(i=qb(r===null?void 0:r,{owner:this}),this.addValue(t,i)),i}readValue(t,r){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i==\"string\"&&(HC(i)||YC(i))?i=parseFloat(i):!sxt(i)&&ka.test(r)&&(i=QB(t,r)),this.setBaseTarget(t,po(i)?i.get():i)),po(i)?i.get():i}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){let{initial:r}=this.props,i;if(typeof r==\"string\"||typeof r==\"object\"){let o=Wb(this.props,r,this.presenceContext?.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!po(n)?n:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Bb),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){Wbt.render(this.render)}}});var P4,IQ=Et(()=>{tA();jbt();CQ();P4=class extends v6{constructor(){super(...arguments),this.KeyframeResolver=JB}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let i=t.style;return i?i[r]:void 0}removeValueFromRenderState(t,{vars:r,style:i}){delete r[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;po(t)&&(this.childSubscription=t.on(\"change\",r=>{this.current&&(this.current.textContent=`${r}`)}))}}});var Nc,gxt=Et(()=>{Nc=class{constructor(t){this.isMounted=!1,this.node=t}update(){}}});function Axt({top:e,left:t,right:r,bottom:i}){return{x:{min:t,max:r},y:{min:e,max:i}}}function yxt(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:i.y,right:i.x}}var _xt=Et(()=>{});function vxt(e,t){return Axt(yxt(e.getBoundingClientRect(),t))}var bxt=Et(()=>{_xt()});function xxt(e,t,r){let i=\"\",n=!0;for(let o=0;o<kYt;o++){let s=U0[o],a=e[s];if(a===void 0)continue;let h=!0;if(typeof a==\"number\")h=a===(s.startsWith(\"scale\")?1:0);else{let p=parseFloat(a);h=s.startsWith(\"scale\")?p===1:p===0}if(!h||r){let p=tF(a,M4[s]);if(!h){n=!1;let g=IYt[s]||s;i+=`${g}(${p}) `}r&&(t[s]=p)}}return i=i.trim(),r?i=r(t,n?\"\":i):n&&(i=\"none\"),i}var IYt,kYt,wxt=Et(()=>{gQ();ZB();tp();IYt={x:\"translateX\",y:\"translateY\",z:\"translateZ\",transformPerspective:\"perspective\"},kYt=U0.length});function Yb(e,t,r){let{style:i,vars:n,transformOrigin:o}=e,s=!1,a=!1;for(let h in t){let p=t[h];if(Nd.has(h)){s=!0;continue}else if(mB(h)){n[h]=p;continue}else{let g=tF(p,M4[h]);h.startsWith(\"origin\")?(a=!0,o[h]=g):i[h]=g}}if(t.transform||(s||r?i.transform=xxt(t,e.transform,r):i.transform&&(i.transform=\"none\")),a){let{originX:h=\"50%\",originY:p=\"50%\",originZ:g=0}=o;i.transformOrigin=`${h} ${p} ${g}`}}var cF=Et(()=>{gQ();ZB();tp();g4();wxt()});function uF(e,{style:t,vars:r},i,n){let o=e.style,s;for(s in t)o[s]=t[s];n?.applyProjectionStyles(o,i);for(s in r)o.setProperty(s,r[s])}var kQ=Et(()=>{});function Txt(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var C4,Sxt=Et(()=>{zb();C4={correct:(e,t)=>{if(!t.target)return e;if(typeof e==\"string\")if(xr.test(e))e=parseFloat(e);else return e;let r=Txt(e,t.target.x),i=Txt(e,t.target.y);return`${r}% ${i}%`}}});var Mxt,Ext=Et(()=>{N0();v4();Mxt={correct:(e,{treeScale:t,projectionDelta:r})=>{let i=e,n=ka.parse(e);if(n.length>5)return i;let o=ka.createTransformer(e),s=typeof n[0]!=\"number\"?1:0,a=r.x.scale*t.x,h=r.y.scale*t.y;n[0+s]/=a,n[1+s]/=h;let p=z0(a,h,.5);return typeof n[2+s]==\"number\"&&(n[2+s]/=p),typeof n[3+s]==\"number\"&&(n[3+s]/=p),o(n)}}});var Pxt,Cxt=Et(()=>{Sxt();Ext();Pxt={borderRadius:{...C4,applyTo:[\"borderTopLeftRadius\",\"borderTopRightRadius\",\"borderBottomLeftRadius\",\"borderBottomRightRadius\"]},borderTopLeftRadius:C4,borderTopRightRadius:C4,borderBottomLeftRadius:C4,borderBottomRightRadius:C4,boxShadow:Mxt}});function x6(e,{layout:t,layoutId:r}){return Nd.has(e)||e.startsWith(\"origin\")||(t||r!==void 0)&&(!!Pxt[e]||e===\"opacity\")}var RQ=Et(()=>{tp();Cxt()});function Xb(e,t,r){let i=e.style,n=t?.style,o={};if(!i)return o;for(let s in i)(po(i[s])||n&&po(n[s])||x6(s,e)||r?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}var hF=Et(()=>{tA();RQ()});function RYt(e){return window.getComputedStyle(e)}var w6,Ixt=Et(()=>{g4();tp();LK();bxt();IQ();cF();kQ();hF();w6=class extends P4{constructor(){super(...arguments),this.type=\"html\",this.renderInstance=uF}readValueFromInstance(t,r){if(Nd.has(r))return this.projection?.isProjecting?IB(r):Bvt(t,r);{let i=RYt(t),n=(mB(r)?i.getPropertyValue(r):i[r])||0;return typeof n==\"string\"?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:r}){return vxt(t,r)}build(t,r,i){Yb(t,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,r,i){return Xb(t,r,i)}}});function kxt(e,t,r=1,i=0,n=!0){e.pathLength=1;let o=n?DYt:OYt;e[o.offset]=`${-i}`,e[o.array]=`${t} ${r}`}var DYt,OYt,Rxt=Et(()=>{DYt={offset:\"stroke-dashoffset\",array:\"stroke-dasharray\"},OYt={offset:\"strokeDashoffset\",array:\"strokeDasharray\"}});function T6(e,{attrX:t,attrY:r,attrScale:i,pathLength:n,pathSpacing:o=1,pathOffset:s=0,...a},h,p,g){if(Yb(e,a,p),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:w,style:C}=e;w.transform&&(C.transform=w.transform,delete w.transform),(C.transform||w.transformOrigin)&&(C.transformOrigin=w.transformOrigin??\"50% 50%\",delete w.transformOrigin),C.transform&&(C.transformBox=g?.transformBox??\"fill-box\",delete w.transformBox);for(let R of LYt)w[R]!==void 0&&(C[R]=w[R],delete w[R]);t!==void 0&&(w.x=t),r!==void 0&&(w.y=r),i!==void 0&&(w.scale=i),n!==void 0&&kxt(w,n,o,s,!1)}var LYt,DQ=Et(()=>{cF();Rxt();LYt=[\"offsetDistance\",\"offsetPath\",\"offsetRotate\",\"offsetAnchor\"]});var dF,OQ=Et(()=>{dF=new Set([\"baseFrequency\",\"diffuseConstant\",\"kernelMatrix\",\"kernelUnitLength\",\"keySplines\",\"keyTimes\",\"limitingConeAngle\",\"markerHeight\",\"markerWidth\",\"numOctaves\",\"targetX\",\"targetY\",\"surfaceScale\",\"specularConstant\",\"specularExponent\",\"stdDeviation\",\"tableValues\",\"viewBox\",\"gradientTransform\",\"pathLength\",\"startOffset\",\"textLength\",\"lengthAdjust\"])});var S6,LQ=Et(()=>{S6=e=>typeof e==\"string\"&&e.toLowerCase()===\"svg\"});function Dxt(e,t,r,i){uF(e,t,void 0,i);for(let n in t.attrs)e.setAttribute(dF.has(n)?n:S4(n),t.attrs[n])}var Oxt=Et(()=>{qB();kQ();OQ()});function M6(e,t,r){let i=Xb(e,t,r);for(let n in e)if(po(e[n])||po(t[n])){let o=U0.indexOf(n)!==-1?\"attr\"+n.charAt(0).toUpperCase()+n.substring(1):n;i[o]=e[n]}return i}var BQ=Et(()=>{tA();tp();hF()});var E6,Lxt=Et(()=>{tp();pQ();SQ();IQ();qB();DQ();OQ();LQ();Oxt();BQ();E6=class extends P4{constructor(){super(...arguments),this.type=\"svg\",this.isSVGTag=!1,this.measureInstanceViewportBox=iF}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Nd.has(r)){let i=KB(r);return i&&i.default||0}return r=dF.has(r)?r:S4(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,i){return M6(t,r,i)}build(t,r,i){T6(t,r,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,r,i,n){Dxt(t,r,i,n)}mount(t){this.isSVGTag=S6(t.tagName),super.mount(t)}}});function FQ(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?FQ(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<BYt;r++){let i=A6[r],n=e.props[i];(V0(n)||n===!1)&&(t[i]=n)}return t}var BYt,Bxt=Et(()=>{g6();sF();BYt=A6.length});function NQ(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}var Fxt=Et(()=>{});function zYt(e){return t=>Promise.all(t.map(({animation:r,options:i})=>kbt(e,r,i)))}function zQ(e){let t=zYt(e),r=Nxt(),i=!0,n=!1,o=p=>(g,w)=>{let C=Ph(e,w,p===\"exit\"?e.presenceContext?.custom:void 0);if(C){let{transition:R,transitionEnd:z,...W}=C;g={...g,...W,...z}}return g};function s(p){t=p(e)}function a(p){let{props:g}=e,w=FQ(e.parent)||{},C=[],R=new Set,z={},W=1/0;for(let H=0;H<NYt;H++){let Q=FYt[H],tt=r[Q],rt=g[Q]!==void 0?g[Q]:w[Q],at=V0(rt),et=Q===p?tt.isActive:null;et===!1&&(W=H);let lt=rt===w[Q]&&rt!==g[Q]&&at;if(lt&&(i||n)&&e.manuallyAnimateOnMount&&(lt=!1),tt.protectedKeys={...z},!tt.isActive&&et===null||!rt&&!tt.prevProp||eA(rt)||typeof rt==\"boolean\")continue;if(Q===\"exit\"&&tt.isActive&&et!==!0){tt.prevResolvedValues&&(z={...z,...tt.prevResolvedValues});continue}let J=zxt(tt.prevProp,rt),ft=J||Q===p&&tt.isActive&&!lt&&at||H>W&&at,dt=!1,Mt=Array.isArray(rt)?rt:[rt],Ft=Mt.reduce(o(Q),{});et===!1&&(Ft={});let{prevResolvedValues:Nt={}}=tt,$t={...Nt,...Ft},Yt=we=>{ft=!0,R.has(we)&&(dt=!0,R.delete(we)),tt.needsAnimating[we]=!0;let Ue=e.getValue(we);Ue&&(Ue.liveStyle=!1)};for(let we in $t){let Ue=Ft[we],lr=Nt[we];if(z.hasOwnProperty(we))continue;let ee=!1;d6(Ue)&&d6(lr)?ee=!NQ(Ue,lr):ee=Ue!==lr,ee?Ue!=null?Yt(we):R.add(we):Ue!==void 0&&R.has(we)?Yt(we):tt.protectedKeys[we]=!0}tt.prevProp=rt,tt.prevResolvedValues=Ft,tt.isActive&&(z={...z,...Ft}),(i||n)&&e.blockInitialAnimation&&(ft=!1);let _e=lt&&J;ft&&(!_e||dt)&&C.push(...Mt.map(we=>{let Ue={type:Q};if(typeof we==\"string\"&&(i||n)&&!_e&&e.manuallyAnimateOnMount&&e.parent){let{parent:lr}=e,ee=Ph(lr,we);if(lr.enteringChildren&&ee){let{delayChildren:Ce}=ee.transition||{};Ue.delay=UB(lr.enteringChildren,e,Ce)}}return{animation:we,options:Ue}}))}if(R.size){let H={};if(typeof g.initial!=\"boolean\"){let Q=Ph(e,Array.isArray(g.initial)?g.initial[0]:g.initial);Q&&Q.transition&&(H.transition=Q.transition)}R.forEach(Q=>{let tt=e.getBaseTarget(Q),rt=e.getValue(Q);rt&&(rt.liveStyle=!0),H[Q]=tt??null}),C.push({animation:H})}let Y=!!C.length;return i&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(Y=!1),i=!1,n=!1,Y?t(C):Promise.resolve()}function h(p,g){if(r[p].isActive===g)return Promise.resolve();e.variantChildren?.forEach(C=>C.animationState?.setActive(p,g)),r[p].isActive=g;let w=a(p);for(let C in r)r[C].protectedKeys={};return w}return{animateChanges:a,setActive:h,setAnimateFunction:s,getState:()=>r,reset:()=>{r=Nxt(),n=!0}}}function zxt(e,t){return typeof t==\"string\"?t!==e:Array.isArray(t)?!NQ(t,e):!1}function Zb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nxt(){return{animate:Zb(!0),whileInView:Zb(),whileHover:Zb(),whileTap:Zb(),whileDrag:Zb(),whileFocus:Zb(),exit:Zb()}}var FYt,NYt,Uxt=Et(()=>{Rbt();JK();Bxt();nF();nQ();g6();T4();Fxt();sF();FYt=[...oF].reverse(),NYt=oF.length});function fF(e,t,r,i={passive:!0}){return e.addEventListener(t,r,i),()=>e.removeEventListener(t,r)}var Vxt=Et(()=>{});function UQ(e){return po(e)?e.get():e}var jxt=Et(()=>{tA()});var Ts=Et(()=>{VB();oQ();Ybt();oxt();AQ();tA();gxt();Ixt();Lxt();CQ();Uxt();nF();MQ();RQ();g6();T4();$B();Vxt();jxt();cF();hF();DQ();LQ();BQ();Zg()});var $xt,rA,P6=Et(()=>{\"use client\";$xt=xe(ze(),1),rA=(0,$xt.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:\"never\"})});function Gxt(e,t){if(typeof e==\"function\")return e(t);e!=null&&(e.current=t)}function UYt(...e){return t=>{let r=!1,i=e.map(n=>{let o=Gxt(n,t);return!r&&typeof o==\"function\"&&(r=!0),o});if(r)return()=>{for(let n=0;n<i.length;n++){let o=i[n];typeof o==\"function\"?o():Gxt(e[n],null)}}}}function qxt(...e){return Wxt.useCallback(UYt(...e),e)}var Wxt,Hxt=Et(()=>{Wxt=xe(ze(),1)});function Xxt({children:e,isPresent:t,anchorX:r,anchorY:i,root:n,pop:o}){let s=(0,iA.useId)(),a=(0,iA.useRef)(null),h=(0,iA.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:p}=(0,iA.useContext)(rA),g=e.props?.ref??e?.ref,w=qxt(a,g);return(0,iA.useInsertionEffect)(()=>{let{width:C,height:R,top:z,left:W,right:Y,bottom:H}=h.current;if(t||o===!1||!a.current||!C||!R)return;let Q=r===\"left\"?`left: ${W}`:`right: ${Y}`,tt=i===\"bottom\"?`bottom: ${H}`:`top: ${z}`;a.current.dataset.motionPopId=s;let rt=document.createElement(\"style\");p&&(rt.nonce=p);let at=n??document.head;return at.appendChild(rt),rt.sheet&&rt.sheet.insertRule(`\n          [data-motion-pop-id=\"${s}\"] {\n            position: absolute !important;\n            width: ${C}px !important;\n            height: ${R}px !important;\n            ${Q}px !important;\n            ${tt}px !important;\n          }\n        `),()=>{a.current?.removeAttribute(\"data-motion-pop-id\"),at.contains(rt)&&at.removeChild(rt)}},[t]),(0,Yxt.jsx)(VQ,{isPresent:t,childRef:a,sizeRef:h,pop:o,children:o===!1?e:pF.cloneElement(e,{ref:w})})}var Yxt,pF,iA,VQ,Zxt=Et(()=>{\"use client\";Yxt=xe(fo(),1);Ts();pF=xe(ze(),1),iA=xe(ze(),1);P6();Hxt();VQ=class extends pF.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(Hb(r)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let i=r.offsetParent,n=Hb(i)&&i.offsetWidth||0,o=Hb(i)&&i.offsetHeight||0,s=getComputedStyle(r),a=this.props.sizeRef.current;a.height=parseFloat(s.height),a.width=parseFloat(s.width),a.top=r.offsetTop,a.left=r.offsetLeft,a.right=n-a.width-a.left,a.bottom=o-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}});function VYt(){return new Map}var jQ,Kxt,C6,Qxt,Jxt=Et(()=>{\"use client\";jQ=xe(fo(),1),Kxt=xe(ze(),1),C6=xe(ze(),1);qC();WC();Zxt();Qxt=({children:e,initial:t,isPresent:r,onExitComplete:i,custom:n,presenceAffectsLayout:o,mode:s,anchorX:a,anchorY:h,root:p})=>{let g=k1(VYt),w=(0,C6.useId)(),C=!0,R=(0,C6.useMemo)(()=>(C=!1,{id:w,initial:t,isPresent:r,custom:n,onExitComplete:z=>{g.set(z,!0);for(let W of g.values())if(!W)return;i&&i()},register:z=>(g.set(z,!1),()=>g.delete(z))}),[r,g,i]);return o&&C&&(R={...R}),(0,C6.useMemo)(()=>{g.forEach((z,W)=>g.set(W,!1))},[r]),Kxt.useEffect(()=>{!r&&!g.size&&i&&i()},[r]),e=(0,jQ.jsx)(Xxt,{pop:s===\"popLayout\",isPresent:r,anchorX:a,anchorY:h,root:p,children:e}),(0,jQ.jsx)(R1.Provider,{value:R,children:e})}});function t2t(e=!0){let t=(0,$1.useContext)(R1);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:i,register:n}=t,o=(0,$1.useId)();(0,$1.useEffect)(()=>{if(e)return n(o)},[e]);let s=(0,$1.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!r&&i?[!1,s]:[!0]}var $1,e2t=Et(()=>{\"use client\";$1=xe(ze(),1);qC()});function $Q(e){let t=[];return mF.Children.forEach(e,r=>{(0,mF.isValidElement)(r)&&t.push(r)}),t}var mF,I6,r2t=Et(()=>{mF=xe(ze(),1),I6=e=>e.key||\"\"});var k6,ep,R6,i2t=Et(()=>{\"use client\";k6=xe(fo(),1),ep=xe(ze(),1);KZ();WC();QZ();Jxt();e2t();r2t();R6=({children:e,custom:t,initial:r=!0,onExitComplete:i,presenceAffectsLayout:n=!0,mode:o=\"sync\",propagate:s=!1,anchorX:a=\"left\",anchorY:h=\"top\",root:p})=>{let[g,w]=t2t(s),C=(0,ep.useMemo)(()=>$Q(e),[e]),R=s&&!g?[]:C.map(I6),z=(0,ep.useRef)(!0),W=(0,ep.useRef)(C),Y=k1(()=>new Map),H=(0,ep.useRef)(new Set),[Q,tt]=(0,ep.useState)(C),[rt,at]=(0,ep.useState)(C);oB(()=>{z.current=!1,W.current=C;for(let J=0;J<rt.length;J++){let ft=I6(rt[J]);R.includes(ft)?(Y.delete(ft),H.current.delete(ft)):Y.get(ft)!==!0&&Y.set(ft,!1)}},[rt,R.length,R.join(\"-\")]);let et=[];if(C!==Q){let J=[...C];for(let ft=0;ft<rt.length;ft++){let dt=rt[ft],Mt=I6(dt);R.includes(Mt)||(J.splice(ft,0,dt),et.push(dt))}return o===\"wait\"&&et.length&&(J=et),at($Q(J)),tt(C),null}let{forceRender:lt}=(0,ep.useContext)(iB);return(0,k6.jsx)(k6.Fragment,{children:rt.map(J=>{let ft=I6(J),dt=s&&!g?!1:C===rt||R.includes(ft),Mt=()=>{if(H.current.has(ft))return;if(Y.has(ft))H.current.add(ft),Y.set(ft,!0);else return;let Ft=!0;Y.forEach(Nt=>{Nt||(Ft=!1)}),Ft&&(lt?.(),at(W.current),s&&w?.(),i&&i())};return(0,k6.jsx)(Qxt,{isPresent:dt,initial:!z.current||r?void 0:!1,custom:t,presenceAffectsLayout:n,mode:o,root:p,onExitComplete:dt?void 0:Mt,anchorX:a,anchorY:h,children:J},ft)})})}});var n2t,I4,gF=Et(()=>{\"use client\";n2t=xe(ze(),1),I4=(0,n2t.createContext)({strict:!1})});function jYt(){if(s2t)return;let e={};for(let t in o2t)e[t]={isEnabled:r=>o2t[t].some(i=>!!r[i])};b6(e),s2t=!0}function AF(){return jYt(),PQ()}var o2t,s2t,GQ=Et(()=>{Ts();o2t={animation:[\"animate\",\"variants\",\"whileHover\",\"whileTap\",\"exit\",\"whileInView\",\"whileFocus\",\"whileDrag\"],exit:[\"exit\"],drag:[\"drag\",\"dragControls\"],focus:[\"whileFocus\"],hover:[\"whileHover\",\"onHoverStart\",\"onHoverEnd\"],tap:[\"whileTap\",\"onTap\",\"onTapStart\",\"onTapCancel\"],pan:[\"onPan\",\"onPanStart\",\"onPanSessionStart\",\"onPanEnd\"],inView:[\"whileInView\",\"onViewportEnter\",\"onViewportLeave\"],layout:[\"layout\",\"layoutId\"]},s2t=!1});function D6(e){let t=AF();for(let r in e)t[r]={...t[r],...e[r]};b6(t)}var WQ=Et(()=>{Ts();GQ()});function O6({children:e,features:t,strict:r=!1}){let[,i]=(0,k4.useState)(!qQ(t)),n=(0,k4.useRef)(void 0);if(!qQ(t)){let{renderer:o,...s}=t;n.current=o,D6(s)}return(0,k4.useEffect)(()=>{qQ(t)&&t().then(({renderer:o,...s})=>{D6(s),n.current=o,i(!0)})},[]),(0,a2t.jsx)(I4.Provider,{value:{renderer:n.current,strict:r},children:e})}function qQ(e){return typeof e==\"function\"}var a2t,k4,l2t=Et(()=>{\"use client\";a2t=xe(fo(),1),k4=xe(ze(),1);gF();WQ()});function L6(e){return e.startsWith(\"while\")||e.startsWith(\"drag\")&&e!==\"draggable\"||e.startsWith(\"layout\")||e.startsWith(\"onTap\")||e.startsWith(\"onPan\")||e.startsWith(\"onLayout\")||$Yt.has(e)}var $Yt,c2t=Et(()=>{$Yt=new Set([\"animate\",\"exit\",\"variants\",\"initial\",\"style\",\"values\",\"variants\",\"transition\",\"transformTemplate\",\"custom\",\"inherit\",\"onBeforeLayoutMeasure\",\"onAnimationStart\",\"onAnimationComplete\",\"onUpdate\",\"onDragStart\",\"onDrag\",\"onDragEnd\",\"onMeasureDragConstraints\",\"onDirectionLock\",\"onDragTransitionEnd\",\"_dragX\",\"_dragY\",\"onHoverStart\",\"onHoverEnd\",\"onViewportEnter\",\"onViewportLeave\",\"globalTapTarget\",\"propagate\",\"ignoreStrict\",\"viewport\"])});function HQ(e){typeof e==\"function\"&&(u2t=t=>t.startsWith(\"on\")?!L6(t):e(t))}function h2t(e,t,r){let i={};for(let n in e)n===\"values\"&&typeof e.values==\"object\"||po(e[n])||(u2t(n)||r===!0&&L6(n)||!t&&!L6(n)||e.draggable&&n.startsWith(\"onDrag\"))&&(i[n]=e[n]);return i}var u2t,YQ=Et(()=>{Ts();c2t();u2t=e=>!L6(e);try{HQ(BR(\"@emotion/is-prop-valid\").default)}catch{}});function XQ({children:e,isValidProp:t,...r}){t&&HQ(t);let i=(0,yF.useContext)(rA);r={...i,...r},r.transition=Gb(r.transition,i.transition),r.isStatic=k1(()=>r.isStatic);let n=(0,yF.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations]);return(0,d2t.jsx)(rA.Provider,{value:n,children:e})}var d2t,yF,f2t=Et(()=>{\"use client\";d2t=xe(fo(),1),yF=xe(ze(),1);Ts();P6();YQ();WC()});var p2t,G1,B6=Et(()=>{\"use client\";p2t=xe(ze(),1),G1=(0,p2t.createContext)({})});function m2t(e,t){if(j1(e)){let{initial:r,animate:i}=e;return{initial:r===!1||V0(r)?r:void 0,animate:V0(i)?i:void 0}}return e.inherit!==!1?t:{}}var g2t=Et(()=>{Ts()});function y2t(e){let{initial:t,animate:r}=m2t(e,(0,_F.useContext)(G1));return(0,_F.useMemo)(()=>({initial:t,animate:r}),[A2t(t),A2t(r)])}function A2t(e){return Array.isArray(e)?e.join(\" \"):e}var _F,_2t=Et(()=>{\"use client\";_F=xe(ze(),1);B6();g2t()});var R4,vF=Et(()=>{R4=()=>({style:{},transform:{},transformOrigin:{},vars:{}})});function ZQ(e,t,r){for(let i in t)!po(t[i])&&!x6(i,r)&&(e[i]=t[i])}function GYt({transformTemplate:e},t){return(0,v2t.useMemo)(()=>{let r=R4();return Yb(r,t,e),Object.assign({},r.vars,r.style)},[t])}function WYt(e,t){let r=e.style||{},i={};return ZQ(i,r,e),Object.assign(i,GYt(e,t)),i}function b2t(e,t){let r={},i=WYt(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout=\"none\",i.touchAction=e.drag===!0?\"none\":`pan-${e.drag===\"x\"?\"y\":\"x\"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}var v2t,KQ=Et(()=>{\"use client\";Ts();v2t=xe(ze(),1);vF()});var bF,QQ=Et(()=>{vF();bF=()=>({...R4(),attrs:{}})});function w2t(e,t,r,i){let n=(0,x2t.useMemo)(()=>{let o=bF();return T6(o,t,S6(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){let o={};ZQ(o,e.style,e),n.style={...o,...n.style}}return n}var x2t,T2t=Et(()=>{\"use client\";Ts();x2t=xe(ze(),1);KQ();QQ()});var S2t,M2t=Et(()=>{S2t=[\"animate\",\"circle\",\"defs\",\"desc\",\"ellipse\",\"g\",\"image\",\"line\",\"filter\",\"marker\",\"mask\",\"metadata\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"rect\",\"stop\",\"switch\",\"symbol\",\"svg\",\"text\",\"tspan\",\"use\",\"view\"]});function D4(e){return typeof e!=\"string\"||e.includes(\"-\")?!1:!!(S2t.indexOf(e)>-1||/[A-Z]/u.test(e))}var xF=Et(()=>{M2t()});function E2t(e,t,r,{latestValues:i},n,o=!1,s){let h=(s??D4(e)?w2t:b2t)(t,i,n,e),p=h2t(t,typeof e==\"string\",o),g=e!==O4.Fragment?{...p,...h,ref:r}:{},{children:w}=t,C=(0,O4.useMemo)(()=>po(w)?w.get():w,[w]);return(0,O4.createElement)(e,{...g,children:C})}var O4,P2t=Et(()=>{\"use client\";Ts();O4=xe(ze(),1);KQ();T2t();YQ();xF()});function qYt({scrapeMotionValuesFromProps:e,createRenderState:t},r,i,n){return{latestValues:HYt(r,i,n,e),renderState:t()}}function HYt(e,t,r,i){let n={},o=i(e,{});for(let C in o)n[C]=UQ(o[C]);let{initial:s,animate:a}=e,h=j1(e),p=y6(e);t&&p&&!h&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let g=r?r.initial===!1:!1;g=g||s===!1;let w=g?a:s;if(w&&typeof w!=\"boolean\"&&!eA(w)){let C=Array.isArray(w)?w:[w];for(let R=0;R<C.length;R++){let z=Wb(e,C[R]);if(z){let{transitionEnd:W,transition:Y,...H}=z;for(let Q in H){let tt=H[Q];if(Array.isArray(tt)){let rt=g?tt.length-1:0;tt=tt[rt]}tt!==null&&(n[Q]=tt)}for(let Q in W)n[Q]=W[Q]}}}return n}var JQ,wF,tJ=Et(()=>{\"use client\";Ts();JQ=xe(ze(),1);B6();qC();WC();wF=e=>(t,r)=>{let i=(0,JQ.useContext)(G1),n=(0,JQ.useContext)(R1),o=()=>qYt(e,t,i,n);return r?o():k1(o)}});var C2t,I2t=Et(()=>{\"use client\";Ts();tJ();vF();C2t=wF({scrapeMotionValuesFromProps:Xb,createRenderState:R4})});var k2t,R2t=Et(()=>{\"use client\";Ts();tJ();QQ();k2t=wF({scrapeMotionValuesFromProps:M6,createRenderState:bF})});var D2t,O2t=Et(()=>{D2t=Symbol.for(\"motionComponentSymbol\")});function L2t(e,t,r){let i=(0,Kb.useRef)(r);(0,Kb.useInsertionEffect)(()=>{i.current=r});let n=(0,Kb.useRef)(null);return(0,Kb.useCallback)(o=>{o&&e.onMount?.(o);let s=i.current;if(typeof s==\"function\")if(o){let a=s(o);typeof a==\"function\"&&(n.current=a)}else n.current?(n.current(),n.current=null):s(o);else s&&(s.current=o);t&&(o?t.mount(o):t.unmount())},[t])}var Kb,B2t=Et(()=>{\"use client\";Kb=xe(ze(),1)});var F2t,N2t,z2t=Et(()=>{\"use client\";F2t=xe(ze(),1),N2t=(0,F2t.createContext)({})});function U2t(e){return e&&typeof e==\"object\"&&Object.prototype.hasOwnProperty.call(e,\"current\")}var V2t=Et(()=>{});function j2t(e,t,r,i,n,o){let{visualElement:s}=(0,zc.useContext)(G1),a=(0,zc.useContext)(I4),h=(0,zc.useContext)(R1),p=(0,zc.useContext)(rA),g=p.reducedMotion,w=p.skipAnimations,C=(0,zc.useRef)(null),R=(0,zc.useRef)(!1);i=i||a.renderer,!C.current&&i&&(C.current=i(e,{visualState:t,parent:s,props:r,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g,skipAnimations:w,isSVG:o}),R.current&&C.current&&(C.current.manuallyAnimateOnMount=!0));let z=C.current,W=(0,zc.useContext)(N2t);z&&!z.projection&&n&&(z.type===\"html\"||z.type===\"svg\")&&YYt(C.current,r,n,W);let Y=(0,zc.useRef)(!1);(0,zc.useInsertionEffect)(()=>{z&&Y.current&&z.update(r,h)});let H=r[f6],Q=(0,zc.useRef)(!!H&&typeof window<\"u\"&&!window.MotionHandoffIsComplete?.(H)&&window.MotionHasOptimisedAnimation?.(H));return oB(()=>{R.current=!0,z&&(Y.current=!0,window.MotionIsMounted=!0,z.updateFeatures(),z.scheduleRenderMicrotask(),Q.current&&z.animationState&&z.animationState.animateChanges())}),(0,zc.useEffect)(()=>{z&&(!Q.current&&z.animationState&&z.animationState.animateChanges(),Q.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(H)}),Q.current=!1),z.enteringChildren=void 0)}),z}function YYt(e,t,r,i){let{layoutId:n,layout:o,drag:s,dragConstraints:a,layoutScroll:h,layoutRoot:p,layoutAnchor:g,layoutCrossfade:w}=t;e.projection=new r(e.latestValues,t[\"data-framer-portal-id\"]?void 0:$2t(e.parent)),e.projection.setOptions({layoutId:n,layout:o,alwaysMeasureLayout:!!s||a&&U2t(a),visualElement:e,animationType:typeof o==\"string\"?o:\"both\",initialPromotionConfig:i,crossfade:w,layoutScroll:h,layoutRoot:p,layoutAnchor:g})}function $2t(e){if(e)return e.options.allowProjection!==!1?e.projection:$2t(e.parent)}var zc,G2t=Et(()=>{\"use client\";Ts();zc=xe(ze(),1);gF();P6();B6();qC();z2t();V2t();QZ()});function SF(e,{forwardMotionProps:t=!1,type:r}={},i,n){i&&D6(i);let o=r?r===\"svg\":D4(e),s=o?k2t:C2t;function a(p,g){let w,C={...(0,L4.useContext)(rA),...p,layoutId:XYt(p)},{isStatic:R}=C,z=y2t(p),W=s(p,R);if(!R&&typeof window<\"u\"){ZYt(C,i);let Y=KYt(C);w=Y.MeasureLayout,z.visualElement=j2t(e,W,C,n,Y.ProjectionNode,o)}return(0,TF.jsxs)(G1.Provider,{value:z,children:[w&&z.visualElement?(0,TF.jsx)(w,{visualElement:z.visualElement,...C}):null,E2t(e,p,L2t(W,z.visualElement,g),W,R,t,o)]})}a.displayName=`motion.${typeof e==\"string\"?e:`create(${e.displayName??e.name??\"\"})`}`;let h=(0,L4.forwardRef)(a);return h[D2t]=e,h}function XYt({layoutId:e}){let t=(0,L4.useContext)(iB).id;return t&&e!==void 0?t+\"-\"+e:e}function ZYt(e,t){let r=(0,L4.useContext)(I4).strict}function KYt(e){let t=AF(),{drag:r,layout:i}=t;if(!r&&!i)return{};let n={...r,...i};return{MeasureLayout:r?.isEnabled(e)||i?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}var TF,L4,W2t=Et(()=>{\"use client\";TF=xe(fo(),1),L4=xe(ze(),1);KZ();gF();P6();B6();_2t();P2t();xF();I2t();R2t();GQ();WQ();O2t();B2t();G2t()});function q2t(e,t){if(typeof Proxy>\"u\")return SF;let r=new Map,i=(o,s)=>SF(o,s,e,t),n=(o,s)=>i(o,s);return new Proxy(n,{get:(o,s)=>s===\"create\"?i:(r.has(s)||r.set(s,SF(s,void 0,e,t)),r.get(s))})}var H2t=Et(()=>{W2t()});var F6,Y2t=Et(()=>{H2t();F6=q2t()});var X2t,Z2t,K2t=Et(()=>{Ts();X2t=xe(ze(),1);xF();Z2t=(e,t)=>t.isSVG??D4(e)?new E6(t):new w6(t,{allowProjection:e!==X2t.Fragment})});var MF,Q2t=Et(()=>{Ts();MF=class extends Nc{constructor(t){super(t),t.animationState||(t.animationState=zQ(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();eA(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}});var QYt,EF,J2t=Et(()=>{Ts();QYt=0,EF=class extends Nc{constructor(){super(...arguments),this.id=QYt++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){let{initial:o,custom:s}=this.node.getProps();if(typeof o==\"string\"){let a=Ph(this.node,o,s);if(a){let{transition:h,transitionEnd:p,...g}=a;for(let w in g)this.node.getValue(w)?.jump(g[w])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(\"exit\",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive(\"exit\",!t);r&&!t&&n.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}});var twt,ewt=Et(()=>{Q2t();J2t();twt={animation:{Feature:MF},exit:{Feature:EF}}});function PF(e){return{point:{x:e.pageX,y:e.pageY}}}var eJ=Et(()=>{});function rwt(e,t,r){let{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive(\"whileHover\",r===\"Start\");let n=\"onHover\"+r,o=i[n];o&&Ys.postRender(()=>o(t,PF(t)))}var CF,iwt=Et(()=>{Ts();eJ();CF=class extends Nc{mount(){let{current:t}=this.node;t&&(this.unmount=vQ(t,(r,i)=>(rwt(this.node,i,\"Start\"),n=>rwt(this.node,n,\"End\"))))}unmount(){}}});var IF,nwt=Et(()=>{Ts();mn();IF=class extends Nc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(\":focus-visible\")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive(\"whileFocus\",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(\"whileFocus\",!1),this.isActive=!1)}mount(){this.unmount=Xg(fF(this.node.current,\"focus\",()=>this.onFocus()),fF(this.node.current,\"blur\",()=>this.onBlur()))}unmount(){}}});function owt(e,t,r){let{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive(\"whileTap\",r===\"Start\");let n=\"onTap\"+(r===\"End\"?\"\":r),o=i[n];o&&Ys.postRender(()=>o(t,PF(t)))}var kF,swt=Et(()=>{Ts();eJ();kF=class extends Nc{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:i}=this.node.props;this.unmount=TQ(t,(n,o)=>(owt(this.node,o,\"Start\"),(s,{success:a})=>owt(this.node,s,a?\"End\":\"Cancel\")),{useGlobalTarget:r,stopPropagation:i?.tap===!1})}unmount(){}}});function eXt({root:e,...t}){let r=e||document;rJ.has(r)||rJ.set(r,{});let i=rJ.get(r),n=JSON.stringify(t);return i[n]||(i[n]=new IntersectionObserver(tXt,{root:e,...t})),i[n]}function awt(e,t,r){let i=eXt(t);return iJ.set(e,r),i.observe(e),()=>{iJ.delete(e),i.unobserve(e)}}var iJ,rJ,JYt,tXt,lwt=Et(()=>{iJ=new WeakMap,rJ=new WeakMap,JYt=e=>{let t=iJ.get(e.target);t&&t(e)},tXt=e=>{e.forEach(JYt)}});function iXt({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var rXt,RF,cwt=Et(()=>{Ts();lwt();rXt={some:0,all:1},RF=class extends Nc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:t={}}=this.node.getProps(),{root:r,margin:i,amount:n=\"some\",once:o}=t,s={root:r?r.current:void 0,rootMargin:i,threshold:typeof n==\"number\"?n:rXt[n]},a=h=>{let{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,o&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(\"whileInView\",p);let{onViewportEnter:g,onViewportLeave:w}=this.node.getProps(),C=p?g:w;C&&C(h)};this.stopObserver=awt(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>\"u\")return;let{props:t,prevProps:r}=this.node;[\"amount\",\"margin\",\"root\"].some(iXt(t,r))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}});var uwt,hwt=Et(()=>{iwt();nwt();swt();cwt();uwt={inView:{Feature:RF},tap:{Feature:kF},focus:{Feature:IF},hover:{Feature:CF}}});var nJ,dwt=Et(()=>{\"use client\";ewt();hwt();K2t();nJ={renderer:Z2t,...twt,...uwt}});var N6=Et(()=>{i2t();l2t();f2t();Y2t();Ts();dwt();mn();mn()});var SJ={};Ql(SJ,{default:()=>kXt});var kXt,MJ=Et(()=>{\"use client\";N6();kXt=nJ});var FJ=Nr((mnr,i3t)=>{var BXt=\"Expected a function\",e3t=NaN,FXt=\"[object Symbol]\",NXt=/^\\s+|\\s+$/g,zXt=/^[-+]0x[0-9a-f]+$/i,UXt=/^0b[01]+$/i,VXt=/^0o[0-7]+$/i,jXt=parseInt,$Xt=typeof global==\"object\"&&global&&global.Object===Object&&global,GXt=typeof self==\"object\"&&self&&self.Object===Object&&self,WXt=$Xt||GXt||Function(\"return this\")(),qXt=Object.prototype,HXt=qXt.toString,YXt=Math.max,XXt=Math.min,LJ=function(){return WXt.Date.now()};function ZXt(e,t,r){var i,n,o,s,a,h,p=0,g=!1,w=!1,C=!0;if(typeof e!=\"function\")throw new TypeError(BXt);t=r3t(t)||0,BJ(r)&&(g=!!r.leading,w=\"maxWait\"in r,o=w?YXt(r3t(r.maxWait)||0,t):o,C=\"trailing\"in r?!!r.trailing:C);function R(et){var lt=i,J=n;return i=n=void 0,p=et,s=e.apply(J,lt),s}function z(et){return p=et,a=setTimeout(H,t),g?R(et):s}function W(et){var lt=et-h,J=et-p,ft=t-lt;return w?XXt(ft,o-J):ft}function Y(et){var lt=et-h,J=et-p;return h===void 0||lt>=t||lt<0||w&&J>=o}function H(){var et=LJ();if(Y(et))return Q(et);a=setTimeout(H,W(et))}function Q(et){return a=void 0,C&&i?R(et):(i=n=void 0,s)}function tt(){a!==void 0&&clearTimeout(a),p=0,i=h=n=a=void 0}function rt(){return a===void 0?s:Q(LJ())}function at(){var et=LJ(),lt=Y(et);if(i=arguments,n=this,h=et,lt){if(a===void 0)return z(h);if(w)return a=setTimeout(H,t),R(h)}return a===void 0&&(a=setTimeout(H,t)),s}return at.cancel=tt,at.flush=rt,at}function BJ(e){var t=typeof e;return!!e&&(t==\"object\"||t==\"function\")}function KXt(e){return!!e&&typeof e==\"object\"}function QXt(e){return typeof e==\"symbol\"||KXt(e)&&HXt.call(e)==FXt}function r3t(e){if(typeof e==\"number\")return e;if(QXt(e))return e3t;if(BJ(e)){var t=typeof e.valueOf==\"function\"?e.valueOf():e;e=BJ(t)?t+\"\":t}if(typeof e!=\"string\")return e===0?e:+e;e=e.replace(NXt,\"\");var r=UXt.test(e);return r||VXt.test(e)?jXt(e.slice(2),r?2:8):zXt.test(e)?e3t:+e}i3t.exports=ZXt});var l3t=Nr((gnr,a3t)=>{var s3t=\"Expected a function\",n3t=NaN,JXt=\"[object Symbol]\",tZt=/^\\s+|\\s+$/g,eZt=/^[-+]0x[0-9a-f]+$/i,rZt=/^0b[01]+$/i,iZt=/^0o[0-7]+$/i,nZt=parseInt,oZt=typeof global==\"object\"&&global&&global.Object===Object&&global,sZt=typeof self==\"object\"&&self&&self.Object===Object&&self,aZt=oZt||sZt||Function(\"return this\")(),lZt=Object.prototype,cZt=lZt.toString,uZt=Math.max,hZt=Math.min,NJ=function(){return aZt.Date.now()};function dZt(e,t,r){var i,n,o,s,a,h,p=0,g=!1,w=!1,C=!0;if(typeof e!=\"function\")throw new TypeError(s3t);t=o3t(t)||0,WF(r)&&(g=!!r.leading,w=\"maxWait\"in r,o=w?uZt(o3t(r.maxWait)||0,t):o,C=\"trailing\"in r?!!r.trailing:C);function R(et){var lt=i,J=n;return i=n=void 0,p=et,s=e.apply(J,lt),s}function z(et){return p=et,a=setTimeout(H,t),g?R(et):s}function W(et){var lt=et-h,J=et-p,ft=t-lt;return w?hZt(ft,o-J):ft}function Y(et){var lt=et-h,J=et-p;return h===void 0||lt>=t||lt<0||w&&J>=o}function H(){var et=NJ();if(Y(et))return Q(et);a=setTimeout(H,W(et))}function Q(et){return a=void 0,C&&i?R(et):(i=n=void 0,s)}function tt(){a!==void 0&&clearTimeout(a),p=0,i=h=n=a=void 0}function rt(){return a===void 0?s:Q(NJ())}function at(){var et=NJ(),lt=Y(et);if(i=arguments,n=this,h=et,lt){if(a===void 0)return z(h);if(w)return a=setTimeout(H,t),R(h)}return a===void 0&&(a=setTimeout(H,t)),s}return at.cancel=tt,at.flush=rt,at}function fZt(e,t,r){var i=!0,n=!0;if(typeof e!=\"function\")throw new TypeError(s3t);return WF(r)&&(i=\"leading\"in r?!!r.leading:i,n=\"trailing\"in r?!!r.trailing:n),dZt(e,t,{leading:i,maxWait:t,trailing:n})}function WF(e){var t=typeof e;return!!e&&(t==\"object\"||t==\"function\")}function pZt(e){return!!e&&typeof e==\"object\"}function mZt(e){return typeof e==\"symbol\"||pZt(e)&&cZt.call(e)==JXt}function o3t(e){if(typeof e==\"number\")return e;if(mZt(e))return n3t;if(WF(e)){var t=typeof e.valueOf==\"function\"?e.valueOf():e;e=WF(t)?t+\"\":t}if(typeof e!=\"string\")return e===0?e:+e;e=e.replace(tZt,\"\");var r=rZt.test(e);return r||iZt.test(e)?nZt(e.slice(2),r?2:8):eZt.test(e)?n3t:+e}a3t.exports=fZt});var Pet=Nr((EMt,I8)=>{(function(e,t){typeof BR==\"function\"&&typeof I8==\"object\"&&I8&&I8.exports?I8.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(EMt,function(){\"use strict\";function e(ft,dt,Mt){this.low=ft|0,this.high=dt|0,this.unsigned=!!Mt}e.prototype.__isLong__,Object.defineProperty(e.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1});function t(ft){return(ft&&ft.__isLong__)===!0}e.isLong=t;var r={},i={};function n(ft,dt){var Mt,Ft,Nt;return dt?(ft>>>=0,(Nt=0<=ft&&ft<256)&&(Ft=i[ft],Ft)?Ft:(Mt=s(ft,(ft|0)<0?-1:0,!0),Nt&&(i[ft]=Mt),Mt)):(ft|=0,(Nt=-128<=ft&&ft<128)&&(Ft=r[ft],Ft)?Ft:(Mt=s(ft,ft<0?-1:0,!1),Nt&&(r[ft]=Mt),Mt))}e.fromInt=n;function o(ft,dt){if(isNaN(ft)||!isFinite(ft))return dt?H:Y;if(dt){if(ft<0)return H;if(ft>=R)return et}else{if(ft<=-z)return lt;if(ft+1>=z)return at}return ft<0?o(-ft,dt).neg():s(ft%C|0,ft/C|0,dt)}e.fromNumber=o;function s(ft,dt,Mt){return new e(ft,dt,Mt)}e.fromBits=s;var a=Math.pow;function h(ft,dt,Mt){if(ft.length===0)throw Error(\"empty string\");if(ft===\"NaN\"||ft===\"Infinity\"||ft===\"+Infinity\"||ft===\"-Infinity\")return Y;if(typeof dt==\"number\"?(Mt=dt,dt=!1):dt=!!dt,Mt=Mt||10,Mt<2||36<Mt)throw RangeError(\"radix\");var Ft;if((Ft=ft.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(Ft===0)return h(ft.substring(1),dt,Mt).neg();for(var Nt=o(a(Mt,8)),$t=Y,Yt=0;Yt<ft.length;Yt+=8){var _e=Math.min(8,ft.length-Yt),Pe=parseInt(ft.substring(Yt,Yt+_e),Mt);if(_e<8){var we=o(a(Mt,_e));$t=$t.mul(we).add(o(Pe))}else $t=$t.mul(Nt),$t=$t.add(o(Pe))}return $t.unsigned=dt,$t}e.fromString=h;function p(ft){return ft instanceof e?ft:typeof ft==\"number\"?o(ft):typeof ft==\"string\"?h(ft):s(ft.low,ft.high,ft.unsigned)}e.fromValue=p;var g=65536,w=1<<24,C=g*g,R=C*C,z=R/2,W=n(w),Y=n(0);e.ZERO=Y;var H=n(0,!0);e.UZERO=H;var Q=n(1);e.ONE=Q;var tt=n(1,!0);e.UONE=tt;var rt=n(-1);e.NEG_ONE=rt;var at=s(-1,2147483647,!1);e.MAX_VALUE=at;var et=s(-1,-1,!0);e.MAX_UNSIGNED_VALUE=et;var lt=s(0,-2147483648,!1);e.MIN_VALUE=lt;var J=e.prototype;return J.toInt=function(){return this.unsigned?this.low>>>0:this.low},J.toNumber=function(){return this.unsigned?(this.high>>>0)*C+(this.low>>>0):this.high*C+(this.low>>>0)},J.toString=function(dt){if(dt=dt||10,dt<2||36<dt)throw RangeError(\"radix\");if(this.isZero())return\"0\";if(this.isNegative())if(this.eq(lt)){var Mt=o(dt),Ft=this.div(Mt),Nt=Ft.mul(Mt).sub(this);return Ft.toString(dt)+Nt.toInt().toString(dt)}else return\"-\"+this.neg().toString(dt);for(var $t=o(a(dt,6),this.unsigned),Yt=this,_e=\"\";;){var Pe=Yt.div($t),we=Yt.sub(Pe.mul($t)).toInt()>>>0,Ue=we.toString(dt);if(Yt=Pe,Yt.isZero())return Ue+_e;for(;Ue.length<6;)Ue=\"0\"+Ue;_e=\"\"+Ue+_e}},J.getHighBits=function(){return this.high},J.getHighBitsUnsigned=function(){return this.high>>>0},J.getLowBits=function(){return this.low},J.getLowBitsUnsigned=function(){return this.low>>>0},J.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lt)?64:this.neg().getNumBitsAbs();for(var dt=this.high!=0?this.high:this.low,Mt=31;Mt>0&&(dt&1<<Mt)==0;Mt--);return this.high!=0?Mt+33:Mt+1},J.isZero=function(){return this.high===0&&this.low===0},J.isNegative=function(){return!this.unsigned&&this.high<0},J.isPositive=function(){return this.unsigned||this.high>=0},J.isOdd=function(){return(this.low&1)===1},J.isEven=function(){return(this.low&1)===0},J.equals=function(dt){return t(dt)||(dt=p(dt)),this.unsigned!==dt.unsigned&&this.high>>>31===1&&dt.high>>>31===1?!1:this.high===dt.high&&this.low===dt.low},J.eq=J.equals,J.notEquals=function(dt){return!this.eq(dt)},J.neq=J.notEquals,J.lessThan=function(dt){return this.comp(dt)<0},J.lt=J.lessThan,J.lessThanOrEqual=function(dt){return this.comp(dt)<=0},J.lte=J.lessThanOrEqual,J.greaterThan=function(dt){return this.comp(dt)>0},J.gt=J.greaterThan,J.greaterThanOrEqual=function(dt){return this.comp(dt)>=0},J.gte=J.greaterThanOrEqual,J.compare=function(dt){if(t(dt)||(dt=p(dt)),this.eq(dt))return 0;var Mt=this.isNegative(),Ft=dt.isNegative();return Mt&&!Ft?-1:!Mt&&Ft?1:this.unsigned?dt.high>>>0>this.high>>>0||dt.high===this.high&&dt.low>>>0>this.low>>>0?-1:1:this.sub(dt).isNegative()?-1:1},J.comp=J.compare,J.negate=function(){return!this.unsigned&&this.eq(lt)?lt:this.not().add(Q)},J.neg=J.negate,J.add=function(dt){t(dt)||(dt=p(dt));var Mt=this.high>>>16,Ft=this.high&65535,Nt=this.low>>>16,$t=this.low&65535,Yt=dt.high>>>16,_e=dt.high&65535,Pe=dt.low>>>16,we=dt.low&65535,Ue=0,lr=0,ee=0,Ce=0;return Ce+=$t+we,ee+=Ce>>>16,Ce&=65535,ee+=Nt+Pe,lr+=ee>>>16,ee&=65535,lr+=Ft+_e,Ue+=lr>>>16,lr&=65535,Ue+=Mt+Yt,Ue&=65535,s(ee<<16|Ce,Ue<<16|lr,this.unsigned)},J.subtract=function(dt){return t(dt)||(dt=p(dt)),this.add(dt.neg())},J.sub=J.subtract,J.multiply=function(dt){if(this.isZero()||(t(dt)||(dt=p(dt)),dt.isZero()))return Y;if(this.eq(lt))return dt.isOdd()?lt:Y;if(dt.eq(lt))return this.isOdd()?lt:Y;if(this.isNegative())return dt.isNegative()?this.neg().mul(dt.neg()):this.neg().mul(dt).neg();if(dt.isNegative())return this.mul(dt.neg()).neg();if(this.lt(W)&&dt.lt(W))return o(this.toNumber()*dt.toNumber(),this.unsigned);var Mt=this.high>>>16,Ft=this.high&65535,Nt=this.low>>>16,$t=this.low&65535,Yt=dt.high>>>16,_e=dt.high&65535,Pe=dt.low>>>16,we=dt.low&65535,Ue=0,lr=0,ee=0,Ce=0;return Ce+=$t*we,ee+=Ce>>>16,Ce&=65535,ee+=Nt*we,lr+=ee>>>16,ee&=65535,ee+=$t*Pe,lr+=ee>>>16,ee&=65535,lr+=Ft*we,Ue+=lr>>>16,lr&=65535,lr+=Nt*Pe,Ue+=lr>>>16,lr&=65535,lr+=$t*_e,Ue+=lr>>>16,lr&=65535,Ue+=Mt*we+Ft*Pe+Nt*_e+$t*Yt,Ue&=65535,s(ee<<16|Ce,Ue<<16|lr,this.unsigned)},J.mul=J.multiply,J.divide=function(dt){if(t(dt)||(dt=p(dt)),dt.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?H:Y;var Mt,Ft,Nt;if(this.unsigned){if(dt.unsigned||(dt=dt.toUnsigned()),dt.gt(this))return H;if(dt.gt(this.shru(1)))return tt;Nt=H}else{if(this.eq(lt)){if(dt.eq(Q)||dt.eq(rt))return lt;if(dt.eq(lt))return Q;var $t=this.shr(1);return Mt=$t.div(dt).shl(1),Mt.eq(Y)?dt.isNegative()?Q:rt:(Ft=this.sub(dt.mul(Mt)),Nt=Mt.add(Ft.div(dt)),Nt)}else if(dt.eq(lt))return this.unsigned?H:Y;if(this.isNegative())return dt.isNegative()?this.neg().div(dt.neg()):this.neg().div(dt).neg();if(dt.isNegative())return this.div(dt.neg()).neg();Nt=Y}for(Ft=this;Ft.gte(dt);){Mt=Math.max(1,Math.floor(Ft.toNumber()/dt.toNumber()));for(var Yt=Math.ceil(Math.log(Mt)/Math.LN2),_e=Yt<=48?1:a(2,Yt-48),Pe=o(Mt),we=Pe.mul(dt);we.isNegative()||we.gt(Ft);)Mt-=_e,Pe=o(Mt,this.unsigned),we=Pe.mul(dt);Pe.isZero()&&(Pe=Q),Nt=Nt.add(Pe),Ft=Ft.sub(we)}return Nt},J.div=J.divide,J.modulo=function(dt){return t(dt)||(dt=p(dt)),this.sub(this.div(dt).mul(dt))},J.mod=J.modulo,J.not=function(){return s(~this.low,~this.high,this.unsigned)},J.and=function(dt){return t(dt)||(dt=p(dt)),s(this.low&dt.low,this.high&dt.high,this.unsigned)},J.or=function(dt){return t(dt)||(dt=p(dt)),s(this.low|dt.low,this.high|dt.high,this.unsigned)},J.xor=function(dt){return t(dt)||(dt=p(dt)),s(this.low^dt.low,this.high^dt.high,this.unsigned)},J.shiftLeft=function(dt){return t(dt)&&(dt=dt.toInt()),(dt&=63)===0?this:dt<32?s(this.low<<dt,this.high<<dt|this.low>>>32-dt,this.unsigned):s(0,this.low<<dt-32,this.unsigned)},J.shl=J.shiftLeft,J.shiftRight=function(dt){return t(dt)&&(dt=dt.toInt()),(dt&=63)===0?this:dt<32?s(this.low>>>dt|this.high<<32-dt,this.high>>dt,this.unsigned):s(this.high>>dt-32,this.high>=0?0:-1,this.unsigned)},J.shr=J.shiftRight,J.shiftRightUnsigned=function(dt){if(t(dt)&&(dt=dt.toInt()),dt&=63,dt===0)return this;var Mt=this.high;if(dt<32){var Ft=this.low;return s(Ft>>>dt|Mt<<32-dt,Mt>>>dt,this.unsigned)}else return dt===32?s(Mt,0,this.unsigned):s(Mt>>>dt-32,0,this.unsigned)},J.shru=J.shiftRightUnsigned,J.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},J.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},J.toBytes=function(ft){return ft?this.toBytesLE():this.toBytesBE()},J.toBytesLE=function(){var ft=this.high,dt=this.low;return[dt&255,dt>>>8&255,dt>>>16&255,dt>>>24&255,ft&255,ft>>>8&255,ft>>>16&255,ft>>>24&255]},J.toBytesBE=function(){var ft=this.high,dt=this.low;return[ft>>>24&255,ft>>>16&255,ft>>>8&255,ft&255,dt>>>24&255,dt>>>16&255,dt>>>8&255,dt&255]},e})});var Art=Nr(gS=>{\"use strict\";Object.defineProperty(gS,\"__esModule\",{value:!0});gS.DefaultSerializer=gS.extendSerializer=void 0;function ihe(e,t){let r=e.deserialize.bind(e),i=e.serialize.bind(e);return{deserialize(n){return t.deserialize(n,r)},serialize(n){return t.serialize(n,i)}}}gS.extendSerializer=ihe;var oPt={deserialize(e){return Object.assign(Error(e.message),{name:e.name,stack:e.stack})},serialize(e){return{__error_marker:\"$$error\",message:e.message,name:e.name,stack:e.stack}}},nhe=e=>e&&typeof e==\"object\"&&\"__error_marker\"in e&&e.__error_marker===\"$$error\";gS.DefaultSerializer={deserialize(e){return nhe(e)?oPt.deserialize(e):e},serialize(e){return e instanceof Error?oPt.serialize(e):e}}});var AS=Nr(A_=>{\"use strict\";Object.defineProperty(A_,\"__esModule\",{value:!0});A_.serialize=A_.deserialize=A_.registerSerializer=void 0;var sPt=Art(),dU=sPt.DefaultSerializer;function ohe(e){dU=sPt.extendSerializer(dU,e)}A_.registerSerializer=ohe;function she(e){return dU.deserialize(e)}A_.deserialize=she;function ahe(e){return dU.serialize(e)}A_.serialize=ahe});var lPt=Nr(yS=>{\"use strict\";Object.defineProperty(yS,\"__esModule\",{value:!0});yS.getBundleURL=yS.getBaseURL=void 0;var yrt;function lhe(){return yrt||(yrt=che()),yrt}yS.getBundleURL=lhe;function che(){try{throw new Error}catch(e){let t=(\"\"+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);if(t)return aPt(t[0])}return\"/\"}function aPt(e){return(\"\"+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)?\\/[^/]+(?:\\?.*)?$/,\"$1\")+\"/\"}yS.getBaseURL=aPt});var vrt=Nr(y_=>{\"use strict\";Object.defineProperty(y_,\"__esModule\",{value:!0});y_.isWorkerRuntime=y_.getWorkerImplementation=y_.defaultPoolSize=void 0;var cPt=lPt();y_.defaultPoolSize=typeof navigator<\"u\"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;var uPt=e=>/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(e);function hPt(e){let t=new Blob([e],{type:\"application/javascript\"});return URL.createObjectURL(t)}function uhe(){if(typeof Worker>\"u\")return class{constructor(){throw Error(\"No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.\")}};class e extends Worker{constructor(i,n){var o,s;typeof i==\"string\"&&n&&n._baseURL?i=new URL(i,n._baseURL):typeof i==\"string\"&&!uPt(i)&&cPt.getBundleURL().match(/^file:\\/\\//i)&&(i=new URL(i,cPt.getBundleURL().replace(/\\/[^\\/]+$/,\"/\")),(!((o=n?.CORSWorkaround)!==null&&o!==void 0)||o)&&(i=hPt(`importScripts(${JSON.stringify(i)});`))),typeof i==\"string\"&&uPt(i)&&(!((s=n?.CORSWorkaround)!==null&&s!==void 0)||s)&&(i=hPt(`importScripts(${JSON.stringify(i)});`)),super(i,n)}}class t extends e{constructor(i,n){let o=window.URL.createObjectURL(i);super(o,n)}static fromText(i,n){let o=new window.Blob([i],{type:\"text/javascript\"});return new t(o,n)}}return{blob:t,default:e}}var _rt;function hhe(){return _rt||(_rt=uhe()),_rt}y_.getWorkerImplementation=hhe;function dhe(){let e=typeof self<\"u\"&&typeof Window<\"u\"&&self instanceof Window;return!!(typeof self<\"u\"&&self.postMessage&&!e)}y_.isWorkerRuntime=dhe});var fPt=Nr((v1r,dPt)=>{var _S=1e3,vS=_S*60,bS=vS*60,Ux=bS*24,fhe=Ux*7,phe=Ux*365.25;dPt.exports=function(e,t){t=t||{};var r=typeof e;if(r===\"string\"&&e.length>0)return mhe(e);if(r===\"number\"&&isFinite(e))return t.long?Ahe(e):ghe(e);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(e))};function mhe(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),i=(t[2]||\"ms\").toLowerCase();switch(i){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return r*phe;case\"weeks\":case\"week\":case\"w\":return r*fhe;case\"days\":case\"day\":case\"d\":return r*Ux;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return r*bS;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return r*vS;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return r*_S;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return r;default:return}}}}function ghe(e){var t=Math.abs(e);return t>=Ux?Math.round(e/Ux)+\"d\":t>=bS?Math.round(e/bS)+\"h\":t>=vS?Math.round(e/vS)+\"m\":t>=_S?Math.round(e/_S)+\"s\":e+\"ms\"}function Ahe(e){var t=Math.abs(e);return t>=Ux?fU(e,t,Ux,\"day\"):t>=bS?fU(e,t,bS,\"hour\"):t>=vS?fU(e,t,vS,\"minute\"):t>=_S?fU(e,t,_S,\"second\"):e+\" ms\"}function fU(e,t,r,i){var n=t>=r*1.5;return Math.round(e/r)+\" \"+i+(n?\"s\":\"\")}});var mPt=Nr((b1r,pPt)=>{function yhe(e){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=n,r.enabled=a,r.humanize=fPt(),r.destroy=p,Object.keys(e).forEach(g=>{r[g]=e[g]}),r.names=[],r.skips=[],r.formatters={};function t(g){let w=0;for(let C=0;C<g.length;C++)w=(w<<5)-w+g.charCodeAt(C),w|=0;return r.colors[Math.abs(w)%r.colors.length]}r.selectColor=t;function r(g){let w,C=null,R,z;function W(...Y){if(!W.enabled)return;let H=W,Q=Number(new Date),tt=Q-(w||Q);H.diff=tt,H.prev=w,H.curr=Q,w=Q,Y[0]=r.coerce(Y[0]),typeof Y[0]!=\"string\"&&Y.unshift(\"%O\");let rt=0;Y[0]=Y[0].replace(/%([a-zA-Z%])/g,(et,lt)=>{if(et===\"%%\")return\"%\";rt++;let J=r.formatters[lt];if(typeof J==\"function\"){let ft=Y[rt];et=J.call(H,ft),Y.splice(rt,1),rt--}return et}),r.formatArgs.call(H,Y),(H.log||r.log).apply(H,Y)}return W.namespace=g,W.useColors=r.useColors(),W.color=r.selectColor(g),W.extend=i,W.destroy=r.destroy,Object.defineProperty(W,\"enabled\",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(R!==r.namespaces&&(R=r.namespaces,z=r.enabled(g)),z),set:Y=>{C=Y}}),typeof r.init==\"function\"&&r.init(W),W}function i(g,w){let C=r(this.namespace+(typeof w>\"u\"?\":\":w)+g);return C.log=this.log,C}function n(g){r.save(g),r.namespaces=g,r.names=[],r.skips=[];let w=(typeof g==\"string\"?g:\"\").trim().replace(/\\s+/g,\",\").split(\",\").filter(Boolean);for(let C of w)C[0]===\"-\"?r.skips.push(C.slice(1)):r.names.push(C)}function o(g,w){let C=0,R=0,z=-1,W=0;for(;C<g.length;)if(R<w.length&&(w[R]===g[C]||w[R]===\"*\"))w[R]===\"*\"?(z=R,W=C,R++):(C++,R++);else if(z!==-1)R=z+1,W++,C=W;else return!1;for(;R<w.length&&w[R]===\"*\";)R++;return R===w.length}function s(){let g=[...r.names,...r.skips.map(w=>\"-\"+w)].join(\",\");return r.enable(\"\"),g}function a(g){for(let w of r.skips)if(o(g,w))return!1;for(let w of r.names)if(o(g,w))return!0;return!1}function h(g){return g instanceof Error?g.stack||g.message:g}function p(){console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\")}return r.enable(r.load()),r}pPt.exports=yhe});var mU=Nr((Bu,pU)=>{Bu.formatArgs=vhe;Bu.save=bhe;Bu.load=xhe;Bu.useColors=_he;Bu.storage=whe();Bu.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})();Bu.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"];function _he(){if(typeof window<\"u\"&&window.process&&(window.process.type===\"renderer\"||window.process.__nwjs))return!0;if(typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))return!1;let e;return typeof document<\"u\"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<\"u\"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<\"u\"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)}function vhe(e){if(e[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+e[0]+(this.useColors?\"%c \":\" \")+\"+\"+pU.exports.humanize(this.diff),!this.useColors)return;let t=\"color: \"+this.color;e.splice(1,0,t,\"color: inherit\");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,n=>{n!==\"%%\"&&(r++,n===\"%c\"&&(i=r))}),e.splice(i,0,t)}Bu.log=console.debug||console.log||(()=>{});function bhe(e){try{e?Bu.storage.setItem(\"debug\",e):Bu.storage.removeItem(\"debug\")}catch{}}function xhe(){let e;try{e=Bu.storage.getItem(\"debug\")||Bu.storage.getItem(\"DEBUG\")}catch{}return!e&&typeof process<\"u\"&&\"env\"in process&&(e=process.env.DEBUG),e}function whe(){try{return localStorage}catch{}}pU.exports=mPt()(Bu);var{formatters:The}=pU.exports;The.j=function(e){try{return JSON.stringify(e)}catch(t){return\"[UnexpectedJSONParseError]: \"+t.message}}});var gk=Nr(xS=>{\"use strict\";var She=xS&&xS.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(xS,\"__esModule\",{value:!0});xS.AsyncSerialScheduler=void 0;var brt=class{constructor(t){this._baseObserver=t,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(t=>this._baseObserver.error(t))}error(t){this._baseObserver.error(t)}schedule(t){let r=Promise.all(this._pendingPromises),i=[],n=s=>i.push(s),o=Promise.resolve().then(()=>She(this,void 0,void 0,function*(){yield r,yield t(n),this._pendingPromises.delete(o);for(let s of i)this._baseObserver.next(s)})).catch(s=>{this._pendingPromises.delete(o),this._baseObserver.error(s)});this._pendingPromises.add(o)}};xS.AsyncSerialScheduler=brt});var APt=Nr(gPt=>{\"use strict\";Object.defineProperty(gPt,\"__esModule\",{value:!0})});var xrt=Nr(Yc=>{\"use strict\";Object.defineProperty(Yc,\"__esModule\",{value:!0});Yc.registerObservableSymbol=Yc.getSymbol=Yc.hasSymbol=Yc.hasSymbols=void 0;var Mhe=()=>typeof Symbol==\"function\";Yc.hasSymbols=Mhe;var Ehe=e=>Yc.hasSymbols()&&!!Symbol[e];Yc.hasSymbol=Ehe;var Phe=e=>Yc.hasSymbol(e)?Symbol[e]:\"@@\"+e;Yc.getSymbol=Phe;function Che(){Yc.hasSymbols()&&!Yc.hasSymbol(\"observable\")&&(Symbol.observable=Symbol(\"observable\"))}Yc.registerObservableSymbol=Che;Yc.hasSymbol(\"asyncIterator\")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for(\"Symbol.asyncIterator\"))});var um=Nr(EA=>{\"use strict\";Object.defineProperty(EA,\"__esModule\",{value:!0});EA.Observable=EA.SubscriptionObserver=EA.Subscription=void 0;APt();var yk=xrt(),Ihe=yk.getSymbol(\"iterator\"),Trt=yk.getSymbol(\"observable\"),yPt=yk.getSymbol(\"species\");function AU(e,t){let r=e[t];if(r!=null){if(typeof r!=\"function\")throw new TypeError(r+\" is not a function\");return r}}function Ak(e){let t=e.constructor;return t!==void 0&&(t=t[yPt],t===null&&(t=void 0)),t!==void 0?t:Vx}function khe(e){return e instanceof Vx}function wS(e){wS.log?wS.log(e):setTimeout(()=>{throw e},0)}function gU(e){Promise.resolve().then(()=>{try{e()}catch(t){wS(t)}})}function _Pt(e){let t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t==\"function\")t();else{let r=AU(t,\"unsubscribe\");r&&r.call(t)}}catch(r){wS(r)}}function Srt(e){e._observer=void 0,e._queue=void 0,e._state=\"closed\"}function Rhe(e){let t=e._queue;if(t){e._queue=void 0,e._state=\"ready\";for(let r of t)if(vPt(e,r.type,r.value),e._state===\"closed\")break}}function vPt(e,t,r){e._state=\"running\";let i=e._observer;try{let n=i?AU(i,t):void 0;switch(t){case\"next\":n&&n.call(i,r);break;case\"error\":if(Srt(e),n)n.call(i,r);else throw r;break;case\"complete\":Srt(e),n&&n.call(i);break}}catch(n){wS(n)}e._state===\"closed\"?_Pt(e):e._state===\"running\"&&(e._state=\"ready\")}function wrt(e,t,r){if(e._state!==\"closed\"){if(e._state===\"buffering\"){e._queue=e._queue||[],e._queue.push({type:t,value:r});return}if(e._state!==\"ready\"){e._state=\"buffering\",e._queue=[{type:t,value:r}],gU(()=>Rhe(e));return}vPt(e,t,r)}}var yU=class{constructor(t,r){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state=\"initializing\";let i=new _U(this);try{this._cleanup=r.call(void 0,i)}catch(n){i.error(n)}this._state===\"initializing\"&&(this._state=\"ready\")}get closed(){return this._state===\"closed\"}unsubscribe(){this._state!==\"closed\"&&(Srt(this),_Pt(this))}};EA.Subscription=yU;var _U=class{constructor(t){this._subscription=t}get closed(){return this._subscription._state===\"closed\"}next(t){wrt(this._subscription,\"next\",t)}error(t){wrt(this._subscription,\"error\",t)}complete(){wrt(this._subscription,\"complete\")}};EA.SubscriptionObserver=_U;var Vx=class e{constructor(t){if(!(this instanceof e))throw new TypeError(\"Observable cannot be called as a function\");if(typeof t!=\"function\")throw new TypeError(\"Observable initializer must be a function\");this._subscriber=t}subscribe(t,r,i){return(typeof t!=\"object\"||t===null)&&(t={next:t,error:r,complete:i}),new yU(t,this._subscriber)}pipe(t,...r){let i=this;for(let n of[t,...r])i=n(i);return i}tap(t,r,i){let n=typeof t!=\"object\"||t===null?{next:t,error:r,complete:i}:t;return new e(o=>this.subscribe({next(s){n.next&&n.next(s),o.next(s)},error(s){n.error&&n.error(s),o.error(s)},complete(){n.complete&&n.complete(),o.complete()},start(s){n.start&&n.start(s)}}))}forEach(t){return new Promise((r,i)=>{if(typeof t!=\"function\"){i(new TypeError(t+\" is not a function\"));return}function n(){o.unsubscribe(),r(void 0)}let o=this.subscribe({next(s){try{t(s,n)}catch(a){i(a),o.unsubscribe()}},error(s){i(s)},complete(){r(void 0)}})})}map(t){if(typeof t!=\"function\")throw new TypeError(t+\" is not a function\");let r=Ak(this);return new r(i=>this.subscribe({next(n){let o=n;try{o=t(n)}catch(s){return i.error(s)}i.next(o)},error(n){i.error(n)},complete(){i.complete()}}))}filter(t){if(typeof t!=\"function\")throw new TypeError(t+\" is not a function\");let r=Ak(this);return new r(i=>this.subscribe({next(n){try{if(!t(n))return}catch(o){return i.error(o)}i.next(n)},error(n){i.error(n)},complete(){i.complete()}}))}reduce(t,r){if(typeof t!=\"function\")throw new TypeError(t+\" is not a function\");let i=Ak(this),n=arguments.length>1,o=!1,s=r;return new i(a=>this.subscribe({next(h){let p=!o;if(o=!0,!p||n)try{s=t(s,h)}catch(g){return a.error(g)}else s=h},error(h){a.error(h)},complete(){if(!o&&!n)return a.error(new TypeError(\"Cannot reduce an empty sequence\"));a.next(s),a.complete()}}))}concat(...t){let r=Ak(this);return new r(i=>{let n,o=0;function s(a){n=a.subscribe({next(h){i.next(h)},error(h){i.error(h)},complete(){o===t.length?(n=void 0,i.complete()):s(r.from(t[o++]))}})}return s(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(t){if(typeof t!=\"function\")throw new TypeError(t+\" is not a function\");let r=Ak(this);return new r(i=>{let n=[],o=this.subscribe({next(a){let h;if(t)try{h=t(a)}catch(g){return i.error(g)}else h=a;let p=r.from(h).subscribe({next(g){i.next(g)},error(g){i.error(g)},complete(){let g=n.indexOf(p);g>=0&&n.splice(g,1),s()}});n.push(p)},error(a){i.error(a)},complete(){s()}});function s(){o.closed&&n.length===0&&i.complete()}return()=>{n.forEach(a=>a.unsubscribe()),o.unsubscribe()}})}[(Symbol.observable,Trt)](){return this}static from(t){let r=typeof this==\"function\"?this:e;if(t==null)throw new TypeError(t+\" is not an object\");let i=AU(t,Trt);if(i){let n=i.call(t);if(Object(n)!==n)throw new TypeError(n+\" is not an object\");return khe(n)&&n.constructor===r?n:new r(o=>n.subscribe(o))}if(yk.hasSymbol(\"iterator\")){let n=AU(t,Ihe);if(n)return new r(o=>{gU(()=>{if(!o.closed){for(let s of n.call(t))if(o.next(s),o.closed)return;o.complete()}})})}if(Array.isArray(t))return new r(n=>{gU(()=>{if(!n.closed){for(let o of t)if(n.next(o),n.closed)return;n.complete()}})});throw new TypeError(t+\" is not observable\")}static of(...t){let r=typeof this==\"function\"?this:e;return new r(i=>{gU(()=>{if(!i.closed){for(let n of t)if(i.next(n),i.closed)return;i.complete()}})})}static get[yPt](){return this}};EA.Observable=Vx;yk.hasSymbols()&&Object.defineProperty(Vx,Symbol(\"extensions\"),{value:{symbol:Trt,hostReportError:wS},configurable:!0});EA.default=Vx});var __=Nr(Mrt=>{\"use strict\";Object.defineProperty(Mrt,\"__esModule\",{value:!0});function Dhe(e){typeof e==\"function\"?e():e&&typeof e.unsubscribe==\"function\"&&e.unsubscribe()}Mrt.default=Dhe});var bPt=Nr(_k=>{\"use strict\";var Ohe=_k&&_k.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(_k,\"__esModule\",{value:!0});var Lhe=gk(),Bhe=um(),Fhe=__();function Nhe(e){return t=>new Bhe.default(r=>{let i=new Lhe.AsyncSerialScheduler(r),n=t.subscribe({complete(){i.complete()},error(o){i.error(o)},next(o){i.schedule(s=>Ohe(this,void 0,void 0,function*(){(yield e(o))&&s(o)}))}});return()=>Fhe.default(n)})}_k.default=Nhe});var wPt=Nr(TS=>{\"use strict\";Object.defineProperty(TS,\"__esModule\",{value:!0});TS.isIterator=TS.isAsyncIterator=void 0;var xPt=xrt();function zhe(e){return e&&xPt.hasSymbol(\"asyncIterator\")&&e[Symbol.asyncIterator]}TS.isAsyncIterator=zhe;function Uhe(e){return e&&xPt.hasSymbol(\"iterator\")&&e[Symbol.iterator]}TS.isIterator=Uhe});var SPt=Nr(jx=>{\"use strict\";var Vhe=jx&&jx.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})},jhe=jx&&jx.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==\"function\"?__values(e):e[Symbol.iterator](),r={},i(\"next\"),i(\"throw\"),i(\"return\"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(s){return new Promise(function(a,h){s=e[o](s),n(a,h,s.done,s.value)})}}function n(o,s,a,h){Promise.resolve(h).then(function(p){o({value:p,done:a})},s)}};Object.defineProperty(jx,\"__esModule\",{value:!0});var $he=gk(),TPt=wPt(),Ghe=um(),Whe=__();function qhe(e){return t=>new Ghe.default(r=>{let i=new $he.AsyncSerialScheduler(r),n=t.subscribe({complete(){i.complete()},error(o){i.error(o)},next(o){i.schedule(s=>Vhe(this,void 0,void 0,function*(){var a,h;let p=yield e(o);if(TPt.isIterator(p)||TPt.isAsyncIterator(p))try{for(var g=jhe(p),w;w=yield g.next(),!w.done;){let C=w.value;s(C)}}catch(C){a={error:C}}finally{try{w&&!w.done&&(h=g.return)&&(yield h.call(g))}finally{if(a)throw a.error}}else p.map(C=>s(C))}))}});return()=>Whe.default(n)})}jx.default=qhe});var MPt=Nr(Ert=>{\"use strict\";Object.defineProperty(Ert,\"__esModule\",{value:!0});var Hhe=um();function Yhe(e){return new Hhe.Observable(t=>{let r=0,i=setInterval(()=>{t.next(r++)},e);return()=>clearInterval(i)})}Ert.default=Yhe});var EPt=Nr(vk=>{\"use strict\";var Xhe=vk&&vk.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(vk,\"__esModule\",{value:!0});var Zhe=gk(),Khe=um(),Qhe=__();function Jhe(e){return t=>new Khe.default(r=>{let i=new Zhe.AsyncSerialScheduler(r),n=t.subscribe({complete(){i.complete()},error(o){i.error(o)},next(o){i.schedule(s=>Xhe(this,void 0,void 0,function*(){let a=yield e(o);s(a)}))}});return()=>Qhe.default(n)})}vk.default=Jhe});var CPt=Nr(Prt=>{\"use strict\";Object.defineProperty(Prt,\"__esModule\",{value:!0});var PPt=um(),tde=__();function ede(...e){return e.length===0?PPt.Observable.from([]):new PPt.Observable(t=>{let r=0,i=e.map(o=>o.subscribe({error(s){t.error(s),n()},next(s){t.next(s)},complete(){++r===e.length&&(t.complete(),n())}})),n=()=>{i.forEach(o=>tde.default(o))};return n})}Prt.default=ede});var krt=Nr(Irt=>{\"use strict\";Object.defineProperty(Irt,\"__esModule\",{value:!0});var rde=um(),Crt=class extends rde.default{constructor(){super(t=>(this._observers.add(t),()=>this._observers.delete(t))),this._observers=new Set}next(t){for(let r of this._observers)r.next(t)}error(t){for(let r of this._observers)r.error(t)}complete(){for(let t of this._observers)t.complete()}};Irt.default=Crt});var IPt=Nr(Rrt=>{\"use strict\";Object.defineProperty(Rrt,\"__esModule\",{value:!0});var ide=um(),nde=krt(),ode=__();function sde(e){let t=new nde.default,r,i=0;return new ide.default(n=>{r||(r=e.subscribe(t));let o=t.subscribe(n);return i++,()=>{i--,o.unsubscribe(),i===0&&(ode.default(r),r=void 0)}})}Rrt.default=sde});var kPt=Nr(bk=>{\"use strict\";var ade=bk&&bk.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(bk,\"__esModule\",{value:!0});var lde=gk(),cde=um(),ude=__();function hde(e,t){return r=>new cde.default(i=>{let n,o=0,s=new lde.AsyncSerialScheduler(i),a=r.subscribe({complete(){s.complete()},error(h){s.error(h)},next(h){s.schedule(p=>ade(this,void 0,void 0,function*(){n=yield e(o===0?typeof t>\"u\"?h:t:n,h,o++),p(n)}))}});return()=>ude.default(a)})}bk.default=hde});var RPt=Nr(ks=>{\"use strict\";Object.defineProperty(ks,\"__esModule\",{value:!0});ks.unsubscribe=ks.Subject=ks.scan=ks.Observable=ks.multicast=ks.merge=ks.map=ks.interval=ks.flatMap=ks.filter=void 0;var dde=bPt();Object.defineProperty(ks,\"filter\",{enumerable:!0,get:function(){return dde.default}});var fde=SPt();Object.defineProperty(ks,\"flatMap\",{enumerable:!0,get:function(){return fde.default}});var pde=MPt();Object.defineProperty(ks,\"interval\",{enumerable:!0,get:function(){return pde.default}});var mde=EPt();Object.defineProperty(ks,\"map\",{enumerable:!0,get:function(){return mde.default}});var gde=CPt();Object.defineProperty(ks,\"merge\",{enumerable:!0,get:function(){return gde.default}});var Ade=IPt();Object.defineProperty(ks,\"multicast\",{enumerable:!0,get:function(){return Ade.default}});var yde=um();Object.defineProperty(ks,\"Observable\",{enumerable:!0,get:function(){return yde.default}});var _de=kPt();Object.defineProperty(ks,\"scan\",{enumerable:!0,get:function(){return _de.default}});var vde=krt();Object.defineProperty(ks,\"Subject\",{enumerable:!0,get:function(){return vde.default}});var bde=__();Object.defineProperty(ks,\"unsubscribe\",{enumerable:!0,get:function(){return bde.default}})});var xk=Nr((F1r,DPt)=>{DPt.exports=RPt()});var OPt=Nr(vU=>{\"use strict\";Object.defineProperty(vU,\"__esModule\",{value:!0});vU.allSettled=void 0;function xde(e){return Promise.all(e.map(t=>{let r=o=>({status:\"fulfilled\",value:o}),i=o=>({status:\"rejected\",reason:o}),n=Promise.resolve(t);try{return n.then(r,i)}catch(o){return Promise.reject(o)}}))}vU.allSettled=xde});var LPt=Nr(wk=>{\"use strict\";Object.defineProperty(wk,\"__esModule\",{value:!0});wk.PoolEventType=void 0;var wde;(function(e){e.initialized=\"initialized\",e.taskCanceled=\"taskCanceled\",e.taskCompleted=\"taskCompleted\",e.taskFailed=\"taskFailed\",e.taskQueued=\"taskQueued\",e.taskQueueDrained=\"taskQueueDrained\",e.taskStart=\"taskStart\",e.terminated=\"terminated\"})(wde=wk.PoolEventType||(wk.PoolEventType={}))});var Tk=Nr(rf=>{\"use strict\";Object.defineProperty(rf,\"__esModule\",{value:!0});rf.$worker=rf.$transferable=rf.$terminate=rf.$events=rf.$errors=void 0;rf.$errors=Symbol(\"thread.errors\");rf.$events=Symbol(\"thread.events\");rf.$terminate=Symbol(\"thread.terminate\");rf.$transferable=Symbol(\"thread.transferable\");rf.$worker=Symbol(\"thread.worker\")});var Ort=Nr(bU=>{\"use strict\";Object.defineProperty(bU,\"__esModule\",{value:!0});bU.Thread=void 0;var Drt=Tk();function BPt(e){throw Error(e)}bU.Thread={errors(e){return e[Drt.$errors]||BPt(\"Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\")},events(e){return e[Drt.$events]||BPt(\"Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\")},terminate(e){return e[Drt.$terminate]()}}});var UPt=Nr(nf=>{\"use strict\";var $x=nf&&nf.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})},Tde=nf&&nf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nf,\"__esModule\",{value:!0});nf.Pool=nf.Thread=nf.PoolEventType=void 0;var Sde=Tde(mU()),Lrt=xk(),FPt=OPt(),Mde=vrt(),ul=LPt();Object.defineProperty(nf,\"PoolEventType\",{enumerable:!0,get:function(){return ul.PoolEventType}});var NPt=Ort();Object.defineProperty(nf,\"Thread\",{enumerable:!0,get:function(){return NPt.Thread}});var Ede=1;function Pde(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t}function Cde(e){return new Promise(t=>setTimeout(t,e))}function Ide(e,t){return e.reduce((r,i)=>[...r,...t(i)],[])}function kde(e){return e.replace(/\\W/g,\" \").trim().replace(/\\s+/g,\"-\")}function Rde(e,t){return Pde(t).map(()=>({init:e(),runningTasks:[]}))}var xU=class{constructor(t,r){this.eventSubject=new Lrt.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];let i=typeof r==\"number\"?{size:r}:r||{},{size:n=Mde.defaultPoolSize}=i;this.debug=Sde.default(`threads:pool:${kde(i.name||String(Ede++))}`),this.options=i,this.workers=Rde(t,n),this.eventObservable=Lrt.multicast(Lrt.Observable.from(this.eventSubject)),Promise.all(this.workers.map(o=>o.init)).then(()=>this.eventSubject.next({type:ul.PoolEventType.initialized,size:this.workers.length}),o=>{this.debug(\"Error while initializing pool worker:\",o),this.eventSubject.error(o),this.initErrors.push(o)})}findIdlingWorker(){let{concurrency:t=1}=this.options;return this.workers.find(r=>r.runningTasks.length<t)}runPoolTask(t,r){return $x(this,void 0,void 0,function*(){let i=this.workers.indexOf(t)+1;this.debug(`Running task #${r.id} on worker #${i}...`),this.eventSubject.next({type:ul.PoolEventType.taskStart,taskID:r.id,workerID:i});try{let n=yield r.run(yield t.init);this.debug(`Task #${r.id} completed successfully`),this.eventSubject.next({type:ul.PoolEventType.taskCompleted,returnValue:n,taskID:r.id,workerID:i})}catch(n){this.debug(`Task #${r.id} failed`),this.eventSubject.next({type:ul.PoolEventType.taskFailed,taskID:r.id,error:n,workerID:i})}})}run(t,r){return $x(this,void 0,void 0,function*(){let i=$x(this,void 0,void 0,function*(){let n=()=>{t.runningTasks=t.runningTasks.filter(o=>o!==i)};yield Cde(0);try{yield this.runPoolTask(t,r)}finally{n(),this.isClosing||this.scheduleWork()}});t.runningTasks.push(i)})}scheduleWork(){this.debug(\"Attempt de-queueing a task in order to run it...\");let t=this.findIdlingWorker();if(!t)return;let r=this.taskQueue.shift();if(!r){this.debug(\"Task queue is empty\"),this.eventSubject.next({type:ul.PoolEventType.taskQueueDrained});return}this.run(t,r)}taskCompletion(t){return new Promise((r,i)=>{let n=this.events().subscribe(o=>{o.type===ul.PoolEventType.taskCompleted&&o.taskID===t?(n.unsubscribe(),r(o.returnValue)):o.type===ul.PoolEventType.taskFailed&&o.taskID===t?(n.unsubscribe(),i(o.error)):o.type===ul.PoolEventType.terminated&&(n.unsubscribe(),i(Error(\"Pool has been terminated before task was run.\")))})})}settled(t=!1){return $x(this,void 0,void 0,function*(){let r=()=>Ide(this.workers,o=>o.runningTasks),i=[],n=this.eventObservable.subscribe(o=>{o.type===ul.PoolEventType.taskFailed&&i.push(o.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&this.taskQueue.length===0?(yield FPt.allSettled(r()),i):(yield new Promise((o,s)=>{let a=this.eventObservable.subscribe({next(h){h.type===ul.PoolEventType.taskQueueDrained&&(a.unsubscribe(),o(void 0))},error:s})}),yield FPt.allSettled(r()),n.unsubscribe(),i)})}completed(t=!1){return $x(this,void 0,void 0,function*(){let r=this.settled(t),i=new Promise((o,s)=>{let a=this.eventObservable.subscribe({next(h){h.type===ul.PoolEventType.taskQueueDrained?(a.unsubscribe(),o(r)):h.type===ul.PoolEventType.taskFailed&&(a.unsubscribe(),s(h.error))},error:s})}),n=yield Promise.race([r,i]);if(n.length>0)throw n[0]})}events(){return this.eventObservable}queue(t){let{maxQueuedJobs:r=1/0}=this.options;if(this.isClosing)throw Error(\"Cannot schedule pool tasks after terminate() has been called.\");if(this.initErrors.length>0)throw this.initErrors[0];let i=this.nextTaskID++,n=this.taskCompletion(i);n.catch(s=>{this.debug(`Task #${i} errored:`,s)});let o={id:i,run:t,cancel:()=>{this.taskQueue.indexOf(o)!==-1&&(this.taskQueue=this.taskQueue.filter(s=>s!==o),this.eventSubject.next({type:ul.PoolEventType.taskCanceled,taskID:o.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=r)throw Error(`Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.`);return this.debug(`Queueing task #${o.id}...`),this.taskQueue.push(o),this.eventSubject.next({type:ul.PoolEventType.taskQueued,taskID:o.id}),this.scheduleWork(),o}terminate(t){return $x(this,void 0,void 0,function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:ul.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(r=>$x(this,void 0,void 0,function*(){return NPt.Thread.terminate(yield r.init)})))})}};xU.EventType=ul.PoolEventType;function zPt(e,t){return new xU(e,t)}zPt.EventType=ul.PoolEventType;nf.Pool=zPt});var VPt=Nr(wU=>{\"use strict\";Object.defineProperty(wU,\"__esModule\",{value:!0});wU.createPromiseWithResolver=void 0;var Dde=()=>{};function Ode(){let e=!1,t,r=Dde;return[new Promise(o=>{e?o(t):r=o}),o=>{e=!0,t=o,r(t)}]}wU.createPromiseWithResolver=Ode});var jPt=Nr(Sk=>{\"use strict\";Object.defineProperty(Sk,\"__esModule\",{value:!0});Sk.WorkerEventType=void 0;var G1r=Tk(),Lde;(function(e){e.internalError=\"internalError\",e.message=\"message\",e.termination=\"termination\"})(Lde=Sk.WorkerEventType||(Sk.WorkerEventType={}))});var GPt=Nr(TU=>{\"use strict\";Object.defineProperty(TU,\"__esModule\",{value:!0});TU.ObservablePromise=void 0;var Bde=xk(),Fde=()=>{},Nde=e=>e,$Pt=e=>Promise.resolve().then(e);function zde(e){throw e}function Ude(e){return e&&typeof e.then==\"function\"}var Brt=class e extends Bde.Observable{constructor(t){super(r=>{let i=this,n=Object.assign(Object.assign({},r),{complete(){r.complete(),i.onCompletion()},error(o){r.error(o),i.onError(o)},next(o){r.next(o),i.onNext(o)}});try{return this.initHasRun=!0,t(n)}catch(o){n.error(o)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state=\"pending\"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state=\"rejected\",this.rejection=t;for(let r of this.rejectionCallbacks)$Pt(()=>r(t))}onCompletion(){this.state=\"fulfilled\";for(let t of this.fulfillmentCallbacks)$Pt(()=>t(this.firstValue))}then(t,r){let i=t||Nde,n=r||zde,o=!1;return new Promise((s,a)=>{let h=g=>{if(!o){o=!0;try{s(n(g))}catch(w){a(w)}}},p=g=>{try{s(i(g))}catch(w){h(w)}};if(this.initHasRun||this.subscribe({error:h}),this.state===\"fulfilled\")return s(i(this.firstValue));if(this.state===\"rejected\")return o=!0,s(n(this.rejection));this.fulfillmentCallbacks.push(p),this.rejectionCallbacks.push(h)})}catch(t){return this.then(void 0,t)}finally(t){let r=t||Fde;return this.then(i=>(r(),i),()=>r())}static from(t){return Ude(t)?new e(r=>{let i=o=>{r.next(o),r.complete()},n=o=>{r.error(o)};t.then(i,n)}):super.from(t)}};TU.ObservablePromise=Brt});var Mk=Nr(SS=>{\"use strict\";Object.defineProperty(SS,\"__esModule\",{value:!0});SS.Transfer=SS.isTransferDescriptor=void 0;var WPt=Tk();function Vde(e){return!(!e||typeof e!=\"object\")}function jde(e){return e&&typeof e==\"object\"&&e[WPt.$transferable]}SS.isTransferDescriptor=jde;function $de(e,t){if(!t){if(!Vde(e))throw Error();t=[e]}return{[WPt.$transferable]:!0,send:e,transferables:t}}SS.Transfer=$de});var Frt=Nr(v_=>{\"use strict\";Object.defineProperty(v_,\"__esModule\",{value:!0});v_.WorkerMessageType=v_.MasterMessageType=void 0;var Gde;(function(e){e.cancel=\"cancel\",e.run=\"run\"})(Gde=v_.MasterMessageType||(v_.MasterMessageType={}));var Wde;(function(e){e.error=\"error\",e.init=\"init\",e.result=\"result\",e.running=\"running\",e.uncaughtError=\"uncaughtError\"})(Wde=v_.WorkerMessageType||(v_.WorkerMessageType={}))});var ZPt=Nr(b_=>{\"use strict\";var qde=b_&&b_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(b_,\"__esModule\",{value:!0});b_.createProxyModule=b_.createProxyFunction=void 0;var Hde=qde(mU()),HPt=xk(),Ek=AS(),qPt=GPt(),Yde=Mk(),Pk=Frt(),YPt=Hde.default(\"threads:master:messages\"),Xde=1,Zde=e=>Array.from(new Set(e)),Kde=e=>e&&e.type===Pk.WorkerMessageType.error,Qde=e=>e&&e.type===Pk.WorkerMessageType.result,Jde=e=>e&&e.type===Pk.WorkerMessageType.running;function tfe(e,t){return new HPt.Observable(r=>{let i,n=(o=>{if(YPt(\"Message from worker:\",o.data),!(!o.data||o.data.uid!==t)){if(Jde(o.data))i=o.data.resultType;else if(Qde(o.data))i===\"promise\"?(typeof o.data.payload<\"u\"&&r.next(Ek.deserialize(o.data.payload)),r.complete(),e.removeEventListener(\"message\",n)):(o.data.payload&&r.next(Ek.deserialize(o.data.payload)),o.data.complete&&(r.complete(),e.removeEventListener(\"message\",n)));else if(Kde(o.data)){let s=Ek.deserialize(o.data.error);r.error(s),e.removeEventListener(\"message\",n)}}});return e.addEventListener(\"message\",n),()=>{if(i===\"observable\"||!i){let o={type:Pk.MasterMessageType.cancel,uid:t};e.postMessage(o)}e.removeEventListener(\"message\",n)}})}function efe(e){if(e.length===0)return{args:[],transferables:[]};let t=[],r=[];for(let i of e)Yde.isTransferDescriptor(i)?(t.push(Ek.serialize(i.send)),r.push(...i.transferables)):t.push(Ek.serialize(i));return{args:t,transferables:r.length===0?r:Zde(r)}}function XPt(e,t){return((...r)=>{let i=Xde++,{args:n,transferables:o}=efe(r),s={type:Pk.MasterMessageType.run,uid:i,method:t,args:n};YPt(\"Sending command to run function to worker:\",s);try{e.postMessage(s,o)}catch(a){return qPt.ObservablePromise.from(Promise.reject(a))}return qPt.ObservablePromise.from(HPt.multicast(tfe(e,i)))})}b_.createProxyFunction=XPt;function rfe(e,t){let r={};for(let i of t)r[i]=XPt(e,i);return r}b_.createProxyModule=rfe});var tCt=Nr(x_=>{\"use strict\";var Nrt=x_&&x_.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})},ife=x_&&x_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(x_,\"__esModule\",{value:!0});x_.spawn=void 0;var zrt=ife(mU()),nfe=xk(),ofe=AS(),sfe=VPt(),SU=Tk(),MU=jPt(),KPt=ZPt(),afe=zrt.default(\"threads:master:messages\"),lfe=zrt.default(\"threads:master:spawn\"),JPt=zrt.default(\"threads:master:thread-utils\"),cfe=e=>e&&e.type===\"init\",ufe=e=>e&&e.type===\"uncaughtError\",hfe=typeof process<\"u\"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function dfe(e,t,r){return Nrt(this,void 0,void 0,function*(){let i,n=new Promise((s,a)=>{i=setTimeout(()=>a(Error(r)),t)}),o=yield Promise.race([e,n]);return clearTimeout(i),o})}function ffe(e){return new Promise((t,r)=>{let i=(n=>{afe(\"Message from worker before finishing initialization:\",n.data),cfe(n.data)?(e.removeEventListener(\"message\",i),t(n.data)):ufe(n.data)&&(e.removeEventListener(\"message\",i),r(ofe.deserialize(n.data.error)))});e.addEventListener(\"message\",i)})}function pfe(e,t){return new nfe.Observable(r=>{let i=(o=>{let s={type:MU.WorkerEventType.message,data:o.data};r.next(s)}),n=(o=>{JPt(\"Unhandled promise rejection event in thread:\",o);let s={type:MU.WorkerEventType.internalError,error:Error(o.reason)};r.next(s)});e.addEventListener(\"message\",i),e.addEventListener(\"unhandledrejection\",n),t.then(()=>{let o={type:MU.WorkerEventType.termination};e.removeEventListener(\"message\",i),e.removeEventListener(\"unhandledrejection\",n),r.next(o),r.complete()})})}function mfe(e){let[t,r]=sfe.createPromiseWithResolver();return{terminate:()=>Nrt(this,void 0,void 0,function*(){JPt(\"Terminating worker\"),yield e.terminate(),r()}),termination:t}}function QPt(e,t,r,i){let n=r.filter(o=>o.type===MU.WorkerEventType.internalError).map(o=>o.error);return Object.assign(e,{[SU.$errors]:n,[SU.$events]:r,[SU.$terminate]:i,[SU.$worker]:t})}function gfe(e,t){return Nrt(this,void 0,void 0,function*(){lfe(\"Initializing new thread\");let r=t&&t.timeout?t.timeout:hfe,n=(yield dfe(ffe(e),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)).exposed,{termination:o,terminate:s}=mfe(e),a=pfe(e,o);if(n.type===\"function\"){let h=KPt.createProxyFunction(e);return QPt(h,e,a,s)}else if(n.type===\"module\"){let h=KPt.createProxyModule(e,n.methods);return QPt(h,e,a,s)}else{let h=n.type;throw Error(`Worker init message states unexpected type of expose(): ${h}`)}})}x_.spawn=gfe});var eCt=Nr(Fu=>{\"use strict\";Object.defineProperty(Fu,\"__esModule\",{value:!0});Fu.Worker=Fu.BlobWorker=Fu.isWorkerRuntime=Fu.Thread=Fu.spawn=Fu.Pool=void 0;var Urt=vrt();Object.defineProperty(Fu,\"isWorkerRuntime\",{enumerable:!0,get:function(){return Urt.isWorkerRuntime}});var Afe=UPt();Object.defineProperty(Fu,\"Pool\",{enumerable:!0,get:function(){return Afe.Pool}});var yfe=tCt();Object.defineProperty(Fu,\"spawn\",{enumerable:!0,get:function(){return yfe.spawn}});var _fe=Ort();Object.defineProperty(Fu,\"Thread\",{enumerable:!0,get:function(){return _fe.Thread}});Fu.BlobWorker=Urt.getWorkerImplementation().blob;Fu.Worker=Urt.getWorkerImplementation().default});var iCt=Nr((Q1r,rCt)=>{\"use strict\";rCt.exports=e=>e?typeof Symbol.observable==\"symbol\"&&typeof e[Symbol.observable]==\"function\"?e===e[Symbol.observable]():typeof e[\"@@observable\"]==\"function\"?e===e[\"@@observable\"]():!1:!1});var nCt=Nr(Vrt=>{\"use strict\";Object.defineProperty(Vrt,\"__esModule\",{value:!0});var vfe=function(){let t=typeof self<\"u\"&&typeof Window<\"u\"&&self instanceof Window;return!!(typeof self<\"u\"&&self.postMessage&&!t)},bfe=function(t,r){self.postMessage(t,r)},xfe=function(t){let r=n=>{t(n.data)},i=()=>{self.removeEventListener(\"message\",r)};return self.addEventListener(\"message\",r),i};Vrt.default={isWorkerRuntime:vfe,postMessageToMaster:bfe,subscribeToMasterMessages:xfe}});var hCt=Nr(Nu=>{\"use strict\";var wfe=Nu&&Nu.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})},cCt=Nu&&Nu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nu,\"__esModule\",{value:!0});Nu.expose=Nu.isWorkerRuntime=Nu.Transfer=Nu.registerSerializer=void 0;var Tfe=cCt(iCt()),w_=AS(),Sfe=Mk(),T_=Frt(),zh=cCt(nCt()),Mfe=AS();Object.defineProperty(Nu,\"registerSerializer\",{enumerable:!0,get:function(){return Mfe.registerSerializer}});var Efe=Mk();Object.defineProperty(Nu,\"Transfer\",{enumerable:!0,get:function(){return Efe.Transfer}});Nu.isWorkerRuntime=zh.default.isWorkerRuntime;var oCt=!1,Ck=new Map,Pfe=e=>e&&e.type===T_.MasterMessageType.cancel,sCt=e=>e&&e.type===T_.MasterMessageType.run,aCt=e=>Tfe.default(e)||Cfe(e);function Cfe(e){return e&&typeof e==\"object\"&&typeof e.subscribe==\"function\"}function uCt(e){return Sfe.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function Ife(){let e={type:T_.WorkerMessageType.init,exposed:{type:\"function\"}};zh.default.postMessageToMaster(e)}function kfe(e){let t={type:T_.WorkerMessageType.init,exposed:{type:\"module\",methods:e}};zh.default.postMessageToMaster(t)}function jrt(e,t){let{payload:r,transferables:i}=uCt(t),n={type:T_.WorkerMessageType.error,uid:e,error:w_.serialize(r)};zh.default.postMessageToMaster(n,i)}function $rt(e,t,r){let{payload:i,transferables:n}=uCt(r),o={type:T_.WorkerMessageType.result,uid:e,complete:t?!0:void 0,payload:i};zh.default.postMessageToMaster(o,n)}function Rfe(e,t){let r={type:T_.WorkerMessageType.running,uid:e,resultType:t};zh.default.postMessageToMaster(r)}function EU(e){try{let t={type:T_.WorkerMessageType.uncaughtError,error:w_.serialize(e)};zh.default.postMessageToMaster(t)}catch(t){console.error(`Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:`,t,`\nOriginal error:`,e)}}function lCt(e,t,r){return wfe(this,void 0,void 0,function*(){let i;try{i=t(...r)}catch(o){return jrt(e,o)}let n=aCt(i)?\"observable\":\"promise\";if(Rfe(e,n),aCt(i)){let o=i.subscribe(s=>$rt(e,!1,w_.serialize(s)),s=>{jrt(e,w_.serialize(s)),Ck.delete(e)},()=>{$rt(e,!0),Ck.delete(e)});Ck.set(e,o)}else try{let o=yield i;$rt(e,!0,w_.serialize(o))}catch(o){jrt(e,w_.serialize(o))}})}function Dfe(e){if(!zh.default.isWorkerRuntime())throw Error(\"expose() called in the master thread.\");if(oCt)throw Error(\"expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.\");if(oCt=!0,typeof e==\"function\")zh.default.subscribeToMasterMessages(t=>{sCt(t)&&!t.method&&lCt(t.uid,e,t.args.map(w_.deserialize))}),Ife();else if(typeof e==\"object\"&&e){zh.default.subscribeToMasterMessages(r=>{sCt(r)&&r.method&&lCt(r.uid,e[r.method],r.args.map(w_.deserialize))});let t=Object.keys(e).filter(r=>typeof e[r]==\"function\");kfe(t)}else throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);zh.default.subscribeToMasterMessages(t=>{if(Pfe(t)){let r=t.uid,i=Ck.get(r);i&&(i.unsubscribe(),Ck.delete(r))}})}Nu.expose=Dfe;typeof self<\"u\"&&typeof self.addEventListener==\"function\"&&zh.default.isWorkerRuntime()&&(self.addEventListener(\"error\",e=>{setTimeout(()=>EU(e.error||e),250)}),self.addEventListener(\"unhandledrejection\",e=>{let t=e.reason;t&&typeof t.message==\"string\"&&setTimeout(()=>EU(t),250)}));typeof process<\"u\"&&typeof process.on==\"function\"&&zh.default.isWorkerRuntime()&&(process.on(\"uncaughtException\",e=>{setTimeout(()=>EU(e),250)}),process.on(\"unhandledRejection\",e=>{e&&typeof e.message==\"string\"&&setTimeout(()=>EU(e),250)}))});var dCt=Nr(Xc=>{\"use strict\";var Ofe=Xc&&Xc.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),Lfe=Xc&&Xc.__exportStar||function(e,t){for(var r in e)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ofe(t,e,r)};Object.defineProperty(Xc,\"__esModule\",{value:!0});Xc.Transfer=Xc.DefaultSerializer=Xc.expose=Xc.registerSerializer=void 0;var Bfe=AS();Object.defineProperty(Xc,\"registerSerializer\",{enumerable:!0,get:function(){return Bfe.registerSerializer}});Lfe(eCt(),Xc);var Ffe=hCt();Object.defineProperty(Xc,\"expose\",{enumerable:!0,get:function(){return Ffe.expose}});var Nfe=Art();Object.defineProperty(Xc,\"DefaultSerializer\",{enumerable:!0,get:function(){return Nfe.DefaultSerializer}});var zfe=Mk();Object.defineProperty(Xc,\"Transfer\",{enumerable:!0,get:function(){return zfe.Transfer}})});var l8t=Nr((snt,ant)=>{(function(e,t){typeof snt==\"object\"&&typeof ant<\"u\"?ant.exports=t():(e=typeof globalThis<\"u\"?globalThis:e||self,e.maplibregl=t())})(snt,(function(){\"use strict\";var e={},t={};function r(n,o,s){if(t[n]=s,n===\"index\"){var a=\"var sharedModule = {}; (\"+t.shared+\")(sharedModule); (\"+t.worker+\")(sharedModule);\",h={};return t.shared(h),t.index(e,h),typeof window<\"u\"&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:\"text/javascript\"}))),e}}r(\"shared\",[\"exports\"],(function(n){\"use strict\";function o(d,l,u,m){return new(u||(u=Promise))((function(A,T){function M(O){try{L(m.next(O))}catch(V){T(V)}}function P(O){try{L(m.throw(O))}catch(V){T(V)}}function L(O){var V;O.done?A(O.value):(V=O.value,V instanceof u?V:new u((function(F){F(V)}))).then(M,P)}L((m=m.apply(d,l||[])).next())}))}function s(d,l){this.x=d,this.y=l}function a(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,\"default\")?d.default:d}var h,p;typeof SuppressedError==\"function\"&&SuppressedError,s.prototype={clone(){return new s(this.x,this.y)},add(d){return this.clone()._add(d)},sub(d){return this.clone()._sub(d)},multByPoint(d){return this.clone()._multByPoint(d)},divByPoint(d){return this.clone()._divByPoint(d)},mult(d){return this.clone()._mult(d)},div(d){return this.clone()._div(d)},rotate(d){return this.clone()._rotate(d)},rotateAround(d,l){return this.clone()._rotateAround(d,l)},matMult(d){return this.clone()._matMult(d)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(d){return this.x===d.x&&this.y===d.y},dist(d){return Math.sqrt(this.distSqr(d))},distSqr(d){let l=d.x-this.x,u=d.y-this.y;return l*l+u*u},angle(){return Math.atan2(this.y,this.x)},angleTo(d){return Math.atan2(this.y-d.y,this.x-d.x)},angleWith(d){return this.angleWithSep(d.x,d.y)},angleWithSep(d,l){return Math.atan2(this.x*l-this.y*d,this.x*d+this.y*l)},_matMult(d){let l=d[2]*this.x+d[3]*this.y;return this.x=d[0]*this.x+d[1]*this.y,this.y=l,this},_add(d){return this.x+=d.x,this.y+=d.y,this},_sub(d){return this.x-=d.x,this.y-=d.y,this},_mult(d){return this.x*=d,this.y*=d,this},_div(d){return this.x/=d,this.y/=d,this},_multByPoint(d){return this.x*=d.x,this.y*=d.y,this},_divByPoint(d){return this.x/=d.x,this.y/=d.y,this},_unit(){return this._div(this.mag()),this},_perp(){let d=this.y;return this.y=this.x,this.x=-d,this},_rotate(d){let l=Math.cos(d),u=Math.sin(d),m=u*this.x+l*this.y;return this.x=l*this.x-u*this.y,this.y=m,this},_rotateAround(d,l){let u=Math.cos(d),m=Math.sin(d),A=l.y+m*(this.x-l.x)+u*(this.y-l.y);return this.x=l.x+u*(this.x-l.x)-m*(this.y-l.y),this.y=A,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:s},s.convert=function(d){if(d instanceof s)return d;if(Array.isArray(d))return new s(+d[0],+d[1]);if(d.x!==void 0&&d.y!==void 0)return new s(+d.x,+d.y);throw new Error(\"Expected [x, y] or {x, y} point format\")};var g=(function(){if(p)return h;function d(l,u,m,A){this.cx=3*l,this.bx=3*(m-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*u,this.by=3*(A-u)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=u,this.p2x=m,this.p2y=A}return p=1,h=d,d.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,u){if(u===void 0&&(u=1e-6),l<0)return 0;if(l>1)return 1;for(var m=l,A=0;A<8;A++){var T=this.sampleCurveX(m)-l;if(Math.abs(T)<u)return m;var M=this.sampleCurveDerivativeX(m);if(Math.abs(M)<1e-6)break;m-=T/M}var P=0,L=1;for(m=l,A=0;A<20&&(T=this.sampleCurveX(m),!(Math.abs(T-l)<u));A++)l>T?P=m:L=m,m=.5*(L-P)+P;return m},solve:function(l,u){return this.sampleCurveY(this.solveCurveX(l,u))}},h})(),w=a(g);let C,R;function z(){return C==null&&(C=typeof OffscreenCanvas<\"u\"&&new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),C}function W(){if(R==null&&(R=!1,z())){let l=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(l){for(let m=0;m<25;m++){let A=4*m;l.fillStyle=`rgb(${A},${A+1},${A+2})`,l.fillRect(m%5,Math.floor(m/5),1,1)}let u=l.getImageData(0,0,5,5).data;for(let m=0;m<100;m++)if(m%4!=3&&u[m]!==m){R=!0;break}}}return R||!1}var Y=1e-6,H=typeof Float32Array<\"u\"?Float32Array:Array;function Q(){var d=new H(9);return H!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[5]=0,d[6]=0,d[7]=0),d[0]=1,d[4]=1,d[8]=1,d}function tt(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}function rt(){var d=new H(3);return H!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0),d}function at(d){var l=d[0],u=d[1],m=d[2];return Math.sqrt(l*l+u*u+m*m)}function et(d,l,u){var m=new H(3);return m[0]=d,m[1]=l,m[2]=u,m}function lt(d,l,u){return d[0]=l[0]+u[0],d[1]=l[1]+u[1],d[2]=l[2]+u[2],d}function J(d,l,u){return d[0]=l[0]*u,d[1]=l[1]*u,d[2]=l[2]*u,d}function ft(d,l,u){var m=l[0],A=l[1],T=l[2],M=u[0],P=u[1],L=u[2];return d[0]=A*L-T*P,d[1]=T*M-m*L,d[2]=m*P-A*M,d}var dt,Mt=at;function Ft(d,l,u){var m=l[0],A=l[1],T=l[2],M=l[3];return d[0]=u[0]*m+u[4]*A+u[8]*T+u[12]*M,d[1]=u[1]*m+u[5]*A+u[9]*T+u[13]*M,d[2]=u[2]*m+u[6]*A+u[10]*T+u[14]*M,d[3]=u[3]*m+u[7]*A+u[11]*T+u[15]*M,d}function Nt(){var d=new H(4);return H!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0),d[3]=1,d}function $t(d,l,u,m){var A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:\"zyx\",T=Math.PI/360;l*=T,m*=T,u*=T;var M=Math.sin(l),P=Math.cos(l),L=Math.sin(u),O=Math.cos(u),V=Math.sin(m),F=Math.cos(m);switch(A){case\"xyz\":d[0]=M*O*F+P*L*V,d[1]=P*L*F-M*O*V,d[2]=P*O*V+M*L*F,d[3]=P*O*F-M*L*V;break;case\"xzy\":d[0]=M*O*F-P*L*V,d[1]=P*L*F-M*O*V,d[2]=P*O*V+M*L*F,d[3]=P*O*F+M*L*V;break;case\"yxz\":d[0]=M*O*F+P*L*V,d[1]=P*L*F-M*O*V,d[2]=P*O*V-M*L*F,d[3]=P*O*F+M*L*V;break;case\"yzx\":d[0]=M*O*F+P*L*V,d[1]=P*L*F+M*O*V,d[2]=P*O*V-M*L*F,d[3]=P*O*F-M*L*V;break;case\"zxy\":d[0]=M*O*F-P*L*V,d[1]=P*L*F+M*O*V,d[2]=P*O*V+M*L*F,d[3]=P*O*F-M*L*V;break;case\"zyx\":d[0]=M*O*F-P*L*V,d[1]=P*L*F+M*O*V,d[2]=P*O*V-M*L*F,d[3]=P*O*F+M*L*V;break;default:throw new Error(\"Unknown angle order \"+A)}return d}function Yt(){var d=new H(2);return H!=Float32Array&&(d[0]=0,d[1]=0),d}function _e(d,l){var u=new H(2);return u[0]=d,u[1]=l,u}rt(),dt=new H(4),H!=Float32Array&&(dt[0]=0,dt[1]=0,dt[2]=0,dt[3]=0),rt(),et(1,0,0),et(0,1,0),Nt(),Nt(),Q(),Yt();let Pe=8192;function we(d,l,u){return l*(Pe/(d.tileSize*Math.pow(2,u-d.tileID.overscaledZ)))}function Ue(d,l){return(d%l+l)%l}function lr(d,l,u){return d*(1-u)+l*u}function ee(d){if(d<=0)return 0;if(d>=1)return 1;let l=d*d,u=l*d;return 4*(d<.5?u:3*(d-l)+u-.75)}function Ce(d,l,u,m){let A=new w(d,l,u,m);return T=>A.solve(T)}let mr=Ce(.25,.1,.25,1);function gr(d,l,u){return Math.min(u,Math.max(l,d))}function Br(d,l,u){let m=u-l,A=((d-l)%m+m)%m+l;return A===l?u:A}function Cr(d,...l){for(let u of l)for(let m in u)d[m]=u[m];return d}let Rr=1;function ti(d,l,u){let m={};for(let A in d)m[A]=l.call(this,d[A],A,d);return m}function wr(d,l,u){let m={};for(let A in d)l.call(this,d[A],A,d)&&(m[A]=d[A]);return m}function He(d){return Array.isArray(d)?d.map(He):typeof d==\"object\"&&d?ti(d,He):d}let Ui={};function ln(d){Ui[d]||(typeof console<\"u\"&&console.warn(d),Ui[d]=!0)}function Io(d,l,u){return(u.y-d.y)*(l.x-d.x)>(l.y-d.y)*(u.x-d.x)}function qn(d){return typeof WorkerGlobalScope<\"u\"&&d!==void 0&&d instanceof WorkerGlobalScope}let ds=null;function Xo(d){return typeof ImageBitmap<\"u\"&&d instanceof ImageBitmap}let Ul=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=\";function gc(d,l,u,m,A){return o(this,void 0,void 0,(function*(){if(typeof VideoFrame>\"u\")throw new Error(\"VideoFrame not supported\");let T=new VideoFrame(d,{timestamp:0});try{let M=T?.format;if(!M||!M.startsWith(\"BGR\")&&!M.startsWith(\"RGB\"))throw new Error(`Unrecognized format ${M}`);let P=M.startsWith(\"BGR\"),L=new Uint8ClampedArray(m*A*4);if(yield T.copyTo(L,(function(O,V,F,X,j){let nt=4*Math.max(-V,0),st=(Math.max(0,F)-F)*X*4+nt,pt=4*X,mt=Math.max(0,V),vt=Math.max(0,F);return{rect:{x:mt,y:vt,width:Math.min(O.width,V+X)-mt,height:Math.min(O.height,F+j)-vt},layout:[{offset:st,stride:pt}]}})(d,l,u,m,A)),P)for(let O=0;O<L.length;O+=4){let V=L[O];L[O]=L[O+2],L[O+2]=V}return L}finally{T.close()}}))}let Wu,qu;function Rs(d,l,u,m){return d.addEventListener(l,u,m),{unsubscribe:()=>{d.removeEventListener(l,u,m)}}}function ba(d){return d*Math.PI/180}function Vl(d){return d/Math.PI*180}let FA={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},NA={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Va=\"AbortError\";class mm extends Error{constructor(l=Va){super(l instanceof Error?l.message:l),this.name=Va,l instanceof Error&&l.stack&&(this.stack=l.stack)}}function Cp(d){return d.name===Va}let ja={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function jl(d){return ja.REGISTERED_PROTOCOLS[d.substring(0,d.indexOf(\"://\"))]}let dl=\"global-dispatcher\";class af extends Error{constructor(l,u,m,A){super(`AJAXError: ${u} (${l}): ${m}`),this.status=l,this.statusText=u,this.url=m,this.body=A}}let gm=()=>qn(self)?self.worker&&self.worker.referrer:(window.location.protocol===\"blob:\"?window.parent:window).location.href,Hu=function(d,l){if(/:\\/\\//.test(d.url)&&!/^https?:|^file:/.test(d.url)){let m=jl(d.url);if(m)return m(d,l);if(qn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:\"GR\",data:d,targetMapId:dl},l)}if(!(/^file:/.test(u=d.url)||/^file:/.test(gm())&&!/^\\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,\"signal\"))return(function(m,A){return o(this,void 0,void 0,(function*(){let T=new Request(m.url,{method:m.method||\"GET\",body:m.body,credentials:m.credentials,headers:m.headers,cache:m.cache,referrer:gm(),referrerPolicy:m.referrerPolicy,signal:A.signal}),M,P;m.type!==\"json\"||T.headers.has(\"Accept\")||T.headers.set(\"Accept\",\"application/json\");try{M=yield fetch(T)}catch(O){throw Cp(O)?O:new af(0,O.message,m.url,new Blob)}if(!M.ok){let O=yield M.blob();throw new af(M.status,M.statusText,m.url,O)}P=m.type===\"arrayBuffer\"||m.type===\"image\"?M.arrayBuffer():m.type===\"json\"?M.json():M.text();let L=yield P;return A.signal.throwIfAborted(),{data:L,cacheControl:M.headers.get(\"Cache-Control\"),expires:M.headers.get(\"Expires\"),etag:M.headers.get(\"ETag\")}}))})(d,l);if(qn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:\"GR\",data:d,mustQueue:!0,targetMapId:dl},l)}var u;return(function(m,A){return new Promise(((T,M)=>{var P;let L=new XMLHttpRequest;L.open(m.method||\"GET\",m.url,!0),m.type!==\"arrayBuffer\"&&m.type!==\"image\"||(L.responseType=\"arraybuffer\");for(let O in m.headers)L.setRequestHeader(O,m.headers[O]);m.type===\"json\"&&(L.responseType=\"text\",!((P=m.headers)===null||P===void 0)&&P.Accept||L.setRequestHeader(\"Accept\",\"application/json\")),L.withCredentials=m.credentials===\"include\",L.onerror=()=>{M(new Error(L.statusText))},L.onload=()=>{if(!A.signal.aborted)if((L.status>=200&&L.status<300||L.status===0)&&L.response!==null){let O=L.response;if(m.type===\"json\")try{O=JSON.parse(L.response)}catch(V){return void M(V)}T({data:O,cacheControl:L.getResponseHeader(\"Cache-Control\"),expires:L.getResponseHeader(\"Expires\"),etag:L.getResponseHeader(\"ETag\")})}else{let O=new Blob([L.response],{type:L.getResponseHeader(\"Content-Type\")});M(new af(L.status,L.statusText,m.url,O))}},A.signal.addEventListener(\"abort\",(()=>{L.abort(),M(new mm(A.signal.reason))})),L.send(m.body)}))})(d,l)};function $l(d){if(!d||d.indexOf(\"://\")<=0||d.indexOf(\"data:image/\")===0||d.indexOf(\"blob:\")===0)return!0;let l=new URL(d),u=window.location;return l.protocol===u.protocol&&l.host===u.host}function lf(d,l,u){u[d]&&u[d].indexOf(l)!==-1||(u[d]=u[d]||[],u[d].push(l))}function Yu(d,l,u){if(u&&u[d]){let m=u[d].indexOf(l);m!==-1&&u[d].splice(m,1)}}class Ip{constructor(l,u={}){Cr(this,u),this.type=l}}class Am extends Ip{constructor(l,u={}){super(\"error\",Cr({error:l},u))}}class ym{on(l,u){return this._listeners=this._listeners||{},lf(l,u,this._listeners),{unsubscribe:()=>{this.off(l,u)}}}off(l,u){return Yu(l,u,this._listeners),Yu(l,u,this._oneTimeListeners),this}once(l,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},lf(l,u,this._oneTimeListeners),this):new Promise((m=>this.once(l,m)))}fire(l,u){typeof l==\"string\"&&(l=new Ip(l,u||{}));let m=l.type;if(this.listens(m)){l.target=this;let A=this._listeners&&this._listeners[m]?this._listeners[m].slice():[];for(let P of A)P.call(this,l);let T=this._oneTimeListeners&&this._oneTimeListeners[m]?this._oneTimeListeners[m].slice():[];for(let P of T)Yu(m,P,this._oneTimeListeners),P.call(this,l);let M=this._eventedParent;M&&(Cr(l,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),M.fire(l))}else l instanceof Am&&console.error(l.error);return this}listens(l){return this._listeners&&this._listeners[l]&&this._listeners[l].length>0||this._oneTimeListeners&&this._oneTimeListeners[l]&&this._oneTimeListeners[l].length>0||this._eventedParent&&this._eventedParent.listens(l)}setEventedParent(l,u){return this._eventedParent=l,this._eventedParentData=u,this}}var Te={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\",length:2},centerAltitude:{type:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},roll:{type:\"number\",default:0,units:\"degrees\"},state:{type:\"state\",default:{}},light:{type:\"light\"},sky:{type:\"sky\"},projection:{type:\"projection\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},\"font-faces\":{type:\"fontFaces\"},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},encoding:{type:\"enum\",values:{mvt:{},mlt:{}},default:\"mvt\"},\"*\":{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:\"filter\"},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:{},\"color-relief\":{},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_color-relief\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_color-relief\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},filter:{type:\"boolean\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},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:\"expression_name\",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:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"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\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"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\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,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:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,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:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",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\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,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\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}};let zA=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"];function UA(d,l){let u={};for(let m in d)m!==\"ref\"&&(u[m]=d[m]);return zA.forEach((m=>{m in l&&(u[m]=l[m])})),u}function Yi(d,l){if(Array.isArray(d)){if(!Array.isArray(l)||d.length!==l.length)return!1;for(let u=0;u<d.length;u++)if(!Yi(d[u],l[u]))return!1;return!0}if(typeof d==\"object\"&&d!==null&&l!==null){if(typeof l!=\"object\"||Object.keys(d).length!==Object.keys(l).length)return!1;for(let u in d)if(!Yi(d[u],l[u]))return!1;return!0}return d===l}function Ds(d,l){d.push(l)}function jh(d,l,u){Ds(u,{command:\"addSource\",args:[d,l[d]]})}function k_(d,l,u){Ds(l,{command:\"removeSource\",args:[d]}),u[d]=!0}function je(d,l,u,m){k_(d,u,m),jh(d,l,u)}function _M(d,l,u){let m;for(m in d[u])if(Object.prototype.hasOwnProperty.call(d[u],m)&&m!==\"data\"&&!Yi(d[u][m],l[u][m]))return!1;for(m in l[u])if(Object.prototype.hasOwnProperty.call(l[u],m)&&m!==\"data\"&&!Yi(d[u][m],l[u][m]))return!1;return!0}function VA(d,l,u,m,A,T){d=d||{},l=l||{};for(let M in d)Object.prototype.hasOwnProperty.call(d,M)&&(Yi(d[M],l[M])||u.push({command:T,args:[m,M,l[M],A]}));for(let M in l)Object.prototype.hasOwnProperty.call(l,M)&&!Object.prototype.hasOwnProperty.call(d,M)&&(Yi(d[M],l[M])||u.push({command:T,args:[m,M,l[M],A]}))}function R_(d){return d.id}function r2(d,l){return d[l.id]=l,d}class Ye{constructor(l,u,m,A){this.message=(l?`${l}: `:\"\")+m,A&&(this.identifier=A),u!=null&&u.__line__&&(this.line=u.__line__)}}function cf(d,...l){for(let u of l)for(let m in u)d[m]=u[m];return d}class Os extends Error{constructor(l,u){super(u),this.message=u,this.key=l}}class D_{constructor(l,u=[]){this.parent=l,this.bindings={};for(let[m,A]of u)this.bindings[m]=A}concat(l){return new D_(this,l)}get(l){if(this.bindings[l])return this.bindings[l];if(this.parent)return this.parent.get(l);throw new Error(`${l} not found in scope.`)}has(l){return!!this.bindings[l]||!!this.parent&&this.parent.has(l)}}let $h={kind:\"null\"},Je={kind:\"number\"},Hr={kind:\"string\"},gi={kind:\"boolean\"},fl={kind:\"color\"},kp={kind:\"projectionDefinition\"},Gh={kind:\"object\"},fi={kind:\"value\"},jA={kind:\"collator\"},Rp={kind:\"formatted\"},_m={kind:\"padding\"},Dp={kind:\"colorArray\"},vm={kind:\"numberArray\"},uf={kind:\"resolvedImage\"},tu={kind:\"variableAnchorOffsetCollection\"};function fs(d,l){return{kind:\"array\",itemType:d,N:l}}function Nn(d){if(d.kind===\"array\"){let l=Nn(d.itemType);return typeof d.N==\"number\"?`array<${l}, ${d.N}>`:d.itemType.kind===\"value\"?\"array\":`array<${l}>`}return d.kind}let O_=[$h,Je,Hr,gi,fl,kp,Rp,Gh,fs(fi),_m,vm,Dp,uf,tu];function bm(d,l){if(l.kind===\"error\")return null;if(d.kind===\"array\"){if(l.kind===\"array\"&&(l.N===0&&l.itemType.kind===\"value\"||!bm(d.itemType,l.itemType))&&(typeof d.N!=\"number\"||d.N===l.N))return null}else{if(d.kind===l.kind)return null;if(d.kind===\"value\"){for(let u of O_)if(!bm(u,l))return null}}return`Expected ${Nn(d)} but found ${Nn(l)} instead.`}function Op(d,l){return l.some((u=>u.kind===d.kind))}function hf(d,l){return l.some((u=>u===\"null\"?d===null:u===\"array\"?Array.isArray(d):u===\"object\"?d&&!Array.isArray(d)&&typeof d==\"object\":u===typeof d))}function pl(d,l){return d.kind===\"array\"&&l.kind===\"array\"?d.itemType.kind===l.itemType.kind&&typeof d.N==\"number\":d.kind===l.kind}let $A=.96422,Zo=.82521,i2=4/29,Wh=6/29,Lp=3*Wh*Wh,n2=Wh*Wh*Wh,vM=Math.PI/180,bM=180/Math.PI;function L_(d){return(d%=360)<0&&(d+=360),d}function o2([d,l,u,m]){let A,T,M=B_((.2225045*(d=GA(d))+.7168786*(l=GA(l))+.0606169*(u=GA(u)))/1);d===l&&l===u?A=T=M:(A=B_((.4360747*d+.3850649*l+.1430804*u)/$A),T=B_((.0139322*d+.0971045*l+.7141733*u)/Zo));let P=116*M-16;return[P<0?0:P,500*(A-M),200*(M-T),m]}function GA(d){return d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)}function B_(d){return d>n2?Math.pow(d,1/3):d/Lp+i2}function s2([d,l,u,m]){let A=(d+16)/116,T=isNaN(l)?A:A+l/500,M=isNaN(u)?A:A-u/200;return A=1*N_(A),T=$A*N_(T),M=Zo*N_(M),[F_(3.1338561*T-1.6168667*A-.4906146*M),F_(-.9787684*T+1.9161415*A+.033454*M),F_(.0719453*T-.2289914*A+1.4052427*M),m]}function F_(d){return(d=d<=.00304?12.92*d:1.055*Math.pow(d,1/2.4)-.055)<0?0:d>1?1:d}function N_(d){return d>Wh?d*d*d:Lp*(d-i2)}let xM=Object.hasOwn||function(d,l){return Object.prototype.hasOwnProperty.call(d,l)};function xm(d,l){return xM(d,l)?d[l]:void 0}function WA(d){return parseInt(d.padEnd(2,d),16)/255}function z_(d,l){return eu(l?d/100:d,0,1)}function eu(d,l,u){return Math.min(Math.max(l,d),u)}function a2(d){return!d.some(Number.isNaN)}let wM={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]};function Gl(d,l,u){return d+u*(l-d)}function Bp(d,l,u){return d.map(((m,A)=>Gl(m,l[A],u)))}class Mi{constructor(l,u,m,A=1,T=!0){this.r=l,this.g=u,this.b=m,this.a=A,T||(this.r*=A,this.g*=A,this.b*=A,A||this.overwriteGetter(\"rgb\",[l,u,m,A]))}static parse(l){if(l instanceof Mi)return l;if(typeof l!=\"string\")return;let u=(function(m){if((m=m.toLowerCase().trim())===\"transparent\")return[0,0,0,0];let A=xm(wM,m);if(A){let[M,P,L]=A;return[M/255,P/255,L/255,1]}if(m.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(m)){let M=m.length<6?1:2,P=1;return[WA(m.slice(P,P+=M)),WA(m.slice(P,P+=M)),WA(m.slice(P,P+=M)),WA(m.slice(P,P+M)||\"ff\")]}if(m.startsWith(\"rgb\")){let M=m.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(M){let[P,L,O,V,F,X,j,nt,st,pt,mt,vt]=M,At=[V||\" \",j||\" \",pt].join(\"\");if(At===\"  \"||At===\"  /\"||At===\",,\"||At===\",,,\"){let wt=[O,X,st].join(\"\"),St=wt===\"%%%\"?100:wt===\"\"?255:0;if(St){let Bt=[eu(+L/St,0,1),eu(+F/St,0,1),eu(+nt/St,0,1),mt?z_(+mt,vt):1];if(a2(Bt))return Bt}}return}}let T=m.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(T){let[M,P,L,O,V,F,X,j,nt]=T,st=[L||\" \",V||\" \",X].join(\"\");if(st===\"  \"||st===\"  /\"||st===\",,\"||st===\",,,\"){let pt=[+P,eu(+O,0,100),eu(+F,0,100),j?z_(+j,nt):1];if(a2(pt))return(function([mt,vt,At,wt]){function St(Bt){let qt=(Bt+mt/30)%12,te=vt*Math.min(At,1-At);return At-te*Math.max(-1,Math.min(qt-3,9-qt,1))}return mt=L_(mt),vt/=100,At/=100,[St(0),St(8),St(4),wt]})(pt)}}})(l);return u?new Mi(...u,!1):void 0}get rgb(){let{r:l,g:u,b:m,a:A}=this,T=A||1/0;return this.overwriteGetter(\"rgb\",[l/T,u/T,m/T,A])}get hcl(){return this.overwriteGetter(\"hcl\",(function(l){let[u,m,A,T]=o2(l),M=Math.sqrt(m*m+A*A);return[Math.round(1e4*M)?L_(Math.atan2(A,m)*bM):NaN,M,u,T]})(this.rgb))}get lab(){return this.overwriteGetter(\"lab\",o2(this.rgb))}overwriteGetter(l,u){return Object.defineProperty(this,l,{value:u}),u}toString(){let[l,u,m,A]=this.rgb;return`rgba(${[l,u,m].map((T=>Math.round(255*T))).join(\",\")},${A})`}static interpolate(l,u,m,A=\"rgb\"){switch(A){case\"rgb\":{let[T,M,P,L]=Bp(l.rgb,u.rgb,m);return new Mi(T,M,P,L,!1)}case\"hcl\":{let[T,M,P,L]=l.hcl,[O,V,F,X]=u.hcl,j,nt;if(isNaN(T)||isNaN(O))isNaN(T)?isNaN(O)?j=NaN:(j=O,P!==1&&P!==0||(nt=V)):(j=T,F!==1&&F!==0||(nt=M));else{let At=O-T;O>T&&At>180?At-=360:O<T&&T-O>180&&(At+=360),j=T+m*At}let[st,pt,mt,vt]=(function([At,wt,St,Bt]){return At=isNaN(At)?0:At*vM,s2([St,Math.cos(At)*wt,Math.sin(At)*wt,Bt])})([j,nt??Gl(M,V,m),Gl(P,F,m),Gl(L,X,m)]);return new Mi(st,pt,mt,vt,!1)}case\"lab\":{let[T,M,P,L]=s2(Bp(l.lab,u.lab,m));return new Mi(T,M,P,L,!1)}}}}Mi.black=new Mi(0,0,0,1),Mi.white=new Mi(1,1,1,1),Mi.transparent=new Mi(0,0,0,0),Mi.red=new Mi(1,0,0,1);class U_{constructor(l,u,m){this.sensitivity=l?u?\"variant\":\"case\":u?\"accent\":\"base\",this.locale=m,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(l,u){return this.collator.compare(l,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let l2=[\"bottom\",\"center\",\"top\"];class qA{constructor(l,u,m,A,T,M){this.text=l,this.image=u,this.scale=m,this.fontStack=A,this.textColor=T,this.verticalAlign=M}}class yo{constructor(l){this.sections=l}static fromString(l){return new yo([new qA(l,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((l=>l.text.length!==0||l.image&&l.image.name.length!==0))}static factory(l){return l instanceof yo?l:yo.fromString(l)}toString(){return this.sections.length===0?\"\":this.sections.map((l=>l.text)).join(\"\")}}class Fr{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Fr)return l;if(typeof l==\"number\")return new Fr([l,l,l,l]);if(Array.isArray(l)&&!(l.length<1||l.length>4)){for(let u of l)if(typeof u!=\"number\")return;switch(l.length){case 1:l=[l[0],l[0],l[0],l[0]];break;case 2:l=[l[0],l[1],l[0],l[1]];break;case 3:l=[l[0],l[1],l[2],l[1]]}return new Fr(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,u,m){return new Fr(Bp(l.values,u.values,m))}}class jo{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof jo)return l;if(typeof l==\"number\")return new jo([l]);if(Array.isArray(l)){for(let u of l)if(typeof u!=\"number\")return;return new jo(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,u,m){return new jo(Bp(l.values,u.values,m))}}class Hn{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Hn)return l;if(typeof l==\"string\"){let m=Mi.parse(l);return m?new Hn([m]):void 0}if(!Array.isArray(l))return;let u=[];for(let m of l){if(typeof m!=\"string\")return;let A=Mi.parse(m);if(!A)return;u.push(A)}return new Hn(u)}toString(){return JSON.stringify(this.values)}static interpolate(l,u,m,A=\"rgb\"){let T=[];if(l.values.length!=u.values.length)throw new Error(`colorArray: Arrays have mismatched length (${l.values.length} vs. ${u.values.length}), cannot interpolate.`);for(let M=0;M<l.values.length;M++)T.push(Mi.interpolate(l.values[M],u.values[M],m,A));return new Hn(T)}}class Yn extends Error{constructor(l){super(l),this.name=\"RuntimeError\"}toJSON(){return this.message}}let c2=new Set([\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"]);class ta{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof ta)return l;if(Array.isArray(l)&&!(l.length<1)&&l.length%2==0){for(let u=0;u<l.length;u+=2){let m=l[u],A=l[u+1];if(typeof m!=\"string\"||!c2.has(m)||!Array.isArray(A)||A.length!==2||typeof A[0]!=\"number\"||typeof A[1]!=\"number\")return}return new ta(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,u,m){let A=l.values,T=u.values;if(A.length!==T.length)throw new Yn(`Cannot interpolate values of different length. from: ${l.toString()}, to: ${u.toString()}`);let M=[];for(let P=0;P<A.length;P+=2){if(A[P]!==T[P])throw new Yn(`Cannot interpolate values containing mismatched anchors. from[${P}]: ${A[P]}, to[${P}]: ${T[P]}`);M.push(A[P]);let[L,O]=A[P+1],[V,F]=T[P+1];M.push([Gl(L,V,m),Gl(O,F,m)])}return new ta(M)}}class ea{constructor(l){this.name=l.name,this.available=l.available}toString(){return this.name}static fromString(l){return l?new ea({name:l,available:!1}):null}}class ra{constructor(l,u,m){this.from=l,this.to=u,this.transition=m}static interpolate(l,u,m){return new ra(l,u,m)}static parse(l){return l instanceof ra?l:Array.isArray(l)&&l.length===3&&typeof l[0]==\"string\"&&typeof l[1]==\"string\"&&typeof l[2]==\"number\"?new ra(l[0],l[1],l[2]):typeof l==\"object\"&&typeof l.from==\"string\"&&typeof l.to==\"string\"&&typeof l.transition==\"number\"?new ra(l.from,l.to,l.transition):typeof l==\"string\"?new ra(l,l,1):void 0}}function V_(d,l,u,m){return typeof d==\"number\"&&d>=0&&d<=255&&typeof l==\"number\"&&l>=0&&l<=255&&typeof u==\"number\"&&u>=0&&u<=255?m===void 0||typeof m==\"number\"&&m>=0&&m<=1?null:`Invalid rgba value [${[d,l,u,m].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof m==\"number\"?[d,l,u,m]:[d,l,u]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function df(d){if(d===null||typeof d==\"string\"||typeof d==\"boolean\"||typeof d==\"number\"||d instanceof ra||d instanceof Mi||d instanceof U_||d instanceof yo||d instanceof Fr||d instanceof jo||d instanceof Hn||d instanceof ta||d instanceof ea)return!0;if(Array.isArray(d)){for(let l of d)if(!df(l))return!1;return!0}if(typeof d==\"object\"){for(let l in d)if(!df(d[l]))return!1;return!0}return!1}function Xn(d){if(d===null)return $h;if(typeof d==\"string\")return Hr;if(typeof d==\"boolean\")return gi;if(typeof d==\"number\")return Je;if(d instanceof Mi)return fl;if(d instanceof ra)return kp;if(d instanceof U_)return jA;if(d instanceof yo)return Rp;if(d instanceof Fr)return _m;if(d instanceof jo)return vm;if(d instanceof Hn)return Dp;if(d instanceof ta)return tu;if(d instanceof ea)return uf;if(Array.isArray(d)){let l=d.length,u;for(let m of d){let A=Xn(m);if(u){if(u===A)continue;u=fi;break}u=A}return fs(u||fi,l)}return Gh}function wm(d){let l=typeof d;return d===null?\"\":l===\"string\"||l===\"number\"||l===\"boolean\"?String(d):d instanceof Mi||d instanceof ra||d instanceof yo||d instanceof Fr||d instanceof jo||d instanceof Hn||d instanceof ta||d instanceof ea?d.toString():JSON.stringify(d)}class ru{constructor(l,u){this.type=l,this.value=u}static parse(l,u){if(l.length!==2)return u.error(`'literal' expression requires exactly one argument, but found ${l.length-1} instead.`);if(!df(l[1]))return u.error(\"invalid value\");let m=l[1],A=Xn(m),T=u.expectedType;return A.kind!==\"array\"||A.N!==0||!T||T.kind!==\"array\"||typeof T.N==\"number\"&&T.N!==0||(A=T),new ru(A,m)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Xu={string:Hr,number:Je,boolean:gi,object:Gh};class Wl{constructor(l,u){this.type=l,this.args=u}static parse(l,u){if(l.length<2)return u.error(\"Expected at least one argument.\");let m,A=1,T=l[0];if(T===\"array\"){let P,L;if(l.length>2){let O=l[1];if(typeof O!=\"string\"||!(O in Xu)||O===\"object\")return u.error('The item type argument of \"array\" must be one of string, number, boolean',1);P=Xu[O],A++}else P=fi;if(l.length>3){if(l[2]!==null&&(typeof l[2]!=\"number\"||l[2]<0||l[2]!==Math.floor(l[2])))return u.error('The length argument to \"array\" must be a positive integer literal',2);L=l[2],A++}m=fs(P,L)}else{if(!Xu[T])throw new Error(`Types doesn't contain name = ${T}`);m=Xu[T]}let M=[];for(;A<l.length;A++){let P=u.parse(l[A],A,fi);if(!P)return null;M.push(P)}return new Wl(m,M)}evaluate(l){for(let u=0;u<this.args.length;u++){let m=this.args[u].evaluate(l);if(!bm(this.type,Xn(m)))return m;if(u===this.args.length-1)throw new Yn(`Expected value to be of type ${Nn(this.type)}, but found ${Nn(Xn(m))} instead.`)}throw new Error}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every((l=>l.outputDefined()))}}let j_={\"to-boolean\":gi,\"to-color\":fl,\"to-number\":Je,\"to-string\":Hr};class Zu{constructor(l,u){this.type=l,this.args=u}static parse(l,u){if(l.length<2)return u.error(\"Expected at least one argument.\");let m=l[0];if(!j_[m])throw new Error(`Can't parse ${m} as it is not part of the known types`);if((m===\"to-boolean\"||m===\"to-string\")&&l.length!==2)return u.error(\"Expected one argument.\");let A=j_[m],T=[];for(let M=1;M<l.length;M++){let P=u.parse(l[M],M,fi);if(!P)return null;T.push(P)}return new Zu(A,T)}evaluate(l){switch(this.type.kind){case\"boolean\":return!!this.args[0].evaluate(l);case\"color\":{let u,m;for(let A of this.args){if(u=A.evaluate(l),m=null,u instanceof Mi)return u;if(typeof u==\"string\"){let T=l.parseColor(u);if(T)return T}else if(Array.isArray(u)&&(m=u.length<3||u.length>4?`Invalid rgba value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:V_(u[0],u[1],u[2],u[3]),!m))return new Mi(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new Yn(m||`Could not parse color from value '${typeof u==\"string\"?u:JSON.stringify(u)}'`)}case\"padding\":{let u;for(let m of this.args){u=m.evaluate(l);let A=Fr.parse(u);if(A)return A}throw new Yn(`Could not parse padding from value '${typeof u==\"string\"?u:JSON.stringify(u)}'`)}case\"numberArray\":{let u;for(let m of this.args){u=m.evaluate(l);let A=jo.parse(u);if(A)return A}throw new Yn(`Could not parse numberArray from value '${typeof u==\"string\"?u:JSON.stringify(u)}'`)}case\"colorArray\":{let u;for(let m of this.args){u=m.evaluate(l);let A=Hn.parse(u);if(A)return A}throw new Yn(`Could not parse colorArray from value '${typeof u==\"string\"?u:JSON.stringify(u)}'`)}case\"variableAnchorOffsetCollection\":{let u;for(let m of this.args){u=m.evaluate(l);let A=ta.parse(u);if(A)return A}throw new Yn(`Could not parse variableAnchorOffsetCollection from value '${typeof u==\"string\"?u:JSON.stringify(u)}'`)}case\"number\":{let u=null;for(let m of this.args){if(u=m.evaluate(l),u===null)return 0;let A=Number(u);if(!isNaN(A))return A}throw new Yn(`Could not convert ${JSON.stringify(u)} to number.`)}case\"formatted\":return yo.fromString(wm(this.args[0].evaluate(l)));case\"resolvedImage\":return ea.fromString(wm(this.args[0].evaluate(l)));case\"projectionDefinition\":return this.args[0].evaluate(l);default:return wm(this.args[0].evaluate(l))}}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every((l=>l.outputDefined()))}}let HA=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];class Rn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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\"?HA[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(l){let u=this._parseColorCache.get(l);return u||(u=Mi.parse(l),this._parseColorCache.set(l,u)),u}}class Fp{constructor(l,u,m=[],A,T=new D_,M=[]){this.registry=l,this.path=m,this.key=m.map((P=>`[${P}]`)).join(\"\"),this.scope=T,this.errors=M,this.expectedType=A,this._isConstant=u}parse(l,u,m,A,T={}){return u?this.concat(u,m,A)._parse(l,T):this._parse(l,T)}_parse(l,u){function m(A,T,M){return M===\"assert\"?new Wl(T,[A]):M===\"coerce\"?new Zu(T,[A]):A}if(l!==null&&typeof l!=\"string\"&&typeof l!=\"boolean\"&&typeof l!=\"number\"||(l=[\"literal\",l]),Array.isArray(l)){if(l.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let A=l[0];if(typeof A!=\"string\")return this.error(`Expression name must be a string, but found ${typeof A} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let T=this.registry[A];if(T){let M=T.parse(l,this);if(!M)return null;if(this.expectedType){let P=this.expectedType,L=M.type;if(P.kind!==\"string\"&&P.kind!==\"number\"&&P.kind!==\"boolean\"&&P.kind!==\"object\"&&P.kind!==\"array\"||L.kind!==\"value\"){if(P.kind===\"projectionDefinition\"&&[\"string\",\"array\"].includes(L.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(P.kind)&&[\"value\",\"string\"].includes(L.kind)||[\"padding\",\"numberArray\"].includes(P.kind)&&[\"value\",\"number\",\"array\"].includes(L.kind)||P.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(L.kind)||P.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(L.kind))M=m(M,P,u.typeAnnotation||\"coerce\");else if(this.checkSubtype(P,L))return null}else M=m(M,P,u.typeAnnotation||\"assert\")}if(!(M instanceof ru)&&M.type.kind!==\"resolvedImage\"&&this._isConstant(M)){let P=new Rn;try{M=new ru(M.type,M.evaluate(P))}catch(L){return this.error(L.message),null}}return M}return this.error(`Unknown expression \"${A}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return this.error(l===void 0?\"'undefined' value invalid. Use null instead.\":typeof l==\"object\"?'Bare objects invalid. Use [\"literal\", {...}] instead.':`Expected an array, but found ${typeof l} instead.`)}concat(l,u,m){let A=typeof l==\"number\"?this.path.concat(l):this.path,T=m?this.scope.concat(m):this.scope;return new Fp(this.registry,this._isConstant,A,u||null,T,this.errors)}error(l,...u){let m=`${this.key}${u.map((A=>`[${A}]`)).join(\"\")}`;this.errors.push(new Os(m,l))}checkSubtype(l,u){let m=bm(l,u);return m&&this.error(m),m}}class Ii{constructor(l,u){this.type=u.type,this.bindings=[].concat(l),this.result=u}evaluate(l){return this.result.evaluate(l)}eachChild(l){for(let u of this.bindings)l(u[1]);l(this.result)}static parse(l,u){if(l.length<4)return u.error(`Expected at least 3 arguments, but found ${l.length-1} instead.`);let m=[];for(let T=1;T<l.length-1;T+=2){let M=l[T];if(typeof M!=\"string\")return u.error(`Expected string, but found ${typeof M} instead.`,T);if(/[^a-zA-Z0-9_]/.test(M))return u.error(\"Variable names must contain only alphanumeric characters or '_'.\",T);let P=u.parse(l[T+1],T+1);if(!P)return null;m.push([M,P])}let A=u.parse(l[l.length-1],l.length-1,u.expectedType,m);return A?new Ii(m,A):null}outputDefined(){return this.result.outputDefined()}}class ii{constructor(l,u){this.type=u.type,this.name=l,this.boundExpression=u}static parse(l,u){if(l.length!==2||typeof l[1]!=\"string\")return u.error(\"'var' expression requires exactly one string literal argument.\");let m=l[1];return u.scope.has(m)?new ii(m,u.scope.get(m)):u.error(`Unknown variable \"${m}\". Make sure \"${m}\" has been bound in an enclosing \"let\" expression before using it.`,1)}evaluate(l){return this.boundExpression.evaluate(l)}eachChild(){}outputDefined(){return!1}}class Tm{constructor(l,u,m){this.type=l,this.index=u,this.input=m}static parse(l,u){if(l.length!==3)return u.error(`Expected 2 arguments, but found ${l.length-1} instead.`);let m=u.parse(l[1],1,Je),A=u.parse(l[2],2,fs(u.expectedType||fi));return m&&A?new Tm(A.type.itemType,m,A):null}evaluate(l){let u=this.index.evaluate(l),m=this.input.evaluate(l);if(u<0)throw new Yn(`Array index out of bounds: ${u} < 0.`);if(u>=m.length)throw new Yn(`Array index out of bounds: ${u} > ${m.length-1}.`);if(u!==Math.floor(u))throw new Yn(`Array index must be an integer, but found ${u} instead.`);return m[u]}eachChild(l){l(this.index),l(this.input)}outputDefined(){return!1}}class ke{constructor(l,u){this.type=gi,this.needle=l,this.haystack=u}static parse(l,u){if(l.length!==3)return u.error(`Expected 2 arguments, but found ${l.length-1} instead.`);let m=u.parse(l[1],1,fi),A=u.parse(l[2],2,fi);return m&&A?Op(m.type,[gi,Hr,Je,$h,fi])?new ke(m,A):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(m.type)} instead`):null}evaluate(l){let u=this.needle.evaluate(l),m=this.haystack.evaluate(l);if(!m)return!1;if(!hf(u,[\"boolean\",\"string\",\"number\",\"null\"]))throw new Yn(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(Xn(u))} instead.`);if(!hf(m,[\"string\",\"array\"]))throw new Yn(`Expected second argument to be of type array or string, but found ${Nn(Xn(m))} instead.`);return m.indexOf(u)>=0}eachChild(l){l(this.needle),l(this.haystack)}outputDefined(){return!0}}class or{constructor(l,u,m){this.type=Je,this.needle=l,this.haystack=u,this.fromIndex=m}static parse(l,u){if(l.length<=2||l.length>=5)return u.error(`Expected 2 or 3 arguments, but found ${l.length-1} instead.`);let m=u.parse(l[1],1,fi),A=u.parse(l[2],2,fi);if(!m||!A)return null;if(!Op(m.type,[gi,Hr,Je,$h,fi]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(m.type)} instead`);if(l.length===4){let T=u.parse(l[3],3,Je);return T?new or(m,A,T):null}return new or(m,A)}evaluate(l){let u=this.needle.evaluate(l),m=this.haystack.evaluate(l);if(!hf(u,[\"boolean\",\"string\",\"number\",\"null\"]))throw new Yn(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(Xn(u))} instead.`);let A;if(this.fromIndex&&(A=this.fromIndex.evaluate(l)),hf(m,[\"string\"])){let T=m.indexOf(u,A);return T===-1?-1:[...m.slice(0,T)].length}if(hf(m,[\"array\"]))return m.indexOf(u,A);throw new Yn(`Expected second argument to be of type array or string, but found ${Nn(Xn(m))} instead.`)}eachChild(l){l(this.needle),l(this.haystack),this.fromIndex&&l(this.fromIndex)}outputDefined(){return!1}}class Ar{constructor(l,u,m,A,T,M){this.inputType=l,this.type=u,this.input=m,this.cases=A,this.outputs=T,this.otherwise=M}static parse(l,u){if(l.length<5)return u.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if(l.length%2!=1)return u.error(\"Expected an even number of arguments.\");let m,A;u.expectedType&&u.expectedType.kind!==\"value\"&&(A=u.expectedType);let T={},M=[];for(let O=2;O<l.length-1;O+=2){let V=l[O],F=l[O+1];Array.isArray(V)||(V=[V]);let X=u.concat(O);if(V.length===0)return X.error(\"Expected at least one branch label.\");for(let nt of V){if(typeof nt!=\"number\"&&typeof nt!=\"string\")return X.error(\"Branch labels must be numbers or strings.\");if(typeof nt==\"number\"&&Math.abs(nt)>Number.MAX_SAFE_INTEGER)return X.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof nt==\"number\"&&Math.floor(nt)!==nt)return X.error(\"Numeric branch labels must be integer values.\");if(m){if(X.checkSubtype(m,Xn(nt)))return null}else m=Xn(nt);if(T[String(nt)]!==void 0)return X.error(\"Branch labels must be unique.\");T[String(nt)]=M.length}let j=u.parse(F,O,A);if(!j)return null;A=A||j.type,M.push(j)}let P=u.parse(l[1],1,fi);if(!P)return null;let L=u.parse(l[l.length-1],l.length-1,A);return L?P.type.kind!==\"value\"&&u.concat(1).checkSubtype(m,P.type)?null:new Ar(m,A,P,T,M,L):null}evaluate(l){let u=this.input.evaluate(l);return(Xn(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(l)}eachChild(l){l(this.input),this.outputs.forEach(l),l(this.otherwise)}outputDefined(){return this.outputs.every((l=>l.outputDefined()))&&this.otherwise.outputDefined()}}class _i{constructor(l,u,m){this.type=l,this.branches=u,this.otherwise=m}static parse(l,u){if(l.length<4)return u.error(`Expected at least 3 arguments, but found only ${l.length-1}.`);if(l.length%2!=0)return u.error(\"Expected an odd number of arguments.\");let m;u.expectedType&&u.expectedType.kind!==\"value\"&&(m=u.expectedType);let A=[];for(let M=1;M<l.length-1;M+=2){let P=u.parse(l[M],M,gi);if(!P)return null;let L=u.parse(l[M+1],M+1,m);if(!L)return null;A.push([P,L]),m=m||L.type}let T=u.parse(l[l.length-1],l.length-1,m);if(!T)return null;if(!m)throw new Error(\"Can't infer output type\");return new _i(m,A,T)}evaluate(l){for(let[u,m]of this.branches)if(u.evaluate(l))return m.evaluate(l);return this.otherwise.evaluate(l)}eachChild(l){for(let[u,m]of this.branches)l(u),l(m);l(this.otherwise)}outputDefined(){return this.branches.every((([l,u])=>u.outputDefined()))&&this.otherwise.outputDefined()}}class Xi{constructor(l,u,m,A){this.type=l,this.input=u,this.beginIndex=m,this.endIndex=A}static parse(l,u){if(l.length<=2||l.length>=5)return u.error(`Expected 2 or 3 arguments, but found ${l.length-1} instead.`);let m=u.parse(l[1],1,fi),A=u.parse(l[2],2,Je);if(!m||!A)return null;if(!Op(m.type,[fs(fi),Hr,fi]))return u.error(`Expected first argument to be of type array or string, but found ${Nn(m.type)} instead`);if(l.length===4){let T=u.parse(l[3],3,Je);return T?new Xi(m.type,m,A,T):null}return new Xi(m.type,m,A)}evaluate(l){let u=this.input.evaluate(l),m=this.beginIndex.evaluate(l),A;if(this.endIndex&&(A=this.endIndex.evaluate(l)),hf(u,[\"string\"]))return[...u].slice(m,A).join(\"\");if(hf(u,[\"array\"]))return u.slice(m,A);throw new Yn(`Expected first argument to be of type array or string, but found ${Nn(Xn(u))} instead.`)}eachChild(l){l(this.input),l(this.beginIndex),this.endIndex&&l(this.endIndex)}outputDefined(){return!1}}function no(d,l){let u=d.length-1,m,A,T=0,M=u,P=0;for(;T<=M;)if(P=Math.floor((T+M)/2),m=d[P],A=d[P+1],m<=l){if(P===u||l<A)return P;T=P+1}else{if(!(m>l))throw new Yn(\"Input is not a number.\");M=P-1}return 0}class zn{constructor(l,u,m){this.type=l,this.input=u,this.labels=[],this.outputs=[];for(let[A,T]of m)this.labels.push(A),this.outputs.push(T)}static parse(l,u){if(l.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return u.error(\"Expected an even number of arguments.\");let m=u.parse(l[1],1,Je);if(!m)return null;let A=[],T=null;u.expectedType&&u.expectedType.kind!==\"value\"&&(T=u.expectedType);for(let M=1;M<l.length;M+=2){let P=M===1?-1/0:l[M],L=l[M+1],O=M,V=M+1;if(typeof P!=\"number\")return u.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',O);if(A.length&&A[A.length-1][0]>=P)return u.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',O);let F=u.parse(L,V,T);if(!F)return null;T=T||F.type,A.push([P,F])}return new zn(T,m,A)}evaluate(l){let u=this.labels,m=this.outputs;if(u.length===1)return m[0].evaluate(l);let A=this.input.evaluate(l);if(A<=u[0])return m[0].evaluate(l);let T=u.length;return A>=u[T-1]?m[T-1].evaluate(l):m[no(u,A)].evaluate(l)}eachChild(l){l(this.input);for(let u of this.outputs)l(u)}outputDefined(){return this.outputs.every((l=>l.outputDefined()))}}function iu(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,\"default\")?d.default:d}var Ku,qh,Np=(function(){if(qh)return Ku;function d(l,u,m,A){this.cx=3*l,this.bx=3*(m-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*u,this.by=3*(A-u)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=u,this.p2x=m,this.p2y=A}return qh=1,Ku=d,d.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,u){if(u===void 0&&(u=1e-6),l<0)return 0;if(l>1)return 1;for(var m=l,A=0;A<8;A++){var T=this.sampleCurveX(m)-l;if(Math.abs(T)<u)return m;var M=this.sampleCurveDerivativeX(m);if(Math.abs(M)<1e-6)break;m-=T/M}var P=0,L=1;for(m=l,A=0;A<20&&(T=this.sampleCurveX(m),!(Math.abs(T-l)<u));A++)l>T?P=m:L=m,m=.5*(L-P)+P;return m},solve:function(l,u){return this.sampleCurveY(this.solveCurveX(l,u))}},Ku})(),ql=iu(Np);class Li{constructor(l,u,m,A,T){this.type=l,this.operator=u,this.interpolation=m,this.input=A,this.labels=[],this.outputs=[];for(let[M,P]of T)this.labels.push(M),this.outputs.push(P)}static interpolationFactor(l,u,m,A){let T=0;if(l.name===\"exponential\")T=Hl(u,l.base,m,A);else if(l.name===\"linear\")T=Hl(u,1,m,A);else if(l.name===\"cubic-bezier\"){let M=l.controlPoints;T=new ql(M[0],M[1],M[2],M[3]).solve(Hl(u,1,m,A))}return T}static parse(l,u){let[m,A,T,...M]=l;if(!Array.isArray(A)||A.length===0)return u.error(\"Expected an interpolation type expression.\",1);if(A[0]===\"linear\")A={name:\"linear\"};else if(A[0]===\"exponential\"){let O=A[1];if(typeof O!=\"number\")return u.error(\"Exponential interpolation requires a numeric base.\",1,1);A={name:\"exponential\",base:O}}else{if(A[0]!==\"cubic-bezier\")return u.error(`Unknown interpolation type ${String(A[0])}`,1,0);{let O=A.slice(1);if(O.length!==4||O.some((V=>typeof V!=\"number\"||V<0||V>1)))return u.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);A={name:\"cubic-bezier\",controlPoints:O}}}if(l.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return u.error(\"Expected an even number of arguments.\");if(T=u.parse(T,2,Je),!T)return null;let P=[],L=null;m!==\"interpolate-hcl\"&&m!==\"interpolate-lab\"||u.expectedType==Dp?u.expectedType&&u.expectedType.kind!==\"value\"&&(L=u.expectedType):L=fl;for(let O=0;O<M.length;O+=2){let V=M[O],F=M[O+1],X=O+3,j=O+4;if(typeof V!=\"number\")return u.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',X);if(P.length&&P[P.length-1][0]>=V)return u.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',X);let nt=u.parse(F,j,L);if(!nt)return null;L=L||nt.type,P.push([V,nt])}return pl(L,Je)||pl(L,kp)||pl(L,fl)||pl(L,_m)||pl(L,vm)||pl(L,Dp)||pl(L,tu)||pl(L,fs(Je))?new Li(L,m,A,T,P):u.error(`Type ${Nn(L)} is not interpolatable.`)}evaluate(l){let u=this.labels,m=this.outputs;if(u.length===1)return m[0].evaluate(l);let A=this.input.evaluate(l);if(A<=u[0])return m[0].evaluate(l);let T=u.length;if(A>=u[T-1])return m[T-1].evaluate(l);let M=no(u,A),P=Li.interpolationFactor(this.interpolation,A,u[M],u[M+1]),L=m[M].evaluate(l),O=m[M+1].evaluate(l);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return Gl(L,O,P);case\"color\":return Mi.interpolate(L,O,P);case\"padding\":return Fr.interpolate(L,O,P);case\"colorArray\":return Hn.interpolate(L,O,P);case\"numberArray\":return jo.interpolate(L,O,P);case\"variableAnchorOffsetCollection\":return ta.interpolate(L,O,P);case\"array\":return Bp(L,O,P);case\"projectionDefinition\":return ra.interpolate(L,O,P)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return Mi.interpolate(L,O,P,\"hcl\");case\"colorArray\":return Hn.interpolate(L,O,P,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return Mi.interpolate(L,O,P,\"lab\");case\"colorArray\":return Hn.interpolate(L,O,P,\"lab\")}}}eachChild(l){l(this.input);for(let u of this.outputs)l(u)}outputDefined(){return this.outputs.every((l=>l.outputDefined()))}}function Hl(d,l,u,m){let A=m-u,T=d-u;return A===0?0:l===1?T/A:(Math.pow(l,T)-1)/(Math.pow(l,A)-1)}let Ls={color:Mi.interpolate,number:Gl,padding:Fr.interpolate,numberArray:jo.interpolate,colorArray:Hn.interpolate,variableAnchorOffsetCollection:ta.interpolate,array:Bp};class ff{constructor(l,u){this.type=l,this.args=u}static parse(l,u){if(l.length<2)return u.error(\"Expected at least one argument.\");let m=null,A=u.expectedType;A&&A.kind!==\"value\"&&(m=A);let T=[];for(let P of l.slice(1)){let L=u.parse(P,1+T.length,m,void 0,{typeAnnotation:\"omit\"});if(!L)return null;m=m||L.type,T.push(L)}if(!m)throw new Error(\"No output type\");let M=A&&T.some((P=>bm(A,P.type)));return new ff(M?fi:m,T)}evaluate(l){let u,m=null,A=0;for(let T of this.args)if(A++,m=T.evaluate(l),m&&m instanceof ea&&!m.available&&(u||(u=m.name),m=null,A===this.args.length&&(m=u)),m!==null)break;return m}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every((l=>l.outputDefined()))}}function ko(d,l){return d===\"==\"||d===\"!=\"?l.kind===\"boolean\"||l.kind===\"string\"||l.kind===\"number\"||l.kind===\"null\"||l.kind===\"value\":l.kind===\"string\"||l.kind===\"number\"||l.kind===\"value\"}function YA(d,l,u,m){return m.compare(l,u)===0}function Qu(d,l,u){let m=d!==\"==\"&&d!==\"!=\";return class a8t{constructor(T,M,P){this.type=gi,this.lhs=T,this.rhs=M,this.collator=P,this.hasUntypedArgument=T.type.kind===\"value\"||M.type.kind===\"value\"}static parse(T,M){if(T.length!==3&&T.length!==4)return M.error(\"Expected two or three arguments.\");let P=T[0],L=M.parse(T[1],1,fi);if(!L)return null;if(!ko(P,L.type))return M.concat(1).error(`\"${P}\" comparisons are not supported for type '${Nn(L.type)}'.`);let O=M.parse(T[2],2,fi);if(!O)return null;if(!ko(P,O.type))return M.concat(2).error(`\"${P}\" comparisons are not supported for type '${Nn(O.type)}'.`);if(L.type.kind!==O.type.kind&&L.type.kind!==\"value\"&&O.type.kind!==\"value\")return M.error(`Cannot compare types '${Nn(L.type)}' and '${Nn(O.type)}'.`);m&&(L.type.kind===\"value\"&&O.type.kind!==\"value\"?L=new Wl(O.type,[L]):L.type.kind!==\"value\"&&O.type.kind===\"value\"&&(O=new Wl(L.type,[O])));let V=null;if(T.length===4){if(L.type.kind!==\"string\"&&O.type.kind!==\"string\"&&L.type.kind!==\"value\"&&O.type.kind!==\"value\")return M.error(\"Cannot use collator to compare non-string types.\");if(V=M.parse(T[3],3,jA),!V)return null}return new a8t(L,O,V)}evaluate(T){let M=this.lhs.evaluate(T),P=this.rhs.evaluate(T);if(m&&this.hasUntypedArgument){let L=Xn(M),O=Xn(P);if(L.kind!==O.kind||L.kind!==\"string\"&&L.kind!==\"number\")throw new Yn(`Expected arguments for \"${d}\" to be (string, string) or (number, number), but found (${L.kind}, ${O.kind}) instead.`)}if(this.collator&&!m&&this.hasUntypedArgument){let L=Xn(M),O=Xn(P);if(L.kind!==\"string\"||O.kind!==\"string\")return l(T,M,P)}return this.collator?u(T,M,P,this.collator.evaluate(T)):l(T,M,P)}eachChild(T){T(this.lhs),T(this.rhs),this.collator&&T(this.collator)}outputDefined(){return!0}}}let Sm=Qu(\"==\",(function(d,l,u){return l===u}),YA),$_=Qu(\"!=\",(function(d,l,u){return l!==u}),(function(d,l,u,m){return!YA(0,l,u,m)})),Hh=Qu(\"<\",(function(d,l,u){return l<u}),(function(d,l,u,m){return m.compare(l,u)<0})),zp=Qu(\">\",(function(d,l,u){return l>u}),(function(d,l,u,m){return m.compare(l,u)>0})),Up=Qu(\"<=\",(function(d,l,u){return l<=u}),(function(d,l,u,m){return m.compare(l,u)<=0})),G_=Qu(\">=\",(function(d,l,u){return l>=u}),(function(d,l,u,m){return m.compare(l,u)>=0}));class Ac{constructor(l,u,m){this.type=jA,this.locale=m,this.caseSensitive=l,this.diacriticSensitive=u}static parse(l,u){if(l.length!==2)return u.error(\"Expected one argument.\");let m=l[1];if(typeof m!=\"object\"||Array.isArray(m))return u.error(\"Collator options argument must be an object.\");let A=u.parse(m[\"case-sensitive\"]!==void 0&&m[\"case-sensitive\"],1,gi);if(!A)return null;let T=u.parse(m[\"diacritic-sensitive\"]!==void 0&&m[\"diacritic-sensitive\"],1,gi);if(!T)return null;let M=null;return m.locale&&(M=u.parse(m.locale,1,Hr),!M)?null:new Ac(A,T,M)}evaluate(l){return new U_(this.caseSensitive.evaluate(l),this.diacriticSensitive.evaluate(l),this.locale?this.locale.evaluate(l):null)}eachChild(l){l(this.caseSensitive),l(this.diacriticSensitive),this.locale&&l(this.locale)}outputDefined(){return!1}}class pe{constructor(l,u,m,A,T,M){this.type=Hr,this.number=l,this.locale=u,this.currency=m,this.unit=A,this.minFractionDigits=T,this.maxFractionDigits=M}static parse(l,u){if(l.length!==3)return u.error(\"Expected two arguments.\");let m=u.parse(l[1],1,Je);if(!m)return null;let A=l[2];if(typeof A!=\"object\"||Array.isArray(A))return u.error(\"NumberFormat options argument must be an object.\");let T=null;if(A.locale&&(T=u.parse(A.locale,1,Hr),!T))return null;let M=null;if(A.currency&&(M=u.parse(A.currency,1,Hr),!M))return null;let P=null;if(A.unit&&(P=u.parse(A.unit,1,Hr),!P))return null;if(M&&P)return u.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let L=null;if(A[\"min-fraction-digits\"]&&(L=u.parse(A[\"min-fraction-digits\"],1,Je),!L))return null;let O=null;return A[\"max-fraction-digits\"]&&(O=u.parse(A[\"max-fraction-digits\"],1,Je),!O)?null:new pe(m,T,M,P,L,O)}evaluate(l){return new Intl.NumberFormat(this.locale?this.locale.evaluate(l):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(l):void 0,unit:this.unit?this.unit.evaluate(l):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(l):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(l):void 0}).format(this.number.evaluate(l))}eachChild(l){l(this.number),this.locale&&l(this.locale),this.currency&&l(this.currency),this.unit&&l(this.unit),this.minFractionDigits&&l(this.minFractionDigits),this.maxFractionDigits&&l(this.maxFractionDigits)}outputDefined(){return!1}}class De{constructor(l){this.type=Rp,this.sections=l}static parse(l,u){if(l.length<2)return u.error(\"Expected at least one argument.\");let m=l[1];if(!Array.isArray(m)&&typeof m==\"object\")return u.error(\"First argument must be an image or text section.\");let A=[],T=!1;for(let M=1;M<=l.length-1;++M){let P=l[M];if(T&&typeof P==\"object\"&&!Array.isArray(P)){T=!1;let L=null;if(P[\"font-scale\"]&&(L=u.parse(P[\"font-scale\"],1,Je),!L))return null;let O=null;if(P[\"text-font\"]&&(O=u.parse(P[\"text-font\"],1,fs(Hr)),!O))return null;let V=null;if(P[\"text-color\"]&&(V=u.parse(P[\"text-color\"],1,fl),!V))return null;let F=null;if(P[\"vertical-align\"]){if(typeof P[\"vertical-align\"]==\"string\"&&!l2.includes(P[\"vertical-align\"]))return u.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${P[\"vertical-align\"]}' instead.`);if(F=u.parse(P[\"vertical-align\"],1,Hr),!F)return null}let X=A[A.length-1];X.scale=L,X.font=O,X.textColor=V,X.verticalAlign=F}else{let L=u.parse(l[M],1,fi);if(!L)return null;let O=L.type.kind;if(O!==\"string\"&&O!==\"value\"&&O!==\"null\"&&O!==\"resolvedImage\")return u.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");T=!0,A.push({content:L,scale:null,font:null,textColor:null,verticalAlign:null})}}return new De(A)}evaluate(l){return new yo(this.sections.map((u=>{let m=u.content.evaluate(l);return Xn(m)===uf?new qA(\"\",m,null,null,null,u.verticalAlign?u.verticalAlign.evaluate(l):null):new qA(wm(m),null,u.scale?u.scale.evaluate(l):null,u.font?u.font.evaluate(l).join(\",\"):null,u.textColor?u.textColor.evaluate(l):null,u.verticalAlign?u.verticalAlign.evaluate(l):null)})))}eachChild(l){for(let u of this.sections)l(u.content),u.scale&&l(u.scale),u.font&&l(u.font),u.textColor&&l(u.textColor),u.verticalAlign&&l(u.verticalAlign)}outputDefined(){return!1}}class Ke{constructor(l){this.type=uf,this.input=l}static parse(l,u){if(l.length!==2)return u.error(\"Expected two arguments.\");let m=u.parse(l[1],1,Hr);return m?new Ke(m):u.error(\"No image name provided.\")}evaluate(l){let u=this.input.evaluate(l),m=ea.fromString(u);return m&&l.availableImages&&(m.available=l.availableImages.indexOf(u)>-1),m}eachChild(l){l(this.input)}outputDefined(){return!1}}class Be{constructor(l){this.type=Je,this.input=l}static parse(l,u){if(l.length!==2)return u.error(`Expected 1 argument, but found ${l.length-1} instead.`);let m=u.parse(l[1],1);return m?m.type.kind!==\"array\"&&m.type.kind!==\"string\"&&m.type.kind!==\"value\"?u.error(`Expected argument of type string or array, but found ${Nn(m.type)} instead.`):new Be(m):null}evaluate(l){let u=this.input.evaluate(l);if(typeof u==\"string\")return[...u].length;if(Array.isArray(u))return u.length;throw new Yn(`Expected value to be of type string or array, but found ${Nn(Xn(u))} instead.`)}eachChild(l){l(this.input)}outputDefined(){return!1}}let v=8192;function An(d,l){let u=(180+d[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d[1]*Math.PI/360)))/360,A=Math.pow(2,l.z);return[Math.round(u*A*v),Math.round(m*A*v)]}function Ni(d,l){let u=Math.pow(2,l.z);return[(A=(d[0]/v+l.x)/u,360*A-180),(m=(d[1]/v+l.y)/u,360/Math.PI*Math.atan(Math.exp((180-360*m)*Math.PI/180))-90)];var m,A}function _t(d,l){d[0]=Math.min(d[0],l[0]),d[1]=Math.min(d[1],l[1]),d[2]=Math.max(d[2],l[0]),d[3]=Math.max(d[3],l[1])}function _o(d,l){return!(d[0]<=l[0]||d[2]>=l[2]||d[1]<=l[1]||d[3]>=l[3])}function $a(d,l,u){let m=d[0]-l[0],A=d[1]-l[1],T=d[0]-u[0],M=d[1]-u[1];return m*M-T*A==0&&m*T<=0&&A*M<=0}function Ro(d,l,u,m){return(A=[m[0]-u[0],m[1]-u[1]])[0]*(T=[l[0]-d[0],l[1]-d[1]])[1]-A[1]*T[0]!=0&&!(!pf(d,l,u,m)||!pf(u,m,d,l));var A,T}function Bi(d,l,u){for(let m of u)for(let A=0;A<m.length-1;++A)if(Ro(d,l,m[A],m[A+1]))return!0;return!1}function un(d,l,u=!1){let m=!1;for(let P of l)for(let L=0;L<P.length-1;L++){if($a(d,P[L],P[L+1]))return u;(T=P[L])[1]>(A=d)[1]!=(M=P[L+1])[1]>A[1]&&A[0]<(M[0]-T[0])*(A[1]-T[1])/(M[1]-T[1])+T[0]&&(m=!m)}var A,T,M;return m}function Ko(d,l){for(let u of l)if(un(d,u))return!0;return!1}function Di(d,l){for(let u of d)if(!un(u,l))return!1;for(let u=0;u<d.length-1;++u)if(Bi(d[u],d[u+1],l))return!1;return!0}function Zi(d,l){for(let u of l)if(Di(d,u))return!0;return!1}function pf(d,l,u,m){let A=m[0]-u[0],T=m[1]-u[1],M=(d[0]-u[0])*T-A*(d[1]-u[1]),P=(l[0]-u[0])*T-A*(l[1]-u[1]);return M>0&&P<0||M<0&&P>0}function W_(d,l,u){let m=[];for(let A=0;A<d.length;A++){let T=[];for(let M=0;M<d[A].length;M++){let P=An(d[A][M],u);_t(l,P),T.push(P)}m.push(T)}return m}function u2(d,l,u){let m=[];for(let A=0;A<d.length;A++){let T=W_(d[A],l,u);m.push(T)}return m}function XA(d,l,u,m){if(d[0]<u[0]||d[0]>u[2]){let A=.5*m,T=d[0]-u[0]>A?-m:u[0]-d[0]>A?m:0;T===0&&(T=d[0]-u[2]>A?-m:u[2]-d[0]>A?m:0),d[0]+=T}_t(l,d)}function ml(d,l,u,m){let A=Math.pow(2,m.z)*v,T=[m.x*v,m.y*v],M=[];for(let P of d)for(let L of P){let O=[L.x+T[0],L.y+T[1]];XA(O,l,u,A),M.push(O)}return M}function mf(d,l,u,m){let A=Math.pow(2,m.z)*v,T=[m.x*v,m.y*v],M=[];for(let L of d){let O=[];for(let V of L){let F=[V.x+T[0],V.y+T[1]];_t(l,F),O.push(F)}M.push(O)}if(l[2]-l[0]<=A/2){(P=l)[0]=P[1]=1/0,P[2]=P[3]=-1/0;for(let L of M)for(let O of L)XA(O,l,u,A)}var P;return M}class Bs{constructor(l,u){this.type=gi,this.geojson=l,this.geometries=u}static parse(l,u){if(l.length!==2)return u.error(`'within' expression requires exactly one argument, but found ${l.length-1} instead.`);if(df(l[1])){let m=l[1];if(m.type===\"FeatureCollection\"){let A=[];for(let T of m.features){let{type:M,coordinates:P}=T.geometry;M===\"Polygon\"&&A.push(P),M===\"MultiPolygon\"&&A.push(...P)}if(A.length)return new Bs(m,{type:\"MultiPolygon\",coordinates:A})}else if(m.type===\"Feature\"){let A=m.geometry.type;if(A===\"Polygon\"||A===\"MultiPolygon\")return new Bs(m,m.geometry)}else if(m.type===\"Polygon\"||m.type===\"MultiPolygon\")return new Bs(m,m)}return u.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(l){if(l.geometry()!=null&&l.canonicalID()!=null){if(l.geometryType()===\"Point\")return(function(u,m){let A=[1/0,1/0,-1/0,-1/0],T=[1/0,1/0,-1/0,-1/0],M=u.canonicalID();if(m.type===\"Polygon\"){let P=W_(m.coordinates,T,M),L=ml(u.geometry(),A,T,M);if(!_o(A,T))return!1;for(let O of L)if(!un(O,P))return!1}if(m.type===\"MultiPolygon\"){let P=u2(m.coordinates,T,M),L=ml(u.geometry(),A,T,M);if(!_o(A,T))return!1;for(let O of L)if(!Ko(O,P))return!1}return!0})(l,this.geometries);if(l.geometryType()===\"LineString\")return(function(u,m){let A=[1/0,1/0,-1/0,-1/0],T=[1/0,1/0,-1/0,-1/0],M=u.canonicalID();if(m.type===\"Polygon\"){let P=W_(m.coordinates,T,M),L=mf(u.geometry(),A,T,M);if(!_o(A,T))return!1;for(let O of L)if(!Di(O,P))return!1}if(m.type===\"MultiPolygon\"){let P=u2(m.coordinates,T,M),L=mf(u.geometry(),A,T,M);if(!_o(A,T))return!1;for(let O of L)if(!Zi(O,P))return!1}return!0})(l,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Mm=class{constructor(d=[],l=(u,m)=>u<m?-1:u>m?1:0){if(this.data=d,this.length=this.data.length,this.compare=l,this.length>0)for(let u=(this.length>>1)-1;u>=0;u--)this._down(u)}push(d){this.data.push(d),this._up(this.length++)}pop(){if(this.length===0)return;let d=this.data[0],l=this.data.pop();return--this.length>0&&(this.data[0]=l,this._down(0)),d}peek(){return this.data[0]}_up(d){let{data:l,compare:u}=this,m=l[d];for(;d>0;){let A=d-1>>1,T=l[A];if(u(m,T)>=0)break;l[d]=T,d=A}l[d]=m}_down(d){let{data:l,compare:u}=this,m=this.length>>1,A=l[d];for(;d<m;){let T=1+(d<<1),M=T+1;if(M<this.length&&u(l[M],l[T])<0&&(T=M),u(l[T],A)>=0)break;l[d]=l[T],d=T}l[d]=A}};function q_(d,l,u=0,m=d.length-1,A=ni){for(;m>u;){if(m-u>600){let L=m-u+1,O=l-u+1,V=Math.log(L),F=.5*Math.exp(2*V/3),X=.5*Math.sqrt(V*F*(L-F)/L)*(O-L/2<0?-1:1);q_(d,l,Math.max(u,Math.floor(l-O*F/L+X)),Math.min(m,Math.floor(l+(L-O)*F/L+X)),A)}let T=d[l],M=u,P=m;for(gl(d,u,l),A(d[m],T)>0&&gl(d,u,m);M<P;){for(gl(d,M,P),M++,P--;A(d[M],T)<0;)M++;for(;A(d[P],T)>0;)P--}A(d[u],T)===0?gl(d,u,P):(P++,gl(d,P,m)),P<=l&&(u=P+1),l<=P&&(m=P-1)}}function gl(d,l,u){let m=d[l];d[l]=d[u],d[u]=m}function ni(d,l){return d<l?-1:d>l?1:0}function Tt(d,l){if(d.length<=1)return[d];let u=[],m,A;for(let T of d){let M=Em(T);M!==0&&(T.area=Math.abs(M),A===void 0&&(A=M<0),A===M<0?(m&&u.push(m),m=[T]):m.push(T))}if(m&&u.push(m),l>1)for(let T=0;T<u.length;T++)u[T].length<=l||(q_(u[T],l,1,u[T].length-1,Ur),u[T]=u[T].slice(0,l));return u}function Ur(d,l){return l.area-d.area}function Em(d){let l=0;for(let u,m,A=0,T=d.length,M=T-1;A<T;M=A++)u=d[A],m=d[M],l+=(m.x-u.x)*(u.y+m.y);return l}let h2=1/298.257223563,d2=h2*(2-h2),f2=Math.PI/180;class H_{constructor(l){let u=6378.137*f2*1e3,m=Math.cos(l*f2),A=1/(1-d2*(1-m*m)),T=Math.sqrt(A);this.kx=u*T*m,this.ky=u*T*A*(1-d2)}distance(l,u){let m=this.wrap(l[0]-u[0])*this.kx,A=(l[1]-u[1])*this.ky;return Math.sqrt(m*m+A*A)}pointOnLine(l,u){let m,A,T,M,P=1/0;for(let L=0;L<l.length-1;L++){let O=l[L][0],V=l[L][1],F=this.wrap(l[L+1][0]-O)*this.kx,X=(l[L+1][1]-V)*this.ky,j=0;F===0&&X===0||(j=(this.wrap(u[0]-O)*this.kx*F+(u[1]-V)*this.ky*X)/(F*F+X*X),j>1?(O=l[L+1][0],V=l[L+1][1]):j>0&&(O+=F/this.kx*j,V+=X/this.ky*j)),F=this.wrap(u[0]-O)*this.kx,X=(u[1]-V)*this.ky;let nt=F*F+X*X;nt<P&&(P=nt,m=O,A=V,T=L,M=j)}return{point:[m,A],index:T,t:Math.max(0,Math.min(1,M))}}wrap(l){for(;l<-180;)l+=360;for(;l>180;)l-=360;return l}}function bt(d,l){return l[0]-d[0]}function Pm(d){return d[1]-d[0]+1}function Ju(d,l){return d[1]>=d[0]&&d[1]<l}function Y_(d,l){if(d[0]>d[1])return[null,null];let u=Pm(d);if(l){if(u===2)return[d,null];let A=Math.floor(u/2);return[[d[0],d[0]+A],[d[0]+A,d[1]]]}if(u===1)return[d,null];let m=Math.floor(u/2)-1;return[[d[0],d[0]+m],[d[0]+m+1,d[1]]]}function ZA(d,l){if(!Ju(l,d.length))return[1/0,1/0,-1/0,-1/0];let u=[1/0,1/0,-1/0,-1/0];for(let m=l[0];m<=l[1];++m)_t(u,d[m]);return u}function KA(d){let l=[1/0,1/0,-1/0,-1/0];for(let u of d)for(let m of u)_t(l,m);return l}function p2(d){return d[0]!==-1/0&&d[1]!==-1/0&&d[2]!==1/0&&d[3]!==1/0}function QA(d,l,u){if(!p2(d)||!p2(l))return NaN;let m=0,A=0;return d[2]<l[0]&&(m=l[0]-d[2]),d[0]>l[2]&&(m=d[0]-l[2]),d[1]>l[3]&&(A=d[1]-l[3]),d[3]<l[1]&&(A=l[1]-d[3]),u.distance([0,0],[m,A])}function Yh(d,l,u){let m=u.pointOnLine(l,d);return u.distance(d,m.point)}function Cm(d,l,u,m,A){let T=Math.min(Yh(d,[u,m],A),Yh(l,[u,m],A)),M=Math.min(Yh(u,[d,l],A),Yh(m,[d,l],A));return Math.min(T,M)}function nu(d,l,u,m,A){if(!Ju(l,d.length)||!Ju(m,u.length))return 1/0;let T=1/0;for(let M=l[0];M<l[1];++M){let P=d[M],L=d[M+1];for(let O=m[0];O<m[1];++O){let V=u[O],F=u[O+1];if(Ro(P,L,V,F))return 0;T=Math.min(T,Cm(P,L,V,F,A))}}return T}function ps(d,l,u,m,A){if(!Ju(l,d.length)||!Ju(m,u.length))return NaN;let T=1/0;for(let M=l[0];M<=l[1];++M)for(let P=m[0];P<=m[1];++P)if(T=Math.min(T,A.distance(d[M],u[P])),T===0)return T;return T}function TM(d,l,u){if(un(d,l,!0))return 0;let m=1/0;for(let A of l){let T=A[0],M=A[A.length-1];if(T!==M&&(m=Math.min(m,Yh(d,[M,T],u)),m===0))return m;let P=u.pointOnLine(A,d);if(m=Math.min(m,u.distance(d,P.point)),m===0)return m}return m}function m2(d,l,u,m){if(!Ju(l,d.length))return NaN;for(let T=l[0];T<=l[1];++T)if(un(d[T],u,!0))return 0;let A=1/0;for(let T=l[0];T<l[1];++T){let M=d[T],P=d[T+1];for(let L of u)for(let O=0,V=L.length,F=V-1;O<V;F=O++){let X=L[F],j=L[O];if(Ro(M,P,X,j))return 0;A=Math.min(A,Cm(M,P,X,j,m))}}return A}function Vi(d,l){for(let u of d)for(let m of u)if(un(m,l,!0))return!0;return!1}function X_(d,l,u,m=1/0){let A=KA(d),T=KA(l);if(m!==1/0&&QA(A,T,u)>=m)return m;if(_o(A,T)){if(Vi(d,l))return 0}else if(Vi(l,d))return 0;let M=1/0;for(let P of d)for(let L=0,O=P.length,V=O-1;L<O;V=L++){let F=P[V],X=P[L];for(let j of l)for(let nt=0,st=j.length,pt=st-1;nt<st;pt=nt++){let mt=j[pt],vt=j[nt];if(Ro(F,X,mt,vt))return 0;M=Math.min(M,Cm(F,X,mt,vt,u))}}return M}function g2(d,l,u,m,A,T){if(!T)return;let M=QA(ZA(m,T),A,u);M<l&&d.push([M,T,[0,0]])}function Im(d,l,u,m,A,T,M){if(!T||!M)return;let P=QA(ZA(m,T),ZA(A,M),u);P<l&&d.push([P,T,M])}function JA(d,l,u,m,A=1/0){let T=Math.min(m.distance(d[0],u[0][0]),A);if(T===0)return T;let M=new Mm([[0,[0,d.length-1],[0,0]]],bt),P=KA(u);for(;M.length>0;){let L=M.pop();if(L[0]>=T)continue;let O=L[1],V=l?50:100;if(Pm(O)<=V){if(!Ju(O,d.length))return NaN;if(l){let F=m2(d,O,u,m);if(isNaN(F)||F===0)return F;T=Math.min(T,F)}else for(let F=O[0];F<=O[1];++F){let X=TM(d[F],u,m);if(T=Math.min(T,X),T===0)return 0}}else{let F=Y_(O,l);g2(M,T,m,d,P,F[0]),g2(M,T,m,d,P,F[1])}}return T}function ty(d,l,u,m,A,T=1/0){let M=Math.min(T,A.distance(d[0],u[0]));if(M===0)return M;let P=new Mm([[0,[0,d.length-1],[0,u.length-1]]],bt);for(;P.length>0;){let L=P.pop();if(L[0]>=M)continue;let O=L[1],V=L[2],F=l?50:100,X=m?50:100;if(Pm(O)<=F&&Pm(V)<=X){if(!Ju(O,d.length)&&Ju(V,u.length))return NaN;let j;if(l&&m)j=nu(d,O,u,V,A),M=Math.min(M,j);else if(l&&!m){let nt=d.slice(O[0],O[1]+1);for(let st=V[0];st<=V[1];++st)if(j=Yh(u[st],nt,A),M=Math.min(M,j),M===0)return M}else if(!l&&m){let nt=u.slice(V[0],V[1]+1);for(let st=O[0];st<=O[1];++st)if(j=Yh(d[st],nt,A),M=Math.min(M,j),M===0)return M}else j=ps(d,O,u,V,A),M=Math.min(M,j)}else{let j=Y_(O,l),nt=Y_(V,m);Im(P,M,A,d,u,j[0],nt[0]),Im(P,M,A,d,u,j[0],nt[1]),Im(P,M,A,d,u,j[1],nt[0]),Im(P,M,A,d,u,j[1],nt[1])}}return M}function Z_(d){return d.type===\"MultiPolygon\"?d.coordinates.map((l=>({type:\"Polygon\",coordinates:l}))):d.type===\"MultiLineString\"?d.coordinates.map((l=>({type:\"LineString\",coordinates:l}))):d.type===\"MultiPoint\"?d.coordinates.map((l=>({type:\"Point\",coordinates:l}))):[d]}class tn{constructor(l,u){this.type=Je,this.geojson=l,this.geometries=u}static parse(l,u){if(l.length!==2)return u.error(`'distance' expression requires exactly one argument, but found ${l.length-1} instead.`);if(df(l[1])){let m=l[1];if(m.type===\"FeatureCollection\")return new tn(m,m.features.map((A=>Z_(A.geometry))).flat());if(m.type===\"Feature\")return new tn(m,Z_(m.geometry));if(\"type\"in m&&\"coordinates\"in m)return new tn(m,Z_(m))}return u.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(l){if(l.geometry()!=null&&l.canonicalID()!=null){if(l.geometryType()===\"Point\")return(function(u,m){let A=u.geometry(),T=A.flat().map((L=>Ni([L.x,L.y],u.canonical)));if(A.length===0)return NaN;let M=new H_(T[0][1]),P=1/0;for(let L of m){switch(L.type){case\"Point\":P=Math.min(P,ty(T,!1,[L.coordinates],!1,M,P));break;case\"LineString\":P=Math.min(P,ty(T,!1,L.coordinates,!0,M,P));break;case\"Polygon\":P=Math.min(P,JA(T,!1,L.coordinates,M,P))}if(P===0)return P}return P})(l,this.geometries);if(l.geometryType()===\"LineString\")return(function(u,m){let A=u.geometry(),T=A.flat().map((L=>Ni([L.x,L.y],u.canonical)));if(A.length===0)return NaN;let M=new H_(T[0][1]),P=1/0;for(let L of m){switch(L.type){case\"Point\":P=Math.min(P,ty(T,!0,[L.coordinates],!1,M,P));break;case\"LineString\":P=Math.min(P,ty(T,!0,L.coordinates,!0,M,P));break;case\"Polygon\":P=Math.min(P,JA(T,!0,L.coordinates,M,P))}if(P===0)return P}return P})(l,this.geometries);if(l.geometryType()===\"Polygon\")return(function(u,m){let A=u.geometry();if(A.length===0||A[0].length===0)return NaN;let T=Tt(A,0).map((L=>L.map((O=>O.map((V=>Ni([V.x,V.y],u.canonical))))))),M=new H_(T[0][0][0][1]),P=1/0;for(let L of m)for(let O of T){switch(L.type){case\"Point\":P=Math.min(P,JA([L.coordinates],!1,O,M,P));break;case\"LineString\":P=Math.min(P,JA(L.coordinates,!0,O,M,P));break;case\"Polygon\":P=Math.min(P,X_(O,L.coordinates,M,P))}if(P===0)return P}return P})(l,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class gf{constructor(l){this.type=fi,this.key=l}static parse(l,u){if(l.length!==2)return u.error(`Expected 1 argument, but found ${l.length-1} instead.`);let m=l[1];return m==null?u.error(\"Global state property must be defined.\"):typeof m!=\"string\"?u.error(`Global state property must be string, but found ${typeof l[1]} instead.`):new gf(m)}evaluate(l){var u;let m=(u=l.globals)===null||u===void 0?void 0:u.globalState;return m&&Object.keys(m).length!==0?xm(m,this.key):null}eachChild(){}outputDefined(){return!1}}let Af={\"==\":Sm,\"!=\":$_,\">\":zp,\"<\":Hh,\">=\":G_,\"<=\":Up,array:Wl,at:Tm,boolean:Wl,case:_i,coalesce:ff,collator:Ac,format:De,image:Ke,in:ke,\"index-of\":or,interpolate:Li,\"interpolate-hcl\":Li,\"interpolate-lab\":Li,length:Be,let:Ii,literal:ru,match:Ar,number:Wl,\"number-format\":pe,object:Wl,slice:Xi,step:zn,string:Wl,\"to-boolean\":Zu,\"to-color\":Zu,\"to-number\":Zu,\"to-string\":Zu,var:ii,within:Bs,distance:tn,\"global-state\":gf};class Yl{constructor(l,u,m,A){this.name=l,this.type=u,this._evaluate=m,this.args=A}evaluate(l){return this._evaluate(l,this.args)}eachChild(l){this.args.forEach(l)}outputDefined(){return!1}static parse(l,u){let m=l[0],A=Yl.definitions[m];if(!A)return u.error(`Unknown expression \"${m}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let T=Array.isArray(A)?A[0]:A.type,M=Array.isArray(A)?[[A[1],A[2]]]:A.overloads,P=M.filter((([O])=>!Array.isArray(O)||O.length===l.length-1)),L=null;for(let[O,V]of P){L=new Fp(u.registry,Vp,u.path,null,u.scope);let F=[],X=!1;for(let j=1;j<l.length;j++){let nt=l[j],st=Array.isArray(O)?O[j-1]:O.type,pt=L.parse(nt,1+F.length,st);if(!pt){X=!0;break}F.push(pt)}if(!X)if(Array.isArray(O)&&O.length!==F.length)L.error(`Expected ${O.length} arguments, but found ${F.length} instead.`);else{for(let j=0;j<F.length;j++){let nt=Array.isArray(O)?O[j]:O.type,st=F[j];L.concat(j+1).checkSubtype(nt,st.type)}if(L.errors.length===0)return new Yl(m,T,V,F)}}if(P.length===1)u.errors.push(...L.errors);else{let O=(P.length?P:M).map((([F])=>{return X=F,Array.isArray(X)?`(${X.map(Nn).join(\", \")})`:`(${Nn(X.type)}...)`;var X})).join(\" | \"),V=[];for(let F=1;F<l.length;F++){let X=u.parse(l[F],1+V.length);if(!X)return null;V.push(Nn(X.type))}u.error(`Expected arguments of type ${O}, but found (${V.join(\", \")}) instead.`)}return null}static register(l,u){Yl.definitions=u;for(let m in u)l[m]=Yl}}function A2(d,[l,u,m,A]){l=l.evaluate(d),u=u.evaluate(d),m=m.evaluate(d);let T=A?A.evaluate(d):1,M=V_(l,u,m,T);if(M)throw new Yn(M);return new Mi(l/255,u/255,m/255,T,!1)}function y2(d,l){return d in l}function ey(d,l){let u=l[d];return u===void 0?null:u}function th(d){return{type:d}}function Vp(d){if(d instanceof ii)return Vp(d.boundExpression);if(d instanceof Yl&&d.name===\"error\"||d instanceof Ac||d instanceof Bs||d instanceof tn||d instanceof gf)return!1;let l=d instanceof Zu||d instanceof Wl,u=!0;return d.eachChild((m=>{u=l?u&&Vp(m):u&&m instanceof ru})),!!u&&ry(d)&&iy(d,[\"zoom\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"])}function ry(d){if(d instanceof Yl&&(d.name===\"get\"&&d.args.length===1||d.name===\"feature-state\"||d.name===\"has\"&&d.args.length===1||d.name===\"properties\"||d.name===\"geometry-type\"||d.name===\"id\"||/^filter-/.test(d.name))||d instanceof Bs||d instanceof tn)return!1;let l=!0;return d.eachChild((u=>{l&&!ry(u)&&(l=!1)})),l}function km(d){if(d instanceof Yl&&d.name===\"feature-state\")return!1;let l=!0;return d.eachChild((u=>{l&&!km(u)&&(l=!1)})),l}function iy(d,l){if(d instanceof Yl&&l.indexOf(d.name)>=0)return!1;let u=!0;return d.eachChild((m=>{u&&!iy(m,l)&&(u=!1)})),u}function K_(d){return{result:\"success\",value:d}}function jp(d){return{result:\"error\",value:d}}function Xh(d){return d[\"property-type\"]===\"data-driven\"||d[\"property-type\"]===\"cross-faded-data-driven\"}function ny(d){return!!d.expression&&d.expression.parameters.indexOf(\"zoom\")>-1}function Q_(d){return!!d.expression&&d.expression.interpolated}function pi(d){return d instanceof Number?\"number\":d instanceof String?\"string\":d instanceof Boolean?\"boolean\":Array.isArray(d)?\"array\":d===null?\"null\":typeof d}function Rm(d){return typeof d==\"object\"&&d!==null&&!Array.isArray(d)&&Xn(d)===Gh}function _2(d){return d}function v2(d,l){let u=d.stops&&typeof d.stops[0][0]==\"object\",m=u||!(u||d.property!==void 0),A=d.type||(Q_(l)?\"exponential\":\"interval\"),T=(function(V){switch(V.type){case\"color\":return Mi.parse;case\"padding\":return Fr.parse;case\"numberArray\":return jo.parse;case\"colorArray\":return Hn.parse;default:return null}})(l);if(T&&((d=cf({},d)).stops&&(d.stops=d.stops.map((V=>[V[0],T(V[1])]))),d.default=T(d.default?d.default:l.default)),d.colorSpace&&(M=d.colorSpace)!==\"rgb\"&&M!==\"hcl\"&&M!==\"lab\")throw new Error(`Unknown color space: \"${d.colorSpace}\"`);var M;let P=(function(V){switch(V){case\"exponential\":return Fs;case\"interval\":return MM;case\"categorical\":return SM;case\"identity\":return eh;default:throw new Error(`Unknown function type \"${V}\"`)}})(A),L,O;if(A===\"categorical\"){L=Object.create(null);for(let V of d.stops)L[V[0]]=V[1];O=typeof d.stops[0][0]}if(u){let V={},F=[];for(let nt=0;nt<d.stops.length;nt++){let st=d.stops[nt],pt=st[0].zoom;V[pt]===void 0&&(V[pt]={zoom:pt,type:d.type,property:d.property,default:d.default,stops:[]},F.push(pt)),V[pt].stops.push([st[0].value,st[1]])}let X=[];for(let nt of F)X.push([V[nt].zoom,v2(V[nt],l)]);let j={name:\"linear\"};return{kind:\"composite\",interpolationType:j,interpolationFactor:Li.interpolationFactor.bind(void 0,j),zoomStops:X.map((nt=>nt[0])),evaluate:({zoom:nt},st)=>Fs({stops:X,base:d.base},l,nt).evaluate(nt,st)}}if(m){let V=A===\"exponential\"?{name:\"exponential\",base:d.base!==void 0?d.base:1}:null;return{kind:\"camera\",interpolationType:V,interpolationFactor:Li.interpolationFactor.bind(void 0,V),zoomStops:d.stops.map((F=>F[0])),evaluate:({zoom:F})=>P(d,l,F,L,O)}}return{kind:\"source\",evaluate(V,F){let X=F&&F.properties?F.properties[d.property]:void 0;return X===void 0?Dm(d.default,l.default):P(d,l,X,L,O)}}}function Dm(d,l,u){return d!==void 0?d:l!==void 0?l:u!==void 0?u:void 0}function SM(d,l,u,m,A){return Dm(typeof u===A?m[u]:void 0,d.default,l.default)}function MM(d,l,u){if(pi(u)!==\"number\")return Dm(d.default,l.default);let m=d.stops.length;if(m===1||u<=d.stops[0][0])return d.stops[0][1];if(u>=d.stops[m-1][0])return d.stops[m-1][1];let A=no(d.stops.map((T=>T[0])),u);return d.stops[A][1]}function Fs(d,l,u){let m=d.base!==void 0?d.base:1;if(pi(u)!==\"number\")return Dm(d.default,l.default);let A=d.stops.length;if(A===1||u<=d.stops[0][0])return d.stops[0][1];if(u>=d.stops[A-1][0])return d.stops[A-1][1];let T=no(d.stops.map((V=>V[0])),u),M=(function(V,F,X,j){let nt=j-X,st=V-X;return nt===0?0:F===1?st/nt:(Math.pow(F,st)-1)/(Math.pow(F,nt)-1)})(u,m,d.stops[T][0],d.stops[T+1][0]),P=d.stops[T][1],L=d.stops[T+1][1],O=Ls[l.type]||_2;return typeof P.evaluate==\"function\"?{evaluate(...V){let F=P.evaluate.apply(void 0,V),X=L.evaluate.apply(void 0,V);if(F!==void 0&&X!==void 0)return O(F,X,M,d.colorSpace)}}:O(P,L,M,d.colorSpace)}function eh(d,l,u){switch(l.type){case\"color\":u=Mi.parse(u);break;case\"formatted\":u=yo.fromString(u.toString());break;case\"resolvedImage\":u=ea.fromString(u.toString());break;case\"padding\":u=Fr.parse(u);break;case\"colorArray\":u=Hn.parse(u);break;case\"numberArray\":u=jo.parse(u);break;default:pi(u)===l.type||l.type===\"enum\"&&l.values[u]||(u=void 0)}return Dm(u,d.default,l.default)}Yl.register(Af,{error:[{kind:\"error\"},[Hr],(d,[l])=>{throw new Yn(l.evaluate(d))}],typeof:[Hr,[fi],(d,[l])=>Nn(Xn(l.evaluate(d)))],\"to-rgba\":[fs(Je,4),[fl],(d,[l])=>{let[u,m,A,T]=l.evaluate(d).rgb;return[255*u,255*m,255*A,T]}],rgb:[fl,[Je,Je,Je],A2],rgba:[fl,[Je,Je,Je,Je],A2],has:{type:gi,overloads:[[[Hr],(d,[l])=>y2(l.evaluate(d),d.properties())],[[Hr,Gh],(d,[l,u])=>y2(l.evaluate(d),u.evaluate(d))]]},get:{type:fi,overloads:[[[Hr],(d,[l])=>ey(l.evaluate(d),d.properties())],[[Hr,Gh],(d,[l,u])=>ey(l.evaluate(d),u.evaluate(d))]]},\"feature-state\":[fi,[Hr],(d,[l])=>ey(l.evaluate(d),d.featureState||{})],properties:[Gh,[],d=>d.properties()],\"geometry-type\":[Hr,[],d=>d.geometryType()],id:[fi,[],d=>d.id()],zoom:[Je,[],d=>d.globals.zoom],\"heatmap-density\":[Je,[],d=>d.globals.heatmapDensity||0],elevation:[Je,[],d=>d.globals.elevation||0],\"line-progress\":[Je,[],d=>d.globals.lineProgress||0],accumulated:[fi,[],d=>d.globals.accumulated===void 0?null:d.globals.accumulated],\"+\":[Je,th(Je),(d,l)=>{let u=0;for(let m of l)u+=m.evaluate(d);return u}],\"*\":[Je,th(Je),(d,l)=>{let u=1;for(let m of l)u*=m.evaluate(d);return u}],\"-\":{type:Je,overloads:[[[Je,Je],(d,[l,u])=>l.evaluate(d)-u.evaluate(d)],[[Je],(d,[l])=>-l.evaluate(d)]]},\"/\":[Je,[Je,Je],(d,[l,u])=>l.evaluate(d)/u.evaluate(d)],\"%\":[Je,[Je,Je],(d,[l,u])=>l.evaluate(d)%u.evaluate(d)],ln2:[Je,[],()=>Math.LN2],pi:[Je,[],()=>Math.PI],e:[Je,[],()=>Math.E],\"^\":[Je,[Je,Je],(d,[l,u])=>Math.pow(l.evaluate(d),u.evaluate(d))],sqrt:[Je,[Je],(d,[l])=>Math.sqrt(l.evaluate(d))],log10:[Je,[Je],(d,[l])=>Math.log(l.evaluate(d))/Math.LN10],ln:[Je,[Je],(d,[l])=>Math.log(l.evaluate(d))],log2:[Je,[Je],(d,[l])=>Math.log(l.evaluate(d))/Math.LN2],sin:[Je,[Je],(d,[l])=>Math.sin(l.evaluate(d))],cos:[Je,[Je],(d,[l])=>Math.cos(l.evaluate(d))],tan:[Je,[Je],(d,[l])=>Math.tan(l.evaluate(d))],asin:[Je,[Je],(d,[l])=>Math.asin(l.evaluate(d))],acos:[Je,[Je],(d,[l])=>Math.acos(l.evaluate(d))],atan:[Je,[Je],(d,[l])=>Math.atan(l.evaluate(d))],min:[Je,th(Je),(d,l)=>Math.min(...l.map((u=>u.evaluate(d))))],max:[Je,th(Je),(d,l)=>Math.max(...l.map((u=>u.evaluate(d))))],abs:[Je,[Je],(d,[l])=>Math.abs(l.evaluate(d))],round:[Je,[Je],(d,[l])=>{let u=l.evaluate(d);return u<0?-Math.round(-u):Math.round(u)}],floor:[Je,[Je],(d,[l])=>Math.floor(l.evaluate(d))],ceil:[Je,[Je],(d,[l])=>Math.ceil(l.evaluate(d))],\"filter-==\":[gi,[Hr,fi],(d,[l,u])=>d.properties()[l.value]===u.value],\"filter-id-==\":[gi,[fi],(d,[l])=>d.id()===l.value],\"filter-type-==\":[gi,[Hr],(d,[l])=>d.geometryType()===l.value],\"filter-<\":[gi,[Hr,fi],(d,[l,u])=>{let m=d.properties()[l.value],A=u.value;return typeof m==typeof A&&m<A}],\"filter-id-<\":[gi,[fi],(d,[l])=>{let u=d.id(),m=l.value;return typeof u==typeof m&&u<m}],\"filter->\":[gi,[Hr,fi],(d,[l,u])=>{let m=d.properties()[l.value],A=u.value;return typeof m==typeof A&&m>A}],\"filter-id->\":[gi,[fi],(d,[l])=>{let u=d.id(),m=l.value;return typeof u==typeof m&&u>m}],\"filter-<=\":[gi,[Hr,fi],(d,[l,u])=>{let m=d.properties()[l.value],A=u.value;return typeof m==typeof A&&m<=A}],\"filter-id-<=\":[gi,[fi],(d,[l])=>{let u=d.id(),m=l.value;return typeof u==typeof m&&u<=m}],\"filter->=\":[gi,[Hr,fi],(d,[l,u])=>{let m=d.properties()[l.value],A=u.value;return typeof m==typeof A&&m>=A}],\"filter-id->=\":[gi,[fi],(d,[l])=>{let u=d.id(),m=l.value;return typeof u==typeof m&&u>=m}],\"filter-has\":[gi,[fi],(d,[l])=>l.value in d.properties()],\"filter-has-id\":[gi,[],d=>d.id()!==null&&d.id()!==void 0],\"filter-type-in\":[gi,[fs(Hr)],(d,[l])=>l.value.indexOf(d.geometryType())>=0],\"filter-id-in\":[gi,[fs(fi)],(d,[l])=>l.value.indexOf(d.id())>=0],\"filter-in-small\":[gi,[Hr,fs(fi)],(d,[l,u])=>u.value.indexOf(d.properties()[l.value])>=0],\"filter-in-large\":[gi,[Hr,fs(fi)],(d,[l,u])=>(function(m,A,T,M){for(;T<=M;){let P=T+M>>1;if(A[P]===m)return!0;A[P]>m?M=P-1:T=P+1}return!1})(d.properties()[l.value],u.value,0,u.value.length-1)],all:{type:gi,overloads:[[[gi,gi],(d,[l,u])=>l.evaluate(d)&&u.evaluate(d)],[th(gi),(d,l)=>{for(let u of l)if(!u.evaluate(d))return!1;return!0}]]},any:{type:gi,overloads:[[[gi,gi],(d,[l,u])=>l.evaluate(d)||u.evaluate(d)],[th(gi),(d,l)=>{for(let u of l)if(u.evaluate(d))return!0;return!1}]]},\"!\":[gi,[gi],(d,[l])=>!l.evaluate(d)],\"is-supported-script\":[gi,[Hr],(d,[l])=>{let u=d.globals&&d.globals.isSupportedScript;return!u||u(l.evaluate(d))}],upcase:[Hr,[Hr],(d,[l])=>l.evaluate(d).toUpperCase()],downcase:[Hr,[Hr],(d,[l])=>l.evaluate(d).toLowerCase()],concat:[Hr,th(fi),(d,l)=>l.map((u=>wm(u.evaluate(d)))).join(\"\")],split:[fs(Hr),[Hr,Hr],(d,[l,u])=>l.evaluate(d).split(u.evaluate(d))],join:[Hr,[fs(Hr),Hr],(d,[l,u])=>l.value.join(u.evaluate(d))],\"resolved-locale\":[Hr,[jA],(d,[l])=>l.evaluate(d).resolvedLocale()]});class Ns{constructor(l,u,m){this.expression=l,this._warningHistory={},this._evaluator=new Rn,this._defaultValue=u?(function(A){if(A.type===\"color\"&&Rm(A.default))return new Mi(0,0,0,0);switch(A.type){case\"color\":return Mi.parse(A.default)||null;case\"padding\":return Fr.parse(A.default)||null;case\"numberArray\":return jo.parse(A.default)||null;case\"colorArray\":return Hn.parse(A.default)||null;case\"variableAnchorOffsetCollection\":return ta.parse(A.default)||null;case\"projectionDefinition\":return ra.parse(A.default)||null;default:return A.default===void 0?null:A.default}})(u):null,this._enumValues=u&&u.type===\"enum\"?u.values:null,this._globalState=m}evaluateWithoutErrorHandling(l,u,m,A,T,M){return this._globalState&&(l=Xl(l,this._globalState)),this._evaluator.globals=l,this._evaluator.feature=u,this._evaluator.featureState=m,this._evaluator.canonical=A,this._evaluator.availableImages=T||null,this._evaluator.formattedSection=M,this.expression.evaluate(this._evaluator)}evaluate(l,u,m,A,T,M){this._globalState&&(l=Xl(l,this._globalState)),this._evaluator.globals=l,this._evaluator.feature=u||null,this._evaluator.featureState=m||null,this._evaluator.canonical=A,this._evaluator.availableImages=T||null,this._evaluator.formattedSection=M||null;try{let P=this.expression.evaluate(this._evaluator);if(P==null||typeof P==\"number\"&&P!=P)return this._defaultValue;if(this._enumValues&&!(P in this._enumValues))throw new Yn(`Expected value to be one of ${Object.keys(this._enumValues).map((L=>JSON.stringify(L))).join(\", \")}, but found ${JSON.stringify(P)} instead.`);return P}catch(P){return this._warningHistory[P.message]||(this._warningHistory[P.message]=!0,typeof console<\"u\"&&console.warn(P.message)),this._defaultValue}}}function $p(d){return Array.isArray(d)&&d.length>0&&typeof d[0]==\"string\"&&d[0]in Af}function Gp(d,l,u){let m=new Fp(Af,Vp,[],l?(function(T){let M={color:fl,string:Hr,number:Je,enum:Hr,boolean:gi,formatted:Rp,padding:_m,numberArray:vm,colorArray:Dp,projectionDefinition:kp,resolvedImage:uf,variableAnchorOffsetCollection:tu};return T.type===\"array\"?fs(M[T.value]||fi,T.length):M[T.type]})(l):void 0),A=m.parse(d,void 0,void 0,void 0,l&&l.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return A?K_(new Ns(A,l,u)):jp(m.errors)}class Zh{constructor(l,u,m){this.kind=l,this._styleExpression=u,this.isStateDependent=l!==\"constant\"&&!km(u.expression),this.globalStateRefs=Kh(u.expression),this._globalState=m}evaluateWithoutErrorHandling(l,u,m,A,T,M){return this._globalState&&(l=Xl(l,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(l,u,m,A,T,M)}evaluate(l,u,m,A,T,M){return this._globalState&&(l=Xl(l,this._globalState)),this._styleExpression.evaluate(l,u,m,A,T,M)}}class J_{constructor(l,u,m,A,T){this.kind=l,this.zoomStops=m,this._styleExpression=u,this.isStateDependent=l!==\"camera\"&&!km(u.expression),this.globalStateRefs=Kh(u.expression),this.interpolationType=A,this._globalState=T}evaluateWithoutErrorHandling(l,u,m,A,T,M){return this._globalState&&(l=Xl(l,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(l,u,m,A,T,M)}evaluate(l,u,m,A,T,M){return this._globalState&&(l=Xl(l,this._globalState)),this._styleExpression.evaluate(l,u,m,A,T,M)}interpolationFactor(l,u,m){return this.interpolationType?Li.interpolationFactor(this.interpolationType,l,u,m):0}}function b2(d,l,u){let m=Gp(d,l,u);if(m.result===\"error\")return m;let A=m.value.expression,T=ry(A);if(!T&&!Xh(l))return jp([new Os(\"\",\"data expressions not supported\")]);let M=iy(A,[\"zoom\"]);if(!M&&!ny(l))return jp([new Os(\"\",\"zoom expressions not supported\")]);let P=Wp(A);return P||M?P instanceof Os?jp([P]):P instanceof Li&&!Q_(l)?jp([new Os(\"\",'\"interpolate\" expressions cannot be used with this property')]):K_(P?new J_(T?\"camera\":\"composite\",m.value,P.labels,P instanceof Li?P.interpolation:void 0,u):new Zh(T?\"constant\":\"source\",m.value,u)):jp([new Os(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')])}class yf{constructor(l,u){this._parameters=l,this._specification=u,cf(this,v2(this._parameters,this._specification))}static deserialize(l){return new yf(l._parameters,l._specification)}static serialize(l){return{_parameters:l._parameters,_specification:l._specification}}}function Wp(d){let l=null;if(d instanceof Ii)l=Wp(d.result);else if(d instanceof ff){for(let u of d.args)if(l=Wp(u),l)break}else(d instanceof zn||d instanceof Li)&&d.input instanceof Yl&&d.input.name===\"zoom\"&&(l=d);return l instanceof Os||d.eachChild((u=>{let m=Wp(u);m instanceof Os?l=m:!l&&m?l=new Os(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):l&&m&&l!==m&&(l=new Os(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))})),l}function Kh(d,l=new Set){return d instanceof gf&&l.add(d.key),d.eachChild((u=>{Kh(u,l)})),l}function Xl(d,l){let{zoom:u,heatmapDensity:m,elevation:A,lineProgress:T,isSupportedScript:M,accumulated:P}=d??{};return{zoom:u,heatmapDensity:m,elevation:A,lineProgress:T,isSupportedScript:M,accumulated:P,globalState:l}}function oy(d){if(d===!0||d===!1)return!0;if(!Array.isArray(d)||d.length===0)return!1;switch(d[0]){case\"has\":return d.length>=2&&d[1]!==\"$id\"&&d[1]!==\"$type\";case\"in\":return d.length>=3&&(typeof d[1]!=\"string\"||Array.isArray(d[2]));case\"!in\":case\"!has\":case\"none\":return!1;case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return d.length!==3||Array.isArray(d[1])||Array.isArray(d[2]);case\"any\":case\"all\":for(let l of d.slice(1))if(!oy(l)&&typeof l!=\"boolean\")return!1;return!0;default:return!0}}let x2={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function Qh(d,l){if(d==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};oy(d)||(d=Om(d));let u=Gp(d,x2,l);if(u.result===\"error\")throw new Error(u.value.map((m=>`${m.key}: ${m.message}`)).join(\", \"));return{filter:(m,A,T)=>u.value.evaluate(m,A,{},T),needGeometry:ou(d),getGlobalStateRefs:()=>Kh(u.value.expression)}}function Jh(d,l){return d<l?-1:d>l?1:0}function ou(d){if(!Array.isArray(d))return!1;if(d[0]===\"within\"||d[0]===\"distance\")return!0;for(let l=1;l<d.length;l++)if(ou(d[l]))return!0;return!1}function Om(d){if(!d)return!0;let l=d[0];return d.length<=1?l!==\"any\":l===\"==\"?sy(d[1],d[2],\"==\"):l===\"!=\"?Bm(sy(d[1],d[2],\"==\")):l===\"<\"||l===\">\"||l===\"<=\"||l===\">=\"?sy(d[1],d[2],l):l===\"any\"?(u=d.slice(1),[\"any\"].concat(u.map(Om))):l===\"all\"?[\"all\"].concat(d.slice(1).map(Om)):l===\"none\"?[\"all\"].concat(d.slice(1).map(Om).map(Bm)):l===\"in\"?Lm(d[1],d.slice(2)):l===\"!in\"?Bm(Lm(d[1],d.slice(2))):l===\"has\"?tv(d[1]):l!==\"!has\"||Bm(tv(d[1]));var u}function sy(d,l,u){switch(d){case\"$type\":return[`filter-type-${u}`,l];case\"$id\":return[`filter-id-${u}`,l];default:return[`filter-${u}`,d,l]}}function Lm(d,l){if(l.length===0)return!1;switch(d){case\"$type\":return[\"filter-type-in\",[\"literal\",l]];case\"$id\":return[\"filter-id-in\",[\"literal\",l]];default:return l.length>200&&!l.some((u=>typeof u!=typeof l[0]))?[\"filter-in-large\",d,[\"literal\",l.sort(Jh)]]:[\"filter-in-small\",d,[\"literal\",l]]}}function tv(d){switch(d){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",d]}}function Bm(d){return[\"!\",d]}function ay(d){let l=typeof d;if(l===\"number\"||l===\"boolean\"||l===\"string\"||d==null)return JSON.stringify(d);if(Array.isArray(d)){let A=\"[\";for(let T of d)A+=`${ay(T)},`;return`${A}]`}let u=Object.keys(d).sort(),m=\"{\";for(let A=0;A<u.length;A++)m+=`${JSON.stringify(u[A])}:${ay(d[u[A]])},`;return`${m}}`}function EM(d){let l=\"\";for(let u of zA)l+=`/${ay(d[u])}`;return l}function w2(d){let l=d.value;return l?[new Ye(d.key,l,\"constants have been deprecated as of v8\")]:[]}function vo(d){return d instanceof Number||d instanceof String||d instanceof Boolean?d.valueOf():d}function td(d){if(Array.isArray(d))return d.map(td);if(d instanceof Object&&!(d instanceof Number||d instanceof String||d instanceof Boolean)){let l={};for(let u in d)l[u]=td(d[u]);return l}return vo(d)}function Ga(d){let l=d.key,u=d.value,m=d.valueSpec||{},A=d.objectElementValidators||{},T=d.style,M=d.styleSpec,P=d.validateSpec,L=[],O=pi(u);if(O!==\"object\")return[new Ye(l,u,`object expected, ${O} found`)];for(let V in u){let F=V.split(\".\")[0],X=xm(m,F)||m[\"*\"],j;if(xm(A,F))j=A[F];else if(xm(m,F)){if(u[V]===void 0)continue;j=P}else if(A[\"*\"])j=A[\"*\"];else{if(!m[\"*\"]){L.push(new Ye(l,u[V],`unknown property \"${V}\"`));continue}j=P}L=L.concat(j({key:(l&&`${l}.`)+V,value:u[V],valueSpec:X,style:T,styleSpec:M,object:u,objectKey:V,validateSpec:P},u))}for(let V in m)A[V]||m[V].required&&m[V].default===void 0&&u[V]===void 0&&L.push(new Ye(l,u,`missing required property \"${V}\"`));return L}function qp(d){let l=d.value,u=d.valueSpec,m=d.style,A=d.styleSpec,T=d.key,M=d.arrayElementValidator||d.validateSpec;if(pi(l)!==\"array\")return[new Ye(T,l,`array expected, ${pi(l)} found`)];if(u.length&&l.length!==u.length)return[new Ye(T,l,`array length ${u.length} expected, length ${l.length} found`)];let P={type:u.value,values:u.values};A.$version<7&&(P.function=u.function),pi(u.value)===\"object\"&&(P=u.value);let L=[];for(let O=0;O<l.length;O++)L=L.concat(M({array:l,arrayIndex:O,value:l[O],valueSpec:P,validateSpec:d.validateSpec,style:m,styleSpec:A,key:`${T}[${O}]`}));return L}function Hp(d){let l=d.key,u=d.value,m=d.valueSpec,A=pi(u);return A===\"number\"&&u!=u&&(A=\"NaN\"),A!==\"number\"?[new Ye(l,u,`number expected, ${A} found`)]:\"minimum\"in m&&u<m.minimum?[new Ye(l,u,`${u} is less than the minimum value ${m.minimum}`)]:\"maximum\"in m&&u>m.maximum?[new Ye(l,u,`${u} is greater than the maximum value ${m.maximum}`)]:[]}function ly(d){let l=d.valueSpec,u=vo(d.value.type),m,A,T,M={},P=u!==\"categorical\"&&d.value.property===void 0,L=!P,O=pi(d.value.stops)===\"array\"&&pi(d.value.stops[0])===\"array\"&&pi(d.value.stops[0][0])===\"object\",V=Ga({key:d.key,value:d.value,valueSpec:d.styleSpec.function,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{stops:function(j){if(u===\"identity\")return[new Ye(j.key,j.value,'identity function may not have a \"stops\" property')];let nt=[],st=j.value;return nt=nt.concat(qp({key:j.key,value:st,valueSpec:j.valueSpec,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,arrayElementValidator:F})),pi(st)===\"array\"&&st.length===0&&nt.push(new Ye(j.key,st,\"array must have at least one stop\")),nt},default:function(j){return j.validateSpec({key:j.key,value:j.value,valueSpec:l,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec})}}});return u===\"identity\"&&P&&V.push(new Ye(d.key,d.value,'missing required property \"property\"')),u===\"identity\"||d.value.stops||V.push(new Ye(d.key,d.value,'missing required property \"stops\"')),u===\"exponential\"&&d.valueSpec.expression&&!Q_(d.valueSpec)&&V.push(new Ye(d.key,d.value,\"exponential functions not supported\")),d.styleSpec.$version>=8&&(L&&!Xh(d.valueSpec)?V.push(new Ye(d.key,d.value,\"property functions not supported\")):P&&!ny(d.valueSpec)&&V.push(new Ye(d.key,d.value,\"zoom functions not supported\"))),u!==\"categorical\"&&!O||d.value.property!==void 0||V.push(new Ye(d.key,d.value,'\"property\" property is required')),V;function F(j){let nt=[],st=j.value,pt=j.key;if(pi(st)!==\"array\")return[new Ye(pt,st,`array expected, ${pi(st)} found`)];if(st.length!==2)return[new Ye(pt,st,`array length 2 expected, length ${st.length} found`)];if(O){if(pi(st[0])!==\"object\")return[new Ye(pt,st,`object expected, ${pi(st[0])} found`)];if(st[0].zoom===void 0)return[new Ye(pt,st,\"object stop key must have zoom\")];if(st[0].value===void 0)return[new Ye(pt,st,\"object stop key must have value\")];if(T&&T>vo(st[0].zoom))return[new Ye(pt,st[0].zoom,\"stop zoom values must appear in ascending order\")];vo(st[0].zoom)!==T&&(T=vo(st[0].zoom),A=void 0,M={}),nt=nt.concat(Ga({key:`${pt}[0]`,value:st[0],valueSpec:{zoom:{}},validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{zoom:Hp,value:X}}))}else nt=nt.concat(X({key:`${pt}[0]`,value:st[0],validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec},st));return $p(td(st[1]))?nt.concat([new Ye(`${pt}[1]`,st[1],\"expressions are not allowed in function stops.\")]):nt.concat(j.validateSpec({key:`${pt}[1]`,value:st[1],valueSpec:l,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec}))}function X(j,nt){let st=pi(j.value),pt=vo(j.value),mt=j.value!==null?j.value:nt;if(m){if(st!==m)return[new Ye(j.key,mt,`${st} stop domain type must match previous stop domain type ${m}`)]}else m=st;if(st!==\"number\"&&st!==\"string\"&&st!==\"boolean\")return[new Ye(j.key,mt,\"stop domain value must be a number, string, or boolean\")];if(st!==\"number\"&&u!==\"categorical\"){let vt=`number expected, ${st} found`;return Xh(l)&&u===void 0&&(vt+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new Ye(j.key,mt,vt)]}return u!==\"categorical\"||st!==\"number\"||isFinite(pt)&&Math.floor(pt)===pt?u!==\"categorical\"&&st===\"number\"&&A!==void 0&&pt<A?[new Ye(j.key,mt,\"stop domain values must appear in ascending order\")]:(A=pt,u===\"categorical\"&&pt in M?[new Ye(j.key,mt,\"stop domain values must be unique\")]:(M[pt]=!0,[])):[new Ye(j.key,mt,`integer expected, found ${pt}`)]}}function yc(d){let l=(d.expressionContext===\"property\"?b2:Gp)(td(d.value),d.valueSpec);if(l.result===\"error\")return l.value.map((m=>new Ye(`${d.key}${m.key}`,d.value,m.message)));let u=l.value.expression||l.value._styleExpression.expression;if(d.expressionContext===\"property\"&&d.propertyKey===\"text-font\"&&!u.outputDefined())return[new Ye(d.key,d.value,`Invalid data expression for \"${d.propertyKey}\". Output values must be contained as literals within the expression.`)];if(d.expressionContext===\"property\"&&d.propertyType===\"layout\"&&!km(u))return[new Ye(d.key,d.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(d.expressionContext===\"filter\"&&!km(u))return[new Ye(d.key,d.value,'\"feature-state\" data expressions are not supported with filters.')];if(d.expressionContext&&d.expressionContext.indexOf(\"cluster\")===0){if(!iy(u,[\"zoom\",\"feature-state\"]))return[new Ye(d.key,d.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(d.expressionContext===\"cluster-initial\"&&!ry(u))return[new Ye(d.key,d.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function Yp(d){let l=d.key,u=d.value,m=pi(u);return m!==\"string\"?[new Ye(l,u,`color expected, ${m} found`)]:Mi.parse(String(u))?[]:[new Ye(l,u,`color expected, \"${u}\" found`)]}function Fm(d){let l=d.key,u=d.value,m=d.valueSpec,A=[];return Array.isArray(m.values)?m.values.indexOf(vo(u))===-1&&A.push(new Ye(l,u,`expected one of [${m.values.join(\", \")}], ${JSON.stringify(u)} found`)):Object.keys(m.values).indexOf(vo(u))===-1&&A.push(new Ye(l,u,`expected one of [${Object.keys(m.values).join(\", \")}], ${JSON.stringify(u)} found`)),A}function ev(d){return oy(td(d.value))?yc(cf({},d,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}})):Xp(d)}function Xp(d){let l=d.value,u=d.key;if(pi(l)!==\"array\")return[new Ye(u,l,`array expected, ${pi(l)} found`)];let m=d.styleSpec,A,T=[];if(l.length<1)return[new Ye(u,l,\"filter array must have at least 1 element\")];switch(T=T.concat(Fm({key:`${u}[0]`,value:l[0],valueSpec:m.filter_operator,style:d.style,styleSpec:d.styleSpec})),vo(l[0])){case\"<\":case\"<=\":case\">\":case\">=\":l.length>=2&&vo(l[1])===\"$type\"&&T.push(new Ye(u,l,`\"$type\" cannot be use with operator \"${l[0]}\"`));case\"==\":case\"!=\":l.length!==3&&T.push(new Ye(u,l,`filter array for operator \"${l[0]}\" must have 3 elements`));case\"in\":case\"!in\":l.length>=2&&(A=pi(l[1]),A!==\"string\"&&T.push(new Ye(`${u}[1]`,l[1],`string expected, ${A} found`)));for(let M=2;M<l.length;M++)A=pi(l[M]),vo(l[1])===\"$type\"?T=T.concat(Fm({key:`${u}[${M}]`,value:l[M],valueSpec:m.geometry_type,style:d.style,styleSpec:d.styleSpec})):A!==\"string\"&&A!==\"number\"&&A!==\"boolean\"&&T.push(new Ye(`${u}[${M}]`,l[M],`string, number, or boolean expected, ${A} found`));break;case\"any\":case\"all\":case\"none\":for(let M=1;M<l.length;M++)T=T.concat(Xp({key:`${u}[${M}]`,value:l[M],style:d.style,styleSpec:d.styleSpec}));break;case\"has\":case\"!has\":A=pi(l[1]),l.length!==2?T.push(new Ye(u,l,`filter array for \"${l[0]}\" operator must have 2 elements`)):A!==\"string\"&&T.push(new Ye(`${u}[1]`,l[1],`string expected, ${A} found`))}return T}function T2(d,l){let u=d.key,m=d.validateSpec,A=d.style,T=d.styleSpec,M=d.value,P=d.objectKey,L=T[`${l}_${d.layerType}`];if(!L)return[];let O=P.match(/^(.*)-transition$/);if(l===\"paint\"&&O&&L[O[1]]&&L[O[1]].transition)return m({key:u,value:M,valueSpec:T.transition,style:A,styleSpec:T});let V=d.valueSpec||L[P];if(!V)return[new Ye(u,M,`unknown property \"${P}\"`)];let F;if(pi(M)===\"string\"&&Xh(V)&&!V.tokens&&(F=/^{([^}]+)}$/.exec(M)))return[new Ye(u,M,`\"${P}\" does not support interpolation syntax\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(F[1])} }\\`.`)];let X=[];return d.layerType===\"symbol\"&&P===\"text-font\"&&Rm(td(M))&&vo(M.type)===\"identity\"&&X.push(new Ye(u,M,'\"text-font\" does not support identity functions')),X.concat(m({key:d.key,value:M,valueSpec:V,style:A,styleSpec:T,expressionContext:\"property\",propertyType:l,propertyKey:P}))}function cy(d){return T2(d,\"paint\")}function rv(d){return T2(d,\"layout\")}function ed(d){var l,u;let m=[],A=d.value,T=d.key,M=d.style,P=d.styleSpec;if(pi(A)!==\"object\")return[new Ye(T,A,`object expected, ${pi(A)} found`)];A.type||A.ref||m.push(new Ye(T,A,'either \"type\" or \"ref\" is required'));let L=vo(A.type),O=vo(A.ref);if(A.id){let V=vo(A.id);for(let F=0;F<d.arrayIndex;F++){let X=M.layers[F];vo(X.id)===V&&m.push(new Ye(T,A.id,`duplicate layer id \"${A.id}\", previously used at line ${X.id.__line__}`))}}if(\"ref\"in A){let V;[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach((F=>{F in A&&m.push(new Ye(T,A[F],`\"${F}\" is prohibited for ref layers`))})),M.layers.forEach((F=>{vo(F.id)===O&&(V=F)})),V?V.ref?m.push(new Ye(T,A.ref,\"ref cannot reference another ref layer\")):L=vo(V.type):m.push(new Ye(T,A.ref,`ref layer \"${O}\" not found`))}else if(L!==\"background\")if(A.source){let V=M.sources&&M.sources[A.source],F=V&&vo(V.type);V?F===\"vector\"&&L===\"raster\"?m.push(new Ye(T,A.source,`layer \"${A.id}\" requires a raster source`)):F!==\"raster-dem\"&&L===\"hillshade\"||F!==\"raster-dem\"&&L===\"color-relief\"?m.push(new Ye(T,A.source,`layer \"${A.id}\" requires a raster-dem source`)):F===\"raster\"&&L!==\"raster\"?m.push(new Ye(T,A.source,`layer \"${A.id}\" requires a vector source`)):F!==\"vector\"||A[\"source-layer\"]?F===\"raster-dem\"&&L!==\"hillshade\"&&L!==\"color-relief\"?m.push(new Ye(T,A.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):L!==\"line\"||!A.paint||!A.paint[\"line-gradient\"]||F===\"geojson\"&&V.lineMetrics||m.push(new Ye(T,A,`layer \"${A.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):m.push(new Ye(T,A,`layer \"${A.id}\" must specify a \"source-layer\"`)):m.push(new Ye(T,A.source,`source \"${A.source}\" not found`))}else m.push(new Ye(T,A,'missing required property \"source\"'));return L===\"raster\"&&(!((l=A.paint)===null||l===void 0)&&l.resampling)&&(!((u=A.paint)===null||u===void 0)&&u[\"raster-resampling\"])&&m.push(new Ye(T,A.paint,`layer \"${A.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),m=m.concat(Ga({key:T,value:A,valueSpec:P.layer,style:d.style,styleSpec:d.styleSpec,validateSpec:d.validateSpec,objectElementValidators:{\"*\":()=>[],type:()=>d.validateSpec({key:`${T}.type`,value:A.type,valueSpec:P.layer.type,style:d.style,styleSpec:d.styleSpec,validateSpec:d.validateSpec,object:A,objectKey:\"type\"}),filter:ev,layout:V=>Ga({layer:A,key:V.key,value:V.value,style:V.style,styleSpec:V.styleSpec,validateSpec:V.validateSpec,objectElementValidators:{\"*\":F=>rv(cf({layerType:L},F))}}),paint:V=>Ga({layer:A,key:V.key,value:V.value,style:V.style,styleSpec:V.styleSpec,validateSpec:V.validateSpec,objectElementValidators:{\"*\":F=>cy(cf({layerType:L},F))}})}})),m}function rh(d){let l=d.value,u=d.key,m=pi(l);return m!==\"string\"?[new Ye(u,l,`string expected, ${m} found`)]:[]}let _f={promoteId:function({key:d,value:l}){if(pi(l)===\"string\")return rh({key:d,value:l});{let u=[];for(let m in l)u.push(...rh({key:`${d}.${m}`,value:l[m]}));return u}}};function iv(d){let l=d.value,u=d.key,m=d.styleSpec,A=d.style,T=d.validateSpec;if(!l.type)return[new Ye(u,l,'\"type\" is required')];let M=vo(l.type),P;switch(M){case\"vector\":case\"raster\":return P=Ga({key:u,value:l,valueSpec:m[`source_${M.replace(\"-\",\"_\")}`],style:d.style,styleSpec:m,objectElementValidators:_f,validateSpec:T}),P;case\"raster-dem\":return P=(function(L){var O;let V=(O=L.sourceName)!==null&&O!==void 0?O:\"\",F=L.value,X=L.styleSpec,j=X.source_raster_dem,nt=L.style,st=[],pt=pi(F);if(F===void 0)return st;if(pt!==\"object\")return st.push(new Ye(\"source_raster_dem\",F,`object expected, ${pt} found`)),st;let mt=vo(F.encoding)===\"custom\",vt=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],At=L.value.encoding?`\"${L.value.encoding}\"`:\"Default\";for(let wt in F)!mt&&vt.includes(wt)?st.push(new Ye(wt,F[wt],`In \"${V}\": \"${wt}\" is only valid when \"encoding\" is set to \"custom\". ${At} encoding found`)):j[wt]?st=st.concat(L.validateSpec({key:wt,value:F[wt],valueSpec:j[wt],validateSpec:L.validateSpec,style:nt,styleSpec:X})):st.push(new Ye(wt,F[wt],`unknown property \"${wt}\"`));return st})({sourceName:u,value:l,style:d.style,styleSpec:m,validateSpec:T}),P;case\"geojson\":if(P=Ga({key:u,value:l,valueSpec:m.source_geojson,style:A,styleSpec:m,validateSpec:T,objectElementValidators:_f}),l.cluster)for(let L in l.clusterProperties){let[O,V]=l.clusterProperties[L],F=typeof O==\"string\"?[O,[\"accumulated\"],[\"get\",L]]:O;P.push(...yc({key:`${u}.${L}.map`,value:V,expressionContext:\"cluster-map\"})),P.push(...yc({key:`${u}.${L}.reduce`,value:F,expressionContext:\"cluster-reduce\"}))}return P;case\"video\":return Ga({key:u,value:l,valueSpec:m.source_video,style:A,validateSpec:T,styleSpec:m});case\"image\":return Ga({key:u,value:l,valueSpec:m.source_image,style:A,validateSpec:T,styleSpec:m});case\"canvas\":return[new Ye(u,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return Fm({key:`${u}.type`,value:l.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]}})}}function nv(d){let l=d.value,u=d.styleSpec,m=u.light,A=d.style,T=[],M=pi(l);if(l===void 0)return T;if(M!==\"object\")return T=T.concat([new Ye(\"light\",l,`object expected, ${M} found`)]),T;for(let P in l){let L=P.match(/^(.*)-transition$/);T=T.concat(L&&m[L[1]]&&m[L[1]].transition?d.validateSpec({key:P,value:l[P],valueSpec:u.transition,validateSpec:d.validateSpec,style:A,styleSpec:u}):m[P]?d.validateSpec({key:P,value:l[P],valueSpec:m[P],validateSpec:d.validateSpec,style:A,styleSpec:u}):[new Ye(P,l[P],`unknown property \"${P}\"`)])}return T}function uy(d){let l=d.value,u=d.styleSpec,m=u.sky,A=d.style,T=pi(l);if(l===void 0)return[];if(T!==\"object\")return[new Ye(\"sky\",l,`object expected, ${T} found`)];let M=[];for(let P in l)M=M.concat(m[P]?d.validateSpec({key:P,value:l[P],valueSpec:m[P],style:A,styleSpec:u}):[new Ye(P,l[P],`unknown property \"${P}\"`)]);return M}function Nm(d){let l=d.value,u=d.styleSpec,m=u.terrain,A=d.style,T=[],M=pi(l);if(l===void 0)return T;if(M!==\"object\")return T=T.concat([new Ye(\"terrain\",l,`object expected, ${M} found`)]),T;for(let P in l)T=T.concat(m[P]?d.validateSpec({key:P,value:l[P],valueSpec:m[P],validateSpec:d.validateSpec,style:A,styleSpec:u}):[new Ye(P,l[P],`unknown property \"${P}\"`)]);return T}function ov(d){let l=[],u=d.value,m=d.key;if(Array.isArray(u)){let A=[],T=[];for(let M in u)u[M].id&&A.includes(u[M].id)&&l.push(new Ye(m,u,`all the sprites' ids must be unique, but ${u[M].id} is duplicated`)),A.push(u[M].id),u[M].url&&T.includes(u[M].url)&&l.push(new Ye(m,u,`all the sprites' URLs must be unique, but ${u[M].url} is duplicated`)),T.push(u[M].url),l=l.concat(Ga({key:`${m}[${M}]`,value:u[M],valueSpec:{id:{type:\"string\",required:!0},url:{type:\"string\",required:!0}},validateSpec:d.validateSpec}));return l}return rh({key:m,value:u})}function zm(d){return!!d&&d.constructor===Object}function Zp(d){return zm(d.value)?[]:[new Ye(d.key,d.value,`object expected, ${pi(d.value)} found`)]}let hy={\"*\":()=>[],array:qp,boolean:function(d){let l=d.value,u=d.key,m=pi(l);return m!==\"boolean\"?[new Ye(u,l,`boolean expected, ${m} found`)]:[]},number:Hp,color:Yp,constants:w2,enum:Fm,filter:ev,function:ly,layer:ed,object:Ga,source:iv,light:nv,sky:uy,terrain:Nm,projection:function(d){let l=d.value,u=d.styleSpec,m=u.projection,A=d.style,T=pi(l);if(l===void 0)return[];if(T!==\"object\")return[new Ye(\"projection\",l,`object expected, ${T} found`)];let M=[];for(let P in l)M=M.concat(m[P]?d.validateSpec({key:P,value:l[P],valueSpec:m[P],style:A,styleSpec:u}):[new Ye(P,l[P],`unknown property \"${P}\"`)]);return M},projectionDefinition:function(d){let l=d.key,u=d.value;u=u instanceof String?u.valueOf():u;let m=pi(u);return m!==\"array\"||(function(A){return Array.isArray(A)&&A.length===3&&typeof A[0]==\"string\"&&typeof A[1]==\"string\"&&typeof A[2]==\"number\"})(u)||(function(A){return!![\"interpolate\",\"step\",\"literal\"].includes(A[0])})(u)?[\"array\",\"string\"].includes(m)?[]:[new Ye(l,u,`projection expected, invalid type \"${m}\" found`)]:[new Ye(l,u,`projection expected, invalid array ${JSON.stringify(u)} found`)]},string:rh,formatted:function(d){return rh(d).length===0?[]:yc(d)},resolvedImage:function(d){return rh(d).length===0?[]:yc(d)},padding:function(d){let l=d.key,u=d.value;if(pi(u)===\"array\"){if(u.length<1||u.length>4)return[new Ye(l,u,`padding requires 1 to 4 values; ${u.length} values found`)];let m={type:\"number\"},A=[];for(let T=0;T<u.length;T++)A=A.concat(d.validateSpec({key:`${l}[${T}]`,value:u[T],validateSpec:d.validateSpec,valueSpec:m}));return A}return Hp({key:l,value:u,valueSpec:{}})},numberArray:function(d){let l=d.key,u=d.value;if(pi(u)===\"array\"){let m={type:\"number\"};if(u.length<1)return[new Ye(l,u,\"array length at least 1 expected, length 0 found\")];let A=[];for(let T=0;T<u.length;T++)A=A.concat(d.validateSpec({key:`${l}[${T}]`,value:u[T],validateSpec:d.validateSpec,valueSpec:m}));return A}return Hp({key:l,value:u,valueSpec:{}})},colorArray:function(d){let l=d.key,u=d.value;if(pi(u)===\"array\"){if(u.length<1)return[new Ye(l,u,\"array length at least 1 expected, length 0 found\")];let m=[];for(let A=0;A<u.length;A++)m=m.concat(Yp({key:`${l}[${A}]`,value:u[A]}));return m}return Yp({key:l,value:u})},variableAnchorOffsetCollection:function(d){let l=d.key,u=d.value,m=pi(u),A=d.styleSpec;if(m!==\"array\"||u.length<1||u.length%2!=0)return[new Ye(l,u,\"variableAnchorOffsetCollection requires a non-empty array of even length\")];let T=[];for(let M=0;M<u.length;M+=2)T=T.concat(Fm({key:`${l}[${M}]`,value:u[M],valueSpec:A.layout_symbol[\"text-anchor\"]})),T=T.concat(qp({key:`${l}[${M+1}]`,value:u[M+1],valueSpec:{length:2,value:\"number\"},validateSpec:d.validateSpec,style:d.style,styleSpec:A}));return T},sprite:ov,state:Zp,fontFaces:function(d){let l=d.key,u=d.value,m=d.validateSpec,A=d.styleSpec,T=d.style;if(!zm(u))return[new Ye(l,u,`object expected, ${pi(u)} found`)];let M=[];for(let P in u){let L=u[P],O=pi(L);if(O===\"string\")M.push(...rh({key:`${l}.${P}`,value:L}));else if(O===\"array\"){let V={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[F,X]of L.entries())M.push(...Ga({key:`${l}.${P}[${F}]`,value:X,valueSpec:V,styleSpec:A,style:T,validateSpec:m}))}else M.push(new Ye(`${l}.${P}`,L,`string or array expected, ${O} found`))}return M}};function Kp(d){let l=d.value,u=d.valueSpec,m=d.styleSpec;return d.validateSpec=Kp,u.expression&&Rm(vo(l))?ly(d):u.expression&&$p(td(l))?yc(d):u.type&&hy[u.type]?hy[u.type](d):Ga(cf({},d,{valueSpec:u.type?m[u.type]:u}))}function Qp(d){let l=d.value,u=d.key,m=rh(d);return m.length||(l.indexOf(\"{fontstack}\")===-1&&m.push(new Ye(u,l,'\"glyphs\" url must include a \"{fontstack}\" token')),l.indexOf(\"{range}\")===-1&&m.push(new Ye(u,l,'\"glyphs\" url must include a \"{range}\" token'))),m}function Ei(d,l=Te){let u=[];return u=u.concat(Kp({key:\"\",value:d,valueSpec:l.$root,styleSpec:l,style:d,validateSpec:Kp,objectElementValidators:{glyphs:Qp,\"*\":()=>[]}})),d.constants&&(u=u.concat(w2({key:\"constants\",value:d.constants}))),sv(u)}function _c(d){return function(l){return d(Object.assign({},l,{validateSpec:Kp}))}}function sv(d){return[].concat(d).sort(((l,u)=>l.line-u.line))}function ia(d){return function(...l){return sv(d.apply(this,l))}}Ei.source=ia(_c(iv)),Ei.sprite=ia(_c(ov)),Ei.glyphs=ia(_c(Qp)),Ei.light=ia(_c(nv)),Ei.sky=ia(_c(uy)),Ei.terrain=ia(_c(Nm)),Ei.state=ia(_c(Zp)),Ei.layer=ia(_c(ed)),Ei.filter=ia(_c(ev)),Ei.paintProperty=ia(_c(cy)),Ei.layoutProperty=ia(_c(rv));let Um={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"};class Al{constructor(l,u){this._globalState=u,this.setValue(l)}evaluate(){var l;return(l=this._literalValue)!==null&&l!==void 0?l:this._compiledValue.evaluate({})}setValue(l){if(l==null||l===\"visible\"||l===\"none\")return this._literalValue=l===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let u=Gp(l,Um,this._globalState);if(u.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,new Error(u.value.map((m=>`${m.key}: ${m.message}`)).join(\", \"));this._literalValue=void 0,this._compiledValue=u.value,this._globalStateRefs=Kh(u.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let Vm=Te,vf=Ei,Wa=vf.light,av=vf.sky,vc=vf.paintProperty,S2=vf.layoutProperty;function Jp(d,l){let u=!1;if(l&&l.length)for(let m of l)d.fire(new Am(new Error(m.message))),u=!0;return u}class jm{constructor(l,u,m){let A=this.cells=[];if(l instanceof ArrayBuffer){this.arrayBuffer=l;let M=new Int32Array(this.arrayBuffer);l=M[0],this.d=(u=M[1])+2*(m=M[2]);for(let L=0;L<this.d*this.d;L++){let O=M[3+L],V=M[3+L+1];A.push(O===V?null:M.subarray(O,V))}let P=M[3+A.length+1];this.keys=M.subarray(M[3+A.length],P),this.bboxes=M.subarray(P),this.insert=this._insertReadonly}else{this.d=u+2*m;for(let M=0;M<this.d*this.d;M++)A.push([]);this.keys=[],this.bboxes=[]}this.n=u,this.extent=l,this.padding=m,this.scale=u/l,this.uid=0;let T=m/u*l;this.min=-T,this.max=l+T}insert(l,u,m,A,T){this._forEachCell(u,m,A,T,this._insertCell,this.uid++,void 0,void 0),this.keys.push(l),this.bboxes.push(u),this.bboxes.push(m),this.bboxes.push(A),this.bboxes.push(T)}_insertReadonly(){throw new Error(\"Cannot insert into a GridIndex created from an ArrayBuffer.\")}_insertCell(l,u,m,A,T,M){this.cells[T].push(M)}query(l,u,m,A,T){let M=this.min,P=this.max;if(l<=M&&u<=M&&P<=m&&P<=A&&!T)return[...this.keys];{let L=[];return this._forEachCell(l,u,m,A,this._queryCell,L,{},T),L}}_queryCell(l,u,m,A,T,M,P,L){let O=this.cells[T];if(O!==null){let V=this.keys,F=this.bboxes;for(let X=0;X<O.length;X++){let j=O[X];if(P[j]===void 0){let nt=4*j;(L?L(F[nt+0],F[nt+1],F[nt+2],F[nt+3]):l<=F[nt+2]&&u<=F[nt+3]&&m>=F[nt+0]&&A>=F[nt+1])?(P[j]=!0,M.push(V[j])):P[j]=!1}}}}_forEachCell(l,u,m,A,T,M,P,L){let O=this._convertToCellCoord(l),V=this._convertToCellCoord(u),F=this._convertToCellCoord(m),X=this._convertToCellCoord(A);for(let j=O;j<=F;j++)for(let nt=V;nt<=X;nt++){let st=this.d*nt+j;if((!L||L(this._convertFromCellCoord(j),this._convertFromCellCoord(nt),this._convertFromCellCoord(j+1),this._convertFromCellCoord(nt+1)))&&T.call(this,l,u,m,A,st,M,P,L))return}}_convertFromCellCoord(l){return(l-this.padding)/this.scale}_convertToCellCoord(l){return Math.max(0,Math.min(this.d-1,Math.floor(l*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let l=this.cells,u=3+this.cells.length+1+1,m=0;for(let M=0;M<this.cells.length;M++)m+=this.cells[M].length;let A=new Int32Array(u+m+this.keys.length+this.bboxes.length);A[0]=this.extent,A[1]=this.n,A[2]=this.padding;let T=u;for(let M=0;M<l.length;M++){let P=l[M];A[3+M]=T,A.set(P,T),T+=P.length}return A[3+l.length]=T,A.set(this.keys,T),T+=this.keys.length,A[3+l.length+1]=T,A.set(this.bboxes,T),T+=this.bboxes.length,A.buffer}static serialize(l,u){let m=l.toArrayBuffer();return u&&u.push(m),{buffer:m}}static deserialize(l){return new jm(l.buffer)}}let bo={};function ir(d,l,u={}){if(bo[d])throw new Error(`${d} is already registered.`);Object.defineProperty(l,\"_classRegistryKey\",{value:d,writeable:!1}),bo[d]={klass:l,omit:u.omit||[],shallow:u.shallow||[]}}ir(\"Object\",Object),ir(\"Set\",Set),ir(\"TransferableGridIndex\",jm),ir(\"Color\",Mi),ir(\"Error\",Error),ir(\"AJAXError\",af),ir(\"ResolvedImage\",ea),ir(\"StylePropertyFunction\",yf),ir(\"StyleExpression\",Ns,{omit:[\"_evaluator\"]}),ir(\"ZoomDependentExpression\",J_),ir(\"ZoomConstantExpression\",Zh),ir(\"CompoundExpression\",Yl,{omit:[\"_evaluate\"]});for(let d in Af)Af[d]._classRegistryKey||ir(`Expression_${d}`,Af[d]);function rd(d){return d&&typeof ArrayBuffer<\"u\"&&(d instanceof ArrayBuffer||d.constructor&&d.constructor.name===\"ArrayBuffer\")}function id(d){return d.$name||d.constructor._classRegistryKey}function nd(d){return!(function(l){if(l===null||typeof l!=\"object\")return!1;let u=id(l);return!(!u||u===\"Object\")})(d)&&(d==null||typeof d==\"boolean\"||typeof d==\"number\"||typeof d==\"string\"||d instanceof Boolean||d instanceof Number||d instanceof String||d instanceof Date||d instanceof RegExp||d instanceof Blob||d instanceof Error||rd(d)||Xo(d)||ArrayBuffer.isView(d)||d instanceof ImageData)}function su(d,l){if(nd(d))return(rd(d)||Xo(d))&&l&&l.push(d),ArrayBuffer.isView(d)&&l&&l.push(d.buffer),d instanceof ImageData&&l&&l.push(d.data.buffer),d;if(Array.isArray(d)){let T=[];for(let M of d)T.push(su(M,l));return T}if(typeof d!=\"object\")throw new Error(\"can't serialize object of type \"+typeof d);let u=id(d);if(!u)throw new Error(`can't serialize object of unregistered class ${d.constructor.name}`);if(!bo[u])throw new Error(`${u} is not registered.`);let{klass:m}=bo[u],A=m.serialize?m.serialize(d,l):{};if(m.serialize){if(l&&A===l[l.length-1])throw new Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let T in d){if(!d.hasOwnProperty(T)||bo[u].omit.indexOf(T)>=0)continue;let M=d[T];A[T]=bo[u].shallow.indexOf(T)>=0?M:su(M,l)}d instanceof Error&&(A.message=d.message)}if(A.$name)throw new Error(\"$name property is reserved for worker serialization logic.\");return u!==\"Object\"&&(A.$name=u),A}function ih(d){if(nd(d))return d;if(Array.isArray(d))return d.map(ih);if(typeof d!=\"object\")throw new Error(\"can't deserialize object of type \"+typeof d);let l=id(d)||\"Object\";if(!bo[l])throw new Error(`can't deserialize unregistered class ${l}`);let{klass:u}=bo[l];if(!u)throw new Error(`can't deserialize unregistered class ${l}`);if(u.deserialize)return u.deserialize(d);let m=Object.create(u.prototype);for(let A of Object.keys(d)){if(A===\"$name\")continue;let T=d[A];m[A]=bo[l].shallow.indexOf(A)>=0?T:ih(T)}return m}class dy{constructor(){this.first=!0}update(l,u){let m=Math.floor(l);return this.first?(this.first=!1,this.lastIntegerZoom=m,this.lastIntegerZoomTime=0,this.lastZoom=l,this.lastFloorZoom=m,!0):(this.lastFloorZoom>m?(this.lastIntegerZoom=m+1,this.lastIntegerZoomTime=u):this.lastFloorZoom<m&&(this.lastIntegerZoom=m,this.lastIntegerZoomTime=u),l!==this.lastZoom&&(this.lastZoom=l,this.lastFloorZoom=m,!0))}}function PM(d){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(d))}function od(d){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1400-\\u167F\\u18B0-\\u18F5\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u303F\\u3041-\\u3096\\u309D-\\u30FB\\u30FD-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u3190-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFE4\\uDFF0-\\uDFF6]|[\\uD81C-\\uD822\\uD83D\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD30-\\uDEFB]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83C[\\uDC00-\\uDE00\\uDF00-\\uDFFF]|\\uD83E[\\uDD00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(d))}function M2(d){return/\\s/u.test(String.fromCodePoint(d))}function $m(d){for(let l of d)if(od(l.codePointAt(0)))return!0;return!1}function t0(d){for(let l of d)if(!e0(l.codePointAt(0)))return!1;return!0}function fy(d){let l=d.map((u=>{try{return new RegExp(`\\\\p{sc=${u}}`,\"u\").source}catch{return null}})).filter((u=>u));return new RegExp(l.join(\"|\"),\"u\")}let py=fy([\"Arab\",\"Dupl\",\"Mong\",\"Ougr\",\"Syrc\"]);function e0(d){return!py.test(String.fromCodePoint(d))}function sd(d){return!(od(d)||(l=d,/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(l))));var l}let xa=fy([\"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 lv(d){return xa.test(String.fromCodePoint(d))}function Gm(d,l){return!(!l&&lv(d)||/[\\u0900-\\u0DFF\\u0F00-\\u109F\\u1780-\\u17FF]/gim.test(String.fromCodePoint(d)))}function E2(d){for(let l of d)if(lv(l.codePointAt(0)))return!0;return!1}let ad=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(d){this.pluginStatus=d.pluginStatus,this.pluginURL=d.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(d){if(ad.isParsed())throw new Error(\"RTL text plugin already registered.\");this.applyArabicShaping=d.applyArabicShaping,this.processBidirectionalText=d.processBidirectionalText,this.processStyledBidirectionalText=d.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(d,l){return o(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(d.pluginStatus!==\"loading\")return this.setState(d),d;let u=d.pluginURL,m=new Promise((T=>{this.loadScriptResolve=T}));l(u);let A=new Promise((T=>setTimeout((()=>T()),this.TIMEOUT)));if(yield Promise.race([m,A]),this.isParsed()){let T={pluginStatus:\"loaded\",pluginURL:u};return this.setState(T),T}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),new Error(`RTL Text Plugin failed to import scripts from ${u}`)}))}};class hn{constructor(l,u){this.isSupportedScript=P2,this.zoom=l,u?(this.now=u.now||0,this.fadeDuration=u.fadeDuration||0,this.zoomHistory=u.zoomHistory||new dy,this.transition=u.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new dy,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let l=this.zoom,u=l-Math.floor(l),m=this.crossFadingFactor();return l>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*m}:{fromScale:.5,toScale:1,t:1-(1-m)*u}}}function P2(d){return(function(l,u){for(let m of l)if(!Gm(m.codePointAt(0),u))return!1;return!0})(d,ad.getRTLTextPluginStatus()===\"loaded\")}let Wm=\"-transition\";class qm{constructor(l,u,m){this.property=l,this.value=u,this.expression=(function(A,T,M){if(Rm(A))return new yf(A,T);if($p(A)){let P=b2(A,T,M);if(P.result===\"error\")throw new Error(P.value.map((L=>`${L.key}: ${L.message}`)).join(\", \"));return P.value}{let P=A;return T.type===\"color\"&&typeof A==\"string\"?P=Mi.parse(A):T.type!==\"padding\"||typeof A!=\"number\"&&!Array.isArray(A)?T.type!==\"numberArray\"||typeof A!=\"number\"&&!Array.isArray(A)?T.type!==\"colorArray\"||typeof A!=\"string\"&&!Array.isArray(A)?T.type===\"variableAnchorOffsetCollection\"&&Array.isArray(A)?P=ta.parse(A):T.type===\"projectionDefinition\"&&typeof A==\"string\"&&(P=ra.parse(A)):P=Hn.parse(A):P=jo.parse(A):P=Fr.parse(A),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>P}}})(u===void 0?l.specification.default:u,l.specification,m)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(l,u,m){return this.property.possiblyEvaluate(this,l,u,m)}}class cv{constructor(l,u){this.property=l,this.value=new qm(l,void 0,u)}transitioned(l,u){return new my(this.property,this.value,u,Cr({},l.transition,this.transition),l.now)}untransitioned(){return new my(this.property,this.value,null,{},0)}}class Hm{constructor(l,u){this._properties=l,this._values=Object.create(l.defaultTransitionablePropertyValues),this._globalState=u}getValue(l){return He(this._values[l].value.value)}setValue(l,u){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new cv(this._values[l].property,this._globalState)),this._values[l].value=new qm(this._values[l].property,u===null?void 0:He(u),this._globalState)}getTransition(l){return He(this._values[l].transition)}setTransition(l,u){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new cv(this._values[l].property,this._globalState)),this._values[l].transition=He(u)||void 0}serialize(){let l={};for(let u of Object.keys(this._values)){let m=this.getValue(u);m!==void 0&&(l[u]=m);let A=this.getTransition(u);A!==void 0&&(l[`${u}${Wm}`]=A)}return l}transitioned(l,u){let m=new Ym(this._properties);for(let A of Object.keys(this._values))m._values[A]=this._values[A].transitioned(l,u._values[A]);return m}untransitioned(){let l=new Ym(this._properties);for(let u of Object.keys(this._values))l._values[u]=this._values[u].untransitioned();return l}}class my{constructor(l,u,m,A,T){this.property=l,this.value=u,this.begin=T+A.delay||0,this.end=this.begin+A.duration||0,l.specification.transition&&(A.delay||A.duration)&&(this.prior=m)}possiblyEvaluate(l,u,m){let A=l.now||0,T=this.value.possiblyEvaluate(l,u,m),M=this.prior;if(M){if(A>this.end)return this.prior=null,T;if(this.value.isDataDriven())return this.prior=null,T;if(A<this.begin)return M.possiblyEvaluate(l,u,m);{let P=(A-this.begin)/(this.end-this.begin);return this.property.interpolate(M.possiblyEvaluate(l,u,m),T,ee(P))}}return T}}class Ym{constructor(l){this._properties=l,this._values=Object.create(l.defaultTransitioningPropertyValues)}possiblyEvaluate(l,u,m){let A=new bf(this._properties);for(let T of Object.keys(this._values))A._values[T]=this._values[T].possiblyEvaluate(l,u,m);return A}hasTransition(){for(let l of Object.keys(this._values))if(this._values[l].prior)return!0;return!1}}class C2{constructor(l,u){this._properties=l,this._values=Object.create(l.defaultPropertyValues),this._globalState=u}hasValue(l){return this._values[l].value!==void 0}getValue(l){return He(this._values[l].value)}setValue(l,u){this._values[l]=new qm(this._values[l].property,u===null?void 0:He(u),this._globalState)}serialize(){let l={};for(let u of Object.keys(this._values)){let m=this.getValue(u);m!==void 0&&(l[u]=m)}return l}possiblyEvaluate(l,u,m){let A=new bf(this._properties);for(let T of Object.keys(this._values))A._values[T]=this._values[T].possiblyEvaluate(l,u,m);return A}}class bc{constructor(l,u,m){this.property=l,this.value=u,this.parameters=m}isConstant(){return this.value.kind===\"constant\"}constantOr(l){return this.value.kind===\"constant\"?this.value.value:l}evaluate(l,u,m,A){return this.property.evaluate(this.value,this.parameters,l,u,m,A)}}class bf{constructor(l){this._properties=l,this._values=Object.create(l.defaultPossiblyEvaluatedValues)}get(l){return this._values[l]}}class fr{constructor(l){this.specification=l}possiblyEvaluate(l,u){if(l.isDataDriven())throw new Error(\"Value should not be data driven\");return l.expression.evaluate(u)}interpolate(l,u,m){let A=Ls[this.specification.type];return A?A(l,u,m):l}}class Mr{constructor(l,u){this.specification=l,this.overrides=u}possiblyEvaluate(l,u,m,A){return new bc(this,l.expression.kind===\"constant\"||l.expression.kind===\"camera\"?{kind:\"constant\",value:l.expression.evaluate(u,null,{},m,A)}:l.expression,u)}interpolate(l,u,m){if(l.value.kind!==\"constant\"||u.value.kind!==\"constant\")return l;if(l.value.value===void 0||u.value.value===void 0)return new bc(this,{kind:\"constant\",value:void 0},l.parameters);let A=Ls[this.specification.type];if(A){let T=A(l.value.value,u.value.value,m);return new bc(this,{kind:\"constant\",value:T},l.parameters)}return l}evaluate(l,u,m,A,T,M){return l.kind===\"constant\"?l.value:l.evaluate(u,m,A,T,M)}}class Xm extends Mr{possiblyEvaluate(l,u,m,A){if(l.value===void 0)return new bc(this,{kind:\"constant\",value:void 0},u);if(l.expression.kind===\"constant\"){let T=l.expression.evaluate(u,null,{},m,A),M=l.property.specification.type===\"resolvedImage\"&&typeof T!=\"string\"?T.name:T,P=this._calculate(M,M,M,u);return new bc(this,{kind:\"constant\",value:P},u)}if(l.expression.kind===\"camera\"){let T=this._calculate(l.expression.evaluate({zoom:u.zoom-1}),l.expression.evaluate({zoom:u.zoom}),l.expression.evaluate({zoom:u.zoom+1}),u);return new bc(this,{kind:\"constant\",value:T},u)}return new bc(this,l.expression,u)}evaluate(l,u,m,A,T,M){if(l.kind===\"source\"){let P=l.evaluate(u,m,A,T,M);return this._calculate(P,P,P,u)}return l.kind===\"composite\"?this._calculate(l.evaluate({zoom:Math.floor(u.zoom)-1},m,A),l.evaluate({zoom:Math.floor(u.zoom)},m,A),l.evaluate({zoom:Math.floor(u.zoom)+1},m,A),u):l.value}_calculate(l,u,m,A){return A.zoom>A.zoomHistory.lastIntegerZoom?{from:l,to:u}:{from:m,to:u}}interpolate(l){return l}}class I2{constructor(l){this.specification=l}possiblyEvaluate(l,u,m,A){if(l.value!==void 0){if(l.expression.kind===\"constant\"){let T=l.expression.evaluate(u,null,{},m,A);return this._calculate(T,T,T,u)}return this._calculate(l.expression.evaluate(new hn(Math.floor(u.zoom-1),u)),l.expression.evaluate(new hn(Math.floor(u.zoom),u)),l.expression.evaluate(new hn(Math.floor(u.zoom+1),u)),u)}}_calculate(l,u,m,A){return A.zoom>A.zoomHistory.lastIntegerZoom?{from:l,to:u}:{from:m,to:u}}interpolate(l){return l}}class r0{constructor(l){this.specification=l}possiblyEvaluate(l,u,m,A){return!!l.expression.evaluate(u,null,{},m,A)}interpolate(){return!1}}class na{constructor(l){this.properties=l,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let u in l){let m=l[u];m.specification.overridable&&this.overridableProperties.push(u);let A=this.defaultPropertyValues[u]=new qm(m,void 0,void 0),T=this.defaultTransitionablePropertyValues[u]=new cv(m,void 0);this.defaultTransitioningPropertyValues[u]=T.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=A.possiblyEvaluate({})}}}ir(\"DataDrivenProperty\",Mr),ir(\"DataConstantProperty\",fr),ir(\"CrossFadedDataDrivenProperty\",Xm),ir(\"CrossFadedProperty\",I2),ir(\"ColorRampProperty\",r0);class yl extends ym{constructor(l,u,m){if(super(),this.id=l.id,this.type=l.type,this._globalState=m,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(A,T){return new Al(A,T)})(this.visibility,m),l.type!==\"custom\"&&(this.metadata=l.metadata,this.minzoom=l.minzoom,this.maxzoom=l.maxzoom,l.type!==\"background\"&&(this.source=l.source,this.sourceLayer=l[\"source-layer\"],this.filter=l.filter,this._featureFilter=Qh(l.filter,m)),u.layout&&(this._unevaluatedLayout=new C2(u.layout,m)),u.paint)){this._transitionablePaint=new Hm(u.paint,m);for(let A in l.paint)this.setPaintProperty(A,l.paint[A],{validate:!1});for(let A in l.layout)this.setLayoutProperty(A,l.layout[A],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bf(u.paint)}}setFilter(l){this.filter=l,this._featureFilter=Qh(l,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(l){return l===\"visibility\"?this.visibility:this._unevaluatedLayout.getValue(l)}getLayoutAffectingGlobalStateRefs(){let l=new Set;for(let u of this._visibilityExpression.getGlobalStateRefs())l.add(u);if(this._unevaluatedLayout)for(let u in this._unevaluatedLayout._values){let m=this._unevaluatedLayout._values[u];for(let A of m.getGlobalStateRefs())l.add(A)}for(let u of this._featureFilter.getGlobalStateRefs())l.add(u);return l}getPaintAffectingGlobalStateRefs(){var l;let u=new globalThis.Map;if(this._transitionablePaint)for(let m in this._transitionablePaint._values){let A=this._transitionablePaint._values[m].value;for(let T of A.getGlobalStateRefs()){let M=(l=u.get(T))!==null&&l!==void 0?l:[];M.push({name:m,value:A.value}),u.set(T,M)}}return u}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(l,u,m={}){if(u==null||!this._validate(S2,`layers.${this.id}.layout.${l}`,l,u,m))return l===\"visibility\"?(this.visibility=u,this._visibilityExpression.setValue(u),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(l,u)}getPaintProperty(l){return l.endsWith(Wm)?this._transitionablePaint.getTransition(l.slice(0,-11)):this._transitionablePaint.getValue(l)}setPaintProperty(l,u,m={}){if(u!=null&&this._validate(vc,`layers.${this.id}.paint.${l}`,l,u,m))return!1;if(l.endsWith(Wm))return this._transitionablePaint.setTransition(l.slice(0,-11),u||void 0),!1;{let A=this._transitionablePaint._values[l],T=A.property.specification[\"property-type\"]===\"cross-faded-data-driven\",M=A.value.isDataDriven(),P=A.value;this._transitionablePaint.setValue(l,u),this._handleSpecialPaintPropertyUpdate(l);let L=this._transitionablePaint._values[l].value;return L.isDataDriven()||M||T||this._handleOverridablePaintPropertyUpdate(l,P,L)}}_handleSpecialPaintPropertyUpdate(l){}_handleOverridablePaintPropertyUpdate(l,u,m){return!1}isHidden(l=this.minzoom,u=!1){return!!(this.minzoom&&l<(u?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&l>=this.maxzoom)||this._evaluatedVisibility===\"none\"}updateTransitions(l){this._transitioningPaint=this._transitionablePaint.transitioned(l,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(l,u){l.getCrossfadeParameters&&(this._crossfadeParameters=l.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(l,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(l,void 0,u)}serialize(){let l={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&&(l.layout=l.layout||{},l.layout.visibility=this.visibility),wr(l,((u,m)=>!(u===void 0||m===\"layout\"&&!Object.keys(u).length||m===\"paint\"&&!Object.keys(u).length)))}_validate(l,u,m,A,T={}){return(!T||T.validate!==!1)&&Jp(this,l.call(vf,{key:u,layerType:this.type,objectKey:m,value:A,styleSpec:Te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let l in this.paint._values){let u=this.paint.get(l);if(u instanceof bc&&Xh(u.property.specification)&&(u.value.kind===\"source\"||u.value.kind===\"composite\")&&u.value.isStateDependent)return!0}return!1}}let au;var k2={get paint(){return au=au||new na({\"raster-opacity\":new fr(Te.paint_raster[\"raster-opacity\"]),\"raster-hue-rotate\":new fr(Te.paint_raster[\"raster-hue-rotate\"]),\"raster-brightness-min\":new fr(Te.paint_raster[\"raster-brightness-min\"]),\"raster-brightness-max\":new fr(Te.paint_raster[\"raster-brightness-max\"]),\"raster-saturation\":new fr(Te.paint_raster[\"raster-saturation\"]),\"raster-contrast\":new fr(Te.paint_raster[\"raster-contrast\"]),resampling:new fr(Te.paint_raster.resampling),\"raster-resampling\":new fr(Te.paint_raster[\"raster-resampling\"]),\"raster-fade-duration\":new fr(Te.paint_raster[\"raster-fade-duration\"])})}};class CM extends yl{constructor(l,u){super(l,k2,u)}}let IM={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Zm{constructor(l,u){this._structArray=l,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class dn{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(l,u){return l._trim(),u&&(l.isTransferred=!0,u.push(l.arrayBuffer)),{length:l.length,arrayBuffer:l.arrayBuffer}}static deserialize(l){let u=Object.create(this.prototype);return u.arrayBuffer=l.arrayBuffer,u.length=l.length,u.capacity=l.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(l){this.reserve(l),this.length=l}reserve(l){if(l>this.capacity){this.capacity=Math.max(l,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function xo(d,l=1){let u=0,m=0;return{members:d.map((A=>{let T=IM[A.type].BYTES_PER_ELEMENT,M=u=nh(u,Math.max(l,T)),P=A.components||1;return m=Math.max(m,T),u+=T*P,{name:A.name,type:A.type,components:P,offset:M}})),size:nh(u,Math.max(m,l)),alignment:l}}function nh(d,l){return Math.ceil(d/l)*l}class xf extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u){let m=this.length;return this.resize(m+1),this.emplace(m,l,u)}emplace(l,u,m){let A=2*l;return this.int16[A+0]=u,this.int16[A+1]=m,l}}xf.prototype.bytesPerElement=4,ir(\"StructArrayLayout2i4\",xf);class Km extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m){let A=this.length;return this.resize(A+1),this.emplace(A,l,u,m)}emplace(l,u,m,A){let T=3*l;return this.int16[T+0]=u,this.int16[T+1]=m,this.int16[T+2]=A,l}}Km.prototype.bytesPerElement=6,ir(\"StructArrayLayout3i6\",Km);class wf extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A){let T=this.length;return this.resize(T+1),this.emplace(T,l,u,m,A)}emplace(l,u,m,A,T){let M=4*l;return this.int16[M+0]=u,this.int16[M+1]=m,this.int16[M+2]=A,this.int16[M+3]=T,l}}wf.prototype.bytesPerElement=8,ir(\"StructArrayLayout4i8\",wf);class gy extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M){let P=this.length;return this.resize(P+1),this.emplace(P,l,u,m,A,T,M)}emplace(l,u,m,A,T,M,P){let L=6*l;return this.int16[L+0]=u,this.int16[L+1]=m,this.int16[L+2]=A,this.int16[L+3]=T,this.int16[L+4]=M,this.int16[L+5]=P,l}}gy.prototype.bytesPerElement=12,ir(\"StructArrayLayout2i4i12\",gy);class uv extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M){let P=this.length;return this.resize(P+1),this.emplace(P,l,u,m,A,T,M)}emplace(l,u,m,A,T,M,P){let L=4*l,O=8*l;return this.int16[L+0]=u,this.int16[L+1]=m,this.uint8[O+4]=A,this.uint8[O+5]=T,this.uint8[O+6]=M,this.uint8[O+7]=P,l}}uv.prototype.bytesPerElement=8,ir(\"StructArrayLayout2i4ub8\",uv);class xc extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,u){let m=this.length;return this.resize(m+1),this.emplace(m,l,u)}emplace(l,u,m){let A=2*l;return this.float32[A+0]=u,this.float32[A+1]=m,l}}xc.prototype.bytesPerElement=8,ir(\"StructArrayLayout2f8\",xc);class ld extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M,P,L,O,V){let F=this.length;return this.resize(F+1),this.emplace(F,l,u,m,A,T,M,P,L,O,V)}emplace(l,u,m,A,T,M,P,L,O,V,F){let X=10*l;return this.uint16[X+0]=u,this.uint16[X+1]=m,this.uint16[X+2]=A,this.uint16[X+3]=T,this.uint16[X+4]=M,this.uint16[X+5]=P,this.uint16[X+6]=L,this.uint16[X+7]=O,this.uint16[X+8]=V,this.uint16[X+9]=F,l}}ld.prototype.bytesPerElement=20,ir(\"StructArrayLayout10ui20\",ld);class i0 extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M,P,L){let O=this.length;return this.resize(O+1),this.emplace(O,l,u,m,A,T,M,P,L)}emplace(l,u,m,A,T,M,P,L,O){let V=8*l;return this.uint16[V+0]=u,this.uint16[V+1]=m,this.uint16[V+2]=A,this.uint16[V+3]=T,this.uint16[V+4]=M,this.uint16[V+5]=P,this.uint16[V+6]=L,this.uint16[V+7]=O,l}}i0.prototype.bytesPerElement=16,ir(\"StructArrayLayout8ui16\",i0);class cd extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M,P,L,O,V,F,X){let j=this.length;return this.resize(j+1),this.emplace(j,l,u,m,A,T,M,P,L,O,V,F,X)}emplace(l,u,m,A,T,M,P,L,O,V,F,X,j){let nt=12*l;return this.int16[nt+0]=u,this.int16[nt+1]=m,this.int16[nt+2]=A,this.int16[nt+3]=T,this.uint16[nt+4]=M,this.uint16[nt+5]=P,this.uint16[nt+6]=L,this.uint16[nt+7]=O,this.int16[nt+8]=V,this.int16[nt+9]=F,this.int16[nt+10]=X,this.int16[nt+11]=j,l}}cd.prototype.bytesPerElement=24,ir(\"StructArrayLayout4i4ui4i24\",cd);class Tf extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,u,m){let A=this.length;return this.resize(A+1),this.emplace(A,l,u,m)}emplace(l,u,m,A){let T=3*l;return this.float32[T+0]=u,this.float32[T+1]=m,this.float32[T+2]=A,l}}Tf.prototype.bytesPerElement=12,ir(\"StructArrayLayout3f12\",Tf);class Qm extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(l){let u=this.length;return this.resize(u+1),this.emplace(u,l)}emplace(l,u){return this.uint32[1*l+0]=u,l}}Qm.prototype.bytesPerElement=4,ir(\"StructArrayLayout1ul4\",Qm);class Sf extends dn{_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(l,u,m,A,T,M,P,L,O){let V=this.length;return this.resize(V+1),this.emplace(V,l,u,m,A,T,M,P,L,O)}emplace(l,u,m,A,T,M,P,L,O,V){let F=10*l,X=5*l;return this.int16[F+0]=u,this.int16[F+1]=m,this.int16[F+2]=A,this.int16[F+3]=T,this.int16[F+4]=M,this.int16[F+5]=P,this.uint32[X+3]=L,this.uint16[F+8]=O,this.uint16[F+9]=V,l}}Sf.prototype.bytesPerElement=20,ir(\"StructArrayLayout6i1ul2ui20\",Sf);class lu extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M){let P=this.length;return this.resize(P+1),this.emplace(P,l,u,m,A,T,M)}emplace(l,u,m,A,T,M,P){let L=6*l;return this.int16[L+0]=u,this.int16[L+1]=m,this.int16[L+2]=A,this.int16[L+3]=T,this.int16[L+4]=M,this.int16[L+5]=P,l}}lu.prototype.bytesPerElement=12,ir(\"StructArrayLayout2i2i2i12\",lu);class Ay extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T){let M=this.length;return this.resize(M+1),this.emplace(M,l,u,m,A,T)}emplace(l,u,m,A,T,M){let P=4*l,L=8*l;return this.float32[P+0]=u,this.float32[P+1]=m,this.float32[P+2]=A,this.int16[L+6]=T,this.int16[L+7]=M,l}}Ay.prototype.bytesPerElement=16,ir(\"StructArrayLayout2f1f2i16\",Ay);class yy extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,u,m,A,T,M){let P=this.length;return this.resize(P+1),this.emplace(P,l,u,m,A,T,M)}emplace(l,u,m,A,T,M,P){let L=16*l,O=4*l,V=8*l;return this.uint8[L+0]=u,this.uint8[L+1]=m,this.float32[O+1]=A,this.float32[O+2]=T,this.int16[V+6]=M,this.int16[V+7]=P,l}}yy.prototype.bytesPerElement=16,ir(\"StructArrayLayout2ub2f2i16\",yy);class ud extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u,m){let A=this.length;return this.resize(A+1),this.emplace(A,l,u,m)}emplace(l,u,m,A){let T=3*l;return this.uint16[T+0]=u,this.uint16[T+1]=m,this.uint16[T+2]=A,l}}ud.prototype.bytesPerElement=6,ir(\"StructArrayLayout3ui6\",ud);class hv extends dn{_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(l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt){let vt=this.length;return this.resize(vt+1),this.emplace(vt,l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt)}emplace(l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt,vt){let At=24*l,wt=12*l,St=48*l;return this.int16[At+0]=u,this.int16[At+1]=m,this.uint16[At+2]=A,this.uint16[At+3]=T,this.uint32[wt+2]=M,this.uint32[wt+3]=P,this.uint32[wt+4]=L,this.uint16[At+10]=O,this.uint16[At+11]=V,this.uint16[At+12]=F,this.float32[wt+7]=X,this.float32[wt+8]=j,this.uint8[St+36]=nt,this.uint8[St+37]=st,this.uint8[St+38]=pt,this.uint32[wt+10]=mt,this.int16[At+22]=vt,l}}hv.prototype.bytesPerElement=48,ir(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48\",hv);class dv extends dn{_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(l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt,vt,At,wt,St,Bt,qt,te,he,fe,Se,ve){let be=this.length;return this.resize(be+1),this.emplace(be,l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt,vt,At,wt,St,Bt,qt,te,he,fe,Se,ve)}emplace(l,u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt,vt,At,wt,St,Bt,qt,te,he,fe,Se,ve,be){let Ae=32*l,Ze=16*l;return this.int16[Ae+0]=u,this.int16[Ae+1]=m,this.int16[Ae+2]=A,this.int16[Ae+3]=T,this.int16[Ae+4]=M,this.int16[Ae+5]=P,this.int16[Ae+6]=L,this.int16[Ae+7]=O,this.uint16[Ae+8]=V,this.uint16[Ae+9]=F,this.uint16[Ae+10]=X,this.uint16[Ae+11]=j,this.uint16[Ae+12]=nt,this.uint16[Ae+13]=st,this.uint16[Ae+14]=pt,this.uint16[Ae+15]=mt,this.uint16[Ae+16]=vt,this.uint16[Ae+17]=At,this.uint16[Ae+18]=wt,this.uint16[Ae+19]=St,this.uint16[Ae+20]=Bt,this.uint16[Ae+21]=qt,this.uint16[Ae+22]=te,this.uint32[Ze+12]=he,this.float32[Ze+13]=fe,this.float32[Ze+14]=Se,this.uint16[Ae+30]=ve,this.uint16[Ae+31]=be,l}}dv.prototype.bytesPerElement=64,ir(\"StructArrayLayout8i15ui1ul2f2ui64\",dv);class Jm extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l){let u=this.length;return this.resize(u+1),this.emplace(u,l)}emplace(l,u){return this.float32[1*l+0]=u,l}}Jm.prototype.bytesPerElement=4,ir(\"StructArrayLayout1f4\",Jm);class fv extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,u,m){let A=this.length;return this.resize(A+1),this.emplace(A,l,u,m)}emplace(l,u,m,A){let T=3*l;return this.uint16[6*l+0]=u,this.float32[T+1]=m,this.float32[T+2]=A,l}}fv.prototype.bytesPerElement=12,ir(\"StructArrayLayout1ui2f12\",fv);class I extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u,m){let A=this.length;return this.resize(A+1),this.emplace(A,l,u,m)}emplace(l,u,m,A){let T=4*l;return this.uint32[2*l+0]=u,this.uint16[T+2]=m,this.uint16[T+3]=A,l}}I.prototype.bytesPerElement=8,ir(\"StructArrayLayout1ul2ui8\",I);class c extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,u){let m=this.length;return this.resize(m+1),this.emplace(m,l,u)}emplace(l,u,m){let A=2*l;return this.uint16[A+0]=u,this.uint16[A+1]=m,l}}c.prototype.bytesPerElement=4,ir(\"StructArrayLayout2ui4\",c);class f extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l){let u=this.length;return this.resize(u+1),this.emplace(u,l)}emplace(l,u){return this.uint16[1*l+0]=u,l}}f.prototype.bytesPerElement=2,ir(\"StructArrayLayout1ui2\",f);class b extends dn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,u,m,A){let T=this.length;return this.resize(T+1),this.emplace(T,l,u,m,A)}emplace(l,u,m,A,T){let M=4*l;return this.float32[M+0]=u,this.float32[M+1]=m,this.float32[M+2]=A,this.float32[M+3]=T,l}}b.prototype.bytesPerElement=16,ir(\"StructArrayLayout4f16\",b);class S extends Zm{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 s(this.anchorPointX,this.anchorPointY)}}S.prototype.size=20;class D extends Sf{get(l){return new S(this,l)}}ir(\"CollisionBoxArray\",D);class N extends Zm{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(l){this._structArray.uint8[this._pos1+37]=l}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(l){this._structArray.uint8[this._pos1+38]=l}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(l){this._structArray.uint32[this._pos4+10]=l}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}N.prototype.size=48;class G extends hv{get(l){return new N(this,l)}}ir(\"PlacedSymbolArray\",G);class q extends Zm{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(l){this._structArray.uint32[this._pos4+12]=l}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]}}q.prototype.size=64;class K extends dv{get(l){return new q(this,l)}}ir(\"SymbolInstanceArray\",K);class it extends Jm{getoffsetX(l){return this.float32[1*l+0]}}ir(\"GlyphOffsetArray\",it);class ct extends Km{getx(l){return this.int16[3*l+0]}gety(l){return this.int16[3*l+1]}gettileUnitDistanceFromAnchor(l){return this.int16[3*l+2]}}ir(\"SymbolLineVertexArray\",ct);class ut extends Zm{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]}}ut.prototype.size=12;class gt extends fv{get(l){return new ut(this,l)}}ir(\"TextAnchorOffsetArray\",gt);class yt extends Zm{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]}}yt.prototype.size=8;class Pt extends I{get(l){return new yt(this,l)}}ir(\"FeatureIndexArray\",Pt);class Ct extends xf{}class Rt extends xf{}class Ut extends xf{}class Gt extends gy{}class zt extends uv{}class jt extends xc{}class Wt extends ld{}class It extends i0{}class Xt extends cd{}class Kt extends Tf{}class de extends Qm{}class le extends lu{}class me extends yy{}class Le extends ud{}class $e extends c{}let Ee=xo([{name:\"a_pos\",components:2,type:\"Int16\"}],4),{members:sr}=Ee;class ur{constructor(l=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=l}prepareSegment(l,u,m,A){let T=this.segments[this.segments.length-1];return l>ur.MAX_VERTEX_ARRAY_LENGTH&&ln(`Max vertices per segment is ${ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${l}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!T||T.vertexLength+l>ur.MAX_VERTEX_ARRAY_LENGTH||T.sortKey!==A?this.createNewSegment(u,m,A):T}createNewSegment(l,u,m){let A={vertexOffset:l.length,primitiveOffset:u.length,vertexLength:0,primitiveLength:0,vaos:{}};return m!==void 0&&(A.sortKey=m),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(A),A}getOrCreateLatestSegment(l,u,m){return this.prepareSegment(0,l,u,m)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let l of this.segments)for(let u in l.vaos)l.vaos[u].destroy()}static simpleSegment(l,u,m,A){return new ur([{vertexOffset:l,primitiveOffset:u,vertexLength:m,primitiveLength:A,vaos:{},sortKey:0}])}}function ji(d,l){return 256*(d=gr(Math.floor(d),0,255))+gr(Math.floor(l),0,255)}ur.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ir(\"SegmentVector\",ur);let Me=xo([{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\"}]),Re=xo([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]);var wn,fn,oo,en={exports:{}},so={exports:{}},pn={exports:{}},Do=(function(){if(oo)return en.exports;oo=1;var d=(wn||(wn=1,so.exports=function(u,m){var A,T,M,P,L,O,V,F;for(T=u.length-(A=3&u.length),M=m,L=3432918353,O=461845907,F=0;F<T;)V=255&u.charCodeAt(F)|(255&u.charCodeAt(++F))<<8|(255&u.charCodeAt(++F))<<16|(255&u.charCodeAt(++F))<<24,++F,M=27492+(65535&(P=5*(65535&(M=(M^=V=(65535&(V=(V=(65535&V)*L+(((V>>>16)*L&65535)<<16)&4294967295)<<15|V>>>17))*O+(((V>>>16)*O&65535)<<16)&4294967295)<<13|M>>>19))+((5*(M>>>16)&65535)<<16)&4294967295))+((58964+(P>>>16)&65535)<<16);switch(V=0,A){case 3:V^=(255&u.charCodeAt(F+2))<<16;case 2:V^=(255&u.charCodeAt(F+1))<<8;case 1:M^=V=(65535&(V=(V=(65535&(V^=255&u.charCodeAt(F)))*L+(((V>>>16)*L&65535)<<16)&4294967295)<<15|V>>>17))*O+(((V>>>16)*O&65535)<<16)&4294967295}return M^=u.length,M=2246822507*(65535&(M^=M>>>16))+((2246822507*(M>>>16)&65535)<<16)&4294967295,M=3266489909*(65535&(M^=M>>>13))+((3266489909*(M>>>16)&65535)<<16)&4294967295,(M^=M>>>16)>>>0}),so.exports),l=(fn||(fn=1,pn.exports=function(u,m){for(var A,T=u.length,M=m^T,P=0;T>=4;)A=1540483477*(65535&(A=255&u.charCodeAt(P)|(255&u.charCodeAt(++P))<<8|(255&u.charCodeAt(++P))<<16|(255&u.charCodeAt(++P))<<24))+((1540483477*(A>>>16)&65535)<<16),M=1540483477*(65535&M)+((1540483477*(M>>>16)&65535)<<16)^(A=1540483477*(65535&(A^=A>>>24))+((1540483477*(A>>>16)&65535)<<16)),T-=4,++P;switch(T){case 3:M^=(255&u.charCodeAt(P+2))<<16;case 2:M^=(255&u.charCodeAt(P+1))<<8;case 1:M=1540483477*(65535&(M^=255&u.charCodeAt(P)))+((1540483477*(M>>>16)&65535)<<16)}return M=1540483477*(65535&(M^=M>>>13))+((1540483477*(M>>>16)&65535)<<16),(M^=M>>>15)>>>0}),pn.exports);return en.exports=d,en.exports.murmur3=d,en.exports.murmur2=l,en.exports})(),ao=a(Do);class y{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(l,u,m,A){this.ids.push(_(l)),this.positions.push(u,m,A)}getPositions(l){if(!this.indexed)throw new Error(\"Trying to get index, but feature positions are not indexed\");let u=_(l),m=0,A=this.ids.length-1;for(;m<A;){let M=m+A>>1;this.ids[M]>=u?A=M:m=M+1}let T=[];for(;this.ids[m]===u;)T.push({index:this.positions[3*m],start:this.positions[3*m+1],end:this.positions[3*m+2]}),m++;return T}static serialize(l,u){let m=new Float64Array(l.ids),A=new Uint32Array(l.positions);return x(m,A,0,m.length-1),u&&u.push(m.buffer,A.buffer),{ids:m,positions:A}}static deserialize(l){let u=new y;return u.ids=l.ids,u.positions=l.positions,u.indexed=!0,u}}function _(d){let l=+d;return!isNaN(l)&&l<=Number.MAX_SAFE_INTEGER?l:ao(String(d))}function x(d,l,u,m){for(;u<m;){let A=d[u+m>>1],T=u-1,M=m+1;for(;;){do T++;while(d[T]<A);do M--;while(d[M]>A);if(T>=M)break;E(d,T,M),E(l,3*T,3*M),E(l,3*T+1,3*M+1),E(l,3*T+2,3*M+2)}M-u<m-M?(x(d,l,u,M),u=M+1):(x(d,l,M+1,m),m=M)}}function E(d,l,u){let m=d[l];d[l]=d[u],d[u]=m}ir(\"FeaturePositionMap\",y);class k{constructor(l,u){this.gl=l.gl,this.location=u}}class B extends k{constructor(l,u){super(l,u),this.current=0}set(l){this.current!==l&&(this.current=l,this.gl.uniform1f(this.location,l))}}class U extends k{constructor(l,u){super(l,u),this.current=[0,0,0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]&&l[3]===this.current[3]||(this.current=l,this.gl.uniform4f(this.location,l[0],l[1],l[2],l[3]))}}class $ extends k{constructor(l,u){super(l,u),this.current=Mi.transparent}set(l){l.r===this.current.r&&l.g===this.current.g&&l.b===this.current.b&&l.a===this.current.a||(this.current=l,this.gl.uniform4f(this.location,l.r,l.g,l.b,l.a))}}let Z=new Float32Array(16);function ot(d){return[ji(255*d.r,255*d.g),ji(255*d.b,255*d.a)]}class ht{constructor(l,u,m){this.value=l,this.uniformNames=u.map((A=>`u_${A}`)),this.type=m}setUniform(l,u,m){l.set(m.constantOr(this.value))}getBinding(l,u,m){return this.type===\"color\"?new $(l,u):new B(l,u)}}class xt{constructor(l,u){this.uniformNames=u.map((m=>`u_${m}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(l,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=l.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=l.tlbr}setConstantDashPositions(l,u){this.dashTo=[0,l.y,l.height,l.width],this.dashFrom=[0,u.y,u.height,u.width]}setUniform(l,u,m,A){let T=null;A===\"u_pattern_to\"?T=this.patternTo:A===\"u_pattern_from\"?T=this.patternFrom:A===\"u_dasharray_to\"?T=this.dashTo:A===\"u_dasharray_from\"?T=this.dashFrom:A===\"u_pixel_ratio_to\"?T=this.pixelRatioTo:A===\"u_pixel_ratio_from\"&&(T=this.pixelRatioFrom),T!==null&&l.set(T)}getBinding(l,u,m){return m.startsWith(\"u_pattern\")||m.startsWith(\"u_dasharray_\")?new U(l,u):new B(l,u)}}class kt{constructor(l,u,m,A){this.expression=l,this.type=m,this.maxValue=0,this.paintVertexAttributes=u.map((T=>({name:`a_${T}`,type:\"Float32\",components:m===\"color\"?2:1,offset:0}))),this.paintVertexArray=new A}populatePaintArray(l,u,m){let A=this.paintVertexArray.length,T=this.expression.evaluate(new hn(0,m),u,{},m.canonical,[],m.formattedSection);this.paintVertexArray.resize(l),this._setPaintValue(A,l,T)}updatePaintArray(l,u,m,A,T){let M=this.expression.evaluate(new hn(0,T),m,A);this._setPaintValue(l,u,M)}_setPaintValue(l,u,m){if(this.type===\"color\"){let A=ot(m);for(let T=l;T<u;T++)this.paintVertexArray.emplace(T,A[0],A[1])}else{for(let A=l;A<u;A++)this.paintVertexArray.emplace(A,m);this.maxValue=Math.max(this.maxValue,Math.abs(m))}}upload(l){var u;!((u=this.paintVertexArray)===null||u===void 0)&&u.arrayBuffer.byteLength&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=l.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ot{constructor(l,u,m,A,T,M){this.expression=l,this.uniformNames=u.map((P=>`u_${P}_t`)),this.type=m,this.useIntegerZoom=A,this.zoom=T,this.maxValue=0,this.paintVertexAttributes=u.map((P=>({name:`a_${P}`,type:\"Float32\",components:m===\"color\"?4:2,offset:0}))),this.paintVertexArray=new M}populatePaintArray(l,u,m){let A=this.expression.evaluate(new hn(this.zoom,m),u,{},m.canonical,[],m.formattedSection),T=this.expression.evaluate(new hn(this.zoom+1,m),u,{},m.canonical,[],m.formattedSection),M=this.paintVertexArray.length;this.paintVertexArray.resize(l),this._setPaintValue(M,l,A,T)}updatePaintArray(l,u,m,A,T){let M=this.expression.evaluate(new hn(this.zoom,T),m,A),P=this.expression.evaluate(new hn(this.zoom+1,T),m,A);this._setPaintValue(l,u,M,P)}_setPaintValue(l,u,m,A){if(this.type===\"color\"){let T=ot(m),M=ot(A);for(let P=l;P<u;P++)this.paintVertexArray.emplace(P,T[0],T[1],M[0],M[1])}else{for(let T=l;T<u;T++)this.paintVertexArray.emplace(T,m,A);this.maxValue=Math.max(this.maxValue,Math.abs(m),Math.abs(A))}}upload(l){var u;!((u=this.paintVertexArray)===null||u===void 0)&&u.arrayBuffer.byteLength&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=l.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(l,u){let m=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,A=gr(this.expression.interpolationFactor(m,this.zoom,this.zoom+1),0,1);l.set(A)}getBinding(l,u,m){return new B(l,u)}}class Dt{constructor(l,u,m,A,T,M){this.expression=l,this.type=u,this.useIntegerZoom=m,this.zoom=A,this.layerId=M,this.zoomInPaintVertexArray=new T,this.zoomOutPaintVertexArray=new T}populatePaintArray(l,u,m){let A=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(l),this.zoomOutPaintVertexArray.resize(l),this._setPaintValues(A,l,this.getPositionIds(u),m)}updatePaintArray(l,u,m,A,T){this._setPaintValues(l,u,this.getPositionIds(m),T)}_setPaintValues(l,u,m,A){let T=this.getPositions(A);if(!T||!m)return;let M=T[m.min],P=T[m.mid],L=T[m.max];if(M&&P&&L)for(let O=l;O<u;O++)this.emplace(this.zoomInPaintVertexArray,O,P,M),this.emplace(this.zoomOutPaintVertexArray,O,P,L)}upload(l){var u,m;if(!((u=this.zoomInPaintVertexArray)===null||u===void 0)&&u.arrayBuffer.byteLength&&(!((m=this.zoomOutPaintVertexArray)===null||m===void 0)&&m.arrayBuffer.byteLength)){let A=this.getVertexAttributes();this.zoomInPaintVertexBuffer=l.createVertexBuffer(this.zoomInPaintVertexArray,A,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=l.createVertexBuffer(this.zoomOutPaintVertexArray,A,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Zt extends Dt{getPositions(l){return l.imagePositions}getPositionIds(l){return l.patterns&&l.patterns[this.layerId]}getVertexAttributes(){return Me.members}emplace(l,u,m,A){l.emplace(u,m.tlbr[0],m.tlbr[1],m.tlbr[2],m.tlbr[3],A.tlbr[0],A.tlbr[1],A.tlbr[2],A.tlbr[3],m.pixelRatio,A.pixelRatio)}}class re extends Dt{getPositions(l){return l.dashPositions}getPositionIds(l){return l.dashes&&l.dashes[this.layerId]}getVertexAttributes(){return Re.members}emplace(l,u,m,A){l.emplace(u,0,m.y,m.height,m.width,0,A.y,A.height,A.width)}}class ye{constructor(l,u,m){this.binders={},this._buffers=[];let A=[];for(let T in l.paint._values){if(!m(T))continue;let M=l.paint.get(T);if(!(M instanceof bc&&Xh(M.property.specification)))continue;let P=ae(T,l.type),L=M.value,O=M.property.specification.type,V=M.property.useIntegerZoom,F=M.property.specification[\"property-type\"],X=F===\"cross-faded\"||F===\"cross-faded-data-driven\";if(L.kind===\"constant\")this.binders[T]=X?new xt(L.value,P):new ht(L.value,P,O),A.push(`/u_${T}`);else if(L.kind===\"source\"||X){let j=Jt(T,O,\"source\");this.binders[T]=X?T===\"line-dasharray\"?new re(L,O,V,u,j,l.id):new Zt(L,O,V,u,j,l.id):new kt(L,P,O,j),A.push(`/a_${T}`)}else{let j=Jt(T,O,\"composite\");this.binders[T]=new Ot(L,P,O,V,u,j),A.push(`/z_${T}`)}}this.cacheKey=A.sort().join(\"\")}getMaxValue(l){let u=this.binders[l];return u instanceof kt||u instanceof Ot?u.maxValue:0}populatePaintArrays(l,u,m){for(let A in this.binders){let T=this.binders[A];(T instanceof kt||T instanceof Ot||T instanceof Dt)&&T.populatePaintArray(l,u,m)}}setConstantPatternPositions(l,u){for(let m in this.binders){let A=this.binders[m];A instanceof xt&&A.setConstantPatternPositions(l,u)}}setConstantDashPositions(l,u){for(let m in this.binders){let A=this.binders[m];A instanceof xt&&A.setConstantDashPositions(l,u)}}updatePaintArrays(l,u,m,A,T){let M=!1;for(let P in l){let L=u.getPositions(P);for(let O of L){let V=m.feature(O.index);for(let F in this.binders){let X=this.binders[F];if((X instanceof kt||X instanceof Ot||X instanceof Dt)&&X.expression.isStateDependent===!0){let j=A.paint.get(F);X.expression=j.value,X.updatePaintArray(O.start,O.end,V,l[P],T),M=!0}}}}return M}defines(){let l=[];for(let u in this.binders){let m=this.binders[u];(m instanceof ht||m instanceof xt)&&l.push(...m.uniformNames.map((A=>`#define HAS_UNIFORM_${A}`)))}return l}getBinderAttributes(){let l=[];for(let u in this.binders){let m=this.binders[u];if(m instanceof kt||m instanceof Ot)for(let A=0;A<m.paintVertexAttributes.length;A++)l.push(m.paintVertexAttributes[A].name);else if(m instanceof Dt){let A=m.getVertexAttributes();for(let T of A)l.push(T.name)}}return l}getBinderUniforms(){let l=[];for(let u in this.binders){let m=this.binders[u];if(m instanceof ht||m instanceof xt||m instanceof Ot)for(let A of m.uniformNames)l.push(A)}return l}getPaintVertexBuffers(){return this._buffers}getUniforms(l,u){let m=[];for(let A in this.binders){let T=this.binders[A];if(T instanceof ht||T instanceof xt||T instanceof Ot){for(let M of T.uniformNames)if(u[M]){let P=T.getBinding(l,u[M],M);m.push({name:M,property:A,binding:P})}}}return m}setUniforms(l,u,m,A){for(let{name:T,property:M,binding:P}of u)this.binders[M].setUniform(P,A,m.get(M),T)}updatePaintBuffers(l){this._buffers=[];for(let u in this.binders){let m=this.binders[u];if(l&&m instanceof Dt){let A=l.fromScale===2?m.zoomInPaintVertexBuffer:m.zoomOutPaintVertexBuffer;A&&this._buffers.push(A)}else(m instanceof kt||m instanceof Ot)&&m.paintVertexBuffer&&this._buffers.push(m.paintVertexBuffer)}}upload(l){for(let u in this.binders){let m=this.binders[u];(m instanceof kt||m instanceof Ot||m instanceof Dt)&&m.upload(l)}this.updatePaintBuffers()}destroy(){for(let l in this.binders){let u=this.binders[l];(u instanceof kt||u instanceof Ot||u instanceof Dt)&&u.destroy()}}}class se{constructor(l,u,m=()=>!0){this.programConfigurations={};for(let A of l)this.programConfigurations[A.id]=new ye(A,u,m);this.needsUpload=!1,this._featureMap=new y,this._bufferOffset=0}populatePaintArrays(l,u,m,A){for(let T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(l,u,A);u.id!==void 0&&this._featureMap.add(u.id,m,this._bufferOffset,l),this._bufferOffset=l,this.needsUpload=!0}updatePaintArrays(l,u,m,A){for(let T of m)this.needsUpload=this.programConfigurations[T.id].updatePaintArrays(l,this._featureMap,u,T,A)||this.needsUpload}get(l){return this.programConfigurations[l]}upload(l){if(this.needsUpload){for(let u in this.programConfigurations)this.programConfigurations[u].upload(l);this.needsUpload=!1}}destroy(){for(let l in this.programConfigurations)this.programConfigurations[l].destroy()}}function ae(d,l){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-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"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\"]}[d]||[d.replace(`${l}-`,\"\").replace(/-/g,\"_\")]}function Jt(d,l,u){let m={color:{source:xc,composite:b},number:{source:Jm,composite:xc}},A=(function(T){return{\"line-pattern\":{source:Wt,composite:Wt},\"fill-pattern\":{source:Wt,composite:Wt},\"fill-extrusion-pattern\":{source:Wt,composite:Wt},\"line-dasharray\":{source:It,composite:It}}[T]})(d);return A&&A[u]||m[l][u]}ir(\"ConstantBinder\",ht),ir(\"CrossFadedConstantBinder\",xt),ir(\"SourceExpressionBinder\",kt),ir(\"CrossFadedPatternBinder\",Zt),ir(\"CrossFadedDasharrayBinder\",re),ir(\"CompositeExpressionBinder\",Ot),ir(\"ProgramConfiguration\",ye,{omit:[\"_buffers\"]}),ir(\"ProgramConfigurationSet\",se);let Ve=Math.pow(2,14)-1,br=-Ve-1;function cr(d){let l=Pe/d.extent,u=d.loadGeometry();for(let m=0;m<u.length;m++){let A=u[m];for(let T=0;T<A.length;T++){let M=A[T],P=Math.round(M.x*l),L=Math.round(M.y*l);M.x=gr(P,br,Ve),M.y=gr(L,br,Ve),(P<M.x||P>M.x+1||L<M.y||L>M.y+1)&&ln(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}}return u}function Or(d,l){return{type:d.type,id:d.id,properties:d.properties,geometry:l?cr(d):[]}}let Yr=-32768;function vi(d,l,u,m,A){d.emplaceBack(Yr+8*l+m,Yr+8*u+A)}class Dr{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=l.index,this.hasDependencies=!1,this.layoutVertexArray=new Rt,this.indexArray=new Le,this.segments=new ur,this.programConfigurations=new se(l.layers,l.zoom),this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(l,u,m){let A=this.layers[0],T=[],M=null,P=!1,L=A.type===\"heatmap\";if(A.type===\"circle\"){let V=A;M=V.layout.get(\"circle-sort-key\"),P=!M.isConstant(),L=L||V.paint.get(\"circle-pitch-alignment\")===\"map\"}let O=L?u.subdivisionGranularity.circle:1;for(let{feature:V,id:F,index:X,sourceLayerIndex:j}of l){let nt=this.layers[0]._featureFilter.needGeometry,st=Or(V,nt);if(!this.layers[0]._featureFilter.filter(new hn(this.zoom),st,m))continue;let pt=P?M.evaluate(st,{},m):void 0,mt={id:F,properties:V.properties,type:V.type,sourceLayerIndex:j,index:X,geometry:nt?st.geometry:cr(V),patterns:{},sortKey:pt};T.push(mt)}P&&T.sort(((V,F)=>V.sortKey-F.sortKey));for(let V of T){let{geometry:F,index:X,sourceLayerIndex:j}=V,nt=l[X].feature;this.addFeature(V,F,X,m,O),u.featureIndex.insert(nt,F,X,j,this.index)}}update(l,u,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,u,this.stateDependentLayers,{imagePositions:m})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,sr),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(l,u,m,A,T=1){let M;switch(T){case 1:M=[0,7];break;case 3:M=[0,2,5,7];break;case 5:M=[0,1,3,4,6,7];break;case 7:M=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${T}; valid values are 1, 3, 5, 7.`)}let P=M.length;for(let L of u)for(let O of L){let V=O.x,F=O.y;if(V<0||V>=Pe||F<0||F>=Pe)continue;let X=this.segments.prepareSegment(P*P,this.layoutVertexArray,this.indexArray,l.sortKey),j=X.vertexLength;for(let nt=0;nt<P;nt++)for(let st=0;st<P;st++)vi(this.layoutVertexArray,V,F,M[st],M[nt]);for(let nt=0;nt<P-1;nt++)for(let st=0;st<P-1;st++){let pt=j+nt*P+st,mt=j+(nt+1)*P+st;this.indexArray.emplaceBack(pt,mt+1,pt+1),this.indexArray.emplaceBack(pt,mt,mt+1)}X.vertexLength+=P*P,X.primitiveLength+=(P-1)*(P-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,m,{imagePositions:{},canonical:A})}}function Sr(d,l){for(let u=0;u<d.length;u++)if(R2(l,d[u]))return!0;for(let u=0;u<l.length;u++)if(R2(d,l[u]))return!0;return!!ci(d,l)}function We(d,l,u){return!!R2(d,l)||!!wa(l,d,u)}function Ai(d,l){if(d.length===1)return bnt(l,d[0]);for(let u=0;u<l.length;u++){let m=l[u];for(let A=0;A<m.length;A++)if(R2(d,m[A]))return!0}for(let u=0;u<d.length;u++)if(bnt(l,d[u]))return!0;for(let u=0;u<l.length;u++)if(ci(d,l[u]))return!0;return!1}function Tn(d,l,u){if(d.length>1){if(ci(d,l))return!0;for(let m=0;m<l.length;m++)if(wa(l[m],d,u))return!0}for(let m=0;m<d.length;m++)if(wa(d[m],l,u))return!0;return!1}function ci(d,l){if(d.length===0||l.length===0)return!1;for(let u=0;u<d.length-1;u++){let m=d[u],A=d[u+1];for(let T=0;T<l.length-1;T++)if(Sn(m,A,l[T],l[T+1]))return!0}return!1}function Sn(d,l,u,m){return Io(d,u,m)!==Io(l,u,m)&&Io(d,l,u)!==Io(d,l,m)}function wa(d,l,u){let m=u*u;if(l.length===1)return d.distSqr(l[0])<m;for(let A=1;A<l.length;A++)if(kM(d,l[A-1],l[A])<m)return!0;return!1}function kM(d,l,u){let m=l.distSqr(u);if(m===0)return d.distSqr(l);let A=((d.x-l.x)*(u.x-l.x)+(d.y-l.y)*(u.y-l.y))/m;return d.distSqr(A<0?l:A>1?u:u.sub(l)._mult(A)._add(l))}function bnt(d,l){let u,m,A,T=!1;for(let M=0;M<d.length;M++){u=d[M];for(let P=0,L=u.length-1;P<u.length;L=P++)m=u[P],A=u[L],m.y>l.y!=A.y>l.y&&l.x<(A.x-m.x)*(l.y-m.y)/(A.y-m.y)+m.x&&(T=!T)}return T}function R2(d,l){let u=!1;for(let m=0,A=d.length-1;m<d.length;A=m++){let T=d[m],M=d[A];T.y>l.y!=M.y>l.y&&l.x<(M.x-T.x)*(l.y-T.y)/(M.y-T.y)+T.x&&(u=!u)}return u}function F8t(d,l,u){let m=u[0],A=u[2];if(d.x<m.x&&l.x<m.x||d.x>A.x&&l.x>A.x||d.y<m.y&&l.y<m.y||d.y>A.y&&l.y>A.y)return!1;let T=Io(d,l,u[0]);return T!==Io(d,l,u[1])||T!==Io(d,l,u[2])||T!==Io(d,l,u[3])}function D2(d,l,u){let m=l.paint.get(d).value;return m.kind===\"constant\"?m.value:u.programConfigurations.get(l.id).getMaxValue(d)}function hR(d){return Math.sqrt(d[0]*d[0]+d[1]*d[1])}function dR(d,l,u,m,A){if(!l[0]&&!l[1])return d;let T=s.convert(l)._mult(A);u===\"viewport\"&&T._rotate(-m);let M=[];for(let P=0;P<d.length;P++)M.push(d[P].sub(T));return M}function N8t(d){let l=[];for(let u=0;u<d.length;u++){let m=d[u],A=l.at(-1);(u===0||A&&!m.equals(A))&&l.push(m)}return l}function z8t({queryGeometry:d,size:l},u){return We(d,u,l)}function U8t({queryGeometry:d,size:l,transform:u,unwrappedTileID:m,getElevation:A},T){return We(d,T,l*(u.projectTileCoordinates(T.x,T.y,m,A).signedDistanceFromCamera/u.cameraToCenterDistance))}function V8t({queryGeometry:d,size:l,transform:u,unwrappedTileID:m,getElevation:A},T){let M=u.projectTileCoordinates(T.x,T.y,m,A).signedDistanceFromCamera,P=l*(u.cameraToCenterDistance/M);return We(d,jV(T,u,m,A),P)}function j8t({queryGeometry:d,size:l,transform:u,unwrappedTileID:m,getElevation:A},T){return We(d,jV(T,u,m,A),l)}function xnt({queryGeometry:d,size:l,transform:u,unwrappedTileID:m,getElevation:A,pitchAlignment:T=\"map\",pitchScale:M=\"map\"},P){let L=T===\"map\"?M===\"map\"?z8t:U8t:M===\"map\"?V8t:j8t,O={queryGeometry:d,size:l,transform:u,unwrappedTileID:m,getElevation:A};for(let V of P)for(let F of V)if(L(O,F))return!0;return!1}function jV(d,l,u,m){let A=l.projectTileCoordinates(d.x,d.y,u,m).point;return new s((.5*A.x+.5)*l.width,(.5*-A.y+.5)*l.height)}let wnt,Tnt;ir(\"CircleBucket\",Dr,{omit:[\"layers\"]});var $8t={get paint(){return Tnt=Tnt||new na({\"circle-radius\":new Mr(Te.paint_circle[\"circle-radius\"]),\"circle-color\":new Mr(Te.paint_circle[\"circle-color\"]),\"circle-blur\":new Mr(Te.paint_circle[\"circle-blur\"]),\"circle-opacity\":new Mr(Te.paint_circle[\"circle-opacity\"]),\"circle-translate\":new fr(Te.paint_circle[\"circle-translate\"]),\"circle-translate-anchor\":new fr(Te.paint_circle[\"circle-translate-anchor\"]),\"circle-pitch-scale\":new fr(Te.paint_circle[\"circle-pitch-scale\"]),\"circle-pitch-alignment\":new fr(Te.paint_circle[\"circle-pitch-alignment\"]),\"circle-stroke-width\":new Mr(Te.paint_circle[\"circle-stroke-width\"]),\"circle-stroke-color\":new Mr(Te.paint_circle[\"circle-stroke-color\"]),\"circle-stroke-opacity\":new Mr(Te.paint_circle[\"circle-stroke-opacity\"])})},get layout(){return wnt=wnt||new na({\"circle-sort-key\":new Mr(Te.layout_circle[\"circle-sort-key\"])})}};class G8t extends yl{constructor(l,u){super(l,$8t,u)}createBucket(l){return new Dr(l)}queryRadius(l){let u=l;return D2(\"circle-radius\",this,u)+D2(\"circle-stroke-width\",this,u)+hR(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:l,feature:u,featureState:m,geometry:A,transform:T,pixelsToTileUnits:M,unwrappedTileID:P,getElevation:L}){let O=dR(l,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-T.bearingInRadians,M),V=this.paint.get(\"circle-radius\").evaluate(u,m)+this.paint.get(\"circle-stroke-width\").evaluate(u,m),F=this.paint.get(\"circle-pitch-scale\"),X=this.paint.get(\"circle-pitch-alignment\"),j,nt;return X===\"map\"?(j=O,nt=V*M):(j=(function(st,pt,mt,vt){return st.map((At=>jV(At,pt,mt,vt)))})(O,T,P,L),nt=V),xnt({queryGeometry:j,size:nt,transform:T,unwrappedTileID:P,getElevation:L,pitchAlignment:X,pitchScale:F},A)}}class Snt extends Dr{}let Mnt;ir(\"HeatmapBucket\",Snt,{omit:[\"layers\"]});var W8t={get paint(){return Mnt=Mnt||new na({\"heatmap-radius\":new Mr(Te.paint_heatmap[\"heatmap-radius\"]),\"heatmap-weight\":new Mr(Te.paint_heatmap[\"heatmap-weight\"]),\"heatmap-intensity\":new fr(Te.paint_heatmap[\"heatmap-intensity\"]),\"heatmap-color\":new r0(Te.paint_heatmap[\"heatmap-color\"]),\"heatmap-opacity\":new fr(Te.paint_heatmap[\"heatmap-opacity\"])})}};function $V(d,{width:l,height:u},m,A){if(A){if(A instanceof Uint8ClampedArray)A=new Uint8Array(A.buffer);else if(A.length!==l*u*m)throw new RangeError(`mismatched image size. expected: ${A.length} but got: ${l*u*m}`)}else A=new Uint8Array(l*u*m);return d.width=l,d.height=u,d.data=A,d}function Ent(d,{width:l,height:u},m){if(l===d.width&&u===d.height)return;let A=$V({},{width:l,height:u},m);GV(d,A,{x:0,y:0},{x:0,y:0},{width:Math.min(d.width,l),height:Math.min(d.height,u)},m),d.width=l,d.height=u,d.data=A.data}function GV(d,l,u,m,A,T){if(A.width===0||A.height===0)return l;if(A.width>d.width||A.height>d.height||u.x>d.width-A.width||u.y>d.height-A.height)throw new RangeError(\"out of range source coordinates for image copy\");if(A.width>l.width||A.height>l.height||m.x>l.width-A.width||m.y>l.height-A.height)throw new RangeError(\"out of range destination coordinates for image copy\");let M=d.data,P=l.data;if(M===P)throw new Error(\"srcData equals dstData, so image is already copied\");for(let L=0;L<A.height;L++){let O=((u.y+L)*d.width+u.x)*T,V=((m.y+L)*l.width+m.x)*T;for(let F=0;F<A.width*T;F++)P[V+F]=M[O+F]}return l}class RM{constructor(l,u){$V(this,l,1,u)}resize(l){Ent(this,l,1)}clone(){return new RM({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(l,u,m,A,T){GV(l,u,m,A,T,1)}}class wc{constructor(l,u){$V(this,l,4,u)}resize(l){Ent(this,l,4)}replace(l,u){u?this.data.set(l):this.data=l instanceof Uint8ClampedArray?new Uint8Array(l.buffer):l}clone(){return new wc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(l,u,m,A,T){GV(l,u,m,A,T,4)}setPixel(l,u,m){let A=4*(l*this.width+u);this.data[A+0]=Math.round(255*m.r/m.a),this.data[A+1]=Math.round(255*m.g/m.a),this.data[A+2]=Math.round(255*m.b/m.a),this.data[A+3]=Math.round(255*m.a)}}function Pnt(d){let l=new Uint8Array(d.length);for(let u=0;u<d.length;u+=4){let m=d[u+3];l[u+0]=Math.round(d[u+0]*m/255),l[u+1]=Math.round(d[u+1]*m/255),l[u+2]=Math.round(d[u+2]*m/255),l[u+3]=m}return l}function Cnt(d){let l={},u=d.resolution||256,m=d.clips?d.clips.length:1,A=d.image||new wc({width:u,height:m});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);let T=(M,P,L)=>{l[d.evaluationKey]=L;let O=d.expression.evaluate(l);A.setPixel(M/4/u,P/4,O)};if(d.clips)for(let M=0,P=0;M<m;++M,P+=4*u)for(let L=0,O=0;L<u;L++,O+=4){let V=L/(u-1),{start:F,end:X}=d.clips[M];T(P,O,F*(1-V)+X*V)}else for(let M=0,P=0;M<u;M++,P+=4)T(0,P,M/(u-1));return A}ir(\"AlphaImage\",RM),ir(\"RGBAImage\",wc);let WV=\"big-fb\";class q8t extends yl{createBucket(l){return new Snt(l)}constructor(l,u){super(l,W8t,u),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){l===\"heatmap-color\"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Cnt({expression:this._transitionablePaint._values[\"heatmap-color\"].value.expression,evaluationKey:\"heatmapDensity\",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(WV)&&this.heatmapFbos.delete(WV)}queryRadius(l){return D2(\"heatmap-radius\",this,l)}queryIntersectsFeature({queryGeometry:l,feature:u,featureState:m,geometry:A,transform:T,pixelsToTileUnits:M,unwrappedTileID:P,getElevation:L}){return xnt({queryGeometry:l,size:this.paint.get(\"heatmap-radius\").evaluate(u,m)*M,transform:T,unwrappedTileID:P,getElevation:L},A)}hasOffscreenPass(){return this.paint.get(\"heatmap-opacity\")!==0&&!this.isHidden()}}let Int;var H8t={get paint(){return Int=Int||new na({\"hillshade-illumination-direction\":new fr(Te.paint_hillshade[\"hillshade-illumination-direction\"]),\"hillshade-illumination-altitude\":new fr(Te.paint_hillshade[\"hillshade-illumination-altitude\"]),\"hillshade-illumination-anchor\":new fr(Te.paint_hillshade[\"hillshade-illumination-anchor\"]),\"hillshade-exaggeration\":new fr(Te.paint_hillshade[\"hillshade-exaggeration\"]),\"hillshade-shadow-color\":new fr(Te.paint_hillshade[\"hillshade-shadow-color\"]),\"hillshade-highlight-color\":new fr(Te.paint_hillshade[\"hillshade-highlight-color\"]),\"hillshade-accent-color\":new fr(Te.paint_hillshade[\"hillshade-accent-color\"]),\"hillshade-method\":new fr(Te.paint_hillshade[\"hillshade-method\"]),resampling:new fr(Te.paint_hillshade.resampling)})}};class Y8t extends yl{constructor(l,u){super(l,H8t,u),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let l=this.paint.get(\"hillshade-illumination-direction\").values,u=this.paint.get(\"hillshade-illumination-altitude\").values,m=this.paint.get(\"hillshade-highlight-color\").values,A=this.paint.get(\"hillshade-shadow-color\").values,T=Math.max(l.length,u.length,m.length,A.length);l=l.concat(Array(T-l.length).fill(l.at(-1))),u=u.concat(Array(T-u.length).fill(u.at(-1))),m=m.concat(Array(T-m.length).fill(m.at(-1))),A=A.concat(Array(T-A.length).fill(A.at(-1)));let M=u.map(ba);return{directionRadians:l.map(ba),altitudeRadians:M,shadowColor:A,highlightColor:m}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}}let knt;var X8t={get paint(){return knt=knt||new na({\"color-relief-opacity\":new fr(Te[\"paint_color-relief\"][\"color-relief-opacity\"]),\"color-relief-color\":new r0(Te[\"paint_color-relief\"][\"color-relief-color\"]),resampling:new fr(Te[\"paint_color-relief\"].resampling)})}};function Rnt(d){return\"data\"in d}class qV{constructor(l,u,m,A){this.context=l,this.format=m,this.texture=l.gl.createTexture(),this._ownedHandle=this.texture,this.update(u,A)}update(l,u,m){let{width:A,height:T}=l,M=!(this.size&&this.size[0]===A&&this.size[1]===T||m),{context:P}=this,{gl:L}=P;this.useMipmap=!!(u&&u.useMipmap),L.bindTexture(L.TEXTURE_2D,this.texture),P.pixelStoreUnpackFlipY.set(!1),P.pixelStoreUnpack.set(1);let O=this.format===L.RGBA&&(!u||u.premultiply!==!1);if(M)this.size=[A,T],Rnt(l)?(P.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(l,O,A,T,L)):(P.pixelStoreUnpackPremultiplyAlpha.set(O),this._uploadDomImage(l,L));else{let{x:V,y:F}=m||{x:0,y:0};Rnt(l)?(P.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(l,O,V,F,A,T,L)):(P.pixelStoreUnpackPremultiplyAlpha.set(O),this._updateDomImage(l,V,F,L))}this.useMipmap&&this.isSizePowerOfTwo()&&L.generateMipmap(L.TEXTURE_2D),P.pixelStoreUnpackFlipY.setDefault(),P.pixelStoreUnpack.setDefault(),P.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(l,u){u.texImage2D(u.TEXTURE_2D,0,this.format,this.format,u.UNSIGNED_BYTE,l)}_uploadRawData(l,u,m,A,T){let{data:M}=l;u&&M&&(M=Pnt(M)),T.texImage2D(T.TEXTURE_2D,0,this.format,m,A,0,this.format,T.UNSIGNED_BYTE,M)}_updateDomImage(l,u,m,A){A.texSubImage2D(A.TEXTURE_2D,0,u,m,A.RGBA,A.UNSIGNED_BYTE,l)}_updateRawData(l,u,m,A,T,M,P){let{data:L}=l;u&&L&&(L=Pnt(L)),P.texSubImage2D(P.TEXTURE_2D,0,m,A,T,M,P.RGBA,P.UNSIGNED_BYTE,L)}bind(l,u,m){let{context:A}=this,{gl:T}=A;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),T.bindTexture(T.TEXTURE_2D,this.texture),m!==T.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=T.LINEAR),l!==this.filter&&(T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,l),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,m||l),this.filter=l),u!==this.wrap&&(T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,u),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,u),this.wrap=u)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:l}=this.context;l.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Dnt{constructor(l,u,m,A=1,T=1,M=1,P=0){if(this.uid=l,u.height!==u.width)throw new RangeError(\"DEM tiles must be square\");if(m&&![\"mapbox\",\"terrarium\",\"custom\"].includes(m))return void ln(`\"${m}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);this.stride=u.height;let L=this.dim=u.height-2;switch(this.data=new Uint32Array(u.data.buffer),m){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=A,this.greenFactor=T,this.blueFactor=M,this.baseShift=P;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let O=0;O<L;O++)this.data[this._idx(-1,O)]=this.data[this._idx(0,O)],this.data[this._idx(L,O)]=this.data[this._idx(L-1,O)],this.data[this._idx(O,-1)]=this.data[this._idx(O,0)],this.data[this._idx(O,L)]=this.data[this._idx(O,L-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(L,-1)]=this.data[this._idx(L-1,0)],this.data[this._idx(-1,L)]=this.data[this._idx(0,L-1)],this.data[this._idx(L,L)]=this.data[this._idx(L-1,L-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let O=0;O<L;O++)for(let V=0;V<L;V++){let F=this.get(O,V);F>this.max&&(this.max=F),F<this.min&&(this.min=F)}}get(l,u){let m=new Uint8Array(this.data.buffer),A=4*this._idx(l,u);return this.unpack(m[A],m[A+1],m[A+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(l,u){if(l<-1||l>=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${l}, y: ${u}, dim: ${this.dim}`);return(u+1)*this.stride+(l+1)}unpack(l,u,m){return l*this.redFactor+u*this.greenFactor+m*this.blueFactor-this.baseShift}pack(l){return Ont(l,this.getUnpackVector())}getPixels(){return new wc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(l,u,m){if(this.dim!==l.dim)throw new Error(\"dem dimension mismatch\");let A=u*this.dim,T=u*this.dim+this.dim,M=m*this.dim,P=m*this.dim+this.dim;switch(u){case-1:A=T-1;break;case 1:T=A+1}switch(m){case-1:M=P-1;break;case 1:P=M+1}let L=-u*this.dim,O=-m*this.dim;for(let V=M;V<P;V++)for(let F=A;F<T;F++)this.data[this._idx(F,V)]=l.data[this._idx(F+L,V+O)]}}function Ont(d,l){let u=l[0],m=l[1],A=l[2],T=l[3],M=Math.min(u,m,A),P=Math.round((d+T)/M);return{r:Math.floor(P*M/u)%256,g:Math.floor(P*M/m)%256,b:Math.floor(P*M/A)%256}}ir(\"DEMData\",Dnt);class Z8t extends yl{constructor(l,u){super(l,X8t,u)}_createColorRamp(l){let u={elevationStops:[],colorStops:[]},m=this._transitionablePaint._values[\"color-relief-color\"].value.expression;if(m instanceof Zh&&m._styleExpression.expression instanceof Li){this.colorRampExpression=m;let M=m._styleExpression.expression;u.elevationStops=M.labels,u.colorStops=[];for(let P of u.elevationStops)u.colorStops.push(M.evaluate({globals:{elevation:P}}))}if(u.elevationStops.length<1&&(u.elevationStops=[0],u.colorStops=[Mi.transparent]),u.elevationStops.length<2&&(u.elevationStops.push(u.elevationStops[0]+1),u.colorStops.push(u.colorStops[0])),u.elevationStops.length<=l)return u;let A={elevationStops:[],colorStops:[]},T=(u.elevationStops.length-1)/(l-1);for(let M=0;M<u.elevationStops.length-.5;M+=T)A.elevationStops.push(u.elevationStops[Math.round(M)]),A.colorStops.push(u.colorStops[Math.round(M)]);return ln(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${l}, provided: ${u.elevationStops.length}`),A}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[\"color-relief-color\"].value.expression}getColorRampTextures(l,u,m){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let A=this._createColorRamp(u),T=new wc({width:A.colorStops.length,height:1}),M=new wc({width:A.colorStops.length,height:1});for(let P=0;P<A.elevationStops.length;P++){let L=Ont(A.elevationStops[P],m);M.setPixel(0,P,new Mi(L.r/255,L.g/255,L.b/255,1)),T.setPixel(0,P,A.colorStops[P])}return this.colorRampTextures={elevationTexture:new qV(l,M,l.gl.RGBA),colorTexture:new qV(l,T,l.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let K8t=xo([{name:\"a_pos\",components:2,type:\"Int16\"}],4),{members:Q8t}=K8t;function fR(d,l,u){let m=u.patternDependencies,A=!1;for(let T of l){let M=T.paint.get(`${d}-pattern`);M.isConstant()||(A=!0);let P=M.constantOr(null);P&&(A=!0,m[P.to]=!0,m[P.from]=!0)}return A}function HV(d,l,u,m,A){let{zoom:T}=m,M=A.patternDependencies;for(let P of l){let L=P.paint.get(`${d}-pattern`).value;if(L.kind!==\"constant\"){let O=L.evaluate({zoom:T-1},u,{},A.availableImages),V=L.evaluate({zoom:T},u,{},A.availableImages),F=L.evaluate({zoom:T+1},u,{},A.availableImages);O=O&&O.name?O.name:O,V=V&&V.name?V.name:V,F=F&&F.name?F.name:F,M[O]=!0,M[V]=!0,M[F]=!0,u.patterns[P.id]={min:O,mid:V,max:F}}}return u}function Lnt(d,l,u,m,A){let T;if(A===(function(M,P,L,O){let V=0;for(let F=P,X=L-O;F<L;F+=O)V+=(M[X]-M[F])*(M[F+1]+M[X+1]),X=F;return V})(d,l,u,m)>0)for(let M=l;M<u;M+=m)T=znt(M/m|0,d[M],d[M+1],T);else for(let M=u-m;M>=l;M-=m)T=znt(M/m|0,d[M],d[M+1],T);return T&&O2(T,T.next)&&(BM(T),T=T.next),T}function pv(d,l){if(!d)return d;l||(l=d);let u,m=d;do if(u=!1,m.steiner||!O2(m,m.next)&&Qo(m.prev,m,m.next)!==0)m=m.next;else{if(BM(m),m=l=m.prev,m===m.next)break;u=!0}while(u||m!==l);return l}function DM(d,l,u,m,A,T,M){if(!d)return;!M&&T&&(function(L,O,V,F){let X=L;do X.z===0&&(X.z=YV(X.x,X.y,O,V,F)),X.prevZ=X.prev,X.nextZ=X.next,X=X.next;while(X!==L);X.prevZ.nextZ=null,X.prevZ=null,(function(j){let nt,st=1;do{let pt,mt=j;j=null;let vt=null;for(nt=0;mt;){nt++;let At=mt,wt=0;for(let Bt=0;Bt<st&&(wt++,At=At.nextZ,At);Bt++);let St=st;for(;wt>0||St>0&&At;)wt!==0&&(St===0||!At||mt.z<=At.z)?(pt=mt,mt=mt.nextZ,wt--):(pt=At,At=At.nextZ,St--),vt?vt.nextZ=pt:j=pt,pt.prevZ=vt,vt=pt;mt=At}vt.nextZ=null,st*=2}while(nt>1)})(X)})(d,m,A,T);let P=d;for(;d.prev!==d.next;){let L=d.prev,O=d.next;if(T?tkt(d,m,A,T):J8t(d))l.push(L.i,d.i,O.i),BM(d),d=O.next,P=O.next;else if((d=O)===P){M?M===1?DM(d=ekt(pv(d),l),l,u,m,A,T,2):M===2&&rkt(d,l,u,m,A,T):DM(pv(d),l,u,m,A,T,1);break}}}function J8t(d){let l=d.prev,u=d,m=d.next;if(Qo(l,u,m)>=0)return!1;let A=l.x,T=u.x,M=m.x,P=l.y,L=u.y,O=m.y,V=Math.min(A,T,M),F=Math.min(P,L,O),X=Math.max(A,T,M),j=Math.max(P,L,O),nt=m.next;for(;nt!==l;){if(nt.x>=V&&nt.x<=X&&nt.y>=F&&nt.y<=j&&OM(A,P,T,L,M,O,nt.x,nt.y)&&Qo(nt.prev,nt,nt.next)>=0)return!1;nt=nt.next}return!0}function tkt(d,l,u,m){let A=d.prev,T=d,M=d.next;if(Qo(A,T,M)>=0)return!1;let P=A.x,L=T.x,O=M.x,V=A.y,F=T.y,X=M.y,j=Math.min(P,L,O),nt=Math.min(V,F,X),st=Math.max(P,L,O),pt=Math.max(V,F,X),mt=YV(j,nt,l,u,m),vt=YV(st,pt,l,u,m),At=d.prevZ,wt=d.nextZ;for(;At&&At.z>=mt&&wt&&wt.z<=vt;){if(At.x>=j&&At.x<=st&&At.y>=nt&&At.y<=pt&&At!==A&&At!==M&&OM(P,V,L,F,O,X,At.x,At.y)&&Qo(At.prev,At,At.next)>=0||(At=At.prevZ,wt.x>=j&&wt.x<=st&&wt.y>=nt&&wt.y<=pt&&wt!==A&&wt!==M&&OM(P,V,L,F,O,X,wt.x,wt.y)&&Qo(wt.prev,wt,wt.next)>=0))return!1;wt=wt.nextZ}for(;At&&At.z>=mt;){if(At.x>=j&&At.x<=st&&At.y>=nt&&At.y<=pt&&At!==A&&At!==M&&OM(P,V,L,F,O,X,At.x,At.y)&&Qo(At.prev,At,At.next)>=0)return!1;At=At.prevZ}for(;wt&&wt.z<=vt;){if(wt.x>=j&&wt.x<=st&&wt.y>=nt&&wt.y<=pt&&wt!==A&&wt!==M&&OM(P,V,L,F,O,X,wt.x,wt.y)&&Qo(wt.prev,wt,wt.next)>=0)return!1;wt=wt.nextZ}return!0}function ekt(d,l){let u=d;do{let m=u.prev,A=u.next.next;!O2(m,A)&&Fnt(m,u,u.next,A)&&LM(m,A)&&LM(A,m)&&(l.push(m.i,u.i,A.i),BM(u),BM(u.next),u=d=A),u=u.next}while(u!==d);return pv(u)}function rkt(d,l,u,m,A,T){let M=d;do{let P=M.next.next;for(;P!==M.prev;){if(M.i!==P.i&&akt(M,P)){let L=Nnt(M,P);return M=pv(M,M.next),L=pv(L,L.next),DM(M,l,u,m,A,T,0),void DM(L,l,u,m,A,T,0)}P=P.next}M=M.next}while(M!==d)}function ikt(d,l){let u=d.x-l.x;return u===0&&(u=d.y-l.y,u===0)&&(u=(d.next.y-d.y)/(d.next.x-d.x)-(l.next.y-l.y)/(l.next.x-l.x)),u}function nkt(d,l){let u=(function(A,T){let M=T,P=A.x,L=A.y,O,V=-1/0;if(O2(A,M))return M;do{if(O2(A,M.next))return M.next;if(L<=M.y&&L>=M.next.y&&M.next.y!==M.y){let st=M.x+(L-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(st<=P&&st>V&&(V=st,O=M.x<M.next.x?M:M.next,st===P))return O}M=M.next}while(M!==T);if(!O)return null;let F=O,X=O.x,j=O.y,nt=1/0;M=O;do{if(P>=M.x&&M.x>=X&&P!==M.x&&Bnt(L<j?P:V,L,X,j,L<j?V:P,L,M.x,M.y)){let st=Math.abs(L-M.y)/(P-M.x);LM(M,A)&&(st<nt||st===nt&&(M.x>O.x||M.x===O.x&&okt(O,M)))&&(O=M,nt=st)}M=M.next}while(M!==F);return O})(d,l);if(!u)return l;let m=Nnt(u,d);return pv(m,m.next),pv(u,u.next)}function okt(d,l){return Qo(d.prev,d,l.prev)<0&&Qo(l.next,d,d.next)<0}function YV(d,l,u,m,A){return(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d=(d-u)*A|0)|d<<8))|d<<4))|d<<2))|d<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-m)*A|0)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function skt(d){let l=d,u=d;do(l.x<u.x||l.x===u.x&&l.y<u.y)&&(u=l),l=l.next;while(l!==d);return u}function Bnt(d,l,u,m,A,T,M,P){return(A-M)*(l-P)>=(d-M)*(T-P)&&(d-M)*(m-P)>=(u-M)*(l-P)&&(u-M)*(T-P)>=(A-M)*(m-P)}function OM(d,l,u,m,A,T,M,P){return!(d===M&&l===P)&&Bnt(d,l,u,m,A,T,M,P)}function akt(d,l){return d.next.i!==l.i&&d.prev.i!==l.i&&!(function(u,m){let A=u;do{if(A.i!==u.i&&A.next.i!==u.i&&A.i!==m.i&&A.next.i!==m.i&&Fnt(A,A.next,u,m))return!0;A=A.next}while(A!==u);return!1})(d,l)&&(LM(d,l)&&LM(l,d)&&(function(u,m){let A=u,T=!1,M=(u.x+m.x)/2,P=(u.y+m.y)/2;do A.y>P!=A.next.y>P&&A.next.y!==A.y&&M<(A.next.x-A.x)*(P-A.y)/(A.next.y-A.y)+A.x&&(T=!T),A=A.next;while(A!==u);return T})(d,l)&&(Qo(d.prev,d,l.prev)||Qo(d,l.prev,l))||O2(d,l)&&Qo(d.prev,d,d.next)>0&&Qo(l.prev,l,l.next)>0)}function Qo(d,l,u){return(l.y-d.y)*(u.x-l.x)-(l.x-d.x)*(u.y-l.y)}function O2(d,l){return d.x===l.x&&d.y===l.y}function Fnt(d,l,u,m){let A=mR(Qo(d,l,u)),T=mR(Qo(d,l,m)),M=mR(Qo(u,m,d)),P=mR(Qo(u,m,l));return A!==T&&M!==P||!(A!==0||!pR(d,u,l))||!(T!==0||!pR(d,m,l))||!(M!==0||!pR(u,d,m))||!(P!==0||!pR(u,l,m))}function pR(d,l,u){return l.x<=Math.max(d.x,u.x)&&l.x>=Math.min(d.x,u.x)&&l.y<=Math.max(d.y,u.y)&&l.y>=Math.min(d.y,u.y)}function mR(d){return d>0?1:d<0?-1:0}function LM(d,l){return Qo(d.prev,d,d.next)<0?Qo(d,l,d.next)>=0&&Qo(d,d.prev,l)>=0:Qo(d,l,d.prev)<0||Qo(d,d.next,l)<0}function Nnt(d,l){let u=XV(d.i,d.x,d.y),m=XV(l.i,l.x,l.y),A=d.next,T=l.prev;return d.next=l,l.prev=d,u.next=A,A.prev=u,m.next=u,u.prev=m,T.next=m,m.prev=T,m}function znt(d,l,u,m){let A=XV(d,l,u);return m?(A.next=m.next,A.prev=m,m.next.prev=A,m.next=A):(A.prev=A,A.next=A),A}function BM(d){d.next.prev=d.prev,d.prev.next=d.next,d.prevZ&&(d.prevZ.nextZ=d.nextZ),d.nextZ&&(d.nextZ.prevZ=d.prevZ)}function XV(d,l,u){return{i:d,x:l,y:u,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class L2{constructor(l,u){if(u>l)throw new Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=l,this._minGranularity=u}getGranularityForZoomLevel(l){return Math.max(Math.floor(this._baseZoomGranularity/(1<<l)),this._minGranularity,1)}}class gR{constructor(l){this.fill=l.fill,this.line=l.line,this.tile=l.tile,this.stencil=l.stencil,this.circle=l.circle}}gR.noSubdivision=new gR({fill:new L2(0,0),line:new L2(0,0),tile:new L2(0,0),stencil:new L2(0,0),circle:1}),ir(\"SubdivisionGranularityExpression\",L2),ir(\"SubdivisionGranularitySetting\",gR);let B2=-32768,FM=32767;class lkt{constructor(l,u){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=l,this._granularityCellSize=Pe/l,this._canonical=u}_getKey(l,u){return(l+=32768)<<16|u+32768}_vertexToIndex(l,u){if(l<-32768||u<-32768||l>32767||u>32767)throw new Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let m=0|Math.round(l),A=0|Math.round(u),T=this._getKey(m,A);if(this._vertexDictionary.has(T))return this._vertexDictionary.get(T);let M=this._vertexBuffer.length/2;return this._vertexDictionary.set(T,M),this._vertexBuffer.push(m,A),M}_subdivideTrianglesScanline(l){if(this._granularity<2)return(function(A,T){let M=[];for(let P=0;P<T.length;P+=3){let L=T[P],O=T[P+1],V=T[P+2],F=A[2*L],X=A[2*L+1];(A[2*O]-F)*(A[2*V+1]-X)-(A[2*O+1]-X)*(A[2*V]-F)>0?(M.push(L),M.push(V),M.push(O)):(M.push(L),M.push(O),M.push(V))}return M})(this._vertexBuffer,l);let u=[],m=l.length;for(let A=0;A<m;A+=3){let T=[l[A+0],l[A+1],l[A+2]],M=[this._vertexBuffer[2*l[A+0]+0],this._vertexBuffer[2*l[A+0]+1],this._vertexBuffer[2*l[A+1]+0],this._vertexBuffer[2*l[A+1]+1],this._vertexBuffer[2*l[A+2]+0],this._vertexBuffer[2*l[A+2]+1]],P=1/0,L=1/0,O=-1/0,V=-1/0;for(let st=0;st<3;st++){let pt=M[2*st],mt=M[2*st+1];P=Math.min(P,pt),O=Math.max(O,pt),L=Math.min(L,mt),V=Math.max(V,mt)}if(P===O||L===V)continue;let F=Math.floor(P/this._granularityCellSize),X=Math.ceil(O/this._granularityCellSize),j=Math.floor(L/this._granularityCellSize),nt=Math.ceil(V/this._granularityCellSize);if(F!==X||j!==nt)for(let st=j;st<nt;st++){let pt=this._scanlineGenerateVertexRingForCellRow(st,M,T);ckt(this._vertexBuffer,pt,u)}else u.push(...T)}return u}_scanlineGenerateVertexRingForCellRow(l,u,m){let A=l*this._granularityCellSize,T=A+this._granularityCellSize,M=[];for(let P=0;P<3;P++){let L=u[2*P],O=u[2*P+1],V=u[2*(P+1)%6],F=u[(2*(P+1)+1)%6],X=u[2*(P+2)%6],j=u[(2*(P+2)+1)%6],nt=V-L,st=F-O,pt=nt===0,mt=st===0,vt=(A-O)/st,At=(T-O)/st,wt=Math.min(vt,At),St=Math.max(vt,At);if(!mt&&(wt>=1||St<=0)||mt&&(O<A||O>T)){F>=A&&F<=T&&M.push(m[(P+1)%3]);continue}!mt&&wt>0&&M.push(this._vertexToIndex(L+nt*wt,O+st*wt));let Bt=L+nt*Math.max(wt,0),qt=L+nt*Math.min(St,1);pt||this._generateIntraEdgeVertices(M,L,O,V,F,Bt,qt),!mt&&St<1&&M.push(this._vertexToIndex(L+nt*St,O+st*St)),(mt||F>=A&&F<=T)&&M.push(m[(P+1)%3]),!mt&&(F<=A||F>=T)&&this._generateInterEdgeVertices(M,L,O,V,F,X,j,qt,A,T)}return M}_generateIntraEdgeVertices(l,u,m,A,T,M,P){let L=A-u,O=T-m,V=O===0,F=V?Math.min(u,A):Math.min(M,P),X=V?Math.max(u,A):Math.max(M,P),j=Math.floor(F/this._granularityCellSize)+1,nt=Math.ceil(X/this._granularityCellSize)-1;if(V?u<A:M<P)for(let st=j;st<=nt;st++){let pt=st*this._granularityCellSize;l.push(this._vertexToIndex(pt,m+O*(pt-u)/L))}else for(let st=nt;st>=j;st--){let pt=st*this._granularityCellSize;l.push(this._vertexToIndex(pt,m+O*(pt-u)/L))}}_generateInterEdgeVertices(l,u,m,A,T,M,P,L,O,V){let F=T-m,X=M-A,j=P-T,nt=(O-T)/j,st=(V-T)/j,pt=Math.min(nt,st),mt=Math.max(nt,st),vt=A+X*pt,At=Math.floor(Math.min(vt,L)/this._granularityCellSize)+1,wt=Math.ceil(Math.max(vt,L)/this._granularityCellSize)-1,St=L<vt,Bt=j===0;if(Bt&&(P===O||P===V))return;if(Bt||pt>=1||mt<=0){let te=m-P,he=M+(u-M)*Math.min((O-P)/te,(V-P)/te);At=Math.floor(Math.min(he,L)/this._granularityCellSize)+1,wt=Math.ceil(Math.max(he,L)/this._granularityCellSize)-1,St=L<he}let qt=F>0?V:O;if(St)for(let te=At;te<=wt;te++)l.push(this._vertexToIndex(te*this._granularityCellSize,qt));else for(let te=wt;te>=At;te--)l.push(this._vertexToIndex(te*this._granularityCellSize,qt))}_generateOutline(l){let u=[];for(let m of l){let A=mv(m,this._granularity,!0),T=this._pointArrayToIndices(A),M=[];for(let P=1;P<T.length;P++)M.push(T[P-1]),M.push(T[P]);u.push(M)}return u}_handlePoles(l){let u=!1,m=!1;this._canonical&&(this._canonical.y===0&&(u=!0),this._canonical.y===(1<<this._canonical.z)-1&&(m=!0)),(u||m)&&this._fillPoles(l,u,m)}_ensureNoPoleVertices(){let l=this._vertexBuffer;for(let u=0;u<l.length;u+=2){let m=l[u+1];m===B2&&(l[u+1]=-32767),m===FM&&(l[u+1]=32766)}}_generatePoleQuad(l,u,m,A,T,M){A>T!=(M===B2)?(l.push(u),l.push(m),l.push(this._vertexToIndex(A,M)),l.push(m),l.push(this._vertexToIndex(T,M)),l.push(this._vertexToIndex(A,M))):(l.push(m),l.push(u),l.push(this._vertexToIndex(A,M)),l.push(this._vertexToIndex(T,M)),l.push(m),l.push(this._vertexToIndex(A,M)))}_fillPoles(l,u,m){let A=this._vertexBuffer,T=Pe,M=l.length;for(let P=2;P<M;P+=3){let L=l[P-2],O=l[P-1],V=l[P],F=A[2*L],X=A[2*L+1],j=A[2*O],nt=A[2*O+1],st=A[2*V],pt=A[2*V+1];u&&(X===0&&nt===0&&this._generatePoleQuad(l,L,O,F,j,B2),nt===0&&pt===0&&this._generatePoleQuad(l,O,V,j,st,B2),pt===0&&X===0&&this._generatePoleQuad(l,V,L,st,F,B2)),m&&(X===T&&nt===T&&this._generatePoleQuad(l,L,O,F,j,FM),nt===T&&pt===T&&this._generatePoleQuad(l,O,V,j,st,FM),pt===T&&X===T&&this._generatePoleQuad(l,V,L,st,F,FM))}}_initializeVertices(l){for(let u=0;u<l.length;u+=2)this._vertexToIndex(l[u],l[u+1])}subdividePolygonInternal(l,u){if(this._used)throw new Error(\"Subdivision: multiple use not allowed.\");this._used=!0;let{flattened:m,holeIndices:A}=(function(P){let L=[],O=[];for(let V of P)if(V.length!==0){V!==P[0]&&L.push(O.length/2);for(let F=0;F<V.length;F++)O.push(V[F].x),O.push(V[F].y)}return{flattened:O,holeIndices:L}})(l),T;this._initializeVertices(m);try{let P=(function(O,V,F=2){let X=V&&V.length,j=X?V[0]*F:O.length,nt=Lnt(O,0,j,F,!0),st=[];if(!nt||nt.next===nt.prev)return st;let pt,mt,vt;if(X&&(nt=(function(At,wt,St,Bt){let qt=[];for(let te=0,he=wt.length;te<he;te++){let fe=Lnt(At,wt[te]*Bt,te<he-1?wt[te+1]*Bt:At.length,Bt,!1);fe===fe.next&&(fe.steiner=!0),qt.push(skt(fe))}qt.sort(ikt);for(let te=0;te<qt.length;te++)St=nkt(qt[te],St);return St})(O,V,nt,F)),O.length>80*F){pt=O[0],mt=O[1];let At=pt,wt=mt;for(let St=F;St<j;St+=F){let Bt=O[St],qt=O[St+1];Bt<pt&&(pt=Bt),qt<mt&&(mt=qt),Bt>At&&(At=Bt),qt>wt&&(wt=qt)}vt=Math.max(At-pt,wt-mt),vt=vt!==0?32767/vt:0}return DM(nt,st,F,pt,mt,vt,0),st})(m,A),L=this._convertIndices(m,P);T=this._subdivideTrianglesScanline(L)}catch(P){console.error(P)}let M=[];return u&&(M=this._generateOutline(l)),this._ensureNoPoleVertices(),this._handlePoles(T),{verticesFlattened:this._vertexBuffer,indicesTriangles:T,indicesLineList:M}}_convertIndices(l,u){let m=[];for(let A=0;A<u.length;A++)m.push(this._vertexToIndex(l[2*u[A]],l[2*u[A]+1]));return m}_pointArrayToIndices(l){let u=[];for(let m=0;m<l.length;m++){let A=l[m];u.push(this._vertexToIndex(A.x,A.y))}return u}}function Unt(d,l,u,m=!0){return new lkt(u,l).subdividePolygonInternal(d,m)}function mv(d,l,u=!1){if(!d||d.length<1)return[];if(d.length<2)return[];let m=d[0],A=d[d.length-1],T=u&&(m.x!==A.x||m.y!==A.y);if(l<2)return T?[...d,d[0]]:[...d];let M=Math.floor(Pe/l),P=[];P.push(new s(d[0].x,d[0].y));let L=d.length,O=T?L:L-1;for(let V=0;V<O;V++){let F=d[V],X=V<L-1?d[V+1]:d[0],j=F.x,nt=F.y,st=X.x,pt=X.y,mt=j!==st,vt=nt!==pt;if(!mt&&!vt)continue;let At=st-j,wt=pt-nt,St=Math.abs(At),Bt=Math.abs(wt),qt=j,te=nt;for(;;){let fe=At>0?(Math.floor(qt/M)+1)*M:(Math.ceil(qt/M)-1)*M,Se=wt>0?(Math.floor(te/M)+1)*M:(Math.ceil(te/M)-1)*M,ve=Math.abs(qt-fe),be=Math.abs(te-Se),Ae=Math.abs(qt-st),Ze=Math.abs(te-pt),nr=mt?ve/St:Number.POSITIVE_INFINITY,er=vt?be/Bt:Number.POSITIVE_INFINITY;if((Ae<=ve||!mt)&&(Ze<=be||!vt))break;if(nr<er&&mt||!vt){qt=fe,te+=wt*nr;let Xe=new s(qt,Math.round(te));P[P.length-1].x===Xe.x&&P[P.length-1].y===Xe.y||P.push(Xe)}else{qt+=At*er,te=Se;let Xe=new s(Math.round(qt),te);P[P.length-1].x===Xe.x&&P[P.length-1].y===Xe.y||P.push(Xe)}}let he=new s(st,pt);P[P.length-1].x===he.x&&P[P.length-1].y===he.y||P.push(he)}return P}function ckt(d,l,u){if(l.length===0)throw new Error(\"Subdivision vertex ring is empty.\");let m=0,A=d[2*l[0]];for(let L=1;L<l.length;L++){let O=d[2*l[L]];O<A&&(A=O,m=L)}let T=l.length,M=m,P=(M+1)%T;for(;;){let L=M-1>=0?M-1:T-1,O=(P+1)%T,V=d[2*l[L]],F=d[2*l[O]],X=d[2*l[M]],j=d[2*l[M]+1],nt=d[2*l[P]+1],st=!1;if(V<F)st=!0;else if(V>F)st=!1;else{let pt=nt-j,mt=-(d[2*l[P]]-X),vt=j<nt?1:-1;((V-X)*pt+(d[2*l[L]+1]-j)*mt)*vt>((F-X)*pt+(d[2*l[O]+1]-j)*mt)*vt&&(st=!0)}if(st){let pt=l[L],mt=l[M],vt=l[P];pt!==mt&&pt!==vt&&mt!==vt&&u.push(vt,mt,pt),M--,M<0&&(M=T-1)}else{let pt=l[O],mt=l[M],vt=l[P];pt!==mt&&pt!==vt&&mt!==vt&&u.push(vt,mt,pt),P++,P>=T&&(P=0)}if(L===O)break}}function Vnt(d,l,u,m,A,T,M,P,L){let O=A.length/2,V=M&&P&&L;if(O<ur.MAX_VERTEX_ARRAY_LENGTH){let F=l.prepareSegment(O,u,m),X=F.vertexLength;for(let st=0;st<T.length;st+=3)m.emplaceBack(X+T[st],X+T[st+1],X+T[st+2]);let j,nt;F.vertexLength+=O,F.primitiveLength+=T.length/3,V&&(nt=M.prepareSegment(O,u,P),j=nt.vertexLength,nt.vertexLength+=O);for(let st=0;st<A.length;st+=2)d(A[st],A[st+1]);if(V)for(let st=0;st<L.length;st++){let pt=L[st];for(let mt=1;mt<pt.length;mt+=2)P.emplaceBack(j+pt[mt-1],j+pt[mt]);nt.primitiveLength+=pt.length/2}}else(function(F,X,j,nt,st,pt){let mt=[];for(let Bt=0;Bt<nt.length/2;Bt++)mt.push(-1);let vt={count:0},At=0,wt=F.getOrCreateLatestSegment(X,j),St=wt.vertexLength;for(let Bt=2;Bt<st.length;Bt+=3){let qt=st[Bt-2],te=st[Bt-1],he=st[Bt],fe=mt[qt]<At,Se=mt[te]<At,ve=mt[he]<At;wt.vertexLength+((fe?1:0)+(Se?1:0)+(ve?1:0))>ur.MAX_VERTEX_ARRAY_LENGTH&&(wt=F.createNewSegment(X,j),At=vt.count,fe=!0,Se=!0,ve=!0,St=0);let be=NM(mt,nt,pt,vt,qt,fe,wt),Ae=NM(mt,nt,pt,vt,te,Se,wt),Ze=NM(mt,nt,pt,vt,he,ve,wt);j.emplaceBack(St+be-At,St+Ae-At,St+Ze-At),wt.primitiveLength++}})(l,u,m,A,T,d),V&&(function(F,X,j,nt,st,pt){let mt=[];for(let Bt=0;Bt<nt.length/2;Bt++)mt.push(-1);let vt={count:0},At=0,wt=F.getOrCreateLatestSegment(X,j),St=wt.vertexLength;for(let Bt=0;Bt<st.length;Bt++){let qt=st[Bt];for(let te=1;te<st[Bt].length;te+=2){let he=qt[te-1],fe=qt[te],Se=mt[he]<At,ve=mt[fe]<At;wt.vertexLength+((Se?1:0)+(ve?1:0))>ur.MAX_VERTEX_ARRAY_LENGTH&&(wt=F.createNewSegment(X,j),At=vt.count,Se=!0,ve=!0,St=0);let be=NM(mt,nt,pt,vt,he,Se,wt),Ae=NM(mt,nt,pt,vt,fe,ve,wt);j.emplaceBack(St+be-At,St+Ae-At),wt.primitiveLength++}}})(M,u,P,A,L,d),l.forceNewSegmentOnNextPrepare(),M?.forceNewSegmentOnNextPrepare()}function NM(d,l,u,m,A,T,M){if(T){let P=m.count;return u(l[2*A],l[2*A+1]),d[A]=m.count,m.count++,M.vertexLength++,P}return d[A]}class ZV{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=l.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Ut,this.indexArray=new Le,this.indexArray2=new $e,this.programConfigurations=new se(l.layers,l.zoom),this.segments=new ur,this.segments2=new ur,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(l,u,m){this.hasDependencies=fR(\"fill\",this.layers,u);let A=this.layers[0].layout.get(\"fill-sort-key\"),T=!A.isConstant(),M=[];for(let{feature:P,id:L,index:O,sourceLayerIndex:V}of l){let F=this.layers[0]._featureFilter.needGeometry,X=Or(P,F);if(!this.layers[0]._featureFilter.filter(new hn(this.zoom),X,m))continue;let j=T?A.evaluate(X,{},m,u.availableImages):void 0,nt={id:L,properties:P.properties,type:P.type,sourceLayerIndex:V,index:O,geometry:F?X.geometry:cr(P),patterns:{},sortKey:j};M.push(nt)}T&&M.sort(((P,L)=>P.sortKey-L.sortKey));for(let P of M){let{geometry:L,index:O,sourceLayerIndex:V}=P;if(this.hasDependencies){let F=HV(\"fill\",this.layers,P,{zoom:this.zoom},u);this.patternFeatures.push(F)}else this.addFeature(P,L,O,m,{},u.subdivisionGranularity);u.featureIndex.insert(l[O].feature,L,O,V,this.index)}}update(l,u,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,u,this.stateDependentLayers,{imagePositions:m})}addFeatures(l,u,m){for(let A of this.patternFeatures)this.addFeature(A,A.geometry,A.index,u,m,l.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Q8t),this.indexBuffer=l.createIndexBuffer(this.indexArray),this.indexBuffer2=l.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(l),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(l,u,m,A,T,M){for(let P of Tt(u,500)){let L=Unt(P,A,M.fill.getGranularityForZoomLevel(A.z)),O=this.layoutVertexArray;Vnt(((V,F)=>{O.emplaceBack(V,F)}),this.segments,this.layoutVertexArray,this.indexArray,L.verticesFlattened,L.indicesTriangles,this.segments2,this.indexArray2,L.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,m,{imagePositions:T,canonical:A})}}let jnt,$nt;ir(\"FillBucket\",ZV,{omit:[\"layers\",\"patternFeatures\"]});var ukt={get paint(){return $nt=$nt||new na({\"fill-antialias\":new fr(Te.paint_fill[\"fill-antialias\"]),\"fill-opacity\":new Mr(Te.paint_fill[\"fill-opacity\"]),\"fill-color\":new Mr(Te.paint_fill[\"fill-color\"]),\"fill-outline-color\":new Mr(Te.paint_fill[\"fill-outline-color\"]),\"fill-translate\":new fr(Te.paint_fill[\"fill-translate\"]),\"fill-translate-anchor\":new fr(Te.paint_fill[\"fill-translate-anchor\"]),\"fill-pattern\":new Xm(Te.paint_fill[\"fill-pattern\"])})},get layout(){return jnt=jnt||new na({\"fill-sort-key\":new Mr(Te.layout_fill[\"fill-sort-key\"])})}};class hkt extends yl{constructor(l,u){super(l,ukt,u)}recalculate(l,u){super.recalculate(l,u);let m=this.paint._values[\"fill-outline-color\"];m.value.kind===\"constant\"&&m.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(l){return new ZV(l)}queryRadius(){return hR(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:l,geometry:u,transform:m,pixelsToTileUnits:A}){return Ai(dR(l,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-m.bearingInRadians,A),u)}isTileClipped(){return!0}}let dkt=xo([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),fkt=xo([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),{members:pkt}=dkt;class zM{constructor(l,u,m,A,T){this.properties={},this.extent=m,this.type=0,this.id=void 0,this._pbf=l,this._geometry=-1,this._keys=A,this._values=T,l.readFields(mkt,this,u)}loadGeometry(){let l=this._pbf;l.pos=this._geometry;let u=l.readVarint()+l.pos,m=[],A,T=1,M=0,P=0,L=0;for(;l.pos<u;){if(M<=0){let O=l.readVarint();T=7&O,M=O>>3}if(M--,T===1||T===2)P+=l.readSVarint(),L+=l.readSVarint(),T===1&&(A&&m.push(A),A=[]),A&&A.push(new s(P,L));else{if(T!==7)throw new Error(`unknown command ${T}`);A&&A.push(A[0].clone())}}return A&&m.push(A),m}bbox(){let l=this._pbf;l.pos=this._geometry;let u=l.readVarint()+l.pos,m=1,A=0,T=0,M=0,P=1/0,L=-1/0,O=1/0,V=-1/0;for(;l.pos<u;){if(A<=0){let F=l.readVarint();m=7&F,A=F>>3}if(A--,m===1||m===2)T+=l.readSVarint(),M+=l.readSVarint(),T<P&&(P=T),T>L&&(L=T),M<O&&(O=M),M>V&&(V=M);else if(m!==7)throw new Error(`unknown command ${m}`)}return[P,O,L,V]}toGeoJSON(l,u,m){let A=this.extent*Math.pow(2,m),T=this.extent*l,M=this.extent*u,P=this.loadGeometry();function L(X){return[360*(X.x+T)/A-180,360/Math.PI*Math.atan(Math.exp((1-2*(X.y+M)/A)*Math.PI))-90]}function O(X){return X.map(L)}let V;if(this.type===1){let X=[];for(let nt of P)X.push(nt[0]);let j=O(X);V=X.length===1?{type:\"Point\",coordinates:j[0]}:{type:\"MultiPoint\",coordinates:j}}else if(this.type===2){let X=P.map(O);V=X.length===1?{type:\"LineString\",coordinates:X[0]}:{type:\"MultiLineString\",coordinates:X}}else{if(this.type!==3)throw new Error(\"unknown feature type\");{let X=Gnt(P),j=[];for(let nt of X)j.push(nt.map(O));V=j.length===1?{type:\"Polygon\",coordinates:j[0]}:{type:\"MultiPolygon\",coordinates:j}}}let F={type:\"Feature\",geometry:V,properties:this.properties};return this.id!=null&&(F.id=this.id),F}}function mkt(d,l,u){d===1?l.id=u.readVarint():d===2?(function(m,A){let T=m.readVarint()+m.pos;for(;m.pos<T;){let M=A._keys[m.readVarint()],P=A._values[m.readVarint()];A.properties[M]=P}})(u,l):d===3?l.type=u.readVarint():d===4&&(l._geometry=u.pos)}function Gnt(d){let l=d.length;if(l<=1)return[d];let u=[],m,A;for(let T=0;T<l;T++){let M=gkt(d[T]);M!==0&&(A===void 0&&(A=M<0),A===M<0?(m&&u.push(m),m=[d[T]]):m&&m.push(d[T]))}return m&&u.push(m),u}function gkt(d){let l=0;for(let u,m,A=0,T=d.length,M=T-1;A<T;M=A++)u=d[A],m=d[M],l+=(m.x-u.x)*(u.y+m.y);return l}zM.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];class Akt{constructor(l,u){this.version=1,this.name=\"\",this.extent=4096,this.length=0,this._pbf=l,this._keys=[],this._values=[],this._features=[],l.readFields(ykt,this,u),this.length=this._features.length}feature(l){if(l<0||l>=this._features.length)throw new Error(\"feature index out of bounds\");this._pbf.pos=this._features[l];let u=this._pbf.readVarint()+this._pbf.pos;return new zM(this._pbf,u,this.extent,this._keys,this._values)}}function ykt(d,l,u){d===15?l.version=u.readVarint():d===1?l.name=u.readString():d===5?l.extent=u.readVarint():d===2?l._features.push(u.pos):d===3?l._keys.push(u.readString()):d===4&&l._values.push((function(m){let A=null,T=m.readVarint()+m.pos;for(;m.pos<T;){let M=m.readVarint()>>3;A=M===1?m.readString():M===2?m.readFloat():M===3?m.readDouble():M===4?m.readVarint64():M===5?m.readVarint():M===6?m.readSVarint():M===7?m.readBoolean():null}if(A==null)throw new Error(\"unknown feature value\");return A})(u))}class Wnt{constructor(l,u){this.layers=l.readFields(_kt,{},u)}}function _kt(d,l,u){if(d===3){let m=new Akt(u,u.readVarint()+u.pos);m.length&&(l[m.name]=m)}}let KV=Math.pow(2,13);function UM(d,l,u,m,A,T,M,P){d.emplaceBack(l,u,2*Math.floor(m*KV)+M,A*KV*2,T*KV*2,Math.round(P))}class QV{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=l.index,this.hasDependencies=!1,this.layoutVertexArray=new Gt,this.centroidVertexArray=new Ct,this.indexArray=new Le,this.programConfigurations=new se(l.layers,l.zoom),this.segments=new ur,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(l,u,m){this.features=[],this.hasDependencies=fR(\"fill-extrusion\",this.layers,u);for(let{feature:A,id:T,index:M,sourceLayerIndex:P}of l){let L=this.layers[0]._featureFilter.needGeometry,O=Or(A,L);if(!this.layers[0]._featureFilter.filter(new hn(this.zoom),O,m))continue;let V={id:T,sourceLayerIndex:P,index:M,geometry:L?O.geometry:cr(A),properties:A.properties,type:A.type,patterns:{}};this.hasDependencies?this.features.push(HV(\"fill-extrusion\",this.layers,V,{zoom:this.zoom},u)):this.addFeature(V,V.geometry,M,m,{},u.subdivisionGranularity),u.featureIndex.insert(A,V.geometry,M,P,this.index,!0)}}addFeatures(l,u,m){for(let A of this.features){let{geometry:T}=A;this.addFeature(A,T,A.index,u,m,l.subdivisionGranularity)}}update(l,u,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,u,this.stateDependentLayers,{imagePositions:m})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,pkt),this.centroidVertexBuffer=l.createVertexBuffer(this.centroidVertexArray,fkt.members,!0),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(l,u,m,A,T,M){for(let P of Tt(u,500)){let L={x:0,y:0,sampleCount:0},O=this.layoutVertexArray.length;this.processPolygon(L,A,l,P,M);let V=this.layoutVertexArray.length-O,F=Math.floor(L.x/L.sampleCount),X=Math.floor(L.y/L.sampleCount);for(let j=0;j<V;j++)this.centroidVertexArray.emplaceBack(F,X)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,m,{imagePositions:T,canonical:A})}processPolygon(l,u,m,A,T){if(A.length<1||qnt(A[0]))return;for(let F of A)F.length!==0&&vkt(l,F);let M={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},P=T.fill.getGranularityForZoomLevel(u.z),L=zM.types[m.type]===\"Polygon\";for(let F of A){if(F.length===0||qnt(F))continue;let X=mv(F,P,L);this._generateSideFaces(X,M)}if(!L)return;let O=Unt(A,u,P,!1),V=this.layoutVertexArray;Vnt(((F,X)=>{UM(V,F,X,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,O.verticesFlattened,O.indicesTriangles)}_generateSideFaces(l,u){let m=0;for(let A=1;A<l.length;A++){let T=l[A],M=l[A-1];if(bkt(T,M))continue;u.segment.vertexLength+4>ur.MAX_VERTEX_ARRAY_LENGTH&&(u.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let P=T.sub(M)._perp()._unit(),L=M.dist(T);m+L>32768&&(m=0),UM(this.layoutVertexArray,T.x,T.y,P.x,P.y,0,0,m),UM(this.layoutVertexArray,T.x,T.y,P.x,P.y,0,1,m),m+=L,UM(this.layoutVertexArray,M.x,M.y,P.x,P.y,0,0,m),UM(this.layoutVertexArray,M.x,M.y,P.x,P.y,0,1,m);let O=u.segment.vertexLength;this.indexArray.emplaceBack(O,O+2,O+1),this.indexArray.emplaceBack(O+1,O+2,O+3),u.segment.vertexLength+=4,u.segment.primitiveLength+=2}}}function vkt(d,l){for(let u=0;u<l.length;u++){let m=l[u];u===l.length-1&&l[0].x===m.x&&l[0].y===m.y||(d.x+=m.x,d.y+=m.y,d.sampleCount++)}}function bkt(d,l){return d.x===l.x&&(d.x<0||d.x>Pe)||d.y===l.y&&(d.y<0||d.y>Pe)}function qnt(d){return d.every((l=>l.x<0))||d.every((l=>l.x>Pe))||d.every((l=>l.y<0))||d.every((l=>l.y>Pe))}let Hnt;ir(\"FillExtrusionBucket\",QV,{omit:[\"layers\",\"features\"]});var xkt={get paint(){return Hnt=Hnt||new na({\"fill-extrusion-opacity\":new fr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"]),\"fill-extrusion-color\":new Mr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-color\"]),\"fill-extrusion-translate\":new fr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"]),\"fill-extrusion-translate-anchor\":new fr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"]),\"fill-extrusion-pattern\":new Xm(Te[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"]),\"fill-extrusion-height\":new Mr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-height\"]),\"fill-extrusion-base\":new Mr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-base\"]),\"fill-extrusion-vertical-gradient\":new fr(Te[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"])})}};class wkt extends yl{constructor(l,u){super(l,xkt,u)}createBucket(l){return new QV(l)}queryRadius(){return hR(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:l,feature:u,featureState:m,geometry:A,transform:T,pixelsToTileUnits:M,pixelPosMatrix:P}){let L=dR(l,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-T.bearingInRadians,M),O=this.paint.get(\"fill-extrusion-height\").evaluate(u,m),V=this.paint.get(\"fill-extrusion-base\").evaluate(u,m),F=(function(j,nt){let st=[];for(let pt of j){let mt=[pt.x,pt.y,0,1];Ft(mt,mt,nt),st.push(new s(mt[0]/mt[3],mt[1]/mt[3]))}return st})(L,P),X=(function(j,nt,st,pt){let mt=[],vt=[],At=pt[8]*nt,wt=pt[9]*nt,St=pt[10]*nt,Bt=pt[11]*nt,qt=pt[8]*st,te=pt[9]*st,he=pt[10]*st,fe=pt[11]*st;for(let Se of j){let ve=[],be=[];for(let Ae of Se){let Ze=Ae.x,nr=Ae.y,er=pt[0]*Ze+pt[4]*nr+pt[12],Xe=pt[1]*Ze+pt[5]*nr+pt[13],Lr=pt[2]*Ze+pt[6]*nr+pt[14],$i=pt[3]*Ze+pt[7]*nr+pt[15],rn=Lr+St,yn=$i+Bt,Xa=er+qt,Oo=Xe+te,zs=Lr+he,aa=$i+fe,co=new s((er+At)/yn,(Xe+wt)/yn);co.z=rn/yn,ve.push(co);let Ta=new s(Xa/aa,Oo/aa);Ta.z=zs/aa,be.push(Ta)}mt.push(ve),vt.push(be)}return[mt,vt]})(A,V,O,P);return(function(j,nt,st){let pt=1/0;Ai(st,nt)&&(pt=Ynt(st,nt[0]));for(let mt=0;mt<nt.length;mt++){let vt=nt[mt],At=j[mt];for(let wt=0;wt<vt.length-1;wt++){let St=vt[wt],Bt=[St,vt[wt+1],At[wt+1],At[wt],St];Sr(st,Bt)&&(pt=Math.min(pt,Ynt(st,Bt)))}}return pt!==1/0&&pt})(X[0],X[1],F)}}function VM(d,l){return d.x*l.x+d.y*l.y}function Ynt(d,l){if(d.length===1){let u=0,m=l[u++],A;for(;!A||m.equals(A);)if(A=l[u++],!A)return 1/0;for(;u<l.length;u++){let T=l[u],M=d[0],P=A.sub(m),L=T.sub(m),O=M.sub(m),V=VM(P,P),F=VM(P,L),X=VM(L,L),j=VM(O,P),nt=VM(O,L),st=V*X-F*F,pt=(X*j-F*nt)/st,mt=(V*nt-F*j)/st,vt=m.z*(1-pt-mt)+A.z*pt+T.z*mt;if(isFinite(vt))return vt}return 1/0}{let u=1/0;for(let m of l)u=Math.min(u,m.z);return u}}let Xnt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class AR{static from(l){if(!(l instanceof ArrayBuffer))throw new Error(\"Data must be an instance of ArrayBuffer.\");let[u,m]=new Uint8Array(l,0,2);if(u!==219)throw new Error(\"Data does not appear to be in a KDBush format.\");let A=m>>4;if(A!==1)throw new Error(`Got v${A} data when expected v1.`);let T=Xnt[15&m];if(!T)throw new Error(\"Unrecognized array type.\");let[M]=new Uint16Array(l,2,1),[P]=new Uint32Array(l,4,1);return new AR(P,M,T,l)}constructor(l,u=64,m=Float64Array,A){if(isNaN(l)||l<0)throw new Error(`Unpexpected numItems value: ${l}.`);this.numItems=+l,this.nodeSize=Math.min(Math.max(+u,2),65535),this.ArrayType=m,this.IndexArrayType=l<65536?Uint16Array:Uint32Array;let T=Xnt.indexOf(this.ArrayType),M=2*l*this.ArrayType.BYTES_PER_ELEMENT,P=l*this.IndexArrayType.BYTES_PER_ELEMENT,L=(8-P%8)%8;if(T<0)throw new Error(`Unexpected typed array class: ${m}.`);A&&A instanceof ArrayBuffer?(this.data=A,this.ids=new this.IndexArrayType(this.data,8,l),this.coords=new this.ArrayType(this.data,8+P+L,2*l),this._pos=2*l,this._finished=!0):(this.data=new ArrayBuffer(8+M+P+L),this.ids=new this.IndexArrayType(this.data,8,l),this.coords=new this.ArrayType(this.data,8+P+L,2*l),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+T]),new Uint16Array(this.data,2,1)[0]=u,new Uint32Array(this.data,4,1)[0]=l)}add(l,u){let m=this._pos>>1;return this.ids[m]=m,this.coords[this._pos++]=l,this.coords[this._pos++]=u,m}finish(){let l=this._pos>>1;if(l!==this.numItems)throw new Error(`Added ${l} items when expected ${this.numItems}.`);return JV(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(l,u,m,A){if(!this._finished)throw new Error(\"Data not yet indexed - call index.finish().\");let{ids:T,coords:M,nodeSize:P}=this,L=[0,T.length-1,0],O=[];for(;L.length;){let V=L.pop()||0,F=L.pop()||0,X=L.pop()||0;if(F-X<=P){for(let pt=X;pt<=F;pt++){let mt=M[2*pt],vt=M[2*pt+1];mt>=l&&mt<=m&&vt>=u&&vt<=A&&O.push(T[pt])}continue}let j=X+F>>1,nt=M[2*j],st=M[2*j+1];nt>=l&&nt<=m&&st>=u&&st<=A&&O.push(T[j]),(V===0?l<=nt:u<=st)&&(L.push(X),L.push(j-1),L.push(1-V)),(V===0?m>=nt:A>=st)&&(L.push(j+1),L.push(F),L.push(1-V))}return O}within(l,u,m){if(!this._finished)throw new Error(\"Data not yet indexed - call index.finish().\");let{ids:A,coords:T,nodeSize:M}=this,P=[0,A.length-1,0],L=[],O=m*m;for(;P.length;){let V=P.pop()||0,F=P.pop()||0,X=P.pop()||0;if(F-X<=M){for(let pt=X;pt<=F;pt++)Knt(T[2*pt],T[2*pt+1],l,u)<=O&&L.push(A[pt]);continue}let j=X+F>>1,nt=T[2*j],st=T[2*j+1];Knt(nt,st,l,u)<=O&&L.push(A[j]),(V===0?l-m<=nt:u-m<=st)&&(P.push(X),P.push(j-1),P.push(1-V)),(V===0?l+m>=nt:u+m>=st)&&(P.push(j+1),P.push(F),P.push(1-V))}return L}}function JV(d,l,u,m,A,T){if(A-m<=u)return;let M=m+A>>1;Znt(d,l,M,m,A,T),JV(d,l,u,m,M-1,1-T),JV(d,l,u,M+1,A,1-T)}function Znt(d,l,u,m,A,T){for(;A>m;){if(A-m>600){let O=A-m+1,V=u-m+1,F=Math.log(O),X=.5*Math.exp(2*F/3),j=.5*Math.sqrt(F*X*(O-X)/O)*(V-O/2<0?-1:1);Znt(d,l,u,Math.max(m,Math.floor(u-V*X/O+j)),Math.min(A,Math.floor(u+(O-V)*X/O+j)),T)}let M=l[2*u+T],P=m,L=A;for(jM(d,l,m,u),l[2*A+T]>M&&jM(d,l,m,A);P<L;){for(jM(d,l,P,L),P++,L--;l[2*P+T]<M;)P++;for(;l[2*L+T]>M;)L--}l[2*m+T]===M?jM(d,l,m,L):(L++,jM(d,l,L,A)),L<=u&&(m=L+1),u<=L&&(A=L-1)}}function jM(d,l,u,m){tj(d,u,m),tj(l,2*u,2*m),tj(l,2*u+1,2*m+1)}function tj(d,l,u){let m=d[l];d[l]=d[u],d[u]=m}function Knt(d,l,u,m){let A=d-u,T=l-m;return A*A+T*T}function ej(d,l,u,m){let A=m,T=l+(u-l>>1),M,P=u-l,L=d[l],O=d[l+1],V=d[u],F=d[u+1];for(let X=l+3;X<u;X+=3){let j=Tkt(d[X],d[X+1],L,O,V,F);if(j>A)M=X,A=j;else if(j===A){let nt=Math.abs(X-T);nt<P&&(M=X,P=nt)}}A>m&&(M-l>3&&ej(d,l,M,m),d[M+2]=A,u-M>3&&ej(d,M,u,m))}function Tkt(d,l,u,m,A,T){let M=A-u,P=T-m;if(M!==0||P!==0){let L=((d-u)*M+(l-m)*P)/(M*M+P*P);L>1?(u=A,m=T):L>0&&(u+=M*L,m+=P*L)}return M=d-u,P=l-m,M*M+P*P}function qa(d,l,u,m){let A={type:l,geom:u},T={id:d??null,type:A.type,geometry:A.geom,tags:m,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(A.type){case\"Point\":case\"MultiPoint\":case\"LineString\":yR(T,A.geom);break;case\"Polygon\":yR(T,A.geom[0]);break;case\"MultiLineString\":for(let M of A.geom)yR(T,M);break;case\"MultiPolygon\":for(let M of A.geom)yR(T,M[0])}return T}function yR(d,l){for(let u=0;u<l.length;u+=3)d.minX=Math.min(d.minX,l[u]),d.minY=Math.min(d.minY,l[u+1]),d.maxX=Math.max(d.maxX,l[u]),d.maxY=Math.max(d.maxY,l[u+1])}function rj(d,l){let u=[];switch(d.type){case\"FeatureCollection\":for(let m=0;m<d.features.length;m++)_R(u,d.features[m],l,m);break;case\"Feature\":_R(u,d,l);break;default:_R(u,{geometry:d,properties:void 0},l)}return u}function _R(d,l,u,m){if(!l.geometry)return;if(l.geometry.type===\"GeometryCollection\")return void(function(P,L,O,V,F){for(let X of O.geometries)_R(P,{id:L.id,geometry:X,properties:L.properties},V,F)})(d,l,l.geometry,u,m);if(!l.geometry.coordinates?.length)return;let T=(function(P,L,O){return L.promoteId?P.properties?.[L.promoteId]:L.generateId?O||0:P.id})(l,u,m),M=Math.pow(u.tolerance/((1<<u.maxZoom)*u.extent),2);switch(l.geometry.type){case\"Point\":return void(function(P,L,O,V){let F=[];F.push(F2(O.coordinates[0]),N2(O.coordinates[1]),0),P.push(qa(L,\"Point\",F,V))})(d,T,l.geometry,l.properties);case\"MultiPoint\":return void(function(P,L,O,V){let F=[];for(let X of O.coordinates)F.push(F2(X[0]),N2(X[1]),0);P.push(qa(L,\"MultiPoint\",F,V))})(d,T,l.geometry,l.properties);case\"LineString\":return void(function(P,L,O,V,F){let X=[];ij(O.coordinates,X,V,!1),P.push(qa(L,\"LineString\",X,F))})(d,T,l.geometry,M,l.properties);case\"MultiLineString\":return void(function(P,L,O,V,F,X){if(F.lineMetrics)for(let j of O.coordinates){let nt=[];ij(j,nt,V,!1),P.push(qa(L,\"LineString\",nt,X))}else{let j=[];nj(O.coordinates,j,V,!1),P.push(qa(L,\"MultiLineString\",j,X))}})(d,T,l.geometry,M,u,l.properties);case\"Polygon\":return void(function(P,L,O,V,F){let X=[];nj(O.coordinates,X,V,!0),P.push(qa(L,\"Polygon\",X,F))})(d,T,l.geometry,M,l.properties);case\"MultiPolygon\":return void(function(P,L,O,V,F){let X=[];for(let j of O.coordinates){let nt=[];nj(j,nt,V,!0),X.push(nt)}P.push(qa(L,\"MultiPolygon\",X,F))})(d,T,l.geometry,M,l.properties);default:throw new Error(\"Input data is not a valid GeoJSON object.\")}}function ij(d,l,u,m){let A,T,M=0;for(let L=0;L<d.length;L++){let O=F2(d[L][0]),V=N2(d[L][1]);l.push(O,V,0),L>0&&(M+=m?(A*V-O*T)/2:Math.sqrt(Math.pow(O-A,2)+Math.pow(V-T,2))),A=O,T=V}let P=l.length-3;l[2]=1,u>0&&ej(l,0,P,u),l[P+2]=1,l.size=Math.abs(M),l.start=0,l.end=l.size}function nj(d,l,u,m){for(let A=0;A<d.length;A++){let T=[];ij(d[A],T,u,m),l.push(T)}}function F2(d){return d/360+.5}function N2(d){let l=Math.sin(d*Math.PI/180),u=.5-.25*Math.log((1+l)/(1-l))/Math.PI;return u<0?0:u>1?1:u}function vR(d){let l={type:\"Feature\",geometry:Skt(d),properties:d.tags};return d.id!=null&&(l.id=d.id),l}function Skt(d){let{type:l,geometry:u}=d;switch(l){case\"Point\":return{type:l,coordinates:Qnt(u[0],u[1])};case\"MultiPoint\":case\"LineString\":return{type:l,coordinates:oj(u)};case\"MultiLineString\":case\"Polygon\":return{type:l,coordinates:u.map((m=>oj(m)))};case\"MultiPolygon\":return{type:l,coordinates:u.map((m=>m.map((A=>oj(A)))))}}}function oj(d){let l=[];for(let u=0;u<d.length;u+=3)l.push(Qnt(d[u],d[u+1]));return l}function Qnt(d,l){return[Jnt(d),tot(l)]}function Jnt(d){return 360*(d-.5)}function tot(d){let l=(180-360*d)*Math.PI/180;return 360*Math.atan(Math.exp(l))/Math.PI-90}var _l;function tg(d,l,u,m,A,T,M,P){if(m/=l,T>=(u/=l)&&M<m)return d;if(M<u||T>=m)return null;let L=[];for(let O of d){let V=A===_l.X?O.minX:O.minY,F=A===_l.X?O.maxX:O.maxY;if(V>=u&&F<m)L.push(O);else if(!(F<u||V>=m))switch(O.type){case\"Point\":case\"MultiPoint\":Mkt(O,L,u,m,A);continue;case\"LineString\":Ekt(O,L,u,m,A,P);continue;case\"MultiLineString\":Pkt(O,L,u,m,A);continue;case\"Polygon\":Ckt(O,L,u,m,A);continue;case\"MultiPolygon\":Ikt(O,L,u,m,A);continue}}return L.length?L:null}function Mkt(d,l,u,m,A){let T=[];(function(M,P,L,O,V){for(let F=0;F<M.length;F+=3){let X=M[F+V];X>=L&&X<=O&&z2(P,M[F],M[F+1],M[F+2])}})(d.geometry,T,u,m,A),T.length&&l.push(qa(d.id,T.length===3?\"Point\":\"MultiPoint\",T,d.tags))}function Ekt(d,l,u,m,A,T){let M=[];if(eot(d.geometry,M,u,m,A,!1,T.lineMetrics),M.length)if(T.lineMetrics)for(let P of M)l.push(qa(d.id,\"LineString\",P,d.tags));else l.push(M.length>1?qa(d.id,\"MultiLineString\",M,d.tags):qa(d.id,\"LineString\",M[0],d.tags))}function Pkt(d,l,u,m,A){let T=[];sj(d.geometry,T,u,m,A,!1),T.length&&l.push(T.length!==1?qa(d.id,\"MultiLineString\",T,d.tags):qa(d.id,\"LineString\",T[0],d.tags))}function Ckt(d,l,u,m,A){let T=[];sj(d.geometry,T,u,m,A,!0),T.length&&l.push(qa(d.id,\"Polygon\",T,d.tags))}function Ikt(d,l,u,m,A){let T=[];for(let M of d.geometry){let P=[];sj(M,P,u,m,A,!0),P.length&&T.push(P)}T.length&&l.push(qa(d.id,\"MultiPolygon\",T,d.tags))}function eot(d,l,u,m,A,T,M){let P=rot(d),L=A===_l.X?kkt:Rkt,O,V,F=d.start;for(let pt=0;pt<d.length-3;pt+=3){let mt=d[pt],vt=d[pt+1],At=d[pt+2],wt=d[pt+3],St=d[pt+4],Bt=A===_l.X?mt:vt,qt=A===_l.X?wt:St,te=!1;M&&(O=Math.sqrt(Math.pow(mt-wt,2)+Math.pow(vt-St,2))),Bt<u?qt>u&&(V=L(P,mt,vt,wt,St,u),M&&(P.start=F+O*V)):Bt>m?qt<m&&(V=L(P,mt,vt,wt,St,m),M&&(P.start=F+O*V)):z2(P,mt,vt,At),qt<u&&Bt>=u&&(V=L(P,mt,vt,wt,St,u),te=!0),qt>m&&Bt<=m&&(V=L(P,mt,vt,wt,St,m),te=!0),!T&&te&&(M&&(P.end=F+O*V),l.push(P),P=rot(d)),M&&(F+=O)}let X=d.length-3,j=d[X],nt=d[X+1],st=A===_l.X?j:nt;st>=u&&st<=m&&z2(P,j,nt,d[X+2]),X=P.length-3,T&&X>=3&&(P[X]!==P[0]||P[X+1]!==P[1])&&z2(P,P[0],P[1],P[2]),P.length&&l.push(P)}function rot(d){let l=[];return l.size=d.size,l.start=d.start,l.end=d.end,l}function sj(d,l,u,m,A,T){for(let M of d)eot(M,l,u,m,A,T,!1)}function z2(d,l,u,m){d.push(l,u,m)}function kkt(d,l,u,m,A,T){let M=(T-l)/(m-l);return z2(d,T,u+(A-u)*M,1),M}function Rkt(d,l,u,m,A,T){let M=(T-u)/(A-u);return z2(d,l+(m-l)*M,T,1),M}function aj(d,l){let u=l.buffer/l.extent,m=d,A=tg(d,1,-1-u,u,_l.X,-1,2,l),T=tg(d,1,1-u,2+u,_l.X,-1,2,l);return(A||T)&&(m=tg(d,1,-u,1+u,_l.X,-1,2,l)||[],A&&(m=iot(A,1).concat(m)),T&&(m=m.concat(iot(T,-1)))),m}function iot(d,l){let u=[];for(let m of d)switch(m.type){case\"Point\":case\"MultiPoint\":case\"LineString\":{let A=lj(m.geometry,l);u.push(qa(m.id,m.type,A,m.tags));continue}case\"MultiLineString\":case\"Polygon\":{let A=[];for(let T of m.geometry)A.push(lj(T,l));u.push(qa(m.id,m.type,A,m.tags));continue}case\"MultiPolygon\":{let A=[];for(let T of m.geometry){let M=[];for(let P of T)M.push(lj(P,l));A.push(M)}u.push(qa(m.id,m.type,A,m.tags));continue}}return u}function lj(d,l){let u=[];u.size=d.size,d.start!==void 0&&(u.start=d.start,u.end=d.end);for(let m=0;m<d.length;m+=3)u.push(d[m]+l,d[m+1],d[m+2]);return u}function Dkt(d,l,u){let m=!!l.newGeometry,A=l.removeAllProperties||l.removeProperties?.length>0||l.addOrUpdateProperties?.length>0;if(m){let T=d[0],M=rj({type:\"FeatureCollection\",features:[{type:\"Feature\",id:T.id,geometry:l.newGeometry,properties:A?not(T.tags,l):T.tags}]},u);return M=aj(M,u),M}if(A){let T=[];for(let M of d){let P={...M};P.tags=not(P.tags,l),T.push(P)}return T}return[]}function not(d,l){if(l.removeAllProperties)return{};let u={...d||{}};if(l.removeProperties)for(let m of l.removeProperties)delete u[m];if(l.addOrUpdateProperties)for(let{key:m,value:A}of l.addOrUpdateProperties)u[m]=A;return u}(function(d){d[d.X=0]=\"X\",d[d.Y=1]=\"Y\"})(_l||(_l={}));let cj={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:d=>d};class Okt{constructor(l){this.options=Object.assign(Object.create(cj),l),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(l){let u=[];for(let m of l){if(!m.geometry)continue;let[A,T]=m.geometry.coordinates,[M,P]=[F2(A),N2(T)];u.push({id:m.id,type:\"Point\",geometry:[M,P],tags:m.properties})}this.createIndex(u)}initialize(l){let u=[];for(let m of l)m.type===\"Point\"&&u.push(m);this.createIndex(u)}updateIndex(l,u,m){this.options=Object.assign(Object.create(cj),m.clusterOptions),this.initialize(l)}createIndex(l){let{log:u,minZoom:m,maxZoom:A}=this.options;u&&console.time(\"total time\");let T=`prepare ${l.length} points`;u&&console.time(T),this.points=l;let M=[];for(let L=0;L<l.length;L++){let O=l[L];if(!O?.geometry)continue;let[V,F]=O.geometry;V=Math.fround(V),F=Math.fround(F),M.push(V,F,1/0,L,-1,1),this.options.reduce&&M.push(0)}let P=this.trees[A+1]=this.createTree(M);u&&console.timeEnd(T);for(let L=A;L>=m;L--){let O=Date.now();P=this.trees[L]=this.createTree(this.cluster(P,L)),u&&console.log(\"z%d: %d clusters in %dms\",L,P.numItems,Date.now()-O)}u&&console.timeEnd(\"total time\")}getClusters(l,u){return this.getClustersInternal(l,u).map((m=>vR(m)))}getClustersInternal(l,u){let m=((l[0]+180)%360+360)%360-180,A=Math.max(-90,Math.min(90,l[1])),T=l[2]===180?180:((l[2]+180)%360+360)%360-180,M=Math.max(-90,Math.min(90,l[3]));if(l[2]-l[0]>=360)m=-180,T=180;else if(m>T){let F=this.getClustersInternal([m,A,180,M],u),X=this.getClustersInternal([-180,A,T,M],u);return F.concat(X)}let P=this.trees[this.limitZoom(u)],L=P.range(F2(m),N2(M),F2(T),N2(A)),O=P.flatData,V=[];for(let F of L){let X=this.stride*F;V.push(O[X+5]>1?Lkt(O,X,this.clusterProps):this.points[O[X+3]])}return V}getChildren(l){let u=this.getOriginId(l),m=this.getOriginZoom(l),A=new Error(\"No cluster with the specified id: \"+l),T=this.trees[m];if(!T)throw A;let M=T.flatData;if(u*this.stride>=M.length)throw A;let P=this.options.radius/(this.options.extent*Math.pow(2,m-1)),L=T.within(M[u*this.stride],M[u*this.stride+1],P),O=[];for(let V of L){let F=V*this.stride;M[F+4]===l&&O.push(M[F+5]>1?Bkt(M,F,this.clusterProps):vR(this.points[M[F+3]]))}if(O.length===0)throw A;return O}getLeaves(l,u,m){let A=[];return this.appendLeaves(A,l,u=u||10,m=m||0,0),A}getTile(l,u,m){let A=this.trees[this.limitZoom(l)];if(!A)return null;let T=Math.pow(2,l),{extent:M,radius:P}=this.options,L=P/M,O=(m-L)/T,V=(m+1+L)/T,F={transformed:!0,features:[],source:null,x:u,y:m,z:l};return this.addTileFeatures(A.range((u-L)/T,O,(u+1+L)/T,V),A.flatData,u,m,T,F),u===0&&this.addTileFeatures(A.range(1-L/T,O,1,V),A.flatData,T,m,T,F),u===T-1&&this.addTileFeatures(A.range(0,O,L/T,V),A.flatData,-1,m,T,F),F}getClusterExpansionZoom(l){return this.getOriginZoom(l)}appendLeaves(l,u,m,A,T){let M=this.getChildren(u);for(let P of M){let L=P.properties;if(L?.cluster?T+L.point_count<=A?T+=L.point_count:T=this.appendLeaves(l,L.cluster_id,m,A,T):T<A?T++:l.push(P),l.length===m)break}return T}createTree(l){let u=new AR(l.length/this.stride|0,this.options.nodeSize,Float32Array);for(let m=0;m<l.length;m+=this.stride)u.add(l[m],l[m+1]);return u.finish(),u.flatData=l,u.data=null,u}addTileFeatures(l,u,m,A,T,M){for(let P of l){let L=P*this.stride,O=u[L+5]>1,V,F,X;if(O)V=uj(u,L,this.clusterProps),F=u[L],X=u[L+1];else{let st=this.points[u[L+3]];V=st.tags,[F,X]=st.geometry}let j={type:1,geometry:[[Math.round(this.options.extent*(F*T-m)),Math.round(this.options.extent*(X*T-A))]],tags:V},nt;nt=O||this.options.generateId?u[L+3]:this.points[u[L+3]].id,nt!==void 0&&(j.id=nt),M.features.push(j)}}limitZoom(l){return Math.max(this.options.minZoom,Math.min(Math.floor(+l),this.options.maxZoom+1))}cluster(l,u){let{radius:m,extent:A,reduce:T,minPoints:M}=this.options,P=m/(A*Math.pow(2,u)),L=l.flatData,O=[],V=this.stride;for(let F=0;F<L.length;F+=V){if(L[F+2]<=u)continue;L[F+2]=u;let X=L[F],j=L[F+1],nt=l.within(L[F],L[F+1],P),st=L[F+5],pt=st;for(let mt of nt){let vt=mt*V;L[vt+2]>u&&(pt+=L[vt+5])}if(pt>st&&pt>=M){let mt,vt=X*st,At=j*st,wt=-1,St=(F/V<<5)+(u+1)+this.points.length;for(let Bt of nt){let qt=Bt*V;if(L[qt+2]<=u)continue;L[qt+2]=u;let te=L[qt+5];vt+=L[qt]*te,At+=L[qt+1]*te,L[qt+4]=St,T&&(mt||(mt=this.map(L,F,!0),wt=this.clusterProps.length,this.clusterProps.push(mt)),T(mt,this.map(L,qt)))}L[F+4]=St,O.push(vt/pt,At/pt,1/0,St,-1,pt),T&&O.push(wt)}else{for(let mt=0;mt<V;mt++)O.push(L[F+mt]);if(pt>1)for(let mt of nt){let vt=mt*V;if(!(L[vt+2]<=u)){L[vt+2]=u;for(let At=0;At<V;At++)O.push(L[vt+At])}}}}return O}getOriginId(l){return l-this.points.length>>5}getOriginZoom(l){return(l-this.points.length)%32}map(l,u,m){if(l[u+5]>1){let M=this.clusterProps[l[u+6]];return m?Object.assign({},M):M}let A=this.points[l[u+3]].tags,T=this.options.map(A);return m&&T===A?Object.assign({},T):T}}function Lkt(d,l,u){return{id:d[l+3],type:\"Point\",tags:uj(d,l,u),geometry:[d[l],d[l+1]]}}function Bkt(d,l,u){return{type:\"Feature\",id:d[l+3],properties:uj(d,l,u),geometry:{type:\"Point\",coordinates:[Jnt(d[l]),tot(d[l+1])]}}}function uj(d,l,u){let m=d[l+5],A=m>=1e4?`${Math.round(m/1e3)}k`:m>=1e3?Math.round(m/100)/10+\"k\":m,T=d[l+6],M=T===-1?{}:Object.assign({},u[T]);return Object.assign(M,{cluster:!0,cluster_id:d[l+3],point_count:m,point_count_abbreviated:A})}let hj=\"geojsonvt_clip_start\",dj=\"geojsonvt_clip_end\";function oot(d,l,u,m,A){let T=l===A.maxZoom?0:A.tolerance/((1<<l)*A.extent),M={transformed:!1,features:[],source:null,x:u,y:m,z:l,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:d.length};for(let P of d)Fkt(M,P,T,A);return M}function Fkt(d,l,u,m){switch(d.minX=Math.min(d.minX,l.minX),d.minY=Math.min(d.minY,l.minY),d.maxX=Math.max(d.maxX,l.maxX),d.maxY=Math.max(d.maxY,l.maxY),l.type){case\"Point\":case\"MultiPoint\":return void(function(A,T){let M=[];for(let L=0;L<T.geometry.length;L+=3)M.push(T.geometry[L],T.geometry[L+1]),A.numPoints++,A.numSimplified++;if(!M.length)return;let P={type:1,tags:T.tags||null,geometry:M};T.id!==null&&(P.id=T.id),A.features.push(P)})(d,l);case\"LineString\":return void(function(A,T,M,P){let L=[];if(fj(L,T.geometry,A,M,!1,!1),!L.length)return;let O=T.tags||null;if(P.lineMetrics){O={};for(let F in T.tags)O[F]=T.tags[F];O[hj]=T.geometry.start/T.geometry.size,O[dj]=T.geometry.end/T.geometry.size}let V={type:2,tags:O,geometry:L};T.id!==null&&(V.id=T.id),A.features.push(V)})(d,l,u,m);case\"MultiLineString\":case\"Polygon\":return void(function(A,T,M){let P=[];for(let O=0;O<T.geometry.length;O++)fj(P,T.geometry[O],A,M,T.type===\"Polygon\",O===0);if(!P.length)return;let L={type:T.type===\"Polygon\"?3:2,tags:T.tags||null,geometry:P};T.id!==null&&(L.id=T.id),A.features.push(L)})(d,l,u);case\"MultiPolygon\":return void(function(A,T,M){let P=[];for(let O=0;O<T.geometry.length;O++){let V=T.geometry[O];for(let F=0;F<V.length;F++)fj(P,V[F],A,M,!0,F===0)}if(!P.length)return;let L={type:3,tags:T.tags||null,geometry:P};T.id!==null&&(L.id=T.id),A.features.push(L)})(d,l,u)}}function fj(d,l,u,m,A,T){let M=m*m;if(m>0&&l.size<(A?M:m))return void(u.numPoints+=l.length/3);let P=[];for(let L=0;L<l.length;L+=3)(m===0||l[L+2]>M)&&(u.numSimplified++,P.push(l[L],l[L+1])),u.numPoints++;A&&(function(L,O){let V=0;for(let F=0,X=L.length,j=X-2;F<X;j=F,F+=2)V+=(L[F]-L[j])*(L[F+1]+L[j+1]);if(V>0===O)for(let F=0,X=L.length;F<X/2;F+=2){let j=L[F],nt=L[F+1];L[F]=L[X-2-F],L[F+1]=L[X-1-F],L[X-2-F]=j,L[X-1-F]=nt}})(P,T),d.push(P)}function sot(d,l){if(d.transformed)return d;let u=1<<d.z,m=d.x,A=d.y;for(let T of d.features)T.type===1?Nkt(T,l,u,m,A):zkt(T,l,u,m,A);return d.transformed=!0,d}function Nkt(d,l,u,m,A){let T=d,M=d.geometry,P=[];for(let L=0;L<M.length;L+=2)P.push(aot(M[L],M[L+1],l,u,m,A));return T.geometry=P,T}function zkt(d,l,u,m,A){let T=d,M=d.geometry,P=[];for(let L of M){let O=[];for(let V=0;V<L.length;V+=2)O.push(aot(L[V],L[V+1],l,u,m,A));P.push(O)}return T.geometry=P,T}function aot(d,l,u,m,A,T){return[Math.round(u*(d*m-A)),Math.round(u*(l*m-T))]}class Ukt{constructor(l){this.options=l,this.stats={},this.total=0,this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(l){this.splitTile(l,0,0,0),this.options.debug&&(l.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)))}updateIndex(l,u,m){m.debug>1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(u),m.debug>1&&console.timeEnd(\"invalidating\");let[A,T,M]=[0,0,0],P=oot(l,A,T,M,m);P.source=l;let L=bR(A,T,M);if(this.tiles[L]=P,this.tileCoords.push({z:A,x:T,y:M,id:L}),m.debug){let O=`z${A}`;this.stats[O]=(this.stats[O]||0)+1,this.total++}}getClusterExpansionZoom(l){return null}getChildren(l){return null}getLeaves(l,u,m){return null}getTile(l,u,m){let{extent:A,debug:T}=this.options,M=1<<l,P=bR(l,u=u+M&M-1,m);if(this.tiles[P])return sot(this.tiles[P],A);T>1&&console.log(\"drilling down to z%d-%d-%d\",l,u,m);let L,O=l,V=u,F=m;for(;!L&&O>0;)O--,V>>=1,F>>=1,L=this.tiles[bR(O,V,F)];return L?.source?(T>1&&(console.log(\"found parent tile z%d-%d-%d\",O,V,F),console.time(\"drilling down\")),this.splitTile(L.source,O,V,F,l,u,m),T>1&&console.timeEnd(\"drilling down\"),this.tiles[P]?sot(this.tiles[P],A):null):null}splitTile(l,u,m,A,T,M,P){let L=[l,u,m,A],O=this.options,V=O.debug;for(;L.length;){A=L.pop(),m=L.pop(),u=L.pop(),l=L.pop();let F=1<<u,X=bR(u,m,A),j=this.tiles[X];if(!j&&(V>1&&console.time(\"creation\"),j=this.tiles[X]=oot(l,u,m,A,O),this.tileCoords.push({z:u,x:m,y:A,id:X}),V)){V>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",u,m,A,j.numFeatures,j.numPoints,j.numSimplified),console.timeEnd(\"creation\"));let te=`z${u}`;this.stats[te]=(this.stats[te]||0)+1,this.total++}if(j.source=l,T==null){if(u===O.indexMaxZoom||j.numPoints<=O.indexMaxPoints)continue}else{if(u===O.maxZoom||u===T)continue;if(T!=null){let te=T-u;if(m!==M>>te||A!==P>>te)continue}}if(j.source=null,!l.length)continue;V>1&&console.time(\"clipping\");let nt=.5*O.buffer/O.extent,st=.5-nt,pt=.5+nt,mt=1+nt,vt=null,At=null,wt=null,St=null,Bt=tg(l,F,m-nt,m+pt,_l.X,j.minX,j.maxX,O),qt=tg(l,F,m+st,m+mt,_l.X,j.minX,j.maxX,O);Bt&&(vt=tg(Bt,F,A-nt,A+pt,_l.Y,j.minY,j.maxY,O),At=tg(Bt,F,A+st,A+mt,_l.Y,j.minY,j.maxY,O)),qt&&(wt=tg(qt,F,A-nt,A+pt,_l.Y,j.minY,j.maxY,O),St=tg(qt,F,A+st,A+mt,_l.Y,j.minY,j.maxY,O)),V>1&&console.timeEnd(\"clipping\"),L.push(vt||[],u+1,2*m,2*A),L.push(At||[],u+1,2*m,2*A+1),L.push(wt||[],u+1,2*m+1,2*A),L.push(St||[],u+1,2*m+1,2*A+1)}}invalidateTiles(l){if(!l.length)return;let u=this.options,{debug:m}=u,A=1/0,T=-1/0,M=1/0,P=-1/0;for(let V of l)A=Math.min(A,V.minX),T=Math.max(T,V.maxX),M=Math.min(M,V.minY),P=Math.max(P,V.maxY);let L=u.buffer/u.extent,O=new Set;for(let V in this.tiles){let F=this.tiles[V],X=1<<F.z,j=(F.x-L)/X,nt=(F.x+1+L)/X,st=(F.y-L)/X,pt=(F.y+1+L)/X;if(T<j||A>=nt||P<st||M>=pt)continue;let mt=!1;for(let vt of l)if(vt.maxX>=j&&vt.minX<nt&&vt.maxY>=st&&vt.minY<pt){mt=!0;break}if(mt){if(m){m>1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",F.z,F.x,F.y,F.numFeatures,F.numPoints,F.numSimplified);let vt=`z${F.z}`;this.stats[vt]=(this.stats[vt]||0)-1,this.total--}delete this.tiles[V],O.add(V)}}O.size&&(this.tileCoords=this.tileCoords.filter((V=>!O.has(V.id))))}}function bR(d,l,u){return 32*((1<<d)*u+l)+d}let Vkt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:cj,debug:0},jkt=xo([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}],4),{members:$kt}=jkt,Gkt=xo([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),{members:Wkt}=Gkt,qkt=Math.cos(Math.PI/180*37.5),lot=Math.pow(2,14)/.5;class pj{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=l.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((u=>{this.gradients[u.id]={}})),this.layoutVertexArray=new zt,this.layoutVertexArray2=new jt,this.indexArray=new Le,this.programConfigurations=new se(l.layers,l.zoom),this.segments=new ur,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(l,u,m){this.hasDependencies=fR(\"line\",this.layers,u)||this.hasLineDasharray(this.layers);let A=this.layers[0].layout.get(\"line-sort-key\"),T=!A.isConstant(),M=[];for(let{feature:P,id:L,index:O,sourceLayerIndex:V}of l){let F=this.layers[0]._featureFilter.needGeometry,X=Or(P,F);if(!this.layers[0]._featureFilter.filter(new hn(this.zoom),X,m))continue;let j=T?A.evaluate(X,{},m):void 0,nt={id:L,properties:P.properties,type:P.type,sourceLayerIndex:V,index:O,geometry:F?X.geometry:cr(P),patterns:{},dashes:{},sortKey:j};M.push(nt)}T&&M.sort(((P,L)=>P.sortKey-L.sortKey));for(let P of M){let{geometry:L,index:O,sourceLayerIndex:V}=P;this.hasDependencies?(fR(\"line\",this.layers,u)?HV(\"line\",this.layers,P,{zoom:this.zoom},u):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,P,this.zoom,u),this.patternFeatures.push(P)):this.addFeature(P,L,O,m,{},{},u.subdivisionGranularity),u.featureIndex.insert(l[O].feature,L,O,V,this.index)}}update(l,u,m,A){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,u,this.stateDependentLayers,{imagePositions:m,dashPositions:A})}addFeatures(l,u,m,A){for(let T of this.patternFeatures)this.addFeature(T,T.geometry,T.index,u,m,A,l.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=l.createVertexBuffer(this.layoutVertexArray2,Wkt)),this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,$kt),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(l){if(l.properties&&Object.prototype.hasOwnProperty.call(l.properties,hj)&&Object.prototype.hasOwnProperty.call(l.properties,dj))return{start:+l.properties[hj],end:+l.properties[dj]}}addFeature(l,u,m,A,T,M,P){let L=this.layers[0].layout,O=L.get(\"line-join\").evaluate(l,{}),V=L.get(\"line-cap\"),F=L.get(\"line-miter-limit\"),X=L.get(\"line-round-limit\");this.lineClips=this.lineFeatureClips(l);for(let j of u)this.addLine(j,l,O,V,F,X,A,P);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,m,{imagePositions:T,dashPositions:M,canonical:A})}addLine(l,u,m,A,T,M,P,L){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,l=mv(l,P?L.line.getGranularityForZoomLevel(P.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let At=0;At<l.length-1;At++)this.totalDistance+=l[At].dist(l[At+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let O=zM.types[u.type]===\"Polygon\",V=l.length;for(;V>=2&&l[V-1].equals(l[V-2]);)V--;let F=0;for(;F<V-1&&l[F].equals(l[F+1]);)F++;if(V<(O?3:2))return;m===\"bevel\"&&(T=1.05);let X=this.overscaling<=16?122880/(512*this.overscaling):0,j=this.segments.prepareSegment(10*V,this.layoutVertexArray,this.indexArray),nt,st,pt,mt,vt;this.e1=this.e2=-1,O&&(nt=l[V-2],vt=l[F].sub(nt)._unit()._perp());for(let At=F;At<V;At++){if(pt=At===V-1?O?l[F+1]:void 0:l[At+1],pt&&l[At].equals(pt))continue;vt&&(mt=vt),nt&&(st=nt),nt=l[At],vt=pt?pt.sub(nt)._unit()._perp():mt,mt=mt||vt;let wt=mt.add(vt);wt.x===0&&wt.y===0||wt._unit();let St=mt.x*vt.x+mt.y*vt.y,Bt=wt.x*vt.x+wt.y*vt.y,qt=Bt!==0?1/Bt:1/0,te=2*Math.sqrt(2-2*Bt),he=Bt<qkt&&st&&pt,fe=mt.x*vt.y-mt.y*vt.x>0;if(he&&At>F){let be=nt.dist(st);if(be>2*X){let Ae=nt.sub(nt.sub(st)._mult(X/be)._round());this.updateDistance(st,Ae),this.addCurrentVertex(Ae,mt,0,0,j),st=Ae}}let Se=st&&pt,ve=Se?m:O?\"butt\":A;if(Se&&ve===\"round\"&&(qt<M?ve=\"miter\":qt<=2&&(ve=\"fakeround\")),ve===\"miter\"&&qt>T&&(ve=\"bevel\"),ve===\"bevel\"&&(qt>2&&(ve=\"flipbevel\"),qt<T&&(ve=\"miter\")),st&&this.updateDistance(st,nt),ve===\"miter\")wt._mult(qt),this.addCurrentVertex(nt,wt,0,0,j);else if(ve===\"flipbevel\"){if(qt>100)wt=vt.mult(-1);else{let be=qt*mt.add(vt).mag()/mt.sub(vt).mag();wt._perp()._mult(be*(fe?-1:1))}this.addCurrentVertex(nt,wt,0,0,j),this.addCurrentVertex(nt,wt.mult(-1),0,0,j)}else if(ve===\"bevel\"||ve===\"fakeround\"){let be=-Math.sqrt(qt*qt-1),Ae=fe?be:0,Ze=fe?0:be;if(st&&this.addCurrentVertex(nt,mt,Ae,Ze,j),ve===\"fakeround\"){let nr=Math.round(180*te/Math.PI/20);for(let er=1;er<nr;er++){let Xe=er/nr;if(Xe!==.5){let $i=Xe-.5;Xe+=Xe*$i*(Xe-1)*((1.0904+St*(St*(3.55645-1.43519*St)-3.2452))*$i*$i+(.848013+St*(.215638*St-1.06021)))}let Lr=vt.sub(mt)._mult(Xe)._add(mt)._unit()._mult(fe?-1:1);this.addHalfVertex(nt,Lr.x,Lr.y,!1,fe,0,j)}}pt&&this.addCurrentVertex(nt,vt,-Ae,-Ze,j)}else if(ve===\"butt\")this.addCurrentVertex(nt,wt,0,0,j);else if(ve===\"square\"){let be=st?1:-1;this.addCurrentVertex(nt,wt,be,be,j)}else ve===\"round\"&&(st&&(this.addCurrentVertex(nt,mt,0,0,j),this.addCurrentVertex(nt,mt,1,1,j,!0)),pt&&(this.addCurrentVertex(nt,vt,-1,-1,j,!0),this.addCurrentVertex(nt,vt,0,0,j)));if(he&&At<V-1){let be=nt.dist(pt);if(be>2*X){let Ae=nt.add(pt.sub(nt)._mult(X/be)._round());this.updateDistance(nt,Ae),this.addCurrentVertex(Ae,vt,0,0,j),nt=Ae}}}}addCurrentVertex(l,u,m,A,T,M=!1){let P=u.y*A-u.x,L=-u.y-u.x*A;this.addHalfVertex(l,u.x+u.y*m,u.y-u.x*m,M,!1,m,T),this.addHalfVertex(l,P,L,M,!0,-A,T),this.distance>lot/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(l,u,m,A,T,M))}addHalfVertex({x:l,y:u},m,A,T,M,P,L){let O=.5*(this.lineClips?this.scaledDistance*(lot-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((l<<1)+(T?1:0),(u<<1)+(M?1:0),Math.round(63*m)+128,Math.round(63*A)+128,1+(P===0?0:P<0?-1:1)|(63&O)<<2,O>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let V=L.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,V,this.e2),L.primitiveLength++),M?this.e2=V:this.e1=V}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(l,u){this.distance+=l.dist(u),this.updateScaledDistance()}hasLineDasharray(l){for(let u of l){let m=u.paint.get(\"line-dasharray\");if(m&&!m.isConstant())return!0}return!1}addLineDashDependencies(l,u,m,A){for(let T of l){let M=T.paint.get(\"line-dasharray\");if(!M||M.value.kind===\"constant\")continue;let P=T.layout.get(\"line-cap\")===\"round\",L={dasharray:M.value.evaluate({zoom:m-1},u,{}),round:P},O={dasharray:M.value.evaluate({zoom:m},u,{}),round:P},V={dasharray:M.value.evaluate({zoom:m+1},u,{}),round:P},F=`${L.dasharray.join(\",\")},${L.round}`,X=`${O.dasharray.join(\",\")},${O.round}`,j=`${V.dasharray.join(\",\")},${V.round}`;A.dashDependencies[F]=L,A.dashDependencies[X]=O,A.dashDependencies[j]=V,u.dashes[T.id]={min:F,mid:X,max:j}}}}let cot,uot;ir(\"LineBucket\",pj,{omit:[\"layers\",\"patternFeatures\"]});var hot={get paint(){return uot=uot||new na({\"line-opacity\":new Mr(Te.paint_line[\"line-opacity\"]),\"line-color\":new Mr(Te.paint_line[\"line-color\"]),\"line-translate\":new fr(Te.paint_line[\"line-translate\"]),\"line-translate-anchor\":new fr(Te.paint_line[\"line-translate-anchor\"]),\"line-width\":new Mr(Te.paint_line[\"line-width\"]),\"line-gap-width\":new Mr(Te.paint_line[\"line-gap-width\"]),\"line-offset\":new Mr(Te.paint_line[\"line-offset\"]),\"line-blur\":new Mr(Te.paint_line[\"line-blur\"]),\"line-dasharray\":new Xm(Te.paint_line[\"line-dasharray\"]),\"line-pattern\":new Xm(Te.paint_line[\"line-pattern\"]),\"line-gradient\":new r0(Te.paint_line[\"line-gradient\"])})},get layout(){return cot=cot||new na({\"line-cap\":new fr(Te.layout_line[\"line-cap\"]),\"line-join\":new Mr(Te.layout_line[\"line-join\"]),\"line-miter-limit\":new fr(Te.layout_line[\"line-miter-limit\"]),\"line-round-limit\":new fr(Te.layout_line[\"line-round-limit\"]),\"line-sort-key\":new Mr(Te.layout_line[\"line-sort-key\"])})}};class Hkt extends Mr{possiblyEvaluate(l,u){return u=new hn(Math.floor(u.zoom),{now:u.now,fadeDuration:u.fadeDuration,zoomHistory:u.zoomHistory,transition:u.transition}),super.possiblyEvaluate(l,u)}evaluate(l,u,m,A){return u=Cr({},u,{zoom:Math.floor(u.zoom)}),super.evaluate(l,u,m,A)}}let xR;class Ykt extends yl{constructor(l,u){super(l,hot,u),this.gradientVersion=0,xR||(xR=new Hkt(hot.paint.properties[\"line-width\"].specification),xR.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(l){if(l===\"line-gradient\"){let u=this.gradientExpression();this.stepInterpolant=!!(function(m){return m._styleExpression!==void 0})(u)&&u._styleExpression.expression instanceof zn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(l,u){super.recalculate(l,u),this.paint._values[\"line-floorwidth\"]=xR.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,l)}createBucket(l){return new pj(l)}queryRadius(l){let u=l,m=dot(D2(\"line-width\",this,u),D2(\"line-gap-width\",this,u)),A=D2(\"line-offset\",this,u);return m/2+Math.abs(A)+hR(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:l,feature:u,featureState:m,geometry:A,transform:T,pixelsToTileUnits:M}){let P=dR(l,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-T.bearingInRadians,M),L=M/2*dot(this.paint.get(\"line-width\").evaluate(u,m),this.paint.get(\"line-gap-width\").evaluate(u,m)),O=this.paint.get(\"line-offset\").evaluate(u,m);return O&&(A=(function(V,F){let X=[];for(let j=0;j<V.length;j++){let nt=N8t(V[j]),st=[];for(let pt=0;pt<nt.length;pt++){let mt=nt[pt],vt=nt[pt-1],At=nt[pt+1],wt=pt===0?new s(0,0):mt.sub(vt)._unit()._perp(),St=pt===nt.length-1?new s(0,0):At.sub(mt)._unit()._perp(),Bt=wt._add(St)._unit(),qt=Bt.x*St.x+Bt.y*St.y;qt!==0&&Bt._mult(1/qt),st.push(Bt._mult(F)._add(mt))}X.push(st)}return X})(A,O*M)),(function(V,F,X){for(let j=0;j<F.length;j++){let nt=F[j];if(V.length>=3){for(let st=0;st<nt.length;st++)if(R2(V,nt[st]))return!0}if(Tn(V,nt,X))return!0}return!1})(P,A,L)}isTileClipped(){return!0}}function dot(d,l){return l>0?l+2*d:d}let Xkt=xo([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"}],4),Zkt=xo([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);xo([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);let Kkt=xo([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);xo([{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\"}]);let fot=xo([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4),Qkt=xo([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4);function Jkt(d,l,u){return d.sections.forEach((m=>{m.text=(function(A,T,M){let P=T.layout.get(\"text-transform\").evaluate(M,{});return P===\"uppercase\"?A=A.toLocaleUpperCase():P===\"lowercase\"&&(A=A.toLocaleLowerCase()),ad.applyArabicShaping&&(A=ad.applyArabicShaping(A)),A})(m.text,l,u)})),d}xo([{name:\"triangle\",components:3,type:\"Uint16\"}]),xo([{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\"}]),xo([{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\"}]),xo([{type:\"Float32\",name:\"offsetX\"}]),xo([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),xo([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var oa=24;let $M={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"},tRt={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},eRt={40:!0};function pot(d,l,u,m,A,T){if(\"fontStack\"in l){let M=u[l.fontStack],P=M&&M[d];return P?P.metrics.advance*l.scale+A:0}{let M=m[l.imageName];return M?M.displaySize[0]*l.scale*oa/T+A:0}}function mot(d,l,u,m){let A=Math.pow(d-l,2);return m?d<l?A/2:2*A:A+Math.abs(u)*u}function rRt(d,l,u){let m=0;return d===10&&(m-=1e4),u&&(m+=150),d!==40&&d!==65288||(m+=50),l!==41&&l!==65289||(m+=50),m}function got(d,l,u,m,A,T){let M=null,P=mot(l,u,A,T);for(let L of m){let O=mot(l-L.x,u,A,T)+L.badness;O<=P&&(M=L,P=O)}return{index:d,x:l,priorBreak:M,badness:P}}function Aot(d){return d?Aot(d.priorBreak).concat(d.index):[]}class U2{constructor(l=\"\",u=[],m=[]){this.text=l,this.sections=u,this.sectionIndex=m,this.imageSectionID=null}static fromFeature(l,u){let m=new U2;for(let A=0;A<l.sections.length;A++){let T=l.sections[A];T.image?m.addImageSection(T):m.addTextSection(T,u)}return m}length(){return[...this.text].length}getSection(l){return this.sections[this.sectionIndex[l]]}getSectionIndex(l){return this.sectionIndex[l]}verticalizePunctuation(){this.text=(function(l){let u=\"\",m={premature:!0,value:void 0},A=l[Symbol.iterator](),T=A.next(),M=l[Symbol.iterator]();M.next();let P=M.next();for(;!T.done;)u+=!P.done&&sd(P.value.codePointAt(0))&&!$M[P.value]||!m.premature&&sd(m.value.codePointAt(0))&&!$M[m.value]||!$M[T.value]?T.value:$M[T.value],m={value:T.value,premature:!1},T=A.next(),P=M.next();return u})(this.text)}hasZeroWidthSpaces(){return this.text.includes(\"\\u200B\")}trim(){let l=this.text.match(/^\\s*/),u=l?l[0].length:0,m=this.text.match(/\\S\\s*$/),A=m?m[0].length-1:0;this.text=this.text.substring(u,this.text.length-A),this.sectionIndex=this.sectionIndex.slice(u,this.sectionIndex.length-A)}substring(l,u){let m=[...this.text].slice(l,u).join(\"\"),A=this.sectionIndex.slice(l,u);return new U2(m,this.sections,A)}toCodeUnitIndex(l){return[...this.text].slice(0,l).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((l,u)=>Math.max(l,this.sections[u].scale)),0)}getMaxImageSize(l){let u=0,m=0;for(let A=0;A<this.length();A++){let T=this.getSection(A);if(\"imageName\"in T){let M=l[T.imageName];if(!M)continue;let P=M.displaySize;u=Math.max(u,P[0]),m=Math.max(m,P[1])}}return{maxImageWidth:u,maxImageHeight:m}}addTextSection(l,u){this.text+=l.text,this.sections.push({scale:l.scale||1,verticalAlign:l.verticalAlign||\"bottom\",fontStack:l.fontStack||u});let m=this.sections.length-1;this.sectionIndex.push(...[...l.text].map((()=>m)))}addImageSection(l){let u=l.image?l.image.name:\"\";if(u.length===0)return void ln(\"Can't add FormattedSection with an empty image.\");let m=this.getNextImageSectionCharCode();m?(this.text+=String.fromCharCode(m),this.sections.push({scale:1,verticalAlign:l.verticalAlign||\"bottom\",imageName:u}),this.sectionIndex.push(this.sections.length-1)):ln(\"Reached maximum number of images 6401\")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(l,u,m,A,T){let M=[],P=this.determineAverageLineWidth(l,u,m,A,T),L=this.hasZeroWidthSpaces(),O=0,V=0,F=this.text[Symbol.iterator](),X=F.next(),j=this.text[Symbol.iterator]();j.next();let nt=j.next(),st=this.text[Symbol.iterator]();st.next(),st.next();let pt=st.next();for(;!X.done;){let mt=this.getSection(V),vt=X.value.codePointAt(0);if(M2(vt)||(O+=pot(vt,mt,m,A,l,T)),!nt.done){let At=PM(vt),wt=nt.value.codePointAt(0);(tRt[vt]||At||\"imageName\"in mt||!pt.done&&eRt[wt])&&M.push(got(V+1,O,P,M,rRt(vt,wt,At&&L),!1))}V++,X=F.next(),nt=j.next(),pt=st.next()}return Aot(got(this.length(),O,P,M,0,!0))}determineAverageLineWidth(l,u,m,A,T){let M=0,P=0;for(let L of this.text){let O=this.getSection(P);M+=pot(L.codePointAt(0),O,m,A,l,T),P++}return M/Math.max(1,Math.ceil(M/u))}}let mj=4294967296,yot=1/mj,_ot=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf-8\");class wR{constructor(l=new Uint8Array(16)){this.buf=ArrayBuffer.isView(l)?l:new Uint8Array(l),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(l,u,m=this.length){for(;this.pos<m;){let A=this.readVarint(),T=A>>3,M=this.pos;this.type=7&A,l(T,u,this),this.pos===M&&this.skip(A)}return u}readMessage(l,u){return this.readFields(l,u,this.readVarint()+this.pos)}readFixed32(){let l=this.dataView.getUint32(this.pos,!0);return this.pos+=4,l}readSFixed32(){let l=this.dataView.getInt32(this.pos,!0);return this.pos+=4,l}readFixed64(){let l=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*mj;return this.pos+=8,l}readSFixed64(){let l=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*mj;return this.pos+=8,l}readFloat(){let l=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,l}readDouble(){let l=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,l}readVarint(l){let u=this.buf,m,A;return A=u[this.pos++],m=127&A,A<128?m:(A=u[this.pos++],m|=(127&A)<<7,A<128?m:(A=u[this.pos++],m|=(127&A)<<14,A<128?m:(A=u[this.pos++],m|=(127&A)<<21,A<128?m:(A=u[this.pos],m|=(15&A)<<28,(function(T,M,P){let L=P.buf,O,V;if(V=L[P.pos++],O=(112&V)>>4,V<128||(V=L[P.pos++],O|=(127&V)<<3,V<128)||(V=L[P.pos++],O|=(127&V)<<10,V<128)||(V=L[P.pos++],O|=(127&V)<<17,V<128)||(V=L[P.pos++],O|=(127&V)<<24,V<128)||(V=L[P.pos++],O|=(1&V)<<31,V<128))return V2(T,O,M);throw new Error(\"Expected varint not more than 10 bytes\")})(m,l,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let l=this.readVarint();return l%2==1?(l+1)/-2:l/2}readBoolean(){return!!this.readVarint()}readString(){let l=this.readVarint()+this.pos,u=this.pos;return this.pos=l,l-u>=12&&_ot?_ot.decode(this.buf.subarray(u,l)):(function(m,A,T){let M=\"\",P=A;for(;P<T;){let L=m[P],O,V,F,X=null,j=L>239?4:L>223?3:L>191?2:1;if(P+j>T)break;j===1?L<128&&(X=L):j===2?(O=m[P+1],(192&O)==128&&(X=(31&L)<<6|63&O,X<=127&&(X=null))):j===3?(O=m[P+1],V=m[P+2],(192&O)==128&&(192&V)==128&&(X=(15&L)<<12|(63&O)<<6|63&V,(X<=2047||X>=55296&&X<=57343)&&(X=null))):j===4&&(O=m[P+1],V=m[P+2],F=m[P+3],(192&O)==128&&(192&V)==128&&(192&F)==128&&(X=(15&L)<<18|(63&O)<<12|(63&V)<<6|63&F,(X<=65535||X>=1114112)&&(X=null))),X===null?(X=65533,j=1):X>65535&&(X-=65536,M+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),M+=String.fromCharCode(X),P+=j}return M})(this.buf,u,l)}readBytes(){let l=this.readVarint()+this.pos,u=this.buf.subarray(this.pos,l);return this.pos=l,u}readPackedVarint(l=[],u){let m=this.readPackedEnd();for(;this.pos<m;)l.push(this.readVarint(u));return l}readPackedSVarint(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readSVarint());return l}readPackedBoolean(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readBoolean());return l}readPackedFloat(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readFloat());return l}readPackedDouble(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readDouble());return l}readPackedFixed32(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readFixed32());return l}readPackedSFixed32(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readSFixed32());return l}readPackedFixed64(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readFixed64());return l}readPackedSFixed64(l=[]){let u=this.readPackedEnd();for(;this.pos<u;)l.push(this.readSFixed64());return l}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(l){let u=7&l;if(u===0)for(;this.buf[this.pos++]>127;);else if(u===2)this.pos=this.readVarint()+this.pos;else if(u===5)this.pos+=4;else{if(u!==1)throw new Error(`Unimplemented type: ${u}`);this.pos+=8}}writeTag(l,u){this.writeVarint(l<<3|u)}realloc(l){let u=this.length||16;for(;u<this.pos+l;)u*=2;if(u!==this.length){let m=new Uint8Array(u);m.set(this.buf),this.buf=m,this.dataView=new DataView(m.buffer),this.length=u}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(l){this.realloc(4),this.dataView.setInt32(this.pos,l,!0),this.pos+=4}writeSFixed32(l){this.realloc(4),this.dataView.setInt32(this.pos,l,!0),this.pos+=4}writeFixed64(l){this.realloc(8),this.dataView.setInt32(this.pos,-1&l,!0),this.dataView.setInt32(this.pos+4,Math.floor(l*yot),!0),this.pos+=8}writeSFixed64(l){this.realloc(8),this.dataView.setInt32(this.pos,-1&l,!0),this.dataView.setInt32(this.pos+4,Math.floor(l*yot),!0),this.pos+=8}writeVarint(l){(l=+l||0)>268435455||l<0?(function(u,m){let A,T;if(u>=0?(A=u%4294967296|0,T=u/4294967296|0):(A=~(-u%4294967296),T=~(-u/4294967296),4294967295^A?A=A+1|0:(A=0,T=T+1|0)),u>=18446744073709552e3||u<-18446744073709552e3)throw new Error(\"Given varint doesn't fit into 10 bytes\");m.realloc(10),(function(M,P,L){L.buf[L.pos++]=127&M|128,M>>>=7,L.buf[L.pos++]=127&M|128,M>>>=7,L.buf[L.pos++]=127&M|128,M>>>=7,L.buf[L.pos++]=127&M|128,L.buf[L.pos]=127&(M>>>=7)})(A,0,m),(function(M,P){let L=(7&M)<<4;P.buf[P.pos++]|=L|((M>>>=3)?128:0),M&&(P.buf[P.pos++]=127&M|((M>>>=7)?128:0),M&&(P.buf[P.pos++]=127&M|((M>>>=7)?128:0),M&&(P.buf[P.pos++]=127&M|((M>>>=7)?128:0),M&&(P.buf[P.pos++]=127&M|((M>>>=7)?128:0),M&&(P.buf[P.pos++]=127&M)))))})(T,m)})(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))}writeSVarint(l){this.writeVarint(l<0?2*-l-1:2*l)}writeBoolean(l){this.writeVarint(+l)}writeString(l){l=String(l),this.realloc(4*l.length),this.pos++;let u=this.pos;this.pos=(function(A,T,M){for(let P,L,O=0;O<T.length;O++){if(P=T.charCodeAt(O),P>55295&&P<57344){if(!L){P>56319||O+1===T.length?(A[M++]=239,A[M++]=191,A[M++]=189):L=P;continue}if(P<56320){A[M++]=239,A[M++]=191,A[M++]=189,L=P;continue}P=L-55296<<10|P-56320|65536,L=null}else L&&(A[M++]=239,A[M++]=191,A[M++]=189,L=null);P<128?A[M++]=P:(P<2048?A[M++]=P>>6|192:(P<65536?A[M++]=P>>12|224:(A[M++]=P>>18|240,A[M++]=P>>12&63|128),A[M++]=P>>6&63|128),A[M++]=63&P|128)}return M})(this.buf,l,this.pos);let m=this.pos-u;m>=128&&vot(u,m,this),this.pos=u-1,this.writeVarint(m),this.pos+=m}writeFloat(l){this.realloc(4),this.dataView.setFloat32(this.pos,l,!0),this.pos+=4}writeDouble(l){this.realloc(8),this.dataView.setFloat64(this.pos,l,!0),this.pos+=8}writeBytes(l){let u=l.length;this.writeVarint(u),this.realloc(u);for(let m=0;m<u;m++)this.buf[this.pos++]=l[m]}writeRawMessage(l,u){this.pos++;let m=this.pos;l(u,this);let A=this.pos-m;A>=128&&vot(m,A,this),this.pos=m-1,this.writeVarint(A),this.pos+=A}writeMessage(l,u,m){this.writeTag(l,2),this.writeRawMessage(u,m)}writePackedVarint(l,u){u.length&&this.writeMessage(l,iRt,u)}writePackedSVarint(l,u){u.length&&this.writeMessage(l,nRt,u)}writePackedBoolean(l,u){u.length&&this.writeMessage(l,aRt,u)}writePackedFloat(l,u){u.length&&this.writeMessage(l,oRt,u)}writePackedDouble(l,u){u.length&&this.writeMessage(l,sRt,u)}writePackedFixed32(l,u){u.length&&this.writeMessage(l,lRt,u)}writePackedSFixed32(l,u){u.length&&this.writeMessage(l,cRt,u)}writePackedFixed64(l,u){u.length&&this.writeMessage(l,uRt,u)}writePackedSFixed64(l,u){u.length&&this.writeMessage(l,hRt,u)}writeBytesField(l,u){this.writeTag(l,2),this.writeBytes(u)}writeFixed32Field(l,u){this.writeTag(l,5),this.writeFixed32(u)}writeSFixed32Field(l,u){this.writeTag(l,5),this.writeSFixed32(u)}writeFixed64Field(l,u){this.writeTag(l,1),this.writeFixed64(u)}writeSFixed64Field(l,u){this.writeTag(l,1),this.writeSFixed64(u)}writeVarintField(l,u){this.writeTag(l,0),this.writeVarint(u)}writeSVarintField(l,u){this.writeTag(l,0),this.writeSVarint(u)}writeStringField(l,u){this.writeTag(l,2),this.writeString(u)}writeFloatField(l,u){this.writeTag(l,5),this.writeFloat(u)}writeDoubleField(l,u){this.writeTag(l,1),this.writeDouble(u)}writeBooleanField(l,u){this.writeVarintField(l,+u)}}function V2(d,l,u){return u?4294967296*l+(d>>>0):4294967296*(l>>>0)+(d>>>0)}function vot(d,l,u){let m=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));u.realloc(m);for(let A=u.pos-1;A>=d;A--)u.buf[A+m]=u.buf[A]}function iRt(d,l){for(let u=0;u<d.length;u++)l.writeVarint(d[u])}function nRt(d,l){for(let u=0;u<d.length;u++)l.writeSVarint(d[u])}function oRt(d,l){for(let u=0;u<d.length;u++)l.writeFloat(d[u])}function sRt(d,l){for(let u=0;u<d.length;u++)l.writeDouble(d[u])}function aRt(d,l){for(let u=0;u<d.length;u++)l.writeBoolean(d[u])}function lRt(d,l){for(let u=0;u<d.length;u++)l.writeFixed32(d[u])}function cRt(d,l){for(let u=0;u<d.length;u++)l.writeSFixed32(d[u])}function uRt(d,l){for(let u=0;u<d.length;u++)l.writeFixed64(d[u])}function hRt(d,l){for(let u=0;u<d.length;u++)l.writeSFixed64(d[u])}function dRt(d,l,u){d===1&&u.readMessage(fRt,l)}function fRt(d,l,u){if(d===3){let{id:m,bitmap:A,width:T,height:M,left:P,top:L,advance:O}=u.readMessage(pRt,{});l.push({id:m,bitmap:new RM({width:T+6,height:M+6},A),metrics:{width:T,height:M,left:P,top:L,advance:O}})}}function pRt(d,l,u){d===1?l.id=u.readVarint():d===2?l.bitmap=u.readBytes():d===3?l.width=u.readVarint():d===4?l.height=u.readVarint():d===5?l.left=u.readSVarint():d===6?l.top=u.readSVarint():d===7&&(l.advance=u.readVarint())}function bot(d){let l=0,u=0;for(let M of d)l+=M.w*M.h,u=Math.max(u,M.w);d.sort(((M,P)=>P.h-M.h));let m=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(l/.95)),u),h:1/0}],A=0,T=0;for(let M of d)for(let P=m.length-1;P>=0;P--){let L=m[P];if(!(M.w>L.w||M.h>L.h)){if(M.x=L.x,M.y=L.y,T=Math.max(T,M.y+M.h),A=Math.max(A,M.x+M.w),M.w===L.w&&M.h===L.h){let O=m.pop();O&&P<m.length&&(m[P]=O)}else M.h===L.h?(L.x+=M.w,L.w-=M.w):M.w===L.w?(L.y+=M.h,L.h-=M.h):(m.push({x:L.x+M.w,y:L.y,w:L.w-M.w,h:M.h}),L.y+=M.h,L.h-=M.h);break}}return{w:A,h:T,fill:l/(A*T)||0}}class gj{constructor(l,{pixelRatio:u,version:m,stretchX:A,stretchY:T,content:M,textFitWidth:P,textFitHeight:L}){this.paddedRect=l,this.pixelRatio=u,this.stretchX=A,this.stretchY=T,this.content=M,this.version=m,this.textFitWidth=P,this.textFitHeight=L}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class xot{constructor(l,u){let m={},A={};this.haveRenderCallbacks=[];let T=[];this.addImages(l,m,T),this.addImages(u,A,T);let{w:M,h:P}=bot(T),L=new wc({width:M||1,height:P||1});for(let O in l){let V=l[O],F=m[O].paddedRect;wc.copy(V.data,L,{x:0,y:0},{x:F.x+1,y:F.y+1},V.data)}for(let O in u){let V=u[O],F=A[O].paddedRect,X=F.x+1,j=F.y+1,nt=V.data.width,st=V.data.height;wc.copy(V.data,L,{x:0,y:0},{x:X,y:j},V.data),wc.copy(V.data,L,{x:0,y:st-1},{x:X,y:j-1},{width:nt,height:1}),wc.copy(V.data,L,{x:0,y:0},{x:X,y:j+st},{width:nt,height:1}),wc.copy(V.data,L,{x:nt-1,y:0},{x:X-1,y:j},{width:1,height:st}),wc.copy(V.data,L,{x:0,y:0},{x:X+nt,y:j},{width:1,height:st})}this.image=L,this.iconPositions=m,this.patternPositions=A}addImages(l,u,m){for(let A in l){let T=l[A],M={x:0,y:0,w:T.data.width+2,h:T.data.height+2};m.push(M),u[A]=new gj(M,T),T.hasRenderCallback&&this.haveRenderCallbacks.push(A)}}patchUpdatedImages(l,u){l.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let m in l.updatedImages)this.patchUpdatedImage(this.iconPositions[m],l.getImage(m),u),this.patchUpdatedImage(this.patternPositions[m],l.getImage(m),u)}patchUpdatedImage(l,u,m){if(!l||!u||l.version===u.version)return;l.version=u.version;let[A,T]=l.tl;m.update(u.data,void 0,{x:A,y:T})}}var _y;function TR(d,l,u,m,A,T,M,P,L,O,V,F,X,j,nt){let st=U2.fromFeature(d,A),pt;F===n.aw.vertical&&st.verticalizePunctuation();let mt=st.determineLineBreaks(O,T,l,m,j),{processBidirectionalText:vt,processStyledBidirectionalText:At}=ad;if(vt&&st.sections.length===1){pt=[],mt=mt.map((qt=>st.toCodeUnitIndex(qt)));let Bt=vt(st.toString(),mt);for(let qt of Bt){let te=[...qt].map((()=>0));pt.push(new U2(qt,st.sections,te))}}else if(At){pt=[],mt=mt.map((he=>st.toCodeUnitIndex(he)));let Bt=0,qt=[];for(let he of st.text)qt.push(...Array(he.length).fill(st.sectionIndex[Bt])),Bt++;let te=At(st.text,qt,mt);for(let he of te){let fe=[],Se=\"\";for(let ve of he[0])fe.push(he[1][Se.length]),Se+=ve;pt.push(new U2(he[0],st.sections,fe))}}else pt=(function(Bt,qt){let te=[],he=0;for(let fe of qt)te.push(Bt.substring(he,fe)),he=fe;return he<Bt.length()&&te.push(Bt.substring(he,Bt.length())),te})(st,mt);let wt=[],St={positionedLines:wt,text:st.toString(),top:V[1],bottom:V[1],left:V[0],right:V[0],writingMode:F,iconsInText:!1,verticalizable:!1};return(function(Bt,qt,te,he,fe,Se,ve,be,Ae,Ze,nr,er){let Xe=0,Lr=0,$i=0,rn=0,yn=be===\"right\"?1:be===\"left\"?0:.5,Xa=oa/er,Oo=0;for(let co of fe){co.trim();let Ta=co.getMaxScale(),bl={positionedGlyphs:[],lineOffset:0};Bt.positionedLines[Oo]=bl;let xl=bl.positionedGlyphs,Tc=0;if(!co.length()){Lr+=Se,++Oo;continue}let Za=mRt(he,co,Xa),Sc=0;for(let la of co.text){let wo=co.getSection(Sc),ms=la.codePointAt(0),Lo=gRt(Ae,nr,ms),ca={glyph:ms,imageName:null,x:Xe,y:Lr+-17,vertical:Lo,scale:1,fontStack:\"\",sectionIndex:co.getSectionIndex(Sc),metrics:null,rect:null},ig;if(\"fontStack\"in wo){if(ig=ARt(wo,ms,Lo,Za,qt,te),!ig)continue;ca.fontStack=wo.fontStack}else{if(Bt.iconsInText=!0,wo.scale*=Xa,ig=yRt(wo,Lo,Ta,Za,he),!ig)continue;Tc=Math.max(Tc,ig.imageOffset),ca.imageName=wo.imageName}let{rect:Pf,metrics:XM,baselineOffset:My}=ig;ca.y+=My,ca.scale=wo.scale,ca.metrics=XM,ca.rect=Pf,xl.push(ca),Lo?(Bt.verticalizable=!0,Xe+=(\"imageName\"in wo?XM.advance:oa)*wo.scale+Ze):Xe+=XM.advance*wo.scale+Ze,Sc++}xl.length!==0&&($i=Math.max(Xe-Ze,$i),_Rt(xl,0,xl.length-1,yn)),Xe=0,bl.lineOffset=Math.max(Tc,(Ta-1)*oa);let hd=Se*Ta+Tc;Lr+=hd,rn=Math.max(hd,rn),++Oo}let{horizontalAlign:zs,verticalAlign:aa}=Aj(ve);(function(co,Ta,bl,xl,Tc,Za,Sc,hd,la){let wo=(Ta-bl)*Tc,ms=0;ms=Za!==Sc?-hd*xl- -17:-xl*la*Sc+.5*Sc;for(let Lo of co)for(let ca of Lo.positionedGlyphs)ca.x+=wo,ca.y+=ms})(Bt.positionedLines,yn,zs,aa,$i,rn,Se,Lr,fe.length),Bt.top+=-aa*Lr,Bt.bottom=Bt.top+Lr,Bt.left+=-zs*$i,Bt.right=Bt.left+$i})(St,l,u,m,pt,M,P,L,F,O,X,nt),!(function(Bt){for(let qt of Bt)if(qt.positionedGlyphs.length!==0)return!1;return!0})(wt)&&St}function Aj(d){let l=.5,u=.5;switch(d){case\"right\":case\"top-right\":case\"bottom-right\":l=1;break;case\"left\":case\"top-left\":case\"bottom-left\":l=0}switch(d){case\"bottom\":case\"bottom-right\":case\"bottom-left\":u=1;break;case\"top\":case\"top-right\":case\"top-left\":u=0}return{horizontalAlign:l,verticalAlign:u}}function mRt(d,l,u){let m=l.getMaxScale()*oa,{maxImageWidth:A,maxImageHeight:T}=l.getMaxImageSize(d),M=Math.max(m,T*u);return{verticalLineContentWidth:Math.max(m,A*u),horizontalLineContentHeight:M}}function wot(d){switch(d){case\"top\":return 0;case\"center\":return .5;default:return 1}}function gRt(d,l,u){return!(d===n.aw.horizontal||!l&&!od(u)||l&&(M2(u)||(m=u,/\\p{sc=Arab}/u.test(String.fromCodePoint(m)))));var m}function ARt(d,l,u,m,A,T){let M=T[d.fontStack],P=(function(O,V,F,X){if(O&&O.rect)return O;let j=V[F.fontStack],nt=j&&j[X];return nt?{rect:null,metrics:nt.metrics}:null})(M&&M[l],A,d,l);if(P===null)return null;let L;if(u)L=m.verticalLineContentWidth-d.scale*oa;else{let O=wot(d.verticalAlign);L=(m.horizontalLineContentHeight-d.scale*oa)*O}return{rect:P.rect,metrics:P.metrics,baselineOffset:L}}function yRt(d,l,u,m,A){let T=A[d.imageName];if(!T)return null;let M=T.paddedRect,P=T.displaySize,L={width:P[0],height:P[1],left:1,top:-3,advance:l?P[1]:P[0]},O;if(l)O=m.verticalLineContentWidth-P[1]*d.scale;else{let V=wot(d.verticalAlign);O=(m.horizontalLineContentHeight-P[1]*d.scale)*V}return{rect:M,metrics:L,baselineOffset:O,imageOffset:(l?P[0]:P[1])*d.scale-oa*u}}function _Rt(d,l,u,m){if(m===0)return;let A=d[u],T=(d[u].x+A.metrics.advance*A.scale)*m;for(let M=l;M<=u;M++)d[M].x-=T}function vRt(d,l,u){let{horizontalAlign:m,verticalAlign:A}=Aj(u),T=l[0]-d.displaySize[0]*m,M=l[1]-d.displaySize[1]*A;return{image:d,top:M,bottom:M+d.displaySize[1],left:T,right:T+d.displaySize[0]}}function Tot(d){var l,u;let m=d.left,A=d.top,T=d.right-m,M=d.bottom-A,P=(l=d.image.textFitWidth)!==null&&l!==void 0?l:\"stretchOrShrink\",L=(u=d.image.textFitHeight)!==null&&u!==void 0?u:\"stretchOrShrink\",O=(d.image.content[2]-d.image.content[0])/(d.image.content[3]-d.image.content[1]);if(L===\"proportional\"){if(P===\"stretchOnly\"&&T/M<O||P===\"proportional\"){let V=Math.ceil(M*O);m*=V/T,T=V}}else if(P===\"proportional\"&&L===\"stretchOnly\"&&O!==0&&T/M>O){let V=Math.ceil(T/O);A*=V/M,M=V}return{x1:m,y1:A,x2:m+T,y2:A+M}}function Sot(d,l,u,m,A,T){let M=d.image,P;if(M.content){let pt=M.content,mt=M.pixelRatio||1;P=[pt[0]/mt,pt[1]/mt,M.displaySize[0]-pt[2]/mt,M.displaySize[1]-pt[3]/mt]}let L=l.left*T,O=l.right*T,V,F,X,j;u===\"width\"||u===\"both\"?(j=A[0]+L-m[3],F=A[0]+O+m[1]):(j=A[0]+(L+O-M.displaySize[0])/2,F=j+M.displaySize[0]);let nt=l.top*T,st=l.bottom*T;return u===\"height\"||u===\"both\"?(V=A[1]+nt-m[0],X=A[1]+st+m[2]):(V=A[1]+(nt+st-M.displaySize[1])/2,X=V+M.displaySize[1]),{image:M,top:V,right:F,bottom:X,left:j,collisionPadding:P}}ir(\"ImagePosition\",gj),ir(\"ImageAtlas\",xot),n.aw=void 0,(_y=n.aw||(n.aw={}))[_y.none=0]=\"none\",_y[_y.horizontal=1]=\"horizontal\",_y[_y.vertical=2]=\"vertical\",_y[_y.horizontalOnly=3]=\"horizontalOnly\";let eg=128,vy=32640;function Mot(d,l){let{expression:u}=l;if(u.kind===\"constant\")return{kind:\"constant\",layoutSize:u.evaluate(new hn(d+1))};if(u.kind===\"source\")return{kind:\"source\"};{let{zoomStops:m,interpolationType:A}=u,T=0;for(;T<m.length&&m[T]<=d;)T++;T=Math.max(0,T-1);let M=T;for(;M<m.length&&m[M]<d+1;)M++;M=Math.min(m.length-1,M);let P=m[T],L=m[M];return u.kind===\"composite\"?{kind:\"composite\",minZoom:P,maxZoom:L,interpolationType:A}:{kind:\"camera\",minZoom:P,maxZoom:L,minSize:u.evaluate(new hn(P)),maxSize:u.evaluate(new hn(L)),interpolationType:A}}}function yj(d,l,u){let m=\"never\",A=d.get(l);return A?m=A:d.get(u)&&(m=\"always\"),m}let bRt=[{name:\"a_fade_opacity\",components:1,type:\"Uint8\",offset:0}];function SR(d,l,u,m,A,T,M,P,L,O,V,F,X){let j=P?Math.min(vy,Math.round(P[0])):0,nt=P?Math.min(vy,Math.round(P[1])):0;d.emplaceBack(l,u,Math.round(32*m),Math.round(32*A),T,M,(j<<1)+(L?1:0),nt,16*O,16*V,256*F,256*X)}function _j(d,l,u){d.emplaceBack(l.x,l.y,u),d.emplaceBack(l.x,l.y,u),d.emplaceBack(l.x,l.y,u),d.emplaceBack(l.x,l.y,u)}function xRt(d){for(let l of d.sections)if(E2(l.text))return!0;return!1}class vj{constructor(l){this.layoutVertexArray=new Xt,this.indexArray=new Le,this.programConfigurations=l,this.segments=new ur,this.dynamicLayoutVertexArray=new Kt,this.opacityVertexArray=new de,this.hasVisibleVertices=!1,this.placedSymbolArray=new G}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(l,u,m,A){this.isEmpty()||(m&&(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Xkt.members),this.indexBuffer=l.createIndexBuffer(this.indexArray,u),this.dynamicLayoutVertexBuffer=l.createVertexBuffer(this.dynamicLayoutVertexArray,Zkt.members,!0),this.opacityVertexBuffer=l.createVertexBuffer(this.opacityVertexArray,bRt,!0),this.opacityVertexBuffer.itemSize=1),(m||A)&&this.programConfigurations.upload(l))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}ir(\"SymbolBuffers\",vj);class bj{constructor(l,u,m){this.layoutVertexArray=new l,this.layoutAttributes=u,this.indexArray=new m,this.segments=new ur,this.collisionVertexArray=new me}upload(l){this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=l.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=l.createVertexBuffer(this.collisionVertexArray,Kkt.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}ir(\"CollisionBuffers\",bj);class j2{constructor(l){this.collisionBoxArray=l.collisionBoxArray,this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((M=>M.id)),this.index=l.index,this.pixelRatio=l.pixelRatio,this.sourceLayerIndex=l.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Mot(this.zoom,u[\"text-size\"]),this.iconSizeData=Mot(this.zoom,u[\"icon-size\"]);let m=this.layers[0].layout,A=m.get(\"symbol-sort-key\"),T=m.get(\"symbol-z-order\");this.canOverlap=yj(m,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||yj(m,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||m.get(\"text-ignore-placement\")||m.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=T!==\"viewport-y\"&&!A.isConstant(),this.sortFeaturesByY=(T===\"viewport-y\"||T===\"auto\"&&!this.sortFeaturesByKey)&&this.canOverlap,m.get(\"symbol-placement\")===\"point\"&&(this.writingModes=m.get(\"text-writing-mode\").map((M=>n.aw[M]))),this.stateDependentLayerIds=this.layers.filter((M=>M.isStateDependent())).map((M=>M.id)),this.sourceID=l.sourceID}createArrays(){this.text=new vj(new se(this.layers,this.zoom,(l=>/^text/.test(l)))),this.icon=new vj(new se(this.layers,this.zoom,(l=>/^icon/.test(l)))),this.glyphOffsetArray=new it,this.lineVertexArray=new ct,this.symbolInstances=new K,this.textAnchorOffsets=new gt}calculateGlyphDependencies(l,u,m,A,T){for(let M of l)if(u[M.codePointAt(0)]=!0,(m||A)&&T){let P=$M[M];P&&(u[P.codePointAt(0)]=!0)}}populate(l,u,m){let A=this.layers[0],T=A.layout,M=T.get(\"text-font\"),P=T.get(\"text-field\"),L=T.get(\"icon-image\"),O=(P.value.kind!==\"constant\"||P.value.value instanceof yo&&!P.value.value.isEmpty()||P.value.value.toString().length>0)&&(M.value.kind!==\"constant\"||M.value.value.length>0),V=L.value.kind!==\"constant\"||!!L.value.value||Object.keys(L.parameters).length>0,F=T.get(\"symbol-sort-key\");if(this.features=[],!O&&!V)return;let X=u.iconDependencies,j=u.glyphDependencies,nt=u.availableImages,st=new hn(this.zoom);for(let{feature:pt,id:mt,index:vt,sourceLayerIndex:At}of l){let wt=A._featureFilter.needGeometry,St=Or(pt,wt);if(!A._featureFilter.filter(st,St,m))continue;let Bt,qt;if(wt||(St.geometry=cr(pt)),O){let he=A.getValueAndResolveTokens(\"text-field\",St,m,nt),fe=yo.factory(he),Se=this.hasRTLText=this.hasRTLText||xRt(fe);(!Se||ad.getRTLTextPluginStatus()===\"unavailable\"||Se&&ad.isParsed())&&(Bt=Jkt(fe,A,St))}if(V){let he=A.getValueAndResolveTokens(\"icon-image\",St,m,nt);qt=he instanceof ea?he:ea.fromString(he)}if(!Bt&&!qt)continue;let te=this.sortFeaturesByKey?F.evaluate(St,{},m):void 0;if(this.features.push({id:mt,text:Bt,icon:qt,index:vt,sourceLayerIndex:At,geometry:St.geometry,properties:pt.properties,type:zM.types[pt.type],sortKey:te}),qt&&(X[qt.name]=!0),Bt){let he=M.evaluate(St,{},m).join(\",\"),fe=T.get(\"text-rotation-alignment\")!==\"viewport\"&&T.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(n.aw.vertical)>=0;for(let Se of Bt.sections)if(Se.image)X[Se.image.name]=!0;else{let ve=$m(Bt.toString()),be=Se.fontStack||he,Ae=j[be]=j[be]||{};this.calculateGlyphDependencies(Se.text,Ae,fe,this.allowVerticalPlacement,ve)}}}T.get(\"symbol-placement\")===\"line\"&&(this.features=(function(pt){let mt={},vt={},At=[],wt=0;function St(he){At.push(pt[he]),wt++}function Bt(he,fe,Se){let ve=vt[he];return delete vt[he],vt[fe]=ve,At[ve].geometry[0].pop(),At[ve].geometry[0]=At[ve].geometry[0].concat(Se[0]),ve}function qt(he,fe,Se){let ve=mt[fe];return delete mt[fe],mt[he]=ve,At[ve].geometry[0].shift(),At[ve].geometry[0]=Se[0].concat(At[ve].geometry[0]),ve}function te(he,fe,Se){let ve=Se?fe[0][fe[0].length-1]:fe[0][0];return`${he}:${ve.x}:${ve.y}`}for(let he=0;he<pt.length;he++){let fe=pt[he],Se=fe.geometry,ve=fe.text?fe.text.toString():null;if(!ve){St(he);continue}let be=te(ve,Se),Ae=te(ve,Se,!0);if(be in vt&&Ae in mt&&vt[be]!==mt[Ae]){let Ze=qt(be,Ae,Se),nr=Bt(be,Ae,At[Ze].geometry);delete mt[be],delete vt[Ae],vt[te(ve,At[nr].geometry,!0)]=nr,At[Ze].geometry=null}else be in vt?Bt(be,Ae,Se):Ae in mt?qt(be,Ae,Se):(St(he),mt[be]=wt-1,vt[Ae]=wt-1)}return At.filter((he=>he.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((pt,mt)=>pt.sortKey-mt.sortKey))}update(l,u,m){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(l,u,this.layers,{imagePositions:m}),this.icon.programConfigurations.updatePaintArrays(l,u,this.layers,{imagePositions:m}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(l){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(l),this.iconCollisionBox.upload(l)),this.text.upload(l,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(l,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(l,u){let m=this.lineVertexArray.length;if(l.segment!==void 0){let A=l.dist(u[l.segment+1]),T=l.dist(u[l.segment]),M={};for(let P=l.segment+1;P<u.length;P++)M[P]={x:u[P].x,y:u[P].y,tileUnitDistanceFromAnchor:A},P<u.length-1&&(A+=u[P+1].dist(u[P]));for(let P=l.segment||0;P>=0;P--)M[P]={x:u[P].x,y:u[P].y,tileUnitDistanceFromAnchor:T},P>0&&(T+=u[P-1].dist(u[P]));for(let P=0;P<u.length;P++){let L=M[P];this.lineVertexArray.emplaceBack(L.x,L.y,L.tileUnitDistanceFromAnchor)}}return{lineStartIndex:m,lineLength:this.lineVertexArray.length-m}}addSymbols(l,u,m,A,T,M,P,L,O,V,F,X){let j=l.indexArray,nt=l.layoutVertexArray,st=l.segments.prepareSegment(4*u.length,nt,j,this.canOverlap?M.sortKey:void 0),pt=this.glyphOffsetArray.length,mt=st.vertexLength,vt=this.allowVerticalPlacement&&P===n.aw.vertical?Math.PI/2:0,At=M.text&&M.text.sections;for(let wt=0;wt<u.length;wt++){let{tl:St,tr:Bt,bl:qt,br:te,tex:he,pixelOffsetTL:fe,pixelOffsetBR:Se,minFontScaleX:ve,minFontScaleY:be,glyphOffset:Ae,isSDF:Ze,sectionIndex:nr}=u[wt],er=st.vertexLength,Xe=Ae[1];SR(nt,L.x,L.y,St.x,Xe+St.y,he.x,he.y,m,Ze,fe.x,fe.y,ve,be),SR(nt,L.x,L.y,Bt.x,Xe+Bt.y,he.x+he.w,he.y,m,Ze,Se.x,fe.y,ve,be),SR(nt,L.x,L.y,qt.x,Xe+qt.y,he.x,he.y+he.h,m,Ze,fe.x,Se.y,ve,be),SR(nt,L.x,L.y,te.x,Xe+te.y,he.x+he.w,he.y+he.h,m,Ze,Se.x,Se.y,ve,be),_j(l.dynamicLayoutVertexArray,L,vt),j.emplaceBack(er,er+2,er+1),j.emplaceBack(er+1,er+2,er+3),st.vertexLength+=4,st.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ae[0]),wt!==u.length-1&&nr===u[wt+1].sectionIndex||l.programConfigurations.populatePaintArrays(nt.length,M,M.index,{imagePositions:{},canonical:X,formattedSection:At&&At[nr]})}l.placedSymbolArray.emplaceBack(L.x,L.y,pt,this.glyphOffsetArray.length-pt,mt,O,V,L.segment,m?m[0]:0,m?m[1]:0,A[0],A[1],P,0,!1,0,F)}_addCollisionDebugVertex(l,u,m,A,T,M){return u.emplaceBack(0,0),l.emplaceBack(m.x,m.y,A,T,Math.round(M.x),Math.round(M.y))}addCollisionDebugVertices(l,u,m,A,T,M,P){let L=T.segments.prepareSegment(4,T.layoutVertexArray,T.indexArray),O=L.vertexLength,V=T.layoutVertexArray,F=T.collisionVertexArray,X=P.anchorX,j=P.anchorY;this._addCollisionDebugVertex(V,F,M,X,j,new s(l,u)),this._addCollisionDebugVertex(V,F,M,X,j,new s(m,u)),this._addCollisionDebugVertex(V,F,M,X,j,new s(m,A)),this._addCollisionDebugVertex(V,F,M,X,j,new s(l,A)),L.vertexLength+=4;let nt=T.indexArray;nt.emplaceBack(O,O+1),nt.emplaceBack(O+1,O+2),nt.emplaceBack(O+2,O+3),nt.emplaceBack(O+3,O),L.primitiveLength+=4}addDebugCollisionBoxes(l,u,m,A){for(let T=l;T<u;T++){let M=this.collisionBoxArray.get(T);this.addCollisionDebugVertices(M.x1,M.y1,M.x2,M.y2,A?this.textCollisionBox:this.iconCollisionBox,M.anchorPoint,m)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new bj(le,fot.members,$e),this.iconCollisionBox=new bj(le,fot.members,$e);for(let l=0;l<this.symbolInstances.length;l++){let u=this.symbolInstances.get(l);this.addDebugCollisionBoxes(u.textBoxStartIndex,u.textBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.iconBoxStartIndex,u.iconBoxEndIndex,u,!1),this.addDebugCollisionBoxes(u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u,!1)}}_deserializeCollisionBoxesForSymbol(l,u,m,A,T,M,P,L,O){let V={};for(let F=u;F<m;F++){let X=l.get(F);V.textBox={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2,anchorPointX:X.anchorPointX,anchorPointY:X.anchorPointY},V.textFeatureIndex=X.featureIndex;break}for(let F=A;F<T;F++){let X=l.get(F);V.verticalTextBox={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2,anchorPointX:X.anchorPointX,anchorPointY:X.anchorPointY},V.verticalTextFeatureIndex=X.featureIndex;break}for(let F=M;F<P;F++){let X=l.get(F);V.iconBox={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2,anchorPointX:X.anchorPointX,anchorPointY:X.anchorPointY},V.iconFeatureIndex=X.featureIndex;break}for(let F=L;F<O;F++){let X=l.get(F);V.verticalIconBox={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2,anchorPointX:X.anchorPointX,anchorPointY:X.anchorPointY},V.verticalIconFeatureIndex=X.featureIndex;break}return V}deserializeCollisionBoxes(l){this.collisionArrays=[];for(let u=0;u<this.symbolInstances.length;u++){let m=this.symbolInstances.get(u);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(l,m.textBoxStartIndex,m.textBoxEndIndex,m.verticalTextBoxStartIndex,m.verticalTextBoxEndIndex,m.iconBoxStartIndex,m.iconBoxEndIndex,m.verticalIconBoxStartIndex,m.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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(l,u){let m=l.placedSymbolArray.get(u),A=m.vertexStartIndex+4*m.numGlyphs;for(let T=m.vertexStartIndex;T<A;T+=4)l.indexArray.emplaceBack(T,T+2,T+1),l.indexArray.emplaceBack(T+1,T+2,T+3)}getSortedSymbolIndexes(l){if(this.sortedAngle===l&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let u=Math.sin(l),m=Math.cos(l),A=[],T=[],M=[];for(let P=0;P<this.symbolInstances.length;++P){M.push(P);let L=this.symbolInstances.get(P);A.push(0|Math.round(u*L.anchorX+m*L.anchorY)),T.push(L.featureIndex)}return M.sort(((P,L)=>A[P]-A[L]||T[L]-T[P])),M}addToSortKeyRanges(l,u){let m=this.sortKeyRanges[this.sortKeyRanges.length-1];m&&m.sortKey===u?m.symbolInstanceEnd=l+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:l,symbolInstanceEnd:l+1})}sortFeatures(l){if(this.sortFeaturesByY&&this.sortedAngle!==l&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(l),this.sortedAngle=l,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let u of this.symbolInstanceIndexes){let m=this.symbolInstances.get(u);this.featureSortOrder.push(m.featureIndex),[m.rightJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.leftJustifiedTextSymbolIndex].forEach(((A,T,M)=>{A>=0&&M.indexOf(A)===T&&this.addIndicesForPlacedSymbol(this.text,A)})),m.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,m.verticalPlacedTextSymbolIndex),m.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.placedIconSymbolIndex),m.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,m.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Eot,Pot;ir(\"SymbolBucket\",j2,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]}),j2.MAX_GLYPHS=65535,j2.addDynamicAttributes=_j;var xj={get paint(){return Pot=Pot||new na({\"icon-opacity\":new Mr(Te.paint_symbol[\"icon-opacity\"]),\"icon-color\":new Mr(Te.paint_symbol[\"icon-color\"]),\"icon-halo-color\":new Mr(Te.paint_symbol[\"icon-halo-color\"]),\"icon-halo-width\":new Mr(Te.paint_symbol[\"icon-halo-width\"]),\"icon-halo-blur\":new Mr(Te.paint_symbol[\"icon-halo-blur\"]),\"icon-translate\":new fr(Te.paint_symbol[\"icon-translate\"]),\"icon-translate-anchor\":new fr(Te.paint_symbol[\"icon-translate-anchor\"]),\"text-opacity\":new Mr(Te.paint_symbol[\"text-opacity\"]),\"text-color\":new Mr(Te.paint_symbol[\"text-color\"],{runtimeType:fl,getOverride:d=>d.textColor,hasOverride:d=>!!d.textColor}),\"text-halo-color\":new Mr(Te.paint_symbol[\"text-halo-color\"]),\"text-halo-width\":new Mr(Te.paint_symbol[\"text-halo-width\"]),\"text-halo-blur\":new Mr(Te.paint_symbol[\"text-halo-blur\"]),\"text-translate\":new fr(Te.paint_symbol[\"text-translate\"]),\"text-translate-anchor\":new fr(Te.paint_symbol[\"text-translate-anchor\"])})},get layout(){return Eot=Eot||new na({\"symbol-placement\":new fr(Te.layout_symbol[\"symbol-placement\"]),\"symbol-spacing\":new fr(Te.layout_symbol[\"symbol-spacing\"]),\"symbol-avoid-edges\":new fr(Te.layout_symbol[\"symbol-avoid-edges\"]),\"symbol-sort-key\":new Mr(Te.layout_symbol[\"symbol-sort-key\"]),\"symbol-z-order\":new fr(Te.layout_symbol[\"symbol-z-order\"]),\"icon-allow-overlap\":new fr(Te.layout_symbol[\"icon-allow-overlap\"]),\"icon-overlap\":new fr(Te.layout_symbol[\"icon-overlap\"]),\"icon-ignore-placement\":new fr(Te.layout_symbol[\"icon-ignore-placement\"]),\"icon-optional\":new fr(Te.layout_symbol[\"icon-optional\"]),\"icon-rotation-alignment\":new fr(Te.layout_symbol[\"icon-rotation-alignment\"]),\"icon-size\":new Mr(Te.layout_symbol[\"icon-size\"]),\"icon-text-fit\":new fr(Te.layout_symbol[\"icon-text-fit\"]),\"icon-text-fit-padding\":new fr(Te.layout_symbol[\"icon-text-fit-padding\"]),\"icon-image\":new Mr(Te.layout_symbol[\"icon-image\"]),\"icon-rotate\":new Mr(Te.layout_symbol[\"icon-rotate\"]),\"icon-padding\":new Mr(Te.layout_symbol[\"icon-padding\"]),\"icon-keep-upright\":new fr(Te.layout_symbol[\"icon-keep-upright\"]),\"icon-offset\":new Mr(Te.layout_symbol[\"icon-offset\"]),\"icon-anchor\":new Mr(Te.layout_symbol[\"icon-anchor\"]),\"icon-pitch-alignment\":new fr(Te.layout_symbol[\"icon-pitch-alignment\"]),\"text-pitch-alignment\":new fr(Te.layout_symbol[\"text-pitch-alignment\"]),\"text-rotation-alignment\":new fr(Te.layout_symbol[\"text-rotation-alignment\"]),\"text-field\":new Mr(Te.layout_symbol[\"text-field\"]),\"text-font\":new Mr(Te.layout_symbol[\"text-font\"]),\"text-size\":new Mr(Te.layout_symbol[\"text-size\"]),\"text-max-width\":new Mr(Te.layout_symbol[\"text-max-width\"]),\"text-line-height\":new fr(Te.layout_symbol[\"text-line-height\"]),\"text-letter-spacing\":new Mr(Te.layout_symbol[\"text-letter-spacing\"]),\"text-justify\":new Mr(Te.layout_symbol[\"text-justify\"]),\"text-radial-offset\":new Mr(Te.layout_symbol[\"text-radial-offset\"]),\"text-variable-anchor\":new fr(Te.layout_symbol[\"text-variable-anchor\"]),\"text-variable-anchor-offset\":new Mr(Te.layout_symbol[\"text-variable-anchor-offset\"]),\"text-anchor\":new Mr(Te.layout_symbol[\"text-anchor\"]),\"text-max-angle\":new fr(Te.layout_symbol[\"text-max-angle\"]),\"text-writing-mode\":new fr(Te.layout_symbol[\"text-writing-mode\"]),\"text-rotate\":new Mr(Te.layout_symbol[\"text-rotate\"]),\"text-padding\":new fr(Te.layout_symbol[\"text-padding\"]),\"text-keep-upright\":new fr(Te.layout_symbol[\"text-keep-upright\"]),\"text-transform\":new Mr(Te.layout_symbol[\"text-transform\"]),\"text-offset\":new Mr(Te.layout_symbol[\"text-offset\"]),\"text-allow-overlap\":new fr(Te.layout_symbol[\"text-allow-overlap\"]),\"text-overlap\":new fr(Te.layout_symbol[\"text-overlap\"]),\"text-ignore-placement\":new fr(Te.layout_symbol[\"text-ignore-placement\"]),\"text-optional\":new fr(Te.layout_symbol[\"text-optional\"])})}};class Cot{constructor(l){if(l.property.overrides===void 0)throw new Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=l.property.overrides?l.property.overrides.runtimeType:$h,this.defaultValue=l}evaluate(l){if(l.formattedSection){let u=this.defaultValue.property.overrides;if(u&&u.hasOverride(l.formattedSection))return u.getOverride(l.formattedSection)}return l.feature&&l.featureState?this.defaultValue.evaluate(l.feature,l.featureState):this.defaultValue.property.specification.default}eachChild(l){this.defaultValue.isConstant()||l(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ir(\"FormatSectionOverride\",Cot,{omit:[\"defaultValue\"]});class MR extends yl{constructor(l,u){super(l,xj,u)}recalculate(l,u){if(super.recalculate(l,u),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\"){let m=this.layout.get(\"text-writing-mode\");if(m){let A=[];for(let T of m)A.indexOf(T)<0&&A.push(T);this.layout._values[\"text-writing-mode\"]=A}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(l,u,m,A){let T=this.layout.get(l).evaluate(u,{},m,A),M=this._unevaluatedLayout._values[l];return M.isDataDriven()||$p(M.value)||!T?T:(function(P,L){return L.replace(/{([^{}]+)}/g,((O,V)=>P&&V in P?String(P[V]):\"\"))})(u.properties,T)}createBucket(l){return new j2(l)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let l of xj.paint.overridableProperties){if(!MR.hasPaintOverride(this.layout,l))continue;let u=this.paint.get(l),m=new Cot(u),A=new Ns(m,u.property.specification),T=null;T=u.value.kind===\"constant\"||u.value.kind===\"source\"?new Zh(\"source\",A):new J_(\"composite\",A,u.value.zoomStops),this.paint._values[l]=new bc(u.property,T,u.parameters)}}_handleOverridablePaintPropertyUpdate(l,u,m){return!(!this.layout||u.isDataDriven()||m.isDataDriven())&&MR.hasPaintOverride(this.layout,l)}static hasPaintOverride(l,u){let m=l.get(\"text-field\"),A=xj.paint.properties[u],T=!1,M=P=>{for(let L of P)if(A.overrides&&A.overrides.hasOverride(L))return void(T=!0)};if(m.value.kind===\"constant\"&&m.value.value instanceof yo)M(m.value.value.sections);else if(m.value.kind===\"source\"||m.value.kind===\"composite\"){let P=O=>{T||(O instanceof ru&&Xn(O.value)===Rp?M(O.value.sections):O instanceof De?M(O.sections):O.eachChild(P))},L=m.value;L._styleExpression&&P(L._styleExpression.expression)}return T}}let Iot;var wRt={get paint(){return Iot=Iot||new na({\"background-color\":new fr(Te.paint_background[\"background-color\"]),\"background-pattern\":new I2(Te.paint_background[\"background-pattern\"]),\"background-opacity\":new fr(Te.paint_background[\"background-opacity\"])})}};class TRt extends yl{constructor(l,u){super(l,wRt,u)}}class SRt extends yl{constructor(l,u){super(l,{},u),this.onAdd=m=>{this.implementation.onAdd&&this.implementation.onAdd(m,m.painter.context.gl)},this.onRemove=m=>{this.implementation.onRemove&&this.implementation.onRemove(m,m.painter.context.gl)},this.implementation=l}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 MRt{constructor(l){this._methodToThrottle=l,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var l;this._triggered||(this._triggered=!0,(l=this._channel)===null||l===void 0||l.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let ERt={once:!0},wj=63710088e-1;class by{constructor(l,u){if(isNaN(l)||isNaN(u))throw new Error(`Invalid LngLat object: (${l}, ${u})`);if(this.lng=+l,this.lat=+u,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new by(Br(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(l){let u=Math.PI/180,m=this.lat*u,A=l.lat*u,T=Math.sin(m)*Math.sin(A)+Math.cos(m)*Math.cos(A)*Math.cos((l.lng-this.lng)*u);return wj*Math.acos(Math.min(T,1))}static convert(l){if(l instanceof by)return l;if(Array.isArray(l)&&(l.length===2||l.length===3))return new by(Number(l[0]),Number(l[1]));if(!Array.isArray(l)&&typeof l==\"object\"&&l!==null)return new by(Number(\"lng\"in l?l.lng:l.lon),Number(l.lat));throw new Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]\")}}let kot=2*Math.PI*wj;function Rot(d){return kot*Math.cos(d*Math.PI/180)}function Dot(d){return(180+d)/360}function Oot(d){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d*Math.PI/360)))/360}function Lot(d,l){return d/Rot(l)}function Bot(d){return 360*d-180}function ER(d){return 360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90}function Fot(d,l){return d*Rot(ER(l))}class GM{constructor(l,u,m=0){this.x=+l,this.y=+u,this.z=+m}static fromLngLat(l,u=0){let m=by.convert(l);return new GM(Dot(m.lng),Oot(m.lat),Lot(u,m.lat))}toLngLat(){return new by(Bot(this.x),ER(this.y))}toAltitude(){return Fot(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/kot*(l=ER(this.y),1/Math.cos(l*Math.PI/180));var l}}function Not(d,l,u){var m=2*Math.PI*6378137/256/Math.pow(2,u);return[d*m-2*Math.PI*6378137/2,l*m-2*Math.PI*6378137/2]}class Tj{constructor(l,u,m){if(!(function(A,T,M){return!(A<0||A>25||M<0||M>=Math.pow(2,A)||T<0||T>=Math.pow(2,A))})(l,u,m))throw new Error(`x=${u}, y=${m}, z=${l} outside of bounds. 0<=x<${Math.pow(2,l)}, 0<=y<${Math.pow(2,l)} 0<=z<=25 `);this.z=l,this.x=u,this.y=m,this.key=$2(0,l,l,u,m)}equals(l){return this.z===l.z&&this.x===l.x&&this.y===l.y}url(l,u,m){let A=(M=this.y,P=this.z,L=Not(256*(T=this.x),256*(M=Math.pow(2,P)-M-1),P),O=Not(256*(T+1),256*(M+1),P),L[0]+\",\"+L[1]+\",\"+O[0]+\",\"+O[1]);var T,M,P,L,O;let V=(function(F,X,j){let nt,st=\"\";for(let pt=F;pt>0;pt--)nt=1<<pt-1,st+=(X&nt?1:0)+(j&nt?2:0);return st})(this.z,this.x,this.y);return l[(this.x+this.y)%l.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(m===\"tms\"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,u>1?\"@2x\":\"\").replace(/{quadkey}/g,V).replace(/{bbox-epsg-3857}/g,A)}isChildOf(l){let u=this.z-l.z;return u>0&&l.x===this.x>>u&&l.y===this.y>>u}getTilePoint(l){let u=Math.pow(2,this.z);return new s((l.x*u-this.x)*Pe,(l.y*u-this.y)*Pe)}toString(){return`${this.z}/${this.x}/${this.y}`}}class zot{constructor(l,u){this.wrap=l,this.canonical=u,this.key=$2(l,u.z,u.z,u.x,u.y)}}class cu{constructor(l,u,m,A,T){if(this.terrainRttPosMatrix32f=null,l<m)throw new Error(`overscaledZ should be >= z; overscaledZ = ${l}; z = ${m}`);this.overscaledZ=l,this.wrap=u,this.canonical=new Tj(m,+A,+T),this.key=$2(u,l,m,A,T)}clone(){return new cu(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(l){return this.overscaledZ===l.overscaledZ&&this.wrap===l.wrap&&this.canonical.equals(l.canonical)}scaledTo(l){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);let u=this.canonical.z-l;return l>this.canonical.z?new cu(l,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new cu(l,this.wrap,l,this.canonical.x>>u,this.canonical.y>>u)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(l,u){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);let m=this.canonical.z-l;return l>this.canonical.z?$2(this.wrap*+u,l,this.canonical.z,this.canonical.x,this.canonical.y):$2(this.wrap*+u,l,l,this.canonical.x>>m,this.canonical.y>>m)}isChildOf(l){if(l.wrap!==this.wrap||this.overscaledZ-l.overscaledZ<=0)return!1;if(l.overscaledZ===0)return this.overscaledZ>0;let u=this.canonical.z-l.canonical.z;return!(u<0)&&l.canonical.x===this.canonical.x>>u&&l.canonical.y===this.canonical.y>>u}children(l){if(this.overscaledZ>=l)return[new cu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let u=this.canonical.z+1,m=2*this.canonical.x,A=2*this.canonical.y;return[new cu(u,this.wrap,u,m,A),new cu(u,this.wrap,u,m+1,A),new cu(u,this.wrap,u,m,A+1),new cu(u,this.wrap,u,m+1,A+1)]}isLessThan(l){return this.wrap<l.wrap||!(this.wrap>l.wrap)&&(this.overscaledZ<l.overscaledZ||!(this.overscaledZ>l.overscaledZ)&&(this.canonical.x<l.canonical.x||!(this.canonical.x>l.canonical.x)&&this.canonical.y<l.canonical.y))}wrapped(){return new cu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(l){return new cu(this.overscaledZ,l,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new zot(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(l){return this.canonical.getTilePoint(new GM(l.x-this.wrap,l.y))}normalizeCoordinates(l,u,m=8192){if(l>=0&&l<m&&u>=0&&u<m)return{tileID:this,x:l,y:u};let A=Math.floor(l/m),T=Math.floor(u/m),M=l-A*m,P=u-T*m,L=this.canonical.z,O=1<<L,V=this.canonical.y+T;if(V<0||V>=O)return null;let F=this.canonical.x+A,X=this.wrap;return F<0?(X-=Math.ceil(-F/O),F=(F%O+O)%O):F>=O&&(X+=Math.floor(F/O),F%=O),{tileID:new cu(this.overscaledZ,X,L,F,V),x:M,y:P}}}function $2(d,l,u,m,A){(d*=2)<0&&(d=-1*d-1);let T=1<<u;return(T*T*d+T*A+m).toString(36)+u.toString(36)+l.toString(36)}ir(\"CanonicalTileID\",Tj),ir(\"OverscaledTileID\",cu,{omit:[\"terrainRttPosMatrix32f\"]});class gv{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(l){return this.minX=Math.min(this.minX,l.x),this.minY=Math.min(this.minY,l.y),this.maxX=Math.max(this.maxX,l.x),this.maxY=Math.max(this.maxY,l.y),this}expandBy(l){return this.minX-=l,this.minY-=l,this.maxX+=l,this.maxY+=l,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(l){return this.expandBy(-l)}map(l){let u=new gv;return u.extend(l(new s(this.minX,this.minY))),u.extend(l(new s(this.maxX,this.minY))),u.extend(l(new s(this.minX,this.maxY))),u.extend(l(new s(this.maxX,this.maxY))),u}static fromPoints(l){let u=new gv;for(let m of l)u.extend(m);return u}contains(l){return l.x>=this.minX&&l.x<=this.maxX&&l.y>=this.minY&&l.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(l){return!this.empty()&&!l.empty()&&l.minX>=this.minX&&l.maxX<=this.maxX&&l.minY>=this.minY&&l.maxY<=this.maxY}intersects(l){return!this.empty()&&!l.empty()&&l.minX<=this.maxX&&l.maxX>=this.minX&&l.minY<=this.maxY&&l.maxY>=this.minY}}class Uot{constructor(l){this._stringToNumber={},this._numberToString=[];for(let u=0;u<l.length;u++){let m=l[u];this._stringToNumber[m]=u,this._numberToString[u]=m}}encode(l){return this._stringToNumber[l]}decode(l){if(l>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${l} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[l]}}class Vot{constructor(l,u,m,A,T){this.type=\"Feature\",this._vectorTileFeature=l,this._x=m,this._y=A,this._z=u,this.properties=l.properties,this.id=T}projectPoint(l,u,m,A){return[360*(l.x+u)/A-180,360/Math.PI*Math.atan(Math.exp((1-2*(l.y+m)/A)*Math.PI))-90]}projectLine(l,u,m,A){return l.map((T=>this.projectPoint(T,u,m,A)))}get geometry(){if(this._geometry)return this._geometry;let l=this._vectorTileFeature,u=l.extent*Math.pow(2,this._z),m=l.extent*this._x,A=l.extent*this._y,T=l.loadGeometry();switch(l.type){case 1:{let M=[];for(let L of T)M.push(L[0]);let P=this.projectLine(M,m,A,u);this._geometry=M.length===1?{type:\"Point\",coordinates:P[0]}:{type:\"MultiPoint\",coordinates:P};break}case 2:{let M=T.map((P=>this.projectLine(P,m,A,u)));this._geometry=M.length===1?{type:\"LineString\",coordinates:M[0]}:{type:\"MultiLineString\",coordinates:M};break}case 3:{let M=Gnt(T),P=[];for(let L of M)P.push(L.map((O=>this.projectLine(O,m,A,u))));this._geometry=P.length===1?{type:\"Polygon\",coordinates:P[0]}:{type:\"MultiPolygon\",coordinates:P};break}default:throw new Error(`unknown feature type: ${l.type}`)}return this._geometry}set geometry(l){this._geometry=l}toJSON(){let l={geometry:this.geometry};for(let u in this)u!==\"_geometry\"&&u!==\"_vectorTileFeature\"&&u!==\"_x\"&&u!==\"_y\"&&u!==\"_z\"&&(l[u]=this[u]);return l}}class G2{constructor(l,u,m){this._name=l,this.dataBuffer=u,typeof m==\"number\"?this._size=m:(this.nullabilityBuffer=m,this._size=m.size())}getValue(l){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(l)?null:this.getValueFromBuffer(l)}has(l){return this.nullabilityBuffer?.get(l)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class PR extends G2{}class Sj extends PR{getValueFromBuffer(l){return this.dataBuffer[l]}}class Mj extends PR{getValueFromBuffer(l){return this.dataBuffer[l]}}class jot extends G2{constructor(l,u,m,A){super(l,u,A),this.delta=m}}class Ej extends jot{constructor(l,u,m,A){super(l,Int32Array.of(u),m,A)}getValueFromBuffer(l){return this.dataBuffer[0]+l*this.delta}}class Pj extends G2{constructor(l,u,m,A){super(l,A?Int32Array.of(u):Uint32Array.of(u),m)}getValueFromBuffer(l){return this.dataBuffer[0]}}class PRt{constructor(l,u,m,A,T=4096){this._name=l,this._geometryVector=u,this._idVector=m,this._propertyVectors=A,this._extent=T}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(l){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((u=>[u.name,u])))),this.propertyVectorsMap.get(l)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let l=[],u=this.geometryVector.getGeometries();for(let m=0;m<this.numFeatures;m++){let A;if(this.idVector){let P=this.idVector.getValue(m);A=this.containsMaxSafeIntegerValues(this.idVector)&&P!==null?Number(P):P}let T={coordinates:u[m],type:this.geometryVector.geometryType(m)},M={};for(let P of this.propertyVectors){if(!P)continue;let L=P.name,O=P.getValue(m);O!==null&&(M[L]=O)}l.push({id:A,geometry:T,properties:M})}return l}containsMaxSafeIntegerValues(l){return l instanceof Sj||l instanceof Pj||l instanceof Ej||l instanceof Mj}}class $ot{constructor(l){this.value=l}get(){return this.value}set(l){this.value=l}increment(){return this.value++}add(l){this.value+=l}}var ki,xy;(function(d){d.NONE=\"NONE\",d.DELTA=\"DELTA\",d.COMPONENTWISE_DELTA=\"COMPONENTWISE_DELTA\",d.RLE=\"RLE\",d.MORTON=\"MORTON\",d.PDE=\"PDE\"})(ki||(ki={})),(function(d){d.NONE=\"NONE\",d.FAST_PFOR=\"FAST_PFOR\",d.VARINT=\"VARINT\",d.ALP=\"ALP\"})(xy||(xy={}));let Cj=new Uint32Array(33);Cj[0]=0;for(let d=1;d<=32;d++)Cj[d]=d===32?4294967295:4294967295>>>32-d;let Ij=Cj,rg=256;function kj(d,l){return d-d%l}function CRt(d){let l=d>>>0;return((255&l)<<24|(65280&l)<<8|l>>>8&65280|l>>>24&255)>>>0}let Rj=(function(){if(!Number.isFinite(65536))return 65536;let d=kj(Math.floor(65536),rg);return d===0?rg:d})(),IRt=3*Rj/rg+Rj|0;function Got(){let d=new Uint8Array(IRt);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:d,byteContainerI32:new Int32Array(d.buffer,d.byteOffset,d.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function kRt(d,l,u,m,A){switch(A){case 1:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0;P[O++]=X>>>0&1,P[O++]=X>>>1&1,P[O++]=X>>>2&1,P[O++]=X>>>3&1,P[O++]=X>>>4&1,P[O++]=X>>>5&1,P[O++]=X>>>6&1,P[O++]=X>>>7&1,P[O++]=X>>>8&1,P[O++]=X>>>9&1,P[O++]=X>>>10&1,P[O++]=X>>>11&1,P[O++]=X>>>12&1,P[O++]=X>>>13&1,P[O++]=X>>>14&1,P[O++]=X>>>15&1,P[O++]=X>>>16&1,P[O++]=X>>>17&1,P[O++]=X>>>18&1,P[O++]=X>>>19&1,P[O++]=X>>>20&1,P[O++]=X>>>21&1,P[O++]=X>>>22&1,P[O++]=X>>>23&1,P[O++]=X>>>24&1,P[O++]=X>>>25&1,P[O++]=X>>>26&1,P[O++]=X>>>27&1,P[O++]=X>>>28&1,P[O++]=X>>>29&1,P[O++]=X>>>30&1,P[O++]=X>>>31&1}})(d,l,u,m);break;case 2:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0;P[O++]=X>>>0&3,P[O++]=X>>>2&3,P[O++]=X>>>4&3,P[O++]=X>>>6&3,P[O++]=X>>>8&3,P[O++]=X>>>10&3,P[O++]=X>>>12&3,P[O++]=X>>>14&3,P[O++]=X>>>16&3,P[O++]=X>>>18&3,P[O++]=X>>>20&3,P[O++]=X>>>22&3,P[O++]=X>>>24&3,P[O++]=X>>>26&3,P[O++]=X>>>28&3,P[O++]=X>>>30&3,P[O++]=j>>>0&3,P[O++]=j>>>2&3,P[O++]=j>>>4&3,P[O++]=j>>>6&3,P[O++]=j>>>8&3,P[O++]=j>>>10&3,P[O++]=j>>>12&3,P[O++]=j>>>14&3,P[O++]=j>>>16&3,P[O++]=j>>>18&3,P[O++]=j>>>20&3,P[O++]=j>>>22&3,P[O++]=j>>>24&3,P[O++]=j>>>26&3,P[O++]=j>>>28&3,P[O++]=j>>>30&3}})(d,l,u,m);break;case 3:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0;P[O++]=X>>>0&7,P[O++]=X>>>3&7,P[O++]=X>>>6&7,P[O++]=X>>>9&7,P[O++]=X>>>12&7,P[O++]=X>>>15&7,P[O++]=X>>>18&7,P[O++]=X>>>21&7,P[O++]=X>>>24&7,P[O++]=X>>>27&7,P[O++]=7&(X>>>30|(1&j)<<2),P[O++]=j>>>1&7,P[O++]=j>>>4&7,P[O++]=j>>>7&7,P[O++]=j>>>10&7,P[O++]=j>>>13&7,P[O++]=j>>>16&7,P[O++]=j>>>19&7,P[O++]=j>>>22&7,P[O++]=j>>>25&7,P[O++]=j>>>28&7,P[O++]=7&(j>>>31|(3&nt)<<1),P[O++]=nt>>>2&7,P[O++]=nt>>>5&7,P[O++]=nt>>>8&7,P[O++]=nt>>>11&7,P[O++]=nt>>>14&7,P[O++]=nt>>>17&7,P[O++]=nt>>>20&7,P[O++]=nt>>>23&7,P[O++]=nt>>>26&7,P[O++]=nt>>>29&7}})(d,l,u,m);break;case 4:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0,st=T[V++]>>>0;P[O++]=X>>>0&15,P[O++]=X>>>4&15,P[O++]=X>>>8&15,P[O++]=X>>>12&15,P[O++]=X>>>16&15,P[O++]=X>>>20&15,P[O++]=X>>>24&15,P[O++]=X>>>28&15,P[O++]=j>>>0&15,P[O++]=j>>>4&15,P[O++]=j>>>8&15,P[O++]=j>>>12&15,P[O++]=j>>>16&15,P[O++]=j>>>20&15,P[O++]=j>>>24&15,P[O++]=j>>>28&15,P[O++]=nt>>>0&15,P[O++]=nt>>>4&15,P[O++]=nt>>>8&15,P[O++]=nt>>>12&15,P[O++]=nt>>>16&15,P[O++]=nt>>>20&15,P[O++]=nt>>>24&15,P[O++]=nt>>>28&15,P[O++]=st>>>0&15,P[O++]=st>>>4&15,P[O++]=st>>>8&15,P[O++]=st>>>12&15,P[O++]=st>>>16&15,P[O++]=st>>>20&15,P[O++]=st>>>24&15,P[O++]=st>>>28&15}})(d,l,u,m);break;case 5:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0,st=T[V++]>>>0,pt=T[V++]>>>0;P[O++]=X>>>0&31,P[O++]=X>>>5&31,P[O++]=X>>>10&31,P[O++]=X>>>15&31,P[O++]=X>>>20&31,P[O++]=X>>>25&31,P[O++]=31&(X>>>30|(7&j)<<2),P[O++]=j>>>3&31,P[O++]=j>>>8&31,P[O++]=j>>>13&31,P[O++]=j>>>18&31,P[O++]=j>>>23&31,P[O++]=31&(j>>>28|(1&nt)<<4),P[O++]=nt>>>1&31,P[O++]=nt>>>6&31,P[O++]=nt>>>11&31,P[O++]=nt>>>16&31,P[O++]=nt>>>21&31,P[O++]=nt>>>26&31,P[O++]=31&(nt>>>31|(15&st)<<1),P[O++]=st>>>4&31,P[O++]=st>>>9&31,P[O++]=st>>>14&31,P[O++]=st>>>19&31,P[O++]=st>>>24&31,P[O++]=31&(st>>>29|(3&pt)<<3),P[O++]=pt>>>2&31,P[O++]=pt>>>7&31,P[O++]=pt>>>12&31,P[O++]=pt>>>17&31,P[O++]=pt>>>22&31,P[O++]=pt>>>27&31}})(d,l,u,m);break;case 6:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0,st=T[V++]>>>0,pt=T[V++]>>>0,mt=T[V++]>>>0;P[O++]=X>>>0&63,P[O++]=X>>>6&63,P[O++]=X>>>12&63,P[O++]=X>>>18&63,P[O++]=X>>>24&63,P[O++]=63&(X>>>30|(15&j)<<2),P[O++]=j>>>4&63,P[O++]=j>>>10&63,P[O++]=j>>>16&63,P[O++]=j>>>22&63,P[O++]=63&(j>>>28|(3&nt)<<4),P[O++]=nt>>>2&63,P[O++]=nt>>>8&63,P[O++]=nt>>>14&63,P[O++]=nt>>>20&63,P[O++]=nt>>>26&63,P[O++]=st>>>0&63,P[O++]=st>>>6&63,P[O++]=st>>>12&63,P[O++]=st>>>18&63,P[O++]=st>>>24&63,P[O++]=63&(st>>>30|(15&pt)<<2),P[O++]=pt>>>4&63,P[O++]=pt>>>10&63,P[O++]=pt>>>16&63,P[O++]=pt>>>22&63,P[O++]=63&(pt>>>28|(3&mt)<<4),P[O++]=mt>>>2&63,P[O++]=mt>>>8&63,P[O++]=mt>>>14&63,P[O++]=mt>>>20&63,P[O++]=mt>>>26&63}})(d,l,u,m);break;case 7:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0,st=T[V++]>>>0,pt=T[V++]>>>0,mt=T[V++]>>>0,vt=T[V++]>>>0;P[O++]=X>>>0&127,P[O++]=X>>>7&127,P[O++]=X>>>14&127,P[O++]=X>>>21&127,P[O++]=127&(X>>>28|(7&j)<<4),P[O++]=j>>>3&127,P[O++]=j>>>10&127,P[O++]=j>>>17&127,P[O++]=j>>>24&127,P[O++]=127&(j>>>31|(63&nt)<<1),P[O++]=nt>>>6&127,P[O++]=nt>>>13&127,P[O++]=nt>>>20&127,P[O++]=127&(nt>>>27|(3&st)<<5),P[O++]=st>>>2&127,P[O++]=st>>>9&127,P[O++]=st>>>16&127,P[O++]=st>>>23&127,P[O++]=127&(st>>>30|(31&pt)<<2),P[O++]=pt>>>5&127,P[O++]=pt>>>12&127,P[O++]=pt>>>19&127,P[O++]=127&(pt>>>26|(1&mt)<<6),P[O++]=mt>>>1&127,P[O++]=mt>>>8&127,P[O++]=mt>>>15&127,P[O++]=mt>>>22&127,P[O++]=127&(mt>>>29|(15&vt)<<3),P[O++]=vt>>>4&127,P[O++]=vt>>>11&127,P[O++]=vt>>>18&127,P[O++]=vt>>>25&127}})(d,l,u,m);break;case 8:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<8;F++){let X=T[V++]>>>0,j=T[V++]>>>0,nt=T[V++]>>>0,st=T[V++]>>>0,pt=T[V++]>>>0,mt=T[V++]>>>0,vt=T[V++]>>>0,At=T[V++]>>>0;P[O++]=X>>>0&255,P[O++]=X>>>8&255,P[O++]=X>>>16&255,P[O++]=X>>>24&255,P[O++]=j>>>0&255,P[O++]=j>>>8&255,P[O++]=j>>>16&255,P[O++]=j>>>24&255,P[O++]=nt>>>0&255,P[O++]=nt>>>8&255,P[O++]=nt>>>16&255,P[O++]=nt>>>24&255,P[O++]=st>>>0&255,P[O++]=st>>>8&255,P[O++]=st>>>16&255,P[O++]=st>>>24&255,P[O++]=pt>>>0&255,P[O++]=pt>>>8&255,P[O++]=pt>>>16&255,P[O++]=pt>>>24&255,P[O++]=mt>>>0&255,P[O++]=mt>>>8&255,P[O++]=mt>>>16&255,P[O++]=mt>>>24&255,P[O++]=vt>>>0&255,P[O++]=vt>>>8&255,P[O++]=vt>>>16&255,P[O++]=vt>>>24&255,P[O++]=At>>>0&255,P[O++]=At>>>8&255,P[O++]=At>>>16&255,P[O++]=At>>>24&255}})(d,l,u,m);break;case 16:(function(T,M,P,L){let O=L,V=M;for(let F=0;F<128;F++){let X=T[V++]>>>0;P[O++]=65535&X,P[O++]=X>>>16&65535}})(d,l,u,m);break;default:(function(T,M,P,L,O){let V=Ij[O]>>>0,F=M,X=0,j=T[F]>>>0,nt=L;for(let st=0;st<8;st++){for(let pt=0;pt<32;pt++)if(X+O<=32)P[nt+pt]=j>>>X&V,X+=O,X===32&&(X=0,F++,pt!==31&&(j=T[F]>>>0));else{let mt=32-X,vt=j>>>X;F++,j=T[F]>>>0;let At=O-mt;P[nt+pt]=(vt|(j&-1>>>32-At>>>0)<<mt)&V,X=At}nt+=32,X=0,st<7&&(j=T[F]>>>0)}})(d,l,u,m,A)}return l+(A<<3)|0}function RRt(d,l,u,m){if(u+2>l)throw new Error(`FastPFOR decode: byteContainer underflow at block=${m} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${u}, byteSize=${l})`);let A=d[u++],T=d[u++];if(A>32)throw new Error(`FastPFOR decode: invalid bitWidth=${A} at block=${m} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:A,exceptionCount:T,bytePosIn:u}}function DRt(d,l,u,m,A,T,M,P,L){let{maxBits:O,exceptionBitWidth:V,bytePosIn:F}=(function(pt,mt,vt,At,wt,St){if(vt+1>mt)throw new Error(`FastPFOR decode: exception header underflow at block=${St} (need 1 byte for maxBits, bytePos=${vt}, byteSize=${mt})`);let Bt=pt[vt++];if(Bt<At||Bt>32)throw new Error(`FastPFOR decode: invalid maxBits=${Bt} at block=${St} (bitWidth=${At}, expected ${At}..32)`);let qt=Bt-At|0;if(qt<1||qt>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${qt} at block=${St} (bitWidth=${At}, maxBits=${Bt})`);if(vt+wt>mt)throw new Error(`FastPFOR decode: exception positions underflow at block=${St} (need=${wt}, have=${mt-vt})`);return{maxBits:Bt,exceptionBitWidth:qt,bytePosIn:vt}})(A,T,M,u,m,L);if(M=F,V===1){let pt=1<<u;for(let mt=0;mt<m;mt=mt+1|0)d[A[M++]+l|0]|=pt;return M}let X=P.dataToBePacked[V];if(!X)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${V} (bitWidth=${u}, maxBits=${O}) at block ${L}`);let j=P.dataPointers,nt=0|j[V],st=0|P.exceptionSizes[V];if(nt+m>st)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${V} (ptr=${nt}, need ${m}, size=${st}) at block ${L}`);for(let pt=0;pt<m;pt=pt+1|0){let mt=A[M++],vt=0|X[nt++];d[mt+l|0]|=vt<<u}return j[V]=nt,M}function ORt(d,l,u,m,A,T){let M=0|u,P=0|d[M];if(P<=0||M+P>d.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${P} at pageStart=${M} (expected > 0 and pageStart+whereMeta < encoded.length=${d.length})`);let L=M+1|0,O=M+P|0,V=d[O]>>>0,F=V+3>>>2,X=O+1,j=X+F;if(j>=d.length)throw new Error(`FastPFOR decode: invalid byteSize=${V} (metaInts=${F}, pageStart=${M}, packedEnd=${O}, byteContainerStart=${X}) causes bitmapPos=${j} out of bounds (encoded.length=${d.length})`);let nt=(function(mt,vt,At,wt){wt.byteContainer.length<At&&(wt.byteContainer=new Uint8Array(2*At),wt.byteContainerI32=void 0);let St=wt.byteContainer,Bt=At>>>2;if(3&St.byteOffset)for(let te=0;te<Bt;te=te+1|0){let he=0|mt[vt+te|0],fe=te<<2;St[fe]=255&he,St[fe+1|0]=he>>>8&255,St[fe+2|0]=he>>>16&255,St[fe+3|0]=he>>>24&255}else{let te=wt.byteContainerI32;(!te||te.buffer!==St.buffer||te.byteOffset!==St.byteOffset||te.length<Bt)&&(te=wt.byteContainerI32=new Int32Array(St.buffer,St.byteOffset,St.byteLength>>>2)),te.set(mt.subarray(vt,vt+Bt))}let qt=3&At;if(qt>0){let te=0|mt[vt+Bt|0],he=Bt<<2;for(let fe=0;fe<qt;fe=fe+1|0)St[he+fe|0]=te>>>(fe<<3)&255}return St})(d,X,V,T),st=V,pt=(function(mt,vt,At){let wt=0|mt[vt++],St=At.dataToBePacked;for(let Bt=2;Bt<=32;Bt=Bt+1|0){if(!(wt>>>Bt-1&1))continue;if(vt>=mt.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${Bt}, streamWordIndex=${vt}, needWords=1, availableWords=${mt.length-vt}, encodedWords=${mt.length})`);let qt=mt[vt++]>>>0,te=kj(qt+31,32),he=qt*Bt+31>>>5;if(vt+he>mt.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${Bt}, size=${qt}, streamWordIndex=${vt}, needWords=${he}, availableWords=${mt.length-vt}, encodedWords=${mt.length})`);let fe=St[Bt];(!fe||fe.length<te)&&(fe=St[Bt]=new Uint32Array(te));let Se=0;for(;Se<qt;Se=Se+32|0)LRt(mt,vt,fe,Se,Bt),vt=vt+Bt|0;vt=vt-((Se-qt|0)*Bt>>>5)|0,At.exceptionSizes[Bt]=qt}return vt})(d,j,T);return T.dataPointers.fill(0),(function(mt,vt,At,wt,St,Bt,qt,te,he,fe){let Se=0|At,ve=0;for(let be=0;be<qt;be=be+1|0){let Ae=RRt(te,he,ve,be);ve=Ae.bytePosIn;let Ze=Ae.bitWidth,nr=Ae.exceptionCount,er=Bt+be*rg|0;switch(Ze){case 0:St.fill(0,er,er+rg);break;case 32:for(let Xe=0;Xe<rg;Xe=Xe+1|0)St[er+Xe|0]=0|mt[Se+Xe|0];Se=Se+rg|0;break;default:Se=kRt(mt,Se,St,er,Ze)}nr>0&&(ve=DRt(St,er,Ze,nr,te,he,ve,fe,be))}if(Se!==wt)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${vt}, packedStart=${At}, consumedPackedEnd=${Se}, expectedPackedEnd=${wt}, packedWords=${wt-At}, encoded.length=${mt.length})`)})(d,M,L,O,l,0|m,A/rg|0,nt,st,T),pt}function LRt(d,l,u,m,A){switch(A){case 2:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0;F[j++]=nt>>>0&3,F[j++]=nt>>>2&3,F[j++]=nt>>>4&3,F[j++]=nt>>>6&3,F[j++]=nt>>>8&3,F[j++]=nt>>>10&3,F[j++]=nt>>>12&3,F[j++]=nt>>>14&3,F[j++]=nt>>>16&3,F[j++]=nt>>>18&3,F[j++]=nt>>>20&3,F[j++]=nt>>>22&3,F[j++]=nt>>>24&3,F[j++]=nt>>>26&3,F[j++]=nt>>>28&3,F[j++]=nt>>>30&3,F[j++]=st>>>0&3,F[j++]=st>>>2&3,F[j++]=st>>>4&3,F[j++]=st>>>6&3,F[j++]=st>>>8&3,F[j++]=st>>>10&3,F[j++]=st>>>12&3,F[j++]=st>>>14&3,F[j++]=st>>>16&3,F[j++]=st>>>18&3,F[j++]=st>>>20&3,F[j++]=st>>>22&3,F[j++]=st>>>24&3,F[j++]=st>>>26&3,F[j++]=st>>>28&3,F[j]=st>>>30&3})(d,l,u,m);case 3:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0;F[j++]=nt>>>0&7,F[j++]=nt>>>3&7,F[j++]=nt>>>6&7,F[j++]=nt>>>9&7,F[j++]=nt>>>12&7,F[j++]=nt>>>15&7,F[j++]=nt>>>18&7,F[j++]=nt>>>21&7,F[j++]=nt>>>24&7,F[j++]=nt>>>27&7,F[j++]=7&(nt>>>30|(1&st)<<2),F[j++]=st>>>1&7,F[j++]=st>>>4&7,F[j++]=st>>>7&7,F[j++]=st>>>10&7,F[j++]=st>>>13&7,F[j++]=st>>>16&7,F[j++]=st>>>19&7,F[j++]=st>>>22&7,F[j++]=st>>>25&7,F[j++]=st>>>28&7,F[j++]=7&(st>>>31|(3&pt)<<1),F[j++]=pt>>>2&7,F[j++]=pt>>>5&7,F[j++]=pt>>>8&7,F[j++]=pt>>>11&7,F[j++]=pt>>>14&7,F[j++]=pt>>>17&7,F[j++]=pt>>>20&7,F[j++]=pt>>>23&7,F[j++]=pt>>>26&7,F[j]=pt>>>29&7})(d,l,u,m);case 4:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0;F[j++]=nt>>>0&15,F[j++]=nt>>>4&15,F[j++]=nt>>>8&15,F[j++]=nt>>>12&15,F[j++]=nt>>>16&15,F[j++]=nt>>>20&15,F[j++]=nt>>>24&15,F[j++]=nt>>>28&15,F[j++]=st>>>0&15,F[j++]=st>>>4&15,F[j++]=st>>>8&15,F[j++]=st>>>12&15,F[j++]=st>>>16&15,F[j++]=st>>>20&15,F[j++]=st>>>24&15,F[j++]=st>>>28&15,F[j++]=pt>>>0&15,F[j++]=pt>>>4&15,F[j++]=pt>>>8&15,F[j++]=pt>>>12&15,F[j++]=pt>>>16&15,F[j++]=pt>>>20&15,F[j++]=pt>>>24&15,F[j++]=pt>>>28&15,F[j++]=mt>>>0&15,F[j++]=mt>>>4&15,F[j++]=mt>>>8&15,F[j++]=mt>>>12&15,F[j++]=mt>>>16&15,F[j++]=mt>>>20&15,F[j++]=mt>>>24&15,F[j]=mt>>>28&15})(d,l,u,m);case 5:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0;F[j++]=nt>>>0&31,F[j++]=nt>>>5&31,F[j++]=nt>>>10&31,F[j++]=nt>>>15&31,F[j++]=nt>>>20&31,F[j++]=nt>>>25&31,F[j++]=31&(nt>>>30|(7&st)<<2),F[j++]=st>>>3&31,F[j++]=st>>>8&31,F[j++]=st>>>13&31,F[j++]=st>>>18&31,F[j++]=st>>>23&31,F[j++]=31&(st>>>28|(1&pt)<<4),F[j++]=pt>>>1&31,F[j++]=pt>>>6&31,F[j++]=pt>>>11&31,F[j++]=pt>>>16&31,F[j++]=pt>>>21&31,F[j++]=pt>>>26&31,F[j++]=31&(pt>>>31|(15&mt)<<1),F[j++]=mt>>>4&31,F[j++]=mt>>>9&31,F[j++]=mt>>>14&31,F[j++]=mt>>>19&31,F[j++]=mt>>>24&31,F[j++]=31&(mt>>>29|(3&vt)<<3),F[j++]=vt>>>2&31,F[j++]=vt>>>7&31,F[j++]=vt>>>12&31,F[j++]=vt>>>17&31,F[j++]=vt>>>22&31,F[j]=vt>>>27&31})(d,l,u,m);case 6:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0;F[j++]=nt>>>0&63,F[j++]=nt>>>6&63,F[j++]=nt>>>12&63,F[j++]=nt>>>18&63,F[j++]=nt>>>24&63,F[j++]=63&(nt>>>30|(15&st)<<2),F[j++]=st>>>4&63,F[j++]=st>>>10&63,F[j++]=st>>>16&63,F[j++]=st>>>22&63,F[j++]=63&(st>>>28|(3&pt)<<4),F[j++]=pt>>>2&63,F[j++]=pt>>>8&63,F[j++]=pt>>>14&63,F[j++]=pt>>>20&63,F[j++]=pt>>>26&63,F[j++]=mt>>>0&63,F[j++]=mt>>>6&63,F[j++]=mt>>>12&63,F[j++]=mt>>>18&63,F[j++]=mt>>>24&63,F[j++]=63&(mt>>>30|(15&vt)<<2),F[j++]=vt>>>4&63,F[j++]=vt>>>10&63,F[j++]=vt>>>16&63,F[j++]=vt>>>22&63,F[j++]=63&(vt>>>28|(3&At)<<4),F[j++]=At>>>2&63,F[j++]=At>>>8&63,F[j++]=At>>>14&63,F[j++]=At>>>20&63,F[j]=At>>>26&63})(d,l,u,m);case 7:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0;F[j++]=nt>>>0&127,F[j++]=nt>>>7&127,F[j++]=nt>>>14&127,F[j++]=nt>>>21&127,F[j++]=127&(nt>>>28|(7&st)<<4),F[j++]=st>>>3&127,F[j++]=st>>>10&127,F[j++]=st>>>17&127,F[j++]=st>>>24&127,F[j++]=127&(st>>>31|(63&pt)<<1),F[j++]=pt>>>6&127,F[j++]=pt>>>13&127,F[j++]=pt>>>20&127,F[j++]=127&(pt>>>27|(3&mt)<<5),F[j++]=mt>>>2&127,F[j++]=mt>>>9&127,F[j++]=mt>>>16&127,F[j++]=mt>>>23&127,F[j++]=127&(mt>>>30|(31&vt)<<2),F[j++]=vt>>>5&127,F[j++]=vt>>>12&127,F[j++]=vt>>>19&127,F[j++]=127&(vt>>>26|(1&At)<<6),F[j++]=At>>>1&127,F[j++]=At>>>8&127,F[j++]=At>>>15&127,F[j++]=At>>>22&127,F[j++]=127&(At>>>29|(15&wt)<<3),F[j++]=wt>>>4&127,F[j++]=wt>>>11&127,F[j++]=wt>>>18&127,F[j]=wt>>>25&127})(d,l,u,m);case 8:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0;F[j++]=nt>>>0&255,F[j++]=nt>>>8&255,F[j++]=nt>>>16&255,F[j++]=nt>>>24&255,F[j++]=st>>>0&255,F[j++]=st>>>8&255,F[j++]=st>>>16&255,F[j++]=st>>>24&255,F[j++]=pt>>>0&255,F[j++]=pt>>>8&255,F[j++]=pt>>>16&255,F[j++]=pt>>>24&255,F[j++]=mt>>>0&255,F[j++]=mt>>>8&255,F[j++]=mt>>>16&255,F[j++]=mt>>>24&255,F[j++]=vt>>>0&255,F[j++]=vt>>>8&255,F[j++]=vt>>>16&255,F[j++]=vt>>>24&255,F[j++]=At>>>0&255,F[j++]=At>>>8&255,F[j++]=At>>>16&255,F[j++]=At>>>24&255,F[j++]=wt>>>0&255,F[j++]=wt>>>8&255,F[j++]=wt>>>16&255,F[j++]=wt>>>24&255,F[j++]=St>>>0&255,F[j++]=St>>>8&255,F[j++]=St>>>16&255,F[j]=St>>>24&255})(d,l,u,m);case 9:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0,Bt=O[V+8]>>>0;F[j++]=nt>>>0&511,F[j++]=nt>>>9&511,F[j++]=nt>>>18&511,F[j++]=511&(nt>>>27|(15&st)<<5),F[j++]=st>>>4&511,F[j++]=st>>>13&511,F[j++]=st>>>22&511,F[j++]=511&(st>>>31|(255&pt)<<1),F[j++]=pt>>>8&511,F[j++]=pt>>>17&511,F[j++]=511&(pt>>>26|(7&mt)<<6),F[j++]=mt>>>3&511,F[j++]=mt>>>12&511,F[j++]=mt>>>21&511,F[j++]=511&(mt>>>30|(127&vt)<<2),F[j++]=vt>>>7&511,F[j++]=vt>>>16&511,F[j++]=511&(vt>>>25|(3&At)<<7),F[j++]=At>>>2&511,F[j++]=At>>>11&511,F[j++]=At>>>20&511,F[j++]=511&(At>>>29|(63&wt)<<3),F[j++]=wt>>>6&511,F[j++]=wt>>>15&511,F[j++]=511&(wt>>>24|(1&St)<<8),F[j++]=St>>>1&511,F[j++]=St>>>10&511,F[j++]=St>>>19&511,F[j++]=511&(St>>>28|(31&Bt)<<4),F[j++]=Bt>>>5&511,F[j++]=Bt>>>14&511,F[j]=Bt>>>23&511})(d,l,u,m);case 10:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0,Bt=O[V+8]>>>0,qt=O[V+9]>>>0;F[j++]=nt>>>0&1023,F[j++]=nt>>>10&1023,F[j++]=nt>>>20&1023,F[j++]=1023&(nt>>>30|(255&st)<<2),F[j++]=st>>>8&1023,F[j++]=st>>>18&1023,F[j++]=1023&(st>>>28|(63&pt)<<4),F[j++]=pt>>>6&1023,F[j++]=pt>>>16&1023,F[j++]=1023&(pt>>>26|(15&mt)<<6),F[j++]=mt>>>4&1023,F[j++]=mt>>>14&1023,F[j++]=1023&(mt>>>24|(3&vt)<<8),F[j++]=vt>>>2&1023,F[j++]=vt>>>12&1023,F[j++]=vt>>>22&1023,F[j++]=At>>>0&1023,F[j++]=At>>>10&1023,F[j++]=At>>>20&1023,F[j++]=1023&(At>>>30|(255&wt)<<2),F[j++]=wt>>>8&1023,F[j++]=wt>>>18&1023,F[j++]=1023&(wt>>>28|(63&St)<<4),F[j++]=St>>>6&1023,F[j++]=St>>>16&1023,F[j++]=1023&(St>>>26|(15&Bt)<<6),F[j++]=Bt>>>4&1023,F[j++]=Bt>>>14&1023,F[j++]=1023&(Bt>>>24|(3&qt)<<8),F[j++]=qt>>>2&1023,F[j++]=qt>>>12&1023,F[j]=qt>>>22&1023})(d,l,u,m);case 11:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0,Bt=O[V+8]>>>0,qt=O[V+9]>>>0,te=O[V+10]>>>0;F[j++]=nt>>>0&2047,F[j++]=nt>>>11&2047,F[j++]=2047&(nt>>>22|(1&st)<<10),F[j++]=st>>>1&2047,F[j++]=st>>>12&2047,F[j++]=2047&(st>>>23|(3&pt)<<9),F[j++]=pt>>>2&2047,F[j++]=pt>>>13&2047,F[j++]=2047&(pt>>>24|(7&mt)<<8),F[j++]=mt>>>3&2047,F[j++]=mt>>>14&2047,F[j++]=2047&(mt>>>25|(15&vt)<<7),F[j++]=vt>>>4&2047,F[j++]=vt>>>15&2047,F[j++]=2047&(vt>>>26|(31&At)<<6),F[j++]=At>>>5&2047,F[j++]=At>>>16&2047,F[j++]=2047&(At>>>27|(63&wt)<<5),F[j++]=wt>>>6&2047,F[j++]=wt>>>17&2047,F[j++]=2047&(wt>>>28|(127&St)<<4),F[j++]=St>>>7&2047,F[j++]=St>>>18&2047,F[j++]=2047&(St>>>29|(255&Bt)<<3),F[j++]=Bt>>>8&2047,F[j++]=Bt>>>19&2047,F[j++]=2047&(Bt>>>30|(511&qt)<<2),F[j++]=qt>>>9&2047,F[j++]=qt>>>20&2047,F[j++]=2047&(qt>>>31|(1023&te)<<1),F[j++]=te>>>10&2047,F[j]=te>>>21&2047})(d,l,u,m);case 12:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0,Bt=O[V+8]>>>0,qt=O[V+9]>>>0,te=O[V+10]>>>0,he=O[V+11]>>>0;F[j++]=nt>>>0&4095,F[j++]=nt>>>12&4095,F[j++]=4095&(nt>>>24|(15&st)<<8),F[j++]=st>>>4&4095,F[j++]=st>>>16&4095,F[j++]=4095&(st>>>28|(255&pt)<<4),F[j++]=pt>>>8&4095,F[j++]=pt>>>20&4095,F[j++]=mt>>>0&4095,F[j++]=mt>>>12&4095,F[j++]=4095&(mt>>>24|(15&vt)<<8),F[j++]=vt>>>4&4095,F[j++]=vt>>>16&4095,F[j++]=4095&(vt>>>28|(255&At)<<4),F[j++]=At>>>8&4095,F[j++]=At>>>20&4095,F[j++]=wt>>>0&4095,F[j++]=wt>>>12&4095,F[j++]=4095&(wt>>>24|(15&St)<<8),F[j++]=St>>>4&4095,F[j++]=St>>>16&4095,F[j++]=4095&(St>>>28|(255&Bt)<<4),F[j++]=Bt>>>8&4095,F[j++]=Bt>>>20&4095,F[j++]=qt>>>0&4095,F[j++]=qt>>>12&4095,F[j++]=4095&(qt>>>24|(15&te)<<8),F[j++]=te>>>4&4095,F[j++]=te>>>16&4095,F[j++]=4095&(te>>>28|(255&he)<<4),F[j++]=he>>>8&4095,F[j]=he>>>20&4095})(d,l,u,m);case 16:return void(function(O,V,F,X){let j=X,nt=O[V]>>>0,st=O[V+1]>>>0,pt=O[V+2]>>>0,mt=O[V+3]>>>0,vt=O[V+4]>>>0,At=O[V+5]>>>0,wt=O[V+6]>>>0,St=O[V+7]>>>0,Bt=O[V+8]>>>0,qt=O[V+9]>>>0,te=O[V+10]>>>0,he=O[V+11]>>>0,fe=O[V+12]>>>0,Se=O[V+13]>>>0,ve=O[V+14]>>>0,be=O[V+15]>>>0;F[j++]=nt>>>0&65535,F[j++]=nt>>>16&65535,F[j++]=st>>>0&65535,F[j++]=st>>>16&65535,F[j++]=pt>>>0&65535,F[j++]=pt>>>16&65535,F[j++]=mt>>>0&65535,F[j++]=mt>>>16&65535,F[j++]=vt>>>0&65535,F[j++]=vt>>>16&65535,F[j++]=At>>>0&65535,F[j++]=At>>>16&65535,F[j++]=wt>>>0&65535,F[j++]=wt>>>16&65535,F[j++]=St>>>0&65535,F[j++]=St>>>16&65535,F[j++]=Bt>>>0&65535,F[j++]=Bt>>>16&65535,F[j++]=qt>>>0&65535,F[j++]=qt>>>16&65535,F[j++]=te>>>0&65535,F[j++]=te>>>16&65535,F[j++]=he>>>0&65535,F[j++]=he>>>16&65535,F[j++]=fe>>>0&65535,F[j++]=fe>>>16&65535,F[j++]=Se>>>0&65535,F[j++]=Se>>>16&65535,F[j++]=ve>>>0&65535,F[j++]=ve>>>16&65535,F[j++]=be>>>0&65535,F[j]=be>>>16&65535})(d,l,u,m);case 32:for(let O=0;O<32;O=O+1|0)u[m+O|0]=0|d[l+O|0];return}let T=Ij[A]>>>0,M=l,P=0,L=d[M]>>>0;for(let O=0;O<32;O++)if(P+A<=32)u[m+O]=L>>>P&T,P+=A,P===32&&(P=0,M++,O!==31&&(L=d[M]>>>0));else{let V=32-P,F=L>>>P;M++,L=d[M]>>>0,u[m+O]=(F|(L&Ij[A-V]>>>0)<<V)&T,P=A-V}}function vl(d,l,u){let m=new Uint32Array(u),A=0,T=l.get();for(let M=0;M<m.length;M++){let P=d[T++],L=127&P;P<128||(P=d[T++],L|=(127&P)<<7,P<128||(P=d[T++],L|=(127&P)<<14,P<128||(P=d[T++],L|=(127&P)<<21,P<128||(P=d[T++],L|=(15&P)<<28)))),m[A++]=L}return l.set(T),m}function W2(d,l,u){let m=new BigUint64Array(u);for(let A=0;A<m.length;A++)m[A]=BRt(d,l);return m}function BRt(d,l){let u=0n,m=0,A=l.get();for(;A<d.length;){let T=d[A++];if(u|=BigInt(127&T)<<BigInt(m),!(128&T))break;if(m+=7,m>=64)throw new Error(\"Varint too long\")}return l.set(A),u}function FRt(d,l){let u,m;return m=d[l.get()],l.increment(),u=127&m,m<128?u:(m=d[l.get()],l.increment(),u|=(127&m)<<7,m<128?u:(m=d[l.get()],l.increment(),u|=(127&m)<<14,m<128?u:(m=d[l.get()],l.increment(),u|=(127&m)<<21,m<128?u:(m=d[l.get()],u|=(15&m)<<28,(function(A,T,M){let P,L;if(L=T[M.get()],M.increment(),P=(112&L)>>4,L<128||(L=T[M.get()],M.increment(),P|=(127&L)<<3,L<128)||(L=T[M.get()],M.increment(),P|=(127&L)<<10,L<128)||(L=T[M.get()],M.increment(),P|=(127&L)<<17,L<128)||(L=T[M.get()],M.increment(),P|=(127&L)<<24,L<128)||(L=T[M.get()],M.increment(),P|=(1&L)<<31,L<128))return 4294967296*P+(A>>>0);throw new Error(\"Expected varint not more than 10 bytes\")})(u,d,l)))))}function Mn(d){return d>>>1^-(1&d)}function Zl(d){return d>>1n^-(1n&d)}function q2(d){return d%2==1?(d+1)/-2:d/2}function Dj(d,l,u){if(u===void 0){u=0;for(let T=0;T<l;T++)u+=d[T]}let m=new Uint32Array(u),A=0;for(let T=0;T<l;T++){let M=d[T];m.fill(d[T+l],A,A+M),A+=M}return m}function Oj(d,l,u){if(u===void 0){u=0;for(let T=0;T<l;T++)u+=Number(d[T])}let m=new BigUint64Array(u),A=0;for(let T=0;T<l;T++){let M=Number(d[T]);m.fill(d[T+l],A,A+M),A+=M}return m}function Wot(d,l,u){let m=new Float64Array(u),A=0;for(let T=0;T<l;T++){let M=d[T];m.fill(d[T+l],A,A+M),A+=M}return m}function qot(d){let l=new Int32Array(d.length);l[0]=Mn(d[0]);let u=d.length/4*4,m=1;if(u>=4)for(;m<u-4;m+=4){let A=d[m+1],T=d[m+2],M=d[m+3];l[m]=Mn(d[m])+l[m-1],l[m+1]=Mn(A)+l[m],l[m+2]=Mn(T)+l[m+1],l[m+3]=Mn(M)+l[m+2]}for(;m!==d.length;++m)l[m]=Mn(d[m])+l[m-1];return l}function Hot(d){let l=new BigInt64Array(d.length);l[0]=Zl(d[0]);let u=d.length/4*4,m=1;if(u>=4)for(;m<u-4;m+=4){let A=d[m+1],T=d[m+2],M=d[m+3];l[m]=Zl(d[m])+l[m-1],l[m+1]=Zl(A)+l[m],l[m+2]=Zl(T)+l[m+1],l[m+3]=Zl(M)+l[m+2]}for(;m!==l.length;++m)l[m]=Zl(d[m])+l[m-1];return l}function Lj(d){let l=d.length/4*4,u=1;if(l>=4)for(let m=d[0];u<l-4;u+=4)m=d[u]+=m,m=d[u+1]+=m,m=d[u+2]+=m,m=d[u+3]+=m;for(;u!==d.length;)d[u]+=d[u-1],++u}var Ha,Mf,Av,uu,lo,sa,Yot,wy;function Kl(d,l){let u=(function(m,A){let T=m[A.get()],M=Object.values(Ha)[T>>4],P=null;switch(M){case Ha.DATA:P={dictionaryType:Object.values(Mf)[15&T]};break;case Ha.OFFSET:P={offsetType:Object.values(Av)[15&T]};break;case Ha.LENGTH:P={lengthType:Object.values(uu)[15&T]}}A.increment();let L=m[A.get()],O=Object.values(ki)[L>>5],V=Object.values(ki)[L>>2&7],F=Object.values(xy)[3&L];A.increment();let X=vl(m,A,2),j=X[0];return{physicalStreamType:M,logicalStreamType:P,logicalLevelTechnique1:O,logicalLevelTechnique2:V,physicalLevelTechnique:F,numValues:j,byteLength:X[1],decompressedCount:j}})(d,l);return u.logicalLevelTechnique1===ki.MORTON?(function(m,A,T){let M=vl(A,T,2);return{physicalStreamType:m.physicalStreamType,logicalStreamType:m.logicalStreamType,logicalLevelTechnique1:m.logicalLevelTechnique1,logicalLevelTechnique2:m.logicalLevelTechnique2,physicalLevelTechnique:m.physicalLevelTechnique,numValues:m.numValues,byteLength:m.byteLength,decompressedCount:m.decompressedCount,numBits:M[0],coordinateShift:M[1]}})(u,d,l):ki.RLE!==u.logicalLevelTechnique1&&ki.RLE!==u.logicalLevelTechnique2||xy.NONE===u.physicalLevelTechnique?u:(function(m,A,T){let M=vl(A,T,2);return{physicalStreamType:m.physicalStreamType,logicalStreamType:m.logicalStreamType,logicalLevelTechnique1:m.logicalLevelTechnique1,logicalLevelTechnique2:m.logicalLevelTechnique2,physicalLevelTechnique:m.physicalLevelTechnique,numValues:m.numValues,byteLength:m.byteLength,decompressedCount:M[1],runs:M[0],numRleValues:M[1]}})(u,d,l)}(function(d){d.PRESENT=\"PRESENT\",d.DATA=\"DATA\",d.OFFSET=\"OFFSET\",d.LENGTH=\"LENGTH\"})(Ha||(Ha={})),(function(d){d.NONE=\"NONE\",d.SINGLE=\"SINGLE\",d.SHARED=\"SHARED\",d.VERTEX=\"VERTEX\",d.MORTON=\"MORTON\",d.FSST=\"FSST\"})(Mf||(Mf={})),(function(d){d.VERTEX=\"VERTEX\",d.INDEX=\"INDEX\",d.STRING=\"STRING\",d.KEY=\"KEY\"})(Av||(Av={})),(function(d){d.VAR_BINARY=\"VAR_BINARY\",d.GEOMETRIES=\"GEOMETRIES\",d.PARTS=\"PARTS\",d.RINGS=\"RINGS\",d.TRIANGLES=\"TRIANGLES\",d.SYMBOL=\"SYMBOL\",d.DICTIONARY=\"DICTIONARY\"})(uu||(uu={})),(function(d){d[d.FLAT=0]=\"FLAT\",d[d.CONST=1]=\"CONST\",d[d.SEQUENCE=2]=\"SEQUENCE\",d[d.DICTIONARY=3]=\"DICTIONARY\",d[d.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(lo||(lo={}));class Ef{constructor(l,u){this.values=l,this._size=u}get(l){let u=Math.floor(l/8);return(this.values[u]>>l%8&1)==1}set(l,u){let m=Math.floor(l/8);this.values[m]=this.values[m]|(u?1:0)<<l%8}getInt(l){let u=Math.floor(l/8);return this.values[u]>>l%8&1}size(){return this._size}getBuffer(){return this.values}}function H2(d,l,u){if(!l)return d;let m=l.size(),A=new d.constructor(m),T=0;for(let M=0;M<m;M++)A[M]=l.get(M)?d[T++]:u;return A}function Bj(d,l,u,m,A){return(function(T,M,P,L){let O;switch(M.logicalLevelTechnique1){case ki.DELTA:if(M.logicalLevelTechnique2===ki.RLE){let V=M;if(!L)return(function(F,X,j){let nt=new Int32Array(j),st=0,pt=0;for(let mt=0;mt<X;mt++){let vt=F[mt],At=Mn(F[mt+X]);for(let wt=0;wt<vt;wt++)pt+=At,nt[st++]=pt}return nt})(T,V.runs,V.numRleValues);O=qot(T=Dj(T,V.runs,V.numRleValues))}else O=qot(T);break;case ki.RLE:O=(function(V,F,X){if(X===void 0){X=0;for(let st=0;st<F;st++)X+=V[st]}let j=new Int32Array(X),nt=0;for(let st=0;st<F;st++){let pt=V[st],mt=V[st+F];mt=Mn(mt),j.fill(mt,nt,nt+pt),nt+=pt}return j})(T,M.runs,M.numRleValues);break;case ki.MORTON:Lj(T),O=new Int32Array(T);break;case ki.COMPONENTWISE_DELTA:O=(function(V){if(V.length<2)return new Int32Array(V);let F=new Int32Array(V.length);F[0]=Mn(V[0]),F[1]=Mn(V[1]);let X=V.length/4*4,j=2;if(X>=4)for(;j<X-4;j+=4){let nt=V[j+1],st=V[j+2],pt=V[j+3];F[j]=Mn(V[j])+F[j-2],F[j+1]=Mn(nt)+F[j-1],F[j+2]=Mn(st)+F[j],F[j+3]=Mn(pt)+F[j+1]}for(;j!==V.length;j+=2)F[j]=Mn(V[j])+F[j-2],F[j+1]=Mn(V[j+1])+F[j-1];return F})(T);break;case ki.NONE:O=(function(V){let F=new Int32Array(V.length);for(let X=0;X<V.length;X++)F[X]=Mn(V[X]);return F})(T);break;default:throw new Error(`The specified Logical level technique is not supported: ${M.logicalLevelTechnique1}`)}return L?H2(O,L,0):O})(Y2(d,l,u),u,0,A)}function hu(d,l,u,m,A){return(function(T,M,P,L){let O;switch(M.logicalLevelTechnique1){case ki.DELTA:O=(function(V){let F=new Uint32Array(V.length);F[0]=Mn(V[0])>>>0;for(let X=1;X<V.length;X++)F[X]=F[X-1]+Mn(V[X])>>>0;return F})(M.logicalLevelTechnique2===ki.RLE?Dj(T,M.runs,M.numRleValues):T);break;case ki.RLE:O=Dj(T,M.runs,M.numRleValues);break;case ki.MORTON:Lj(T),O=T;break;case ki.COMPONENTWISE_DELTA:O=(function(V){if(V.length<2)return new Uint32Array(V);let F=new Uint32Array(V.length);F[0]=Mn(V[0])>>>0,F[1]=Mn(V[1])>>>0;for(let X=2;X<V.length;X+=2)F[X]=F[X-2]+Mn(V[X])>>>0,F[X+1]=F[X-1]+Mn(V[X+1])>>>0;return F})(T);break;case ki.NONE:O=T;break;default:throw new Error(`The specified Logical level technique is not supported: ${M.logicalLevelTechnique1}`)}return L?H2(O,L,0):O})(Y2(d,l,u),u,0,A)}function Ty(d,l,u){return(function(m,A){if(A.logicalLevelTechnique1===ki.DELTA&&A.logicalLevelTechnique2===ki.NONE)return(function(T){let M=new Int32Array(T.length+1);M[0]=0,M[1]=Mn(T[0]);let P=M[1];for(let L=2;L!==M.length;++L)P+=Mn(T[L-1]),M[L]=M[L-1]+P;return new Uint32Array(M)})(m);if(A.logicalLevelTechnique1===ki.RLE&&A.logicalLevelTechnique2===ki.NONE)return(function(T,M,P){let L=new Uint32Array(P+1);L[0]=0;let O=1,V=L[0];for(let F=0;F<M;F++){let X=T[F],j=T[F+M];for(let nt=O;nt<O+X;nt++)L[nt]=j+V,V=L[nt];O+=X}return L})(m,A.runs,A.numRleValues);if(A.logicalLevelTechnique1===ki.NONE&&A.logicalLevelTechnique2===ki.NONE){(function(M){let P=0;for(let L=0;L<M.length;L++)M[L]+=P,P=M[L]})(m);let T=new Uint32Array(A.numValues+1);return T[0]=0,T.set(m,1),T}if(A.logicalLevelTechnique1===ki.DELTA&&A.logicalLevelTechnique2===ki.RLE){let T=(function(M,P,L){let O=new Int32Array(L+1);O[0]=0;let V=1,F=O[0];for(let X=0;X<P;X++){let j=M[X],nt=M[X+P];nt=Mn(nt);for(let st=V;st<V+j;st++)O[st]=nt+F,F=O[st];V+=j}return O})(m,A.runs,A.numRleValues);return Lj(T),new Uint32Array(T)}throw new Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")})(Y2(d,l,u),u)}function Y2(d,l,u){let m=u.physicalLevelTechnique;switch(m){case xy.FAST_PFOR:return(function(A,T,M,P){return(function(L,O,V,F,X){let j=F.get();if(3&V)throw new Error(`FastPFOR: invalid encodedByteLength=${V} at offset=${j} (encodedBytes.length=${L.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let nt=V>>>2,st=(function(mt,vt){if(vt<=mt.encodedWords.length)return mt.encodedWords;let At=new Uint32Array(Math.max(16,2*vt));return mt.encodedWords=At,At})(X,nt);(function(mt,vt,At,wt){if(vt<0||At<0||vt+At>mt.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${vt}, byteLength=${At}, bytes.length=${mt.length})`);let St=Math.floor(At/4),Bt=At%4!=0,qt=Bt?St+1:St;if(wt.length<qt)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${wt.length} < ${qt}`);if(St>0){let te=mt.byteOffset+vt;if(3&te)for(let he=0;he<St;he++){let fe=vt+4*he;wt[he]=mt[fe]<<24|mt[fe+1]<<16|mt[fe+2]<<8|mt[fe+3]}else{let he=new Uint32Array(mt.buffer,te,St);for(let fe=0;fe<St;fe++)wt[fe]=0|CRt(he[fe])}}if(Bt){let te=vt+4*St,he=At-4*St,fe=0;for(let Se=0;Se<he;Se++)fe|=mt[te+Se]<<24-8*Se;wt[St]=0|fe}})(L,j,V,st);let pt=(function(mt,vt,At){let wt=0,St=0,Bt=new Uint32Array(vt),qt=At??Got();if(mt.length>0){let te=0|mt[wt];if(wt=wt+1|0,255&te)throw new Error(`FastPFOR decode: invalid alignedLength=${te} (expected multiple of 256)`);if(St+te>Bt.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${St}, alignedLength=${te}, out.length=${Bt.length})`);wt=(function(he,fe,Se,ve,be,Ae){let Ze=ve+kj(be,rg),nr=ve,er=Se;for(;nr!==Ze;){let Xe=Math.min(Rj,Ze-nr);er=ORt(he,fe,er,nr,Xe,Ae),nr=nr+Xe|0}return er})(mt,Bt,wt,St,te,qt),St=St+te|0}return(function(te,he,fe,Se,ve,be){if(be===0)return he;let Ae=0,Ze=he,nr=he+fe,er=ve,Xe=ve,Lr=ve+be,$i=0,rn=0;for(;Ze<nr&&Xe<Lr;){let yn=te[Ze]>>>Ae&255;if(Ae+=8,Ze+=Ae>>>5,Ae&=31,$i|=(127&yn)<<rn,128&yn)Se[Xe++]=0|$i,$i=0,rn=0;else if(rn+=7,rn>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${rn}, partial=${$i}, decoded=${Xe-er}/${be}, inPos=${Ze}, inEnd=${nr})`)}if(Xe!==Lr)throw new Error(`FastPFOR VByte: truncated stream (decoded=${Xe-er}, expected=${be}, consumedWords=${Ze-he}/${fe}, vbyteStart=${he}, vbyteEnd=${nr})`)})(mt,wt,mt.length-wt|0,Bt,St,vt-St|0),Bt})(st.subarray(0,nt),O,X.decoderWorkspace);return F.add(V),pt})(A,T,M,P,(function(L=16){if(L<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${L}`);let O=Math.max(16,0|L);return{encodedWords:new Uint32Array(O),decoderWorkspace:Got()}})(M>>>2))})(d,u.numValues,u.byteLength,l);case xy.VARINT:return vl(d,l,u.numValues);case xy.NONE:{let A=l.get();l.add(u.byteLength);let T=d.subarray(A,l.get());return new Uint32Array(T)}default:throw new Error(`Specified physicalLevelTechnique ${m} is not supported (yet).`)}}function Fj(d,l,u){let m=Y2(d,l,u);return m.length===1?m[0]:(function(A){return A[1]})(m)}function Xot(d,l,u){return(function(m){if(m.length===2){let A=Mn(m[1]);return[A,A]}return[Mn(m[2]),Mn(m[3])]})(Y2(d,l,u))}function Zot(d,l,u){return(function(m){if(m.length===2){let A=Zl(m[1]);return[A,A]}return[Zl(m[2]),Zl(m[3])]})(W2(d,l,u.numValues))}function Kot(d,l,u,m){return(function(A,T,M){let P;switch(T.logicalLevelTechnique1){case ki.DELTA:P=(function(L){let O=new BigUint64Array(L.length);O[0]=BigInt.asUintN(64,Zl(L[0]));for(let V=1;V<L.length;V++)O[V]=BigInt.asUintN(64,O[V-1]+Zl(L[V]));return O})(T.logicalLevelTechnique2===ki.RLE?Oj(A,T.runs,T.numRleValues):A);break;case ki.RLE:P=Oj(A,T.runs,T.numRleValues);break;case ki.NONE:P=A;break;default:throw new Error(`The specified Logical level technique is not supported: ${T.logicalLevelTechnique1}`)}return M?H2(P,M,0n):P})(W2(d,l,u.numValues),u,m)}function Qot(d,l,u){let m=W2(d,l,u.numValues);return m.length===1?m[0]:(function(A){return A[1]})(m)}function CR(d,l,u,m,A=\"int32\"){let T=d.logicalLevelTechnique1;if(T===ki.RLE)return d.runs===1?lo.CONST:lo.FLAT;if(T!==ki.DELTA||d.logicalLevelTechnique2!==ki.RLE)return d.numValues===1?lo.CONST:lo.FLAT;let M=l instanceof Ef?l.size():l;if(d.numRleValues!==M)return lo.FLAT;if(d.runs===1)return lo.SEQUENCE;if(d.runs!==2)return d.numValues===1?lo.CONST:lo.FLAT;let P=m.get();if(d.physicalLevelTechnique===xy.VARINT)return(function(V,F,X){let j=new $ot(F.get());if(X===\"int64\"){let st=W2(V,j,4);return st[2]===2n&&st[3]===2n}let nt=vl(V,j,4);return nt[2]===2&&nt[3]===2})(u,m,A)?lo.SEQUENCE:d.numValues===1?lo.CONST:lo.FLAT;let L=m.get(),O=new Int32Array(u.buffer,u.byteOffset+L,4);return m.set(P),O[2]===2&&O[3]===2?lo.SEQUENCE:d.numValues===1?lo.CONST:lo.FLAT}class Jot extends PR{getValueFromBuffer(l){return this.dataBuffer[l]}}class tst extends jot{constructor(l,u,m,A){super(l,BigInt64Array.of(u),m,A)}getValueFromBuffer(l){return this.dataBuffer[0]+BigInt(l)*this.delta}}function Nj(d,l,u){return{x:est(d,l)-u,y:est(d>>1,l)-u}}function est(d,l){let u=0;for(let m=0;m<l;m++)u|=(d&1<<2*m)>>m;return u}function X2(d,l,u,m,A,T,M){return d===wy.MORTON?(function(P,L,O,V,F,X){let j=new Array(F?V+1:V);for(let nt=0;nt<V;nt++){let st=Nj(P[L[O+nt]],X.numBits,X.coordinateShift);j[nt]=new s(st.x,st.y)}return F&&(j[j.length-1]=j[0]),j})(l,u,m,A,T,M):(function(P,L,O,V,F){let X=new Array(F?V+1:V);for(let j=0;j<2*V;j+=2){let nt=2*L[O+j/2];X[j/2]=new s(P[nt],P[nt+1])}return F&&(X[X.length-1]=X[0]),X})(l,u,m,A,T)}function Z2(d,l,u,m){let A=new Array(m?u+1:u);for(let T=0;T<2*u;T+=2)A[T/2]=new s(d[l+T],d[l+T+1]);return m&&(A[A.length-1]=A[0]),A}(function(d){d[d.POINT=0]=\"POINT\",d[d.LINESTRING=1]=\"LINESTRING\",d[d.POLYGON=2]=\"POLYGON\",d[d.MULTIPOINT=3]=\"MULTIPOINT\",d[d.MULTILINESTRING=4]=\"MULTILINESTRING\",d[d.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})(sa||(sa={})),(function(d){d[d.POINT=0]=\"POINT\",d[d.LINESTRING=1]=\"LINESTRING\",d[d.POLYGON=2]=\"POLYGON\"})(Yot||(Yot={})),(function(d){d[d.MORTON=0]=\"MORTON\",d[d.VEC_2=1]=\"VEC_2\",d[d.VEC_3=2]=\"VEC_3\"})(wy||(wy={}));class rst{constructor(l,u,m,A,T){this._vertexBufferType=l,this._topologyVector=u,this._vertexOffsets=m,this._vertexBuffer=A,this._mortonSettings=T}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(l){let u=this.vertexOffsets?2*this.vertexOffsets[l]:2*l;return[this.vertexBuffer[u],this.vertexBuffer[u+1]]}getVertex(l){if(this.vertexOffsets&&this.mortonSettings){let m=Nj(this.vertexBuffer[this.vertexOffsets[l]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[m.x,m.y]}let u=this.vertexOffsets?2*this.vertexOffsets[l]:2*l;return[this.vertexBuffer[u],this.vertexBuffer[u+1]]}getGeometries(){return(function(l){let u=new Array(l.numGeometries),m=1,A=1,T=1,M=0,P=0,L=0,O=l.mortonSettings,V=l.topologyVector,F=V.geometryOffsets,X=V.partOffsets,j=V.ringOffsets,nt=l.vertexOffsets,st=!nt||nt.length===0,pt=l.containsPolygonGeometry(),mt=l.vertexBuffer;for(let vt=0;vt<l.numGeometries;vt++)switch(l.geometryType(vt)){case sa.POINT:{let At,wt;if(st)At=mt[P++],wt=mt[P++];else if(l.vertexBufferType===wy.MORTON){let St=Nj(mt[nt[L++]],O.numBits,O.coordinateShift);At=St.x,wt=St.y}else{let St=2*nt[L++];At=mt[St],wt=mt[St+1]}u[M++]=[[new s(At,wt)]],F&&T++,X&&m++,j&&A++}break;case sa.MULTIPOINT:{let At=F[T]-F[T-1];T++;let wt=new Array(At);if(st)for(let St=0;St<At;St++){let Bt=mt[P++],qt=mt[P++];wt[St]=new s(Bt,qt)}else for(let St=0;St<At;St++){let Bt=2*nt[L++];wt[St]=new s(mt[Bt],mt[Bt+1])}u[M++]=wt.map((St=>[St])),m+=At,A+=At}break;case sa.LINESTRING:{let At,wt;pt?(At=j[A]-j[A-1],A++):At=X[m]-X[m-1],m++,st?(wt=Z2(mt,P,At,!1),P+=2*At):(wt=X2(l.vertexBufferType,mt,nt,L,At,!1,O),L+=At),u[M++]=[wt],F&&T++}break;case sa.POLYGON:{let At=X[m]-X[m-1];m++;let wt=new Array(At-1),St,Bt=j[A]-j[A-1];if(A++,st){St=Z2(mt,P,Bt,!0),P+=2*Bt;for(let qt=0;qt<wt.length;qt++)Bt=j[A]-j[A-1],A++,wt[qt]=Z2(mt,P,Bt,!0),P+=2*Bt}else{St=X2(l.vertexBufferType,mt,nt,L,Bt,!0,O),L+=Bt;for(let qt=0;qt<wt.length;qt++)Bt=j[A]-j[A-1],A++,wt[qt]=X2(l.vertexBufferType,mt,nt,L,Bt,!0,O),L+=Bt}u[M++]=[St].concat(wt),F&&T++}break;case sa.MULTILINESTRING:{let At=F[T]-F[T-1];T++;let wt=new Array(At);for(let St=0;St<At;St++){let Bt;if(pt?(Bt=j[A]-j[A-1],A++):Bt=X[m]-X[m-1],m++,st)wt[St]=Z2(mt,P,Bt,!1),P+=2*Bt;else{let qt=X2(l.vertexBufferType,mt,nt,L,Bt,!1,O);wt[St]=qt,L+=Bt}}u[M++]=wt}break;case sa.MULTIPOLYGON:{let At=F[T]-F[T-1];T++;let wt=new Array(At);for(let St=0;St<At;St++){let Bt=X[m]-X[m-1],qt;m++;let te=new Array(Bt-1),he=j[A]-j[A-1];A++,st?(qt=Z2(mt,P,he,!0),P+=2*he):(qt=X2(l.vertexBufferType,mt,nt,L,he,!0,O),L+=he);for(let fe=0;fe<te.length;fe++){let Se=j[A]-j[A-1];A++,st?(te[fe]=Z2(mt,P,Se,!0),P+=2*Se):(te[fe]=X2(l.vertexBufferType,mt,nt,L,Se,!0,O),L+=Se)}wt[St]=[qt].concat(te)}u[M++]=wt.flat()}break;default:throw new Error(\"The specified geometry type is currently not supported.\")}return u})(this)}get mortonSettings(){return this._mortonSettings}}class ist extends rst{constructor(l,u,m,A,T,M,P){super(m,A,T,M,P),this._numGeometries=l,this._geometryType=u}geometryType(l){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===sa.POLYGON||this._geometryType===sa.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class nst extends rst{constructor(l,u,m,A,T,M){super(l,m,A,T,M),this._geometryTypes=u}geometryType(l){return this._geometryTypes[l]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let l=0;l<this.numGeometries;l++)if(this.geometryType(l)===sa.POLYGON||this.geometryType(l)===sa.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class ost{constructor(l,u,m,A){this._triangleOffsets=l,this._indexBuffer=u,this._vertexBuffer=m,this._topologyVector=A}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error(\"Cannot convert GpuVector to coordinates without topology information\");let l=new Array(this.numGeometries),u=this._topologyVector,m=u.partOffsets,A=u.ringOffsets,T=u.geometryOffsets,M=0,P=1,L=1,O=1;for(let V=0;V<this.numGeometries;V++)switch(this.geometryType(V)){case sa.POLYGON:{let F=m[P]-m[P-1];P++;let X=[];for(let j=0;j<F;j++){let nt=A[L]-A[L-1];L++;let st=[];for(let pt=0;pt<nt;pt++){let mt=this._vertexBuffer[M++],vt=this._vertexBuffer[M++];st.push(new s(mt,vt))}st.length>0&&st.push(st[0]),X.push(st)}l[V]=X,T&&O++}break;case sa.MULTIPOLYGON:{let F=T[O]-T[O-1];O++;let X=[];for(let j=0;j<F;j++){let nt=m[P]-m[P-1];P++;for(let st=0;st<nt;st++){let pt=A[L]-A[L-1];L++;let mt=[];for(let vt=0;vt<pt;vt++){let At=this._vertexBuffer[M++],wt=this._vertexBuffer[M++];mt.push(new s(At,wt))}mt.length>0&&mt.push(mt[0]),X.push(mt)}}l[V]=X}}return l}[Symbol.iterator](){return null}}function sst(d,l,u,m,A,T){return new NRt(d,l,u,m,A,T)}class NRt extends ost{constructor(l,u,m,A,T,M){super(m,A,T,M),this._numGeometries=l,this._geometryType=u}geometryType(l){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function ast(d,l,u,m,A){return new zRt(d,l,u,m,A)}class zRt extends ost{constructor(l,u,m,A,T){super(u,m,A,T),this._geometryTypes=l}geometryType(l){return this._geometryTypes[l]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function URt(d,l,u,m,A){let T=Kl(d,u),M,P,L,O;if(CR(T,m,d,u)===lo.CONST){let vt=Fj(d,u,T),At,wt,St,Bt;for(let qt=0;qt<l-1;qt++){let te=Kl(d,u);switch(te.physicalStreamType){case Ha.LENGTH:switch(te.logicalStreamType.lengthType){case uu.GEOMETRIES:At=Ty(d,u,te);break;case uu.PARTS:wt=Ty(d,u,te);break;case uu.RINGS:St=Ty(d,u,te);break;case uu.TRIANGLES:Bt=Ty(d,u,te)}break;case Ha.OFFSET:switch(te.logicalStreamType.offsetType){case Av.VERTEX:M=hu(d,u,te);break;case Av.INDEX:O=hu(d,u,te)}break;case Ha.DATA:Mf.VERTEX===te.logicalStreamType.dictionaryType?P=Bj(d,u,te):(L={numBits:te.numBits,coordinateShift:te.coordinateShift},P=hu(d,u,te))}}return O?At!==void 0||wt!==void 0?sst(m,vt,Bt,O,P,{geometryOffsets:At,partOffsets:wt,ringOffsets:St}):sst(m,vt,Bt,O,P):L===void 0?(function(qt,te,he,fe,Se){return new ist(qt,te,wy.VEC_2,he,fe,Se)})(m,vt,{geometryOffsets:At,partOffsets:wt,ringOffsets:St},M,P):(function(qt,te,he,fe,Se,ve){return new ist(qt,te,wy.MORTON,he,fe,Se,ve)})(m,vt,{geometryOffsets:At,partOffsets:wt,ringOffsets:St},M,P,L)}let V=hu(d,u,T),F,X,j,nt,st,pt,mt;for(let vt=0;vt<l-1;vt++){let At=Kl(d,u);switch(At.physicalStreamType){case Ha.LENGTH:switch(At.logicalStreamType.lengthType){case uu.GEOMETRIES:F=hu(d,u,At);break;case uu.PARTS:X=hu(d,u,At);break;case uu.RINGS:j=hu(d,u,At);break;case uu.TRIANGLES:nt=Ty(d,u,At)}break;case Ha.OFFSET:switch(At.logicalStreamType.offsetType){case Av.VERTEX:M=hu(d,u,At);break;case Av.INDEX:O=hu(d,u,At)}break;case Ha.DATA:Mf.VERTEX===At.logicalStreamType.dictionaryType?P=Bj(d,u,At):(L={numBits:At.numBits,coordinateShift:At.coordinateShift},P=hu(d,u,At))}}return F?(st=zj(V,F,2),X&&j?(pt=lst(V,st,X,!1),mt=(function(vt,At,wt,St){let Bt=new Uint32Array(wt[wt.length-1]+1),qt=0;Bt[0]=qt;let te=1,he=1,fe=0;for(let Se=0;Se<vt.length;Se++){let ve=vt[Se],be=At[Se+1]-At[Se];if(ve!==0&&ve!==3)for(let Ae=0;Ae<be;Ae++){let Ze=wt[te]-wt[te-1];te++;for(let nr=0;nr<Ze;nr++)qt=Bt[he++]=qt+St[fe++]}else for(let Ae=0;Ae<be;Ae++)Bt[he++]=++qt,te++}return Bt})(V,st,pt,j)):X&&(pt=(function(vt,At,wt){let St=new Uint32Array(At[At.length-1]+1),Bt=0;St[0]=Bt;let qt=1,te=0;for(let he=0;he<vt.length;he++){let fe=vt[he],Se=At[he+1]-At[he];if(fe===4||fe===1)for(let ve=0;ve<Se;ve++)Bt=St[qt++]=Bt+wt[te++];else for(let ve=0;ve<Se;ve++)St[qt++]=++Bt}return St})(V,st,X))):X&&j?(pt=zj(V,X,1),mt=lst(V,pt,j,!0)):X&&(pt=zj(V,X,0)),O&&!pt?ast(V,nt,O,P):O?ast(V,nt,O,P,{geometryOffsets:st,partOffsets:pt,ringOffsets:mt}):L===void 0?(function(vt,At,wt,St){return new nst(wy.VEC_2,vt,At,wt,St)})(V,{geometryOffsets:st,partOffsets:pt,ringOffsets:mt},M,P):(function(vt,At,wt,St,Bt){return new nst(wy.MORTON,vt,At,wt,St,Bt)})(V,{geometryOffsets:st,partOffsets:pt,ringOffsets:mt},M,P,L)}function zj(d,l,u){let m=new Uint32Array(d.length+1),A=0;m[0]=A;let T=0;for(let M=0;M<d.length;M++)A=m[M+1]=A+(d[M]>u?l[T++]:1);return m}function lst(d,l,u,m){let A=new Uint32Array(l[l.length-1]+1),T=0;A[0]=T;let M=1,P=0;for(let L=0;L<d.length;L++){let O=d[L],V=l[L+1]-l[L];if(O===5||O===2||m&&(O===4||O===1))for(let F=0;F<V;F++)T=A[M++]=T+u[P++];else for(let F=0;F<V;F++)A[M++]=++T}return A}class VRt extends G2{constructor(l,u,m){super(l,u.getBuffer(),m),this.dataVector=u}getValueFromBuffer(l){return this.dataVector.get(l)}}class jRt extends PR{getValueFromBuffer(l){return this.dataBuffer[l]}}class cst extends G2{constructor(l,u,m,A){super(l,A?BigInt64Array.of(u):BigUint64Array.of(u),m)}getValueFromBuffer(l){return this.dataBuffer[0]}}function WM(d,l,u,m,A){let T=(function(M,P,L,O){let V=new Uint8Array(P),F=0,X=O.get()+L;for(;F<P&&!(O.get()>=X);){let j=M[O.increment()];if(j<=127){let nt=j+3,st=M[O.increment()],pt=Math.min(F+nt,P);V.fill(st,F,pt),F=pt}else{let nt=256-j;for(let st=0;st<nt&&F<P;st++)V[F++]=M[O.increment()]}}return O.set(X),V})(d,Math.ceil(l/8),u,m);return A?(function(M,P,L){if(!L)return M;let O=L.size(),V=new Ef(M,P),F=new Ef(new Uint8Array(Math.ceil(O/8)),O),X=0;for(let j=0;j<O;j++){let nt=!!L.get(j)&&V.get(X++);F.set(j,nt)}return F.getBuffer()})(T,l,A):T}let $Rt=new TextDecoder;function Uj(d,l,u){return u-l>=12?$Rt.decode(d.subarray(l,u)):(function(m,A,T){let M=\"\",P=A;for(;P<T;){let L=m[P],O,V,F,X=null,j=L>239?4:L>223?3:L>191?2:1;if(P+j>T)break;j===1?L<128&&(X=L):j===2?(O=m[P+1],(192&O)==128&&(X=(31&L)<<6|63&O,X<=127&&(X=null))):j===3?(O=m[P+1],V=m[P+2],(192&O)==128&&(192&V)==128&&(X=(15&L)<<12|(63&O)<<6|63&V,(X<=2047||X>=55296&&X<=57343)&&(X=null))):j===4&&(O=m[P+1],V=m[P+2],F=m[P+3],(192&O)==128&&(192&V)==128&&(192&F)==128&&(X=(15&L)<<18|(63&O)<<12|(63&V)<<6|63&F,(X<=65535||X>=1114112)&&(X=null))),X===null?(X=65533,j=1):X>65535&&(X-=65536,M+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),M+=String.fromCharCode(X),P+=j}return M})(d,l,u)}class Vj extends G2{constructor(l,u,m,A){super(l,m,A),this.offsetBuffer=u}}class ust extends Vj{constructor(l,u,m,A){super(l,u,m,A??u.length-1)}getValueFromBuffer(l){return Uj(this.dataBuffer,this.offsetBuffer[l],this.offsetBuffer[l+1])}}class K2 extends Vj{constructor(l,u,m,A,T){super(l,m,A,T??u.length),this.indexBuffer=u,this.indexBuffer=u}getValueFromBuffer(l){let u=this.indexBuffer[l];return Uj(this.dataBuffer,this.offsetBuffer[u],this.offsetBuffer[u+1])}}class hst extends Vj{constructor(l,u,m,A,T,M,P){super(l,m,A,P),this.indexBuffer=u,this.symbolOffsetBuffer=T,this.symbolTableBuffer=M}getValueFromBuffer(l){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=(function(m,A,T){let M=[],P=new Array(A.length).fill(0);for(let L=1;L<A.length;L++)P[L]=P[L-1]+A[L-1];for(let L=0;L<T.length;L++)if(T[L]===255)M.push(T[++L]);else{let O=A[T[L]],V=P[T[L]];for(let F=0;F<O;F++)M.push(m[V+F])}return new Uint8Array(M)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let u=this.indexBuffer[l];return Uj(this.decodedDictionary,this.offsetBuffer[u],this.offsetBuffer[u+1])}offsetToLengthBuffer(l){let u=new Uint32Array(l.length-1),m=l[0];for(let A=1;A<l.length;A++){let T=l[A];u[A-1]=T-m,m=T}return u}}function GRt(d,l,u,m,A,T){return u.type===\"scalarType\"?(function(M,P,L,O,V,F){let X=null;if(M===0)return null;if(F.nullable){let nt=Kl(P,L),st=nt.numValues,pt=L.get(),mt=WM(P,st,nt.byteLength,L);L.set(pt+nt.byteLength),X=new Ef(mt,nt.numValues)}let j=X??O;switch(V.physicalType){case 4:case 3:return(function(nt,st,pt,mt,vt){let At=Kl(nt,st),wt=CR(At,vt,nt,st),St=mt.physicalType===3;if(wt===lo.FLAT){let qt=qM(vt)?vt:void 0,te=St?Bj(nt,st,At,0,qt):hu(nt,st,At,0,qt);return new Sj(pt.name,te,vt)}if(wt===lo.SEQUENCE){let qt=Xot(nt,st,At);return new Ej(pt.name,qt[0],qt[1],At.numRleValues)}let Bt=St?(function(qt,te,he){let fe=Y2(qt,te,he);return fe.length===1?Mn(fe[0]):(function(Se){return Mn(Se[1])})(fe)})(nt,st,At):Fj(nt,st,At);return new Pj(pt.name,Bt,vt,St)})(P,L,F,V,j);case 9:return(function(nt,st,pt,mt,vt){let At=null,wt=null,St=null,Bt=null,qt=null,te=vt??null,he=null,fe=null;for(let Se=0;Se<mt;Se++){let ve=Kl(st,pt);switch(ve.physicalStreamType){case Ha.PRESENT:{let be=WM(st,ve.numValues,ve.byteLength,pt),Ae=new Ef(be,ve.numValues);te=vt??Ae;break}case Ha.OFFSET:wt=hu(st,pt,ve,0,te);break;case Ha.LENGTH:{let be=Ty(st,pt,ve);uu.DICTIONARY===ve.logicalStreamType.lengthType?At=be:uu.SYMBOL===ve.logicalStreamType.lengthType?Bt=be:he=be;break}case Ha.DATA:{let be=st.subarray(pt.get(),pt.get()+ve.byteLength);pt.add(ve.byteLength);let Ae=ve.logicalStreamType.dictionaryType;Mf.FSST===Ae?qt=be:Mf.SINGLE===Ae||Mf.SHARED===Ae?St=be:Mf.NONE===Ae&&(fe=be);break}}}return(function(Se,ve,be,Ae,Ze,nr,er){return ve?new hst(Se,be,Ae,Ze,nr,ve,er):null})(nt,qt,wt,At,St,Bt,te)??(function(Se,ve,be,Ae,Ze){return ve?Ze?new K2(Se,be,Ae,ve,Ze):new K2(Se,be,Ae,ve):null})(nt,St,wt,At,te)??(function(Se,ve,be,Ae,Ze){if(!ve||!be)return null;if(Ae)return Ze?new K2(Se,Ae,ve,be,Ze):new K2(Se,Ae,ve,be);if(Ze&&Ze.size()!==ve.length-1){let nr=new Uint32Array(Ze.size()),er=0;for(let Xe=0;Xe<Ze.size();Xe++)nr[Xe]=Ze.get(Xe)?er++:0;return new K2(Se,nr,ve,be,Ze)}return Ze?new ust(Se,ve,be,Ze):new ust(Se,ve,be)})(nt,he,fe,wt,te)})(F.name,P,L,F.nullable?M-1:M,X);case 0:return(function(nt,st,pt,mt,vt){let At=Kl(nt,st),wt=At.numValues,St=st.get(),Bt=qM(vt)?vt:void 0,qt=WM(nt,wt,At.byteLength,st,Bt);st.set(St+At.byteLength);let te=new Ef(qt,wt);return new VRt(pt.name,te,vt)})(P,L,F,0,j);case 6:case 5:return(function(nt,st,pt,mt,vt){let At=Kl(nt,st),wt=CR(At,mt,nt,st,\"int64\"),St=vt.physicalType===5;if(wt===lo.FLAT){let qt=qM(mt)?mt:void 0,te=St?(function(he,fe,Se,ve){return(function(be,Ae,Ze){let nr;switch(Ae.logicalLevelTechnique1){case ki.DELTA:if(Ae.logicalLevelTechnique2===ki.RLE){let er=Ae;if(!Ze)return(function(Xe,Lr,$i){let rn=new BigInt64Array($i),yn=0,Xa=0n;for(let Oo=0;Oo<Lr;Oo++){let zs=Number(Xe[Oo]),aa=Zl(Xe[Oo+Lr]);for(let co=0;co<zs;co++)Xa+=aa,rn[yn++]=Xa}return rn})(be,er.runs,er.numRleValues);nr=Hot(be=Oj(be,er.runs,er.numRleValues))}else nr=Hot(be);break;case ki.RLE:nr=(function(er,Xe,Lr){if(Lr===void 0){Lr=0;for(let yn=0;yn<Xe;yn++)Lr+=Number(er[yn])}let $i=new BigInt64Array(Lr),rn=0;for(let yn=0;yn<Xe;yn++){let Xa=Number(er[yn]),Oo=er[yn+Xe];Oo=Zl(Oo),$i.fill(Oo,rn,rn+Xa),rn+=Xa}return $i})(be,Ae.runs,Ae.numRleValues);break;case ki.NONE:nr=(function(er){let Xe=new BigInt64Array(er.length);for(let Lr=0;Lr<er.length;Lr++)Xe[Lr]=Zl(er[Lr]);return Xe})(be);break;default:throw new Error(`The specified Logical level technique is not supported: ${Ae.logicalLevelTechnique1}`)}return Ze?H2(nr,Ze,0n):nr})(W2(he,fe,Se.numValues),Se,ve)})(nt,st,At,qt):Kot(nt,st,At,qt);return new Jot(pt.name,te,mt)}if(wt===lo.SEQUENCE){let qt=Zot(nt,st,At);return new tst(pt.name,qt[0],qt[1],At.numRleValues)}let Bt=St?(function(qt,te,he){let fe=W2(qt,te,he.numValues);return fe.length===1?Zl(fe[0]):(function(Se){return Zl(Se[1])})(fe)})(nt,st,At):Qot(nt,st,At);return new cst(pt.name,Bt,mt,St)})(P,L,F,j,V);case 7:return(function(nt,st,pt,mt){let vt=Kl(nt,st),At=qM(mt)?mt:void 0,wt=(function(St,Bt,qt,te){let he=Bt.get(),fe=he+qt*Float32Array.BYTES_PER_ELEMENT,Se=new Uint8Array(St.subarray(he,fe)).buffer,ve=new Float32Array(Se);return Bt.set(fe),te?H2(ve,te,0):ve})(nt,st,vt.numValues,At);return new jRt(pt.name,wt,mt)})(P,L,F,j);case 8:return(function(nt,st,pt,mt){let vt=Kl(nt,st),At=qM(mt)?mt:void 0,wt=(function(St,Bt,qt,te){let he=Bt.get(),fe=he+qt*Float64Array.BYTES_PER_ELEMENT,Se=new Uint8Array(St.subarray(he,fe)).buffer,ve=new Float64Array(Se);return Bt.set(fe),te?H2(ve,te,0):ve})(nt,st,vt.numValues,At);return new Mj(pt.name,wt,mt)})(P,L,F,j);default:throw new Error(`The specified data type for the field is currently not supported: ${V}`)}})(m,d,l,A,u.scalarType,u):m===0?null:(function(M,P,L,O){let V=null,F=null,X=null,j=null,nt=!1;for(;!nt;){let vt=Kl(M,P);switch(vt.physicalStreamType){case Ha.LENGTH:uu.DICTIONARY===vt.logicalStreamType.lengthType?V=Ty(M,P,vt):X=Ty(M,P,vt);break;case Ha.DATA:Mf.SINGLE===vt.logicalStreamType.dictionaryType||Mf.SHARED===vt.logicalStreamType.dictionaryType?(F=M.subarray(P.get(),P.get()+vt.byteLength),nt=!0):j=M.subarray(P.get(),P.get()+vt.byteLength),P.add(vt.byteLength)}}let st=L.complexType.children,pt=[],mt=0;for(let vt of st){let At=vl(M,P,1)[0];if(At===0)continue;let wt=vt.name?`${L.name}${vt.name}`:L.name;if(At!==2||vt.type!==\"scalarField\"||vt.scalarField.physicalType!==9)throw new Error(\"Currently only optional string fields are implemented for a struct.\");let St=Kl(M,P),Bt=WM(M,St.numValues,St.byteLength,P),qt=Kl(M,P),te=hu(M,P,qt,0,qt.decompressedCount!==O?new Ef(Bt,St.numValues):void 0);pt[mt++]=j?new hst(wt,te,V,F,X,j,new Ef(Bt,St.numValues)):new K2(wt,te,V,F,new Ef(Bt,St.numValues))}return pt})(d,l,u,A)}function qM(d){return d instanceof Ef}function dst(d){switch(d){case 0:case 1:case 2:case 3:{let l={};l.nullable=!!(1&d),l.columnScope=0;let u={type:\"logicalType\",logicalType:0};return u.longID=!!(2&d),l.scalarType=u,l.type=\"scalarType\",l}case 4:{let l={nullable:!1,columnScope:0},u={type:\"physicalType\",physicalType:0};return l.type=\"complexType\",l.complexType=u,l}case 30:{let l={nullable:!1,columnScope:0},u={type:\"physicalType\",physicalType:1};return l.type=\"complexType\",l.complexType=u,l}default:return(function(l){let u;switch(l){case 10:case 11:u=0;break;case 12:case 13:u=1;break;case 14:case 15:u=2;break;case 16:case 17:u=3;break;case 18:case 19:u=4;break;case 20:case 21:u=5;break;case 22:case 23:u=6;break;case 24:case 25:u=7;break;case 26:case 27:u=8;break;case 28:case 29:u=9;break;default:return null}let m={};m.nullable=!!(1&l),m.columnScope=0;let A={type:\"physicalType\"};return A.physicalType=u,m.type=\"scalarType\",m.scalarType=A,m})(d)}}function fst(d){return d>=10}function pst(d){return d===30}function WRt(d){if(d.type===\"scalarType\"){let l=d.scalarType;if(l.type===\"physicalType\")switch(l.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if(l.type===\"logicalType\")return!1}else if(d.type===\"complexType\"){let l=d.complexType;if(l.type===\"physicalType\")switch(l.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",d),!1}function qRt(d){return d.type===\"complexType\"&&d.complexType?.type===\"physicalType\"&&d.complexType.physicalType===0}let HRt=new TextDecoder;function jj(d,l){let u=vl(d,l,1)[0];if(u===0)return\"\";let m=l.get(),A=d.subarray(m,m+u);return l.add(u),HRt.decode(A)}function mst(d,l){let u=vl(d,l,1)[0]>>>0;if(u<10||u>30)throw new Error(`Unsupported field type code ${u}. Supported: 10-29(scalars), 30(STRUCT)`);let m=dst(u);if(fst(u)&&(m.name=jj(d,l)),pst(u)){let A=vl(d,l,1)[0]>>>0;m.complexType.children=new Array(A);for(let T=0;T<A;T++)m.complexType.children[T]=mst(d,l)}return(function(A){return{name:A.name,nullable:A.nullable,scalarField:A.scalarType,complexField:A.complexType,type:A.type===\"scalarType\"?\"scalarField\":\"complexField\"}})(m)}function YRt(d,l){let u=vl(d,l,1)[0]>>>0,m=dst(u);if(!m)throw new Error(`Unsupported column type code ${u}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(fst(u)?m.name=jj(d,l):u>=0&&u<=3?m.name=\"id\":u===4&&(m.name=\"geometry\"),pst(u)){let A=vl(d,l,1)[0]>>>0,T=m.complexType;T.children=new Array(A);for(let M=0;M<A;M++)T.children[M]=mst(d,l)}return m}function XRt(d,l){let u={featureTables:[]},m={};m.name=jj(d,l);let A=vl(d,l,1)[0]>>>0,T=vl(d,l,1)[0]>>>0;m.columns=new Array(T);for(let M=0;M<T;M++)m.columns[M]=YRt(d,l);return u.featureTables.push(m),[u,A]}function ZRt(d,l,u,m,A,T,M=!1){let P=l.scalarType;if(!P||P.type!==\"logicalType\"||P.logicalType!==0)throw new Error(`ID column must be a logical ID scalar type: ${m}`);let L=P.longID?6:4,O=typeof T==\"number\"?void 0:T,V=CR(A,T,d,u,L===6?\"int64\":\"int32\");if(L===4)switch(V){case lo.FLAT:{let F=hu(d,u,A,0,O);return new Sj(m,F,T)}case lo.SEQUENCE:{let F=Xot(d,u,A);return new Ej(m,F[0],F[1],A.numRleValues)}case lo.CONST:{let F=Fj(d,u,A);return new Pj(m,F,T,!1)}}switch(V){case lo.FLAT:{if(M){let X=(function(j,nt,st){let pt=(function(mt,vt,At){let wt=new Float64Array(At);for(let St=0;St<At;St++)wt[St]=FRt(mt,vt);return wt})(j,nt,st.numValues);return(function(mt,vt){switch(vt.logicalLevelTechnique1){case ki.DELTA:return vt.logicalLevelTechnique2===ki.RLE&&(mt=Wot(mt,vt.runs,vt.numRleValues)),(function(At){At[0]=q2(At[0]);let wt=At.length/4*4,St=1;if(wt>=4)for(;St<wt-4;St+=4){let Bt=At[St+1],qt=At[St+2],te=At[St+3];At[St]=q2(At[St])+At[St-1],At[St+1]=q2(Bt)+At[St],At[St+2]=q2(qt)+At[St+1],At[St+3]=q2(te)+At[St+2]}for(;St!==At.length;++St)At[St]=q2(At[St])+At[St-1]})(mt),mt;case ki.RLE:return(function(At,wt){return Wot(At,wt.runs,wt.numRleValues)})(mt,vt);case ki.NONE:return mt;default:throw new Error(`The specified Logical level technique is not supported: ${vt.logicalLevelTechnique1}`)}})(pt,st)})(d,u,A);return new Mj(m,X,T)}let F=Kot(d,u,A,O);return new Jot(m,F,T)}case lo.SEQUENCE:{let F=Zot(d,u,A);return new tst(m,F[0],F[1],A.numRleValues)}case lo.CONST:{let F=Qot(d,u,A);return new cst(m,F,T,!1)}}throw new Error(\"Vector type not supported for id column.\")}class KRt{constructor(l,u){var m;switch(this._featureData=l,this.properties=this._featureData.properties||{},(m=this._featureData.geometry)===null||m===void 0?void 0:m.type){case sa.POINT:case sa.MULTIPOINT:this.type=1;break;case sa.LINESTRING:case sa.MULTILINESTRING:this.type=2;break;case sa.POLYGON:case sa.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=u,this.id=Number(this._featureData.id)}loadGeometry(){let l=[];for(let u of this._featureData.geometry.coordinates){let m=[];for(let A of u)m.push(new s(A.x,A.y));l.push(m)}return l}}class QRt{constructor(l){this.features=[],this.featureTable=l,this.name=l.name,this.extent=l.extent,this.version=2,this.features=l.getFeatures(),this.length=this.features.length}feature(l){return new KRt(this.features[l],this.extent)}}class gst{constructor(l){this.layers={};let u=(function(m,A,T=!0){let M=new $ot(0),P=[];for(;M.get()<m.length;){let O=vl(m,M,1)[0]>>>0,V=M.get()+O;if(V>m.length)throw new Error(`Block overruns tile: ${V} > ${m.length}`);if(vl(m,M,1)[0]>>>0!=1){M.set(V);continue}let[F,X]=XRt(m,M),j=F.featureTables[0],nt=null,st=null,pt=[],mt=0;for(let At of j.columns){let wt=At.name;if((L=At).type===\"scalarType\"&&L.scalarType?.type===\"logicalType\"&&L.scalarType.logicalType===0){let St=null;if(At.nullable){let qt=Kl(m,M),te=M.get(),he=WM(m,qt.numValues,qt.byteLength,M);M.set(te+qt.byteLength),St=new Ef(he,qt.numValues)}let Bt=Kl(m,M);mt=St?St.size():Bt.decompressedCount,nt=ZRt(m,At,M,wt,Bt,St??mt,T)}else if(qRt(At)){let St=vl(m,M,1)[0];if(mt===0){let Bt=M.get();mt=Kl(m,M).decompressedCount,M.set(Bt)}st=URt(m,St,M,mt)}else{let St=WRt(At)?vl(m,M,1)[0]:1;if(St===0)continue;let Bt=GRt(m,M,At,St,mt);if(Bt)if(Array.isArray(Bt))for(let qt of Bt)pt.push(qt);else pt.push(Bt)}}let vt=new PRt(j.name,st,nt,pt,X);P.push(vt),M.set(V)}var L;return P})(new Uint8Array(l));this.layers=u.reduce(((m,A)=>Object.assign(Object.assign({},m),{[A.name]:new QRt(A)})),{})}}class JRt{constructor(l,u){this.feature=l,this.type=l.type,this.properties=l.tags?l.tags:{},this.extent=u,\"id\"in l&&(typeof l.id==\"string\"?this.id=parseInt(l.id,10):typeof l.id!=\"number\"||isNaN(l.id)||(this.id=l.id))}loadGeometry(){let l=[],u=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let m of u){let A=[];for(let T of m)A.push(new s(T[0],T[1]));l.push(A)}return l}}let HM=\"_geojsonTileLayer\";function t7t(d,l,u=\"\"){l.writeVarintField(15,d.version||1),l.writeStringField(1,d.name||\"\"),l.writeVarintField(5,d.extent||4096);let m={jsonPrefix:u,keys:[],values:[],keycache:{},valuecache:{}};for(let M=0;M<d.length;M++)m.feature=d.feature(M),l.writeMessage(2,e7t,m);let A=m.keys;for(let M of A)l.writeStringField(3,M);let T=m.values;for(let M of T)l.writeMessage(4,n7t,M)}function e7t(d,l){if(!d.feature)return;let u=d.feature;u.id!==void 0&&l.writeVarintField(1,u.id),l.writeMessage(2,r7t,d),l.writeVarintField(3,u.type),l.writeMessage(4,i7t,u)}function r7t(d,l){for(let u in d.feature?.properties){let m=d.feature.properties[u],A=d.keycache[u];if(m==null)continue;A===void 0&&(d.keys.push(u),A=d.keys.length-1,d.keycache[u]=A),l.writeVarint(A),typeof m!=\"string\"&&typeof m!=\"boolean\"&&typeof m!=\"number\"&&(m=d.jsonPrefix+JSON.stringify(m));let T=typeof m+\":\"+m,M=d.valuecache[T];M===void 0&&(d.values.push(m),M=d.values.length-1,d.valuecache[T]=M),l.writeVarint(M)}}function $j(d,l){return(l<<3)+(7&d)}function Ast(d){return d<<1^d>>31}function i7t(d,l){let u=d.loadGeometry(),m=d.type,A=0,T=0;for(let M of u){let P=1;m===1&&(P=M.length),l.writeVarint($j(1,P));let L=m===3?M.length-1:M.length;for(let O=0;O<L;O++){O===1&&m!==1&&l.writeVarint($j(2,L-1));let V=M[O].x-A,F=M[O].y-T;l.writeVarint(Ast(V)),l.writeVarint(Ast(F)),A+=V,T+=F}d.type===3&&l.writeVarint($j(7,1))}}function n7t(d,l){let u=typeof d;u===\"string\"?l.writeStringField(1,d):u===\"boolean\"?l.writeBooleanField(7,d):u===\"number\"&&(d%1!=0?l.writeDoubleField(3,d):d<0?l.writeSVarintField(6,d):l.writeVarintField(5,d))}class yst{constructor(l,u){this.tileID=l,this.x=l.canonical.x,this.y=l.canonical.y,this.z=l.canonical.z,this.grid=new jm(Pe,16,0),this.grid3D=new jm(Pe,16,0),this.featureIndexArray=new Pt,this.promoteId=u}insert(l,u,m,A,T,M){let P=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(m,A,T);let L=M?this.grid3D:this.grid;for(let O=0;O<u.length;O++){let V=u[O],F=[1/0,1/0,-1/0,-1/0];for(let X=0;X<V.length;X++){let j=V[X];F[0]=Math.min(F[0],j.x),F[1]=Math.min(F[1],j.y),F[2]=Math.max(F[2],j.x),F[3]=Math.max(F[3],j.y)}F[0]<Pe&&F[1]<Pe&&F[2]>=0&&F[3]>=0&&L.insert(P,F[0],F[1],F[2],F[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!==\"mlt\"?new Wnt(new wR(this.rawTileData)).layers:new gst(this.rawTileData).layers,this.sourceLayerCoder=new Uot(this.vtLayers?Object.keys(this.vtLayers).sort():[HM])),this.vtLayers}query(l,u,m,A){this.loadVTLayers();let T=l.params,M=Pe/l.tileSize/l.scale,P=Qh(T.filter,T.globalState),L=l.queryGeometry,O=l.queryPadding*M,V=gv.fromPoints(L),F=this.grid.query(V.minX-O,V.minY-O,V.maxX+O,V.maxY+O),X=gv.fromPoints(l.cameraQueryGeometry).expandBy(O),j=this.grid3D.query(X.minX,X.minY,X.maxX,X.maxY,((pt,mt,vt,At)=>(function(wt,St,Bt,qt,te){for(let fe of wt)if(St<=fe.x&&Bt<=fe.y&&qt>=fe.x&&te>=fe.y)return!0;let he=[new s(St,Bt),new s(St,te),new s(qt,te),new s(qt,Bt)];if(wt.length>2){for(let fe of he)if(R2(wt,fe))return!0}for(let fe=0;fe<wt.length-1;fe++)if(F8t(wt[fe],wt[fe+1],he))return!0;return!1})(l.cameraQueryGeometry,pt-O,mt-O,vt+O,At+O)));for(let pt of j)F.push(pt);F.sort(o7t);let nt={},st;for(let pt=0;pt<F.length;pt++){let mt=F[pt];if(mt===st)continue;st=mt;let vt=this.featureIndexArray.get(mt),At=null;this.loadMatchingFeature(nt,vt.bucketIndex,vt.sourceLayerIndex,vt.featureIndex,P,T.layers,T.availableImages,u,m,A,((wt,St,Bt)=>(At||(At=cr(wt)),St.queryIntersectsFeature({queryGeometry:L,feature:wt,featureState:Bt,geometry:At,zoom:this.z,transform:l.transform,pixelsToTileUnits:M,pixelPosMatrix:l.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:l.getElevation}))))}return nt}loadMatchingFeature(l,u,m,A,T,M,P,L,O,V,F){let X=this.bucketLayerIDs[u];if(M&&!X.some((pt=>M.has(pt))))return;let j=this.sourceLayerCoder.decode(m),nt=this.vtLayers[j].feature(A);if(T.needGeometry){let pt=Or(nt,!0);if(!T.filter(new hn(this.tileID.overscaledZ),pt,this.tileID.canonical))return}else if(!T.filter(new hn(this.tileID.overscaledZ),nt))return;let st=this.getId(nt,j);for(let pt=0;pt<X.length;pt++){let mt=X[pt];if(M&&!M.has(mt))continue;let vt=L[mt];if(!vt)continue;let At={};st&&V&&(At=V.getState(vt.sourceLayer||HM,st));let wt=Cr({},O[mt]);wt.paint=_st(wt.paint,vt.paint,nt,At,P),wt.layout=_st(wt.layout,vt.layout,nt,At,P);let St=!F||F(nt,vt,At);if(!St)continue;let Bt=new Vot(nt,this.z,this.x,this.y,st);Bt.layer=wt;let qt=l[mt];qt===void 0&&(qt=l[mt]=[]),qt.push({featureIndex:A,feature:Bt,intersectionZ:St})}}lookupSymbolFeatures(l,u,m,A,T,M,P,L){let O={};this.loadVTLayers();let V=Qh(T.filterSpec,T.globalState);for(let F of l)this.loadMatchingFeature(O,m,A,F,V,M,P,L,u);return O}hasLayer(l){for(let u of this.bucketLayerIDs)for(let m of u)if(l===m)return!0;return!1}getId(l,u){var m;let A=l.id;return this.promoteId&&(A=l.properties[typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[u]],typeof A==\"boolean\"&&(A=Number(A)),A===void 0&&(!((m=l.properties)===null||m===void 0)&&m.cluster)&&this.promoteId&&(A=Number(l.properties.cluster_id))),A}}function _st(d,l,u,m,A){return ti(d,((T,M)=>{let P=l instanceof bf?l.get(M):null;return P&&P.evaluate?P.evaluate(u,m,A):P}))}function o7t(d,l){return l-d}function vst(d,l,u,m,A){let T=[];for(let M=0;M<d.length;M++){let P=d[M],L;for(let O=0;O<P.length-1;O++){let V=P[O],F=P[O+1];V.x<l&&F.x<l||(V.x<l?V=new s(l,V.y+(l-V.x)/(F.x-V.x)*(F.y-V.y))._round():F.x<l&&(F=new s(l,V.y+(l-V.x)/(F.x-V.x)*(F.y-V.y))._round()),V.y<u&&F.y<u||(V.y<u?V=new s(V.x+(u-V.y)/(F.y-V.y)*(F.x-V.x),u)._round():F.y<u&&(F=new s(V.x+(u-V.y)/(F.y-V.y)*(F.x-V.x),u)._round()),V.x>=m&&F.x>=m||(V.x>=m?V=new s(m,V.y+(m-V.x)/(F.x-V.x)*(F.y-V.y))._round():F.x>=m&&(F=new s(m,V.y+(m-V.x)/(F.x-V.x)*(F.y-V.y))._round()),V.y>=A&&F.y>=A||(V.y>=A?V=new s(V.x+(A-V.y)/(F.y-V.y)*(F.x-V.x),A)._round():F.y>=A&&(F=new s(V.x+(A-V.y)/(F.y-V.y)*(F.x-V.x),A)._round()),L&&V.equals(L[L.length-1])||(L=[V],T.push(L)),L.push(F)))))}}return T}function bst(d,l,u,m,A){switch(l){case 1:return(function(T,M,P,L){let O=[];for(let V of T)for(let F of V){let X=L===0?F.x:F.y;X>=M&&X<=P&&O.push([F])}return O})(d,u,m,A);case 2:return xst(d,u,m,A,!1);case 3:return xst(d,u,m,A,!0)}return[]}function s7t(d,l,u,m,A){let T=m===0?a7t:l7t,M=[],P=[];for(let V=0;V<d.length-1;V++){let F=d[V],X=d[V+1],j=m===0?F.x:F.y,nt=m===0?X.x:X.y,st=!1;j<l?nt>l&&M.push(T(F,X,l)):j>u?nt<u&&M.push(T(F,X,u)):M.push(F),nt<l&&j>=l&&(M.push(T(F,X,l)),st=!0),nt>u&&j<=u&&(M.push(T(F,X,u)),st=!0),!A&&st&&(P.push(M),M=[])}let L=d.length-1,O=m===0?d[L].x:d[L].y;return O>=l&&O<=u&&M.push(d[L]),A&&M.length>0&&!M[0].equals(M[M.length-1])&&M.push(new s(M[0].x,M[0].y)),M.length>0&&P.push(M),P}function xst(d,l,u,m,A){let T=[];for(let M of d){let P=s7t(M,l,u,m,A);P.length>0&&T.push(...P)}return T}function a7t(d,l,u){return new s(u,d.y+(u-d.x)/(l.x-d.x)*(l.y-d.y))}function l7t(d,l,u){return new s(d.x+(u-d.y)/(l.y-d.y)*(l.x-d.x),u)}ir(\"FeatureIndex\",yst,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});class Sy extends s{constructor(l,u,m,A){super(l,u),this.angle=m,A!==void 0&&(this.segment=A)}clone(){return new Sy(this.x,this.y,this.angle,this.segment)}}function wst(d,l,u,m,A){if(l.segment===void 0||u===0)return!0;let T=l,M=l.segment+1,P=0;for(;P>-u/2;){if(M--,M<0)return!1;P-=d[M].dist(T),T=d[M]}P+=d[M].dist(d[M+1]),M++;let L=[],O=0;for(;P<u/2;){let V=d[M],F=d[M+1];if(!F)return!1;let X=d[M-1].angleTo(V)-V.angleTo(F);for(X=Math.abs((X+3*Math.PI)%(2*Math.PI)-Math.PI),L.push({distance:P,angleDelta:X}),O+=X;P-L[0].distance>m;)O-=L.shift().angleDelta;if(O>A)return!1;M++,P+=V.dist(F)}return!0}function Tst(d){let l=0;for(let u=0;u<d.length-1;u++)l+=d[u].dist(d[u+1]);return l}function Sst(d,l,u){return d?.6*l*u:0}function Mst(d,l){return Math.max(d?d.right-d.left:0,l?l.right-l.left:0)}function c7t(d,l,u,m,A,T){let M=Sst(u,A,T),P=Mst(u,m)*T,L=0,O=Tst(d)/2;for(let V=0;V<d.length-1;V++){let F=d[V],X=d[V+1],j=F.dist(X);if(L+j>O){let nt=(O-L)/j,st=Ls.number(F.x,X.x,nt),pt=Ls.number(F.y,X.y,nt),mt=new Sy(st,pt,X.angleTo(F),V);return mt._round(),!M||wst(d,mt,P,M,l)?mt:void 0}L+=j}}function u7t(d,l,u,m,A,T,M,P,L){let O=Sst(m,T,M),V=Mst(m,A),F=V*M,X=d[0].x===0||d[0].x===L||d[0].y===0||d[0].y===L;return l-F<l/4&&(l=F+l/4),Est(d,X?l/2*P%l:(V/2+2*T)*M*P%l,l,O,u,F,X,!1,L)}function Est(d,l,u,m,A,T,M,P,L){let O=T/2,V=Tst(d),F=0,X=l-u,j=[];for(let nt=0;nt<d.length-1;nt++){let st=d[nt],pt=d[nt+1],mt=st.dist(pt),vt=pt.angleTo(st);for(;X+u<F+mt;){X+=u;let At=(X-F)/mt,wt=Ls.number(st.x,pt.x,At),St=Ls.number(st.y,pt.y,At);if(wt>=0&&wt<L&&St>=0&&St<L&&X-O>=0&&X+O<=V){let Bt=new Sy(wt,St,vt,nt);Bt._round(),m&&!wst(d,Bt,T,m,A)||j.push(Bt)}}F+=mt}return P||j.length||M||(j=Est(d,F/2,u,m,A,T,M,!0,L)),j}function Pst(d,l,u,m){let A=[],T=d.image,M=T.pixelRatio,P=T.paddedRect.w-2,L=T.paddedRect.h-2,O={x1:d.left,y1:d.top,x2:d.right,y2:d.bottom},V=T.stretchX||[[0,P]],F=T.stretchY||[[0,L]],X=(Ae,Ze)=>Ae+Ze[1]-Ze[0],j=V.reduce(X,0),nt=F.reduce(X,0),st=P-j,pt=L-nt,mt=0,vt=j,At=0,wt=nt,St=0,Bt=st,qt=0,te=pt;if(T.content&&m){let Ae=T.content,Ze=Ae[2]-Ae[0],nr=Ae[3]-Ae[1];(T.textFitWidth||T.textFitHeight)&&(O=Tot(d)),mt=IR(V,0,Ae[0]),At=IR(F,0,Ae[1]),vt=IR(V,Ae[0],Ae[2]),wt=IR(F,Ae[1],Ae[3]),St=Ae[0]-mt,qt=Ae[1]-At,Bt=Ze-vt,te=nr-wt}let he=O.x1,fe=O.y1,Se=O.x2-he,ve=O.y2-fe,be=(Ae,Ze,nr,er)=>{let Xe=kR(Ae.stretch-mt,vt,Se,he),Lr=RR(Ae.fixed-St,Bt,Ae.stretch,j),$i=kR(Ze.stretch-At,wt,ve,fe),rn=RR(Ze.fixed-qt,te,Ze.stretch,nt),yn=kR(nr.stretch-mt,vt,Se,he),Xa=RR(nr.fixed-St,Bt,nr.stretch,j),Oo=kR(er.stretch-At,wt,ve,fe),zs=RR(er.fixed-qt,te,er.stretch,nt),aa=new s(Xe,$i),co=new s(yn,$i),Ta=new s(yn,Oo),bl=new s(Xe,Oo),xl=new s(Lr/M,rn/M),Tc=new s(Xa/M,zs/M),Za=l*Math.PI/180;if(Za){let la=Math.sin(Za),wo=Math.cos(Za),ms=[wo,-la,la,wo];aa._matMult(ms),co._matMult(ms),bl._matMult(ms),Ta._matMult(ms)}let Sc=Ae.stretch+Ae.fixed,hd=Ze.stretch+Ze.fixed;return{tl:aa,tr:co,bl,br:Ta,tex:{x:T.paddedRect.x+1+Sc,y:T.paddedRect.y+1+hd,w:nr.stretch+nr.fixed-Sc,h:er.stretch+er.fixed-hd},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:xl,pixelOffsetBR:Tc,minFontScaleX:Bt/M/Se,minFontScaleY:te/M/ve,isSDF:u}};if(m&&(T.stretchX||T.stretchY)){let Ae=Cst(V,st,j),Ze=Cst(F,pt,nt);for(let nr=0;nr<Ae.length-1;nr++){let er=Ae[nr],Xe=Ae[nr+1];for(let Lr=0;Lr<Ze.length-1;Lr++)A.push(be(er,Ze[Lr],Xe,Ze[Lr+1]))}}else A.push(be({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:P+1},{fixed:0,stretch:L+1}));return A}function IR(d,l,u){let m=0;for(let A of d)m+=Math.max(l,Math.min(u,A[1]))-Math.max(l,Math.min(u,A[0]));return m}function Cst(d,l,u){let m=[{fixed:-1,stretch:0}];for(let[A,T]of d){let M=m[m.length-1];m.push({fixed:A-M.stretch,stretch:M.stretch}),m.push({fixed:A-M.stretch,stretch:M.stretch+(T-A)})}return m.push({fixed:l+1,stretch:u}),m}function kR(d,l,u,m){return d/l*u+m}function RR(d,l,u,m){return d-l*u/m}ir(\"Anchor\",Sy);class DR{constructor(l,u,m,A,T,M,P,L,O,V){var F;if(this.boxStartIndex=l.length,O){let X=M.top,j=M.bottom,nt=M.collisionPadding;nt&&(X-=nt[1],j+=nt[3]);let st=j-X;st>0&&(st=Math.max(10,st),this.circleDiameter=st)}else{let X=!((F=M.image)===null||F===void 0)&&F.content&&(M.image.textFitWidth||M.image.textFitHeight)?Tot(M):{x1:M.left,y1:M.top,x2:M.right,y2:M.bottom};X.y1=X.y1*P-L[0],X.y2=X.y2*P+L[2],X.x1=X.x1*P-L[3],X.x2=X.x2*P+L[1];let j=M.collisionPadding;if(j&&(X.x1-=j[0]*P,X.y1-=j[1]*P,X.x2+=j[2]*P,X.y2+=j[3]*P),V){let nt=new s(X.x1,X.y1),st=new s(X.x2,X.y1),pt=new s(X.x1,X.y2),mt=new s(X.x2,X.y2),vt=V*Math.PI/180;nt._rotate(vt),st._rotate(vt),pt._rotate(vt),mt._rotate(vt),X.x1=Math.min(nt.x,st.x,pt.x,mt.x),X.x2=Math.max(nt.x,st.x,pt.x,mt.x),X.y1=Math.min(nt.y,st.y,pt.y,mt.y),X.y2=Math.max(nt.y,st.y,pt.y,mt.y)}l.emplaceBack(u.x,u.y,X.x1,X.y1,X.x2,X.y2,m,A,T)}this.boxEndIndex=l.length}}class h7t{constructor(l=[],u=(m,A)=>m<A?-1:m>A?1:0){if(this.data=l,this.length=this.data.length,this.compare=u,this.length>0)for(let m=(this.length>>1)-1;m>=0;m--)this._down(m)}push(l){this.data.push(l),this._up(this.length++)}pop(){if(this.length===0)return;let l=this.data[0],u=this.data.pop();return--this.length>0&&(this.data[0]=u,this._down(0)),l}peek(){return this.data[0]}_up(l){let{data:u,compare:m}=this,A=u[l];for(;l>0;){let T=l-1>>1,M=u[T];if(m(A,M)>=0)break;u[l]=M,l=T}u[l]=A}_down(l){let{data:u,compare:m}=this,A=this.length>>1,T=u[l];for(;l<A;){let M=1+(l<<1),P=M+1;if(P<this.length&&m(u[P],u[M])<0&&(M=P),m(u[M],T)>=0)break;u[l]=u[M],l=M}u[l]=T}}function d7t(d,l=1,u=!1){let m=gv.fromPoints(d[0]),A=Math.min(m.width(),m.height()),T=A/2,M=new h7t([],f7t),{minX:P,minY:L,maxX:O,maxY:V}=m;if(A===0)return new s(P,L);for(let j=P;j<O;j+=A)for(let nt=L;nt<V;nt+=A)M.push(new Q2(j+T,nt+T,T,d));let F=(function(j){let nt=0,st=0,pt=0,mt=j[0];for(let vt=0,At=mt.length,wt=At-1;vt<At;wt=vt++){let St=mt[vt],Bt=mt[wt],qt=St.x*Bt.y-Bt.x*St.y;st+=(St.x+Bt.x)*qt,pt+=(St.y+Bt.y)*qt,nt+=3*qt}return new Q2(st/nt,pt/nt,0,j)})(d),X=M.length;for(;M.length;){let j=M.pop();(j.d>F.d||!F.d)&&(F=j,u&&console.log(\"found best %d after %d probes\",Math.round(1e4*j.d)/1e4,X)),j.max-F.d<=l||(T=j.h/2,M.push(new Q2(j.p.x-T,j.p.y-T,T,d)),M.push(new Q2(j.p.x+T,j.p.y-T,T,d)),M.push(new Q2(j.p.x-T,j.p.y+T,T,d)),M.push(new Q2(j.p.x+T,j.p.y+T,T,d)),X+=4)}return u&&(console.log(`num probes: ${X}`),console.log(`best distance: ${F.d}`)),F.p}function f7t(d,l){return l.max-d.max}function Q2(d,l,u,m){this.p=new s(d,l),this.h=u,this.d=(function(A,T){let M=!1,P=1/0;for(let L=0;L<T.length;L++){let O=T[L];for(let V=0,F=O.length,X=F-1;V<F;X=V++){let j=O[V],nt=O[X];j.y>A.y!=nt.y>A.y&&A.x<(nt.x-j.x)*(A.y-j.y)/(nt.y-j.y)+j.x&&(M=!M),P=Math.min(P,kM(A,j,nt))}}return(M?1:-1)*Math.sqrt(P)})(this.p,m),this.max=this.d+this.h*Math.SQRT2}var Ya;n.aM=void 0,(Ya=n.aM||(n.aM={}))[Ya.center=1]=\"center\",Ya[Ya.left=2]=\"left\",Ya[Ya.right=3]=\"right\",Ya[Ya.top=4]=\"top\",Ya[Ya.bottom=5]=\"bottom\",Ya[Ya[\"top-left\"]=6]=\"top-left\",Ya[Ya[\"top-right\"]=7]=\"top-right\",Ya[Ya[\"bottom-left\"]=8]=\"bottom-left\",Ya[Ya[\"bottom-right\"]=9]=\"bottom-right\";let Gj=Number.POSITIVE_INFINITY;function Ist(d,l){return l[1]!==Gj?(function(u,m,A){let T=0,M=0;switch(m=Math.abs(m),A=Math.abs(A),u){case\"top-right\":case\"top-left\":case\"top\":M=A-7;break;case\"bottom-right\":case\"bottom-left\":case\"bottom\":M=7-A}switch(u){case\"top-right\":case\"bottom-right\":case\"right\":T=-m;break;case\"top-left\":case\"bottom-left\":case\"left\":T=m}return[T,M]})(d,l[0],l[1]):(function(u,m){let A=0,T=0;m<0&&(m=0);let M=m/Math.SQRT2;switch(u){case\"top-right\":case\"top-left\":T=M-7;break;case\"bottom-right\":case\"bottom-left\":T=7-M;break;case\"bottom\":T=7-m;break;case\"top\":T=m-7}switch(u){case\"top-right\":case\"bottom-right\":A=-M;break;case\"top-left\":case\"bottom-left\":A=M;break;case\"left\":A=m;break;case\"right\":A=-m}return[A,T]})(d,l[0])}function kst(d,l,u){var m;let A=d.layout,T=(m=A.get(\"text-variable-anchor-offset\"))===null||m===void 0?void 0:m.evaluate(l,{},u);if(T){let P=T.values,L=[];for(let O=0;O<P.length;O+=2){let V=L[O]=P[O],F=P[O+1].map((X=>X*oa));V.startsWith(\"top\")?F[1]-=7:V.startsWith(\"bottom\")&&(F[1]+=7),L[O+1]=F}return new ta(L)}let M=A.get(\"text-variable-anchor\");if(M){let P;P=d._unevaluatedLayout.getValue(\"text-radial-offset\")!==void 0?[A.get(\"text-radial-offset\").evaluate(l,{},u)*oa,Gj]:A.get(\"text-offset\").evaluate(l,{},u).map((O=>O*oa));let L=[];for(let O of M)L.push(O,Ist(O,P));return new ta(L)}return null}function Wj(d){switch(d){case\"right\":case\"top-right\":case\"bottom-right\":return\"right\";case\"left\":case\"top-left\":case\"bottom-left\":return\"left\"}return\"center\"}function p7t(d,l,u,m,A,T,M,P,L,O,V,F){let X=T.textMaxSize.evaluate(l,{});X===void 0&&(X=M);let j=d.layers[0].layout,nt=j.get(\"icon-offset\").evaluate(l,{},V),st=Dst(u.horizontal),pt=M/24,mt=d.tilePixelRatio*pt,vt=d.tilePixelRatio*X/24,At=d.tilePixelRatio*P,wt=d.tilePixelRatio*j.get(\"symbol-spacing\"),St=j.get(\"text-padding\")*d.tilePixelRatio,Bt=(function(nr,er,Xe,Lr=1){let $i=nr.get(\"icon-padding\").evaluate(er,{},Xe),rn=$i&&$i.values;return[rn[0]*Lr,rn[1]*Lr,rn[2]*Lr,rn[3]*Lr]})(j,l,V,d.tilePixelRatio),qt=j.get(\"text-max-angle\")/180*Math.PI,te=j.get(\"text-rotation-alignment\")!==\"viewport\"&&j.get(\"symbol-placement\")!==\"point\",he=j.get(\"icon-rotation-alignment\")===\"map\"&&j.get(\"symbol-placement\")!==\"point\",fe=j.get(\"symbol-placement\"),Se=wt/2,ve=j.get(\"icon-text-fit\"),be;m&&ve!==\"none\"&&(d.allowVerticalPlacement&&u.vertical&&(be=Sot(m,u.vertical,ve,j.get(\"icon-text-fit-padding\"),nt,pt)),st&&(m=Sot(m,st,ve,j.get(\"icon-text-fit-padding\"),nt,pt)));let Ae=V?F.line.getGranularityForZoomLevel(V.z):1,Ze=(nr,er)=>{er.x<0||er.x>=Pe||er.y<0||er.y>=Pe||(function(Xe,Lr,$i,rn,yn,Xa,Oo,zs,aa,co,Ta,bl,xl,Tc,Za,Sc,hd,la,wo,ms,Lo,ca,ig,Pf,XM){let My=Xe.addToLineVertexArray(Lr,$i),yv,J2,tw,ew,Ost=0,Lst=0,Bst=0,Fst=0,Zj=-1,Kj=-1,ng={},Nst=ao(\"\");if(Xe.allowVerticalPlacement&&rn.vertical){let wl=zs.layout.get(\"text-rotate\").evaluate(Lo,{},Pf)+90;tw=new DR(aa,Lr,co,Ta,bl,rn.vertical,xl,Tc,Za,wl),Oo&&(ew=new DR(aa,Lr,co,Ta,bl,Oo,hd,la,Za,wl))}if(yn){let wl=zs.layout.get(\"icon-rotate\").evaluate(Lo,{}),oh=zs.layout.get(\"icon-text-fit\")!==\"none\",_v=Pst(yn,wl,ig,oh),If=Oo?Pst(Oo,wl,ig,oh):void 0;J2=new DR(aa,Lr,co,Ta,bl,yn,hd,la,!1,wl),Ost=4*_v.length;let vv=Xe.iconSizeData,n0=null;vv.kind===\"source\"?(n0=[eg*zs.layout.get(\"icon-size\").evaluate(Lo,{})],n0[0]>vy&&ln(`${Xe.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):vv.kind===\"composite\"&&(n0=[eg*ca.compositeIconSizes[0].evaluate(Lo,{},Pf),eg*ca.compositeIconSizes[1].evaluate(Lo,{},Pf)],(n0[0]>vy||n0[1]>vy)&&ln(`${Xe.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),Xe.addSymbols(Xe.icon,_v,n0,ms,wo,Lo,n.aw.none,Lr,My.lineStartIndex,My.lineLength,-1,Pf),Zj=Xe.icon.placedSymbolArray.length-1,If&&(Lst=4*If.length,Xe.addSymbols(Xe.icon,If,n0,ms,wo,Lo,n.aw.vertical,Lr,My.lineStartIndex,My.lineLength,-1,Pf),Kj=Xe.icon.placedSymbolArray.length-1)}let zst=Object.keys(rn.horizontal);for(let wl of zst){let oh=rn.horizontal[wl];if(!yv){Nst=ao(oh.text);let If=zs.layout.get(\"text-rotate\").evaluate(Lo,{},Pf);yv=new DR(aa,Lr,co,Ta,bl,oh,xl,Tc,Za,If)}let _v=oh.positionedLines.length===1;if(Bst+=Rst(Xe,Lr,oh,Xa,zs,Za,Lo,Sc,My,rn.vertical?n.aw.horizontal:n.aw.horizontalOnly,_v?zst:[wl],ng,Zj,ca,Pf),_v)break}rn.vertical&&(Fst+=Rst(Xe,Lr,rn.vertical,Xa,zs,Za,Lo,Sc,My,n.aw.vertical,[\"vertical\"],ng,Kj,ca,Pf));let A7t=yv?yv.boxStartIndex:Xe.collisionBoxArray.length,y7t=yv?yv.boxEndIndex:Xe.collisionBoxArray.length,_7t=tw?tw.boxStartIndex:Xe.collisionBoxArray.length,v7t=tw?tw.boxEndIndex:Xe.collisionBoxArray.length,b7t=J2?J2.boxStartIndex:Xe.collisionBoxArray.length,x7t=J2?J2.boxEndIndex:Xe.collisionBoxArray.length,w7t=ew?ew.boxStartIndex:Xe.collisionBoxArray.length,T7t=ew?ew.boxEndIndex:Xe.collisionBoxArray.length,Cf=-1,LR=(wl,oh)=>wl&&wl.circleDiameter?Math.max(wl.circleDiameter,oh):oh;Cf=LR(yv,Cf),Cf=LR(tw,Cf),Cf=LR(J2,Cf),Cf=LR(ew,Cf);let Ust=Cf>-1?1:0;Ust&&(Cf*=XM/oa),Xe.glyphOffsetArray.length>=j2.MAX_GLYPHS&&ln(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),Lo.sortKey!==void 0&&Xe.addToSortKeyRanges(Xe.symbolInstances.length,Lo.sortKey);let S7t=kst(zs,Lo,Pf),[M7t,E7t]=(function(wl,oh){let _v=wl.length,If=oh?.values;if(If?.length>0)for(let vv=0;vv<If.length;vv+=2){let n0=If[vv+1];wl.emplaceBack(n.aM[If[vv]],n0[0],n0[1])}return[_v,wl.length]})(Xe.textAnchorOffsets,S7t);Xe.symbolInstances.emplaceBack(Lr.x,Lr.y,ng.right>=0?ng.right:-1,ng.center>=0?ng.center:-1,ng.left>=0?ng.left:-1,ng.vertical||-1,Zj,Kj,Nst,A7t,y7t,_7t,v7t,b7t,x7t,w7t,T7t,co,Bst,Fst,Ost,Lst,Ust,0,xl,Cf,M7t,E7t)})(d,er,nr,u,m,A,be,d.layers[0],d.collisionBoxArray,l.index,l.sourceLayerIndex,d.index,mt,[St,St,St,St],te,L,At,Bt,he,nt,l,T,O,V,M)};if(fe===\"line\")for(let nr of vst(l.geometry,0,0,Pe,Pe)){let er=mv(nr,Ae),Xe=u7t(er,wt,qt,u.vertical||st,m,24,vt,d.overscaling,Pe);for(let Lr of Xe)st&&m7t(d,st.text,Se,Lr)||Ze(er,Lr)}else if(fe===\"line-center\"){for(let nr of l.geometry)if(nr.length>1){let er=mv(nr,Ae),Xe=c7t(er,qt,u.vertical||st,m,24,vt);Xe&&Ze(er,Xe)}}else if(l.type===\"Polygon\")for(let nr of Tt(l.geometry,0)){let er=d7t(nr,16);Ze(mv(nr[0],Ae,!0),new Sy(er.x,er.y,0))}else if(l.type===\"LineString\")for(let nr of l.geometry){let er=mv(nr,Ae);Ze(er,new Sy(er[0].x,er[0].y,0))}else if(l.type===\"Point\")for(let nr of l.geometry)for(let er of nr)Ze([er],new Sy(er.x,er.y,0))}function Rst(d,l,u,m,A,T,M,P,L,O,V,F,X,j,nt){let st=(function(vt,At,wt,St,Bt,qt,te,he){let fe=St.layout.get(\"text-rotate\").evaluate(qt,{})*Math.PI/180,Se=[];for(let ve of At.positionedLines)for(let be of ve.positionedGlyphs){if(!be.rect)continue;let Ae=be.rect||{},Ze=4,nr=!0,er=1,Xe=0,Lr=(Bt||he)&&be.vertical,$i=be.metrics.advance*be.scale/2;if(he&&At.verticalizable&&(Xe=ve.lineOffset/2-(be.imageName?-(oa-be.metrics.width*be.scale)/2:(be.scale-1)*oa)),be.imageName){let la=te[be.imageName];nr=la.sdf,er=la.pixelRatio,Ze=1/er}let rn=Bt?[be.x+$i,be.y]:[0,0],yn=Bt?[0,0]:[be.x+$i+wt[0],be.y+wt[1]-Xe],Xa=[0,0];Lr&&(Xa=yn,yn=[0,0]);let Oo=be.metrics.isDoubleResolution?2:1,zs=(be.metrics.left-Ze)*be.scale-$i+yn[0],aa=(-be.metrics.top-Ze)*be.scale+yn[1],co=zs+Ae.w/Oo*be.scale/er,Ta=aa+Ae.h/Oo*be.scale/er,bl=new s(zs,aa),xl=new s(co,aa),Tc=new s(zs,Ta),Za=new s(co,Ta);if(Lr){let la=new s(-$i,$i- -17),wo=-Math.PI/2,ms=12-$i,Lo=new s(22-ms,-(be.imageName?ms:0)),ca=new s(...Xa);bl._rotateAround(wo,la)._add(Lo)._add(ca),xl._rotateAround(wo,la)._add(Lo)._add(ca),Tc._rotateAround(wo,la)._add(Lo)._add(ca),Za._rotateAround(wo,la)._add(Lo)._add(ca)}if(fe){let la=Math.sin(fe),wo=Math.cos(fe),ms=[wo,-la,la,wo];bl._matMult(ms),xl._matMult(ms),Tc._matMult(ms),Za._matMult(ms)}let Sc=new s(0,0),hd=new s(0,0);Se.push({tl:bl,tr:xl,bl:Tc,br:Za,tex:Ae,writingMode:At.writingMode,glyphOffset:rn,sectionIndex:be.sectionIndex,isSDF:nr,pixelOffsetTL:Sc,pixelOffsetBR:hd,minFontScaleX:0,minFontScaleY:0})}return Se})(0,u,P,A,T,M,m,d.allowVerticalPlacement),pt=d.textSizeData,mt=null;pt.kind===\"source\"?(mt=[eg*A.layout.get(\"text-size\").evaluate(M,{})],mt[0]>vy&&ln(`${d.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):pt.kind===\"composite\"&&(mt=[eg*j.compositeTextSizes[0].evaluate(M,{},nt),eg*j.compositeTextSizes[1].evaluate(M,{},nt)],(mt[0]>vy||mt[1]>vy)&&ln(`${d.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),d.addSymbols(d.text,st,mt,P,T,M,O,l,L.lineStartIndex,L.lineLength,X,nt);for(let vt of V)F[vt]=d.text.placedSymbolArray.length-1;return 4*st.length}function Dst(d){for(let l in d)return d[l];return null}function m7t(d,l,u,m){let A=d.compareText;if(l in A){let T=A[l];for(let M=T.length-1;M>=0;M--)if(m.dist(T[M])<u)return!0}else A[l]=[];return A[l].push(m),!1}var qj;n.cF=void 0,(qj=n.cF||(n.cF={})).create=\"create\",qj.load=\"load\",qj.fullLoad=\"fullLoad\";let OR=null,YM=[],Hj=1e3/60,Yj=\"loadTime\",Xj=\"fullLoadTime\",g7t={mark(d){performance.mark(d)},recordStartOfFrameAt(d){OR!=null&&YM.push(d-OR),OR=d},resetRuntimeMetrics(){OR=null,YM=[]},clearInitializationMetrics(){performance.clearMeasures(Yj),performance.clearMeasures(Xj);for(let d in n.cF)performance.clearMarks(n.cF[d])},remove(){this.resetRuntimeMetrics(),this.clearInitializationMetrics()},getPerformanceMetrics(){performance.measure(Yj,n.cF.create,n.cF.load),performance.measure(Xj,n.cF.create,n.cF.fullLoad);let d=performance.getEntriesByName(Yj)[0].duration,l=performance.getEntriesByName(Xj)[0].duration,u=YM.length;return{loadTimeMs:d,fullLoadTimeMs:l,averageFramesPerSecond:1/(YM.reduce(((m,A)=>m+A),0)/u/1e3),virtualDroppedFramesCount:YM.filter((m=>m>Hj)).reduce(((m,A)=>m+(A-Hj)/Hj),0),totalFramesCount:u}}};n.$=z,n.A=H,n.B=Jp,n.C=vf,n.D=fr,n.E=ym,n.F=function([d,l,u]){return l+=90,l*=Math.PI/180,u*=Math.PI/180,{x:d*Math.cos(l)*Math.sin(u),y:d*Math.sin(l)*Math.sin(u),z:d*Math.cos(u)}},n.G=Ls,n.H=hn,n.I=gj,n.J=av,n.K=function(d){if(ds==null){let l=d.navigator?d.navigator.userAgent:null;ds=!!d.safari||!(!l||!(/\\b(iPad|iPhone|iPod)\\b/.test(l)||l.match(\"Safari\")&&!l.match(\"Chrome\")))}return ds},n.L=class{constructor(d,l){this.target=d,this.mapId=l,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new MRt((()=>this.process())),this.subscription=Rs(this.target,\"message\",(u=>this.receive(u)),!1),this.globalScope=qn(self)?d:window}registerMessageHandler(d,l){this.messageHandlers[d]=l}unregisterMessageHandler(d){delete this.messageHandlers[d]}sendAsync(d,l){return new Promise(((u,m)=>{let A=Math.round(1e18*Math.random()).toString(36).substring(0,10),T=l?Rs(l.signal,\"abort\",(()=>{T?.unsubscribe(),delete this.resolveRejects[A];let L={id:A,type:\"<cancel>\",origin:location.origin,targetMapId:d.targetMapId,sourceMapId:this.mapId};this.target.postMessage(L)}),ERt):null;this.resolveRejects[A]={resolve:L=>{T?.unsubscribe(),u(L)},reject:L=>{T?.unsubscribe(),m(L)}};let M=[],P=Object.assign(Object.assign({},d),{id:A,sourceMapId:this.mapId,origin:location.origin,data:su(d.data,M)});this.target.postMessage(P,{transfer:M})}))}receive(d){let l=d.data,u=l.id,m=[\"file://\",\"resource://android\",\"null\"],A=[l.origin,location.origin],T=l.origin===location.origin,M=A.some((P=>m.includes(P)));if((T||M)&&(!l.targetMapId||this.mapId===l.targetMapId)){if(l.type===\"<cancel>\"){delete this.tasks[u];let P=this.abortControllers[u];return delete this.abortControllers[u],void(P&&P.abort())}if(qn(self)||l.mustQueue)return this.tasks[u]=l,this.taskQueue.push(u),void this.invoker.trigger();this.processTask(u,l)}}process(){if(this.taskQueue.length===0)return;let d=this.taskQueue.shift(),l=this.tasks[d];delete this.tasks[d],this.taskQueue.length>0&&this.invoker.trigger(),l&&this.processTask(d,l)}processTask(d,l){return o(this,void 0,void 0,(function*(){if(l.type===\"<response>\"){let A=this.resolveRejects[d];return delete this.resolveRejects[d],A?void(l.error?A.reject(ih(l.error)):A.resolve(ih(l.data))):void 0}if(!this.messageHandlers[l.type])return void this.completeTask(d,new Error(`Could not find a registered handler for ${l.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(\", \")}`));let u=ih(l.data),m=new AbortController;this.abortControllers[d]=m;try{let A=yield this.messageHandlers[l.type](l.sourceMapId,u,m);this.completeTask(d,null,A)}catch(A){this.completeTask(d,A)}}))}completeTask(d,l,u){let m=[];delete this.abortControllers[d];let A={id:d,type:\"<response>\",sourceMapId:this.mapId,origin:location.origin,error:l?su(l):null,data:su(u,m)};this.target.postMessage(A,{transfer:m})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},n.M=dl,n.N=function(){var d=new H(16);return H!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0),d[0]=1,d[5]=1,d[10]=1,d[15]=1,d},n.O=function(d,l,u){var m,A,T,M,P,L,O,V,F,X,j,nt,st=u[0],pt=u[1],mt=u[2];return l===d?(d[12]=l[0]*st+l[4]*pt+l[8]*mt+l[12],d[13]=l[1]*st+l[5]*pt+l[9]*mt+l[13],d[14]=l[2]*st+l[6]*pt+l[10]*mt+l[14],d[15]=l[3]*st+l[7]*pt+l[11]*mt+l[15]):(A=l[1],T=l[2],M=l[3],P=l[4],L=l[5],O=l[6],V=l[7],F=l[8],X=l[9],j=l[10],nt=l[11],d[0]=m=l[0],d[1]=A,d[2]=T,d[3]=M,d[4]=P,d[5]=L,d[6]=O,d[7]=V,d[8]=F,d[9]=X,d[10]=j,d[11]=nt,d[12]=m*st+P*pt+F*mt+l[12],d[13]=A*st+L*pt+X*mt+l[13],d[14]=T*st+O*pt+j*mt+l[14],d[15]=M*st+V*pt+nt*mt+l[15]),d},n.P=s,n.Q=function(d,l,u){var m=u[0],A=u[1],T=u[2];return d[0]=l[0]*m,d[1]=l[1]*m,d[2]=l[2]*m,d[3]=l[3]*m,d[4]=l[4]*A,d[5]=l[5]*A,d[6]=l[6]*A,d[7]=l[7]*A,d[8]=l[8]*T,d[9]=l[9]*T,d[10]=l[10]*T,d[11]=l[11]*T,d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15],d},n.R=wc,n.S=function(d,l,u){var m=l[0],A=l[1],T=l[2],M=l[3],P=l[4],L=l[5],O=l[6],V=l[7],F=l[8],X=l[9],j=l[10],nt=l[11],st=l[12],pt=l[13],mt=l[14],vt=l[15],At=u[0],wt=u[1],St=u[2],Bt=u[3];return d[0]=At*m+wt*P+St*F+Bt*st,d[1]=At*A+wt*L+St*X+Bt*pt,d[2]=At*T+wt*O+St*j+Bt*mt,d[3]=At*M+wt*V+St*nt+Bt*vt,d[4]=(At=u[4])*m+(wt=u[5])*P+(St=u[6])*F+(Bt=u[7])*st,d[5]=At*A+wt*L+St*X+Bt*pt,d[6]=At*T+wt*O+St*j+Bt*mt,d[7]=At*M+wt*V+St*nt+Bt*vt,d[8]=(At=u[8])*m+(wt=u[9])*P+(St=u[10])*F+(Bt=u[11])*st,d[9]=At*A+wt*L+St*X+Bt*pt,d[10]=At*T+wt*O+St*j+Bt*mt,d[11]=At*M+wt*V+St*nt+Bt*vt,d[12]=(At=u[12])*m+(wt=u[13])*P+(St=u[14])*F+(Bt=u[15])*st,d[13]=At*A+wt*L+St*X+Bt*pt,d[14]=At*T+wt*O+St*j+Bt*mt,d[15]=At*M+wt*V+St*nt+Bt*vt,d},n.T=qV,n.U=function(d,l){let u={};for(let m=0;m<l.length;m++){let A=l[m];A in d&&(u[A]=d[A])}return u},n.V=by,n.W=Br,n.X=Oot,n.Y=Dot,n.Z=Cp,n._=o,n.a=mm,n.a$=function(d){var l=new H(3);return l[0]=d[0],l[1]=d[1],l[2]=d[2],l},n.a0=W,n.a1=gc,n.a2=cu,n.a3=Bot,n.a4=ER,n.a5=Pe,n.a6=GM,n.a7=gv,n.a8=25,n.a9=Tj,n.aA=function(d){var l=d[0],u=d[1];return Math.sqrt(l*l+u*u)},n.aB=function(d){return d[0]=0,d[1]=0,d},n.aC=function(d,l,u){return d[0]=l[0]*u,d[1]=l[1]*u,d},n.aD=_j,n.aE=Ft,n.aF=function(d,l,u,m){let A=l.y-d.y,T=l.x-d.x,M=m.y-u.y,P=m.x-u.x,L=M*T-P*A;if(L===0)return null;let O=(P*(d.y-u.y)-M*(d.x-u.x))/L;return new s(d.x+O*T,d.y+O*A)},n.aG=vst,n.aH=Sr,n.aI=function(d){let l=1/0,u=1/0,m=-1/0,A=-1/0;for(let T of d)l=Math.min(l,T.x),u=Math.min(u,T.y),m=Math.max(m,T.x),A=Math.max(A,T.y);return[l,u,m,A]},n.aJ=oa,n.aK=we,n.aL=function(d,l,u,m,A=!1){if(!u[0]&&!u[1])return[0,0];let T=A?m===\"map\"?-d.bearingInRadians:0:m===\"viewport\"?d.bearingInRadians:0;if(T){let M=Math.sin(T),P=Math.cos(T);u=[u[0]*P-u[1]*M,u[0]*M+u[1]*P]}return[A?u[0]:we(l,u[0],d.zoom),A?u[1]:we(l,u[1],d.zoom)]},n.aN=yj,n.aO=Wj,n.aP=Aj,n.aQ=d=>d.type===\"symbol\",n.aR=AR,n.aS=xo,n.aT=gR,n.aU=Ct,n.aV=ur,n.aW=Le,n.aX=Vl,n.aY=Fot,n.aZ=J,n.a_=lt,n.aa=d=>{let l=window.document.createElement(\"video\");return l.muted=!0,new Promise((u=>{l.onloadstart=()=>{u(l)};for(let m of d){let A=window.document.createElement(\"source\");$l(m)||(l.crossOrigin=\"Anonymous\"),A.src=m,l.appendChild(A)}}))},n.ab=Ye,n.ac=function(){return Rr++},n.ad=D,n.ae=j2,n.af=HM,n.ag=Qh,n.ah=Or,n.ai=Vot,n.aj=function(d){let l={};if(d.replace(/(?:^|(?:\\s*\\,\\s*))([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)(?:\\=(?:([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)|(?:\\\"((?:[^\"\\\\]|\\\\.)*)\\\")))?/g,((u,m,A,T)=>{let M=A||T;return l[m]=!M||M.toLowerCase(),\"\"})),l[\"max-age\"]){let u=parseInt(l[\"max-age\"],10);isNaN(u)?delete l[\"max-age\"]:l[\"max-age\"]=u}return l},n.ak=gr,n.al=85.051129,n.am=ba,n.an=function(d){return Math.pow(2,d)},n.ao=tt,n.ap=Lot,n.aq=function(d){return Math.log(d)/Math.LN2},n.ar=function(d){var l=d[0],u=d[1];return l*l+u*u},n.as=function(d){if(!d.length)return new Set;let l=Math.max(...d.map((L=>L.canonical.z))),u=1/0,m=-1/0,A=1/0,T=-1/0,M=[];for(let L of d){let{x:O,y:V,z:F}=L.canonical,X=Math.pow(2,l-F),j=O*X,nt=V*X;M.push({id:L,x:j,y:nt}),j<u&&(u=j),j>m&&(m=j),nt<A&&(A=nt),nt>T&&(T=nt)}let P=new Set;for(let L of M)L.x!==u&&L.x!==m&&L.y!==A&&L.y!==T||P.add(L.id);return P},n.at=function(d,l){let u=Math.abs(2*d.wrap)-+(d.wrap<0),m=Math.abs(2*l.wrap)-+(l.wrap<0);return d.overscaledZ-l.overscaledZ||m-u||l.canonical.y-d.canonical.y||l.canonical.x-d.canonical.x},n.au=class{constructor(d,l){this.max=d,this.onRemove=l,this.reset()}reset(){for(let d in this.data)for(let l of this.data[d])l.timeout&&clearTimeout(l.timeout),this.onRemove(l.value);return this.data={},this.order=[],this}add(d,l,u){let m=d.wrapped().key;this.data[m]===void 0&&(this.data[m]=[]);let A={value:l,timeout:void 0};if(u!==void 0&&(A.timeout=setTimeout((()=>{this.remove(d,A)}),u)),this.data[m].push(A),this.order.push(m),this.order.length>this.max){let T=this._getAndRemoveByKey(this.order[0]);T&&this.onRemove(T)}return this}has(d){return d.wrapped().key in this.data}getAndRemove(d){return this.has(d)?this._getAndRemoveByKey(d.wrapped().key):null}_getAndRemoveByKey(d){let l=this.data[d].shift();return l.timeout&&clearTimeout(l.timeout),this.data[d].length===0&&delete this.data[d],this.order.splice(this.order.indexOf(d),1),l.value}getByKey(d){let l=this.data[d];return l?l[0].value:null}get(d){return this.has(d)?this.data[d.wrapped().key][0].value:null}remove(d,l){if(!this.has(d))return this;let u=d.wrapped().key,m=l===void 0?0:this.data[u].indexOf(l),A=this.data[u][m];return this.data[u].splice(m,1),A.timeout&&clearTimeout(A.timeout),this.data[u].length===0&&delete this.data[u],this.onRemove(A.value),this.order.splice(this.order.indexOf(u),1),this}setMaxSize(d){for(this.max=d;this.order.length>this.max;){let l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}filter(d){let l=[];for(let u in this.data)for(let m of this.data[u])d(m.value)||l.push(m);for(let u of l)this.remove(u.value.tileID,u)}},n.av=function(d,l){let u=0,m=0;if(d.kind===\"constant\")m=d.layoutSize;else if(d.kind!==\"source\"){let{interpolationType:A,minZoom:T,maxZoom:M}=d,P=A?gr(Li.interpolationFactor(A,l,T,M),0,1):0;d.kind===\"camera\"?m=Ls.number(d.minSize,d.maxSize,P):u=P}return{uSizeT:u,uSize:m}},n.ax=function(d,{uSize:l,uSizeT:u},{lowerSize:m,upperSize:A}){return d.kind===\"source\"?m/eg:d.kind===\"composite\"?Ls.number(m/eg,A/eg,u):l},n.ay=function(d,l){var u=l[0],m=l[1],A=l[2],T=l[3],M=l[4],P=l[5],L=l[6],O=l[7],V=l[8],F=l[9],X=l[10],j=l[11],nt=l[12],st=l[13],pt=l[14],mt=l[15],vt=u*P-m*M,At=u*L-A*M,wt=u*O-T*M,St=m*L-A*P,Bt=m*O-T*P,qt=A*O-T*L,te=V*st-F*nt,he=V*pt-X*nt,fe=V*mt-j*nt,Se=F*pt-X*st,ve=F*mt-j*st,be=X*mt-j*pt,Ae=vt*be-At*ve+wt*Se+St*fe-Bt*he+qt*te;return Ae?(d[0]=(P*be-L*ve+O*Se)*(Ae=1/Ae),d[1]=(A*ve-m*be-T*Se)*Ae,d[2]=(st*qt-pt*Bt+mt*St)*Ae,d[3]=(X*Bt-F*qt-j*St)*Ae,d[4]=(L*fe-M*be-O*he)*Ae,d[5]=(u*be-A*fe+T*he)*Ae,d[6]=(pt*wt-nt*qt-mt*At)*Ae,d[7]=(V*qt-X*wt+j*At)*Ae,d[8]=(M*ve-P*fe+O*te)*Ae,d[9]=(m*fe-u*ve-T*te)*Ae,d[10]=(nt*Bt-st*wt+mt*vt)*Ae,d[11]=(F*wt-V*Bt-j*vt)*Ae,d[12]=(P*he-M*Se-L*te)*Ae,d[13]=(u*Se-m*he+A*te)*Ae,d[14]=(st*At-nt*St-pt*vt)*Ae,d[15]=(V*St-F*At+X*vt)*Ae,d):null},n.az=Yt,n.b=Xo,n.b$=U,n.b0=function(d,l,u){return d[0]=l[0]-u[0],d[1]=l[1]-u[1],d[2]=l[2]-u[2],d},n.b1=function(d,l){var u=l[0],m=l[1],A=l[2],T=u*u+m*m+A*A;return T>0&&(T=1/Math.sqrt(T)),d[0]=l[0]*T,d[1]=l[1]*T,d[2]=l[2]*T,d},n.b2=ft,n.b3=function(d,l){return d[0]*l[0]+d[1]*l[1]+d[2]*l[2]},n.b4=function(d,l,u){return d[0]=l[0]*u[0],d[1]=l[1]*u[1],d[2]=l[2]*u[2],d[3]=l[3]*u[3],d},n.b5=at,n.b6=function(d,l,u){let m=l[0]*u[0]+l[1]*u[1]+l[2]*u[2];return m===0?null:(-(d[0]*u[0]+d[1]*u[1]+d[2]*u[2])-u[3])/m},n.b7=Mt,n.b8=function(d,l,u){return d[0]=l[0]*u,d[1]=l[1]*u,d[2]=l[2]*u,d[3]=l[3]*u,d},n.b9=function(d,l){return d[0]*l[0]+d[1]*l[1]+d[2]*l[2]+d[3]},n.bA=function(d,l,u){var m=u[0],A=u[1],T=u[2],M=u[3],P=l[0],L=l[1],O=l[2],V=A*O-T*L,F=T*P-m*O,X=m*L-A*P;return d[0]=P+M*(V+=V)+A*(X+=X)-T*(F+=F),d[1]=L+M*F+T*V-m*X,d[2]=O+M*X+m*F-A*V,d},n.bB=function(d,l,u){let m=(A=[d[0],d[1],d[2],l[0],l[1],l[2],u[0],u[1],u[2]])[0]*((V=A[8])*(M=A[4])-(P=A[5])*(O=A[7]))+A[1]*(-V*(T=A[3])+P*(L=A[6]))+A[2]*(O*T-M*L);var A,T,M,P,L,O,V;if(m===0)return null;let F=ft([],[l[0],l[1],l[2]],[u[0],u[1],u[2]]),X=ft([],[u[0],u[1],u[2]],[d[0],d[1],d[2]]),j=ft([],[d[0],d[1],d[2]],[l[0],l[1],l[2]]),nt=J([],F,-d[3]);return lt(nt,nt,J([],X,-l[3])),lt(nt,nt,J([],j,-u[3])),J(nt,nt,1/m),nt},n.bC=wj,n.bD=function(){return new Float64Array(4)},n.bE=function(d,l,u,m){var A=[],T=[];return A[0]=l[0]-u[0],A[1]=l[1]-u[1],A[2]=l[2]-u[2],T[0]=A[0]*Math.cos(m)-A[1]*Math.sin(m),T[1]=A[0]*Math.sin(m)+A[1]*Math.cos(m),T[2]=A[2],d[0]=T[0]+u[0],d[1]=T[1]+u[1],d[2]=T[2]+u[2],d},n.bF=function(d,l,u,m){var A=[],T=[];return A[0]=l[0]-u[0],A[1]=l[1]-u[1],A[2]=l[2]-u[2],T[0]=A[0],T[1]=A[1]*Math.cos(m)-A[2]*Math.sin(m),T[2]=A[1]*Math.sin(m)+A[2]*Math.cos(m),d[0]=T[0]+u[0],d[1]=T[1]+u[1],d[2]=T[2]+u[2],d},n.bG=function(d,l,u,m){var A=[],T=[];return A[0]=l[0]-u[0],A[1]=l[1]-u[1],A[2]=l[2]-u[2],T[0]=A[2]*Math.sin(m)+A[0]*Math.cos(m),T[1]=A[1],T[2]=A[2]*Math.cos(m)-A[0]*Math.sin(m),d[0]=T[0]+u[0],d[1]=T[1]+u[1],d[2]=T[2]+u[2],d},n.bH=function(d,l,u){var m=Math.sin(u),A=Math.cos(u),T=l[0],M=l[1],P=l[2],L=l[3],O=l[8],V=l[9],F=l[10],X=l[11];return l!==d&&(d[4]=l[4],d[5]=l[5],d[6]=l[6],d[7]=l[7],d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15]),d[0]=T*A-O*m,d[1]=M*A-V*m,d[2]=P*A-F*m,d[3]=L*A-X*m,d[8]=T*m+O*A,d[9]=M*m+V*A,d[10]=P*m+F*A,d[11]=L*m+X*A,d},n.bI=function(d,l){let u=Ue(d,360),m=Ue(l,360),A=m-u,T=m>u?A-360:A+360;return Math.abs(A)<Math.abs(T)?A:T},n.bJ=function(d){return d[0]=0,d[1]=0,d[2]=0,d},n.bK=function(d,l,u,m){let A=Math.sqrt(d*d+l*l),T=Math.sqrt(u*u+m*m);d/=A,l/=A,u/=T,m/=T;let M=Math.acos(d*u+l*m);return-l*u+d*m>0?M:-M},n.bL=function(d,l){let u=Ue(d,2*Math.PI),m=Ue(l,2*Math.PI);return Math.min(Math.abs(u-m),Math.abs(u-m+2*Math.PI),Math.abs(u-m-2*Math.PI))},n.bM=function(){let d={},l=Te.$version;for(let u in Te.$root){let m=Te.$root[u];if(m.required){let A=null;A=u===\"version\"?l:m.type===\"array\"?[]:{},A!=null&&(d[u]=A)}}return d},n.bN=gm,n.bO=dy,n.bP=function d(l,u){if(Array.isArray(l)){if(!Array.isArray(u)||l.length!==u.length)return!1;for(let m=0;m<l.length;m++)if(!d(l[m],u[m]))return!1;return!0}if(typeof l==\"object\"&&l!==null&&u!==null){if(typeof u!=\"object\"||Object.keys(l).length!==Object.keys(u).length)return!1;for(let m in l)if(!d(l[m],u[m]))return!1;return!0}return l===u},n.bQ=function(d){d=d.slice();let l=Object.create(null);for(let u=0;u<d.length;u++)l[d[u].id]=d[u];for(let u=0;u<d.length;u++)\"ref\"in d[u]&&(d[u]=UA(d[u],l[d[u].ref]));return d},n.bR=function(d,l){if(d.type===\"custom\")return new SRt(d,l);switch(d.type){case\"background\":return new TRt(d,l);case\"circle\":return new G8t(d,l);case\"color-relief\":return new Z8t(d,l);case\"fill\":return new hkt(d,l);case\"fill-extrusion\":return new wkt(d,l);case\"heatmap\":return new q8t(d,l);case\"hillshade\":return new Y8t(d,l);case\"line\":return new Ykt(d,l);case\"raster\":return new CM(d,l);case\"symbol\":return new MR(d,l)}},n.bS=d=>d.type===\"raster\",n.bT=He,n.bU=function(d,l){if(!d)return[{command:\"setStyle\",args:[l]}];let u=[];try{if(!Yi(d.version,l.version))return[{command:\"setStyle\",args:[l]}];Yi(d.center,l.center)||u.push({command:\"setCenter\",args:[l.center]}),Yi(d.state,l.state)||u.push({command:\"setGlobalState\",args:[l.state]}),Yi(d.centerAltitude,l.centerAltitude)||u.push({command:\"setCenterAltitude\",args:[l.centerAltitude]}),Yi(d.zoom,l.zoom)||u.push({command:\"setZoom\",args:[l.zoom]}),Yi(d.bearing,l.bearing)||u.push({command:\"setBearing\",args:[l.bearing]}),Yi(d.pitch,l.pitch)||u.push({command:\"setPitch\",args:[l.pitch]}),Yi(d.roll,l.roll)||u.push({command:\"setRoll\",args:[l.roll]}),Yi(d.sprite,l.sprite)||u.push({command:\"setSprite\",args:[l.sprite]}),Yi(d.glyphs,l.glyphs)||u.push({command:\"setGlyphs\",args:[l.glyphs]}),Yi(d.transition,l.transition)||u.push({command:\"setTransition\",args:[l.transition]}),Yi(d.light,l.light)||u.push({command:\"setLight\",args:[l.light]}),Yi(d.terrain,l.terrain)||u.push({command:\"setTerrain\",args:[l.terrain]}),Yi(d.sky,l.sky)||u.push({command:\"setSky\",args:[l.sky]}),Yi(d.projection,l.projection)||u.push({command:\"setProjection\",args:[l.projection]});let m={},A=[];(function(M,P,L,O){let V;for(V in P=P||{},M=M||{})Object.prototype.hasOwnProperty.call(M,V)&&(Object.prototype.hasOwnProperty.call(P,V)||k_(V,L,O));for(V in P)Object.prototype.hasOwnProperty.call(P,V)&&(Object.prototype.hasOwnProperty.call(M,V)?Yi(M[V],P[V])||(M[V].type===\"geojson\"&&P[V].type===\"geojson\"&&_M(M,P,V)?Ds(L,{command:\"setGeoJSONSourceData\",args:[V,P[V].data]}):je(V,P,L,O)):jh(V,P,L))})(d.sources,l.sources,A,m);let T=[];d.layers&&d.layers.forEach((M=>{\"source\"in M&&m[M.source]?u.push({command:\"removeLayer\",args:[M.id]}):T.push(M)})),u=u.concat(A),(function(M,P,L){P=P||[];let O=(M=M||[]).map(R_),V=P.map(R_),F=M.reduce(r2,{}),X=P.reduce(r2,{}),j=O.slice(),nt=Object.create(null),st,pt,mt,vt,At;for(let wt=0,St=0;wt<O.length;wt++)st=O[wt],Object.prototype.hasOwnProperty.call(X,st)?St++:(Ds(L,{command:\"removeLayer\",args:[st]}),j.splice(j.indexOf(st,St),1));for(let wt=0,St=0;wt<V.length;wt++)st=V[V.length-1-wt],j[j.length-1-wt]!==st&&(Object.prototype.hasOwnProperty.call(F,st)?(Ds(L,{command:\"removeLayer\",args:[st]}),j.splice(j.lastIndexOf(st,j.length-St),1)):St++,vt=j[j.length-wt],Ds(L,{command:\"addLayer\",args:[X[st],vt]}),j.splice(j.length-wt,0,st),nt[st]=!0);for(let wt=0;wt<V.length;wt++)if(st=V[wt],pt=F[st],mt=X[st],!nt[st]&&!Yi(pt,mt))if(Yi(pt.source,mt.source)&&Yi(pt[\"source-layer\"],mt[\"source-layer\"])&&Yi(pt.type,mt.type)){for(At in VA(pt.layout,mt.layout,L,st,null,\"setLayoutProperty\"),VA(pt.paint,mt.paint,L,st,null,\"setPaintProperty\"),Yi(pt.filter,mt.filter)||Ds(L,{command:\"setFilter\",args:[st,mt.filter]}),Yi(pt.minzoom,mt.minzoom)&&Yi(pt.maxzoom,mt.maxzoom)||Ds(L,{command:\"setLayerZoomRange\",args:[st,mt.minzoom,mt.maxzoom]}),pt)Object.prototype.hasOwnProperty.call(pt,At)&&At!==\"layout\"&&At!==\"paint\"&&At!==\"filter\"&&At!==\"metadata\"&&At!==\"minzoom\"&&At!==\"maxzoom\"&&(At.indexOf(\"paint.\")===0?VA(pt[At],mt[At],L,st,At.slice(6),\"setPaintProperty\"):Yi(pt[At],mt[At])||Ds(L,{command:\"setLayerProperty\",args:[st,At,mt[At]]}));for(At in mt)Object.prototype.hasOwnProperty.call(mt,At)&&!Object.prototype.hasOwnProperty.call(pt,At)&&At!==\"layout\"&&At!==\"paint\"&&At!==\"filter\"&&At!==\"metadata\"&&At!==\"minzoom\"&&At!==\"maxzoom\"&&(At.indexOf(\"paint.\")===0?VA(pt[At],mt[At],L,st,At.slice(6),\"setPaintProperty\"):Yi(pt[At],mt[At])||Ds(L,{command:\"setLayerProperty\",args:[st,At,mt[At]]}))}else Ds(L,{command:\"removeLayer\",args:[st]}),vt=j[j.lastIndexOf(st)+1],Ds(L,{command:\"addLayer\",args:[mt,vt]})})(T,l.layers,u)}catch(m){console.warn(\"Unable to compute style diff:\",m),u=[{command:\"setStyle\",args:[l]}]}return u},n.bV=function(d){let l=[],u=d.id;return u===void 0&&l.push({message:`layers.${u}: missing required property \"id\"`}),d.render===void 0&&l.push({message:`layers.${u}: missing required method \"render\"`}),d.renderingMode&&d.renderingMode!==\"2d\"&&d.renderingMode!==\"3d\"&&l.push({message:`layers.${u}: property \"renderingMode\" must be either \"2d\" or \"3d\"`}),l},n.bW=ti,n.bX=wr,n.bY=class extends k{constructor(d,l){super(d,l),this.current=0}set(d){this.current!==d&&(this.current=d,this.gl.uniform1i(this.location,d))}},n.bZ=$,n.b_=class extends k{constructor(d,l){super(d,l),this.current=Z}set(d){if(d[12]!==this.current[12]||d[0]!==this.current[0])return this.current=d,void this.gl.uniformMatrix4fv(this.location,!1,d);for(let l=1;l<16;l++)if(d[l]!==this.current[l]){this.current=d,this.gl.uniformMatrix4fv(this.location,!1,d);break}}},n.ba=zot,n.bb=$2,n.bc=function(d,l,u,m,A){var T=1/Math.tan(l/2);if(d[0]=T/u,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=T,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=-1,d[12]=0,d[13]=0,d[15]=0,A!=null&&A!==1/0){var M=1/(m-A);d[10]=(A+m)*M,d[14]=2*A*m*M}else d[10]=-1,d[14]=-2*m;return d},n.bd=function(d){var l=new H(16);return l[0]=d[0],l[1]=d[1],l[2]=d[2],l[3]=d[3],l[4]=d[4],l[5]=d[5],l[6]=d[6],l[7]=d[7],l[8]=d[8],l[9]=d[9],l[10]=d[10],l[11]=d[11],l[12]=d[12],l[13]=d[13],l[14]=d[14],l[15]=d[15],l},n.be=function(d,l,u){var m=Math.sin(u),A=Math.cos(u),T=l[0],M=l[1],P=l[2],L=l[3],O=l[4],V=l[5],F=l[6],X=l[7];return l!==d&&(d[8]=l[8],d[9]=l[9],d[10]=l[10],d[11]=l[11],d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15]),d[0]=T*A+O*m,d[1]=M*A+V*m,d[2]=P*A+F*m,d[3]=L*A+X*m,d[4]=O*A-T*m,d[5]=V*A-M*m,d[6]=F*A-P*m,d[7]=X*A-L*m,d},n.bf=function(d,l,u){var m=Math.sin(u),A=Math.cos(u),T=l[4],M=l[5],P=l[6],L=l[7],O=l[8],V=l[9],F=l[10],X=l[11];return l!==d&&(d[0]=l[0],d[1]=l[1],d[2]=l[2],d[3]=l[3],d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15]),d[4]=T*A+O*m,d[5]=M*A+V*m,d[6]=P*A+F*m,d[7]=L*A+X*m,d[8]=O*A-T*m,d[9]=V*A-M*m,d[10]=F*A-P*m,d[11]=X*A-L*m,d},n.bg=function(){let d=new Float32Array(16);return tt(d),d},n.bh=function(){let d=new Float64Array(16);return tt(d),d},n.bi=function(){return new Float64Array(16)},n.bj=function(d,l,u){let m=new Float64Array(4);return $t(m,d,l-90,u),m},n.bk=function(d,l,u,m){var A,T,M,P,L,O=l[0],V=l[1],F=l[2],X=l[3],j=u[0],nt=u[1],st=u[2],pt=u[3];return(T=O*j+V*nt+F*st+X*pt)<0&&(T=-T,j=-j,nt=-nt,st=-st,pt=-pt),1-T>Y?(A=Math.acos(T),M=Math.sin(A),P=Math.sin((1-m)*A)/M,L=Math.sin(m*A)/M):(P=1-m,L=m),d[0]=P*O+L*j,d[1]=P*V+L*nt,d[2]=P*F+L*st,d[3]=P*X+L*pt,d},n.bl=function(d){let l=new Float64Array(9);var u,m,A,T,M,P,L,O,V,F,X,j,nt,st,pt,mt,vt,At;F=(A=(m=d)[0])*(L=A+A),X=(T=m[1])*L,nt=(M=m[2])*L,st=M*(O=T+T),mt=(P=m[3])*L,vt=P*O,At=P*(V=M+M),(u=l)[0]=1-(j=T*O)-(pt=M*V),u[3]=X-At,u[6]=nt+vt,u[1]=X+At,u[4]=1-F-pt,u[7]=st-mt,u[2]=nt-vt,u[5]=st+mt,u[8]=1-F-j;let wt=Vl(-Math.asin(gr(l[2],-1,1))),St,Bt;return Math.hypot(l[5],l[8])<.001?(St=0,Bt=-Vl(Math.atan2(l[3],l[4]))):(St=Vl(l[5]===0&&l[8]===0?0:Math.atan2(l[5],l[8])),Bt=Vl(l[1]===0&&l[0]===0?0:Math.atan2(l[1],l[0]))),{roll:St,pitch:wt+90,bearing:Bt}},n.bm=function(d,l){return d.roll==l.roll&&d.pitch==l.pitch&&d.bearing==l.bearing},n.bn=Mi,n.bo=B,n.bp=B2,n.bq=FM,n.br=L2,n.bs=lr,n.bt=ee,n.bu=ra,n.bv=function(d,l,u,m,A){return lr(m,A,gr((d-l)/(u-l),0,1))},n.bw=function(d,l,u,m){return d[0]=l[0]+u[0]*m,d[1]=l[1]+u[1]*m,d[2]=l[2]+u[2]*m,d},n.bx=Ue,n.by=function(){return new Float64Array(3)},n.bz=$t,n.c=ja,n.c$=class{constructor(d,l){this.layers={[HM]:this},this.name=HM,this.version=l?l.version:1,this.extent=l?l.extent:4096,this.length=d.length,this.features=d}feature(d){return new JRt(this.features[d],this.extent)}},n.c0=class extends k{constructor(d,l){super(d,l),this.current=[0,0,0]}set(d){d[0]===this.current[0]&&d[1]===this.current[1]&&d[2]===this.current[2]||(this.current=d,this.gl.uniform3f(this.location,d[0],d[1],d[2]))}},n.c1=class extends k{constructor(d,l){super(d,l),this.current=[0,0]}set(d){d[0]===this.current[0]&&d[1]===this.current[1]||(this.current=d,this.gl.uniform2f(this.location,d[0],d[1]))}},n.c2=Q,n.c3=function(d,l){var u=Math.sin(l),m=Math.cos(l);return d[0]=m,d[1]=u,d[2]=0,d[3]=-u,d[4]=m,d[5]=0,d[6]=0,d[7]=0,d[8]=1,d},n.c4=function(d,l,u){var m=l[0],A=l[1],T=l[2];return d[0]=m*u[0]+A*u[3]+T*u[6],d[1]=m*u[1]+A*u[4]+T*u[7],d[2]=m*u[2]+A*u[5]+T*u[8],d},n.c5=function(d,l,u,m,A,T,M){var P=1/(l-u),L=1/(m-A),O=1/(T-M);return d[0]=-2*P,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*L,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*O,d[11]=0,d[12]=(l+u)*P,d[13]=(A+m)*L,d[14]=(M+T)*O,d[15]=1,d},n.c6=class extends k{constructor(d,l){super(d,l),this.current=new Array}set(d){if(d!=this.current){this.current=d;let l=new Float32Array(4*d.length);for(let u=0;u<d.length;u++)l[4*u]=d[u].r,l[4*u+1]=d[u].g,l[4*u+2]=d[u].b,l[4*u+3]=d[u].a;this.gl.uniform4fv(this.location,l)}}},n.c7=class extends k{constructor(d,l){super(d,l),this.current=new Array}set(d){if(d!=this.current){this.current=d;let l=new Float32Array(d);this.gl.uniform1fv(this.location,l)}}},n.c8=class extends Ay{},n.c9=Qkt,n.cA=function(d,l,u){var m=l[0],A=l[1];return d[0]=u[0]*m+u[4]*A+u[12],d[1]=u[1]*m+u[5]*A+u[13],d},n.cB=function(d,l){let{x:u,y:m}=GM.fromLngLat(l);return!(d<0||d>25||m<0||m>=1||u<0||u>=1)},n.cC=function(d,l){return d[0]=l[0],d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=l[1],d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=l[2],d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d},n.cD=class extends Km{},n.cE=g7t,n.cG=af,n.cH=function(d,l){ja.REGISTERED_PROTOCOLS[d]=l},n.cI=function(d){delete ja.REGISTERED_PROTOCOLS[d]},n.cJ=function(d,l){let u={};for(let A=0;A<d.length;A++){let T=l&&l[d[A].id]||EM(d[A]);l&&(l[d[A].id]=T);let M=u[T];M||(M=u[T]=[]),M.push(d[A])}let m=[];for(let A in u)m.push(u[A]);return m},n.cK=ir,n.cL=Uot,n.cM=yst,n.cN=xot,n.cO=function(d){var l;d.bucket.createArrays(),d.bucket.tilePixelRatio=Pe/(512*d.bucket.overscaling),d.bucket.compareText={},d.bucket.iconsNeedLinear=!1;let u=d.bucket.layers[0],m=u.layout,A=u._unevaluatedLayout._values,T={layoutIconSize:A[\"icon-size\"].possiblyEvaluate(new hn(d.bucket.zoom+1),d.canonical),layoutTextSize:A[\"text-size\"].possiblyEvaluate(new hn(d.bucket.zoom+1),d.canonical),textMaxSize:A[\"text-size\"].possiblyEvaluate(new hn(18))};if(d.bucket.textSizeData.kind===\"composite\"){let{minZoom:V,maxZoom:F}=d.bucket.textSizeData;T.compositeTextSizes=[A[\"text-size\"].possiblyEvaluate(new hn(V),d.canonical),A[\"text-size\"].possiblyEvaluate(new hn(F),d.canonical)]}if(d.bucket.iconSizeData.kind===\"composite\"){let{minZoom:V,maxZoom:F}=d.bucket.iconSizeData;T.compositeIconSizes=[A[\"icon-size\"].possiblyEvaluate(new hn(V),d.canonical),A[\"icon-size\"].possiblyEvaluate(new hn(F),d.canonical)]}let M=m.get(\"text-line-height\")*oa,P=m.get(\"text-rotation-alignment\")!==\"viewport\"&&m.get(\"symbol-placement\")!==\"point\",L=m.get(\"text-keep-upright\"),O=m.get(\"text-size\");for(let V of d.bucket.features){let F=m.get(\"text-font\").evaluate(V,{},d.canonical).join(\",\"),X=O.evaluate(V,{},d.canonical),j=T.layoutTextSize.evaluate(V,{},d.canonical),nt=T.layoutIconSize.evaluate(V,{},d.canonical),st={horizontal:{},vertical:void 0},pt=V.text,mt,vt=[0,0];if(pt){let St=pt.toString(),Bt=m.get(\"text-letter-spacing\").evaluate(V,{},d.canonical)*oa,qt=t0(St)?Bt:0,te=m.get(\"text-anchor\").evaluate(V,{},d.canonical),he=kst(u,V,d.canonical);if(!he){let be=m.get(\"text-radial-offset\").evaluate(V,{},d.canonical);vt=be?Ist(te,[be*oa,Gj]):m.get(\"text-offset\").evaluate(V,{},d.canonical).map((Ae=>Ae*oa))}let fe=P?\"center\":m.get(\"text-justify\").evaluate(V,{},d.canonical),Se=m.get(\"symbol-placement\")===\"point\"?m.get(\"text-max-width\").evaluate(V,{},d.canonical)*oa:1/0,ve=()=>{d.bucket.allowVerticalPlacement&&$m(St)&&(st.vertical=TR(pt,d.glyphMap,d.glyphPositions,d.imagePositions,F,Se,M,te,\"left\",qt,vt,n.aw.vertical,!0,j,X))};if(!P&&he){let be=new Set;if(fe===\"auto\")for(let Ze=0;Ze<he.values.length;Ze+=2)be.add(Wj(he.values[Ze]));else be.add(fe);let Ae=!1;for(let Ze of be)if(!st.horizontal[Ze])if(Ae)st.horizontal[Ze]=st.horizontal[0];else{let nr=TR(pt,d.glyphMap,d.glyphPositions,d.imagePositions,F,Se,M,\"center\",Ze,qt,vt,n.aw.horizontal,!1,j,X);nr&&(st.horizontal[Ze]=nr,Ae=nr.positionedLines.length===1)}ve()}else{fe===\"auto\"&&(fe=Wj(te));let be=TR(pt,d.glyphMap,d.glyphPositions,d.imagePositions,F,Se,M,te,fe,qt,vt,n.aw.horizontal,!1,j,X);be&&(st.horizontal[fe]=be),ve(),$m(St)&&P&&L&&(st.vertical=TR(pt,d.glyphMap,d.glyphPositions,d.imagePositions,F,Se,M,te,fe,qt,vt,n.aw.vertical,!1,j,X))}}let At=!1;if(V.icon&&V.icon.name){let St=d.imageMap[V.icon.name];St&&(mt=vRt(d.imagePositions[V.icon.name],m.get(\"icon-offset\").evaluate(V,{},d.canonical),m.get(\"icon-anchor\").evaluate(V,{},d.canonical)),At=!!St.sdf,d.bucket.sdfIcons===void 0?d.bucket.sdfIcons=At:d.bucket.sdfIcons!==At&&ln(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),(St.pixelRatio!==d.bucket.pixelRatio||m.get(\"icon-rotate\").constantOr(1)!==0)&&(d.bucket.iconsNeedLinear=!0))}let wt=Dst(st.horizontal)||st.vertical;(l=d.bucket).iconsInText||(l.iconsInText=!!wt&&wt.iconsInText),(wt||mt)&&p7t(d.bucket,V,st,mt,d.imageMap,T,j,nt,vt,At,d.canonical,d.subdivisionGranularity)}d.showCollisionBoxes&&d.bucket.generateCollisionDebugBuffers()},n.cP=ZV,n.cQ=QV,n.cR=pj,n.cS=function(d,l=\"\"){let u=new wR;return(function(m,A,T=\"\"){for(let M in m.layers)A.writeMessage(3,((P,L)=>t7t(P,L,T)),m.layers[M])})(d,u,l),u.finish()},n.cT=function(d,l,u,m,A,T){let M=bst(d,l,u,A,0);return M=bst(M,l,m,T,1),M},n.cU=class{constructor(d){this.maxEntries=d,this.map=new Map}get(d){let l=this.map.get(d);return l!==void 0&&(this.map.delete(d),this.map.set(d,l)),l}set(d,l){if(this.map.has(d))this.map.delete(d);else if(this.map.size>=this.maxEntries){let u=this.map.keys().next().value;this.map.delete(u)}this.map.set(d,l)}clear(){this.map.clear()}},n.cV=Wnt,n.cW=wR,n.cX=gst,n.cY=class{constructor(d){this.start=`${d}#start`,this.end=`${d}#end`,this.measure=d,performance.mark(this.start)}finish(){performance.mark(this.end);let d=performance.getEntriesByName(this.measure);return d.length===0&&(performance.measure(this.measure,this.start,this.end),d=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),d}},n.cZ=function(d,l,u,m,A){return o(this,void 0,void 0,(function*(){if(W())try{return yield gc(d,l,u,m,A)}catch{}return(function(T,M,P,L,O){let V=T.width,F=T.height;Wu&&qu||(Wu=new OffscreenCanvas(V,F),qu=Wu.getContext(\"2d\",{willReadFrequently:!0})),Wu.width=V,Wu.height=F,qu.drawImage(T,0,0,V,F);let X=qu.getImageData(M,P,L,O);return qu.clearRect(0,0,V,F),X.data})(d,l,u,m,A)}))},n.c_=Dnt,n.ca=class extends ud{},n.cb=WV,n.cc=function(d){return d<=1?1:Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))},n.cd=Cnt,n.ce=function(d,l,u){var m=l[0],A=l[1],T=l[2],M=u[3]*m+u[7]*A+u[11]*T+u[15];return d[0]=(u[0]*m+u[4]*A+u[8]*T+u[12])/(M=M||1),d[1]=(u[1]*m+u[5]*A+u[9]*T+u[13])/M,d[2]=(u[2]*m+u[6]*A+u[10]*T+u[14])/M,d},n.cf=class extends wf{},n.cg=class extends f{},n.ch=function(d,l){return d[0]===l[0]&&d[1]===l[1]&&d[2]===l[2]&&d[3]===l[3]&&d[4]===l[4]&&d[5]===l[5]&&d[6]===l[6]&&d[7]===l[7]&&d[8]===l[8]&&d[9]===l[9]&&d[10]===l[10]&&d[11]===l[11]&&d[12]===l[12]&&d[13]===l[13]&&d[14]===l[14]&&d[15]===l[15]},n.ci=function(d,l){var u=d[0],m=d[1],A=d[2],T=d[3],M=d[4],P=d[5],L=d[6],O=d[7],V=d[8],F=d[9],X=d[10],j=d[11],nt=d[12],st=d[13],pt=d[14],mt=d[15],vt=l[0],At=l[1],wt=l[2],St=l[3],Bt=l[4],qt=l[5],te=l[6],he=l[7],fe=l[8],Se=l[9],ve=l[10],be=l[11],Ae=l[12],Ze=l[13],nr=l[14],er=l[15];return Math.abs(u-vt)<=Y*Math.max(1,Math.abs(u),Math.abs(vt))&&Math.abs(m-At)<=Y*Math.max(1,Math.abs(m),Math.abs(At))&&Math.abs(A-wt)<=Y*Math.max(1,Math.abs(A),Math.abs(wt))&&Math.abs(T-St)<=Y*Math.max(1,Math.abs(T),Math.abs(St))&&Math.abs(M-Bt)<=Y*Math.max(1,Math.abs(M),Math.abs(Bt))&&Math.abs(P-qt)<=Y*Math.max(1,Math.abs(P),Math.abs(qt))&&Math.abs(L-te)<=Y*Math.max(1,Math.abs(L),Math.abs(te))&&Math.abs(O-he)<=Y*Math.max(1,Math.abs(O),Math.abs(he))&&Math.abs(V-fe)<=Y*Math.max(1,Math.abs(V),Math.abs(fe))&&Math.abs(F-Se)<=Y*Math.max(1,Math.abs(F),Math.abs(Se))&&Math.abs(X-ve)<=Y*Math.max(1,Math.abs(X),Math.abs(ve))&&Math.abs(j-be)<=Y*Math.max(1,Math.abs(j),Math.abs(be))&&Math.abs(nt-Ae)<=Y*Math.max(1,Math.abs(nt),Math.abs(Ae))&&Math.abs(st-Ze)<=Y*Math.max(1,Math.abs(st),Math.abs(Ze))&&Math.abs(pt-nr)<=Y*Math.max(1,Math.abs(pt),Math.abs(nr))&&Math.abs(mt-er)<=Y*Math.max(1,Math.abs(mt),Math.abs(er))},n.cj=function(d,l){return d[0]=l[0],d[1]=l[1],d[2]=l[2],d[3]=l[3],d[4]=l[4],d[5]=l[5],d[6]=l[6],d[7]=l[7],d[8]=l[8],d[9]=l[9],d[10]=l[10],d[11]=l[11],d[12]=l[12],d[13]=l[13],d[14]=l[14],d[15]=l[15],d},n.ck=d=>d.type===\"circle\",n.cl=d=>d.type===\"heatmap\",n.cm=d=>d.type===\"line\",n.cn=d=>d.type===\"fill\",n.co=d=>d.type===\"fill-extrusion\",n.cp=d=>d.type===\"hillshade\",n.cq=d=>d.type===\"color-relief\",n.cr=d=>d.type===\"background\",n.cs=d=>d.type===\"custom\",n.ct=Ce,n.cu=function(d,l,u){if(l<=0)return d;let m=1/l;return u===void 0||Math.abs(u)<1e-10?Math.round(d*m)/m:(u>0?Math.ceil(d*m-1e-9):Math.floor(d*m+1e-10))/m},n.cv=function(d,l,u){let m=_e(l.x-u.x,l.y-u.y),A=_e(d.x-u.x,d.y-u.y);var T,M;return Vl(Math.atan2(m[0]*A[1]-m[1]*A[0],(T=m)[0]*(M=A)[0]+T[1]*M[1]))},n.cw=mr,n.cx=function(d,l){var u;if(!NA[l])return!1;let m=d?.target,A=((u=m?.ownerDocument)===null||u===void 0?void 0:u.defaultView)||window;return d instanceof A.MouseEvent||d instanceof A.WheelEvent},n.cy=function(d,l){return FA[l]&&\"touches\"in d},n.cz=function(d){return FA[d]||NA[d]},n.d=$l,n.d0=Gp,n.d1=class{get tiles(){return this.tileIndex?.tiles??{}}get stats(){return this.tileIndex.stats}get total(){return this.tileIndex.total}constructor(d,l){let u=(l=this.options=Object.assign({},Vkt,l)).debug;if(u&&console.time(\"preprocess data\"),l.maxZoom<0||l.maxZoom>24)throw new Error(\"maxZoom should be in the 0-24 range\");if(l.promoteId&&l.generateId)throw new Error(\"promoteId and generateId cannot be used together.\");let m=rj(d,l);u&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",l.indexMaxZoom,l.indexMaxPoints),console.time(\"generate tiles\")),m=aj(m,l),l.updateable&&(this.source=m),this.initializeIndex(m,l)}initializeIndex(d,l){this.tileIndex=l.cluster?new Okt(l.clusterOptions):new Ukt(l),d.length&&this.tileIndex.initialize(d)}getTile(d,l,u){return l=+l,u=+u,(d=+d)<0||d>24?null:this.tileIndex.getTile(d,l,u)}updateData(d,l){let u=this.options;if(!u.updateable)throw new Error(\"to update tile geojson `updateable` option must be set to true\");let{affected:m,source:A}=(function(T,M,P){let L=(function(V){return V?{removeAll:V.removeAll,remove:new Set(V.remove||[]),add:new Map(V.add?.map((F=>[F.id,F]))),update:new Map(V.update?.map((F=>[F.id,F])))}:{remove:new Set,add:new Map,update:new Map}})(M),O=[];if(L.removeAll&&(O=T,T=[]),L.remove.size||L.add.size){let V=[];for(let F of T)(L.remove.has(F.id)||L.add.has(F.id))&&V.push(F);if(V.length){O.push(...V);let F=new Set(V.map((X=>X.id)));T=T.filter((X=>!F.has(X.id)))}if(L.add.size){let F=rj({type:\"FeatureCollection\",features:Array.from(L.add.values())},P);F=aj(F,P),O.push(...F),T.push(...F)}}if(L.update.size)for(let[V,F]of L.update){let X=[],j=[];for(let st of T)st.id===V?X.push(st):j.push(st);if(!X.length)continue;let nt=Dkt(X,F,P);nt.length&&(O.push(...X,...nt),j.push(...nt),T=j)}return{affected:O,source:T}})(this.source,d,u);l&&({affected:m,source:A}=this.filterUpdate(A,m,l)),m.length&&(this.source=A,this.tileIndex.updateIndex(A,m,u))}filterUpdate(d,l,u){let m=new Set;for(let A of d)A.id!=null&&(u(vR(A))||(l.push(A),m.add(A.id)));return{affected:l,source:d=d.filter((A=>!m.has(A.id)))}}getData(){if(!this.options.updateable)throw new Error(\"to retrieve data the `updateable` option must be set to true\");return{type:\"FeatureCollection\",features:this.source.map((d=>vR(d)))}}updateClusterOptions(d,l){let u=this.options.cluster;this.options.cluster=d,this.options.clusterOptions=l,u!=d?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(d){return this.tileIndex.getClusterExpansionZoom(d)}getClusterChildren(d){return this.tileIndex.getChildren(d)}getClusterLeaves(d,l,u){return this.tileIndex.getLeaves(d,l,u)}},n.d2=ad,n.e=Cr,n.f=d=>o(void 0,void 0,void 0,(function*(){if(d.byteLength===0)return createImageBitmap(new ImageData(1,1));let l=new Blob([new Uint8Array(d)],{type:\"image/png\"});try{return createImageBitmap(l)}catch(u){throw new Error(`Could not load image because of ${u.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),n.g=jl,n.h=d=>new Promise(((l,u)=>{let m=new Image;m.onload=()=>{l(m),URL.revokeObjectURL(m.src),m.onload=null,window.requestAnimationFrame((()=>{m.src=Ul}))},m.onerror=()=>u(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.\"));let A=new Blob([new Uint8Array(d)],{type:\"image/png\"});m.src=d.byteLength?URL.createObjectURL(A):Ul})),n.i=qn,n.j=(d,l)=>Hu(Cr(d,{type:\"json\"}),l),n.k=Am,n.l=Ip,n.m=Hu,n.n=(d,l)=>Hu(Cr(d,{type:\"arrayBuffer\"}),l),n.o=function(d){return new wR(d).readFields(dRt,[])},n.p=bot,n.q=function(d){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u2E80-\\u2FDF\\u3000-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(d))},n.r=RM,n.s=Rs,n.t=na,n.u=Te,n.v=Vm,n.w=ln,n.x=Hm,n.y=Wa,n.z=Wm})),r(\"worker\",[\"./shared\"],(function(n){\"use strict\";class o{constructor(et,lt){this.keyCache={},et&&this.replace(et,lt)}replace(et,lt){this._layerConfigs={},this._layers={},this.update(et,[],lt)}update(et,lt,J){for(let dt of et){this._layerConfigs[dt.id]=dt;let Mt=this._layers[dt.id]=n.bR(dt,J);Mt._featureFilter=n.ag(Mt.filter,J),this.keyCache[dt.id]&&delete this.keyCache[dt.id]}for(let dt of lt)delete this.keyCache[dt],delete this._layerConfigs[dt],delete this._layers[dt];this.familiesBySource={};let ft=n.cJ(Object.values(this._layerConfigs),this.keyCache);for(let dt of ft){let Mt=dt.map((Pe=>this._layers[Pe.id])),Ft=Mt[0];if(Ft.isHidden())continue;let Nt=Ft.source||\"\",$t=this.familiesBySource[Nt];$t||($t=this.familiesBySource[Nt]={});let Yt=Ft.sourceLayer||n.af,_e=$t[Yt];_e||(_e=$t[Yt]=[]),_e.push(Mt)}}}class s{constructor(et){let lt={},J=[];for(let Ft in et){let Nt=et[Ft],$t=lt[Ft]={};for(let Yt in Nt){let _e=Nt[+Yt];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;let Pe={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};J.push(Pe),$t[Yt]={rect:Pe,metrics:_e.metrics}}}let{w:ft,h:dt}=n.p(J),Mt=new n.r({width:ft||1,height:dt||1});for(let Ft in et){let Nt=et[Ft];for(let $t in Nt){let Yt=Nt[+$t];if(!Yt||Yt.bitmap.width===0||Yt.bitmap.height===0)continue;let _e=lt[Ft][$t].rect;n.r.copy(Yt.bitmap,Mt,{x:0,y:0},{x:_e.x+1,y:_e.y+1},Yt.bitmap)}}this.image=Mt,this.positions=lt}}n.cK(\"GlyphAtlas\",s);class a{constructor(et){this.tileID=new n.a2(et.tileID.overscaledZ,et.tileID.wrap,et.tileID.canonical.z,et.tileID.canonical.x,et.tileID.canonical.y),this.uid=et.uid,this.zoom=et.zoom,this.pixelRatio=et.pixelRatio,this.tileSize=et.tileSize,this.source=et.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=et.showCollisionBoxes,this.collectResourceTiming=!!et.collectResourceTiming,this.returnDependencies=!!et.returnDependencies,this.promoteId=et.promoteId,this.inFlightDependencies=[]}parse(et,lt,J,ft,dt){return n._(this,void 0,void 0,(function*(){this.status=\"parsing\",this.data=et,this.collisionBoxArray=new n.ad;let Mt=new n.cL(Object.keys(et.layers).sort()),Ft=new n.cM(this.tileID,this.promoteId);Ft.bucketLayerIDs=[];let Nt={},$t={featureIndex:Ft,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:J,subdivisionGranularity:dt},Yt=lt.familiesBySource[this.source];for(let He in Yt){let Ui=et.layers[He];if(!Ui)continue;Ui.version===1&&n.w(`Vector tile source \"${this.source}\" layer \"${He}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ln=Mt.encode(He),Io=[];for(let qn=0;qn<Ui.length;qn++){let ds=Ui.feature(qn),Xo=Ft.getId(ds,He);Io.push({feature:ds,id:Xo,index:qn,sourceLayerIndex:ln})}for(let qn of Yt[He]){let ds=qn[0];ds.source!==this.source&&n.w(`layer.source = ${ds.source} does not equal this.source = ${this.source}`),ds.isHidden(this.zoom,!0)||(h(qn,this.zoom,J),(Nt[ds.id]=ds.createBucket({index:Ft.bucketLayerIDs.length,layers:qn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ln,sourceID:this.source})).populate(Io,$t,this.tileID.canonical),Ft.bucketLayerIDs.push(qn.map((Xo=>Xo.id))))}}let _e=n.bW($t.glyphDependencies,(He=>Object.keys(He).map(Number)));this.inFlightDependencies.forEach((He=>He?.abort())),this.inFlightDependencies=[];let Pe=Promise.resolve({});if(Object.keys(_e).length){let He=new AbortController;this.inFlightDependencies.push(He),Pe=ft.sendAsync({type:\"GG\",data:{stacks:_e,source:this.source,tileID:this.tileID,type:\"glyphs\"}},He)}let we=Object.keys($t.iconDependencies),Ue=Promise.resolve({});if(we.length){let He=new AbortController;this.inFlightDependencies.push(He),Ue=ft.sendAsync({type:\"GI\",data:{icons:we,source:this.source,tileID:this.tileID,type:\"icons\"}},He)}let lr=Object.keys($t.patternDependencies),ee=Promise.resolve({});if(lr.length){let He=new AbortController;this.inFlightDependencies.push(He),ee=ft.sendAsync({type:\"GI\",data:{icons:lr,source:this.source,tileID:this.tileID,type:\"patterns\"}},He)}let Ce=$t.dashDependencies,mr=Promise.resolve({});if(Object.keys(Ce).length){let He=new AbortController;this.inFlightDependencies.push(He),mr=ft.sendAsync({type:\"GDA\",data:{dashes:Ce}},He)}let[gr,Br,Cr,Rr]=yield Promise.all([Pe,Ue,ee,mr]),ti=new s(gr),wr=new n.cN(Br,Cr);for(let He in Nt){let Ui=Nt[He];Ui instanceof n.ae?(h(Ui.layers,this.zoom,J),n.cO({bucket:Ui,glyphMap:gr,glyphPositions:ti.positions,imageMap:Br,imagePositions:wr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:$t.subdivisionGranularity})):Ui.hasDependencies&&(Ui instanceof n.cP||Ui instanceof n.cQ||Ui instanceof n.cR)&&(h(Ui.layers,this.zoom,J),Ui.addFeatures($t,this.tileID.canonical,wr.patternPositions,Rr))}return this.status=\"done\",{buckets:Object.values(Nt).filter((He=>!He.isEmpty())),featureIndex:Ft,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ti.image,imageAtlas:wr,dashPositions:Rr,glyphMap:this.returnDependencies?gr:null,iconMap:this.returnDependencies?Br:null,glyphPositions:this.returnDependencies?ti.positions:null}}))}}function h(at,et,lt){let J=new n.H(et);for(let ft of at)ft.recalculate(J,lt)}class p{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(et,lt){this.loading[et]=lt}finishLoading(et){delete this.loading[et]}abort(et){let lt=this.loading[et];lt?.abort&&(lt.abort.abort(),delete this.loading[et])}setParsing(et,lt){this.parsing[et]=lt}consumeParsing(et){let lt=this.parsing[et];if(lt)return delete this.parsing[et],lt}clearParsing(et){delete this.parsing[et]}markLoaded(et,lt){this.loaded[et]=lt}getLoaded(et){let lt=this.loaded[et];if(lt)return lt}removeLoaded(et){delete this.loaded[et]}clearLoaded(){this.loaded={}}}class g{constructor(et,lt,J,ft,dt){this.type=et,this.properties=J||{},this.extent=dt,this.pointsArray=lt,this.id=ft}loadGeometry(){return this.pointsArray.map((et=>et.map((lt=>new n.P(lt.x,lt.y)))))}}class w{constructor(et,lt,J){this.version=2,this._myFeatures=et,this.name=lt,this.length=et.length,this.extent=J}feature(et){return this._myFeatures[et]}}class C{constructor(){this.layers={}}addLayer(et){this.layers[et.name]=et}}function R(at){let et=n.cS(at);return et.byteOffset===0&&et.byteLength===et.buffer.byteLength||(et=new Uint8Array(et)),{vectorTile:at,rawData:et.buffer}}function z(at,et,lt){let{extent:J}=at,ft=Math.pow(2,lt.z-et.z),dt=(lt.x-et.x*ft)*J,Mt=(lt.y-et.y*ft)*J,Ft=[];for(let Nt=0;Nt<at.length;Nt++){let $t=at.feature(Nt),Yt=$t.loadGeometry();for(let Pe of Yt)for(let we of Pe)we.x=we.x*ft-dt,we.y=we.y*ft-Mt;let _e=128;Yt=n.cT(Yt,$t.type,-_e,-_e,J+_e,J+_e),Yt.length!==0&&Ft.push(new g($t.type,Yt,$t.properties,$t.id,J))}return new w(Ft,at.name,J)}class W{constructor(et,lt,J){this.actor=et,this.layerIndex=lt,this.availableImages=J,this.tileState=new p,this.overzoomedTileResultCache=new n.cU(1e3)}loadVectorTile(et,lt){try{return{vectorTile:et.encoding!==\"mlt\"?new n.cV(new n.cW(lt)):new n.cX(lt),rawData:lt}}catch(J){let ft=new Uint8Array(lt),dt=`Unable to parse the tile at ${et.request.url}, `;throw dt+=ft[0]===31&&ft[1]===139?\"please make sure the data is not gzipped and that you have configured the relevant header in the server\":`got error: ${J.message}`,new Error(dt)}}loadTile(et){return n._(this,void 0,void 0,(function*(){let{uid:lt,overzoomParameters:J}=et;J&&(et.request=J.overzoomRequest);let ft=this._startRequestTiming(et),dt=new a(et);this.tileState.startLoading(lt,dt);let Mt=new AbortController;dt.abort=Mt;try{let Ft=yield n.n(et.request,Mt);if(et.etag&&et.etag===Ft.etag)return this.tileState.finishLoading(lt),this._getEtagUnmodifiedResult(Ft,ft);let Nt=this.loadVectorTile(et,Ft.data);if(this.tileState.finishLoading(lt),!Nt)return null;let{vectorTile:$t,rawData:Yt}=Nt;J&&({vectorTile:$t,rawData:Yt}=this._getOverzoomTile(et,$t));let _e=this._getExpiryData(Ft),Pe=this._finishRequestTiming(ft);dt.vectorTile=$t,this.tileState.markLoaded(lt,dt);let we={rawData:Yt,cacheControl:_e,resourceTiming:Pe};this.tileState.setParsing(lt,we);try{return yield this._parseWorkerTile(dt,et,we)}finally{this.tileState.clearParsing(lt)}}catch(Ft){throw this.tileState.finishLoading(lt),dt.status=\"done\",this.tileState.markLoaded(lt,dt),Ft}}))}_getEtagUnmodifiedResult(et,lt){let J=this._getExpiryData(et),ft=this._finishRequestTiming(lt);return n.e({etagUnmodified:!0},J,ft)}_parseWorkerTile(et,lt,J){return n._(this,void 0,void 0,(function*(){let ft=yield et.parse(et.vectorTile,this.layerIndex,this.availableImages,this.actor,lt.subdivisionGranularity);if(J){let{rawData:dt,cacheControl:Mt,resourceTiming:Ft}=J;ft=n.e({rawTileData:dt.slice(0),encoding:lt.encoding},ft,Mt,Ft)}return ft}))}_getExpiryData({expires:et,cacheControl:lt,etag:J}){let ft={};return et&&(ft.expires=et),lt&&(ft.cacheControl=lt),J&&(ft.etag=J),ft}_startRequestTiming(et){var lt;if(!((lt=et.request)===null||lt===void 0)&&lt.collectResourceTiming)return new n.cY(et.request.url)}_finishRequestTiming(et){let lt=et?.finish();return lt?{resourceTiming:JSON.parse(JSON.stringify(lt))}:{}}_getOverzoomTile(et,lt){let{tileID:J,source:ft,overzoomParameters:dt}=et,{maxZoomTileID:Mt}=dt,Ft=`${Mt.key}_${J.key}`,Nt=this.overzoomedTileResultCache.get(Ft);if(Nt)return Nt;let $t=new C,Yt=this.layerIndex.familiesBySource[ft];for(let Pe in Yt){let we=lt.layers[Pe];if(!we)continue;let Ue=z(we,Mt,J.canonical);Ue.length>0&&$t.addLayer(Ue)}let _e=R($t);return this.overzoomedTileResultCache.set(Ft,_e),_e}reloadTile(et){return n._(this,void 0,void 0,(function*(){let lt=et.uid,J=this.tileState.getLoaded(lt);if(!J)throw new Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(J.showCollisionBoxes=et.showCollisionBoxes,J.status===\"parsing\"){let ft=this.tileState.consumeParsing(lt);return yield this._parseWorkerTile(J,et,ft)}if(J.status===\"done\"&&J.vectorTile)return yield this._parseWorkerTile(J,et)}))}abortTile(et){return n._(this,void 0,void 0,(function*(){this.tileState.abort(et.uid)}))}removeTile(et){return n._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(et.uid)}))}}class Y{constructor(){this.loaded={}}loadTile(et){return n._(this,void 0,void 0,(function*(){let{uid:lt,encoding:J,rawImageData:ft,redFactor:dt,greenFactor:Mt,blueFactor:Ft,baseShift:Nt}=et,$t=ft.width+2,Yt=ft.height+2,_e=n.b(ft)?new n.R({width:$t,height:Yt},yield n.cZ(ft,-1,-1,$t,Yt)):ft,Pe=new n.c_(lt,_e,J,dt,Mt,Ft,Nt);return this.loaded=this.loaded||{},this.loaded[lt]=Pe,Pe}))}removeTile(et){let lt=this.loaded,J=et.uid;lt&&lt[J]&&delete lt[J]}}class H{constructor(et,lt,J,ft=Q){this.actor=et,this.layerIndex=lt,this.availableImages=J,this.tileState=new p,this._createGeoJSONIndex=ft}loadVectorTile(et){if(!this._geoJSONIndex)throw new Error(\"Unable to parse the data into a cluster or geojson\");let{z:lt,x:J,y:ft}=et.tileID.canonical,dt=this._geoJSONIndex.getTile(lt,J,ft);return dt?R(new n.c$(dt.features,{version:2,extent:n.a5})):null}loadTile(et){return n._(this,void 0,void 0,(function*(){let{uid:lt}=et,J=new a(et);J.abort=new AbortController;try{let ft=this.loadVectorTile(et);if(!ft)return null;let{vectorTile:dt,rawData:Mt}=ft;J.vectorTile=dt,this.tileState.markLoaded(lt,J);let Ft={rawData:Mt};this.tileState.setParsing(lt,Ft);try{return yield this._parseWorkerTile(J,et,Ft)}finally{this.tileState.clearParsing(lt)}}catch(ft){throw J.status=\"done\",this.tileState.markLoaded(lt,J),ft}}))}_reloadLoadedTile(et){return n._(this,void 0,void 0,(function*(){let lt=et.uid,J=this.tileState.getLoaded(lt);if(!J)throw new Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(J.showCollisionBoxes=et.showCollisionBoxes,J.status===\"parsing\"){let ft=this.tileState.consumeParsing(lt);return yield this._parseWorkerTile(J,et,ft)}if(J.status===\"done\"&&J.vectorTile)return yield this._parseWorkerTile(J,et)}))}_parseWorkerTile(et,lt,J){return n._(this,void 0,void 0,(function*(){let ft=yield et.parse(et.vectorTile,this.layerIndex,this.availableImages,this.actor,lt.subdivisionGranularity);if(J){let{rawData:dt}=J;ft=n.e({rawTileData:dt.slice(0),encoding:\"mvt\"},ft)}return ft}))}abortTile(et){return n._(this,void 0,void 0,(function*(){this.tileState.abort(et.uid)}))}removeTile(et){return n._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(et.uid)}))}loadData(et){return n._(this,void 0,void 0,(function*(){var lt;(lt=this._pendingRequest)===null||lt===void 0||lt.abort();let J=this._startRequestTiming(et);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(et,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let ft={};return et.request&&(ft.data=et.data),this._finishRequestTiming(J,et,ft),ft}catch(ft){if(delete this._pendingRequest,!n.Z(ft))throw ft;return{abandoned:!0}}}))}_startRequestTiming(et){var lt;if(!((lt=et.request)===null||lt===void 0)&&lt.collectResourceTiming)return new n.cY(et.request.url)}_finishRequestTiming(et,lt,J){let ft=et?.finish();ft&&(J.resourceTiming={[lt.source]:JSON.parse(JSON.stringify(ft))})}reloadTile(et){return this.tileState.getLoaded(et.uid)?this._reloadLoadedTile(et):this.loadTile(et)}loadAndProcessGeoJSON(et,lt){return n._(this,void 0,void 0,(function*(){var J;if(et.request&&(et.data=(yield n.j(et.request,lt)).data),et.data)return et.data=this._filterGeoJSON(et.data,et.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(et.data,et));if(et.dataDiff)return(J=this._geoJSONIndex)!==null&&J!==void 0||(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},et)),void this._geoJSONIndex.updateData(et.dataDiff,this._getFilterPredicate(et.filter));if(et.updateCluster&&this._geoJSONIndex.updateClusterOptions(et.geojsonVtOptions.cluster,tt(et)),this._geoJSONIndex==null)throw new Error(`Input data given to '${et.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(et,lt){if(et.type!==\"FeatureCollection\")return et;let J=this._getFilterPredicate(lt);return J?{type:\"FeatureCollection\",features:et.features.filter((ft=>J(ft)))}:et}_getFilterPredicate(et){if(typeof et!=\"boolean\"&&!et?.length)return;let lt=n.d0(et,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(lt.result===\"error\")throw new Error(lt.value.map((J=>`${J.key}: ${J.message}`)).join(\", \"));return J=>lt.value.evaluate({zoom:0},J)}removeSource(et){return n._(this,void 0,void 0,(function*(){var lt;(lt=this._pendingRequest)===null||lt===void 0||lt.abort()}))}getClusterExpansionZoom(et){return this._geoJSONIndex.getClusterExpansionZoom(et.clusterId)}getClusterChildren(et){return this._geoJSONIndex.getClusterChildren(et.clusterId)}getClusterLeaves(et){return this._geoJSONIndex.getClusterLeaves(et.clusterId,et.limit,et.offset)}}function Q(at,et){let lt=n.e(et.geojsonVtOptions||{},{updateable:!0,clusterOptions:tt(et)});return new n.d1(at,lt)}function tt({geojsonVtOptions:at,clusterProperties:et}){if(!et||!at.clusterOptions)return at.clusterOptions;let lt={},J={},ft={accumulated:null,zoom:0},dt={properties:null},Mt=Object.keys(et);for(let Ft of Mt){let[Nt,$t]=et[Ft],Yt=n.d0($t),_e=n.d0(typeof Nt==\"string\"?[Nt,[\"accumulated\"],[\"get\",Ft]]:Nt);lt[Ft]=Yt.value,J[Ft]=_e.value}return at.clusterOptions.map=Ft=>{dt.properties=Ft;let Nt={};for(let $t of Mt)Nt[$t]=lt[$t].evaluate(ft,dt);return Nt},at.clusterOptions.reduce=(Ft,Nt)=>{dt.properties=Nt;for(let $t of Mt)ft.accumulated=Ft[$t],Ft[$t]=J[$t].evaluate(ft,dt)},at.clusterOptions}class rt{constructor(et){this.self=et,this.actor=new n.L(et),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(lt,J)=>{if(this.externalWorkerSourceTypes[lt])throw new Error(`Worker source with name \"${lt}\" already registered.`);this.externalWorkerSourceTypes[lt]=J},this.self.addProtocol=n.cH,this.self.removeProtocol=n.cI,this.self.registerRTLTextPlugin=lt=>{n.d2.setMethods(lt)},this.actor.registerMessageHandler(\"LDT\",((lt,J)=>this._getDEMWorkerSource(lt,J.source).loadTile(J))),this.actor.registerMessageHandler(\"RDT\",((lt,J)=>n._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(lt,J.source).removeTile(J)})))),this.actor.registerMessageHandler(\"GCEZ\",((lt,J)=>n._(this,void 0,void 0,(function*(){return this._getWorkerSource(lt,J.type,J.source).getClusterExpansionZoom(J)})))),this.actor.registerMessageHandler(\"GCC\",((lt,J)=>n._(this,void 0,void 0,(function*(){return this._getWorkerSource(lt,J.type,J.source).getClusterChildren(J)})))),this.actor.registerMessageHandler(\"GCL\",((lt,J)=>n._(this,void 0,void 0,(function*(){return this._getWorkerSource(lt,J.type,J.source).getClusterLeaves(J)})))),this.actor.registerMessageHandler(\"LD\",((lt,J)=>this._getWorkerSource(lt,J.type,J.source).loadData(J))),this.actor.registerMessageHandler(\"LT\",((lt,J)=>this._getWorkerSource(lt,J.type,J.source).loadTile(J))),this.actor.registerMessageHandler(\"RT\",((lt,J)=>this._getWorkerSource(lt,J.type,J.source).reloadTile(J))),this.actor.registerMessageHandler(\"AT\",((lt,J)=>this._getWorkerSource(lt,J.type,J.source).abortTile(J))),this.actor.registerMessageHandler(\"RMT\",((lt,J)=>this._getWorkerSource(lt,J.type,J.source).removeTile(J))),this.actor.registerMessageHandler(\"RS\",((lt,J)=>n._(this,void 0,void 0,(function*(){if(!this.workerSources[lt]||!this.workerSources[lt][J.type]||!this.workerSources[lt][J.type][J.source])return;let ft=this.workerSources[lt][J.type][J.source];delete this.workerSources[lt][J.type][J.source],ft.removeSource!==void 0&&ft.removeSource(J)})))),this.actor.registerMessageHandler(\"RM\",(lt=>n._(this,void 0,void 0,(function*(){delete this.layerIndexes[lt],delete this.availableImages[lt],delete this.workerSources[lt],delete this.demWorkerSources[lt],this.globalStates.delete(lt)})))),this.actor.registerMessageHandler(\"SR\",((lt,J)=>n._(this,void 0,void 0,(function*(){this.referrer=J})))),this.actor.registerMessageHandler(\"SRPS\",((lt,J)=>this._syncRTLPluginState(lt,J))),this.actor.registerMessageHandler(\"IS\",((lt,J)=>n._(this,void 0,void 0,(function*(){this.self.importScripts(J)})))),this.actor.registerMessageHandler(\"SI\",((lt,J)=>this._setImages(lt,J))),this.actor.registerMessageHandler(\"UL\",((lt,J)=>n._(this,void 0,void 0,(function*(){this._getLayerIndex(lt).update(J.layers,J.removedIds,this._getGlobalState(lt))})))),this.actor.registerMessageHandler(\"UGS\",((lt,J)=>n._(this,void 0,void 0,(function*(){let ft=this._getGlobalState(lt);for(let dt in J)ft[dt]=J[dt]})))),this.actor.registerMessageHandler(\"SL\",((lt,J)=>n._(this,void 0,void 0,(function*(){this._getLayerIndex(lt).replace(J,this._getGlobalState(lt))}))))}_getGlobalState(et){let lt=this.globalStates.get(et);return lt||(lt={},this.globalStates.set(et,lt)),lt}_setImages(et,lt){return n._(this,void 0,void 0,(function*(){this.availableImages[et]=lt;for(let J in this.workerSources[et]){let ft=this.workerSources[et][J];for(let dt in ft)ft[dt].availableImages=lt}}))}_syncRTLPluginState(et,lt){return n._(this,void 0,void 0,(function*(){return yield n.d2.syncState(lt,this.self.importScripts)}))}_getAvailableImages(et){let lt=this.availableImages[et];return lt||(lt=[]),lt}_getLayerIndex(et){let lt=this.layerIndexes[et];return lt||(lt=this.layerIndexes[et]=new o),lt}_getWorkerSource(et,lt,J){if(this.workerSources[et]||(this.workerSources[et]={}),this.workerSources[et][lt]||(this.workerSources[et][lt]={}),!this.workerSources[et][lt][J]){let ft={sendAsync:(dt,Mt)=>(dt.targetMapId=et,this.actor.sendAsync(dt,Mt))};switch(lt){case\"vector\":this.workerSources[et][lt][J]=new W(ft,this._getLayerIndex(et),this._getAvailableImages(et));break;case\"geojson\":this.workerSources[et][lt][J]=new H(ft,this._getLayerIndex(et),this._getAvailableImages(et));break;default:this.workerSources[et][lt][J]=new this.externalWorkerSourceTypes[lt](ft,this._getLayerIndex(et),this._getAvailableImages(et))}}return this.workerSources[et][lt][J]}_getDEMWorkerSource(et,lt){return this.demWorkerSources[et]||(this.demWorkerSources[et]={}),this.demWorkerSources[et][lt]||(this.demWorkerSources[et][lt]=new Y),this.demWorkerSources[et][lt]}}return n.i(self)&&(self.worker=new rt(self)),rt})),r(\"index\",[\"exports\",\"./shared\"],(function(n,o){\"use strict\";var s=\"5.21.1\";function a(){var I=new o.A(4);return o.A!=Float32Array&&(I[1]=0,I[2]=0),I[0]=1,I[3]=1,I}let h,p,g,w={frame(I,c,f,b){let S=b||window,D=S.requestAnimationFrame((G=>{N(),c(G)})),{unsubscribe:N}=o.s(I.signal,\"abort\",(()=>{N(),S.cancelAnimationFrame(D),f(new o.a(I.signal.reason))}),!1)},frameAsync(I,c){return new Promise(((f,b)=>{this.frame(I,f,b,c)}))},getImageData(I,c=0){return this.getImageCanvasContext(I).getImageData(-c,-c,I.width+2*c,I.height+2*c)},getImageCanvasContext(I){let c=window.document.createElement(\"canvas\"),f=c.getContext(\"2d\",{willReadFrequently:!0});if(!f)throw new Error(\"failed to create canvas 2d context\");return c.width=I.width,c.height=I.height,f.drawImage(I,0,0,I.width,I.height),f},resolveURL:I=>(h||(h=document.createElement(\"a\")),h.href=I,h.href),hardwareConcurrency:typeof navigator<\"u\"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return g!==void 0?g:!!matchMedia&&(p==null&&(p=matchMedia(\"(prefers-reduced-motion: reduce)\")),p.matches)},set prefersReducedMotion(I){g=I}},C=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:performance.now()}setNow(I){this._frozenAt=I}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function R(){return C.getCurrentTime()}class z{static create(c,f,b){let S=window.document.createElement(c);return f!==void 0&&(S.className=f),b&&b.appendChild(S),S}static createNS(c,f){return window.document.createElementNS(c,f)}static disableDrag(){z.docStyle&&z.selectProp&&(z.userSelect=z.docStyle[z.selectProp],z.docStyle[z.selectProp]=\"none\")}static enableDrag(){z.docStyle&&z.selectProp&&(z.docStyle[z.selectProp]=z.userSelect)}static suppressClickInternal(c){c.preventDefault(),c.stopPropagation(),window.removeEventListener(\"click\",z.suppressClickInternal,!0)}static suppressClick(){window.addEventListener(\"click\",z.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener(\"click\",z.suppressClickInternal,!0)}),0)}static getScale(c){let f=c.getBoundingClientRect();return{x:f.width/c.offsetWidth||1,y:f.height/c.offsetHeight||1,boundingClientRect:f}}static getPoint(c,f,b){let S=f.boundingClientRect;return new o.P((b.clientX-S.left)/f.x-c.clientLeft,(b.clientY-S.top)/f.y-c.clientTop)}static mousePos(c,f){let b=z.getScale(c);return z.getPoint(c,b,f)}static touchPos(c,f){let b=[],S=z.getScale(c);for(let D=0;D<f.length;D++)b.push(z.getPoint(c,S,f[D]));return b}static sanitize(c){let f=new DOMParser().parseFromString(c,\"text/html\").body||document.createElement(\"body\"),b=f.querySelectorAll(\"script\");for(let S of b)S.remove();return z.clean(f),f.innerHTML}static isPossiblyDangerous(c,f){let b=f.replace(/\\s+/g,\"\").toLowerCase();return!(![\"src\",\"href\",\"xlink:href\"].includes(c)||!b.includes(\"javascript:\")&&!b.includes(\"data:\"))||!!c.startsWith(\"on\")||void 0}static clean(c){let f=c.children;for(let b of f)z.removeAttributes(b),z.clean(b)}static removeAttributes(c){for(let{name:f,value:b}of c.attributes)z.isPossiblyDangerous(f,b)&&c.removeAttribute(f)}}var W;z.docStyle=typeof window<\"u\"&&window.document&&window.document.documentElement.style,z.selectProp=!z.docStyle||\"userSelect\"in z.docStyle?\"userSelect\":\"webkitUserSelect\",(function(I){let c,f,b,S;I.resetRequestQueue=()=>{c=[],f=0,b=0,S={}},I.addThrottleControl=q=>{let K=b++;return S[K]=q,K},I.removeThrottleControl=q=>{delete S[q],N()},I.getImage=(q,K,it=!0)=>new Promise(((ct,ut)=>{q.headers||(q.headers={}),q.headers.accept=\"image/webp,*/*\",o.e(q,{type:\"image\"}),c.push({abortController:K,requestParameters:q,supportImageRefresh:it,state:\"queued\",onError:gt=>{ut(gt)},onSuccess:gt=>{ct(gt)}}),N()}));let D=q=>o._(this,void 0,void 0,(function*(){q.state=\"running\";let{requestParameters:K,supportImageRefresh:it,onError:ct,onSuccess:ut,abortController:gt}=q,yt=it===!1&&!o.i(self)&&!o.g(K.url)&&(!K.headers||Object.keys(K.headers).reduce(((Rt,Ut)=>Rt&&Ut===\"accept\"),!0));f++;let Pt=yt?G(K,gt):o.m(K,gt);try{let Rt=yield Pt;delete q.abortController,q.state=\"completed\",Rt.data instanceof HTMLImageElement||o.b(Rt.data)?ut(Rt):Rt.data&&ut({data:yield(Ct=Rt.data,typeof createImageBitmap==\"function\"?o.f(Ct):o.h(Ct)),cacheControl:Rt.cacheControl,expires:Rt.expires})}catch(Rt){delete q.abortController,ct(Rt)}finally{f--,N()}var Ct})),N=()=>{let q=(()=>{for(let K of Object.keys(S))if(S[K]())return!0;return!1})()?o.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:o.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let K=f;K<q&&c.length>0;K++){let it=c.shift();it.abortController.signal.aborted?K--:D(it)}},G=(q,K)=>new Promise(((it,ct)=>{let ut=new Image,gt=q.url,yt=q.credentials;yt&&yt===\"include\"?ut.crossOrigin=\"use-credentials\":(yt&&yt===\"same-origin\"||!o.d(gt))&&(ut.crossOrigin=\"anonymous\"),K.signal.addEventListener(\"abort\",(()=>{ut.src=\"\",ct(new o.a(K.signal.reason))})),ut.fetchPriority=\"high\",ut.onload=()=>{ut.onerror=ut.onload=null,it({data:ut})},ut.onerror=()=>{ut.onerror=ut.onload=null,K.signal.aborted||ct(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.\"))},ut.src=gt}))})(W||(W={})),W.resetRequestQueue();class Y{constructor(c){this._transformRequestFn=c??null}transformRequest(c,f){return this._transformRequestFn&&this._transformRequestFn(c,f)||{url:c}}setTransformRequest(c){this._transformRequestFn=c}}function H(I){let c=[];if(typeof I==\"string\")c.push({id:\"default\",url:I});else if(I&&I.length>0){let f=[];for(let{id:b,url:S}of I){let D=`${b}${S}`;f.indexOf(D)===-1&&(f.push(D),c.push({id:b,url:S}))}}return c}function Q(I,c,f){try{let b=new URL(I);return b.pathname+=`${c}${f}`,b.toString()}catch{throw new Error(`Invalid sprite URL \"${I}\", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function tt(I){let{userImage:c}=I;return!!(c&&c.render&&c.render())&&(I.data.replace(new Uint8Array(c.data.buffer)),!0)}class rt extends o.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(let c of Object.keys(this.images))this.removeImage(c);this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(c){if(this.loaded!==c&&(this.loaded=c,c)){for(let{ids:f,promiseResolve:b}of this.requestors)b(this._getImagesForIds(f));this.requestors=[]}}getImage(c){let f=this.images[c];if(f&&!f.data&&f.spriteData){let b=f.spriteData;f.data=new o.R({width:b.width,height:b.height},b.context.getImageData(b.x,b.y,b.width,b.height).data),f.spriteData=null}return f}addImage(c,f){if(this.images[c])throw new Error(`Image id ${c} already exist, use updateImage instead`);this._validate(c,f)&&(this.images[c]=f)}_validate(c,f){let b=!0,S=f.data||f.spriteData;return this._validateStretch(f.stretchX,S&&S.width)||(this.fire(new o.k(new Error(`Image \"${c}\" has invalid \"stretchX\" value`))),b=!1),this._validateStretch(f.stretchY,S&&S.height)||(this.fire(new o.k(new Error(`Image \"${c}\" has invalid \"stretchY\" value`))),b=!1),this._validateContent(f.content,f)||(this.fire(new o.k(new Error(`Image \"${c}\" has invalid \"content\" value`))),b=!1),b}_validateStretch(c,f){if(!c)return!0;let b=0;for(let S of c){if(S[0]<b||S[1]<S[0]||f<S[1])return!1;b=S[1]}return!0}_validateContent(c,f){if(!c)return!0;if(c.length!==4)return!1;let b=f.spriteData,S=b&&b.width||f.data.width,D=b&&b.height||f.data.height;return!(c[0]<0||S<c[0]||c[1]<0||D<c[1]||c[2]<0||S<c[2]||c[3]<0||D<c[3]||c[2]<c[0]||c[3]<c[1])}updateImage(c,f,b=!0){let S=this.getImage(c);if(b&&(S.data.width!==f.data.width||S.data.height!==f.data.height))throw new Error(`size mismatch between old image (${S.data.width}x${S.data.height}) and new image (${f.data.width}x${f.data.height}).`);f.version=S.version+1,this.images[c]=f,this.updatedImages[c]=!0}removeImage(c){let f=this.images[c];delete this.images[c],delete this.patterns[c],f.userImage&&f.userImage.onRemove&&f.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(c){return new Promise(((f,b)=>{let S=!0;if(!this.isLoaded())for(let D of c)this.images[D]||(S=!1);this.isLoaded()||S?f(this._getImagesForIds(c)):this.requestors.push({ids:c,promiseResolve:f})}))}_getImagesForIds(c){let f={};for(let b of c){let S=this.getImage(b);S||(this.fire(new o.l(\"styleimagemissing\",{id:b})),S=this.getImage(b)),S?f[b]={data:S.data.clone(),pixelRatio:S.pixelRatio,sdf:S.sdf,version:S.version,stretchX:S.stretchX,stretchY:S.stretchY,content:S.content,textFitWidth:S.textFitWidth,textFitHeight:S.textFitHeight,hasRenderCallback:!!(S.userImage&&S.userImage.render)}:o.w(`Image \"${b}\" 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 f}getPixelSize(){let{width:c,height:f}=this.atlasImage;return{width:c,height:f}}getPattern(c){let f=this.patterns[c],b=this.getImage(c);if(!b)return null;if(f&&f.position.version===b.version)return f.position;if(f)f.position.version=b.version;else{let S={w:b.data.width+2,h:b.data.height+2,x:0,y:0},D=new o.I(S,b);this.patterns[c]={bin:S,position:D}}return this._updatePatternAtlas(),this.patterns[c].position}bind(c){let f=c.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new o.T(c,this.atlasImage,f.RGBA),this.atlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE)}_updatePatternAtlas(){let c=[];for(let D in this.patterns)c.push(this.patterns[D].bin);let{w:f,h:b}=o.p(c),S=this.atlasImage;S.resize({width:f||1,height:b||1});for(let D in this.patterns){let{bin:N}=this.patterns[D],G=N.x+1,q=N.y+1,K=this.getImage(D).data,it=K.width,ct=K.height;o.R.copy(K,S,{x:0,y:0},{x:G,y:q},{width:it,height:ct}),o.R.copy(K,S,{x:0,y:ct-1},{x:G,y:q-1},{width:it,height:1}),o.R.copy(K,S,{x:0,y:0},{x:G,y:q+ct},{width:it,height:1}),o.R.copy(K,S,{x:it-1,y:0},{x:G-1,y:q},{width:1,height:ct}),o.R.copy(K,S,{x:0,y:0},{x:G+it,y:q},{width:1,height:ct})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(c){for(let f of c){if(this.callbackDispatchedThisFrame[f])continue;this.callbackDispatchedThisFrame[f]=!0;let b=this.getImage(f);b||o.w(`Image with ID: \"${f}\" was not found`),tt(b)&&this.updateImage(f,b)}}cloneImages(){let c={};for(let f in this.images){let b=this.images[f];c[f]=Object.assign(Object.assign({},b),{data:b.data?b.data.clone():null})}return c}}let at=1e20;function et(I,c,f,b,S,D,N,G,q){for(let K=c;K<c+b;K++)lt(I,f*D+K,D,S,N,G,q);for(let K=f;K<f+S;K++)lt(I,K*D+c,1,b,N,G,q)}function lt(I,c,f,b,S,D,N){D[0]=0,N[0]=-at,N[1]=at,S[0]=I[c];for(let G=1,q=0,K=0;G<b;G++){S[G]=I[c+G*f];let it=G*G;do{let ct=D[q];K=(S[G]-S[ct]+it-ct*ct)/(G-ct)/2}while(K<=N[q]&&--q>-1);q++,D[q]=G,N[q]=K,N[q+1]=at}for(let G=0,q=0;G<b;G++){for(;N[q+1]<G;)q++;let K=D[q],it=G-K;I[c+G*f]=S[K]+it*it}}let J=o.v.layout_symbol[\"text-font\"].default.join(\",\");class ft{constructor(c,f,b){this.requestManager=c,this.localIdeographFontFamily=f,this.entries={},this.lang=b}setURL(c){this.url=c}getGlyphs(c){return o._(this,void 0,void 0,(function*(){let f=[];for(let D in c)for(let N of c[D])f.push(this._getAndCacheGlyphsPromise(D,N));let b=yield Promise.all(f),S={};for(let{stack:D,id:N,glyph:G}of b)S[D]||(S[D]={}),S[D][N]=G&&{id:G.id,bitmap:G.bitmap.clone(),metrics:G.metrics};return S}))}_getAndCacheGlyphsPromise(c,f){return o._(this,void 0,void 0,(function*(){let b=this.entries[c];b||(b=this.entries[c]={glyphs:{},requests:{},ranges:{}});let S=b.glyphs[f];return S!==void 0?{stack:c,id:f,glyph:S}:!this.url||this._charUsesLocalIdeographFontFamily(f)?(S=b.glyphs[f]=this._drawGlyph(b,c,f),{stack:c,id:f,glyph:S}):yield this._downloadAndCacheRangePromise(c,f)}))}_downloadAndCacheRangePromise(c,f){return o._(this,void 0,void 0,(function*(){let b=this.entries[c],S=Math.floor(f/256);if(b.ranges[S])return{stack:c,id:f,glyph:null};if(!b.requests[S]){let D=ft.loadGlyphRange(c,S,this.url,this.requestManager);b.requests[S]=D}try{let D=yield b.requests[S];for(let N in D)b.glyphs[+N]=D[+N];return b.ranges[S]=!0,{stack:c,id:f,glyph:D[f]||null}}catch(D){let N=b.glyphs[f]=this._drawGlyph(b,c,f);return this._warnOnMissingGlyphRange(N,S,f,D),{stack:c,id:f,glyph:N}}}))}_warnOnMissingGlyphRange(c,f,b,S){let D=256*f,N=D+255,G=b.toString(16).padStart(4,\"0\").toUpperCase();o.w(`Unable to load glyph range ${f}, ${D}-${N}. Rendering codepoint U+${G} locally instead. ${S}`)}_charUsesLocalIdeographFontFamily(c){return!!this.localIdeographFontFamily&&o.q(c)}_drawGlyph(c,f,b){let S=f===J&&this.localIdeographFontFamily!==\"\"&&this._charUsesLocalIdeographFontFamily(b),D=S?\"ideographTinySDF\":\"tinySDF\";c[D]||(c[D]=this._createTinySDF(S?this.localIdeographFontFamily:f));let N=c[D].draw(String.fromCodePoint(b)),G=/^\\p{gc=Cf}+$/u.test(String.fromCodePoint(b));return{id:b,bitmap:new o.r({width:N.width||60,height:N.height||60},N.data),metrics:{width:G?0:N.glyphWidth/2||24,height:N.glyphHeight/2||24,left:N.glyphLeft/2+.5||0,top:N.glyphTop/2-27.5||-8,advance:G?0:N.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(c){let f=c?c.split(\",\"):[];f.push(\"sans-serif\");let b=f.map((S=>/[-\\w]+/.test(S)?S:`'${CSS.escape(S)}'`)).join(\",\");return new ft.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:b,fontWeight:this._fontWeight(f[0]),fontStyle:this._fontStyle(f[0]),lang:this.lang})}_fontStyle(c){return/italic/i.test(c)?\"italic\":/oblique/i.test(c)?\"oblique\":\"normal\"}_fontWeight(c){let f={thin:100,hairline:100,\"extra light\":200,\"ultra light\":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,\"extra bold\":800,\"ultra bold\":800,black:900,heavy:900,\"extra black\":950,\"ultra black\":950},b;for(let[S,D]of Object.entries(f))new RegExp(`\\\\b${S}\\\\b`,\"i\").test(c)&&(b=`${D}`);return b}destroy(){for(let c in this.entries){let f=this.entries[c];f.tinySDF&&(f.tinySDF=null),f.ideographTinySDF&&(f.ideographTinySDF=null),f.glyphs={},f.requests={},f.ranges={}}this.entries={}}}ft.loadGlyphRange=function(I,c,f,b){return o._(this,void 0,void 0,(function*(){let S=256*c,D=S+255,N=yield b.transformRequest(f.replace(\"{fontstack}\",I).replace(\"{range}\",`${S}-${D}`),\"Glyphs\"),G=yield o.n(N,new AbortController);if(!G||!G.data)throw new Error(`Could not load glyph range. range: ${c}, ${S}-${D}`);let q={};for(let K of o.o(G.data))q[K.id]=K;return q}))},ft.TinySDF=class{constructor({fontSize:I=24,buffer:c=3,radius:f=8,cutoff:b=.25,fontFamily:S=\"sans-serif\",fontWeight:D=\"normal\",fontStyle:N=\"normal\",lang:G=null}={}){this.buffer=c,this.cutoff=b,this.radius=f,this.lang=G;let q=this.size=I+4*c,K=this._createCanvas(q),it=this.ctx=K.getContext(\"2d\",{willReadFrequently:!0});it.font=`${N} ${D} ${I}px ${S}`,it.textBaseline=\"alphabetic\",it.textAlign=\"left\",it.fillStyle=\"black\",this.gridOuter=new Float64Array(q*q),this.gridInner=new Float64Array(q*q),this.f=new Float64Array(q),this.z=new Float64Array(q+1),this.v=new Uint16Array(q)}_createCanvas(I){let c=document.createElement(\"canvas\");return c.width=c.height=I,c}draw(I){let{width:c,actualBoundingBoxAscent:f,actualBoundingBoxDescent:b,actualBoundingBoxLeft:S,actualBoundingBoxRight:D}=this.ctx.measureText(I),N=Math.ceil(f),G=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(D-S))),q=Math.min(this.size-this.buffer,N+Math.ceil(b)),K=G+2*this.buffer,it=q+2*this.buffer,ct=Math.max(K*it,0),ut=new Uint8ClampedArray(ct),gt={data:ut,width:K,height:it,glyphWidth:G,glyphHeight:q,glyphTop:N,glyphLeft:0,glyphAdvance:c};if(G===0||q===0)return gt;let{ctx:yt,buffer:Pt,gridInner:Ct,gridOuter:Rt}=this;this.lang&&(yt.lang=this.lang),yt.clearRect(Pt,Pt,G,q),yt.fillText(I,Pt,Pt+N);let Ut=yt.getImageData(Pt,Pt,G,q);Rt.fill(at,0,ct),Ct.fill(0,0,ct);for(let Gt=0;Gt<q;Gt++)for(let zt=0;zt<G;zt++){let jt=Ut.data[4*(Gt*G+zt)+3]/255;if(jt===0)continue;let Wt=(Gt+Pt)*K+zt+Pt;if(jt===1)Rt[Wt]=0,Ct[Wt]=at;else{let It=.5-jt;Rt[Wt]=It>0?It*It:0,Ct[Wt]=It<0?It*It:0}}et(Rt,0,0,K,it,K,this.f,this.v,this.z),et(Ct,Pt,Pt,G,q,K,this.f,this.v,this.z);for(let Gt=0;Gt<ct;Gt++){let zt=Math.sqrt(Rt[Gt])-Math.sqrt(Ct[Gt]);ut[Gt]=Math.round(255-255*(zt/this.radius+this.cutoff))}return gt}};class dt{constructor(){this.specification=o.u.light.position}possiblyEvaluate(c,f){return o.F(c.expression.evaluate(f))}interpolate(c,f,b){return{x:o.G.number(c.x,f.x,b),y:o.G.number(c.y,f.y,b),z:o.G.number(c.z,f.z,b)}}}let Mt;class Ft extends o.E{constructor(c){super(),Mt=Mt||new o.t({anchor:new o.D(o.u.light.anchor),position:new dt,color:new o.D(o.u.light.color),intensity:new o.D(o.u.light.intensity)}),this._transitionable=new o.x(Mt,void 0),this.setLight(c),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(c,f={}){if(!this._validate(o.y,c,f))for(let b in c){let S=c[b];b.endsWith(o.z)?this._transitionable.setTransition(b.slice(0,-o.z.length),S):this._transitionable.setValue(b,S)}}updateTransitions(c){this._transitioning=this._transitionable.transitioned(c,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(c){this.properties=this._transitioning.possiblyEvaluate(c)}_validate(c,f,b){return(!b||b.validate!==!1)&&o.B(this,c.call(o.C,{value:f,style:{glyphs:!0,sprite:!0},styleSpec:o.u}))}}let Nt=new o.t({\"sky-color\":new o.D(o.u.sky[\"sky-color\"]),\"horizon-color\":new o.D(o.u.sky[\"horizon-color\"]),\"fog-color\":new o.D(o.u.sky[\"fog-color\"]),\"fog-ground-blend\":new o.D(o.u.sky[\"fog-ground-blend\"]),\"horizon-fog-blend\":new o.D(o.u.sky[\"horizon-fog-blend\"]),\"sky-horizon-blend\":new o.D(o.u.sky[\"sky-horizon-blend\"]),\"atmosphere-blend\":new o.D(o.u.sky[\"atmosphere-blend\"])});class $t extends o.E{constructor(c){super(),this._transitionable=new o.x(Nt,void 0),this.setSky(c),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new o.H(0))}setSky(c,f={}){if(!this._validate(o.J,c,f)){c||(c={\"sky-color\":\"transparent\",\"horizon-color\":\"transparent\",\"fog-color\":\"transparent\",\"fog-ground-blend\":1,\"atmosphere-blend\":0});for(let b in c){let S=c[b];b.endsWith(o.z)?this._transitionable.setTransition(b.slice(0,-o.z.length),S):this._transitionable.setValue(b,S)}}}getSky(){return this._transitionable.serialize()}updateTransitions(c){this._transitioning=this._transitionable.transitioned(c,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(c){this.properties=this._transitioning.possiblyEvaluate(c)}_validate(c,f,b={}){return b?.validate!==!1&&o.B(this,c.call(o.C,o.e({value:f,style:{glyphs:!0,sprite:!0},styleSpec:o.u})))}calculateFogBlendOpacity(c){return c<60?0:c<70?(c-60)/10:1}}class Yt{constructor(c,f){this.width=c,this.height=f,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(c,f){let b=c.join(\",\")+String(f);return this.dashEntry[b]||(this.dashEntry[b]=this.addDash(c,f)),this.dashEntry[b]}getDashRanges(c,f,b){let S=[],D=c.length%2==1?-c[c.length-1]*b:0,N=c[0]*b,G=!0;S.push({left:D,right:N,isDash:G,zeroLength:c[0]===0});let q=c[0];for(let K=1;K<c.length;K++){G=!G;let it=c[K];D=q*b,q+=it,N=q*b,S.push({left:D,right:N,isDash:G,zeroLength:it===0})}return S}addRoundDash(c,f,b){let S=f/2;for(let D=-b;D<=b;D++){let N=this.width*(this.nextRow+b+D),G=0,q=c[G];for(let K=0;K<this.width;K++){K/q.right>1&&(q=c[++G]);let it=Math.abs(K-q.left),ct=Math.abs(K-q.right),ut=Math.min(it,ct),gt,yt=D/b*(S+1);if(q.isDash){let Pt=S-Math.abs(yt);gt=Math.sqrt(ut*ut+Pt*Pt)}else gt=S-Math.sqrt(ut*ut+yt*yt);this.data[N+K]=Math.max(0,Math.min(255,gt+128))}}}addRegularDash(c){for(let G=c.length-1;G>=0;--G){let q=c[G],K=c[G+1];q.zeroLength?c.splice(G,1):K&&K.isDash===q.isDash&&(K.left=q.left,c.splice(G,1))}let f=c[0],b=c[c.length-1];f.isDash===b.isDash&&(f.left=b.left-this.width,b.right=f.right+this.width);let S=this.width*this.nextRow,D=0,N=c[D];for(let G=0;G<this.width;G++){G/N.right>1&&(N=c[++D]);let q=Math.abs(G-N.left),K=Math.abs(G-N.right),it=Math.min(q,K);this.data[S+G]=Math.max(0,Math.min(255,(N.isDash?it:-it)+128))}}addDash(c,f){let b=f?7:0,S=2*b+1;if(this.nextRow+S>this.height)return o.w(\"LineAtlas out of space\"),null;let D=0;for(let G=0;G<c.length;G++)D+=c[G];if(D!==0){let G=this.width/D,q=this.getDashRanges(c,this.width,G);f?this.addRoundDash(q,G,b):this.addRegularDash(q)}let N={y:this.nextRow+b,height:2*b,width:D};return this.nextRow+=S,this.dirty=!0,N}bind(c){let f=c.gl;this.texture?(f.bindTexture(f.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,f.texSubImage2D(f.TEXTURE_2D,0,0,0,this.width,this.height,f.ALPHA,f.UNSIGNED_BYTE,this.data))):(this.texture=f.createTexture(),f.bindTexture(f.TEXTURE_2D,this.texture),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.REPEAT),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.REPEAT),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texImage2D(f.TEXTURE_2D,0,f.ALPHA,this.width,this.height,0,f.ALPHA,f.UNSIGNED_BYTE,this.data))}}let _e=\"maplibre_preloaded_worker_pool\";class Pe{constructor(){this.active={}}acquire(c){if(!this.workers)for(this.workers=[];this.workers.length<Pe.workerCount;)this.workers.push(new Worker(o.c.WORKER_URL));return this.active[c]=!0,this.workers.slice()}release(c){delete this.active[c],this.numActive()===0&&(this.workers.forEach((f=>{f.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[_e]}numActive(){return Object.keys(this.active).length}}let we=Math.floor(w.hardwareConcurrency/2),Ue,lr;function ee(){return Ue||(Ue=new Pe),Ue}Pe.workerCount=o.K(globalThis)?Math.max(Math.min(we,3),1):1;class Ce{constructor(c,f){this.workerPool=c,this.actors=[],this.currentActor=0,this.id=f;let b=this.workerPool.acquire(f);for(let S=0;S<b.length;S++){let D=new o.L(b[S],f);D.name=`Worker ${S}`,this.actors.push(D)}if(!this.actors.length)throw new Error(\"No actors found\")}broadcast(c,f){let b=[];for(let S of this.actors)b.push(S.sendAsync({type:c,data:f}));return Promise.all(b)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(c=!0){this.actors.forEach((f=>{f.remove()})),this.actors=[],c&&this.workerPool.release(this.id)}registerMessageHandler(c,f){for(let b of this.actors)b.registerMessageHandler(c,f)}unregisterMessageHandler(c){for(let f of this.actors)f.unregisterMessageHandler(c)}}function mr(){return lr||(lr=new Ce(ee(),o.M),lr.registerMessageHandler(\"GR\",((I,c,f)=>o.m(c,f)))),lr}function gr(I,c){let f=o.N();return o.O(f,f,[1,1,0]),o.Q(f,f,[.5*I.width,.5*I.height,1]),I.calculatePosMatrix?o.S(f,f,I.calculatePosMatrix(c.toUnwrapped())):f}function Br(I,c,f,b,S,D,N){var G;let q=(function(ut,gt,yt){if(ut)for(let Pt of ut){let Ct=gt[Pt];if(Ct&&Ct.source===yt&&Ct.type===\"fill-extrusion\")return!0}else for(let Pt in gt){let Ct=gt[Pt];if(Ct.source===yt&&Ct.type===\"fill-extrusion\")return!0}return!1})((G=S?.layers)!==null&&G!==void 0?G:null,c,I.id),K=D.maxPitchScaleFactor(),it=I.tilesIn(b,K,q);it.sort(Cr);let ct=[];for(let ut of it)ct.push({wrappedTileID:ut.tileID.wrapped().key,queryResults:ut.tile.queryRenderedFeatures(c,f,I.getState(),ut.queryGeometry,ut.cameraQueryGeometry,ut.scale,S,D,K,gr(D,ut.tileID),N?(gt,yt)=>N(ut.tileID,gt,yt):void 0)});return(function(ut,gt){for(let yt in ut)for(let Pt of ut[yt])Rr(Pt,gt);return ut})((function(ut){let gt={},yt={};for(let Pt of ut){let Ct=Pt.queryResults,Rt=Pt.wrappedTileID,Ut=yt[Rt]=yt[Rt]||{};for(let Gt in Ct){let zt=Ct[Gt],jt=Ut[Gt]=Ut[Gt]||{},Wt=gt[Gt]=gt[Gt]||[];for(let It of zt)jt[It.featureIndex]||(jt[It.featureIndex]=!0,Wt.push(It))}}return gt})(ct),I)}function Cr(I,c){let f=I.tileID,b=c.tileID;return f.overscaledZ-b.overscaledZ||f.canonical.y-b.canonical.y||f.wrap-b.wrap||f.canonical.x-b.canonical.x}function Rr(I,c){let f=I.feature,b=c.getFeatureState(f.layer[\"source-layer\"],f.id);f.source=f.layer.source,f.layer[\"source-layer\"]&&(f.sourceLayer=f.layer[\"source-layer\"]),f.state=b}function ti(I,c,f,b){return o._(this,void 0,void 0,(function*(){let S=I;if(I.url?S=(yield o.j(yield c.transformRequest(I.url,\"Source\"),f)).data:yield w.frameAsync(f,b),!S)return null;let D=o.U(o.e(S,I),[\"tiles\",\"minzoom\",\"maxzoom\",\"attribution\",\"bounds\",\"scheme\",\"tileSize\",\"encoding\"]);return\"vector_layers\"in S&&S.vector_layers&&(D.vectorLayerIds=S.vector_layers.map((N=>N.id))),D}))}class wr{constructor(c,f){c&&(f?this.setSouthWest(c).setNorthEast(f):Array.isArray(c)&&(c.length===4?this.setSouthWest([c[0],c[1]]).setNorthEast([c[2],c[3]]):this.setSouthWest(c[0]).setNorthEast(c[1])))}setNorthEast(c){return this._ne=c instanceof o.V?new o.V(c.lng,c.lat):o.V.convert(c),this}setSouthWest(c){return this._sw=c instanceof o.V?new o.V(c.lng,c.lat):o.V.convert(c),this}extend(c){let f=this._sw,b=this._ne,S,D;if(c instanceof o.V)S=c,D=c;else{if(!(c instanceof wr))return Array.isArray(c)?c.length===4||c.every(Array.isArray)?this.extend(wr.convert(c)):this.extend(o.V.convert(c)):c&&(\"lng\"in c||\"lon\"in c)&&\"lat\"in c?this.extend(o.V.convert(c)):this;if(S=c._sw,D=c._ne,!S||!D)return this}return f||b?(f.lng=Math.min(S.lng,f.lng),f.lat=Math.min(S.lat,f.lat),b.lng=Math.max(D.lng,b.lng),b.lat=Math.max(D.lat,b.lat)):(this._sw=new o.V(S.lng,S.lat),this._ne=new o.V(D.lng,D.lat)),this}getCenter(){return new o.V((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 o.V(this.getWest(),this.getNorth())}getSouthEast(){return new o.V(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(c){let{lng:f,lat:b}=o.V.convert(c),S=this._sw.lng<=f&&f<=this._ne.lng;return this._sw.lng>this._ne.lng&&(S=this._sw.lng>=f&&f>=this._ne.lng),this._sw.lat<=b&&b<=this._ne.lat&&S}intersects(c){if(!((c=wr.convert(c)).getNorth()>=this.getSouth()&&c.getSouth()<=this.getNorth()))return!1;let f=Math.abs(this.getEast()-this.getWest()),b=Math.abs(c.getEast()-c.getWest());if(f>=360||b>=360)return!0;let S=o.W(this.getWest(),-180,180),D=o.W(this.getEast(),-180,180),N=o.W(c.getWest(),-180,180),G=o.W(c.getEast(),-180,180),q=S>D,K=N>G;return!(!q||!K)||(q?G>=S||N<=D:K?D>=N||S<=G:N<=D&&G>=S)}static convert(c){return c instanceof wr?c:c&&new wr(c)}static fromLngLat(c,f=0){let b=360*f/40075017,S=b/Math.cos(Math.PI/180*c.lat);return new wr(new o.V(c.lng-S,c.lat-b),new o.V(c.lng+S,c.lat+b))}adjustAntiMeridian(){let c=new o.V(this._sw.lng,this._sw.lat),f=new o.V(this._ne.lng,this._ne.lat);return new wr(c,c.lng>f.lng?new o.V(f.lng+360,f.lat):f)}}class He{constructor(c,f,b){this.bounds=wr.convert(this.validateBounds(c)),this.minzoom=f||0,this.maxzoom=b||24}validateBounds(c){return Array.isArray(c)&&c.length===4?[Math.max(-180,c[0]),Math.max(-90,c[1]),Math.min(180,c[2]),Math.min(90,c[3])]:[-180,-90,180,90]}contains(c){let f=Math.pow(2,c.z),b=Math.floor(o.Y(this.bounds.getWest())*f),S=Math.floor(o.X(this.bounds.getNorth())*f),D=Math.ceil(o.Y(this.bounds.getEast())*f),N=Math.ceil(o.X(this.bounds.getSouth())*f);return c.x>=b&&c.x<D&&c.y>=S&&c.y<N}}class Ui extends o.E{constructor(c,f,b,S){if(super(),this.id=c,this.dispatcher=b,this.type=\"vector\",this.minzoom=0,this.maxzoom=22,this.scheme=\"xyz\",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.e(this,o.U(f,[\"url\",\"scheme\",\"tileSize\",\"promoteId\",\"encoding\"])),this._options=o.e({type:\"vector\"},f),this._collectResourceTiming=f.collectResourceTiming,this.tileSize!==512)throw new Error(\"vector tile sources must have a tileSize of 512\");this.setEventedParent(S)}load(){return o._(this,arguments,void 0,(function*(c=!1){this._loaded=!1,this.fire(new o.l(\"dataloading\",{dataType:\"source\"})),this._tileJSONRequest=new AbortController;try{let f=yield ti(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,f&&(o.e(this,f),f.bounds&&(this.tileBounds=new He(f.bounds,this.minzoom,this.maxzoom)),this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})),this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"content\",sourceDataChanged:c})))}catch(f){this._tileJSONRequest=null,this._loaded=!0,o.Z(f)||this.fire(new o.k(f))}}))}loaded(){return this._loaded}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}onAdd(c){this.map=c,this.load()}setSourceProperty(c){this._tileJSONRequest&&this._tileJSONRequest.abort(),c(),this.load(!0)}setTiles(c){return this.setSourceProperty((()=>{this._options.tiles=c})),this}setUrl(c){return this.setSourceProperty((()=>{this.url=c,this._options.url=c})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return o.e({},this._options)}loadTile(c){return o._(this,void 0,void 0,(function*(){let f=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),b={request:yield this.map._requestManager.transformRequest(f,\"Tile\"),uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,tileSize:this.tileSize*c.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(c),etag:c.etag};b.request.collectResourceTiming=this._collectResourceTiming;let S=\"RT\";if(c.actor&&c.state!==\"expired\"){if(c.state===\"loading\")return new Promise(((D,N)=>{c.reloadPromise={resolve:D,reject:N}}))}else c.actor=this.dispatcher.getActor(),S=\"LT\";c.abortController=new AbortController;try{let D=yield c.actor.sendAsync({type:S,data:b},c.abortController);if(delete c.abortController,c.aborted)return;this._afterTileLoadWorkerResponse(c,D);let N={};return D?.etagUnmodified&&(N.unmodified=!0),N}catch(D){if(delete c.abortController,c.aborted)return;if(D&&D.status!==404)throw D;this._afterTileLoadWorkerResponse(c,null)}}))}_getOverzoomParameters(c){return o._(this,void 0,void 0,(function*(){if(c.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let f=c.tileID.scaledTo(this.maxzoom).canonical,b=f.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:f,overzoomRequest:yield this.map._requestManager.transformRequest(b,\"Tile\")}}))}_afterTileLoadWorkerResponse(c,f){if(f?.resourceTiming&&(c.resourceTiming=f.resourceTiming),f&&this.map._refreshExpiredTiles&&c.setExpiryData(f),c.etag=f?.etag,c.loadVectorData(f,this.map.painter),c.reloadPromise){let b=c.reloadPromise;c.reloadPromise=null,this.loadTile(c).then(b.resolve).catch(b.reject)}}abortTile(c){return o._(this,void 0,void 0,(function*(){c.abortController&&(c.abortController.abort(),delete c.abortController),c.actor&&(yield c.actor.sendAsync({type:\"AT\",data:{uid:c.uid,type:this.type,source:this.id}}))}))}unloadTile(c){return o._(this,void 0,void 0,(function*(){c.unloadVectorData(),c.actor&&(yield c.actor.sendAsync({type:\"RMT\",data:{uid:c.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class ln extends o.E{constructor(c,f,b,S){super(),this.id=c,this.dispatcher=b,this.setEventedParent(S),this.type=\"raster\",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=\"xyz\",this.tileSize=512,this._loaded=!1,this._options=o.e({type:\"raster\"},f),o.e(this,o.U(f,[\"url\",\"scheme\",\"tileSize\"]))}load(){return o._(this,arguments,void 0,(function*(c=!1){this._loaded=!1,this.fire(new o.l(\"dataloading\",{dataType:\"source\"})),this._tileJSONRequest=new AbortController;try{let f=yield ti(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,f&&(o.e(this,f),f.bounds&&(this.tileBounds=new He(f.bounds,this.minzoom,this.maxzoom)),this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})),this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"content\",sourceDataChanged:c})))}catch(f){this._tileJSONRequest=null,this._loaded=!0,o.Z(f)||this.fire(new o.k(f))}}))}loaded(){return this._loaded}onAdd(c){this.map=c,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(c){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),c(),this.load(!0)}setTiles(c){return this.setSourceProperty((()=>{this._options.tiles=c})),this}setUrl(c){return this.setSourceProperty((()=>{this.url=c,this._options.url=c})),this}serialize(){return o.e({},this._options)}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}loadTile(c){return o._(this,void 0,void 0,(function*(){let f=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);c.abortController=new AbortController;try{let b=yield W.getImage(yield this.map._requestManager.transformRequest(f,\"Tile\"),c.abortController,this.map._refreshExpiredTiles);if(delete c.abortController,c.aborted)return void(c.state=\"unloaded\");if(b&&b.data){this.map._refreshExpiredTiles&&(b.cacheControl||b.expires)&&c.setExpiryData({cacheControl:b.cacheControl,expires:b.expires});let S=this.map.painter.context,D=S.gl,N=b.data;c.texture=this.map.painter.getTileTexture(N.width),c.texture?c.texture.update(N,{useMipmap:!0}):(c.texture=new o.T(S,N,D.RGBA,{useMipmap:!0}),c.texture.bind(D.LINEAR,D.CLAMP_TO_EDGE,D.LINEAR_MIPMAP_NEAREST)),c.state=\"loaded\"}}catch(b){if(delete c.abortController,c.aborted)c.state=\"unloaded\";else if(b)throw c.state=\"errored\",b}}))}abortTile(c){return o._(this,void 0,void 0,(function*(){c.abortController&&(c.abortController.abort(),delete c.abortController)}))}unloadTile(c){return o._(this,void 0,void 0,(function*(){c.texture&&this.map.painter.saveTileTexture(c.texture)}))}hasTransition(){return!1}}class Io extends ln{constructor(c,f,b,S){super(c,f,b,S),this.type=\"raster-dem\",this.maxzoom=22,this._options=o.e({type:\"raster-dem\"},f),this.encoding=f.encoding||\"mapbox\",this.redFactor=f.redFactor,this.greenFactor=f.greenFactor,this.blueFactor=f.blueFactor,this.baseShift=f.baseShift}loadTile(c){return o._(this,void 0,void 0,(function*(){let f=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),b=yield this.map._requestManager.transformRequest(f,\"Tile\");c.neighboringTiles=this._getNeighboringTiles(c.tileID),c.abortController=new AbortController;try{let S=yield W.getImage(b,c.abortController,this.map._refreshExpiredTiles);if(delete c.abortController,c.aborted)return void(c.state=\"unloaded\");if(S&&S.data){let D=S.data;this.map._refreshExpiredTiles&&(S.cacheControl||S.expires)&&c.setExpiryData({cacheControl:S.cacheControl,expires:S.expires});let N=o.b(D)&&o.$()?D:yield this.readImageNow(D),G={type:this.type,uid:c.uid,source:this.id,rawImageData:N,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(c.actor&&c.state!==\"expired\"&&c.state!==\"reloading\")return;c.actor&&c.state!==\"expired\"||(c.actor=this.dispatcher.getActor());let q=yield c.actor.sendAsync({type:\"LDT\",data:G});c.dem=q,c.needsHillshadePrepare=!0,c.needsTerrainPrepare=!0,c.state=\"loaded\"}}catch(S){if(delete c.abortController,c.aborted)c.state=\"unloaded\";else if(S)throw c.state=\"errored\",S}}))}readImageNow(c){return o._(this,void 0,void 0,(function*(){if(typeof VideoFrame<\"u\"&&o.a0()){let f=c.width+2,b=c.height+2;try{return new o.R({width:f,height:b},yield o.a1(c,-1,-1,f,b))}catch{}}return w.getImageData(c,1)}))}_getNeighboringTiles(c){let f=c.canonical,b=Math.pow(2,f.z),S=(f.x-1+b)%b,D=f.x===0?c.wrap-1:c.wrap,N=(f.x+1+b)%b,G=f.x+1===b?c.wrap+1:c.wrap,q={};return q[new o.a2(c.overscaledZ,D,f.z,S,f.y).key]={backfilled:!1},q[new o.a2(c.overscaledZ,G,f.z,N,f.y).key]={backfilled:!1},f.y>0&&(q[new o.a2(c.overscaledZ,D,f.z,S,f.y-1).key]={backfilled:!1},q[new o.a2(c.overscaledZ,c.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},q[new o.a2(c.overscaledZ,G,f.z,N,f.y-1).key]={backfilled:!1}),f.y+1<b&&(q[new o.a2(c.overscaledZ,D,f.z,S,f.y+1).key]={backfilled:!1},q[new o.a2(c.overscaledZ,c.wrap,f.z,f.x,f.y+1).key]={backfilled:!1},q[new o.a2(c.overscaledZ,G,f.z,N,f.y+1).key]={backfilled:!1}),q}unloadTile(c){return o._(this,void 0,void 0,(function*(){c.demTexture&&this.map.painter.saveTileTexture(c.demTexture),c.fbo&&(c.fbo.destroy(),delete c.fbo),c.dem&&delete c.dem,delete c.neighboringTiles,c.state=\"unloaded\",c.actor&&(yield c.actor.sendAsync({type:\"RDT\",data:{type:this.type,uid:c.uid,source:this.id}}))}))}}function qn(I,c){return c?I.properties[c]:I.id}function ds(I,c){let f={id:I.id};if(c.removeAllProperties&&(delete I.removeProperties,delete I.addOrUpdateProperties,delete c.removeProperties),c.removeProperties)for(let b of c.removeProperties){let S=I.addOrUpdateProperties.findIndex((D=>D.key===b));S>-1&&I.addOrUpdateProperties.splice(S,1)}return(I.removeAllProperties||c.removeAllProperties)&&(f.removeAllProperties=!0),(I.removeProperties||c.removeProperties)&&(f.removeProperties=[...I.removeProperties||[],...c.removeProperties||[]]),(I.addOrUpdateProperties||c.addOrUpdateProperties)&&(f.addOrUpdateProperties=[...I.addOrUpdateProperties||[],...c.addOrUpdateProperties||[]]),(I.newGeometry||c.newGeometry)&&(f.newGeometry=c.newGeometry||I.newGeometry),f}function Xo(I){var c,f;if(!I)return{};let b={};return b.removeAll=I.removeAll,b.remove=new Set(I.remove||[]),b.add=new Map((c=I.add)===null||c===void 0?void 0:c.map((S=>[S.id,S]))),b.update=new Map((f=I.update)===null||f===void 0?void 0:f.map((S=>[S.id,S]))),b}function Ul(I){return I&&I.length!==0?typeof I[0]==\"number\"?[I]:I.flatMap((c=>Ul(c))):[]}function gc(I){return I.type===\"GeometryCollection\"?I.geometries.flatMap((c=>gc(c))):Ul(I.coordinates)}function Wu(I){let c=new wr,f;switch(I.type){case\"FeatureCollection\":f=I.features.flatMap((b=>gc(b.geometry)));break;case\"Feature\":f=gc(I.geometry);break;default:f=gc(I)}if(f.length===0)return c;for(let b=0;b<f.length;b++){let[S,D]=f[b];c.extend([S,D])}return c}class qu extends o.E{constructor(c,f,b,S){super(),this.id=c,this.type=\"geojson\",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:f.data},this.actor=b.getActor(),this.setEventedParent(S),this._data=typeof f.data==\"string\"?{url:f.data}:{geojson:f.data},this._options=o.e({},f),this._collectResourceTiming=f.collectResourceTiming,f.maxzoom!==void 0&&(this.maxzoom=f.maxzoom),f.type&&(this.type=f.type),f.attribution&&(this.attribution=f.attribution),this.promoteId=f.promoteId,f.clusterMaxZoom!==void 0&&this.maxzoom<=f.clusterMaxZoom&&o.w(`The maxzoom value \"${this.maxzoom}\" is expected to be greater than the clusterMaxZoom value \"${f.clusterMaxZoom}\".`),this.workerOptions=o.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(f.buffer!==void 0?f.buffer:128),tolerance:this._pixelsToTileUnits(f.tolerance!==void 0?f.tolerance:.375),extent:o.a5,maxZoom:this.maxzoom,lineMetrics:f.lineMetrics||!1,generateId:f.generateId||!1,promoteId:typeof f.promoteId==\"string\"?f.promoteId:void 0,cluster:f.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(f.clusterMaxZoom),minPoints:Math.max(2,f.clusterMinPoints||2),extent:o.a5,radius:this._pixelsToTileUnits(f.clusterRadius||50),log:!1,generateId:f.generateId||!1}},clusterProperties:f.clusterProperties,filter:f.filter},f.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(c){return c*(o.a5/this.tileSize)}_getClusterMaxZoom(c){let f=c?Math.round(c):this.maxzoom-1;return Number.isInteger(c)||c===void 0||o.w(`Integer expected for option 'clusterMaxZoom': provided value \"${c}\" rounded to \"${f}\"`),f}load(){return o._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(c){this.map=c,this.load()}setData(c,f){this._data=typeof c==\"string\"?{url:c}:{geojson:c},this._pendingWorkerUpdate={data:c};let b=this._updateWorkerData();return f?b:this}updateData(c,f){this._pendingWorkerUpdate.diff=(function(S,D){if(!S)return D||{};if(!D)return S||{};let N=Xo(S),G=Xo(D);(function(K,it){it.removeAll&&(K.add.clear(),K.update.clear(),K.remove.clear(),it.remove.clear());for(let ct of it.remove)K.add.delete(ct),K.update.delete(ct);for(let[ct,ut]of it.update){let gt=K.update.get(ct);gt&&(it.update.set(ct,ds(gt,ut)),K.update.delete(ct))}})(N,G);let q={};if((N.removeAll||G.removeAll)&&(q.removeAll=!0),q.remove=new Set([...N.remove,...G.remove]),q.add=new Map([...N.add,...G.add]),q.update=new Map([...N.update,...G.update]),q.remove.size&&q.add.size)for(let K of q.add.keys())q.remove.delete(K);return(function(K){let it={};return K.removeAll&&(it.removeAll=K.removeAll),K.remove&&(it.remove=Array.from(K.remove)),K.add&&(it.add=Array.from(K.add.values())),K.update&&(it.update=Array.from(K.update.values())),it})(q)})(this._pendingWorkerUpdate.diff,c);let b=this._updateWorkerData();return f?b:this}getData(){return o._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once(\"data\")),this._data.geojson?this._data.geojson:{type:\"FeatureCollection\",features:Array.from(this._data.updateable.values())}}))}getBounds(){return o._(this,void 0,void 0,(function*(){return Wu(yield this.getData())}))}setClusterOptions(c){return this.workerOptions.geojsonVtOptions.cluster=c.cluster,c.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(c.clusterRadius)),c.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(c.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(c){return this.actor.sendAsync({type:\"GCEZ\",data:{type:this.type,clusterId:c,source:this.id}})}getClusterChildren(c){return this.actor.sendAsync({type:\"GCC\",data:{type:this.type,clusterId:c,source:this.id}})}getClusterLeaves(c,f,b){return this.actor.sendAsync({type:\"GCL\",data:{type:this.type,source:this.id,clusterId:c,limit:f,offset:b}})}_updateWorkerData(){return o._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void o.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:c,diff:f,updateCluster:b}=this._pendingWorkerUpdate,S=this._getLoadGeoJSONParameters(c,f,b);c!==void 0?this._pendingWorkerUpdate.data=void 0:f?this._pendingWorkerUpdate.diff=void 0:b&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(S)}))}_getLoadGeoJSONParameters(c,f,b){return o._(this,void 0,void 0,(function*(){let S=o.e({type:this.type},this.workerOptions);return typeof c==\"string\"?(S.request=yield this.map._requestManager.transformRequest(w.resolveURL(c),\"Source\"),S.request.collectResourceTiming=this._collectResourceTiming,S):c!==void 0?(S.data=c,S):f?(S.dataDiff=f,S):b?(S.updateCluster=!0,S):void 0}))}_dispatchWorkerUpdate(c){return o._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new o.l(\"dataloading\",{dataType:\"source\"}));try{let f=yield c,b=yield this.actor.sendAsync({type:\"LD\",data:f});if(this._isUpdatingWorker=!1,this._removed||b.abandoned)return void this.fire(new o.l(\"dataabort\",{dataType:\"source\"}));b.data&&(this._data={geojson:b.data});let S=this._applyDiffToSource(f.dataDiff),D=this._getShouldReloadTileOptions(S),N={dataType:\"source\"};this._applyResourceTiming(N,b),this.fire(new o.l(\"data\",Object.assign(Object.assign({},N),{sourceDataType:\"metadata\"}))),this.fire(new o.l(\"data\",Object.assign(Object.assign({},N),{sourceDataType:\"content\",shouldReloadTileOptions:D})))}catch(f){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new o.l(\"dataabort\",{dataType:\"source\"}));this.fire(new o.k(f))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(c,f){var b;if(!this._collectResourceTiming)return;let S=(b=f.resourceTiming)===null||b===void 0?void 0:b[this.id];if(!S)return;let D=S.slice(0);D?.length&&o.e(c,{resourceTiming:D})}_applyDiffToSource(c){if(!c)return;let f=typeof this.promoteId==\"string\"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let S=(function(D,N){let G=new Map;if(D==null||D.type==null)return G;if(D.type===\"Feature\"){let q=qn(D,N);return q==null?void 0:(G.set(q,D),G)}if(D.type===\"FeatureCollection\"){let q=new Set;for(let K of D.features){let it=qn(K,N);if(it==null||q.has(it))return;q.add(it),G.set(it,K)}return G}})(this._data.geojson,f);if(!S)throw new Error(`GeoJSONSource \"${this.id}\": GeoJSON data is not compatible with updateData`);this._data={updateable:S}}if(!this._data.updateable)return;let b=(function(S,D,N){var G,q;let K=[];if(D.removeAll)S.clear();else if(D.remove)for(let it of D.remove){let ct=S.get(it);ct&&(K.push(ct.geometry),S.delete(it))}if(D.add)for(let it of D.add){let ct=qn(it,N);if(ct==null)continue;let ut=S.get(ct);ut&&K.push(ut.geometry),K.push(it.geometry),S.set(ct,it)}if(D.update)for(let it of D.update){let ct=S.get(it.id);if(!ct)continue;let ut=!!it.newGeometry,gt=it.removeAllProperties||((G=it.removeProperties)===null||G===void 0?void 0:G.length)>0||((q=it.addOrUpdateProperties)===null||q===void 0?void 0:q.length)>0;if(!ut&&!gt)continue;K.push(ct.geometry);let yt=Object.assign({},ct);if(S.set(it.id,yt),ut&&(K.push(it.newGeometry),yt.geometry=it.newGeometry),gt){if(yt.properties=it.removeAllProperties?{}:Object.assign({},yt.properties||{}),it.removeProperties)for(let Pt of it.removeProperties)delete yt.properties[Pt];if(it.addOrUpdateProperties)for(let{key:Pt,value:Ct}of it.addOrUpdateProperties)yt.properties[Pt]=Ct}}return K})(this._data.updateable,c,f);return c.removeAll||this._options.cluster?void 0:b}_getShouldReloadTileOptions(c){if(c)return{affectedBounds:c.filter(Boolean).map((f=>Wu(f)))}}shouldReloadTile(c,{affectedBounds:f}){if(c.state===\"loading\")return!0;if(c.state===\"unloaded\")return!1;let{buffer:b,extent:S}=this.workerOptions.geojsonVtOptions,D=(function({x:N,y:G,z:q},K=0){let it=o.a3((N-K)/Math.pow(2,q)),ct=o.a4((G+1+K)/Math.pow(2,q)),ut=o.a3((N+1+K)/Math.pow(2,q)),gt=o.a4((G-K)/Math.pow(2,q));return new wr([it,ct],[ut,gt])})(c.tileID.canonical,b/S);for(let N of f)if(D.intersects(N))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(c){return o._(this,void 0,void 0,(function*(){let f=c.actor?\"RT\":\"LT\";c.actor=this.actor;let b={type:this.type,uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};c.abortController=new AbortController;let S=yield this.actor.sendAsync({type:f,data:b},c.abortController);delete c.abortController,c.unloadVectorData(),c.aborted||c.loadVectorData(S,this.map.painter,f===\"RT\")}))}abortTile(c){return o._(this,void 0,void 0,(function*(){c.abortController&&(c.abortController.abort(),delete c.abortController),c.aborted=!0}))}unloadTile(c){return o._(this,void 0,void 0,(function*(){c.unloadVectorData(),yield this.actor.sendAsync({type:\"RMT\",data:{uid:c.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 o.e({},this._options,{type:this.type,data:this._data.updateable?{type:\"FeatureCollection\",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class Rs extends o.E{constructor(c,f,b,S){super(),this.flippedWindingOrder=!1,this.id=c,this.dispatcher=b,this.coordinates=f.coordinates,this.type=\"image\",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(S),this.options=f}load(c){return o._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new o.l(\"dataloading\",{dataType:\"source\"})),this.url=this.options.url,this._request=new AbortController;try{let f=yield W.getImage(yield this.map._requestManager.transformRequest(this.url,\"Image\"),this._request);this._request=null,this._loaded=!0,f&&f.data&&(this.image=f.data,c&&(this.coordinates=c),this._finishLoading())}catch(f){this._request=null,this._loaded=!0,o.Z(f)||this.fire(new o.k(f))}}))}loaded(){return this._loaded}updateImage(c){return c.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=c.url,this.load(c.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})))}onAdd(c){this.map=c,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(c){this.coordinates=c;let f=c.map(o.a6.fromLngLat);var b;return this.tileID=(function(S){let D=o.a7.fromPoints(S),N=D.width(),G=D.height(),q=Math.max(N,G),K=Math.max(0,Math.floor(-Math.log(q)/Math.LN2)),it=Math.pow(2,K);return new o.a9(K,Math.floor((D.minX+D.maxX)/2*it),Math.floor((D.minY+D.maxY)/2*it))})(f),this.terrainTileRanges=this._getOverlappingTileRanges(f),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=f.map((S=>this.tileID.getTilePoint(S)._round())),this.flippedWindingOrder=((b=this.tileCoords)[1].x-b[0].x)*(b[2].y-b[0].y)-(b[1].y-b[0].y)*(b[2].x-b[0].x)<0,this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"content\"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let c=this.map.painter.context,f=c.gl;this.texture||(this.texture=new o.T(c,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let b=!1;for(let S in this.tiles){let D=this.tiles[S];D.state!==\"loaded\"&&(D.state=\"loaded\",D.texture=this.texture,b=!0)}b&&this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"idle\",sourceId:this.id}))}loadTile(c){return o._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(c.tileID.canonical)?(this.tiles[String(c.tileID.wrap)]=c,c.buckets={}):c.state=\"errored\"}))}serialize(){return{type:\"image\",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(c){let{minX:f,minY:b,maxX:S,maxY:D}=o.a7.fromPoints(c),N={};for(let G=0;G<=o.a8;G++){let q=Math.pow(2,G),K=Math.floor(f*q),it=Math.floor(b*q),ct=Math.floor(S*q),ut=Math.floor(D*q),gt=(K%q+q)%q,yt=ct%q,Pt=Math.floor(K/q),Ct=Math.floor(ct/q);N[G]={minWrap:Pt,maxWrap:Ct,minTileXWrapped:gt,maxTileXWrapped:yt,minTileY:it,maxTileY:ut}}return N}}class ba extends Rs{constructor(c,f,b,S){super(c,f,b,S),this._onPlayingHandler=()=>{var D;(D=this.map)===null||D===void 0||D.triggerRepaint()},this.roundZoom=!0,this.type=\"video\",this.options=f}load(){return o._(this,void 0,void 0,(function*(){this._loaded=!1;let c=this.options;this.urls=[];for(let f of c.urls)this.urls.push((yield this.map._requestManager.transformRequest(f,\"Source\")).url);try{let f=yield o.aa(this.urls);if(this._loaded=!0,!f)return;this.video=f,this.video.loop=!0,this.video.addEventListener(\"playing\",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(f){this.fire(new o.k(f))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(c){if(this.video){let f=this.video.seekable;c<f.start(0)||c>f.end(0)?this.fire(new o.k(new o.ab(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=c}}getVideo(){return this.video}onAdd(c){this.map||(this.map=c,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener(\"playing\",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let c=this.map.painter.context,f=c.gl;this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new o.T(c,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let b=!1;for(let S in this.tiles){let D=this.tiles[S];D.state!==\"loaded\"&&(D.state=\"loaded\",D.texture=this.texture,b=!0)}b&&this.fire(new o.l(\"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 Vl extends Rs{constructor(c,f,b,S){super(c,f,b,S),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some((D=>!Array.isArray(D)||D.length!==2||D.some((N=>typeof N!=\"number\"))))||this.fire(new o.k(new o.ab(`sources.${c}`,null,'\"coordinates\" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.k(new o.ab(`sources.${c}`,null,'missing required property \"coordinates\"'))),f.animate&&typeof f.animate!=\"boolean\"&&this.fire(new o.k(new o.ab(`sources.${c}`,null,'optional \"animate\" property must be a boolean value'))),f.canvas?typeof f.canvas==\"string\"||f.canvas instanceof HTMLCanvasElement||this.fire(new o.k(new o.ab(`sources.${c}`,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 o.k(new o.ab(`sources.${c}`,null,'missing required property \"canvas\"'))),this.options=f,this.animate=f.animate===void 0||f.animate}load(){return o._(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 o.k(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(c){this.map=c,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let c=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,c=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,c=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let f=this.map.painter.context,b=f.gl;this.texture?(c||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new o.T(f,this.canvas,b.RGBA,{premultiply:!0}),this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE));let S=!1;for(let D in this.tiles){let N=this.tiles[D];N.state!==\"loaded\"&&(N.state=\"loaded\",N.texture=this.texture,S=!0)}S&&this.fire(new o.l(\"data\",{dataType:\"source\",sourceDataType:\"idle\",sourceId:this.id}))}serialize(){return{type:\"canvas\",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let c of[this.canvas.width,this.canvas.height])if(isNaN(c)||c<=0)return!0;return!1}}let FA={},NA=I=>{switch(I){case\"geojson\":return qu;case\"image\":return Rs;case\"raster\":return ln;case\"raster-dem\":return Io;case\"vector\":return Ui;case\"video\":return ba;case\"canvas\":return Vl}return FA[I]},Va=\"RTLPluginLoaded\";class mm extends o.E{constructor(){super(...arguments),this.status=\"unavailable\",this.url=null,this.dispatcher=mr()}_syncState(c){return this.status=c,this.dispatcher.broadcast(\"SRPS\",{pluginStatus:c,pluginURL:this.url}).catch((f=>{throw this.status=\"error\",f}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status=\"unavailable\",this.url=null}setRTLTextPlugin(c){return o._(this,arguments,void 0,(function*(f,b=!1){if(this.url)throw new Error(\"setRTLTextPlugin cannot be called multiple times.\");if(this.url=w.resolveURL(f),!this.url)throw new Error(`requested url ${f} is invalid`);if(this.status===\"unavailable\"){if(!b)return this._requestImport();this.status=\"deferred\",this._syncState(this.status)}else if(this.status===\"requested\")return this._requestImport()}))}_requestImport(){return o._(this,void 0,void 0,(function*(){yield this._syncState(\"loading\"),this.status=\"loaded\",this.fire(new o.l(Va))}))}lazyLoad(){this.status===\"unavailable\"?this.status=\"requested\":this.status===\"deferred\"&&this._requestImport()}}let Cp=null;function ja(){return Cp||(Cp=new mm),Cp}var jl,dl;(function(I){I[I.Base=0]=\"Base\",I[I.Parent=1]=\"Parent\"})(jl||(jl={})),(function(I){I[I.Departing=0]=\"Departing\",I[I.Incoming=1]=\"Incoming\"})(dl||(dl={}));class af{constructor(c,f){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=c,this.uid=o.ac(),this.uses=0,this.tileSize=f,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state=\"loading\"}isRenderable(c){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(c||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:c,fadingDirection:f,fadingParentID:b,fadeEndTime:S}){this.resetFadeLogic(),this.fadingRole=c,this.fadingDirection=f,this.fadingParentID=b,this.fadeEndTime=S}setSelfFadeLogic(c){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=c}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=R(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state===\"errored\"||this.state===\"loaded\"||this.state===\"reloading\"}clearTextures(c){this.demTexture&&c.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(c,f,b){if(c?.etagUnmodified!==!0)if(this.hasData()&&this.unloadVectorData(),this.state=\"loaded\",c){c.featureIndex&&(this.latestFeatureIndex=c.featureIndex,c.rawTileData?(this.latestRawTileData=c.rawTileData,this.latestEncoding=c.encoding,this.latestFeatureIndex.rawTileData=c.rawTileData,this.latestFeatureIndex.encoding=c.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=c.collisionBoxArray,this.buckets=(function(S,D){let N={};if(!D)return N;for(let G of S){let q=G.layerIds.map((K=>D.getLayer(K))).filter(Boolean);if(q.length!==0){G.layers=q,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((K=>q.filter((it=>it.id===K))[0])));for(let K of q)N[K.id]=G}}return N})(c.buckets,f?.style),this.hasSymbolBuckets=!1;for(let S in this.buckets){let D=this.buckets[S];if(D instanceof o.ae){if(this.hasSymbolBuckets=!0,!b)break;D.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let S in this.buckets){let D=this.buckets[S];if(D instanceof o.ae&&D.hasRTLText){this.hasRTLText=!0,ja().lazyLoad();break}}this.queryPadding=0;for(let S in this.buckets){let D=this.buckets[S];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(S).queryRadius(D))}c.imageAtlas&&(this.imageAtlas=c.imageAtlas),c.glyphAtlasImage&&(this.glyphAtlasImage=c.glyphAtlasImage),this.dashPositions=c.dashPositions}else this.collisionBoxArray=new o.ad;else this.state=\"loaded\"}unloadVectorData(){for(let c in this.buckets)this.buckets[c].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state=\"unloaded\"}getBucket(c){return this.buckets[c.id]}upload(c){for(let b in this.buckets){let S=this.buckets[b];S.uploadPending()&&S.upload(c)}let f=c.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new o.T(c,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new o.T(c,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(c){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(c,this.imageAtlasTexture)}queryRenderedFeatures(c,f,b,S,D,N,G,q,K,it,ct){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:S,cameraQueryGeometry:D,scale:N,tileSize:this.tileSize,pixelPosMatrix:it,transform:q,params:G,queryPadding:this.queryPadding*K,getElevation:ct},c,f,b):{}}querySourceFeatures(c,f){let b=this.latestFeatureIndex;if(!b||!b.rawTileData)return;let S=b.loadVTLayers(),D=f&&f.sourceLayer?f.sourceLayer:\"\",N=S[o.af]||S[D];if(!N)return;let G=o.ag(f?.filter,f?.globalState),{z:q,x:K,y:it}=this.tileID.canonical,ct={z:q,x:K,y:it};for(let ut=0;ut<N.length;ut++){let gt=N.feature(ut);if(G.needGeometry){let Ct=o.ah(gt,!0);if(!G.filter(new o.H(this.tileID.overscaledZ),Ct,this.tileID.canonical))continue}else if(!G.filter(new o.H(this.tileID.overscaledZ),gt))continue;let yt=b.getId(gt,D),Pt=new o.ai(gt,q,K,it,yt);Pt.tile=ct,c.push(Pt)}}hasData(){return this.state===\"loaded\"||this.state===\"reloading\"||this.state===\"expired\"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(c){let f=this.expirationTime;if(c.cacheControl){let b=o.aj(c.cacheControl);b[\"max-age\"]&&(this.expirationTime=Date.now()+1e3*b[\"max-age\"])}else c.expires&&(this.expirationTime=new Date(c.expires).getTime());if(this.expirationTime){let b=Date.now(),S=!1;if(this.expirationTime>b)S=!1;else if(f)if(this.expirationTime<f)S=!0;else{let D=this.expirationTime-f;D?this.expirationTime=b+Math.max(D,3e4):S=!0}else S=!0;S?(this.expiredRequestCount++,this.state=\"expired\"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(c,f){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(c).length===0)return;let b=this.latestFeatureIndex.loadVTLayers();for(let S in this.buckets){if(!f.style.hasLayer(S))continue;let D=this.buckets[S],N=D.layers[0].sourceLayer||o.af,G=b[N],q=c[N];if(!G||!q||Object.keys(q).length===0)continue;D.update(q,G,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let K=f&&f.style&&f.style.getLayer(S);K&&(this.queryPadding=Math.max(this.queryPadding,K.queryRadius(D)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(c){this.symbolFadeHoldUntil=R()+c}setDependencies(c,f){let b={};for(let S of f)b[S]=!0;this.dependencies[c]=b}hasDependency(c,f){for(let b of c){let S=this.dependencies[b];if(S){for(let D of f)if(S[D])return!0}}return!1}}class gm{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(c,f,b){let S=String(f);if(this.stateChanges[c]=this.stateChanges[c]||{},this.stateChanges[c][S]=this.stateChanges[c][S]||{},o.e(this.stateChanges[c][S],b),this.deletedStates[c]===null){this.deletedStates[c]={};for(let D in this.state[c])D!==S&&(this.deletedStates[c][D]=null)}else if(this.deletedStates[c]&&this.deletedStates[c][S]===null){this.deletedStates[c][S]={};for(let D in this.state[c][S])b[D]||(this.deletedStates[c][S][D]=null)}else for(let D in b)this.deletedStates[c]&&this.deletedStates[c][S]&&this.deletedStates[c][S][D]===null&&delete this.deletedStates[c][S][D]}removeFeatureState(c,f,b){if(this.deletedStates[c]===null)return;let S=String(f);if(this.deletedStates[c]=this.deletedStates[c]||{},b&&f!==void 0)this.deletedStates[c][S]!==null&&(this.deletedStates[c][S]=this.deletedStates[c][S]||{},this.deletedStates[c][S][b]=null);else if(f!==void 0)if(this.stateChanges[c]&&this.stateChanges[c][S])for(b in this.deletedStates[c][S]={},this.stateChanges[c][S])this.deletedStates[c][S][b]=null;else this.deletedStates[c][S]=null;else this.deletedStates[c]=null}getState(c,f){let b=String(f),S=o.e({},(this.state[c]||{})[b],(this.stateChanges[c]||{})[b]);if(this.deletedStates[c]===null)return{};if(this.deletedStates[c]){let D=this.deletedStates[c][f];if(D===null)return{};for(let N in D)delete S[N]}return S}initializeTileState(c,f){c.setFeatureState(this.state,f)}coalesceChanges(c,f){let b={};for(let S in this.stateChanges){this.state[S]=this.state[S]||{};let D={};for(let N in this.stateChanges[S])this.state[S][N]||(this.state[S][N]={}),o.e(this.state[S][N],this.stateChanges[S][N]),D[N]=this.state[S][N];b[S]=D}for(let S in this.deletedStates){this.state[S]=this.state[S]||{};let D={};if(this.deletedStates[S]===null)for(let N in this.state[S])D[N]={},this.state[S][N]={};else for(let N in this.deletedStates[S]){if(this.deletedStates[S][N]===null)this.state[S][N]={};else for(let G of Object.keys(this.deletedStates[S][N]))delete this.state[S][N][G];D[N]=this.state[S][N]}b[S]=b[S]||{},o.e(b[S],D)}this.stateChanges={},this.deletedStates={},Object.keys(b).length!==0&&(this.revision++,c.setFeatureState(b,f))}}let Hu=89.25;function $l(I,c){let f=o.ak(c.lat,-o.al,o.al);return new o.P(o.Y(c.lng)*I,o.X(f)*I)}function lf(I,c){return new o.a6(c.x/I,c.y/I).toLngLat()}function Yu(I){return I.cameraToCenterDistance*Math.min(.85*Math.tan(o.am(90-I.pitch)),Math.tan(o.am(Hu-I.pitch)))}function Ip(I,c){let f=I.canonical,b=c/o.an(f.z),S=f.x+Math.pow(2,f.z)*I.wrap,D=o.ao(new Float64Array(16));return o.O(D,D,[S*b,f.y*b,0]),o.Q(D,D,[b/o.a5,b/o.a5,1]),D}function Am(I,c,f,b,S){let D=o.a6.fromLngLat(I,c),N=S*o.ap(1,I.lat),{x:G,y:q,z:K}=ym(f,b);return new o.a6(D.x+N*-G,D.y+N*-q,D.z+N*-K)}function ym(I,c){let f=o.am(I),b=o.am(c),S=Math.cos(-f),D=Math.sin(f);return{x:D*Math.sin(b),y:-D*Math.cos(b),z:S}}function Te(I,c,f){let b=c.intersectsFrustum(I);if(!f||b===0)return b;let S=c.intersectsPlane(f);return S===0?0:b===2&&S===2?2:1}function zA(I,c,f){let b=0,S=(f-c)/10;for(let D=0;D<10;D++)b+=S*Math.pow(Math.cos(c+(D+.5)/10*(f-c)),I);return b}function UA(I,c){return function(f,b,S,D,N){let G=2*((I-1)/o.aq(Math.cos(o.am(Hu-N))/Math.cos(o.am(Hu)))-1),q=Math.acos(S/D),K=2*zA(G-1,0,o.am(N/2)),it=Math.min(o.am(Hu),q+o.am(N/2)),ct=zA(G-1,Math.min(it,q-o.am(N/2)),it),ut=Math.atan(b/S),gt=Math.hypot(b,S),yt=f;return yt+=o.aq(D/gt/Math.max(.5,Math.cos(o.am(N/2)))),yt+=G*o.aq(Math.cos(ut))/2,yt-=o.aq(Math.max(1,ct/K/c))/2,yt}}let Yi=UA(9.314,3);function Ds(I,c){let f=(c.roundZoom?Math.round:Math.floor)(I.zoom+o.aq(I.tileSize/c.tileSize));return Math.max(0,f)}function jh(I,c){let f=I.getCameraFrustum(),b=I.getClippingPlane(),S=I.screenPointToMercatorCoordinate(I.getCameraPoint()),D=o.a6.fromLngLat(I.center,I.elevation);S.z=D.z+Math.cos(I.pitchInRadians)*I.cameraToCenterDistance/I.worldSize;let N=I.getCoveringTilesDetailsProvider(),G=N.allowVariableZoom(I,c),q=Ds(I,c),K=c.minzoom||0,it=c.maxzoom!==void 0?c.maxzoom:I.maxZoom,ct=Math.min(Math.max(0,q),it),ut=Math.pow(2,ct),gt=[ut*S.x,ut*S.y,0],yt=[ut*D.x,ut*D.y,0],Pt=Math.hypot(D.x-S.x,D.y-S.y),Ct=Math.abs(D.z-S.z),Rt=Math.hypot(Pt,Ct),Ut=jt=>({zoom:0,x:0,y:0,wrap:jt,fullyVisible:!1}),Gt=[],zt=[];if(I.renderWorldCopies&&N.allowWorldCopies())for(let jt=1;jt<=3;jt++)Gt.push(Ut(-jt)),Gt.push(Ut(jt));for(Gt.push(Ut(0));Gt.length>0;){let jt=Gt.pop(),Wt=jt.x,It=jt.y,Xt=jt.fullyVisible,Kt={x:Wt,y:It,z:jt.zoom},de=N.getTileBoundingVolume(Kt,jt.wrap,I.elevation,c);if(!Xt){let $e=Te(f,de,b);if($e===0)continue;Xt=$e===2}let le=N.distanceToTile2d(S.x,S.y,Kt,de),me=q;G&&(me=(c.calculateTileZoom||Yi)(I.zoom+o.aq(I.tileSize/c.tileSize),le,Ct,Rt,I.fov)),me=(c.roundZoom?Math.round:Math.floor)(me),me=Math.max(0,me);let Le=Math.min(me,it);if(jt.wrap=N.getWrap(D,Kt,jt.wrap),jt.zoom>=Le){if(jt.zoom<K)continue;let $e=ct-jt.zoom,Ee=gt[0]-.5-(Wt<<$e),sr=gt[1]-.5-(It<<$e),ur=c.reparseOverscaled?Math.max(jt.zoom,me):jt.zoom;zt.push({tileID:new o.a2(jt.zoom===it?ur:jt.zoom,jt.wrap,jt.zoom,Wt,It),distanceSq:o.ar([yt[0]-.5-Wt,yt[1]-.5-It]),tileDistanceToCamera:Math.sqrt(Ee*Ee+sr*sr)})}else for(let $e=0;$e<4;$e++)Gt.push({zoom:jt.zoom+1,x:(Wt<<1)+$e%2,y:(It<<1)+($e>>1),wrap:jt.wrap,fullyVisible:Xt})}return zt.sort(((jt,Wt)=>jt.distanceSq-Wt.distanceSq)).map((jt=>jt.tileID))}let k_=o.a7.fromPoints([new o.P(0,0),new o.P(o.a5,o.a5)]);function je(I){return I===\"raster\"||I===\"image\"||I===\"video\"}function _M(I,c,f,b,S,D,N){if(!c.hasData())return!1;let{tileID:G,fadingRole:q,fadingDirection:K,fadingParentID:it}=c;if(q===jl.Base&&K===dl.Incoming&&it)return f[it.key]=it,!0;let ct=Math.max(G.overscaledZ-S,D);for(let ut=G.overscaledZ-1;ut>=ct;ut--){let gt=G.scaledTo(ut),yt=I.getLoadedTile(gt);if(yt)return c.setCrossFadeLogic({fadingRole:jl.Base,fadingDirection:dl.Incoming,fadingParentID:yt.tileID,fadeEndTime:b+N}),yt.setCrossFadeLogic({fadingRole:jl.Parent,fadingDirection:dl.Departing,fadeEndTime:b+N}),f[gt.key]=gt,!0}return!1}function VA(I,c,f,b,S,D){if(!c.hasData())return!1;let N=c.tileID.children(S),G=R_(I,c,N,f,b,S,D);if(G)return!0;for(let q of N)R_(I,c,q.children(S),f,b,S,D)&&(G=!0);return G}function R_(I,c,f,b,S,D,N){if(f[0].overscaledZ>=D)return!1;let G=!1;for(let q of f){let K=I.getLoadedTile(q);if(!K)continue;let{fadingRole:it,fadingDirection:ct,fadingParentID:ut}=K;it===jl.Base&&ct===dl.Departing&&ut||(K.setCrossFadeLogic({fadingRole:jl.Base,fadingDirection:dl.Departing,fadingParentID:c.tileID,fadeEndTime:S+N}),c.setCrossFadeLogic({fadingRole:jl.Parent,fadingDirection:dl.Incoming,fadeEndTime:S+N})),b[q.key]=q,G=!0}return G}function r2(I,c,f,b){let S=I.tileID;return!!I.selfFading||!I.hasData()&&!!c.has(S)&&(I.setSelfFadeLogic(f+b),!0)}function Ye(I,c){var f;I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0;let b=c.tileID.canonical.x-I.tileID.canonical.x,S=c.tileID.canonical.y-I.tileID.canonical.y,D=Math.pow(2,I.tileID.canonical.z),N=c.tileID.key;b===0&&S===0||Math.abs(S)>1||(Math.abs(b)>1&&(Math.abs(b+D)===1?b+=D:Math.abs(b-D)===1&&(b-=D)),c.dem&&I.dem&&(I.dem.backfillBorder(c.dem,b,S),!((f=I.neighboringTiles)===null||f===void 0)&&f[N]&&(I.neighboringTiles[N].backfilled=!0)))}class cf{constructor(){this._tiles={}}handleWrapJump(c){let f={};for(let b in this._tiles){let S=this._tiles[b];S.tileID=S.tileID.unwrapTo(S.tileID.wrap+c),f[S.tileID.key]=S}this._tiles=f}setFeatureState(c,f){for(let b in this._tiles)this._tiles[b].setFeatureState(c,f)}getAllTiles(){return Object.values(this._tiles)}getAllIds(c=!1){return c?Object.values(this._tiles).map((f=>f.tileID)).sort(o.at).map((f=>f.key)):Object.keys(this._tiles)}getTileById(c){return this._tiles[c]}setTile(c,f){this._tiles[c]=f}deleteTileById(c){delete this._tiles[c]}getLoadedTile(c){let f=this.getTileById(c.key);return f?.hasData()?f:null}isIdRenderable(c,f=!1){var b;return(b=this.getTileById(c))===null||b===void 0?void 0:b.isRenderable(f)}getRenderableIds(c=0,f){let b=[];for(let S of this.getAllIds())this.isIdRenderable(S,f)&&b.push(this.getTileById(S));return f?b.sort(((S,D)=>{let N=S.tileID,G=D.tileID,q=new o.P(N.canonical.x,N.canonical.y)._rotate(-c),K=new o.P(G.canonical.x,G.canonical.y)._rotate(-c);return N.overscaledZ-G.overscaledZ||K.y-q.y||K.x-q.x})).map((S=>S.tileID.key)):b.map((S=>S.tileID)).sort(o.at).map((S=>S.key))}}class Os extends o.E{constructor(c,f,b){super(),this.id=c,this.dispatcher=b,this.on(\"data\",(S=>this._dataHandler(S))),this.on(\"dataloading\",(()=>{this._sourceErrored=!1})),this.on(\"error\",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((S,D,N,G)=>{let q=new(NA(D.type))(S,D,N,G);if(q.id!==S)throw new Error(`Expected Source id to be ${S} instead of ${q.id}`);return q})(c,f,b,this),this._inViewTiles=new cf,this._outOfViewCache=new o.au(0,(S=>this._unloadTile(S))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new gm,this._didEmitContent=!1,this._updated=!1}onAdd(c){this.map=c,this._maxTileCacheSize=c?c._maxTileCacheSize:null,this._maxTileCacheZoomLevels=c?c._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(c)}onRemove(c){for(let f of this._inViewTiles.getAllTiles())f.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(c),this._inViewTiles=new cf}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(let c of this._inViewTiles.getAllTiles())if(c.state!==\"loaded\"&&c.state!==\"errored\")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let c=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,c&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(c,f,b){return o._(this,void 0,void 0,(function*(){try{let S=yield this._source.loadTile(c);this._tileLoaded(c,f,b,S)}catch(S){c.state=\"errored\",S.status!==404?this._source.fire(new o.k(S,{tile:c})):this.update(this.transform,this.terrain)}}))}_unloadTile(c){this._source.unloadTile&&this._source.unloadTile(c)}_abortTile(c){this._source.abortTile&&this._source.abortTile(c),this._source.fire(new o.l(\"dataabort\",{tile:c,coord:c.tileID,dataType:\"source\"}))}serialize(){return this._source.serialize()}prepare(c){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let f of this._inViewTiles.getAllTiles())f.upload(c),f.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(c){var f;return this._inViewTiles.getRenderableIds((f=this.transform)===null||f===void 0?void 0:f.bearingInRadians,c)}hasRenderableParent(c){let f=c.overscaledZ-1;if(f>=this._source.minzoom){let b=this.getLoadedTile(c.scaledTo(f));if(b)return this._inViewTiles.isIdRenderable(b.tileID.key)}return!1}reload(c,f=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let b of this._inViewTiles.getAllIds()){let S=this._inViewTiles.getTileById(b);f&&!this._source.shouldReloadTile(S,f)||(c?this._reloadTile(b,\"expired\"):S.state!==\"errored\"&&this._reloadTile(b,\"reloading\"))}}}_reloadTile(c,f){return o._(this,void 0,void 0,(function*(){let b=this._inViewTiles.getTileById(c);b&&(b.state!==\"loading\"&&(b.state=f),yield this._loadTile(b,c,f))}))}_tileLoaded(c,f,b,S){c.timeAdded=R(),c.selfFading&&(c.fadeEndTime=c.timeAdded+this._rasterFadeDuration),b===\"expired\"&&(c.refreshedUponExpiration=!0),this._setTileReloadTimer(f,c),S?.unmodified||(this.getSource().type===\"raster-dem\"&&c.dem&&(function(D,N){var G,q;let K=N.getRenderableIds();for(let it of K){if(!D.neighboringTiles||!D.neighboringTiles[it])continue;let ct=N.getTileById(it);D.neighboringTiles[it].backfilled||Ye(D,ct),!((q=(G=ct.neighboringTiles)===null||G===void 0?void 0:G[D.tileID.key])===null||q===void 0)&&q.backfilled||Ye(ct,D)}})(c,this._inViewTiles),this._state.initializeTileState(c,this.map?this.map.painter:null),c.aborted||this._source.fire(new o.l(\"data\",{dataType:\"source\",tile:c,coord:c.tileID})))}getTile(c){return this.getTileByID(c.key)}getTileByID(c){return this._inViewTiles.getTileById(c)}_retainLoadedChildren(c,f){let b=this._getLoadedDescendents(f),S=new Set;for(let D of f){let N=b[D.key];if(!N?.length){S.add(D);continue}let G=D.overscaledZ+Os.maxOverzooming,q=N.filter((ct=>ct.tileID.overscaledZ<=G));if(!q.length){S.add(D);continue}let K=Math.min(...q.map((ct=>ct.tileID.overscaledZ))),it=q.filter((ct=>ct.tileID.overscaledZ===K)).map((ct=>ct.tileID));for(let ct of it)c[ct.key]=ct;this._areDescendentsComplete(it,K,D.overscaledZ)||S.add(D)}return S}_getLoadedDescendents(c){var f;let b={};for(let S of this._inViewTiles.getAllTiles().filter((D=>D.hasData())))for(let D of c)S.tileID.isChildOf(D)&&(b[f=D.key]||(b[f]=[])).push(S);return b}_areDescendentsComplete(c,f,b){return c.length===1&&c[0].isOverscaled()?c[0].overscaledZ===f:Math.pow(4,f-b)===c.length}getLoadedTile(c){return this._inViewTiles.getLoadedTile(c)}updateCacheSize(c){let f=Math.ceil(c.width/this._source.tileSize)+1,b=Math.ceil(c.height/this._source.tileSize)+1,S=Math.floor(f*b*(this._maxTileCacheZoomLevels===null?o.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),D=typeof this._maxTileCacheSize==\"number\"?Math.min(this._maxTileCacheSize,S):S;this._outOfViewCache.setMaxSize(D)}handleWrapJump(c){let f=Math.round((c-(this._prevLng===void 0?c:this._prevLng))/360);this._prevLng=c,f&&(this._inViewTiles.handleWrapJump(f),this._resetTileReloadTimers())}update(c,f){if(!this._sourceLoaded||this._paused)return;let b;this.transform=c,this.terrain=f,this.updateCacheSize(c),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?b=c.getVisibleUnwrappedCoordinates(this._source.tileID).map((q=>new o.a2(q.canonical.z,q.wrap,q.canonical.z,q.canonical.x,q.canonical.y))):(b=jh(c,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type===\"vector\"&&this.map._zoomLevelsToOverscale!==void 0?c.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:f,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(b=b.filter((q=>this._source.hasTile(q))))):b=[],this.usedForTerrain&&(b=this._addTerrainIdealTiles(b));let S=b.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,S&&this.fire(new o.l(\"data\",{sourceDataType:\"idle\",dataType:\"source\",sourceId:this.id}));let D=Ds(c,this._source),N=this._updateRetainedTiles(b,D),G=je(this._source.type);G&&this._rasterFadeDuration>0&&!f&&(function(q,K,it,ct,ut,gt,yt){let Pt=R(),Ct=o.as(K);for(let Rt of K){let Ut=q.getTileById(Rt.key);Ut.fadingDirection!==dl.Departing&&Ut.fadeOpacity!==0||Ut.resetFadeLogic(),_M(q,Ut,it,Pt,ct,ut,yt)||VA(q,Ut,it,Pt,gt,yt)||r2(Ut,Ct,Pt,yt)||Ut.resetFadeLogic()}})(this._inViewTiles,b,N,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),G?this._cleanUpRasterTiles(N):this._cleanUpVectorTiles(N)}_cleanUpRasterTiles(c){for(let f of this._inViewTiles.getAllIds())c[f]||this._removeTile(f)}_cleanUpVectorTiles(c){for(let f of this._inViewTiles.getAllIds()){let b=this._inViewTiles.getTileById(f);c[f]?b.clearSymbolFadeHold():b.hasSymbolBuckets?b.holdingForSymbolFade()?b.symbolFadeFinished()&&this._removeTile(f):b.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(f)}}_addTerrainIdealTiles(c){let f=[];for(let b of c)if(b.canonical.z>this._source.minzoom){let S=b.scaledTo(b.canonical.z-1);f.push(S);let D=b.scaledTo(Math.max(this._source.minzoom,Math.min(b.canonical.z,5)));f.push(D)}return c.concat(f)}releaseSymbolFadeTiles(){for(let c of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(c).holdingForSymbolFade()&&this._removeTile(c)}_updateRetainedTiles(c,f){var b;let S=new Set;for(let K of c)this._addTile(K).hasData()||S.add(K);let D=c.reduce(((K,it)=>(K[it.key]=it,K)),{}),N=this._retainLoadedChildren(D,S),G={},q=Math.max(f-Os.maxUnderzooming,this._source.minzoom);for(let K of N){let it=this._inViewTiles.getTileById(K.key),ct=it?.wasRequested();for(let ut=K.overscaledZ-1;ut>=q;--ut){let gt=K.scaledTo(ut);if(G[gt.key])break;if(G[gt.key]=!0,it=this.getTile(gt),!it&&ct&&(it=this._addTile(gt)),it){let yt=it.hasData();if((yt||!(!((b=this.map)===null||b===void 0)&&b.cancelPendingTileRequestsWhileZooming)||ct)&&(D[gt.key]=gt),ct=it.wasRequested(),yt)break}}}return D}_addTile(c){let f=this._inViewTiles.getTileById(c.key);if(f)return f;f=this._outOfViewCache.getAndRemove(c),f&&(f.resetFadeLogic(),this._setTileReloadTimer(c.key,f),f.tileID=c,this._state.initializeTileState(f,this.map?this.map.painter:null));let b=f;return f||(f=new af(c,this._source.tileSize*c.overscaleFactor()),this._loadTile(f,c.key,f.state)),f.uses++,this._inViewTiles.setTile(c.key,f),b||this._source.fire(new o.l(\"dataloading\",{tile:f,coord:f.tileID,dataType:\"source\"})),f}_setTileReloadTimer(c,f){this._clearTileReloadTimer(c);let b=f.getExpiryTimeout();b&&(this._timers[c]=setTimeout((()=>{this._reloadTile(c,\"expired\"),delete this._timers[c]}),b))}_clearTileReloadTimer(c){let f=this._timers[c];f&&(clearTimeout(f),delete this._timers[c])}_resetTileReloadTimers(){for(let c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(let c of this._inViewTiles.getAllIds()){let f=this._inViewTiles.getTileById(c);this._setTileReloadTimer(c,f)}}refreshTiles(c){for(let f of this._inViewTiles.getAllIds()){let b=this._inViewTiles.getTileById(f);(this._inViewTiles.isIdRenderable(f)||b.state==\"errored\")&&c.some((S=>S.equals(b.tileID.canonical)))&&this._reloadTile(f,\"expired\")}}_removeTile(c){let f=this._inViewTiles.getTileById(c);f&&(f.uses--,this._inViewTiles.deleteTileById(c),this._clearTileReloadTimer(c),f.uses>0||(f.hasData()&&f.state!==\"reloading\"?this._outOfViewCache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}_dataHandler(c){c.dataType===\"source\"&&(c.sourceDataType!==\"metadata\"?c.sourceDataType===\"content\"&&this._sourceLoaded&&!this._paused&&(this.reload(c.sourceDataChanged,c.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let c of this._inViewTiles.getAllIds())this._removeTile(c);this._outOfViewCache.reset()}tilesIn(c,f,b){let S=[],D=this.transform;if(!D)return S;let N=D.getCoveringTilesDetailsProvider().allowWorldCopies(),G=b?D.getCameraQueryGeometry(c):c,q=gt=>D.screenPointToMercatorCoordinate(gt,this.terrain),K=this.transformBbox(c,q,!N),it=this.transformBbox(G,q,!N),ct=this.getIds(),ut=o.a7.fromPoints(it);for(let gt=0;gt<ct.length;gt++){let yt=this._inViewTiles.getTileById(ct[gt]);if(yt.holdingForSymbolFade())continue;let Pt=N?[yt.tileID]:[yt.tileID.unwrapTo(-1),yt.tileID.unwrapTo(0)],Ct=Math.pow(2,D.zoom-yt.tileID.overscaledZ),Rt=f*yt.queryPadding*o.a5/yt.tileSize/Ct;for(let Ut of Pt){let Gt=ut.map((zt=>Ut.getTilePoint(new o.a6(zt.x,zt.y))));if(Gt.expandBy(Rt),Gt.intersects(k_)){let zt=K.map((Wt=>Ut.getTilePoint(Wt))),jt=it.map((Wt=>Ut.getTilePoint(Wt)));S.push({tile:yt,tileID:N?Ut:Ut.unwrapTo(0),queryGeometry:zt,cameraQueryGeometry:jt,scale:Ct})}}}return S}transformBbox(c,f,b){let S=c.map(f);if(b){let D=o.a7.fromPoints(c);D.shrinkBy(.001*Math.min(D.width(),D.height()));let N=D.map(f);o.a7.fromPoints(S).covers(N)||(S=S.map((G=>G.x>.5?new o.a6(G.x-1,G.y,G.z):G)))}return S}getVisibleCoordinates(c){let f=this.getRenderableIds(c).map((b=>this._inViewTiles.getTileById(b).tileID));return this.transform&&this.transform.populateCache(f),f}hasTransition(){return!!this._source.hasTransition()||!(!je(this._source.type)||!(function(c,f){if(f<=0)return!1;let b=R();for(let S of c.getAllTiles())if(S.fadeEndTime>=b)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(c){this._rasterFadeDuration=c}setFeatureState(c,f,b){this._state.updateState(c=c||o.af,f,b)}removeFeatureState(c,f,b){this._state.removeFeatureState(c=c||o.af,f,b)}getFeatureState(c,f){return this._state.getState(c=c||o.af,f)}setDependencies(c,f,b){let S=this._inViewTiles.getTileById(c);S&&S.setDependencies(f,b)}reloadTilesForDependencies(c,f){for(let b of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(b).hasDependency(c,f)&&this._reloadTile(b,\"reloading\");this._outOfViewCache.filter((b=>!b.hasDependency(c,f)))}areTilesLoaded(){for(let c of this._inViewTiles.getAllTiles())if(c.state!==\"loaded\"&&c.state!==\"errored\")return!1;return!0}}Os.maxUnderzooming=10,Os.maxOverzooming=3;class D_{constructor(c,f){this.reset(c,f)}reset(c,f){this.points=c||[],this._distances=[0];for(let b=1;b<this.points.length;b++)this._distances[b]=this._distances[b-1]+this.points[b].dist(this.points[b-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(f||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(c){if(this.points.length===1)return this.points[0];c=o.ak(c,0,1);let f=1,b=this._distances[f],S=c*this.paddedLength+this.padding;for(;b<S&&f<this._distances.length;)b=this._distances[++f];let D=f-1,N=this._distances[D],G=b-N,q=G>0?(S-N)/G:0;return this.points[D].mult(1-q).add(this.points[f].mult(q))}}function $h(I,c){let f=!0;return I===\"always\"||I!==\"never\"&&c!==\"never\"||(f=!1),f}class Je{constructor(c,f,b){let S=this.boxCells=[],D=this.circleCells=[];this.xCellCount=Math.ceil(c/b),this.yCellCount=Math.ceil(f/b);for(let N=0;N<this.xCellCount*this.yCellCount;N++)S.push([]),D.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=c,this.height=f,this.xScale=this.xCellCount/c,this.yScale=this.yCellCount/f,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(c,f,b,S,D){this._forEachCell(f,b,S,D,this._insertBoxCell,this.boxUid++),this.boxKeys.push(c),this.bboxes.push(f),this.bboxes.push(b),this.bboxes.push(S),this.bboxes.push(D)}insertCircle(c,f,b,S){this._forEachCell(f-S,b-S,f+S,b+S,this._insertCircleCell,this.circleUid++),this.circleKeys.push(c),this.circles.push(f),this.circles.push(b),this.circles.push(S)}_insertBoxCell(c,f,b,S,D,N){this.boxCells[D].push(N)}_insertCircleCell(c,f,b,S,D,N){this.circleCells[D].push(N)}_query(c,f,b,S,D,N,G){if(b<0||c>this.width||S<0||f>this.height)return[];let q=[];if(c<=0&&f<=0&&this.width<=b&&this.height<=S){if(D)return[{key:null,x1:c,y1:f,x2:b,y2:S}];for(let K=0;K<this.boxKeys.length;K++)q.push({key:this.boxKeys[K],x1:this.bboxes[4*K],y1:this.bboxes[4*K+1],x2:this.bboxes[4*K+2],y2:this.bboxes[4*K+3]});for(let K=0;K<this.circleKeys.length;K++){let it=this.circles[3*K],ct=this.circles[3*K+1],ut=this.circles[3*K+2];q.push({key:this.circleKeys[K],x1:it-ut,y1:ct-ut,x2:it+ut,y2:ct+ut})}}else this._forEachCell(c,f,b,S,this._queryCell,q,{hitTest:D,overlapMode:N,seenUids:{box:{},circle:{}}},G);return q}query(c,f,b,S){return this._query(c,f,b,S,!1,null)}hitTest(c,f,b,S,D,N){return this._query(c,f,b,S,!0,D,N).length>0}hitTestCircle(c,f,b,S,D){let N=c-b,G=c+b,q=f-b,K=f+b;if(G<0||N>this.width||K<0||q>this.height)return!1;let it=[];return this._forEachCell(N,q,G,K,this._queryCellCircle,it,{hitTest:!0,overlapMode:S,circle:{x:c,y:f,radius:b},seenUids:{box:{},circle:{}}},D),it.length>0}_queryCell(c,f,b,S,D,N,G,q){let{seenUids:K,hitTest:it,overlapMode:ct}=G,ut=this.boxCells[D];if(ut!==null){let yt=this.bboxes;for(let Pt of ut)if(!K.box[Pt]){K.box[Pt]=!0;let Ct=4*Pt,Rt=this.boxKeys[Pt];if(c<=yt[Ct+2]&&f<=yt[Ct+3]&&b>=yt[Ct+0]&&S>=yt[Ct+1]&&(!q||q(Rt))&&(!it||!$h(ct,Rt.overlapMode))&&(N.push({key:Rt,x1:yt[Ct],y1:yt[Ct+1],x2:yt[Ct+2],y2:yt[Ct+3]}),it))return!0}}let gt=this.circleCells[D];if(gt!==null){let yt=this.circles;for(let Pt of gt)if(!K.circle[Pt]){K.circle[Pt]=!0;let Ct=3*Pt,Rt=this.circleKeys[Pt];if(this._circleAndRectCollide(yt[Ct],yt[Ct+1],yt[Ct+2],c,f,b,S)&&(!q||q(Rt))&&(!it||!$h(ct,Rt.overlapMode))){let Ut=yt[Ct],Gt=yt[Ct+1],zt=yt[Ct+2];if(N.push({key:Rt,x1:Ut-zt,y1:Gt-zt,x2:Ut+zt,y2:Gt+zt}),it)return!0}}}return!1}_queryCellCircle(c,f,b,S,D,N,G,q){let{circle:K,seenUids:it,overlapMode:ct}=G,ut=this.boxCells[D];if(ut!==null){let yt=this.bboxes;for(let Pt of ut)if(!it.box[Pt]){it.box[Pt]=!0;let Ct=4*Pt,Rt=this.boxKeys[Pt];if(this._circleAndRectCollide(K.x,K.y,K.radius,yt[Ct+0],yt[Ct+1],yt[Ct+2],yt[Ct+3])&&(!q||q(Rt))&&!$h(ct,Rt.overlapMode))return N.push(!0),!0}}let gt=this.circleCells[D];if(gt!==null){let yt=this.circles;for(let Pt of gt)if(!it.circle[Pt]){it.circle[Pt]=!0;let Ct=3*Pt,Rt=this.circleKeys[Pt];if(this._circlesCollide(yt[Ct],yt[Ct+1],yt[Ct+2],K.x,K.y,K.radius)&&(!q||q(Rt))&&!$h(ct,Rt.overlapMode))return N.push(!0),!0}}}_forEachCell(c,f,b,S,D,N,G,q){let K=this._convertToXCellCoord(c),it=this._convertToYCellCoord(f),ct=this._convertToXCellCoord(b),ut=this._convertToYCellCoord(S);for(let gt=K;gt<=ct;gt++)for(let yt=it;yt<=ut;yt++)if(D.call(this,c,f,b,S,this.xCellCount*yt+gt,N,G,q))return}_convertToXCellCoord(c){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(c*this.xScale)))}_convertToYCellCoord(c){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(c*this.yScale)))}_circlesCollide(c,f,b,S,D,N){let G=S-c,q=D-f,K=b+N;return K*K>G*G+q*q}_circleAndRectCollide(c,f,b,S,D,N,G){let q=(N-S)/2,K=Math.abs(c-(S+q));if(K>q+b)return!1;let it=(G-D)/2,ct=Math.abs(f-(D+it));if(ct>it+b)return!1;if(K<=q||ct<=it)return!0;let ut=K-q,gt=ct-it;return ut*ut+gt*gt<=b*b}}function Hr(I,c,f){let b=o.N();if(!I){let{vecSouth:ct,vecEast:ut}=fl(c),gt=a();gt[0]=ut[0],gt[1]=ut[1],gt[2]=ct[0],gt[3]=ct[1],S=gt,(it=(N=(D=gt)[0])*(K=D[3])-(q=D[2])*(G=D[1]))&&(S[0]=K*(it=1/it),S[1]=-G*it,S[2]=-q*it,S[3]=N*it),b[0]=gt[0],b[1]=gt[1],b[4]=gt[2],b[5]=gt[3]}var S,D,N,G,q,K,it;return o.Q(b,b,[1/f,1/f,1]),b}function gi(I,c,f,b){if(I){let S=o.N();if(!c){let{vecSouth:D,vecEast:N}=fl(f);S[0]=N[0],S[1]=N[1],S[4]=D[0],S[5]=D[1]}return o.Q(S,S,[b,b,1]),S}return f.pixelsToClipSpaceMatrix}function fl(I){let c=Math.cos(I.rollInRadians),f=Math.sin(I.rollInRadians),b=Math.cos(I.pitchInRadians),S=Math.cos(I.bearingInRadians),D=Math.sin(I.bearingInRadians),N=o.az();N[0]=-S*b*f-D*c,N[1]=-D*b*f+S*c;let G=o.aA(N);G<1e-9?o.aB(N):o.aC(N,N,1/G);let q=o.az();q[0]=S*b*c-D*f,q[1]=D*b*c+S*f;let K=o.aA(q);return K<1e-9?o.aB(q):o.aC(q,q,1/K),{vecEast:q,vecSouth:N}}function kp(I,c,f,b){let S;b?(S=[I,c,b(I,c),1],o.aE(S,S,f)):(S=[I,c,0,1],$A(S,S,f));let D=S[3];return{point:new o.P(S[0]/D,S[1]/D),signedDistanceFromCamera:D,isOccluded:!1}}function Gh(I,c){return .5+I/c*.5}function fi(I,c){return I.x>=-c[0]&&I.x<=c[0]&&I.y>=-c[1]&&I.y<=c[1]}function jA(I,c,f,b,S,D,N,G,q,K,it,ct,ut){let gt=f?I.textSizeData:I.iconSizeData,yt=o.av(gt,c.transform.zoom),Pt=[256/c.width*2+1,256/c.height*2+1],Ct=f?I.text.dynamicLayoutVertexArray:I.icon.dynamicLayoutVertexArray;Ct.clear();let Rt=I.lineVertexArray,Ut=f?I.text.placedSymbolArray:I.icon.placedSymbolArray,Gt=c.transform.width/c.transform.height,zt=!1;for(let jt=0;jt<Ut.length;jt++){let Wt=Ut.get(jt);if(Wt.hidden||Wt.writingMode===o.aw.vertical&&!zt){pl(Wt.numGlyphs,Ct);continue}zt=!1;let It=new o.P(Wt.anchorX,Wt.anchorY),Xt={getElevation:ut,pitchedLabelPlaneMatrix:b,lineVertexArray:Rt,pitchWithMap:D,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:c.transform,tileAnchorPoint:It,unwrappedTileID:q,width:K,height:it,translation:ct},Kt=Nn(Wt.anchorX,Wt.anchorY,Xt);if(!fi(Kt.point,Pt)){pl(Wt.numGlyphs,Ct);continue}let de=Gh(c.transform.cameraToCenterDistance,Kt.signedDistanceFromCamera),le=o.ax(gt,yt,Wt),me=D?le*c.transform.getPitchedTextCorrection(Wt.anchorX,Wt.anchorY,q)/de:le*de,Le=Dp({projectionContext:Xt,pitchedLabelPlaneMatrixInverse:S,symbol:Wt,fontSize:me,flip:!1,keepUpright:N,glyphOffsetArray:I.glyphOffsetArray,dynamicLayoutVertexArray:Ct,aspectRatio:Gt,rotateToLine:G});zt=Le.useVertical,(Le.notEnoughRoom||zt||Le.needsFlipping&&Dp({projectionContext:Xt,pitchedLabelPlaneMatrixInverse:S,symbol:Wt,fontSize:me,flip:!0,keepUpright:N,glyphOffsetArray:I.glyphOffsetArray,dynamicLayoutVertexArray:Ct,aspectRatio:Gt,rotateToLine:G}).notEnoughRoom)&&pl(Wt.numGlyphs,Ct)}f?I.text.dynamicLayoutVertexBuffer.updateData(Ct):I.icon.dynamicLayoutVertexBuffer.updateData(Ct)}function Rp(I,c,f,b,S,D,N,G){let q=D.glyphStartIndex+D.numGlyphs,K=D.lineStartIndex,it=D.lineStartIndex+D.lineLength,ct=c.getoffsetX(D.glyphStartIndex),ut=c.getoffsetX(q-1),gt=Op(I*ct,f,b,S,D.segment,K,it,G,N);if(!gt)return null;let yt=Op(I*ut,f,b,S,D.segment,K,it,G,N);return yt?G.projectionCache.anyProjectionOccluded?null:{first:gt,last:yt}:null}function _m(I,c,f,b){return I===o.aw.horizontal&&Math.abs(f.y-c.y)>Math.abs(f.x-c.x)*b?{useVertical:!0}:(I===o.aw.vertical?c.y<f.y:c.x>f.x)?{needsFlipping:!0}:null}function Dp(I){let{projectionContext:c,pitchedLabelPlaneMatrixInverse:f,symbol:b,fontSize:S,flip:D,keepUpright:N,glyphOffsetArray:G,dynamicLayoutVertexArray:q,aspectRatio:K,rotateToLine:it}=I,ct=S/24,ut=b.lineOffsetX*ct,gt=b.lineOffsetY*ct,yt;if(b.numGlyphs>1){let Pt=b.glyphStartIndex+b.numGlyphs,Ct=b.lineStartIndex,Rt=b.lineStartIndex+b.lineLength,Ut=Rp(ct,G,ut,gt,D,b,it,c);if(!Ut)return{notEnoughRoom:!0};let Gt=fs(Ut.first.point.x,Ut.first.point.y,c,f),zt=fs(Ut.last.point.x,Ut.last.point.y,c,f);if(N&&!D){let jt=_m(b.writingMode,Gt,zt,K);if(jt)return jt}yt=[Ut.first];for(let jt=b.glyphStartIndex+1;jt<Pt-1;jt++){let Wt=Op(ct*G.getoffsetX(jt),ut,gt,D,b.segment,Ct,Rt,c,it);if(!Wt)return{notEnoughRoom:!0};yt.push(Wt)}yt.push(Ut.last)}else{if(N&&!D){let Ct=tu(c.tileAnchorPoint.x,c.tileAnchorPoint.y,c).point,Rt=b.lineStartIndex+b.segment+1,Ut=new o.P(c.lineVertexArray.getx(Rt),c.lineVertexArray.gety(Rt)),Gt=tu(Ut.x,Ut.y,c),zt=Gt.signedDistanceFromCamera>0?Gt.point:vm(c.tileAnchorPoint,Ut,Ct,1,c),jt=fs(Ct.x,Ct.y,c,f),Wt=fs(zt.x,zt.y,c,f),It=_m(b.writingMode,jt,Wt,K);if(It)return It}let Pt=Op(ct*G.getoffsetX(b.glyphStartIndex),ut,gt,D,b.segment,b.lineStartIndex,b.lineStartIndex+b.lineLength,c,it);if(!Pt||c.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};yt=[Pt]}for(let Pt of yt)o.aD(q,Pt.point,Pt.angle);return{}}function vm(I,c,f,b,S){let D=I.add(I.sub(c)._unit()),N=tu(D.x,D.y,S).point,G=f.sub(N);return f.add(G._mult(b/G.mag()))}function uf(I,c,f){let b=c.projectionCache;if(b.projections[I])return b.projections[I];let S=new o.P(c.lineVertexArray.getx(I),c.lineVertexArray.gety(I)),D=tu(S.x,S.y,c);if(D.signedDistanceFromCamera>0)return b.projections[I]=D.point,b.anyProjectionOccluded=b.anyProjectionOccluded||D.isOccluded,D.point;let N=I-f.direction;return vm(f.distanceFromAnchor===0?c.tileAnchorPoint:new o.P(c.lineVertexArray.getx(N),c.lineVertexArray.gety(N)),S,f.previousVertex,f.absOffsetX-f.distanceFromAnchor+1,c)}function tu(I,c,f){let b=I+f.translation[0],S=c+f.translation[1],D;return f.pitchWithMap?(D=kp(b,S,f.pitchedLabelPlaneMatrix,f.getElevation),D.isOccluded=!1):(D=f.transform.projectTileCoordinates(b,S,f.unwrappedTileID,f.getElevation),D.point.x=(.5*D.point.x+.5)*f.width,D.point.y=(.5*-D.point.y+.5)*f.height),D}function fs(I,c,f,b){if(f.pitchWithMap){let S=[I,c,0,1];return o.aE(S,S,b),f.transform.projectTileCoordinates(S[0]/S[3],S[1]/S[3],f.unwrappedTileID,f.getElevation).point}return{x:I/f.width*2-1,y:1-c/f.height*2}}function Nn(I,c,f){return f.transform.projectTileCoordinates(I,c,f.unwrappedTileID,f.getElevation)}function O_(I,c,f){return I._unit()._perp()._mult(c*f)}function bm(I,c,f,b,S,D,N,G,q){if(G.projectionCache.offsets[I])return G.projectionCache.offsets[I];let K=f.add(c);if(I+q.direction<b||I+q.direction>=S)return G.projectionCache.offsets[I]=K,K;let it=uf(I+q.direction,G,q),ct=O_(it.sub(f),N,q.direction),ut=f.add(ct),gt=it.add(ct);return G.projectionCache.offsets[I]=o.aF(D,K,ut,gt)||K,G.projectionCache.offsets[I]}function Op(I,c,f,b,S,D,N,G,q){let K=b?I-c:I+c,it=K>0?1:-1,ct=0;b&&(it*=-1,ct=Math.PI),it<0&&(ct+=Math.PI);let ut,gt=it>0?D+S:D+S+1;G.projectionCache.cachedAnchorPoint?ut=G.projectionCache.cachedAnchorPoint:(ut=tu(G.tileAnchorPoint.x,G.tileAnchorPoint.y,G).point,G.projectionCache.cachedAnchorPoint=ut);let yt,Pt,Ct=ut,Rt=ut,Ut=0,Gt=0,zt=Math.abs(K),jt=[],Wt;for(;Ut+Gt<=zt;){if(gt+=it,gt<D||gt>=N)return null;Ut+=Gt,Rt=Ct,Pt=yt;let Kt={absOffsetX:zt,direction:it,distanceFromAnchor:Ut,previousVertex:Rt};if(Ct=uf(gt,G,Kt),f===0)jt.push(Rt),Wt=Ct.sub(Rt);else{let de,le=Ct.sub(Rt);de=le.mag()===0?O_(uf(gt+it,G,Kt).sub(Ct),f,it):O_(le,f,it),Pt||(Pt=Rt.add(de)),yt=bm(gt,de,Ct,D,N,Pt,f,G,Kt),jt.push(Pt),Wt=yt.sub(Pt)}Gt=Wt.mag()}let It=Wt._mult((zt-Ut)/Gt)._add(Pt||Rt),Xt=ct+Math.atan2(Ct.y-Rt.y,Ct.x-Rt.x);return jt.push(It),{point:It,angle:q?Xt:0,path:jt}}let hf=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pl(I,c){for(let f=0;f<I;f++){let b=c.length;c.resize(b+4),c.float32.set(hf,3*b)}}function $A(I,c,f){let b=c[0],S=c[1];return I[0]=f[0]*b+f[4]*S+f[12],I[1]=f[1]*b+f[5]*S+f[13],I[3]=f[3]*b+f[7]*S+f[15],I}let Zo=100;class i2{constructor(c,f=new Je(c.width+200,c.height+200,25),b=new Je(c.width+200,c.height+200,25)){this.transform=c,this.grid=f,this.ignoredGrid=b,this.pitchFactor=Math.cos(c.pitch*Math.PI/180)*c.cameraToCenterDistance,this.screenRightBoundary=c.width+Zo,this.screenBottomBoundary=c.height+Zo,this.gridRightBoundary=c.width+200,this.gridBottomBoundary=c.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(c,f,b,S,D,N,G,q,K,it,ct,ut){let gt=this.projectAndGetPerspectiveRatio(c.anchorPointX+q[0],c.anchorPointY+q[1],D,it,ut),yt=b*gt.perspectiveRatio,Pt;if(N||G)Pt=this._projectCollisionBox(c,yt,S,D,N,G,q,gt,it,ct,ut);else{let Wt=gt.x+(ct?ct.x*yt:0),It=gt.y+(ct?ct.y*yt:0);Pt={allPointsOccluded:!1,box:[Wt+c.x1*yt,It+c.y1*yt,Wt+c.x2*yt,It+c.y2*yt]}}let[Ct,Rt,Ut,Gt]=Pt.box,zt=N?Pt.allPointsOccluded:gt.isOccluded,jt=zt;return jt||(jt=gt.perspectiveRatio<this.perspectiveRatioCutoff),jt||(jt=!this.isInsideGrid(Ct,Rt,Ut,Gt)),jt||f!==\"always\"&&this.grid.hitTest(Ct,Rt,Ut,Gt,f,K)?{box:[Ct,Rt,Ut,Gt],placeable:!1,offscreen:!1,occluded:zt}:{box:[Ct,Rt,Ut,Gt],placeable:!0,offscreen:this.isOffscreen(Ct,Rt,Ut,Gt),occluded:zt}}placeCollisionCircles(c,f,b,S,D,N,G,q,K,it,ct,ut,gt,yt){let Pt=[],Ct=new o.P(f.anchorX,f.anchorY),Rt=this.getPerspectiveRatio(Ct.x,Ct.y,N,yt),Ut=(K?D*this.transform.getPitchedTextCorrection(f.anchorX,f.anchorY,N)/Rt:D*Rt)/o.aJ,Gt={getElevation:yt,pitchedLabelPlaneMatrix:G,lineVertexArray:b,pitchWithMap:K,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:Ct,unwrappedTileID:N,width:this.transform.width,height:this.transform.height,translation:gt},zt=Rp(Ut,S,f.lineOffsetX*Ut,f.lineOffsetY*Ut,!1,f,!1,Gt),jt=!1,Wt=!1,It=!0;if(zt){let Xt=.5*ct*Rt+ut,Kt=new o.P(-100,-100),de=new o.P(this.screenRightBoundary,this.screenBottomBoundary),le=new D_,me=zt.first,Le=zt.last,$e=[];for(let ur=me.path.length-1;ur>=1;ur--)$e.push(me.path[ur]);for(let ur=1;ur<Le.path.length;ur++)$e.push(Le.path[ur]);let Ee=2.5*Xt;if(K){let ur=this.projectPathToScreenSpace($e,Gt);$e=ur.some((ji=>ji.signedDistanceFromCamera<=0))?[]:ur.map((ji=>ji.point))}let sr=[];if($e.length>0){let ur=$e[0].clone(),ji=$e[0].clone();for(let Me=1;Me<$e.length;Me++)ur.x=Math.min(ur.x,$e[Me].x),ur.y=Math.min(ur.y,$e[Me].y),ji.x=Math.max(ji.x,$e[Me].x),ji.y=Math.max(ji.y,$e[Me].y);sr=ur.x>=Kt.x&&ji.x<=de.x&&ur.y>=Kt.y&&ji.y<=de.y?[$e]:ji.x<Kt.x||ur.x>de.x||ji.y<Kt.y||ur.y>de.y?[]:o.aG([$e],Kt.x,Kt.y,de.x,de.y)}for(let ur of sr){le.reset(ur,.25*Xt);let ji=0;ji=le.length<=.5*Xt?1:Math.ceil(le.paddedLength/Ee)+1;for(let Me=0;Me<ji;Me++){let Re=Me/Math.max(ji-1,1),wn=le.lerp(Re),fn=wn.x+Zo,oo=wn.y+Zo;Pt.push(fn,oo,Xt,0);let en=fn-Xt,so=oo-Xt,pn=fn+Xt,Do=oo+Xt;if(It=It&&this.isOffscreen(en,so,pn,Do),Wt=Wt||this.isInsideGrid(en,so,pn,Do),c!==\"always\"&&this.grid.hitTestCircle(fn,oo,Xt,c,it)&&(jt=!0,!q))return{circles:[],offscreen:!1,collisionDetected:jt}}}}return{circles:!q&&jt||!Wt||Rt<this.perspectiveRatioCutoff?[]:Pt,offscreen:It,collisionDetected:jt}}projectPathToScreenSpace(c,f){let b=(function(S,D){let N=o.N();return o.ay(N,D.pitchedLabelPlaneMatrix),S.map((G=>{let q=kp(G.x,G.y,N,D.getElevation),K=D.transform.projectTileCoordinates(q.point.x,q.point.y,D.unwrappedTileID,D.getElevation);return K.point.x=(.5*K.point.x+.5)*D.width,K.point.y=(.5*-K.point.y+.5)*D.height,K}))})(c,f);return(function(S){let D=0,N=0,G=0,q=0;for(let K=0;K<S.length;K++)S[K].isOccluded?(G=K+1,q=0):(q++,q>N&&(N=q,D=G));return S.slice(D,D+N)})(b)}queryRenderedSymbols(c){if(c.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let f=[],b=new o.a7;for(let ct of c){let ut=new o.P(ct.x+Zo,ct.y+Zo);b.extend(ut),f.push(ut)}let{minX:S,minY:D,maxX:N,maxY:G}=b,q=this.grid.query(S,D,N,G).concat(this.ignoredGrid.query(S,D,N,G)),K={},it={};for(let ct of q){let ut=ct.key;if(K[ut.bucketInstanceId]===void 0&&(K[ut.bucketInstanceId]={}),K[ut.bucketInstanceId][ut.featureIndex])continue;let gt=[new o.P(ct.x1,ct.y1),new o.P(ct.x2,ct.y1),new o.P(ct.x2,ct.y2),new o.P(ct.x1,ct.y2)];o.aH(f,gt)&&(K[ut.bucketInstanceId][ut.featureIndex]=!0,it[ut.bucketInstanceId]===void 0&&(it[ut.bucketInstanceId]=[]),it[ut.bucketInstanceId].push(ut.featureIndex))}return it}insertCollisionBox(c,f,b,S,D,N){(b?this.ignoredGrid:this.grid).insert({bucketInstanceId:S,featureIndex:D,collisionGroupID:N,overlapMode:f},c[0],c[1],c[2],c[3])}insertCollisionCircles(c,f,b,S,D,N){let G=b?this.ignoredGrid:this.grid,q={bucketInstanceId:S,featureIndex:D,collisionGroupID:N,overlapMode:f};for(let K=0;K<c.length;K+=4)G.insertCircle(q,c[K],c[K+1],c[K+2])}projectAndGetPerspectiveRatio(c,f,b,S,D){if(D){let N;S?(N=[c,f,S(c,f),1],o.aE(N,N,D)):(N=[c,f,0,1],$A(N,N,D));let G=N[3];return{x:(N[0]/G+1)/2*this.transform.width+Zo,y:(-N[1]/G+1)/2*this.transform.height+Zo,perspectiveRatio:.5+this.transform.cameraToCenterDistance/G*.5,isOccluded:!1,signedDistanceFromCamera:G}}{let N=this.transform.projectTileCoordinates(c,f,b,S);return{x:(N.point.x+1)/2*this.transform.width+Zo,y:(1-N.point.y)/2*this.transform.height+Zo,perspectiveRatio:.5+this.transform.cameraToCenterDistance/N.signedDistanceFromCamera*.5,isOccluded:N.isOccluded,signedDistanceFromCamera:N.signedDistanceFromCamera}}}getPerspectiveRatio(c,f,b,S){let D=this.transform.projectTileCoordinates(c,f,b,S);return .5+this.transform.cameraToCenterDistance/D.signedDistanceFromCamera*.5}isOffscreen(c,f,b,S){return b<Zo||c>=this.screenRightBoundary||S<Zo||f>this.screenBottomBoundary}isInsideGrid(c,f,b,S){return b>=0&&c<this.gridRightBoundary&&S>=0&&f<this.gridBottomBoundary}getViewportMatrix(){let c=o.ao([]);return o.O(c,c,[-100,-100,0]),c}_projectCollisionBox(c,f,b,S,D,N,G,q,K,it,ct){let ut=1,gt=0,yt=0,Pt=1,Ct=c.anchorPointX+G[0],Rt=c.anchorPointY+G[1];if(N&&!D){let $e=this.projectAndGetPerspectiveRatio(Ct+1,Rt,S,K,ct),Ee=$e.x-q.x,sr=Math.atan(($e.y-q.y)/Ee)+(Ee<0?Math.PI:0),ur=Math.sin(sr),ji=Math.cos(sr);ut=ji,gt=ur,yt=-ur,Pt=ji}else if(!N&&D){let $e=fl(this.transform);ut=$e.vecEast[0],gt=$e.vecEast[1],yt=$e.vecSouth[0],Pt=$e.vecSouth[1]}let Ut=q.x,Gt=q.y,zt=f;D&&(Ut=Ct,Gt=Rt,zt=Math.pow(2,-(this.transform.zoom-b.overscaledZ)),zt*=this.transform.getPitchedTextCorrection(Ct,Rt,S),it||(zt*=o.ak(.5+q.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),it&&(Ut+=ut*it.x*zt+yt*it.y*zt,Gt+=gt*it.x*zt+Pt*it.y*zt);let jt=c.x1*zt,Wt=c.x2*zt,It=(jt+Wt)/2,Xt=c.y1*zt,Kt=c.y2*zt,de=(Xt+Kt)/2,le=[{offsetX:jt,offsetY:Xt},{offsetX:It,offsetY:Xt},{offsetX:Wt,offsetY:Xt},{offsetX:Wt,offsetY:de},{offsetX:Wt,offsetY:Kt},{offsetX:It,offsetY:Kt},{offsetX:jt,offsetY:Kt},{offsetX:jt,offsetY:de}],me=[];for(let{offsetX:$e,offsetY:Ee}of le)me.push(new o.P(Ut+ut*$e+yt*Ee,Gt+gt*$e+Pt*Ee));let Le=!1;if(D){let $e=me.map((Ee=>this.projectAndGetPerspectiveRatio(Ee.x,Ee.y,S,K,ct)));Le=$e.some((Ee=>!Ee.isOccluded)),me=$e.map((Ee=>new o.P(Ee.x,Ee.y)))}else Le=!0;return{box:o.aI(me),allPointsOccluded:!Le}}}class Wh{constructor(c,f,b,S){this.opacity=c?Math.max(0,Math.min(1,c.opacity+(c.placed?f:-f))):S&&b?1:0,this.placed=b}isHidden(){return this.opacity===0&&!this.placed}}class Lp{constructor(c,f,b,S,D){this.text=new Wh(c?c.text:null,f,b,D),this.icon=new Wh(c?c.icon:null,f,S,D)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class n2{constructor(c,f,b){this.text=c,this.icon=f,this.skipFade=b}}class vM{constructor(c,f,b,S,D){this.bucketInstanceId=c,this.featureIndex=f,this.sourceLayerIndex=b,this.bucketIndex=S,this.tileID=D}}class bM{constructor(c){this.crossSourceCollisions=c,this.maxGroupID=0,this.collisionGroups={}}get(c){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[c]){let f=++this.maxGroupID;this.collisionGroups[c]={ID:f,predicate:b=>b.collisionGroupID===f}}return this.collisionGroups[c]}}function L_(I,c,f,b,S){let{horizontalAlign:D,verticalAlign:N}=o.aP(I);return new o.P(-(D-.5)*c+b[0]*S,-(N-.5)*f+b[1]*S)}class o2{constructor(c,f,b,S,D){this.transform=c.clone(),this.terrain=f,this.collisionIndex=new i2(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=b,this.retainedQueryData={},this.collisionGroups=new bM(S),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=D,D&&(D.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(c){let f=this.terrain;return f?(b,S)=>f.getElevation(c,b,S):null}getBucketParts(c,f,b,S){let D=b.getBucket(f),N=b.latestFeatureIndex;if(!D||!N||f.id!==D.layerIds[0])return;let G=b.collisionBoxArray,q=D.layers[0].layout,K=D.layers[0].paint,it=Math.pow(2,this.transform.zoom-b.tileID.overscaledZ),ct=b.tileSize/o.a5,ut=b.tileID.toUnwrapped(),gt=q.get(\"text-rotation-alignment\")===\"map\",yt=o.aK(b,1,this.transform.zoom),Pt=o.aL(this.collisionIndex.transform,b,K.get(\"text-translate\"),K.get(\"text-translate-anchor\")),Ct=o.aL(this.collisionIndex.transform,b,K.get(\"icon-translate\"),K.get(\"icon-translate-anchor\")),Rt=Hr(gt,this.transform,yt);this.retainedQueryData[D.bucketInstanceId]=new vM(D.bucketInstanceId,N,D.sourceLayerIndex,D.index,b.tileID);let Ut={bucket:D,layout:q,translationText:Pt,translationIcon:Ct,unwrappedTileID:ut,pitchedLabelPlaneMatrix:Rt,scale:it,textPixelRatio:ct,holdingForFade:b.holdingForSymbolFade(),collisionBoxArray:G,partiallyEvaluatedTextSize:o.av(D.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(D.sourceID)};if(S)for(let Gt of D.sortKeyRanges){let{sortKey:zt,symbolInstanceStart:jt,symbolInstanceEnd:Wt}=Gt;c.push({sortKey:zt,symbolInstanceStart:jt,symbolInstanceEnd:Wt,parameters:Ut})}else c.push({symbolInstanceStart:0,symbolInstanceEnd:D.symbolInstances.length,parameters:Ut})}attemptAnchorPlacement(c,f,b,S,D,N,G,q,K,it,ct,ut,gt,yt,Pt,Ct,Rt,Ut,Gt,zt){let jt=o.aM[c.textAnchor],Wt=[c.textOffset0,c.textOffset1],It=L_(jt,b,S,Wt,D),Xt=this.collisionIndex.placeCollisionBox(f,ut,q,K,it,G,N,Ct,ct.predicate,Gt,It,zt);if((!Ut||this.collisionIndex.placeCollisionBox(Ut,ut,q,K,it,G,N,Rt,ct.predicate,Gt,It,zt).placeable)&&Xt.placeable){let Kt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[gt.crossTileID]&&this.prevPlacement.placements[gt.crossTileID]&&this.prevPlacement.placements[gt.crossTileID].text&&(Kt=this.prevPlacement.variableOffsets[gt.crossTileID].anchor),gt.crossTileID===0)throw new Error(\"symbolInstance.crossTileID can't be 0\");return this.variableOffsets[gt.crossTileID]={textOffset:Wt,width:b,height:S,anchor:jt,textBoxScale:D,prevAnchor:Kt},this.markUsedJustification(yt,jt,gt,Pt),yt.allowVerticalPlacement&&(this.markUsedOrientation(yt,Pt,gt),this.placedOrientations[gt.crossTileID]=Pt),{shift:It,placedGlyphBoxes:Xt}}}placeLayerBucketPart(c,f,b){let{bucket:S,layout:D,translationText:N,translationIcon:G,unwrappedTileID:q,pitchedLabelPlaneMatrix:K,textPixelRatio:it,holdingForFade:ct,collisionBoxArray:ut,partiallyEvaluatedTextSize:gt,collisionGroup:yt}=c.parameters,Pt=D.get(\"text-optional\"),Ct=D.get(\"icon-optional\"),Rt=o.aN(D,\"text-overlap\",\"text-allow-overlap\"),Ut=Rt===\"always\",Gt=o.aN(D,\"icon-overlap\",\"icon-allow-overlap\"),zt=Gt===\"always\",jt=D.get(\"text-rotation-alignment\")===\"map\",Wt=D.get(\"text-pitch-alignment\")===\"map\",It=D.get(\"icon-text-fit\")!==\"none\",Xt=D.get(\"symbol-z-order\")===\"viewport-y\",Kt=Ut&&(zt||!S.hasIconData()||Ct),de=zt&&(Ut||!S.hasTextData()||Pt);!S.collisionArrays&&ut&&S.deserializeCollisionBoxes(ut);let le=this.retainedQueryData[S.bucketInstanceId].tileID,me=this._getTerrainElevationFunc(le),Le=this.transform.getFastPathSimpleProjectionMatrix(le),$e=(Ee,sr,ur)=>{var ji,Me;if(f[Ee.crossTileID])return;if(ct)return void(this.placements[Ee.crossTileID]=new n2(!1,!1,!1));let Re=!1,wn=!1,fn=!0,oo=null,en={box:null,placeable:!1,offscreen:null,occluded:!1},so={placeable:!1},pn=null,Do=null,ao=null,y=0,_=0,x=0;sr.textFeatureIndex?y=sr.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(y=Ee.featureIndex),sr.verticalTextFeatureIndex&&(_=sr.verticalTextFeatureIndex);let E=sr.textBox;if(E){let $=xt=>{let kt=o.aw.horizontal;if(S.allowVerticalPlacement&&!xt&&this.prevPlacement){let Ot=this.prevPlacement.placedOrientations[Ee.crossTileID];Ot&&(this.placedOrientations[Ee.crossTileID]=Ot,kt=Ot,this.markUsedOrientation(S,kt,Ee))}return kt},Z=(xt,kt)=>{if(S.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&sr.verticalTextBox){for(let Ot of S.writingModes)if(Ot===o.aw.vertical?(en=kt(),so=en):en=xt(),en&&en.placeable)break}else en=xt()},ot=Ee.textAnchorOffsetStartIndex,ht=Ee.textAnchorOffsetEndIndex;if(ht===ot){let xt=(kt,Ot)=>{let Dt=this.collisionIndex.placeCollisionBox(kt,Rt,it,le,q,Wt,jt,N,yt.predicate,me,void 0,Le);return Dt&&Dt.placeable&&(this.markUsedOrientation(S,Ot,Ee),this.placedOrientations[Ee.crossTileID]=Ot),Dt};Z((()=>xt(E,o.aw.horizontal)),(()=>{let kt=sr.verticalTextBox;return S.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&kt?xt(kt,o.aw.vertical):{box:null,offscreen:null}})),$(en&&en.placeable)}else{let xt=o.aM[(Me=(ji=this.prevPlacement)===null||ji===void 0?void 0:ji.variableOffsets[Ee.crossTileID])===null||Me===void 0?void 0:Me.anchor],kt=(Dt,Zt,re)=>{let ye=Dt.x2-Dt.x1,se=Dt.y2-Dt.y1,ae=Ee.textBoxScale,Jt=It&&Gt===\"never\"?Zt:null,Ve=null,br=Rt===\"never\"?1:2,cr=\"never\";xt&&br++;for(let Or=0;Or<br;Or++){for(let Yr=ot;Yr<ht;Yr++){let vi=S.textAnchorOffsets.get(Yr);if(xt&&vi.textAnchor!==xt)continue;let Dr=this.attemptAnchorPlacement(vi,Dt,ye,se,ae,jt,Wt,it,le,q,yt,cr,Ee,S,re,N,G,Jt,me);if(Dr&&(Ve=Dr.placedGlyphBoxes,Ve&&Ve.placeable))return Re=!0,oo=Dr.shift,Ve}xt?xt=null:cr=Rt}return b&&!Ve&&(Ve={box:this.collisionIndex.placeCollisionBox(E,\"always\",it,le,q,Wt,jt,N,yt.predicate,me,void 0,Le).box,offscreen:!1,placeable:!1,occluded:!1}),Ve};Z((()=>kt(E,sr.iconBox,o.aw.horizontal)),(()=>{let Dt=sr.verticalTextBox;return S.allowVerticalPlacement&&(!en||!en.placeable)&&Ee.numVerticalGlyphVertices>0&&Dt?kt(Dt,sr.verticalIconBox,o.aw.vertical):{box:null,occluded:!0,offscreen:null}})),en&&(Re=en.placeable,fn=en.offscreen);let Ot=$(en&&en.placeable);if(!Re&&this.prevPlacement){let Dt=this.prevPlacement.variableOffsets[Ee.crossTileID];Dt&&(this.variableOffsets[Ee.crossTileID]=Dt,this.markUsedJustification(S,Dt.anchor,Ee,Ot))}}}if(pn=en,Re=pn&&pn.placeable,fn=pn&&pn.offscreen,Ee.useRuntimeCollisionCircles&&Ee.centerJustifiedTextSymbolIndex>=0){let $=S.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex),Z=o.ax(S.textSizeData,gt,$),ot=D.get(\"text-padding\");Do=this.collisionIndex.placeCollisionCircles(Rt,$,S.lineVertexArray,S.glyphOffsetArray,Z,q,K,b,Wt,yt.predicate,Ee.collisionCircleDiameter,ot,N,me),Do.circles.length&&Do.collisionDetected&&!b&&o.w(\"Collisions detected, but collision boxes are not shown\"),Re=Ut||Do.circles.length>0&&!Do.collisionDetected,fn=fn&&Do.offscreen}if(sr.iconFeatureIndex&&(x=sr.iconFeatureIndex),sr.iconBox){let $=Z=>this.collisionIndex.placeCollisionBox(Z,Gt,it,le,q,Wt,jt,G,yt.predicate,me,It&&oo?oo:void 0,Le);so&&so.placeable&&sr.verticalIconBox?(ao=$(sr.verticalIconBox),wn=ao.placeable):(ao=$(sr.iconBox),wn=ao.placeable),fn=fn&&ao.offscreen}let k=Pt||Ee.numHorizontalGlyphVertices===0&&Ee.numVerticalGlyphVertices===0,B=Ct||Ee.numIconVertices===0;k||B?B?k||(wn=wn&&Re):Re=wn&&Re:wn=Re=wn&&Re;let U=wn&&ao.placeable;if(Re&&pn.placeable&&this.collisionIndex.insertCollisionBox(pn.box,Rt,D.get(\"text-ignore-placement\"),S.bucketInstanceId,so&&so.placeable&&_?_:y,yt.ID),U&&this.collisionIndex.insertCollisionBox(ao.box,Gt,D.get(\"icon-ignore-placement\"),S.bucketInstanceId,x,yt.ID),Do&&Re&&this.collisionIndex.insertCollisionCircles(Do.circles,Rt,D.get(\"text-ignore-placement\"),S.bucketInstanceId,y,yt.ID),b&&this.storeCollisionData(S.bucketInstanceId,ur,sr,pn,ao,Do),Ee.crossTileID===0)throw new Error(\"symbolInstance.crossTileID can't be 0\");if(S.bucketInstanceId===0)throw new Error(\"bucket.bucketInstanceId can't be 0\");this.placements[Ee.crossTileID]=new n2((Re||Kt)&&!pn?.occluded,(wn||de)&&!ao?.occluded,fn||S.justReloaded),f[Ee.crossTileID]=!0};if(Xt){if(c.symbolInstanceStart!==0)throw new Error(\"bucket.bucketInstanceId should be 0\");let Ee=S.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let sr=Ee.length-1;sr>=0;--sr){let ur=Ee[sr];$e(S.symbolInstances.get(ur),S.collisionArrays[ur],ur)}}else for(let Ee=c.symbolInstanceStart;Ee<c.symbolInstanceEnd;Ee++)$e(S.symbolInstances.get(Ee),S.collisionArrays[Ee],Ee);S.justReloaded=!1}storeCollisionData(c,f,b,S,D,N){if(b.textBox||b.iconBox){let G,q;this.collisionBoxArrays.has(c)?G=this.collisionBoxArrays.get(c):(G=new Map,this.collisionBoxArrays.set(c,G)),G.has(f)?q=G.get(f):(q={text:null,icon:null},G.set(f,q)),b.textBox&&(q.text=S.box),b.iconBox&&(q.icon=D.box)}if(N){let G=this.collisionCircleArrays[c];G===void 0&&(G=this.collisionCircleArrays[c]=[]);for(let q=0;q<N.circles.length;q+=4)G.push(N.circles[q+0]-Zo),G.push(N.circles[q+1]-Zo),G.push(N.circles[q+2]),G.push(N.collisionDetected?1:0)}}markUsedJustification(c,f,b,S){let D;D=S===o.aw.vertical?b.verticalPlacedTextSymbolIndex:{left:b.leftJustifiedTextSymbolIndex,center:b.centerJustifiedTextSymbolIndex,right:b.rightJustifiedTextSymbolIndex}[o.aO(f)];let N=[b.leftJustifiedTextSymbolIndex,b.centerJustifiedTextSymbolIndex,b.rightJustifiedTextSymbolIndex,b.verticalPlacedTextSymbolIndex];for(let G of N)G>=0&&(c.text.placedSymbolArray.get(G).crossTileID=D>=0&&G!==D?0:b.crossTileID)}markUsedOrientation(c,f,b){let S=f===o.aw.horizontal||f===o.aw.horizontalOnly?f:0,D=f===o.aw.vertical?f:0,N=[b.leftJustifiedTextSymbolIndex,b.centerJustifiedTextSymbolIndex,b.rightJustifiedTextSymbolIndex];for(let G of N)c.text.placedSymbolArray.get(G).placedOrientation=S;b.verticalPlacedTextSymbolIndex&&(c.text.placedSymbolArray.get(b.verticalPlacedTextSymbolIndex).placedOrientation=D)}commit(c){this.commitTime=c,this.zoomAtLastRecencyCheck=this.transform.zoom;let f=this.prevPlacement,b=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;let S=f?f.symbolFadeChange(c):1,D=f?f.opacities:{},N=f?f.variableOffsets:{},G=f?f.placedOrientations:{};for(let q in this.placements){let K=this.placements[q],it=D[q];it?(this.opacities[q]=new Lp(it,S,K.text,K.icon),b=b||K.text!==it.text.placed||K.icon!==it.icon.placed):(this.opacities[q]=new Lp(null,S,K.text,K.icon,K.skipFade),b=b||K.text||K.icon)}for(let q in D){let K=D[q];if(!this.opacities[q]){let it=new Lp(K,S,!1,!1);it.isHidden()||(this.opacities[q]=it,b=b||K.text.placed||K.icon.placed)}}for(let q in N)this.variableOffsets[q]||!this.opacities[q]||this.opacities[q].isHidden()||(this.variableOffsets[q]=N[q]);for(let q in G)this.placedOrientations[q]||!this.opacities[q]||this.opacities[q].isHidden()||(this.placedOrientations[q]=G[q]);if(f&&f.lastPlacementChangeTime===void 0)throw new Error(\"Last placement time for previous placement is not defined\");b?this.lastPlacementChangeTime=c:typeof this.lastPlacementChangeTime!=\"number\"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:c)}updateLayerOpacities(c,f){let b={};for(let S of f){let D=S.getBucket(c);D&&S.latestFeatureIndex&&c.id===D.layerIds[0]&&this.updateBucketOpacities(D,S.tileID,b,S.collisionBoxArray)}}updateBucketOpacities(c,f,b,S){c.hasTextData()&&(c.text.opacityVertexArray.clear(),c.text.hasVisibleVertices=!1),c.hasIconData()&&(c.icon.opacityVertexArray.clear(),c.icon.hasVisibleVertices=!1),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexArray.clear(),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexArray.clear();let D=c.layers[0],N=D.layout,G=new Lp(null,0,!1,!1,!0),q=N.get(\"text-allow-overlap\"),K=N.get(\"icon-allow-overlap\"),it=D._unevaluatedLayout.hasValue(\"text-variable-anchor\")||D._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"),ct=N.get(\"text-rotation-alignment\")===\"map\",ut=N.get(\"text-pitch-alignment\")===\"map\",gt=N.get(\"icon-text-fit\")!==\"none\",yt=new Lp(null,0,q&&(K||!c.hasIconData()||N.get(\"icon-optional\")),K&&(q||!c.hasTextData()||N.get(\"text-optional\")),!0);!c.collisionArrays&&S&&(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData())&&c.deserializeCollisionBoxes(S);let Pt=(Rt,Ut,Gt)=>{for(let zt=0;zt<Ut/4;zt++)Rt.opacityVertexArray.emplaceBack(Gt);Rt.hasVisibleVertices=Rt.hasVisibleVertices||Gt!==eu},Ct=this.collisionBoxArrays.get(c.bucketInstanceId);for(let Rt=0;Rt<c.symbolInstances.length;Rt++){let Ut=c.symbolInstances.get(Rt),{numHorizontalGlyphVertices:Gt,numVerticalGlyphVertices:zt,crossTileID:jt}=Ut,Wt=this.opacities[jt];b[jt]?Wt=G:Wt||(Wt=yt,this.opacities[jt]=Wt),b[jt]=!0;let It=Ut.numIconVertices>0,Xt=this.placedOrientations[Ut.crossTileID],Kt=Xt===o.aw.vertical,de=Xt===o.aw.horizontal||Xt===o.aw.horizontalOnly;if(Gt>0||zt>0){let me=z_(Wt.text);Pt(c.text,Gt,Kt?eu:me),Pt(c.text,zt,de?eu:me);let Le=Wt.text.isHidden();[Ut.rightJustifiedTextSymbolIndex,Ut.centerJustifiedTextSymbolIndex,Ut.leftJustifiedTextSymbolIndex].forEach((sr=>{sr>=0&&(c.text.placedSymbolArray.get(sr).hidden=Le||Kt?1:0)})),Ut.verticalPlacedTextSymbolIndex>=0&&(c.text.placedSymbolArray.get(Ut.verticalPlacedTextSymbolIndex).hidden=Le||de?1:0);let $e=this.variableOffsets[Ut.crossTileID];$e&&this.markUsedJustification(c,$e.anchor,Ut,Xt);let Ee=this.placedOrientations[Ut.crossTileID];Ee&&(this.markUsedJustification(c,\"left\",Ut,Ee),this.markUsedOrientation(c,Ee,Ut))}if(It){let me=z_(Wt.icon),Le=!(gt&&Ut.verticalPlacedIconSymbolIndex&&Kt);Ut.placedIconSymbolIndex>=0&&(Pt(c.icon,Ut.numIconVertices,Le?me:eu),c.icon.placedSymbolArray.get(Ut.placedIconSymbolIndex).hidden=Wt.icon.isHidden()),Ut.verticalPlacedIconSymbolIndex>=0&&(Pt(c.icon,Ut.numVerticalIconVertices,Le?eu:me),c.icon.placedSymbolArray.get(Ut.verticalPlacedIconSymbolIndex).hidden=Wt.icon.isHidden())}let le=Ct&&Ct.has(Rt)?Ct.get(Rt):{text:null,icon:null};if(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData()){let me=c.collisionArrays[Rt];if(me){let Le=new o.P(0,0);if(me.textBox||me.verticalTextBox){let $e=!0;if(it){let Ee=this.variableOffsets[jt];Ee?(Le=L_(Ee.anchor,Ee.width,Ee.height,Ee.textOffset,Ee.textBoxScale),ct&&Le._rotate(ut?-this.transform.bearingInRadians:this.transform.bearingInRadians)):$e=!1}if(me.textBox||me.verticalTextBox){let Ee;me.textBox&&(Ee=Kt),me.verticalTextBox&&(Ee=de),GA(c.textCollisionBox.collisionVertexArray,Wt.text.placed,!$e||Ee,le.text,Le.x,Le.y)}}if(me.iconBox||me.verticalIconBox){let $e=!!(!de&&me.verticalIconBox),Ee;me.iconBox&&(Ee=$e),me.verticalIconBox&&(Ee=!$e),GA(c.iconCollisionBox.collisionVertexArray,Wt.icon.placed,Ee,le.icon,gt?Le.x:0,gt?Le.y:0)}}}}if(c.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[c.bucketInstanceId]&&(this.retainedQueryData[c.bucketInstanceId].featureSortOrder=c.featureSortOrder),c.hasTextData()&&c.text.opacityVertexBuffer&&c.text.opacityVertexBuffer.updateData(c.text.opacityVertexArray),c.hasIconData()&&c.icon.opacityVertexBuffer&&c.icon.opacityVertexBuffer.updateData(c.icon.opacityVertexArray),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexBuffer&&c.iconCollisionBox.collisionVertexBuffer.updateData(c.iconCollisionBox.collisionVertexArray),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexBuffer&&c.textCollisionBox.collisionVertexBuffer.updateData(c.textCollisionBox.collisionVertexArray),c.text.opacityVertexArray.length!==c.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${c.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${c.text.layoutVertexArray.length}) / 4`);if(c.icon.opacityVertexArray.length!==c.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${c.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${c.icon.layoutVertexArray.length}) / 4`);c.bucketInstanceId in this.collisionCircleArrays&&(c.collisionCircleArray=this.collisionCircleArrays[c.bucketInstanceId],delete this.collisionCircleArrays[c.bucketInstanceId])}symbolFadeChange(c){return this.fadeDuration===0?1:(c-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(c){return Math.max(0,(this.transform.zoom-c)/1.5)}hasTransitions(c){return this.stale||c-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(c,f){let b=this.zoomAtLastRecencyCheck===f?1-this.zoomAdjustment(f):1;return this.zoomAtLastRecencyCheck=f,this.commitTime+this.fadeDuration*b>c}setStale(){this.stale=!0}}function GA(I,c,f,b,S,D){b&&b.length!==0||(b=[0,0,0,0]);let N=b[0]-Zo,G=b[1]-Zo,q=b[2]-Zo,K=b[3]-Zo;I.emplaceBack(c?1:0,f?1:0,S||0,D||0,N,G),I.emplaceBack(c?1:0,f?1:0,S||0,D||0,q,G),I.emplaceBack(c?1:0,f?1:0,S||0,D||0,q,K),I.emplaceBack(c?1:0,f?1:0,S||0,D||0,N,K)}let B_=Math.pow(2,25),s2=Math.pow(2,24),F_=Math.pow(2,17),N_=Math.pow(2,16),xM=Math.pow(2,9),xm=Math.pow(2,8),WA=Math.pow(2,1);function z_(I){if(I.opacity===0&&!I.placed)return 0;if(I.opacity===1&&I.placed)return 4294967295;let c=I.placed?1:0,f=Math.floor(127*I.opacity);return f*B_+c*s2+f*F_+c*N_+f*xM+c*xm+f*WA+c}let eu=0;class a2{constructor(c){this._sortAcrossTiles=c.layout.get(\"symbol-z-order\")!==\"viewport-y\"&&!c.layout.get(\"symbol-sort-key\").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(c,f,b,S,D){let N=this._bucketParts;for(;this._currentTileIndex<c.length;)if(f.getBucketParts(N,S,c[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,D())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,N.sort(((G,q)=>G.sortKey-q.sortKey)));this._currentPartIndex<N.length;)if(f.placeLayerBucketPart(N[this._currentPartIndex],this._seenCrossTileIDs,b),this._currentPartIndex++,D())return!0;return!1}}class wM{constructor(c,f,b,S,D,N,G,q){this.placement=new o2(c,f,N,G,q),this._currentPlacementIndex=b.length-1,this._forceFullPlacement=S,this._showCollisionBoxes=D,this._done=!1}isDone(){return this._done}continuePlacement(c,f,b){let S=R(),D=()=>!this._forceFullPlacement&&R()-S>2;for(;this._currentPlacementIndex>=0;){let N=f[c[this._currentPlacementIndex]],G=this.placement.collisionIndex.transform.zoom;if(o.aQ(N)&&N.layout&&(!N.minzoom||N.minzoom<=G)&&(!N.maxzoom||N.maxzoom>G)){if(this._inProgressLayer||(this._inProgressLayer=new a2(N)),this._inProgressLayer.continuePlacement(b[N.source],this.placement,this._showCollisionBoxes,N,D))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(c){return this.placement.commit(c),this.placement}}let Gl=512/o.a5/2;class Bp{constructor(c,f,b){this.tileID=c,this.bucketInstanceId=b,this._symbolsByKey={};let S=new Map;for(let D=0;D<f.length;D++){let N=f.get(D),G=N.key,q=S.get(G);q?q.push(N):S.set(G,[N])}for(let[D,N]of S){let G={positions:N.map((q=>({x:Math.floor(q.anchorX*Gl),y:Math.floor(q.anchorY*Gl)}))),crossTileIDs:N.map((q=>q.crossTileID))};if(G.positions.length>128){let q=new o.aR(G.positions.length,16,Uint16Array);for(let{x:K,y:it}of G.positions)q.add(K,it);q.finish(),delete G.positions,G.index=q}this._symbolsByKey[D]=G}}getScaledCoordinates(c,f){let{x:b,y:S,z:D}=this.tileID.canonical,{x:N,y:G,z:q}=f.canonical,K=Gl/Math.pow(2,q-D),it=(G*o.a5+c.anchorY)*K,ct=S*o.a5*Gl;return{x:Math.floor((N*o.a5+c.anchorX)*K-b*o.a5*Gl),y:Math.floor(it-ct)}}findMatches(c,f,b){let S=this.tileID.canonical.z<f.canonical.z?1:Math.pow(2,this.tileID.canonical.z-f.canonical.z);for(let D=0;D<c.length;D++){let N=c.get(D);if(N.crossTileID)continue;let G=this._symbolsByKey[N.key];if(!G)continue;let q=this.getScaledCoordinates(N,f);if(G.index){let K=G.index.range(q.x-S,q.y-S,q.x+S,q.y+S).sort();for(let it of K){let ct=G.crossTileIDs[it];if(!b[ct]){b[ct]=!0,N.crossTileID=ct;break}}}else if(G.positions)for(let K=0;K<G.positions.length;K++){let it=G.positions[K],ct=G.crossTileIDs[K];if(Math.abs(it.x-q.x)<=S&&Math.abs(it.y-q.y)<=S&&!b[ct]){b[ct]=!0,N.crossTileID=ct;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:c})=>c))}}class Mi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class U_{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(c){let f=Math.round((c-this.lng)/360);if(f!==0)for(let b in this.indexes){let S=this.indexes[b],D={};for(let N in S){let G=S[N];G.tileID=G.tileID.unwrapTo(G.tileID.wrap+f),D[G.tileID.key]=G}this.indexes[b]=D}this.lng=c}addBucket(c,f,b){if(this.indexes[c.overscaledZ]&&this.indexes[c.overscaledZ][c.key]){if(this.indexes[c.overscaledZ][c.key].bucketInstanceId===f.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(c.overscaledZ,this.indexes[c.overscaledZ][c.key])}for(let D=0;D<f.symbolInstances.length;D++)f.symbolInstances.get(D).crossTileID=0;this.usedCrossTileIDs[c.overscaledZ]||(this.usedCrossTileIDs[c.overscaledZ]={});let S=this.usedCrossTileIDs[c.overscaledZ];for(let D in this.indexes){let N=this.indexes[D];if(Number(D)>c.overscaledZ)for(let G in N){let q=N[G];q.tileID.isChildOf(c)&&q.findMatches(f.symbolInstances,c,S)}else{let G=N[c.scaledTo(Number(D)).key];G&&G.findMatches(f.symbolInstances,c,S)}}for(let D=0;D<f.symbolInstances.length;D++){let N=f.symbolInstances.get(D);N.crossTileID||(N.crossTileID=b.generate(),S[N.crossTileID]=!0)}return this.indexes[c.overscaledZ]===void 0&&(this.indexes[c.overscaledZ]={}),this.indexes[c.overscaledZ][c.key]=new Bp(c,f.symbolInstances,f.bucketInstanceId),!0}removeBucketCrossTileIDs(c,f){for(let b of f.getCrossTileIDsLists())for(let S of b)delete this.usedCrossTileIDs[c][S]}removeStaleBuckets(c){let f=!1;for(let b in this.indexes){let S=this.indexes[b];for(let D in S)c[S[D].bucketInstanceId]||(this.removeBucketCrossTileIDs(b,S[D]),delete S[D],f=!0)}return f}}class l2{constructor(){this.layerIndexes={},this.crossTileIDs=new Mi,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(c,f,b){let S=this.layerIndexes[c.id];S===void 0&&(S=this.layerIndexes[c.id]=new U_);let D=!1,N={};S.handleWrapJump(b);for(let G of f){let q=G.getBucket(c);q&&c.id===q.layerIds[0]&&(q.bucketInstanceId||(q.bucketInstanceId=++this.maxBucketInstanceId),S.addBucket(G.tileID,q,this.crossTileIDs)&&(D=!0),N[q.bucketInstanceId]=!0)}return S.removeStaleBuckets(N)&&(D=!0),D}pruneUnusedLayers(c){let f={};c.forEach((b=>{f[b]=!0}));for(let b in this.layerIndexes)f[b]||delete this.layerIndexes[b]}}var qA=\"void main() {fragColor=vec4(1.0);}\";let yo={prelude:Fr(`#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;`,`#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c\n);}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Fr(\"\",\"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}\"),projectionGlobe:Fr(\"\",`#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Fr(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,\"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}\"),backgroundPattern:Fr(`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;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,\"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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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:Fr(`in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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:Fr(qA,\"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}\"),heatmap:Fr(`uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.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;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}`),heatmapTexture:Fr(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out 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:Fr(\"in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}\",\"in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;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:Fr(\"in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}\",\"in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}\"),colorRelief:Fr(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,\"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}\"),debug:Fr(\"uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}\",\"in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}\"),depth:Fr(qA,`in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}`),fill:Fr(`#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Fr(`in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}`),fillOutlinePattern:Fr(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}`),fillPattern:Fr(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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:Fr(`in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:Fr(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*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:Fr(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:Fr(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}\"),line:Fr(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}`),lineGradient:Fr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}`),linePattern:Fr(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Fr(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat 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=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Fr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat 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=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat 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;float texel_height=1.0/u_image_height;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:Fr(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Fr(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_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;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 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:Fr(`#define SDF_PX 8.0\nuniform 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;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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=texture(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);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_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;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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/16.0;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,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:Fr(`#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}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=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_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;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 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:Fr(\"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;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in 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=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && 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);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}\",\"in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out 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=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}\"),terrainDepth:Fr(\"in 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() {fragColor=pack(v_depth);}\",\"in vec3 a_pos3d;uniform float u_ele_delta;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}\"),terrainCoords:Fr(\"precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}\",\"in vec3 a_pos3d;uniform float u_ele_delta;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}\"),projectionErrorMeasurement:Fr(\"in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}\",\"in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}\"),atmosphere:Fr(`#ifdef GL_ES\nprecision highp float;\n#endif\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,\"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}\"),sky:Fr(\"uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}\",\"in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}\")};function Fr(I,c){let f=/#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g,b=c.match(/in ([\\w]+) ([\\w]+)/g),S=I.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g),D=c.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g),N=D?D.concat(S):S,G={};return{fragmentSource:I=I.replace(f,((q,K,it,ct,ut)=>(G[ut]=!0,K===\"define\"?`\n#ifndef HAS_UNIFORM_u_${ut}\nin ${it} ${ct} ${ut};\n#else\nuniform ${it} ${ct} u_${ut};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${ut}\n    ${it} ${ct} ${ut} = u_${ut};\n#endif\n`))),vertexSource:c=c.replace(f,((q,K,it,ct,ut)=>{let gt=ct===\"float\"?\"vec2\":\"vec4\",yt=ut.match(/color/)?\"color\":gt;return G[ut]?K===\"define\"?`\n#ifndef HAS_UNIFORM_u_${ut}\nuniform lowp float u_${ut}_t;\nin ${it} ${gt} a_${ut};\nout ${it} ${ct} ${ut};\n#else\nuniform ${it} ${ct} u_${ut};\n#endif\n`:yt===\"vec4\"?`\n#ifndef HAS_UNIFORM_u_${ut}\n    ${ut} = a_${ut};\n#else\n    ${it} ${ct} ${ut} = u_${ut};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${ut}\n    ${ut} = unpack_mix_${yt}(a_${ut}, u_${ut}_t);\n#else\n    ${it} ${ct} ${ut} = u_${ut};\n#endif\n`:K===\"define\"?`\n#ifndef HAS_UNIFORM_u_${ut}\nuniform lowp float u_${ut}_t;\nin ${it} ${gt} a_${ut};\n#else\nuniform ${it} ${ct} u_${ut};\n#endif\n`:yt===\"vec4\"?`\n#ifndef HAS_UNIFORM_u_${ut}\n    ${it} ${ct} ${ut} = a_${ut};\n#else\n    ${it} ${ct} ${ut} = u_${ut};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${ut}\n    ${it} ${ct} ${ut} = unpack_mix_${yt}(a_${ut}, u_${ut}_t);\n#else\n    ${it} ${ct} ${ut} = u_${ut};\n#endif\n`})),staticAttributes:b,staticUniforms:N}}class jo{constructor(c,f,b){this.vertexBuffer=c,this.indexBuffer=f,this.segments=b}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Hn=o.aS([{name:\"a_pos\",type:\"Int16\",components:2}]);let Yn=\"#define PROJECTION_MERCATOR\",c2=\"mercator\";class ta{constructor(){this._cachedMesh=null}get name(){return\"mercator\"}get useSubdivision(){return!1}get shaderVariantName(){return c2}get shaderDefine(){return Yn}get shaderPreludeCode(){return yo.projectionMercator}get vertexShaderPreludeCode(){return yo.projectionMercator.vertexSource}get subdivisionGranularity(){return o.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(c){}getMeshFromTileID(c,f,b,S,D){if(this._cachedMesh)return this._cachedMesh;let N=new o.aU;N.emplaceBack(0,0),N.emplaceBack(o.a5,0),N.emplaceBack(0,o.a5),N.emplaceBack(o.a5,o.a5);let G=c.createVertexBuffer(N,Hn.members),q=o.aV.simpleSegment(0,0,4,2),K=new o.aW;K.emplaceBack(1,0,2),K.emplaceBack(1,2,3);let it=c.createIndexBuffer(K);return this._cachedMesh=new jo(G,it,q),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(c){}}class ea{constructor(c=0,f=0,b=0,S=0){if(isNaN(c)||c<0||isNaN(f)||f<0||isNaN(b)||b<0||isNaN(S)||S<0)throw new Error(\"Invalid value for edge-insets, top, bottom, left and right must all be numbers\");this.top=c,this.bottom=f,this.left=b,this.right=S}interpolate(c,f,b){return f.top!=null&&c.top!=null&&(this.top=o.G.number(c.top,f.top,b)),f.bottom!=null&&c.bottom!=null&&(this.bottom=o.G.number(c.bottom,f.bottom,b)),f.left!=null&&c.left!=null&&(this.left=o.G.number(c.left,f.left,b)),f.right!=null&&c.right!=null&&(this.right=o.G.number(c.right,f.right,b)),this}getCenter(c,f){let b=o.ak((this.left+c-this.right)/2,0,c),S=o.ak((this.top+f-this.bottom)/2,0,f);return new o.P(b,S)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new ea(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ra(I,c){if(!I.renderWorldCopies||I.lngRange)return;let f=c.lng-I.center.lng;c.lng+=f>180?-360:f<-180?360:0}function V_(I){return Math.max(0,Math.floor(I))}class df{constructor(c,f){var b;this.applyConstrain=(S,D)=>this._constrainOverride!==null?this._constrainOverride(S,D):this._callbacks.defaultConstrain(S,D),this._callbacks=c,this._tileSize=512,this._renderWorldCopies=f?.renderWorldCopies===void 0||!!f?.renderWorldCopies,this._minZoom=f?.minZoom||0,this._maxZoom=f?.maxZoom||22,this._minPitch=f?.minPitch==null?0:f?.minPitch,this._maxPitch=f?.maxPitch==null?60:f?.maxPitch,this._constrainOverride=(b=f?.constrainOverride)!==null&&b!==void 0?b:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new o.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=V_(this._zoom),this._scale=o.an(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new ea,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(c,f,b){this._constrainOverride=c.constrainOverride,this._latRange=c.latRange,this._lngRange=c.lngRange,this._width=c.width,this._height=c.height,this._center=c.center,this._elevation=c.elevation,this._minElevationForCurrentTile=c.minElevationForCurrentTile,this._zoom=c.zoom,this._tileZoom=V_(this._zoom),this._scale=o.an(this._zoom),this._bearingInRadians=c.bearingInRadians,this._fovInRadians=c.fovInRadians,this._pitchInRadians=c.pitchInRadians,this._rollInRadians=c.rollInRadians,this._unmodified=c.unmodified,this._edgeInsets=new ea(c.padding.top,c.padding.bottom,c.padding.left,c.padding.right),this._minZoom=c.minZoom,this._maxZoom=c.maxZoom,this._minPitch=c.minPitch,this._maxPitch=c.maxPitch,this._renderWorldCopies=c.renderWorldCopies,this._cameraToCenterDistance=c.cameraToCenterDistance,this._nearZ=c.nearZ,this._farZ=c.farZ,this._autoCalculateNearFarZ=!b&&c.autoCalculateNearFarZ,f&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(c){this._minElevationForCurrentTile=c}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(c){this._minZoom!==c&&(this._minZoom=c,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(c){this._minPitch!==c&&(this._minPitch=c,this.setPitch(Math.max(this.pitch,c)))}get maxPitch(){return this._maxPitch}setMaxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.setPitch(Math.min(this.pitch,c)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get constrainOverride(){return this._constrainOverride}setConstrainOverride(c){c===void 0&&(c=null),this._constrainOverride!==c&&(this._constrainOverride=c,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(c){let f=o.W(c,-180,180)*Math.PI/180;var b,S,D,N,G,q,K,it,ct;this._bearingInRadians!==f&&(this._unmodified=!1,this._bearingInRadians=f,this._calcMatrices(),this._rotationMatrix=a(),b=this._rotationMatrix,D=-this._bearingInRadians,N=(S=this._rotationMatrix)[0],G=S[1],q=S[2],K=S[3],it=Math.sin(D),ct=Math.cos(D),b[0]=N*ct+q*it,b[1]=G*ct+K*it,b[2]=N*-it+q*ct,b[3]=G*-it+K*ct)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(c){let f=o.ak(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==f&&(this._unmodified=!1,this._pitchInRadians=f,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(c){let f=c/180*Math.PI;this._rollInRadians!==f&&(this._unmodified=!1,this._rollInRadians=f,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return o.aX(this._fovInRadians)}setFov(c){c=o.ak(c,.1,150),this.fov!==c&&(this._unmodified=!1,this._fovInRadians=o.am(c),this._calcMatrices())}get zoom(){return this._zoom}setZoom(c){let f=this.applyConstrain(this._center,c).zoom;this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this._tileZoom=Math.max(0,Math.floor(f)),this._scale=o.an(f),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(c){c!==this._elevation&&(this._elevation=c,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(c,f){this._autoCalculateNearFarZ=!1,this._nearZ=c,this._farZ=f,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,f,b){this._unmodified=!1,this._edgeInsets.interpolate(c,f,b),this.constrainInternal(),this._calcMatrices()}resize(c,f,b=!0){this._width=c,this._height=f,b&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new wr([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(c){c?(this._lngRange=[c.getWest(),c.getEast()],this._latRange=[c.getSouth(),c.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-o.al,o.al])}getCameraQueryGeometry(c,f){if(f.length===1)return[f[0],c];{let{minX:b,minY:S,maxX:D,maxY:N}=o.a7.fromPoints(f).extend(c);return[new o.P(b,S),new o.P(D,S),new o.P(D,N),new o.P(b,N),new o.P(b,S)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let c=this._unmodified,{center:f,zoom:b}=this.applyConstrain(this.center,this.zoom);this.setCenter(f),this.setZoom(b),this._unmodified=c,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let c=o.ao(new Float64Array(16));o.Q(c,c,[this._width/2,-this._height/2,1]),o.O(c,c,[1,-1,0]),this._clipSpaceToPixelsMatrix=c,c=o.ao(new Float64Array(16)),o.Q(c,c,[1,-1,1]),o.O(c,c,[-1,-1,0]),o.Q(c,c,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=c,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(c,f,b,S){let D=b!==void 0?b:this.bearing,N=S=S!==void 0?S:this.pitch,{distanceToCenter:G,clampedElevation:q}=this._distanceToCenterFromAltElevationPitch(f,this.elevation,N),{x:K,y:it}=ym(N,D),ct=o.a6.fromLngLat(c,f),ut,gt,yt=o.aY(1,ct.y),Pt=0;do{if(Pt+=1,Pt>10)break;gt=G/yt,ut=new o.a6(ct.x+K*gt,ct.y+it*gt),yt=1/ut.meterInMercatorCoordinateUnits()}while(Math.abs(G-gt*yt)>1e-12);return{center:ut.toLngLat(),elevation:q,zoom:o.aq(this.height/2/Math.tan(this.fovInRadians/2)/gt/this.tileSize)}}recalculateZoomAndCenter(c){if(this.elevation-c==0)return;let f=1/this.worldSize,b=o.ap(1,this.center.lat)*this.worldSize,S=o.a6.fromLngLat(this.center,this.elevation),D=S.x/f,N=S.y/f,G=S.z/f,q=this.pitch,K=this.bearing,{x:it,y:ct,z:ut}=ym(q,K),gt=this.cameraToCenterDistance,yt=D+gt*-it,Pt=N+gt*-ct,Ct=G+gt*ut,{distanceToCenter:Rt,clampedElevation:Ut}=this._distanceToCenterFromAltElevationPitch(Ct/b,c,q),Gt=Rt*b,zt=new o.a6((yt+it*Gt)*f,(Pt+ct*Gt)*f,0).toLngLat(),jt=o.ap(1,zt.lat),Wt=o.aq(this.height/2/Math.tan(this.fovInRadians/2)/Rt/jt/this.tileSize);this._elevation=Ut,this._center=zt,this.setZoom(Wt)}_distanceToCenterFromAltElevationPitch(c,f,b){let S=-Math.cos(o.am(b)),D=c-f,N,G=f;return S*D>=0||Math.abs(S)<.1?(N=1e4,G=c+N*S):N=-D/S,{distanceToCenter:N,clampedElevation:G}}getCameraPoint(){let c=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.P(c*Math.sin(this.rollInRadians),c*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let c=o.ap(1,this.center.lat)*this.worldSize;return Am(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/c).toLngLat()}getMercatorTileCoordinates(c){if(!c)return[0,0,1,1];let f=c.canonical.z>=0?1<<c.canonical.z:Math.pow(2,c.canonical.z);return[c.canonical.x/f,c.canonical.y/f,1/f/o.a5,1/f/o.a5]}}class Xn{constructor(c,f){this.min=c,this.max=f,this.center=o.aZ([],o.a_([],this.min,this.max),.5)}quadrant(c){let f=[c%2==0,c<2],b=o.a$(this.min),S=o.a$(this.max);for(let D=0;D<f.length;D++)b[D]=f[D]?this.min[D]:this.center[D],S[D]=f[D]?this.center[D]:this.max[D];return S[2]=this.max[2],new Xn(b,S)}distanceX(c){return Math.max(Math.min(this.max[0],c[0]),this.min[0])-c[0]}distanceY(c){return Math.max(Math.min(this.max[1],c[1]),this.min[1])-c[1]}intersectsFrustum(c){let f=!0;for(let b=0;b<c.planes.length;b++){let S=this.intersectsPlane(c.planes[b]);if(S===0)return 0;S===1&&(f=!1)}return f?2:c.aabb.min[0]>this.max[0]||c.aabb.min[1]>this.max[1]||c.aabb.min[2]>this.max[2]||c.aabb.max[0]<this.min[0]||c.aabb.max[1]<this.min[1]||c.aabb.max[2]<this.min[2]?0:1}intersectsPlane(c){let f=c[3],b=c[3];for(let S=0;S<3;S++)c[S]>0?(f+=c[S]*this.min[S],b+=c[S]*this.max[S]):(b+=c[S]*this.min[S],f+=c[S]*this.max[S]);return f>=0?2:b<0?0:1}}class wm{distanceToTile2d(c,f,b,S){let D=S.distanceX([c,f]),N=S.distanceY([c,f]);return Math.hypot(D,N)}getWrap(c,f,b){return b}getTileBoundingVolume(c,f,b,S){var D,N;let G=0,q=0;if(S?.terrain){let it=new o.a2(c.z,f,c.z,c.x,c.y),ct=S.terrain.getMinMaxElevation(it);G=(D=ct.minElevation)!==null&&D!==void 0?D:Math.min(0,b),q=(N=ct.maxElevation)!==null&&N!==void 0?N:Math.max(0,b)}let K=1<<c.z;return new Xn([f+c.x/K,c.y/K,G],[f+(c.x+1)/K,(c.y+1)/K,q])}allowVariableZoom(c,f){let b=c.fov*(Math.abs(Math.cos(c.rollInRadians))*c.height+Math.abs(Math.sin(c.rollInRadians))*c.width)/c.height,S=o.ak(78.5-b/2,0,60);return!!f.terrain||c.pitch>S}allowWorldCopies(){return!0}prepareNextFrame(){}}class ru{constructor(c,f,b){this.points=c,this.planes=f,this.aabb=b}static fromInvProjectionMatrix(c,f=1,b=0,S,D){let N=D?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],G=Math.pow(2,b),q=[[-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((ut=>(function(gt,yt,Pt,Ct){let Rt=o.aE([],gt,yt),Ut=1/Rt[3]/Pt*Ct;return o.b4(Rt,Rt,[Ut,Ut,1/Rt[3],Ut])})(ut,c,f,G)));S&&(function(ut,gt,yt,Pt){let Ct=Pt?4:0,Rt=Pt?0:4,Ut=0,Gt=[],zt=[];for(let It=0;It<4;It++){let Xt=o.b0([],ut[It+Rt],ut[It+Ct]),Kt=o.b5(Xt);o.aZ(Xt,Xt,1/Kt),Gt.push(Kt),zt.push(Xt)}for(let It=0;It<4;It++){let Xt=o.b6(ut[It+Ct],zt[It],yt);Ut=Xt!==null&&Xt>=0?Math.max(Ut,Xt):Math.max(Ut,Gt[It])}let jt=(function(It,Xt){let Kt=o.b0([],It[Xt[0]],It[Xt[1]]),de=o.b0([],It[Xt[2]],It[Xt[1]]),le=[0,0,0,0];return o.b1(le,o.b2([],Kt,de)),le[3]=-o.b3(le,It[Xt[0]]),le})(ut,gt),Wt=(function(It,Xt){let Kt=o.b7(It),de=o.b8([],It,1/Kt),le=o.b0([],Xt,o.aZ([],de,o.b3(Xt,de))),me=o.b7(le);if(me>0){let Le=Math.sqrt(1-de[3]*de[3]),$e=o.aZ([],de,-de[3]),Ee=o.a_([],$e,o.aZ([],le,Le/me));return o.b9(Xt,Ee)}return null})(yt,jt);if(Wt!==null){let It=Wt/o.b3(zt[0],jt);Ut=Math.min(Ut,It)}for(let It=0;It<4;It++){let Xt=Math.min(Ut,Gt[It]);ut[It+Rt]=[ut[It+Ct][0]+zt[It][0]*Xt,ut[It+Ct][1]+zt[It][1]*Xt,ut[It+Ct][2]+zt[It][2]*Xt,1]}})(q,N[0],S,D);let K=N.map((ut=>{let gt=o.b0([],q[ut[0]],q[ut[1]]),yt=o.b0([],q[ut[2]],q[ut[1]]),Pt=o.b1([],o.b2([],gt,yt)),Ct=-o.b3(Pt,q[ut[1]]);return Pt.concat(Ct)})),it=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],ct=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let ut of q)for(let gt=0;gt<3;gt++)it[gt]=Math.min(it[gt],ut[gt]),ct[gt]=Math.max(ct[gt],ut[gt]);return new ru(q,K,new Xn(it,ct))}}class Xu{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(c){this._helper.setMinZoom(c)}setMaxZoom(c){this._helper.setMaxZoom(c)}setMinPitch(c){this._helper.setMinPitch(c)}setMaxPitch(c){this._helper.setMaxPitch(c)}setRenderWorldCopies(c){this._helper.setRenderWorldCopies(c)}setBearing(c){this._helper.setBearing(c)}setPitch(c){this._helper.setPitch(c)}setRoll(c){this._helper.setRoll(c)}setFov(c){this._helper.setFov(c)}setZoom(c){this._helper.setZoom(c)}setCenter(c){this._helper.setCenter(c)}setElevation(c){this._helper.setElevation(c)}setMinElevationForCurrentTile(c){this._helper.setMinElevationForCurrentTile(c)}setPadding(c){this._helper.setPadding(c)}interpolatePadding(c,f,b){return this._helper.interpolatePadding(c,f,b)}isPaddingEqual(c){return this._helper.isPaddingEqual(c)}resize(c,f,b=!0){this._helper.resize(c,f,b)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(c){this._helper.setMaxBounds(c)}setConstrainOverride(c){this._helper.setConstrainOverride(c)}overrideNearFarZ(c,f){this._helper.overrideNearFarZ(c,f)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(c){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),c)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(c,f){}constructor(c){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(f,b)=>{b=o.ak(+b,this.minZoom,this.maxZoom);let S={center:new o.V(f.lng,f.lat),zoom:b},D=this._helper._lngRange;if(!this._helper._renderWorldCopies&&D===null){let zt=179.9999999999;D=[-zt,zt]}let N=this.tileSize*o.an(S.zoom),G=0,q=N,K=0,it=N,ct=0,ut=0,{x:gt,y:yt}=this.size;if(this._helper._latRange){let zt=this._helper._latRange;G=o.X(zt[1])*N,q=o.X(zt[0])*N,q-G<yt&&(ct=yt/(q-G))}D&&(K=o.W(o.Y(D[0])*N,0,N),it=o.W(o.Y(D[1])*N,0,N),it<K&&(it+=N),it-K<gt&&(ut=gt/(it-K)));let{x:Pt,y:Ct}=$l(N,f),Rt,Ut,Gt=Math.max(ut||0,ct||0);if(Gt){let zt=new o.P(ut?(it+K)/2:Pt,ct?(q+G)/2:Ct);return S.center=lf(N,zt).wrap(),S.zoom+=o.aq(Gt),S}if(this._helper._latRange){let zt=yt/2;Ct-zt<G&&(Ut=G+zt),Ct+zt>q&&(Ut=q-zt)}if(D){let zt=(K+it)/2,jt=Pt;this._helper._renderWorldCopies&&(jt=o.W(Pt,zt-N/2,zt+N/2));let Wt=gt/2;jt-Wt<K&&(Rt=K+Wt),jt+Wt>it&&(Rt=it-Wt)}if(Rt!==void 0||Ut!==void 0){let zt=new o.P(Rt??Pt,Ut??Ct);S.center=lf(N,zt).wrap()}return S},this.applyConstrain=(f,b)=>this._helper.applyConstrain(f,b),this._helper=new df({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(f,b)=>this.defaultConstrain(f,b)},c),this._coveringTilesDetailsProvider=new wm}clone(){let c=new Xu;return c.apply(this,!1),c}apply(c,f,b){this._helper.apply(c,f,b)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(c){let f=[new o.ba(0,c)];if(this._helper._renderWorldCopies){let b=this.screenPointToMercatorCoordinate(new o.P(0,0)),S=this.screenPointToMercatorCoordinate(new o.P(this._helper._width,0)),D=this.screenPointToMercatorCoordinate(new o.P(this._helper._width,this._helper._height)),N=this.screenPointToMercatorCoordinate(new o.P(0,this._helper._height)),G=Math.floor(Math.min(b.x,S.x,D.x,N.x)),q=Math.floor(Math.max(b.x,S.x,D.x,N.x)),K=1;for(let it=G-K;it<=q+K;it++)it!==0&&f.push(new o.ba(it,c))}return f}getCameraFrustum(){return ru.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(c){let f=this.screenPointToLocation(this.centerPoint,c),b=c?c.getElevationForLngLatZoom(f,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(b)}setLocationAtPoint(c,f){let b=o.ap(this.elevation,this.center.lat),S=this.screenPointToMercatorCoordinateAtZ(f,b),D=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,b),N=o.a6.fromLngLat(c),G=new o.a6(N.x-(S.x-D.x),N.y-(S.y-D.y));this.setCenter(G?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(c,f){return f?this.coordinatePoint(o.a6.fromLngLat(c),f.getElevationForLngLat(c,this),this._pixelMatrix3D):this.coordinatePoint(o.a6.fromLngLat(c))}screenPointToLocation(c,f){var b;return(b=this.screenPointToMercatorCoordinate(c,f))===null||b===void 0?void 0:b.toLngLat()}screenPointToMercatorCoordinate(c,f){if(f){let b=f.pointCoordinate(c);if(b!=null)return b}return this.screenPointToMercatorCoordinateAtZ(c)}screenPointToMercatorCoordinateAtZ(c,f){let b=f||0,S=[c.x,c.y,0,1],D=[c.x,c.y,1,1];o.aE(S,S,this._pixelMatrixInverse),o.aE(D,D,this._pixelMatrixInverse);let N=S[3],G=D[3],q=S[1]/N,K=D[1]/G,it=S[2]/N,ct=D[2]/G,ut=it===ct?0:(b-it)/(ct-it);return new o.a6(o.G.number(S[0]/N,D[0]/G,ut)/this.worldSize,o.G.number(q,K,ut)/this.worldSize,b)}coordinatePoint(c,f=0,b=this._pixelMatrix){let S=[c.x*this.worldSize,c.y*this.worldSize,f,1];return o.aE(S,S,b),new o.P(S[0]/S[3],S[1]/S[3])}getBounds(){let c=Math.max(0,this._helper._height/2-Yu(this));return new wr().extend(this.screenPointToLocation(new o.P(0,c))).extend(this.screenPointToLocation(new o.P(this._helper._width,c))).extend(this.screenPointToLocation(new o.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new o.P(0,this._helper._height)))}isPointOnMapSurface(c,f){return f?f.pointCoordinate(c)!=null:c.y>this.height/2-Yu(this)}calculatePosMatrix(c,f=!1,b){var S;let D=(S=c.key)!==null&&S!==void 0?S:o.bb(c.wrap,c.canonical.z,c.canonical.z,c.canonical.x,c.canonical.y),N=f?this._alignedPosMatrixCache:this._posMatrixCache;if(N.has(D)){let K=N.get(D);return b?K.f32:K.f64}let G=Ip(c,this.worldSize);o.S(G,f?this._alignedProjMatrix:this._viewProjMatrix,G);let q={f64:G,f32:new Float32Array(G)};return N.set(D,q),b?q.f32:q.f64}calculateFogMatrix(c){let f=c.key,b=this._fogMatrixCacheF32;if(b.has(f))return b.get(f);let S=Ip(c,this.worldSize);return o.S(S,this._fogMatrix,S),b.set(f,new Float32Array(S)),b.get(f)}calculateCenterFromCameraLngLatAlt(c,f,b,S){return this._helper.calculateCenterFromCameraLngLatAlt(c,f,b,S)}_calculateNearFarZIfNeeded(c,f,b){if(!this._helper.autoCalculateNearFarZ)return;let S=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),D=c-S*this._helper._pixelPerMeter/Math.cos(f),N=S<0?D:c,G=Math.PI/2+this.pitchInRadians,q=o.am(this.fov)*(Math.abs(Math.cos(o.am(this.roll)))*this.height+Math.abs(Math.sin(o.am(this.roll)))*this.width)/this.height*(.5+b.y/this.height),K=Math.sin(q)*N/Math.sin(o.ak(Math.PI-G-q,.01,Math.PI-.01)),it=Yu(this),ct=Math.atan(it/this._helper.cameraToCenterDistance),ut=o.am(.75),gt=ct>ut?2*ct*(.5+b.y/(2*it)):ut,yt=Math.sin(gt)*N/Math.sin(o.ak(Math.PI-G-gt,.01,Math.PI-.01)),Pt=Math.min(K,yt);this._helper._farZ=1.01*(Math.cos(Math.PI/2-f)*Pt+N),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let c=this.centerOffset,f=$l(this.worldSize,this.center),b=f.x,S=f.y;this._helper._pixelPerMeter=o.ap(1,this.center.lat)*this.worldSize;let D=o.am(Math.min(this.pitch,Hu)),N=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(D)),G;this._calculateNearFarZIfNeeded(N,D,c),G=new Float64Array(16),o.bc(G,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),o.ay(this._invProjMatrix,G),G[8]=2*-c.x/this._helper._width,G[9]=2*c.y/this._helper._height,this._projectionMatrix=o.bd(G),o.Q(G,G,[1,-1,1]),o.O(G,G,[0,0,-this._helper.cameraToCenterDistance]),o.be(G,G,-this.rollInRadians),o.bf(G,G,this.pitchInRadians),o.be(G,G,-this.bearingInRadians),o.O(G,G,[-b,-S,0]),this._mercatorMatrix=o.Q([],G,[this.worldSize,this.worldSize,this.worldSize]),o.Q(G,G,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=o.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,G),o.O(G,G,[0,0,-this.elevation]),this._viewProjMatrix=G,this._invViewProjMatrix=o.ay([],G);let q=[0,0,-1,1];o.aE(q,q,this._invViewProjMatrix),this._cameraPosition=[q[0]/q[3],q[1]/q[3],q[2]/q[3]],this._fogMatrix=new Float64Array(16),o.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,N,this._helper._farZ),this._fogMatrix[8]=2*-c.x/this.width,this._fogMatrix[9]=2*c.y/this.height,o.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),o.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),o.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),o.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),o.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),o.O(this._fogMatrix,this._fogMatrix,[-b,-S,0]),o.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),o.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=o.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,G);let K=this._helper._width%2/2,it=this._helper._height%2/2,ct=Math.cos(this.bearingInRadians),ut=Math.sin(-this.bearingInRadians),gt=b-Math.round(b)+ct*K+ut*it,yt=S-Math.round(S)+ct*it+ut*K,Pt=new Float64Array(G);if(o.O(Pt,Pt,[gt>.5?gt-1:gt,yt>.5?yt-1:yt,0]),this._alignedProjMatrix=Pt,G=o.ay(new Float64Array(16),this._pixelMatrix),!G)throw new Error(\"failed to invert matrix\");this._pixelMatrixInverse=G,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let c=this.screenPointToMercatorCoordinate(new o.P(0,0)),f=[c.x*this.worldSize,c.y*this.worldSize,0,1];return o.aE(f,f,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let c=o.ap(1,this.center.lat)*this.worldSize;return Am(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/c).toLngLat()}lngLatToCameraDepth(c,f){let b=o.a6.fromLngLat(c),S=[b.x*this.worldSize,b.y*this.worldSize,f,1];return o.aE(S,S,this._viewProjMatrix),S[2]/S[3]}getProjectionData(c){let{overscaledTileID:f,aligned:b,applyTerrainMatrix:S}=c,D=this._helper.getMercatorTileCoordinates(f),N=f?this.calculatePosMatrix(f,b,!0):null,G;return G=f&&f.terrainRttPosMatrix32f&&S?f.terrainRttPosMatrix32f:N||o.bg(),{mainMatrix:G,tileMercatorCoords:D,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:G}}isLocationOccluded(c){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(c,f,b){return 1}transformLightDirection(c){return o.a$(c)}getRayDirectionFromPixel(c){throw new Error(\"Not implemented.\")}projectTileCoordinates(c,f,b,S){let D=this.calculatePosMatrix(b),N;S?(N=[c,f,S(c,f),1],o.aE(N,N,D)):(N=[c,f,0,1],$A(N,N,D));let G=N[3];return{point:new o.P(N[0]/G,N[1]/G),signedDistanceFromCamera:G,isOccluded:!1}}populateCache(c){for(let f of c)this.calculatePosMatrix(f)}getMatrixForModel(c,f){let b=o.a6.fromLngLat(c,f),S=b.meterInMercatorCoordinateUnits(),D=o.bh();return o.O(D,D,[b.x,b.y,b.z]),o.be(D,D,Math.PI),o.bf(D,D,Math.PI/2),o.Q(D,D,[-S,S,S]),D}getProjectionDataForCustomLayer(c=!0){let f=new o.a2(0,0,0,0,0),b=this.getProjectionData({overscaledTileID:f,applyGlobeMatrix:c}),S=Ip(f,this.worldSize);o.S(S,this._viewProjMatrix,S),b.tileMercatorCoords=[0,0,1,1];let D=[o.a5,o.a5,this.worldSize/this._helper.pixelsPerMeter],N=o.bi();return o.Q(N,S,D),b.fallbackMatrix=N,b.mainMatrix=N,b}getFastPathSimpleProjectionMatrix(c){return this.calculatePosMatrix(c)}}function Wl(){o.w(\"Map cannot fit within canvas with the given bounds, padding, and/or offset.\")}function j_(I){if(I.useSlerp)if(I.k<1){let c=o.bj(I.startEulerAngles.roll,I.startEulerAngles.pitch,I.startEulerAngles.bearing),f=o.bj(I.endEulerAngles.roll,I.endEulerAngles.pitch,I.endEulerAngles.bearing),b=new Float64Array(4);o.bk(b,c,f,I.k);let S=o.bl(b);I.tr.setRoll(S.roll),I.tr.setPitch(S.pitch),I.tr.setBearing(S.bearing)}else I.tr.setRoll(I.endEulerAngles.roll),I.tr.setPitch(I.endEulerAngles.pitch),I.tr.setBearing(I.endEulerAngles.bearing);else I.tr.setRoll(o.G.number(I.startEulerAngles.roll,I.endEulerAngles.roll,I.k)),I.tr.setPitch(o.G.number(I.startEulerAngles.pitch,I.endEulerAngles.pitch,I.k)),I.tr.setBearing(o.G.number(I.startEulerAngles.bearing,I.endEulerAngles.bearing,I.k))}function Zu(I,c,f,b,S){let D=S.padding,N=$l(S.worldSize,f.getNorthWest()),G=$l(S.worldSize,f.getNorthEast()),q=$l(S.worldSize,f.getSouthEast()),K=$l(S.worldSize,f.getSouthWest()),it=o.am(-b),ct=N.rotate(it),ut=G.rotate(it),gt=q.rotate(it),yt=K.rotate(it),Pt=new o.P(Math.max(ct.x,ut.x,yt.x,gt.x),Math.max(ct.y,ut.y,yt.y,gt.y)),Ct=new o.P(Math.min(ct.x,ut.x,yt.x,gt.x),Math.min(ct.y,ut.y,yt.y,gt.y)),Rt=Pt.sub(Ct),Ut=(S.width-(D.left+D.right+c.left+c.right))/Rt.x,Gt=(S.height-(D.top+D.bottom+c.top+c.bottom))/Rt.y;if(Gt<0||Ut<0)return void Wl();let zt=Math.min(o.aq(S.scale*Math.min(Ut,Gt)),I.maxZoom),jt=o.P.convert(I.offset),Wt=new o.P((c.left-c.right)/2,(c.top-c.bottom)/2).rotate(o.am(b)),It=jt.add(Wt).mult(S.scale/o.an(zt));return{center:lf(S.worldSize,N.add(q).div(2).sub(It)),zoom:zt,bearing:b}}class HA{get useGlobeControls(){return!1}handlePanInertia(c,f){let b=c.mag(),S=Math.abs(Yu(f));return{easingOffset:c.mult(Math.min(.75*S/b,1)),easingCenter:f.center}}handleMapControlsRollPitchBearingZoom(c,f){c.bearingDelta&&f.setBearing(f.bearing+c.bearingDelta),c.pitchDelta&&f.setPitch(f.pitch+c.pitchDelta),c.rollDelta&&f.setRoll(f.roll+c.rollDelta),c.zoomDelta&&f.setZoom(f.zoom+c.zoomDelta)}handleMapControlsPan(c,f,b){c.around.distSqr(f.centerPoint)<.01||f.setLocationAtPoint(b,c.around)}cameraForBoxAndBearing(c,f,b,S,D){return Zu(c,f,b,S,D)}handleJumpToCenterZoom(c,f){c.zoom!==(f.zoom!==void 0?+f.zoom:c.zoom)&&c.setZoom(+f.zoom),f.center!==void 0&&c.setCenter(o.V.convert(f.center))}handleEaseTo(c,f){let b=c.zoom,S=c.padding,D={roll:c.roll,pitch:c.pitch,bearing:c.bearing},N={roll:f.roll===void 0?c.roll:f.roll,pitch:f.pitch===void 0?c.pitch:f.pitch,bearing:f.bearing===void 0?c.bearing:f.bearing},G=f.zoom!==void 0,q=!c.isPaddingEqual(f.padding),K=!1,it=G?+f.zoom:c.zoom,ct=c.centerPoint.add(f.offsetAsPoint),ut=c.screenPointToLocation(ct),{center:gt,zoom:yt}=c.applyConstrain(o.V.convert(f.center||ut),it??b);ra(c,gt);let Pt=$l(c.worldSize,ut),Ct=$l(c.worldSize,gt).sub(Pt),Rt=o.an(yt-b);return K=yt!==b,{easeFunc:Ut=>{if(K&&c.setZoom(o.G.number(b,yt,Ut)),o.bm(D,N)||j_({startEulerAngles:D,endEulerAngles:N,tr:c,k:Ut,useSlerp:D.roll!=N.roll}),q&&(c.interpolatePadding(S,f.padding,Ut),ct=c.centerPoint.add(f.offsetAsPoint)),f.around)c.setLocationAtPoint(f.around,f.aroundPoint);else{let Gt=o.an(c.zoom-b),zt=yt>b?Math.min(2,Rt):Math.max(.5,Rt),jt=Math.pow(zt,1-Ut),Wt=lf(c.worldSize,Pt.add(Ct.mult(Ut*jt)).mult(Gt));c.setLocationAtPoint(c.renderWorldCopies?Wt.wrap():Wt,ct)}},isZooming:K,elevationCenter:gt}}handleFlyTo(c,f){let b=f.zoom!==void 0,S=c.zoom,D=c.applyConstrain(o.V.convert(f.center||f.locationAtOffset),b?+f.zoom:S),N=D.center,G=D.zoom;ra(c,N);let q=$l(c.worldSize,f.locationAtOffset),K=$l(c.worldSize,N).sub(q),it=K.mag(),ct=o.an(G-S),ut;if(f.minZoom!==void 0){let gt=Math.min(+f.minZoom,S,G),yt=c.applyConstrain(N,gt).zoom;ut=o.an(yt-S)}return{easeFunc:(gt,yt,Pt,Ct)=>{c.setZoom(gt===1?G:S+o.aq(yt));let Rt=gt===1?N:lf(c.worldSize,q.add(K.mult(Pt)).mult(yt));c.setLocationAtPoint(c.renderWorldCopies?Rt.wrap():Rt,Ct)},scaleOfZoom:ct,targetCenter:N,scaleOfMinZoom:ut,pixelPathLength:it}}}class Rn{constructor(c,f,b){this.blendFunction=c,this.blendColor=f,this.mask=b}}Rn.Replace=[1,0],Rn.disabled=new Rn(Rn.Replace,o.bn.transparent,[!1,!1,!1,!1]),Rn.unblended=new Rn(Rn.Replace,o.bn.transparent,[!0,!0,!0,!0]),Rn.alphaBlended=new Rn([1,771],o.bn.transparent,[!0,!0,!0,!0]);let Fp=2305;class Ii{constructor(c,f,b){this.enable=c,this.mode=f,this.frontFace=b}}Ii.disabled=new Ii(!1,1029,Fp),Ii.backCCW=new Ii(!0,1029,Fp),Ii.frontCCW=new Ii(!0,1028,Fp);class ii{constructor(c,f,b){this.func=c,this.mask=f,this.range=b}}ii.ReadOnly=!1,ii.ReadWrite=!0,ii.disabled=new ii(519,ii.ReadOnly,[0,1]);let Tm=7680;class ke{constructor(c,f,b,S,D,N){this.test=c,this.ref=f,this.mask=b,this.fail=S,this.depthFail=D,this.pass=N}}ke.disabled=new ke({func:519,mask:0},0,0,Tm,Tm,Tm);let or=new WeakMap;function Ar(I){var c;if(or.has(I))return or.get(I);{let f=(c=I.getParameter(I.VERSION))===null||c===void 0?void 0:c.startsWith(\"WebGL 2.0\");return or.set(I,f),f}}class _i{get awaitingQuery(){return!!this._readbackQueue}constructor(c){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=c;let f=c.context,b=f.gl;this._texFormat=b.RGBA,this._texType=b.UNSIGNED_BYTE;let S=new o.aU;S.emplaceBack(-1,-1),S.emplaceBack(2,-1),S.emplaceBack(-1,2);let D=new o.aW;D.emplaceBack(0,1,2),this._fullscreenTriangle=new jo(f.createVertexBuffer(S,Hn.members),f.createIndexBuffer(D),o.aV.simpleSegment(0,0,S.length,D.length)),this._resultBuffer=new Uint8Array(4),f.activeTexture.set(b.TEXTURE1);let N=b.createTexture();b.bindTexture(b.TEXTURE_2D,N),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST),b.texImage2D(b.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=f.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(N),Ar(b)&&(this._pbo=b.createBuffer(),b.bindBuffer(b.PIXEL_PACK_BUFFER,this._pbo),b.bufferData(b.PIXEL_PACK_BUFFER,4,b.STREAM_READ),b.bindBuffer(b.PIXEL_PACK_BUFFER,null))}destroy(){let c=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),c.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(c,f){let b=this._updateCount;return this._readbackQueue?b>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():b>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(c,f),this._updateCount++,this._measuredError}_bindFramebuffer(){let c=this._cachedRenderContext.context,f=c.gl;c.activeTexture.set(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,this._fbo.colorAttachment.get()),c.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(c,f){let b=this._cachedRenderContext.context,S=b.gl;if(this._bindFramebuffer(),b.viewport.set([0,0,this._texWidth,this._texHeight]),b.clear({color:o.bn.transparent}),this._cachedRenderContext.useProgram(\"projectionErrorMeasurement\").draw(b,S.TRIANGLES,ii.disabled,ke.disabled,Rn.unblended,Ii.disabled,((D,N)=>({u_input:D,u_output_expected:N}))(c,f),null,null,\"$clipping\",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&Ar(S)){S.bindBuffer(S.PIXEL_PACK_BUFFER,this._pbo),S.readBuffer(S.COLOR_ATTACHMENT0),S.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),S.bindBuffer(S.PIXEL_PACK_BUFFER,null);let D=S.fenceSync(S.SYNC_GPU_COMMANDS_COMPLETE,0);S.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:D}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let c=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&Ar(c)){let f=c.clientWaitSync(this._readbackQueue.sync,0,0);if(f===c.WAIT_FAILED)return o.w(\"WebGL2 clientWaitSync failed.\"),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(f===c.TIMEOUT_EXPIRED)return;c.bindBuffer(c.PIXEL_PACK_BUFFER,this._pbo),c.getBufferSubData(c.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),c.bindBuffer(c.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),c.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=_i._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(c){let f=0;return f+=c[0]/256,f+=c[1]/65536,f+=c[2]/16777216,c[3]<127&&(f=-f),f/128}}let Xi=o.a5/128;function no(I,c){let f=I.granularity!==void 0?Math.max(I.granularity,1):1,b=f+(I.generateBorders?2:0),S=f+(I.extendToNorthPole||I.generateBorders?1:0)+(I.extendToSouthPole||I.generateBorders?1:0),D=b+1,N=S+1,G=I.generateBorders?-1:0,q=I.generateBorders||I.extendToNorthPole?-1:0,K=f+(I.generateBorders?1:0),it=f+(I.generateBorders||I.extendToSouthPole?1:0),ct=D*N,ut=b*S*6,gt=D*N>65536;if(gt&&c===\"16bit\")throw new Error(\"Granularity is too large and meshes would not fit inside 16 bit vertex indices.\");let yt=gt||c===\"32bit\",Pt=new Int16Array(2*ct),Ct=0;for(let Gt=q;Gt<=it;Gt++)for(let zt=G;zt<=K;zt++){let jt=zt/f*o.a5;zt===-1&&(jt=-Xi),zt===f+1&&(jt=o.a5+Xi);let Wt=Gt/f*o.a5;Gt===-1&&(Wt=I.extendToNorthPole?o.bp:-Xi),Gt===f+1&&(Wt=I.extendToSouthPole?o.bq:o.a5+Xi),Pt[Ct++]=jt,Pt[Ct++]=Wt}let Rt=yt?new Uint32Array(ut):new Uint16Array(ut),Ut=0;for(let Gt=0;Gt<S;Gt++)for(let zt=0;zt<b;zt++){let jt=zt+1+Gt*D,Wt=zt+(Gt+1)*D,It=zt+1+(Gt+1)*D;Rt[Ut++]=zt+Gt*D,Rt[Ut++]=Wt,Rt[Ut++]=jt,Rt[Ut++]=jt,Rt[Ut++]=Wt,Rt[Ut++]=It}return{vertices:Pt.buffer.slice(0),indices:Rt.buffer.slice(0),uses32bitIndices:yt}}let zn=new o.aT({fill:new o.br(128,2),line:new o.br(512,0),tile:new o.br(128,32),stencil:new o.br(128,1),circle:3});class iu{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return\"vertical-perspective\"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return\"globe\"}get shaderDefine(){return\"#define GLOBE\"}get shaderPreludeCode(){return yo.projectionGlobe}get vertexShaderPreludeCode(){return yo.projectionMercator.vertexSource}get subdivisionGranularity(){return zn}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(c){this._errorMeasurement||(this._errorMeasurement=new _i(c));let f=o.X(this._errorQueryLatitudeDegrees),b=2*Math.atan(Math.exp(Math.PI-f*Math.PI*2))-.5*Math.PI,S=this._errorMeasurement.updateErrorLoop(f,b),D=R();S!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=S,this._errorMeasurementLastChangeTime=D);let N=Math.min(Math.max((D-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=o.bs(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,o.bt(N))}_getMeshKey(c){return`${c.granularity.toString(36)}_${c.generateBorders?\"b\":\"\"}${c.extendToNorthPole?\"n\":\"\"}${c.extendToSouthPole?\"s\":\"\"}`}getMeshFromTileID(c,f,b,S,D){let N=(D===\"stencil\"?zn.stencil:zn.tile).getGranularityForZoomLevel(f.z);return this._getMesh(c,{granularity:N,generateBorders:b,extendToNorthPole:f.y===0&&S,extendToSouthPole:f.y===(1<<f.z)-1&&S})}_getMesh(c,f){let b=this._getMeshKey(f);if(b in this._tileMeshCache)return this._tileMeshCache[b];let S=(function(D,N){let G=no(N,\"16bit\"),q=o.aU.deserialize({arrayBuffer:G.vertices,length:G.vertices.byteLength/2/2}),K=o.aW.deserialize({arrayBuffer:G.indices,length:G.indices.byteLength/2/3});return new jo(D.createVertexBuffer(q,Hn.members),D.createIndexBuffer(K),o.aV.simpleSegment(0,0,q.length,K.length))})(c,f);return this._tileMeshCache[b]=S,S}recalculate(c){}hasTransition(){let c=R(),f=!1;return f=f||(c-this._errorMeasurementLastChangeTime)/1e3<.7,f=f||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,f}setErrorQueryLatitudeDegrees(c){this._errorQueryLatitudeDegrees=c}}let Ku=new o.t({type:new o.D(o.u.projection.type)});class qh extends o.E{constructor(c){super(),this._transitionable=new o.x(Ku,void 0),this.setProjection(c),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new o.H(0)),this._mercatorProjection=new ta,this._verticalPerspectiveProjection=new iu}get transitionState(){let c=this.properties.get(\"type\");if(typeof c==\"string\"&&c===\"mercator\")return 0;if(typeof c==\"string\"&&c===\"vertical-perspective\")return 1;if(c instanceof o.bu){if(c.from===\"vertical-perspective\"&&c.to===\"mercator\")return 1-c.transition;if(c.from===\"mercator\"&&c.to===\"vertical-perspective\")return c.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return\"globe\"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(c){this._mercatorProjection.updateGPUdependent(c),this._verticalPerspectiveProjection.updateGPUdependent(c)}getMeshFromTileID(c,f,b,S,D){return this.currentProjection.getMeshFromTileID(c,f,b,S,D)}setProjection(c){this._transitionable.setValue(\"type\",c?.type||\"mercator\")}updateTransitions(c){this._transitioning=this._transitionable.transitioned(c,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(c){this.properties=this._transitioning.possiblyEvaluate(c)}setErrorQueryLatitudeDegrees(c){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(c),this._mercatorProjection.setErrorQueryLatitudeDegrees(c)}}function Np(I){let c=Hl(I.worldSize,I.center.lat);return 2*Math.PI*c}function ql(I,c,f,b,S){let D=1/(1<<S),N=c/o.a5*D+b*D,G=o.bx((I/o.a5*D+f*D)*Math.PI*2+Math.PI,2*Math.PI),q=2*Math.atan(Math.exp(Math.PI-N*Math.PI*2))-.5*Math.PI,K=Math.cos(q),it=new Float64Array(3);return it[0]=Math.sin(G)*K,it[1]=Math.sin(q),it[2]=Math.cos(G)*K,it}function Li(I){return(function(c,f){let b=Math.cos(f),S=new Float64Array(3);return S[0]=Math.sin(c)*b,S[1]=Math.sin(f),S[2]=Math.cos(c)*b,S})(I.lng*Math.PI/180,I.lat*Math.PI/180)}function Hl(I,c){return I/(2*Math.PI)/Math.cos(c*Math.PI/180)}function Ls(I){let c=Math.asin(I[1])/Math.PI*180,f=Math.sqrt(I[0]*I[0]+I[2]*I[2]);if(f>1e-6){let b=I[0]/f,S=Math.acos(I[2]/f),D=(b>0?S:-S)/Math.PI*180;return new o.V(o.W(D,-180,180),c)}return new o.V(0,c)}function ff(I){return Math.cos(I*Math.PI/180)}function ko(I,c){let f=ff(I),b=ff(c);return o.aq(b/f)}function YA(I,c){let f=I.rotate(c.bearingInRadians),b=c.zoom+ko(c.center.lat,0),S=o.bs(1/ff(c.center.lat),1/ff(Math.min(Math.abs(c.center.lat),60)),o.bv(b,7,3,0,1)),D=360/Np({worldSize:c.worldSize,center:{lat:c.center.lat}});return new o.V(c.center.lng-f.x*D*S,o.ak(c.center.lat+f.y*D,-o.al,o.al))}function Qu(I){let c=.5*I,f=Math.sin(c),b=Math.cos(c);return Math.log(f+b)-Math.log(b-f)}function Sm(I,c,f,b){let S=I.lat+f*b;if(Math.abs(f)>1){let D=(Math.sign(I.lat+f)!==Math.sign(I.lat)?-Math.abs(I.lat):Math.abs(I.lat))*Math.PI/180,N=Math.abs(I.lat+f)*Math.PI/180,G=Qu(D+b*(N-D)),q=Qu(D),K=Qu(N);return new o.V(I.lng+c*((G-q)/(K-q)),S)}return new o.V(I.lng+c*b,S)}class $_{constructor(c){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=c}swapBuffers(){if(!this._hadAnyChanges)return;let c=this._cachePrevious;this._cachePrevious=this._cache,this._cache=c,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(c,f,b,S){let D=`${c.z}_${c.x}_${c.y}_${S?.terrain?\"t\":\"\"}`,N=this._cache.get(D);if(N)return N;let G=this._cachePrevious.get(D);if(G)return this._cache.set(D,G),G;let q=this._boundingVolumeFactory(c,f,b,S);return this._cache.set(D,q),this._hadAnyChanges=!0,q}}class Hh{constructor(c,f,b,S){this.min=b,this.max=S,this.points=c,this.planes=f}static fromAabb(c,f){let b=[];for(let S=0;S<8;S++)b.push([1&~S?c[0]:f[0],(S>>1&1)==1?f[1]:c[1],(S>>2&1)==1?f[2]:c[2]]);return new Hh(b,[[-1,0,0,f[0]],[1,0,0,-c[0]],[0,-1,0,f[1]],[0,1,0,-c[1]],[0,0,-1,f[2]],[0,0,1,-c[2]]],c,f)}static fromCenterSizeAngles(c,f,b){let S=o.bz([],b[0],b[1],b[2]),D=o.bA([],[f[0],0,0],S),N=o.bA([],[0,f[1],0],S),G=o.bA([],[0,0,f[2]],S),q=[...c],K=[...c];for(let ct=0;ct<8;ct++)for(let ut=0;ut<3;ut++){let gt=c[ut]+D[ut]*(1&~ct?-1:1)+N[ut]*((ct>>1&1)==1?1:-1)+G[ut]*((ct>>2&1)==1?1:-1);q[ut]=Math.min(q[ut],gt),K[ut]=Math.max(K[ut],gt)}let it=[];for(let ct=0;ct<8;ct++){let ut=[...c];o.a_(ut,ut,o.aZ([],D,1&~ct?-1:1)),o.a_(ut,ut,o.aZ([],N,(ct>>1&1)==1?1:-1)),o.a_(ut,ut,o.aZ([],G,(ct>>2&1)==1?1:-1)),it.push(ut)}return new Hh(it,[[...D,-o.b3(D,it[0])],[...N,-o.b3(N,it[0])],[...G,-o.b3(G,it[0])],[-D[0],-D[1],-D[2],-o.b3(D,it[7])],[-N[0],-N[1],-N[2],-o.b3(N,it[7])],[-G[0],-G[1],-G[2],-o.b3(G,it[7])]],q,K)}intersectsFrustum(c){let f=!0,b=this.points.length,S=this.planes.length,D=c.planes.length,N=c.points.length;for(let G=0;G<D;G++){let q=c.planes[G],K=0;for(let it=0;it<b;it++){let ct=this.points[it];q[0]*ct[0]+q[1]*ct[1]+q[2]*ct[2]+q[3]>=0&&K++}if(K===0)return 0;K<b&&(f=!1)}if(f)return 2;for(let G=0;G<S;G++){let q=this.planes[G],K=0;for(let it=0;it<N;it++){let ct=c.points[it];q[0]*ct[0]+q[1]*ct[1]+q[2]*ct[2]+q[3]>=0&&K++}if(K===0)return 0}return 1}intersectsPlane(c){let f=this.points.length,b=0;for(let S=0;S<f;S++){let D=this.points[S];c[0]*D[0]+c[1]*D[1]+c[2]*D[2]+c[3]>=0&&b++}return b===f?2:b===0?0:1}}function zp(I,c,f){let b=I-c;return b<0?-b:Math.max(0,b-f)}function Up(I,c,f,b,S){let D=I-f,N;return N=D<0?Math.min(-D,1+D-S):D>S?Math.min(Math.max(D-S,0),1-D):0,Math.max(N,zp(c,b,S))}class G_{constructor(){this._boundingVolumeCache=new $_(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(c,f,b,S){let D=1<<b.z,N=1/D,G=b.x/D,q=b.y/D,K=2;return K=Math.min(K,Up(c,f,G,q,N)),K=Math.min(K,Up(c,f,G+.5,-q-N,N)),K=Math.min(K,Up(c,f,G+.5,2-q-N,N)),K}getWrap(c,f,b){let S=1<<f.z,D=1/S,N=f.x/S,G=zp(c.x,N,D),q=zp(c.x,N-1,D),K=zp(c.x,N+1,D),it=Math.min(G,q,K);return it===K?1:it===q?-1:0}allowVariableZoom(c,f){return Ds(c,f)>4}allowWorldCopies(){return!1}getTileBoundingVolume(c,f,b,S){return this._boundingVolumeCache.getTileBoundingVolume(c,f,b,S)}_computeTileBoundingVolume(c,f,b,S){var D,N;let G=0,q=0;if(S?.terrain){let K=new o.a2(c.z,f,c.z,c.x,c.y),it=S.terrain.getMinMaxElevation(K);G=(D=it.minElevation)!==null&&D!==void 0?D:Math.min(0,b),q=(N=it.maxElevation)!==null&&N!==void 0?N:Math.max(0,b)}if(G/=o.bC,q/=o.bC,G+=1,q+=1,c.z<=0)return Hh.fromAabb([-q,-q,-q],[q,q,q]);if(c.z===1)return Hh.fromAabb([c.x===0?-q:0,c.y===0?0:-q,-q],[c.x===0?0:q,c.y===0?q:0,q]);{let K=[ql(0,0,c.x,c.y,c.z),ql(o.a5,0,c.x,c.y,c.z),ql(o.a5,o.a5,c.x,c.y,c.z),ql(0,o.a5,c.x,c.y,c.z)],it=[];for(let le of K)it.push(o.aZ([],le,q));if(q!==G)for(let le of K)it.push(o.aZ([],le,G));c.y===0&&it.push([0,1,0]),c.y===(1<<c.z)-1&&it.push([0,-1,0]);let ct=[1,1,1],ut=[-1,-1,-1];for(let le of it)for(let me=0;me<3;me++)ct[me]=Math.min(ct[me],le[me]),ut[me]=Math.max(ut[me],le[me]);let gt=ql(o.a5/2,o.a5/2,c.x,c.y,c.z),yt=o.b2([],[0,1,0],gt);o.b1(yt,yt);let Pt=o.b2([],gt,yt);o.b1(Pt,Pt);let Ct=o.b2([],K[2],K[1]);o.b1(Ct,Ct);let Rt=o.b2([],K[0],K[3]);o.b1(Rt,Rt),it.push(o.aZ([],gt,q)),c.y>=(1<<c.z)/2&&it.push(o.aZ([],ql(o.a5/2,0,c.x,c.y,c.z),q)),c.y<(1<<c.z)/2&&it.push(o.aZ([],ql(o.a5/2,o.a5,c.x,c.y,c.z),q));let Ut=Ac(gt,it),Gt=Ac(Pt,it),zt=[-gt[0],-gt[1],-gt[2],Ut.max],jt=[gt[0],gt[1],gt[2],-Ut.min],Wt=[-Pt[0],-Pt[1],-Pt[2],Gt.max],It=[Pt[0],Pt[1],Pt[2],-Gt.min],Xt=[...Ct,0],Kt=[...Rt,0],de=[];return c.y===0?de.push(o.bB(Kt,Xt,zt),o.bB(Kt,Xt,jt)):de.push(o.bB(Wt,Xt,zt),o.bB(Wt,Xt,jt),o.bB(Wt,Kt,zt),o.bB(Wt,Kt,jt)),c.y===(1<<c.z)-1?de.push(o.bB(Kt,Xt,zt),o.bB(Kt,Xt,jt)):de.push(o.bB(It,Xt,zt),o.bB(It,Xt,jt),o.bB(It,Kt,zt),o.bB(It,Kt,jt)),new Hh(de,[zt,jt,Wt,It,Xt,Kt],ct,ut)}}}function Ac(I,c){let f=1/0,b=-1/0;for(let S of c){let D=o.b3(I,S);f=Math.min(f,D),b=Math.max(b,D)}return{min:f,max:b}}class pe{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(c){this._helper.setMinZoom(c)}setMaxZoom(c){this._helper.setMaxZoom(c)}setMinPitch(c){this._helper.setMinPitch(c)}setMaxPitch(c){this._helper.setMaxPitch(c)}setRenderWorldCopies(c){this._helper.setRenderWorldCopies(c)}setBearing(c){this._helper.setBearing(c)}setPitch(c){this._helper.setPitch(c)}setRoll(c){this._helper.setRoll(c)}setFov(c){this._helper.setFov(c)}setZoom(c){this._helper.setZoom(c)}setCenter(c){this._helper.setCenter(c)}setElevation(c){this._helper.setElevation(c)}setMinElevationForCurrentTile(c){this._helper.setMinElevationForCurrentTile(c)}setPadding(c){this._helper.setPadding(c)}interpolatePadding(c,f,b){return this._helper.interpolatePadding(c,f,b)}isPaddingEqual(c){return this._helper.isPaddingEqual(c)}resize(c,f){this._helper.resize(c,f)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(c){this._helper.setMaxBounds(c)}setConstrainOverride(c){this._helper.setConstrainOverride(c)}overrideNearFarZ(c,f){this._helper.overrideNearFarZ(c,f)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(c){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),c)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(c){}constructor(c){this._cachedClippingPlane=o.bD(),this._projectionMatrix=o.bh(),this._globeViewProjMatrix32f=o.bg(),this._globeViewProjMatrixNoCorrection=o.bh(),this._globeViewProjMatrixNoCorrectionInverted=o.bh(),this._globeProjMatrixInverted=o.bh(),this._cameraPosition=o.by(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(f,b)=>{let S=o.ak(f.lat,-o.al,o.al),D=o.ak(+b,this.minZoom+ko(0,S),this.maxZoom);return{center:new o.V(f.lng,S),zoom:D}},this.applyConstrain=(f,b)=>this._helper.applyConstrain(f,b),this._helper=new df({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(f,b)=>this.defaultConstrain(f,b)},c),this._coveringTilesDetailsProvider=new G_}clone(){let c=new pe;return c.apply(this,!1),c}apply(c,f,b){this._globeLatitudeErrorCorrectionRadians=b||0,this._helper.apply(c,f)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let c=o.by();return c[0]=this._cameraPosition[0],c[1]=this._cameraPosition[1],c[2]=this._cameraPosition[2],c}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(c){let{overscaledTileID:f,applyGlobeMatrix:b}=c,S=this._helper.getMercatorTileCoordinates(f);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:S,clippingPlane:this._cachedClippingPlane,projectionTransition:b?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(c){let f=this.pitchInRadians,b=this.cameraToCenterDistance/c,S=Math.sin(f)*b,D=Math.cos(f)*b+1,N=1/Math.sqrt(S*S+D*D)*1,G=-S,q=D,K=Math.sqrt(G*G+q*q);G/=K,q/=K;let it=[0,G,q];o.bE(it,it,[0,0,0],-this.bearingInRadians),o.bF(it,it,[0,0,0],-1*this.center.lat*Math.PI/180),o.bG(it,it,[0,0,0],this.center.lng*Math.PI/180);let ct=1/o.b5(it);return o.aZ(it,it,ct),[...it,-N*ct]}isLocationOccluded(c){return!this.isSurfacePointVisible(Li(c))}transformLightDirection(c){let f=this._helper._center.lng*Math.PI/180,b=this._helper._center.lat*Math.PI/180,S=Math.cos(b),D=[Math.sin(f)*S,Math.sin(b),Math.cos(f)*S],N=[D[2],0,-D[0]],G=[0,0,0];o.b2(G,N,D),o.b1(N,N),o.b1(G,G);let q=[0,0,0];return o.b1(q,[N[0]*c[0]+G[0]*c[1]+D[0]*c[2],N[1]*c[0]+G[1]*c[1]+D[1]*c[2],N[2]*c[0]+G[2]*c[1]+D[2]*c[2]]),q}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(c,f,b){let S=(function(G,q,K){let it=1/(1<<K.z);return new o.a6(G/o.a5*it+K.x*it,q/o.a5*it+K.y*it)})(c,f,b.canonical),D=(N=S.y,[o.bx(S.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-N*Math.PI*2))-.5*Math.PI]);var N;return this.getCircleRadiusCorrection()/Math.cos(D[1])}projectTileCoordinates(c,f,b,S){let D=b.canonical,N=ql(c,f,D.x,D.y,D.z),G=1+(S?S(c,f):0)/o.bC,q=[N[0]*G,N[1]*G,N[2]*G,1];o.aE(q,q,this._globeViewProjMatrixNoCorrection);let K=this._cachedClippingPlane,it=K[0]*N[0]+K[1]*N[1]+K[2]*N[2]+K[3]<0;return{point:new o.P(q[0]/q[3],q[1]/q[3]),signedDistanceFromCamera:q[3],isOccluded:it}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let c=Hl(this.worldSize,this.center.lat),f=o.bi(),b=o.bi();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*c),o.bc(f,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let S=this.centerOffset;f[8]=2*-S.x/this._helper._width,f[9]=2*S.y/this._helper._height,this._projectionMatrix=o.bd(f),this._globeProjMatrixInverted=o.bi(),o.ay(this._globeProjMatrixInverted,f),o.O(f,f,[0,0,-this.cameraToCenterDistance]),o.be(f,f,this.rollInRadians),o.bf(f,f,-this.pitchInRadians),o.be(f,f,this.bearingInRadians),o.O(f,f,[0,0,-c]);let D=o.by();D[0]=c,D[1]=c,D[2]=c,o.bf(b,f,this.center.lat*Math.PI/180),o.bH(b,b,-this.center.lng*Math.PI/180),o.Q(b,b,D),this._globeViewProjMatrixNoCorrection=b,o.bf(f,f,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),o.bH(f,f,-this.center.lng*Math.PI/180),o.Q(f,f,D),this._globeViewProjMatrix32f=new Float32Array(f),this._globeViewProjMatrixNoCorrectionInverted=o.bi(),o.ay(this._globeViewProjMatrixNoCorrectionInverted,b);let N=o.by();this._cameraPosition=o.by(),this._cameraPosition[2]=this.cameraToCenterDistance/c,o.bE(this._cameraPosition,this._cameraPosition,N,-this.rollInRadians),o.bF(this._cameraPosition,this._cameraPosition,N,this.pitchInRadians),o.bE(this._cameraPosition,this._cameraPosition,N,-this.bearingInRadians),o.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),o.bF(this._cameraPosition,this._cameraPosition,N,-this.center.lat*Math.PI/180),o.bG(this._cameraPosition,this._cameraPosition,N,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(c);let G=o.bd(this._globeViewProjMatrixNoCorrectionInverted);o.Q(G,G,[1,1,-1]),this._cachedFrustum=ru.fromInvProjectionMatrix(G,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(c){o.w(\"calculateFogMatrix is not supported on globe projection.\");let f=o.bi();return o.ao(f),f}getVisibleUnwrappedCoordinates(c){return[new o.ba(0,c)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(c){c&&o.w(\"terrain is not fully supported on vertical perspective projection.\"),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(c,f){if(!this._globeViewProjMatrixNoCorrection)return 1;let b=Li(c);o.aZ(b,b,1+f/o.bC);let S=o.bD();return o.aE(S,[b[0],b[1],b[2],1],this._globeViewProjMatrixNoCorrection),S[2]/S[3]}populateCache(c){}getBounds(){let c=.5*this.width,f=.5*this.height,b=[new o.P(0,0),new o.P(c,0),new o.P(this.width,0),new o.P(this.width,f),new o.P(this.width,this.height),new o.P(c,this.height),new o.P(0,this.height),new o.P(0,f)],S=[];for(let ct of b)S.push(this.unprojectScreenPoint(ct));let D=0,N=0,G=0,q=0,K=this.center;for(let ct of S){let ut=o.bI(K.lng,ct.lng),gt=o.bI(K.lat,ct.lat);ut<N&&(N=ut),ut>D&&(D=ut),gt<q&&(q=gt),gt>G&&(G=gt)}let it=[K.lng+N,K.lat+q,K.lng+D,K.lat+G];return this.isSurfacePointOnScreen([0,1,0])&&(it[3]=90,it[0]=-180,it[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(it[1]=-90,it[0]=-180,it[2]=180),new wr(it)}calculateCenterFromCameraLngLatAlt(c,f,b,S){return this._helper.calculateCenterFromCameraLngLatAlt(c,f,b,S)}setLocationAtPoint(c,f){let b=Li(this.unprojectScreenPoint(f)),S=Li(c),D=o.by();o.bJ(D);let N=o.by();o.bG(N,b,D,-this.center.lng*Math.PI/180),o.bF(N,N,D,this.center.lat*Math.PI/180);let G=S[0]*S[0]+S[2]*S[2],q=N[0]*N[0];if(G<q)return;let K=Math.sqrt(G-q),it=-K,ct=o.bK(S[0],S[2],N[0],K),ut=o.bK(S[0],S[2],N[0],it),gt=o.by();o.bG(gt,S,D,-ct);let yt=o.bK(gt[1],gt[2],N[1],N[2]),Pt=o.by();o.bG(Pt,S,D,-ut);let Ct=o.bK(Pt[1],Pt[2],N[1],N[2]),Rt=.5*Math.PI,Ut=yt>=-Rt&&yt<=Rt,Gt=Ct>=-Rt&&Ct<=Rt,zt,jt;if(Ut&&Gt){let Kt=this.center.lng*Math.PI/180,de=this.center.lat*Math.PI/180;o.bL(ct,Kt)+o.bL(yt,de)<o.bL(ut,Kt)+o.bL(Ct,de)?(zt=ct,jt=yt):(zt=ut,jt=Ct)}else if(Ut)zt=ct,jt=yt;else{if(!Gt)return;zt=ut,jt=Ct}let Wt=zt/Math.PI*180,It=jt/Math.PI*180,Xt=this.center.lat;this.setCenter(new o.V(Wt,o.ak(It,-90,90))),this.setZoom(this.zoom+ko(Xt,this.center.lat))}locationToScreenPoint(c,f){let b=Li(c);if(f){let S=f.getElevationForLngLatZoom(c,this._helper._tileZoom);o.aZ(b,b,1+S/o.bC)}return this._projectSurfacePointToScreen(b)}_projectSurfacePointToScreen(c){let f=o.bD();return o.aE(f,[...c,1],this._globeViewProjMatrixNoCorrection),f[0]/=f[3],f[1]/=f[3],new o.P((.5*f[0]+.5)*this.width,(.5*-f[1]+.5)*this.height)}screenPointToMercatorCoordinate(c,f){if(f){let b=f.pointCoordinate(c);if(b)return b}return o.a6.fromLngLat(this.unprojectScreenPoint(c))}screenPointToLocation(c,f){var b;return(b=this.screenPointToMercatorCoordinate(c,f))===null||b===void 0?void 0:b.toLngLat()}isPointOnMapSurface(c,f){let b=this._cameraPosition,S=this.getRayDirectionFromPixel(c);return!!this.rayPlanetIntersection(b,S)}getRayDirectionFromPixel(c){let f=o.bD();f[0]=c.x/this.width*2-1,f[1]=-1*(c.y/this.height*2-1),f[2]=1,f[3]=1,o.aE(f,f,this._globeViewProjMatrixNoCorrectionInverted),f[0]/=f[3],f[1]/=f[3],f[2]/=f[3];let b=o.by();b[0]=f[0]-this._cameraPosition[0],b[1]=f[1]-this._cameraPosition[1],b[2]=f[2]-this._cameraPosition[2];let S=o.by();return o.b1(S,b),S}isSurfacePointVisible(c){let f=this._cachedClippingPlane;return f[0]*c[0]+f[1]*c[1]+f[2]*c[2]+f[3]>=0}isSurfacePointOnScreen(c){if(!this.isSurfacePointVisible(c))return!1;let f=o.bD();return o.aE(f,[...c,1],this._globeViewProjMatrixNoCorrection),f[0]/=f[3],f[1]/=f[3],f[2]/=f[3],f[0]>-1&&f[0]<1&&f[1]>-1&&f[1]<1&&f[2]>-1&&f[2]<1}rayPlanetIntersection(c,f){let b=o.b3(c,f),S=o.by(),D=o.by();o.aZ(D,f,b),o.b0(S,c,D);let N=1-o.b3(S,S);if(N<0)return null;let G=o.b3(c,c)-1,q=-b+(b<0?1:-1)*Math.sqrt(N),K=G/q,it=q;return{tMin:Math.min(K,it),tMax:Math.max(K,it)}}unprojectScreenPoint(c){let f=this._cameraPosition,b=this.getRayDirectionFromPixel(c),S=this.rayPlanetIntersection(f,b);if(S){let it=o.by();o.a_(it,f,[b[0]*S.tMin,b[1]*S.tMin,b[2]*S.tMin]);let ct=o.by();return o.b1(ct,it),Ls(ct)}let D=this._cachedClippingPlane,N=D[0]*b[0]+D[1]*b[1]+D[2]*b[2],G=-o.b9(D,f)/N,q=o.by();if(G>0)o.a_(q,f,[b[0]*G,b[1]*G,b[2]*G]);else{let it=o.by();o.a_(it,f,[2*b[0],2*b[1],2*b[2]]);let ct=o.b9(this._cachedClippingPlane,it);o.b0(q,it,[this._cachedClippingPlane[0]*ct,this._cachedClippingPlane[1]*ct,this._cachedClippingPlane[2]*ct])}let K=(function(it){let ct=o.by();return ct[0]=it[0]*-it[3],ct[1]=it[1]*-it[3],ct[2]=it[2]*-it[3],{center:ct,radius:Math.sqrt(1-it[3]*it[3])}})(D);return Ls((function(it,ct,ut){let gt=o.by();o.b0(gt,ut,it);let yt=o.by();return o.bw(yt,it,gt,ct/o.b7(gt)),yt})(K.center,K.radius,q))}getMatrixForModel(c,f){let b=o.V.convert(c),S=1/o.bC,D=o.bh();return o.bH(D,D,b.lng/180*Math.PI),o.bf(D,D,-b.lat/180*Math.PI),o.O(D,D,[0,0,1+f/o.bC]),o.bf(D,D,.5*Math.PI),o.Q(D,D,[S,S,S]),D}getProjectionDataForCustomLayer(c=!0){let f=this.getProjectionData({overscaledTileID:new o.a2(0,0,0,0,0),applyGlobeMatrix:c});return f.tileMercatorCoords=[0,0,1,1],f}getFastPathSimpleProjectionMatrix(c){}}class De{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(c){this._helper.setMinZoom(c)}setMaxZoom(c){this._helper.setMaxZoom(c)}setMinPitch(c){this._helper.setMinPitch(c)}setMaxPitch(c){this._helper.setMaxPitch(c)}setRenderWorldCopies(c){this._helper.setRenderWorldCopies(c)}setBearing(c){this._helper.setBearing(c)}setPitch(c){this._helper.setPitch(c)}setRoll(c){this._helper.setRoll(c)}setFov(c){this._helper.setFov(c)}setZoom(c){this._helper.setZoom(c)}setCenter(c){this._helper.setCenter(c)}setElevation(c){this._helper.setElevation(c)}setMinElevationForCurrentTile(c){this._helper.setMinElevationForCurrentTile(c)}setPadding(c){this._helper.setPadding(c)}interpolatePadding(c,f,b){return this._helper.interpolatePadding(c,f,b)}isPaddingEqual(c){return this._helper.isPaddingEqual(c)}resize(c,f,b=!0){this._helper.resize(c,f,b)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(c){this._helper.setMaxBounds(c)}setConstrainOverride(c){this._helper.setConstrainOverride(c)}overrideNearFarZ(c,f){this._helper.overrideNearFarZ(c,f)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(c){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),c)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(c,f){this._globeness=c,this._globeLatitudeErrorCorrectionRadians=f,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(c){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(f,b)=>this.currentTransform.defaultConstrain(f,b),this.applyConstrain=(f,b)=>this._helper.applyConstrain(f,b),this._helper=new df({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(f,b)=>this.defaultConstrain(f,b)},c),this._globeness=1,this._mercatorTransform=new Xu,this._verticalPerspectiveTransform=new pe}clone(){let c=new De;return c._globeness=this._globeness,c._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,c.apply(this,!1),c}apply(c,f){this._helper.apply(c,f),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(c){let f=this._mercatorTransform.getProjectionData(c),b=this._verticalPerspectiveTransform.getProjectionData(c);return{mainMatrix:this.isGlobeRendering?b.mainMatrix:f.mainMatrix,clippingPlane:b.clippingPlane,tileMercatorCoords:b.tileMercatorCoords,projectionTransition:c.applyGlobeMatrix?this._globeness:0,fallbackMatrix:f.fallbackMatrix}}isLocationOccluded(c){return this.currentTransform.isLocationOccluded(c)}transformLightDirection(c){return this.currentTransform.transformLightDirection(c)}getPixelScale(){return o.bs(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return o.bs(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(c,f,b){let S=this._mercatorTransform.getPitchedTextCorrection(c,f,b),D=this._verticalPerspectiveTransform.getPitchedTextCorrection(c,f,b);return o.bs(S,D,this._globeness)}projectTileCoordinates(c,f,b,S){return this.currentTransform.projectTileCoordinates(c,f,b,S)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(c){return this.currentTransform.calculateFogMatrix(c)}getVisibleUnwrappedCoordinates(c){return this.currentTransform.getVisibleUnwrappedCoordinates(c)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(c){this._mercatorTransform.recalculateZoomAndCenter(c),this._verticalPerspectiveTransform.recalculateZoomAndCenter(c)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(c,f){return this.currentTransform.lngLatToCameraDepth(c,f)}populateCache(c){this._mercatorTransform.populateCache(c),this._verticalPerspectiveTransform.populateCache(c)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(c,f,b,S){return this._helper.calculateCenterFromCameraLngLatAlt(c,f,b,S)}setLocationAtPoint(c,f){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(c,f),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(c,f),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(c,f){return this.currentTransform.locationToScreenPoint(c,f)}screenPointToMercatorCoordinate(c,f){return this.currentTransform.screenPointToMercatorCoordinate(c,f)}screenPointToLocation(c,f){return this.currentTransform.screenPointToLocation(c,f)}isPointOnMapSurface(c,f){return this.currentTransform.isPointOnMapSurface(c,f)}getRayDirectionFromPixel(c){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(c)}getMatrixForModel(c,f){return this.currentTransform.getMatrixForModel(c,f)}getProjectionDataForCustomLayer(c=!0){let f=this._mercatorTransform.getProjectionDataForCustomLayer(c);if(!this.isGlobeRendering)return f;let b=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(c);return b.fallbackMatrix=f.mainMatrix,b}getFastPathSimpleProjectionMatrix(c){return this.currentTransform.getFastPathSimpleProjectionMatrix(c)}}class Ke{get useGlobeControls(){return!0}handlePanInertia(c,f){let b=YA(c,f);return Math.abs(b.lng-f.center.lng)>180&&(b.lng=f.center.lng+179.5*Math.sign(b.lng-f.center.lng)),{easingCenter:b,easingOffset:new o.P(0,0)}}handleMapControlsRollPitchBearingZoom(c,f){let b=c.around,S=f.screenPointToLocation(b);c.bearingDelta&&f.setBearing(f.bearing+c.bearingDelta),c.pitchDelta&&f.setPitch(f.pitch+c.pitchDelta),c.rollDelta&&f.setRoll(f.roll+c.rollDelta);let D=f.zoom;c.zoomDelta&&f.setZoom(f.zoom+c.zoomDelta);let N=f.zoom-D;if(N===0)return;let G=o.bI(f.center.lng,S.lng),q=G/(Math.abs(G/180)+1),K=o.bI(f.center.lat,S.lat),it=f.getRayDirectionFromPixel(b),ct=f.cameraPosition,ut=-1*o.b3(ct,it),gt=o.by();o.a_(gt,ct,[it[0]*ut,it[1]*ut,it[2]*ut]);let yt=o.b5(gt)-1,Pt=Math.exp(.5*-Math.max(yt-.3,0)),Ct=Hl(f.worldSize,f.center.lat)/Math.min(f.width,f.height),Rt=o.bv(Ct,.9,.5,1,.25),Ut=(1-o.an(-N))*Math.min(Pt,Rt),Gt=f.center.lat,zt=f.zoom,jt=new o.V(f.center.lng+q*Ut,o.ak(f.center.lat+K*Ut,-o.al,o.al));f.setLocationAtPoint(S,b);let Wt=f.center,It=o.bv(Math.abs(G),45,85,0,1),Xt=o.bv(Ct,.75,.35,0,1),Kt=Math.pow(Math.max(It,Xt),.25),de=o.bI(Wt.lng,jt.lng),le=o.bI(Wt.lat,jt.lat);f.setCenter(new o.V(Wt.lng+de*Kt,Wt.lat+le*Kt).wrap()),f.setZoom(zt+ko(Gt,f.center.lat))}handleMapControlsPan(c,f,b){if(!c.panDelta)return;let S=f.center.lat,D=f.zoom;f.setCenter(YA(c.panDelta,f).wrap()),f.setZoom(D+ko(S,f.center.lat))}cameraForBoxAndBearing(c,f,b,S,D){let N=Zu(c,f,b,S,D),G=f.left/D.width*2-1,q=(D.width-f.right)/D.width*2-1,K=f.top/D.height*-2+1,it=(D.height-f.bottom)/D.height*-2+1,ct=o.bI(b.getWest(),b.getEast())<0,ut=ct?b.getEast():b.getWest(),gt=ct?b.getWest():b.getEast(),yt=Math.max(b.getNorth(),b.getSouth()),Pt=Math.min(b.getNorth(),b.getSouth()),Ct=ut+.5*o.bI(ut,gt),Rt=yt+.5*o.bI(yt,Pt),Ut=D.clone();Ut.setCenter(N.center),Ut.setBearing(N.bearing),Ut.setPitch(0),Ut.setRoll(0),Ut.setZoom(N.zoom);let Gt=Ut.modelViewProjectionMatrix,zt=[Li(b.getNorthWest()),Li(b.getNorthEast()),Li(b.getSouthWest()),Li(b.getSouthEast()),Li(new o.V(gt,Rt)),Li(new o.V(ut,Rt)),Li(new o.V(Ct,yt)),Li(new o.V(Ct,Pt))],jt=Li(N.center),Wt=Number.POSITIVE_INFINITY;for(let It of zt)G<0&&(Wt=Ke.getLesserNonNegativeNonNull(Wt,Ke.solveVectorScale(It,jt,Gt,\"x\",G))),q>0&&(Wt=Ke.getLesserNonNegativeNonNull(Wt,Ke.solveVectorScale(It,jt,Gt,\"x\",q))),K>0&&(Wt=Ke.getLesserNonNegativeNonNull(Wt,Ke.solveVectorScale(It,jt,Gt,\"y\",K))),it<0&&(Wt=Ke.getLesserNonNegativeNonNull(Wt,Ke.solveVectorScale(It,jt,Gt,\"y\",it)));if(Number.isFinite(Wt)&&Wt!==0)return N.zoom=Ut.zoom+o.aq(Wt),N;Wl()}handleJumpToCenterZoom(c,f){let b=c.center.lat,S=c.applyConstrain(f.center?o.V.convert(f.center):c.center,c.zoom).center;c.setCenter(S.wrap());let D=f.zoom!==void 0?+f.zoom:c.zoom+ko(b,S.lat);c.zoom!==D&&c.setZoom(D)}handleEaseTo(c,f){let b=c.zoom,S=c.center,D=c.padding,N={roll:c.roll,pitch:c.pitch,bearing:c.bearing},G={roll:f.roll===void 0?c.roll:f.roll,pitch:f.pitch===void 0?c.pitch:f.pitch,bearing:f.bearing===void 0?c.bearing:f.bearing},q=f.zoom!==void 0,K=!c.isPaddingEqual(f.padding),it=!1,ct=f.center?o.V.convert(f.center):S,ut=c.applyConstrain(ct,b).center;ra(c,ut);let gt=c.clone();gt.setCenter(ut),gt.setZoom(q?+f.zoom:b+ko(S.lat,ct.lat)),gt.setBearing(f.bearing);let yt=new o.P(o.ak(c.centerPoint.x+f.offsetAsPoint.x,0,c.width),o.ak(c.centerPoint.y+f.offsetAsPoint.y,0,c.height));gt.setLocationAtPoint(ut,yt);let Pt=(f.offset&&f.offsetAsPoint.mag())>0?gt.center:ut,Ct=q?+f.zoom:b+ko(S.lat,Pt.lat),Rt=b+ko(S.lat,0),Ut=Ct+ko(Pt.lat,0),Gt=o.bI(S.lng,Pt.lng),zt=o.bI(S.lat,Pt.lat),jt=o.an(Ut-Rt);return it=Ct!==b,{easeFunc:Wt=>{if(o.bm(N,G)||j_({startEulerAngles:N,endEulerAngles:G,tr:c,k:Wt,useSlerp:N.roll!=G.roll}),K&&c.interpolatePadding(D,f.padding,Wt),f.around)o.w(\"Easing around a point is not supported under globe projection.\"),c.setLocationAtPoint(f.around,f.aroundPoint);else{let It=Ut>Rt?Math.min(2,jt):Math.max(.5,jt),Xt=Math.pow(It,1-Wt),Kt=Sm(S,Gt,zt,Wt*Xt);c.setCenter(Kt.wrap())}if(it){let It=o.G.number(Rt,Ut,Wt)+ko(0,c.center.lat);c.setZoom(It)}},isZooming:it,elevationCenter:Pt}}handleFlyTo(c,f){let b=f.zoom!==void 0,S=c.center,D=c.zoom,N=c.padding,G=!c.isPaddingEqual(f.padding),q=c.applyConstrain(o.V.convert(f.center||f.locationAtOffset),D).center,K=b?+f.zoom:c.zoom+ko(c.center.lat,q.lat),it=c.clone();it.setCenter(q),it.setZoom(K),it.setBearing(f.bearing);let ct=new o.P(o.ak(c.centerPoint.x+f.offsetAsPoint.x,0,c.width),o.ak(c.centerPoint.y+f.offsetAsPoint.y,0,c.height));it.setLocationAtPoint(q,ct);let ut=it.center;ra(c,ut);let gt=(function(zt,jt,Wt){let It=Li(jt),Xt=Li(Wt),Kt=o.b3(It,Xt),de=Math.acos(Kt),le=Np(zt);return de/(2*Math.PI)*le})(c,S,ut),yt=D+ko(S.lat,0),Pt=K+ko(ut.lat,0),Ct=o.an(Pt-yt),Rt;if(typeof f.minZoom==\"number\"){let zt=+f.minZoom+ko(ut.lat,0),jt=Math.min(zt,yt,Pt)+ko(0,ut.lat),Wt=c.applyConstrain(ut,jt).zoom+ko(ut.lat,0);Rt=o.an(Wt-yt)}let Ut=o.bI(S.lng,ut.lng),Gt=o.bI(S.lat,ut.lat);return{easeFunc:(zt,jt,Wt,It)=>{let Xt=Sm(S,Ut,Gt,Wt);G&&c.interpolatePadding(N,f.padding,zt);let Kt=zt===1?ut:Xt;c.setCenter(Kt.wrap());let de=yt+o.aq(jt);c.setZoom(zt===1?K:de+ko(0,Kt.lat))},scaleOfZoom:Ct,targetCenter:ut,scaleOfMinZoom:Rt,pixelPathLength:gt}}static solveVectorScale(c,f,b,S,D){let N=S===\"x\"?[b[0],b[4],b[8],b[12]]:[b[1],b[5],b[9],b[13]],G=[b[3],b[7],b[11],b[15]],q=c[0]*N[0]+c[1]*N[1]+c[2]*N[2],K=c[0]*G[0]+c[1]*G[1]+c[2]*G[2],it=f[0]*N[0]+f[1]*N[1]+f[2]*N[2],ct=f[0]*G[0]+f[1]*G[1]+f[2]*G[2];return it+D*K===q+D*ct||G[3]*(q-it)+N[3]*(ct-K)+q*ct==it*K?null:(it+N[3]-D*ct-D*G[3])/(it-q-D*ct+D*K)}static getLesserNonNegativeNonNull(c,f){return f!==null&&f>=0&&f<c?f:c}}class Be{constructor(c){this._globe=c,this._mercatorCameraHelper=new HA,this._verticalPerspectiveCameraHelper=new Ke}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(c,f){return this.currentHelper.handlePanInertia(c,f)}handleMapControlsRollPitchBearingZoom(c,f){return this.currentHelper.handleMapControlsRollPitchBearingZoom(c,f)}handleMapControlsPan(c,f,b){this.currentHelper.handleMapControlsPan(c,f,b)}cameraForBoxAndBearing(c,f,b,S,D){return this.currentHelper.cameraForBoxAndBearing(c,f,b,S,D)}handleJumpToCenterZoom(c,f){this.currentHelper.handleJumpToCenterZoom(c,f)}handleEaseTo(c,f){return this.currentHelper.handleEaseTo(c,f)}handleFlyTo(c,f){return this.currentHelper.handleFlyTo(c,f)}}let v=(I,c)=>o.B(I,c&&c.filter((f=>f.identifier!==\"source.canvas\"))),An=o.bM();class Ni extends o.E{constructor(c,f={}){var b,S;super(),this._rtlPluginLoaded=()=>{for(let N in this.tileManagers){let G=this.tileManagers[N].getSource().type;G!==\"vector\"&&G!==\"geojson\"||this.tileManagers[N].reload()}},this.map=c,this.dispatcher=new Ce(ee(),c._getMapId()),this.dispatcher.registerMessageHandler(\"GG\",((N,G)=>this.getGlyphs(N,G))),this.dispatcher.registerMessageHandler(\"GI\",((N,G)=>this.getImages(N,G))),this.dispatcher.registerMessageHandler(\"GDA\",((N,G)=>this.getDashes(N,G))),this.imageManager=new rt,this.imageManager.setEventedParent(this);let D=((b=c._container)===null||b===void 0?void 0:b.lang)||typeof document<\"u\"&&((S=document.documentElement)===null||S===void 0?void 0:S.lang)||void 0;this.glyphManager=new ft(c._requestManager,f.localIdeographFontFamily,D),this.lineAtlas=new Yt(256,512),this.crossTileSymbolIndex=new l2,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast(\"SR\",o.bN()),ja().on(Va,this._rtlPluginLoaded),this.on(\"data\",(N=>{if(N.dataType!==\"source\"||N.sourceDataType!==\"metadata\")return;let G=this.tileManagers[N.sourceId];if(!G)return;let q=G.getSource();if(q&&q.vectorLayerIds)for(let K in this._layers){let it=this._layers[K];it.source===q.id&&this._validateLayer(it)}}))}_setInitialValues(){var c;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new o.bO,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((c=this.crossTileSymbolIndex)===null||c===void 0?void 0:c.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(c,f){var b,S,D;this._checkLoaded();let N=f===null?(D=(S=(b=this.stylesheet.state)===null||b===void 0?void 0:b[c])===null||S===void 0?void 0:S.default)!==null&&D!==void 0?D:null:f;if(o.bP(N,this._globalState[c]))return this;this._globalState[c]=N,this._applyGlobalStateChanges([c])}getGlobalState(){return this._globalState}setGlobalState(c){this._checkLoaded();let f=[];for(let b in c)!o.bP(this._globalState[b],c[b].default)&&(f.push(b),this._globalState[b]=c[b].default);this._applyGlobalStateChanges(f)}_applyGlobalStateChanges(c){if(c.length===0)return;let f=new Set,b={};for(let S of c){b[S]=this._globalState[S];for(let D in this._layers){let N=this._layers[D],G=N.getLayoutAffectingGlobalStateRefs(),q=N.getPaintAffectingGlobalStateRefs(),K=N.getVisibilityAffectingGlobalStateRefs();if(G.has(S)&&f.add(N.source),q.has(S))for(let{name:it,value:ct}of q.get(S))this._updatePaintProperty(N,it,ct);K?.has(S)&&(N.recalculateVisibility(),this._updateLayer(N))}}this.dispatcher.broadcast(\"UGS\",b);for(let S in this.tileManagers)f.has(S)&&(this._reloadSource(S),this._changed=!0)}loadURL(c){return o._(this,arguments,void 0,(function*(f,b={},S){this.fire(new o.l(\"dataloading\",{dataType:\"style\"})),b.validate=typeof b.validate!=\"boolean\"||b.validate;let D=yield this.map._requestManager.transformRequest(f,\"Style\");this._loadStyleRequest=new AbortController;let N=this._loadStyleRequest;try{let G=yield o.j(D,this._loadStyleRequest);this._loadStyleRequest=null,this._load(G.data,b,S)}catch(G){this._loadStyleRequest=null,G&&!N.signal.aborted&&this.fire(new o.k(G))}}))}loadJSON(c,f={},b){this.fire(new o.l(\"dataloading\",{dataType:\"style\"})),this._frameRequest=new AbortController,w.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,f.validate=f.validate!==!1,this._load(c,f,b)})).catch((()=>{}))}loadEmpty(){this.fire(new o.l(\"dataloading\",{dataType:\"style\"})),this._load(An,{validate:!1})}_load(c,f,b){var S,D;let N=f.transformStyle?f.transformStyle(b,c):c;if(!f.validate||!v(this,o.C(N))){N=Object.assign({},N),this._loaded=!0,this.stylesheet=N;for(let G in N.sources)this.addSource(G,N.sources[G],{validate:!1});N.sprite?this._loadSprite(N.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(N.glyphs),this._createLayers(),this.light=new Ft(this.stylesheet.light),this._setProjectionInternal(((S=this.stylesheet.projection)===null||S===void 0?void 0:S.type)||\"mercator\"),this.sky=new $t(this.stylesheet.sky),this.map.setTerrain((D=this.stylesheet.terrain)!==null&&D!==void 0?D:null),this.fire(new o.l(\"data\",{dataType:\"style\"})),this.fire(new o.l(\"style.load\"))}}_createLayers(){var c,f,b;let S=o.bQ(this.stylesheet.layers);this.setGlobalState((c=this.stylesheet.state)!==null&&c!==void 0?c:null),this.dispatcher.broadcast(\"SL\",S),this._order=S.map((D=>D.id)),this._layers={},this._serializedLayers=null;for(let D of S){let N=o.bR(D,this._globalState);if(N.setEventedParent(this,{layer:{id:D.id}}),this._layers[D.id]=N,o.bS(N)&&this.tileManagers[N.source]){let G=(b=(f=D.paint)===null||f===void 0?void 0:f[\"raster-fade-duration\"])!==null&&b!==void 0?b:N.paint.get(\"raster-fade-duration\");this.tileManagers[N.source].setRasterFadeDuration(G)}}}_loadSprite(c,f=!1,b=void 0){this.imageManager.setLoaded(!1);let S=new AbortController,D;this._spriteRequest=S,(function(N,G,q,K){return o._(this,void 0,void 0,(function*(){let it=H(N),ct=q>1?\"@2x\":\"\",ut={},gt={};for(let{id:yt,url:Pt}of it){let Ct=yield G.transformRequest(Q(Pt,ct,\".json\"),\"SpriteJSON\");ut[yt]=o.j(Ct,K);let Rt=yield G.transformRequest(Q(Pt,ct,\".png\"),\"SpriteImage\");gt[yt]=W.getImage(Rt,K)}return yield Promise.all([...Object.values(ut),...Object.values(gt)]),(function(yt,Pt){return o._(this,void 0,void 0,(function*(){let Ct={};for(let Rt in yt){Ct[Rt]={};let Ut=w.getImageCanvasContext((yield Pt[Rt]).data),Gt=(yield yt[Rt]).data;for(let zt in Gt){let{width:jt,height:Wt,x:It,y:Xt,sdf:Kt,pixelRatio:de,stretchX:le,stretchY:me,content:Le,textFitWidth:$e,textFitHeight:Ee}=Gt[zt];Ct[Rt][zt]={data:null,pixelRatio:de,sdf:Kt,stretchX:le,stretchY:me,content:Le,textFitWidth:$e,textFitHeight:Ee,spriteData:{width:jt,height:Wt,x:It,y:Xt,context:Ut}}}}return Ct}))})(ut,gt)}))})(c,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((N=>{if(this._spriteRequest=null,N)for(let G in N){this._spritesImagesIds[G]=[];let q=this._spritesImagesIds[G]?this._spritesImagesIds[G].filter((K=>!(K in N))):[];for(let K of q)this.imageManager.removeImage(K),this._changedImages[K]=!0;for(let K in N[G]){let it=G===\"default\"?K:`${G}:${K}`;this._spritesImagesIds[G].push(it),it in this.imageManager.images?this.imageManager.updateImage(it,N[G][K],!1):this.imageManager.addImage(it,N[G][K]),f&&(this._changedImages[it]=!0)}}})).catch((N=>{this._spriteRequest=null,D=N,S.signal.aborted||this.fire(new o.k(D))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),f&&(this._changed=!0),this.dispatcher.broadcast(\"SI\",this._availableImages),this.fire(new o.l(\"data\",{dataType:\"style\"})),b&&b(D)}))}_unloadSprite(){for(let c of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(c),this._changedImages[c]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(\"SI\",this._availableImages),this.fire(new o.l(\"data\",{dataType:\"style\"}))}_validateLayer(c){let f=this.tileManagers[c.source];if(!f)return;let b=c.sourceLayer;if(!b)return;let S=f.getSource();(S.type===\"geojson\"||S.vectorLayerIds&&S.vectorLayerIds.indexOf(b)===-1)&&this.fire(new o.k(new Error(`Source layer \"${b}\" does not exist on source \"${S.id}\" as specified by style layer \"${c.id}\".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let c in this.tileManagers)if(!this.tileManagers[c].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(c,f=!1){let b=this._serializedAllLayers();if(!c||c.length===0)return Object.values(f?o.bT(b):b);let S=[];for(let D of c)if(b[D]){let N=f?o.bT(b[D]):b[D];S.push(N)}return S}_serializedAllLayers(){let c=this._serializedLayers;if(c)return c;c=this._serializedLayers={};let f=Object.keys(this._layers);for(let b of f){let S=this._layers[b];S.type!==\"custom\"&&(c[b]=S.serialize())}return c}hasTransitions(){var c,f,b;if(!((c=this.light)===null||c===void 0)&&c.hasTransition()||!((f=this.sky)===null||f===void 0)&&f.hasTransition()||!((b=this.projection)===null||b===void 0)&&b.hasTransition())return!0;for(let S in this.tileManagers)if(this.tileManagers[S].hasTransition())return!0;for(let S in this._layers)if(this._layers[S].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error(\"Style is not done loading.\")}update(c){if(!this._loaded)return;let f=this._changed;if(f){let S=Object.keys(this._updatedLayers),D=Object.keys(this._removedLayers);(S.length||D.length)&&this._updateWorkerLayers(S,D);for(let N in this._updatedSources){let G=this._updatedSources[N];if(G===\"reload\")this._reloadSource(N);else{if(G!==\"clear\")throw new Error(`Invalid action ${G}`);this._clearSource(N)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let N in this._updatedPaintProps)this._layers[N].updateTransitions(c);this.light.updateTransitions(c),this.sky.updateTransitions(c),this._resetUpdates()}let b={};for(let S in this.tileManagers){let D=this.tileManagers[S];b[S]=D.used,D.used=!1}for(let S of this._order){let D=this._layers[S];D.recalculate(c,this._availableImages),!D.isHidden(c.zoom)&&D.source&&(this.tileManagers[D.source].used=!0)}for(let S in b){let D=this.tileManagers[S];!!b[S]!=!!D.used&&D.fire(new o.l(\"data\",{sourceDataType:\"visibility\",dataType:\"source\",sourceId:S}))}this.light.recalculate(c),this.sky.recalculate(c),this.projection.recalculate(c),this.z=c.zoom,f&&this.fire(new o.l(\"data\",{dataType:\"style\"}))}_updateTilesForChangedImages(){let c=Object.keys(this._changedImages);if(c.length){for(let f in this.tileManagers)this.tileManagers[f].reloadTilesForDependencies([\"icons\",\"patterns\"],c);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let c in this.tileManagers)this.tileManagers[c].reloadTilesForDependencies([\"glyphs\"],[\"\"]);this._glyphsDidChange=!1}}_updateWorkerLayers(c,f){this.dispatcher.broadcast(\"UL\",{layers:this._serializeByIds(c,!1),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(c,f={}){var b;this._checkLoaded();let S=this.serialize();if(c=f.transformStyle?f.transformStyle(S,c):c,((b=f.validate)===null||b===void 0||b)&&v(this,o.C(c)))return!1;(c=o.bT(c)).layers=o.bQ(c.layers);let D=o.bU(S,c),N=this._getOperationsToPerform(D);if(N.unimplemented.length>0)throw new Error(`Unimplemented: ${N.unimplemented.join(\", \")}.`);if(N.operations.length===0)return!1;for(let G of N.operations)G();return this.stylesheet=c,this._serializedLayers=null,this.fire(new o.l(\"style.load\",{style:this})),!0}_getOperationsToPerform(c){let f=[],b=[];for(let S of c)switch(S.command){case\"setCenter\":case\"setZoom\":case\"setBearing\":case\"setPitch\":case\"setRoll\":continue;case\"addLayer\":f.push((()=>this.addLayer.apply(this,S.args)));break;case\"removeLayer\":f.push((()=>this.removeLayer.apply(this,S.args)));break;case\"setPaintProperty\":f.push((()=>this.setPaintProperty.apply(this,S.args)));break;case\"setLayoutProperty\":f.push((()=>this.setLayoutProperty.apply(this,S.args)));break;case\"setFilter\":f.push((()=>this.setFilter.apply(this,S.args)));break;case\"addSource\":f.push((()=>this.addSource.apply(this,S.args)));break;case\"removeSource\":f.push((()=>this.removeSource.apply(this,S.args)));break;case\"setLayerZoomRange\":f.push((()=>this.setLayerZoomRange.apply(this,S.args)));break;case\"setLight\":f.push((()=>this.setLight.apply(this,S.args)));break;case\"setGeoJSONSourceData\":f.push((()=>this.setGeoJSONSourceData.apply(this,S.args)));break;case\"setGlyphs\":f.push((()=>this.setGlyphs.apply(this,S.args)));break;case\"setSprite\":f.push((()=>this.setSprite.apply(this,S.args)));break;case\"setTerrain\":f.push((()=>this.map.setTerrain.apply(this,S.args)));break;case\"setSky\":f.push((()=>this.setSky.apply(this,S.args)));break;case\"setProjection\":this.setProjection.apply(this,S.args);break;case\"setGlobalState\":f.push((()=>this.setGlobalState.apply(this,S.args)));break;case\"setTransition\":f.push((()=>{}));break;default:b.push(S.command)}return{operations:f,unimplemented:b}}addImage(c,f){if(this.getImage(c))return this.fire(new o.k(new Error(`An image named \"${c}\" already exists.`)));this.imageManager.addImage(c,f),this._afterImageUpdated(c)}updateImage(c,f){this.imageManager.updateImage(c,f)}getImage(c){return this.imageManager.getImage(c)}removeImage(c){if(!this.getImage(c))return this.fire(new o.k(new Error(`An image named \"${c}\" does not exist.`)));this.imageManager.removeImage(c),this._afterImageUpdated(c)}_afterImageUpdated(c){this._availableImages=this.imageManager.listImages(),this._changedImages[c]=!0,this._changed=!0,this.dispatcher.broadcast(\"SI\",this._availableImages),this.fire(new o.l(\"data\",{dataType:\"style\"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(c,f,b={}){if(this._checkLoaded(),this.tileManagers[c]!==void 0)throw new Error(`Source \"${c}\" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(\", \")}.`);if([\"vector\",\"raster\",\"geojson\",\"video\",\"image\"].indexOf(f.type)>=0&&this._validate(o.C.source,`sources.${c}`,f,null,b))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);let S=this.tileManagers[c]=new Os(c,f,this.dispatcher);S.style=this,S.setEventedParent(this,(()=>({isSourceLoaded:S.loaded(),source:S.serialize(),sourceId:c}))),S.onAdd(this.map),this._changed=!0}removeSource(c){if(this._checkLoaded(),this.tileManagers[c]===void 0)throw new Error(`There is no source with this ID=${c}`);for(let b in this._layers)if(this._layers[b].source===c)return this.fire(new o.k(new Error(`Source \"${c}\" cannot be removed while layer \"${b}\" is using it.`)));let f=this.tileManagers[c];delete this.tileManagers[c],delete this._updatedSources[c],f.fire(new o.l(\"data\",{sourceDataType:\"metadata\",dataType:\"source\",sourceId:c})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(c,f){if(this._checkLoaded(),this.tileManagers[c]===void 0)throw new Error(`There is no source with this ID=${c}`);let b=this.tileManagers[c].getSource();if(b.type!==\"geojson\")throw new Error(`geojsonSource.type is ${b.type}, which is !== 'geojson`);b.setData(f),this._changed=!0}getSource(c){return this.tileManagers[c]&&this.tileManagers[c].getSource()}addLayer(c,f,b={}){this._checkLoaded();let S=c.id;if(this.getLayer(S))return void this.fire(new o.k(new Error(`Layer \"${S}\" already exists on this map.`)));let D;if(c.type===\"custom\"){if(v(this,o.bV(c)))return;D=o.bR(c,this._globalState)}else{if(\"source\"in c&&typeof c.source==\"object\"&&(this.addSource(S,c.source),c=o.bT(c),c=o.e(c,{source:S})),this._validate(o.C.layer,`layers.${S}`,c,{arrayIndex:-1},b))return;D=o.bR(c,this._globalState),this._validateLayer(D),D.setEventedParent(this,{layer:{id:S}})}let N=f?this._order.indexOf(f):this._order.length;if(f&&N===-1)this.fire(new o.k(new Error(`Cannot add layer \"${S}\" before non-existing layer \"${f}\".`)));else{if(this._order.splice(N,0,S),this._layerOrderChanged=!0,this._layers[S]=D,this._removedLayers[S]&&D.source&&D.type!==\"custom\"){let G=this._removedLayers[S];delete this._removedLayers[S],G.type!==D.type?this._updatedSources[D.source]=\"clear\":(this._updatedSources[D.source]=\"reload\",this.tileManagers[D.source].pause())}this._updateLayer(D),D.onAdd&&D.onAdd(this.map)}}moveLayer(c,f){if(this._checkLoaded(),this._changed=!0,!this._layers[c])return void this.fire(new o.k(new Error(`The layer '${c}' does not exist in the map's style and cannot be moved.`)));if(c===f)return;let b=this._order.indexOf(c);this._order.splice(b,1);let S=f?this._order.indexOf(f):this._order.length;f&&S===-1?this.fire(new o.k(new Error(`Cannot move layer \"${c}\" before non-existing layer \"${f}\".`))):(this._order.splice(S,0,c),this._layerOrderChanged=!0)}removeLayer(c){this._checkLoaded();let f=this._layers[c];if(!f)return void this.fire(new o.k(new Error(`Cannot remove non-existing layer \"${c}\".`)));f.setEventedParent(null);let b=this._order.indexOf(c);this._order.splice(b,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[c]=f,delete this._layers[c],this._serializedLayers&&delete this._serializedLayers[c],delete this._updatedLayers[c],delete this._updatedPaintProps[c],f.onRemove&&f.onRemove(this.map)}getLayer(c){return this._layers[c]}getLayersOrder(){return[...this._order]}hasLayer(c){return c in this._layers}setLayerZoomRange(c,f,b){this._checkLoaded();let S=this.getLayer(c);S?S.minzoom===f&&S.maxzoom===b||(f!=null&&(S.minzoom=f),b!=null&&(S.maxzoom=b),this._updateLayer(S)):this.fire(new o.k(new Error(`Cannot set the zoom range of non-existing layer \"${c}\".`)))}setFilter(c,f,b={}){this._checkLoaded();let S=this.getLayer(c);if(S){if(!o.bP(S.filter,f))return f==null?(S.setFilter(void 0),void this._updateLayer(S)):void(this._validate(o.C.filter,`layers.${S.id}.filter`,f,null,b)||(S.setFilter(o.bT(f)),this._updateLayer(S)))}else this.fire(new o.k(new Error(`Cannot filter non-existing layer \"${c}\".`)))}getFilter(c){return o.bT(this.getLayer(c).filter)}setLayoutProperty(c,f,b,S={}){this._checkLoaded();let D=this.getLayer(c);D?o.bP(D.getLayoutProperty(f),b)||(D.setLayoutProperty(f,b,S),this._updateLayer(D)):this.fire(new o.k(new Error(`Cannot style non-existing layer \"${c}\".`)))}getLayoutProperty(c,f){let b=this.getLayer(c);if(b)return b.getLayoutProperty(f);this.fire(new o.k(new Error(`Cannot get style of non-existing layer \"${c}\".`)))}setPaintProperty(c,f,b,S={}){this._checkLoaded();let D=this.getLayer(c);D?o.bP(D.getPaintProperty(f),b)||this._updatePaintProperty(D,f,b,S):this.fire(new o.k(new Error(`Cannot style non-existing layer \"${c}\".`)))}_updatePaintProperty(c,f,b,S={}){c.setPaintProperty(f,b,S)&&this._updateLayer(c),o.bS(c)&&f===\"raster-fade-duration\"&&this.tileManagers[c.source].setRasterFadeDuration(b),this._changed=!0,this._updatedPaintProps[c.id]=!0,this._serializedLayers=null}getPaintProperty(c,f){return this.getLayer(c).getPaintProperty(f)}setFeatureState(c,f){this._checkLoaded();let b=c.source,S=c.sourceLayer,D=this.tileManagers[b];if(D===void 0)return void this.fire(new o.k(new Error(`The source '${b}' does not exist in the map's style.`)));let N=D.getSource().type;N===\"geojson\"&&S?this.fire(new o.k(new Error(\"GeoJSON sources cannot have a sourceLayer parameter.\"))):N!==\"vector\"||S?(c.id===void 0&&this.fire(new o.k(new Error(\"The feature id parameter must be provided.\"))),D.setFeatureState(S,c.id,f)):this.fire(new o.k(new Error(\"The sourceLayer parameter must be provided for vector source types.\")))}removeFeatureState(c,f){this._checkLoaded();let b=c.source,S=this.tileManagers[b];if(S===void 0)return void this.fire(new o.k(new Error(`The source '${b}' does not exist in the map's style.`)));let D=S.getSource().type,N=D===\"vector\"?c.sourceLayer:void 0;D!==\"vector\"||N?f&&typeof c.id!=\"string\"&&typeof c.id!=\"number\"?this.fire(new o.k(new Error(\"A feature id is required to remove its specific state property.\"))):S.removeFeatureState(N,c.id,f):this.fire(new o.k(new Error(\"The sourceLayer parameter must be provided for vector source types.\")))}getFeatureState(c){this._checkLoaded();let f=c.source,b=c.sourceLayer,S=this.tileManagers[f];if(S!==void 0)return S.getSource().type!==\"vector\"||b?(c.id===void 0&&this.fire(new o.k(new Error(\"The feature id parameter must be provided.\"))),S.getFeatureState(b,c.id)):void this.fire(new o.k(new Error(\"The sourceLayer parameter must be provided for vector source types.\")));this.fire(new o.k(new Error(`The source '${f}' does not exist in the map's style.`)))}getTransition(){return o.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let c=o.bW(this.tileManagers,(D=>D.serialize())),f=this._serializeByIds(this._order,!0),b=this.map.getTerrain()||void 0,S=this.stylesheet;return o.bX({version:S.version,name:S.name,metadata:S.metadata,light:S.light,sky:S.sky,center:S.center,zoom:S.zoom,bearing:S.bearing,pitch:S.pitch,sprite:S.sprite,glyphs:S.glyphs,transition:S.transition,projection:S.projection,sources:c,layers:f,terrain:b},(D=>D!==void 0))}_updateLayer(c){this._updatedLayers[c.id]=!0,c.source&&!this._updatedSources[c.source]&&this.tileManagers[c.source].getSource().type!==\"raster\"&&(this._updatedSources[c.source]=\"reload\",this.tileManagers[c.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(c){let f=N=>this._layers[N].type===\"fill-extrusion\",b={},S=[];for(let N=this._order.length-1;N>=0;N--){let G=this._order[N];if(f(G)){b[G]=N;for(let q of c){let K=q[G];if(K)for(let it of K)S.push(it)}}}S.sort(((N,G)=>G.intersectionZ-N.intersectionZ));let D=[];for(let N=this._order.length-1;N>=0;N--){let G=this._order[N];if(f(G))for(let q=S.length-1;q>=0;q--){let K=S[q].feature;if(b[K.layer.id]<N)break;D.push(K),S.pop()}else for(let q of c){let K=q[G];if(K)for(let it of K)D.push(it.feature)}}return D}queryRenderedFeatures(c,f,b){f&&f.filter&&this._validate(o.C.filter,\"queryRenderedFeatures.filter\",f.filter,null,f);let S={};if(f&&f.layers){if(!(Array.isArray(f.layers)||f.layers instanceof Set))return this.fire(new o.k(new Error(\"parameters.layers must be an Array or a Set of strings\"))),[];for(let K of f.layers){let it=this._layers[K];if(!it)return this.fire(new o.k(new Error(`The layer '${K}' does not exist in the map's style and cannot be queried for features.`))),[];S[it.source]=!0}}let D=[];f.availableImages=this._availableImages;let N=this._serializedAllLayers(),G=f.layers instanceof Set?f.layers:Array.isArray(f.layers)?new Set(f.layers):null,q=Object.assign(Object.assign({},f),{layers:G,globalState:this._globalState});for(let K in this.tileManagers)f.layers&&!S[K]||D.push(Br(this.tileManagers[K],this._layers,N,c,q,b,this.map.terrain?(it,ct,ut)=>this.map.terrain.getElevation(it,ct,ut):void 0));return this.placement&&D.push((function(K,it,ct,ut,gt,yt,Pt){let Ct={},Rt=yt.queryRenderedSymbols(ut),Ut=[];for(let Gt of Object.keys(Rt).map(Number))Ut.push(Pt[Gt]);Ut.sort(Cr);for(let Gt of Ut){let zt=Gt.featureIndex.lookupSymbolFeatures(Rt[Gt.bucketInstanceId],it,Gt.bucketIndex,Gt.sourceLayerIndex,{filterSpec:gt.filter,globalState:gt.globalState},gt.layers,gt.availableImages,K);for(let jt in zt){let Wt=Ct[jt]=Ct[jt]||[],It=zt[jt];It.sort(((Xt,Kt)=>{let de=Gt.featureSortOrder;if(de){let le=de.indexOf(Xt.featureIndex);return de.indexOf(Kt.featureIndex)-le}return Kt.featureIndex-Xt.featureIndex}));for(let Xt of It)Wt.push(Xt)}}return(function(Gt,zt,jt){for(let Wt in Gt)for(let It of Gt[Wt])Rr(It,jt[zt[Wt].source]);return Gt})(Ct,K,ct)})(this._layers,N,this.tileManagers,c,q,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(D)}querySourceFeatures(c,f){f?.filter&&this._validate(o.C.filter,\"querySourceFeatures.filter\",f.filter,null,f);let b=this.tileManagers[c];return b?(function(S,D){let N=S.getRenderableIds().map((K=>S.getTileByID(K))),G=[],q={};for(let K=0;K<N.length;K++){let it=N[K],ct=it.tileID.canonical.key;q[ct]||(q[ct]=!0,it.querySourceFeatures(G,D))}return G})(b,f?Object.assign(Object.assign({},f),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(c,f={}){this._checkLoaded();let b=this.light.getLight(),S=!1;for(let N in c)if(!o.bP(c[N],b[N])){S=!0;break}if(!S)return;let D={now:R(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(c,f),this.light.updateTransitions(D)}getProjection(){var c;return(c=this.stylesheet)===null||c===void 0?void 0:c.projection}setProjection(c){if(this._checkLoaded(),this.stylesheet.projection=c,this.projection){if(this.projection.name===c.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(c.type)}getSky(){var c;return(c=this.stylesheet)===null||c===void 0?void 0:c.sky}setSky(c,f={}){this._checkLoaded();let b=this.getSky(),S=!1;if(!c&&!b)return;if(c&&!b)S=!0;else if(!c&&b)S=!0;else for(let N in c)if(!o.bP(c[N],b[N])){S=!0;break}if(!S)return;let D={now:R(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=c,this.sky.setSky(c,f),this.sky.updateTransitions(D)}_setProjectionInternal(c){let f=(function(b,S){let D={constrainOverride:S};if(Array.isArray(b)){let N=new qh({type:b});return{projection:N,transform:new De(D),cameraHelper:new Be(N)}}switch(b){case\"mercator\":return{projection:new ta,transform:new Xu(D),cameraHelper:new HA};case\"globe\":{let N=new qh({type:[\"interpolate\",[\"linear\"],[\"zoom\"],11,\"vertical-perspective\",12,\"mercator\"]});return{projection:N,transform:new De(D),cameraHelper:new Be(N)}}case\"vertical-perspective\":return{projection:new iu,transform:new pe(D),cameraHelper:new Ke};default:return o.w(`Unknown projection name: ${b}. Falling back to mercator projection.`),{projection:new ta,transform:new Xu(D),cameraHelper:new HA}}})(c,this.map.transformConstrain);this.projection=f.projection,this.map.migrateProjection(f.transform,f.cameraHelper);for(let b in this.tileManagers)this.tileManagers[b].reload()}_validate(c,f,b,S,D={}){return(!D||D.validate!==!1)&&v(this,c.call(o.C,o.e({key:f,style:this.serialize(),value:b,styleSpec:o.u},S)))}_remove(c=!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),ja().off(Va,this._rtlPluginLoaded);for(let f in this._layers)this._layers[f].setEventedParent(null);for(let f in this.tileManagers){let b=this.tileManagers[f];b.setEventedParent(null),b.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),c&&this.dispatcher.broadcast(\"RM\",void 0),this.dispatcher.remove(c)}_clearSource(c){this.tileManagers[c].clearTiles()}_reloadSource(c){this.tileManagers[c].resume(),this.tileManagers[c].reload()}_updateSources(c){for(let f in this.tileManagers)this.tileManagers[f].update(c,this.map.terrain)}_generateCollisionBoxes(){for(let c in this.tileManagers)this._reloadSource(c)}_updatePlacement(c,f,b,S,D=!1){let N=!1,G=!1,q={};for(let K of this._order){let it=this._layers[K];if(it.type!==\"symbol\")continue;if(!q[it.source]){let ut=this.tileManagers[it.source];q[it.source]=ut.getRenderableIds(!0).map((gt=>ut.getTileByID(gt))).sort(((gt,yt)=>yt.tileID.overscaledZ-gt.tileID.overscaledZ||(gt.tileID.isLessThan(yt.tileID)?-1:1)))}let ct=this.crossTileSymbolIndex.addLayer(it,q[it.source],c.center.lng);N=N||ct}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((D=D||this._layerOrderChanged||b===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(R(),c.zoom))&&(this.pauseablePlacement=new wM(c,this.map.terrain,this._order,D,f,b,S,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,q),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(R()),G=!0),N&&this.pauseablePlacement.placement.setStale()),G||N)for(let K of this._order){let it=this._layers[K];it.type===\"symbol\"&&this.placement.updateLayerOpacities(it,q[it.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(R())}_releaseSymbolFadeTiles(){for(let c in this.tileManagers)this.tileManagers[c].releaseSymbolFadeTiles()}getImages(c,f){return o._(this,void 0,void 0,(function*(){let b=yield this.imageManager.getImages(f.icons);this._updateTilesForChangedImages();let S=this.tileManagers[f.source];return S&&S.setDependencies(f.tileID.key,f.type,f.icons),b}))}getGlyphs(c,f){return o._(this,void 0,void 0,(function*(){let b=yield this.glyphManager.getGlyphs(f.stacks),S=this.tileManagers[f.source];return S&&S.setDependencies(f.tileID.key,f.type,[\"\"]),b}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(c,f={}){this._checkLoaded(),c&&this._validate(o.C.glyphs,\"glyphs\",c,null,f)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=c,this.glyphManager.entries={},this.glyphManager.setURL(c))}getDashes(c,f){return o._(this,void 0,void 0,(function*(){let b={};for(let[S,D]of Object.entries(f.dashes))b[S]=this.lineAtlas.getDash(D.dasharray,D.round);return b}))}addSprite(c,f,b={},S){this._checkLoaded();let D=[{id:c,url:f}],N=[...H(this.stylesheet.sprite),...D];this._validate(o.C.sprite,\"sprite\",N,null,b)||(this.stylesheet.sprite=N,this._loadSprite(D,!0,S))}removeSprite(c){this._checkLoaded();let f=H(this.stylesheet.sprite);if(f.find((b=>b.id===c))){if(this._spritesImagesIds[c])for(let b of this._spritesImagesIds[c])this.imageManager.removeImage(b),this._changedImages[b]=!0;f.splice(f.findIndex((b=>b.id===c)),1),this.stylesheet.sprite=f.length>0?f:void 0,delete this._spritesImagesIds[c],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(\"SI\",this._availableImages),this.fire(new o.l(\"data\",{dataType:\"style\"}))}else this.fire(new o.k(new Error(`Sprite \"${c}\" doesn't exists on this map.`)))}getSprite(){return H(this.stylesheet.sprite)}setSprite(c,f={},b){this._checkLoaded(),c&&this._validate(o.C.sprite,\"sprite\",c,null,f)||(this.stylesheet.sprite=c,c?this._loadSprite(c,!0,b):(this._unloadSprite(),b&&b(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(let c in this.tileManagers){let f=this.tileManagers[c];f.setEventedParent(null),f.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let c in this._layers){let f=this._layers[c];f.setEventedParent(null),f.onRemove&&f.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler(\"GG\"),this.dispatcher.unregisterMessageHandler(\"GI\"),this.dispatcher.unregisterMessageHandler(\"GDA\"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var _t=o.aS([{name:\"a_pos\",type:\"Int16\",components:2},{name:\"a_texture_pos\",type:\"Int16\",components:2}]);class _o{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(c,f,b,S,D,N,G,q,K){this.context=c;let it=this.boundPaintVertexBuffers.length!==S.length;for(let ct=0;!it&&ct<S.length;ct++)this.boundPaintVertexBuffers[ct]!==S[ct]&&(it=!0);!this.vao||this.boundProgram!==f||this.boundLayoutVertexBuffer!==b||it||this.boundIndexBuffer!==D||this.boundVertexOffset!==N||this.boundDynamicVertexBuffer!==G||this.boundDynamicVertexBuffer2!==q||this.boundDynamicVertexBuffer3!==K?this.freshBind(f,b,S,D,N,G,q,K):(c.bindVertexArray.set(this.vao),G&&G.bind(),D&&D.dynamicDraw&&D.bind(),q&&q.bind(),K&&K.bind())}freshBind(c,f,b,S,D,N,G,q){let K=c.numAttributes,it=this.context,ct=it.gl;this.vao&&this.destroy(),this.vao=it.createVertexArray(),it.bindVertexArray.set(this.vao),this.boundProgram=c,this.boundLayoutVertexBuffer=f,this.boundPaintVertexBuffers=b,this.boundIndexBuffer=S,this.boundVertexOffset=D,this.boundDynamicVertexBuffer=N,this.boundDynamicVertexBuffer2=G,this.boundDynamicVertexBuffer3=q,f.enableAttributes(ct,c);for(let ut of b)ut.enableAttributes(ct,c);N&&N.enableAttributes(ct,c),G&&G.enableAttributes(ct,c),q&&q.enableAttributes(ct,c),f.bind(),f.setVertexAttribPointers(ct,c,D);for(let ut of b)ut.bind(),ut.setVertexAttribPointers(ct,c,D);N&&(N.bind(),N.setVertexAttribPointers(ct,c,D)),S&&S.bind(),G&&(G.bind(),G.setVertexAttribPointers(ct,c,D)),q&&(q.bind(),q.setVertexAttribPointers(ct,c,D)),it.currentNumAttributes=K}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let $a=(I,c,f,b,S)=>({u_texture:0,u_ele_delta:I,u_fog_matrix:c,u_fog_color:f?f.properties.get(\"fog-color\"):o.bn.white,u_fog_ground_blend:f?f.properties.get(\"fog-ground-blend\"):1,u_fog_ground_blend_opacity:S?0:f?f.calculateFogBlendOpacity(b):0,u_horizon_color:f?f.properties.get(\"horizon-color\"):o.bn.white,u_horizon_fog_blend:f?f.properties.get(\"horizon-fog-blend\"):1,u_is_globe_mode:S?1:0}),Ro={mainMatrix:\"u_projection_matrix\",tileMercatorCoords:\"u_projection_tile_mercator_coords\",clippingPlane:\"u_projection_clipping_plane\",projectionTransition:\"u_projection_transition\",fallbackMatrix:\"u_projection_fallback_matrix\"};function Bi(I){let c=[];for(let f=0;f<I.length;f++){if(I[f]===null)continue;let b=I[f].split(\" \");c.push(b.pop())}return c}class un{constructor(c,f,b,S,D,N,G,q,K=[]){let it=c.gl;this.program=it.createProgram();let ct=Bi(f.staticAttributes),ut=b?b.getBinderAttributes():[],gt=ct.concat(ut),yt=yo.prelude.staticUniforms?Bi(yo.prelude.staticUniforms):[],Pt=G.staticUniforms?Bi(G.staticUniforms):[],Ct=f.staticUniforms?Bi(f.staticUniforms):[],Rt=b?b.getBinderUniforms():[],Ut=yt.concat(Pt).concat(Ct).concat(Rt),Gt=[];for(let de of Ut)Gt.indexOf(de)<0&&Gt.push(de);let zt=b?b.defines():[];Ar(it)&&zt.unshift(\"#version 300 es\"),D&&zt.push(\"#define OVERDRAW_INSPECTOR;\"),N&&zt.push(\"#define TERRAIN3D;\"),q&&zt.push(q),K&&zt.push(...K);let jt=zt.concat(yo.prelude.fragmentSource,G.fragmentSource,f.fragmentSource).join(`\n`),Wt=zt.concat(yo.prelude.vertexSource,G.vertexSource,f.vertexSource).join(`\n`);Ar(it)||(jt=(function(de){return de.replace(/\\bin\\s/g,\"varying \").replace(\"out highp vec4 fragColor;\",\"\").replace(/fragColor/g,\"gl_FragColor\").replace(/texture\\(/g,\"texture2D(\")})(jt),Wt=(function(de){return de.replace(/\\bin\\s/g,\"attribute \").replace(/\\bout\\s/g,\"varying \").replace(/texture\\(/g,\"texture2D(\")})(Wt));let It=it.createShader(it.FRAGMENT_SHADER);if(it.isContextLost())return void(this.failedToCreate=!0);if(it.shaderSource(It,jt),it.compileShader(It),!it.getShaderParameter(It,it.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${it.getShaderInfoLog(It)}`);it.attachShader(this.program,It);let Xt=it.createShader(it.VERTEX_SHADER);if(it.isContextLost())return void(this.failedToCreate=!0);if(it.shaderSource(Xt,Wt),it.compileShader(Xt),!it.getShaderParameter(Xt,it.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${it.getShaderInfoLog(Xt)}`);it.attachShader(this.program,Xt),this.attributes={};let Kt={};this.numAttributes=gt.length;for(let de=0;de<this.numAttributes;de++)gt[de]&&(it.bindAttribLocation(this.program,de,gt[de]),this.attributes[gt[de]]=de);if(it.linkProgram(this.program),!it.getProgramParameter(this.program,it.LINK_STATUS))throw new Error(`Program failed to link: ${it.getProgramInfoLog(this.program)}`);it.deleteShader(Xt),it.deleteShader(It);for(let de=0;de<Gt.length;de++){let le=Gt[de];if(le&&!Kt[le]){let me=it.getUniformLocation(this.program,le);me&&(Kt[le]=me)}}this.fixedUniforms=S(c,Kt),this.terrainUniforms=((de,le)=>({u_depth:new o.bY(de,le.u_depth),u_terrain:new o.bY(de,le.u_terrain),u_terrain_dim:new o.bo(de,le.u_terrain_dim),u_terrain_matrix:new o.b_(de,le.u_terrain_matrix),u_terrain_unpack:new o.b$(de,le.u_terrain_unpack),u_terrain_exaggeration:new o.bo(de,le.u_terrain_exaggeration)}))(c,Kt),this.projectionUniforms=((de,le)=>({u_projection_matrix:new o.b_(de,le.u_projection_matrix),u_projection_tile_mercator_coords:new o.b$(de,le.u_projection_tile_mercator_coords),u_projection_clipping_plane:new o.b$(de,le.u_projection_clipping_plane),u_projection_transition:new o.bo(de,le.u_projection_transition),u_projection_fallback_matrix:new o.b_(de,le.u_projection_fallback_matrix)}))(c,Kt),this.binderUniforms=b?b.getUniforms(c,Kt):[]}draw(c,f,b,S,D,N,G,q,K,it,ct,ut,gt,yt,Pt,Ct,Rt,Ut,Gt){let zt=c.gl;if(this.failedToCreate)return;if(c.program.set(this.program),c.setDepthMode(b),c.setStencilMode(S),c.setColorMode(D),c.setCullFace(N),q){c.activeTexture.set(zt.TEXTURE2),zt.bindTexture(zt.TEXTURE_2D,q.depthTexture),c.activeTexture.set(zt.TEXTURE3),zt.bindTexture(zt.TEXTURE_2D,q.texture);for(let Wt in this.terrainUniforms)this.terrainUniforms[Wt].set(q[Wt])}if(K)for(let Wt in K)this.projectionUniforms[Ro[Wt]].set(K[Wt]);if(G)for(let Wt in this.fixedUniforms)this.fixedUniforms[Wt].set(G[Wt]);Ct&&Ct.setUniforms(c,this.binderUniforms,yt,{zoom:Pt});let jt=0;switch(f){case zt.LINES:jt=2;break;case zt.TRIANGLES:jt=3;break;case zt.LINE_STRIP:jt=1}for(let Wt of gt.get()){let It=Wt.vaos||(Wt.vaos={});(It[it]||(It[it]=new _o)).bind(c,this,ct,Ct?Ct.getPaintVertexBuffers():[],ut,Wt.vertexOffset,Rt,Ut,Gt),zt.drawElements(f,Wt.primitiveLength*jt,zt.UNSIGNED_SHORT,Wt.primitiveOffset*jt*2)}}}function Ko(I,c,f){let b=1/o.aK(f,1,c.transform.tileZoom),S=Math.pow(2,f.tileID.overscaledZ),D=f.tileSize*Math.pow(2,c.transform.tileZoom)/S,N=D*(f.tileID.canonical.x+f.tileID.wrap*S),G=D*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[b,I.fromScale,I.toScale],u_fade:I.t,u_pixel_coord_upper:[N>>16,G>>16],u_pixel_coord_lower:[65535&N,65535&G]}}let Di=(I,c,f,b)=>{let S=I.style.light,D=S.properties.get(\"position\"),N=[D.x,D.y,D.z],G=o.c2();S.properties.get(\"anchor\")===\"viewport\"&&o.c3(G,I.transform.bearingInRadians),o.c4(N,N,G);let q=I.transform.transformLightDirection(N),K=S.properties.get(\"color\");return{u_lightpos:N,u_lightpos_globe:q,u_lightintensity:S.properties.get(\"intensity\"),u_lightcolor:[K.r,K.g,K.b],u_vertical_gradient:+c,u_opacity:f,u_fill_translate:b}},Zi=(I,c,f,b,S,D,N)=>o.e(Di(I,c,f,b),Ko(D,I,N),{u_height_factor:-Math.pow(2,S.overscaledZ)/N.tileSize/8}),pf=(I,c,f,b)=>o.e(Ko(c,I,f),{u_fill_translate:b}),W_=(I,c)=>({u_world:I,u_fill_translate:c}),u2=(I,c,f,b,S)=>o.e(pf(I,c,f,S),{u_world:b}),XA=(I,c,f,b,S)=>{let D=I.transform,N,G,q=0;if(f.paint.get(\"circle-pitch-alignment\")===\"map\"){let K=o.aK(c,1,D.zoom);N=!0,G=[K,K],q=K/(o.a5*Math.pow(2,c.tileID.overscaledZ))*2*Math.PI*S}else N=!1,G=D.pixelsToGLUnits;return{u_camera_to_center_distance:D.cameraToCenterDistance,u_scale_with_map:+(f.paint.get(\"circle-pitch-scale\")===\"map\"),u_pitch_with_map:+N,u_device_pixel_ratio:I.pixelRatio,u_extrude_scale:G,u_globe_extrude_scale:q,u_translate:b}},ml=I=>({u_pixel_extrude_scale:[1/I.width,1/I.height]}),mf=I=>({u_viewport_size:[I.width,I.height]}),Bs=(I,c=1)=>({u_color:I,u_overlay:0,u_overlay_scale:c}),Mm=(I,c,f,b)=>{let S=o.aK(I,1,c)/(o.a5*Math.pow(2,I.tileID.overscaledZ))*2*Math.PI*b;return{u_extrude_scale:o.aK(I,1,c),u_intensity:f,u_globe_extrude_scale:S}},q_=(I,c,f,b)=>{let S=o.N();o.c5(S,0,I.width,I.height,0,0,1);let D=I.context.gl;return{u_matrix:S,u_world:[D.drawingBufferWidth,D.drawingBufferHeight],u_image:f,u_color_ramp:b,u_opacity:c.paint.get(\"heatmap-opacity\")}},gl=(I,c,f)=>{let b=f.paint.get(\"hillshade-accent-color\"),S;switch(f.paint.get(\"hillshade-method\")){case\"basic\":S=4;break;case\"combined\":S=1;break;case\"igor\":S=2;break;case\"multidirectional\":S=3;break;default:S=0}let D=f.getIlluminationProperties();for(let N=0;N<D.directionRadians.length;N++)f.paint.get(\"hillshade-illumination-anchor\")===\"viewport\"&&(D.directionRadians[N]+=I.transform.bearingInRadians);return{u_image:0,u_latrange:Tt(0,c.tileID),u_exaggeration:f.paint.get(\"hillshade-exaggeration\"),u_altitudes:D.altitudeRadians,u_azimuths:D.directionRadians,u_accent:b,u_method:S,u_highlights:D.highlightColor,u_shadows:D.shadowColor}},ni=(I,c)=>{let f=c.stride,b=o.N();return o.c5(b,0,o.a5,-o.a5,0,0,1),o.O(b,b,[0,-o.a5,0]),{u_matrix:b,u_image:1,u_dimension:[f,f],u_zoom:I.overscaledZ,u_unpack:c.getUnpackVector()}};function Tt(I,c){let f=Math.pow(2,c.canonical.z),b=c.canonical.y;return[new o.a6(0,b/f).toLngLat().lat,new o.a6(0,(b+1)/f).toLngLat().lat]}let Ur=(I,c,f=0)=>({u_image:0,u_unpack:c.getUnpackVector(),u_dimension:[c.stride,c.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:f,u_opacity:I.paint.get(\"color-relief-opacity\")}),Em=(I,c,f,b)=>{let S=I.transform;return{u_translation:Pm(I,c,f),u_ratio:b/o.aK(c,1,S.zoom),u_device_pixel_ratio:I.pixelRatio,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},h2=(I,c,f,b,S)=>o.e(Em(I,c,f,b),{u_image:0,u_image_height:S}),d2=(I,c,f,b,S)=>{let D=I.transform,N=bt(c,D);return{u_translation:Pm(I,c,f),u_texsize:c.imageAtlasTexture.size,u_ratio:b/o.aK(c,1,D.zoom),u_device_pixel_ratio:I.pixelRatio,u_image:0,u_scale:[N,S.fromScale,S.toScale],u_fade:S.t,u_units_to_pixels:[1/D.pixelsToGLUnits[0],1/D.pixelsToGLUnits[1]]}},f2=(I,c,f,b,S)=>{let D=bt(c,I.transform);return o.e(Em(I,c,f,b),{u_tileratio:D,u_crossfade_from:S.fromScale,u_crossfade_to:S.toScale,u_image:0,u_mix:S.t,u_lineatlas_width:I.lineAtlas.width,u_lineatlas_height:I.lineAtlas.height})},H_=(I,c,f,b,S,D)=>{let N=bt(c,I.transform);return o.e(Em(I,c,f,b),{u_image:0,u_image_height:D,u_tileratio:N,u_crossfade_from:S.fromScale,u_crossfade_to:S.toScale,u_image_dash:1,u_mix:S.t,u_lineatlas_width:I.lineAtlas.width,u_lineatlas_height:I.lineAtlas.height})};function bt(I,c){return 1/o.aK(I,1,c.tileZoom)}function Pm(I,c,f){return o.aL(I.transform,c,f.paint.get(\"line-translate\"),f.paint.get(\"line-translate-anchor\"))}let Ju=(I,c,f,b,S)=>{return{u_tl_parent:I,u_scale_parent:c,u_buffer_scale:1,u_fade_t:f.mix,u_opacity:f.opacity*b.paint.get(\"raster-opacity\"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get(\"raster-brightness-min\"),u_brightness_high:b.paint.get(\"raster-brightness-max\"),u_saturation_factor:(N=b.paint.get(\"raster-saturation\"),N>0?1-1/(1.001-N):-N),u_contrast_factor:(D=b.paint.get(\"raster-contrast\"),D>0?1/(1-D):1+D),u_spin_weights:Y_(b.paint.get(\"raster-hue-rotate\")),u_coords_top:[S[0].x,S[0].y,S[1].x,S[1].y],u_coords_bottom:[S[3].x,S[3].y,S[2].x,S[2].y]};var D,N};function Y_(I){I*=Math.PI/180;let c=Math.sin(I),f=Math.cos(I);return[(2*f+1)/3,(-Math.sqrt(3)*c-f+1)/3,(Math.sqrt(3)*c-f+1)/3]}let ZA=(I,c,f,b,S,D,N,G,q,K,it,ct,ut)=>{let gt=N.transform;return{u_is_size_zoom_constant:+(I===\"constant\"||I===\"source\"),u_is_size_feature_constant:+(I===\"constant\"||I===\"camera\"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:gt.cameraToCenterDistance,u_pitch:gt.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:gt.width/gt.height,u_fade_change:N.options.fadeDuration?N.symbolFadeChange:1,u_label_plane_matrix:G,u_coord_matrix:q,u_is_text:+it,u_pitch_with_map:+b,u_is_along_line:S,u_is_variable_anchor:D,u_texsize:ct,u_texture:0,u_translation:K,u_pitched_scale:ut}},KA=(I,c,f,b,S,D,N,G,q,K,it,ct,ut,gt)=>{let yt=N.transform;return o.e(ZA(I,c,f,b,S,D,N,G,q,K,it,ct,gt),{u_gamma_scale:b?Math.cos(yt.pitch*Math.PI/180)*yt.cameraToCenterDistance:1,u_device_pixel_ratio:N.pixelRatio,u_is_halo:1})},p2=(I,c,f,b,S,D,N,G,q,K,it,ct,ut)=>o.e(KA(I,c,f,b,S,D,N,G,q,K,!0,it,0,ut),{u_texsize_icon:ct,u_texture_icon:1}),QA=(I,c)=>({u_opacity:I,u_color:c}),Yh=(I,c,f,b,S)=>o.e((function(D,N,G,q){let K=G.imageManager.getPattern(D.from.toString()),it=G.imageManager.getPattern(D.to.toString()),{width:ct,height:ut}=G.imageManager.getPixelSize(),gt=Math.pow(2,q.tileID.overscaledZ),yt=q.tileSize*Math.pow(2,G.transform.tileZoom)/gt,Pt=yt*(q.tileID.canonical.x+q.tileID.wrap*gt),Ct=yt*q.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:K.tl,u_pattern_br_a:K.br,u_pattern_tl_b:it.tl,u_pattern_br_b:it.br,u_texsize:[ct,ut],u_mix:N.t,u_pattern_size_a:K.displaySize,u_pattern_size_b:it.displaySize,u_scale_a:N.fromScale,u_scale_b:N.toScale,u_tile_units_to_pixels:1/o.aK(q,1,G.transform.tileZoom),u_pixel_coord_upper:[Pt>>16,Ct>>16],u_pixel_coord_lower:[65535&Pt,65535&Ct]}})(f,S,c,b),{u_opacity:I}),Cm=(I,c)=>{},nu={fillExtrusion:(I,c)=>({u_lightpos:new o.c0(I,c.u_lightpos),u_lightpos_globe:new o.c0(I,c.u_lightpos_globe),u_lightintensity:new o.bo(I,c.u_lightintensity),u_lightcolor:new o.c0(I,c.u_lightcolor),u_vertical_gradient:new o.bo(I,c.u_vertical_gradient),u_opacity:new o.bo(I,c.u_opacity),u_fill_translate:new o.c1(I,c.u_fill_translate)}),fillExtrusionPattern:(I,c)=>({u_lightpos:new o.c0(I,c.u_lightpos),u_lightpos_globe:new o.c0(I,c.u_lightpos_globe),u_lightintensity:new o.bo(I,c.u_lightintensity),u_lightcolor:new o.c0(I,c.u_lightcolor),u_vertical_gradient:new o.bo(I,c.u_vertical_gradient),u_height_factor:new o.bo(I,c.u_height_factor),u_opacity:new o.bo(I,c.u_opacity),u_fill_translate:new o.c1(I,c.u_fill_translate),u_image:new o.bY(I,c.u_image),u_texsize:new o.c1(I,c.u_texsize),u_pixel_coord_upper:new o.c1(I,c.u_pixel_coord_upper),u_pixel_coord_lower:new o.c1(I,c.u_pixel_coord_lower),u_scale:new o.c0(I,c.u_scale),u_fade:new o.bo(I,c.u_fade)}),fill:(I,c)=>({u_fill_translate:new o.c1(I,c.u_fill_translate)}),fillPattern:(I,c)=>({u_image:new o.bY(I,c.u_image),u_texsize:new o.c1(I,c.u_texsize),u_pixel_coord_upper:new o.c1(I,c.u_pixel_coord_upper),u_pixel_coord_lower:new o.c1(I,c.u_pixel_coord_lower),u_scale:new o.c0(I,c.u_scale),u_fade:new o.bo(I,c.u_fade),u_fill_translate:new o.c1(I,c.u_fill_translate)}),fillOutline:(I,c)=>({u_world:new o.c1(I,c.u_world),u_fill_translate:new o.c1(I,c.u_fill_translate)}),fillOutlinePattern:(I,c)=>({u_world:new o.c1(I,c.u_world),u_image:new o.bY(I,c.u_image),u_texsize:new o.c1(I,c.u_texsize),u_pixel_coord_upper:new o.c1(I,c.u_pixel_coord_upper),u_pixel_coord_lower:new o.c1(I,c.u_pixel_coord_lower),u_scale:new o.c0(I,c.u_scale),u_fade:new o.bo(I,c.u_fade),u_fill_translate:new o.c1(I,c.u_fill_translate)}),circle:(I,c)=>({u_camera_to_center_distance:new o.bo(I,c.u_camera_to_center_distance),u_scale_with_map:new o.bY(I,c.u_scale_with_map),u_pitch_with_map:new o.bY(I,c.u_pitch_with_map),u_extrude_scale:new o.c1(I,c.u_extrude_scale),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_globe_extrude_scale:new o.bo(I,c.u_globe_extrude_scale),u_translate:new o.c1(I,c.u_translate)}),collisionBox:(I,c)=>({u_pixel_extrude_scale:new o.c1(I,c.u_pixel_extrude_scale)}),collisionCircle:(I,c)=>({u_viewport_size:new o.c1(I,c.u_viewport_size)}),debug:(I,c)=>({u_color:new o.bZ(I,c.u_color),u_overlay:new o.bY(I,c.u_overlay),u_overlay_scale:new o.bo(I,c.u_overlay_scale)}),depth:Cm,clippingMask:Cm,heatmap:(I,c)=>({u_extrude_scale:new o.bo(I,c.u_extrude_scale),u_intensity:new o.bo(I,c.u_intensity),u_globe_extrude_scale:new o.bo(I,c.u_globe_extrude_scale)}),heatmapTexture:(I,c)=>({u_matrix:new o.b_(I,c.u_matrix),u_world:new o.c1(I,c.u_world),u_image:new o.bY(I,c.u_image),u_color_ramp:new o.bY(I,c.u_color_ramp),u_opacity:new o.bo(I,c.u_opacity)}),hillshade:(I,c)=>({u_image:new o.bY(I,c.u_image),u_latrange:new o.c1(I,c.u_latrange),u_exaggeration:new o.bo(I,c.u_exaggeration),u_altitudes:new o.c7(I,c.u_altitudes),u_azimuths:new o.c7(I,c.u_azimuths),u_accent:new o.bZ(I,c.u_accent),u_method:new o.bY(I,c.u_method),u_shadows:new o.c6(I,c.u_shadows),u_highlights:new o.c6(I,c.u_highlights)}),hillshadePrepare:(I,c)=>({u_matrix:new o.b_(I,c.u_matrix),u_image:new o.bY(I,c.u_image),u_dimension:new o.c1(I,c.u_dimension),u_zoom:new o.bo(I,c.u_zoom),u_unpack:new o.b$(I,c.u_unpack)}),colorRelief:(I,c)=>({u_image:new o.bY(I,c.u_image),u_unpack:new o.b$(I,c.u_unpack),u_dimension:new o.c1(I,c.u_dimension),u_elevation_stops:new o.bY(I,c.u_elevation_stops),u_color_stops:new o.bY(I,c.u_color_stops),u_color_ramp_size:new o.bY(I,c.u_color_ramp_size),u_opacity:new o.bo(I,c.u_opacity)}),line:(I,c)=>({u_translation:new o.c1(I,c.u_translation),u_ratio:new o.bo(I,c.u_ratio),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_units_to_pixels:new o.c1(I,c.u_units_to_pixels)}),lineGradient:(I,c)=>({u_translation:new o.c1(I,c.u_translation),u_ratio:new o.bo(I,c.u_ratio),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_units_to_pixels:new o.c1(I,c.u_units_to_pixels),u_image:new o.bY(I,c.u_image),u_image_height:new o.bo(I,c.u_image_height)}),linePattern:(I,c)=>({u_translation:new o.c1(I,c.u_translation),u_texsize:new o.c1(I,c.u_texsize),u_ratio:new o.bo(I,c.u_ratio),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_image:new o.bY(I,c.u_image),u_units_to_pixels:new o.c1(I,c.u_units_to_pixels),u_scale:new o.c0(I,c.u_scale),u_fade:new o.bo(I,c.u_fade)}),lineSDF:(I,c)=>({u_translation:new o.c1(I,c.u_translation),u_ratio:new o.bo(I,c.u_ratio),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_units_to_pixels:new o.c1(I,c.u_units_to_pixels),u_image:new o.bY(I,c.u_image),u_mix:new o.bo(I,c.u_mix),u_tileratio:new o.bo(I,c.u_tileratio),u_crossfade_from:new o.bo(I,c.u_crossfade_from),u_crossfade_to:new o.bo(I,c.u_crossfade_to),u_lineatlas_width:new o.bo(I,c.u_lineatlas_width),u_lineatlas_height:new o.bo(I,c.u_lineatlas_height)}),lineGradientSDF:(I,c)=>({u_translation:new o.c1(I,c.u_translation),u_ratio:new o.bo(I,c.u_ratio),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_units_to_pixels:new o.c1(I,c.u_units_to_pixels),u_image:new o.bY(I,c.u_image),u_image_height:new o.bo(I,c.u_image_height),u_tileratio:new o.bo(I,c.u_tileratio),u_crossfade_from:new o.bo(I,c.u_crossfade_from),u_crossfade_to:new o.bo(I,c.u_crossfade_to),u_image_dash:new o.bY(I,c.u_image_dash),u_mix:new o.bo(I,c.u_mix),u_lineatlas_width:new o.bo(I,c.u_lineatlas_width),u_lineatlas_height:new o.bo(I,c.u_lineatlas_height)}),raster:(I,c)=>({u_tl_parent:new o.c1(I,c.u_tl_parent),u_scale_parent:new o.bo(I,c.u_scale_parent),u_buffer_scale:new o.bo(I,c.u_buffer_scale),u_fade_t:new o.bo(I,c.u_fade_t),u_opacity:new o.bo(I,c.u_opacity),u_image0:new o.bY(I,c.u_image0),u_image1:new o.bY(I,c.u_image1),u_brightness_low:new o.bo(I,c.u_brightness_low),u_brightness_high:new o.bo(I,c.u_brightness_high),u_saturation_factor:new o.bo(I,c.u_saturation_factor),u_contrast_factor:new o.bo(I,c.u_contrast_factor),u_spin_weights:new o.c0(I,c.u_spin_weights),u_coords_top:new o.b$(I,c.u_coords_top),u_coords_bottom:new o.b$(I,c.u_coords_bottom)}),symbolIcon:(I,c)=>({u_is_size_zoom_constant:new o.bY(I,c.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bY(I,c.u_is_size_feature_constant),u_size_t:new o.bo(I,c.u_size_t),u_size:new o.bo(I,c.u_size),u_camera_to_center_distance:new o.bo(I,c.u_camera_to_center_distance),u_pitch:new o.bo(I,c.u_pitch),u_rotate_symbol:new o.bY(I,c.u_rotate_symbol),u_aspect_ratio:new o.bo(I,c.u_aspect_ratio),u_fade_change:new o.bo(I,c.u_fade_change),u_label_plane_matrix:new o.b_(I,c.u_label_plane_matrix),u_coord_matrix:new o.b_(I,c.u_coord_matrix),u_is_text:new o.bY(I,c.u_is_text),u_pitch_with_map:new o.bY(I,c.u_pitch_with_map),u_is_along_line:new o.bY(I,c.u_is_along_line),u_is_variable_anchor:new o.bY(I,c.u_is_variable_anchor),u_texsize:new o.c1(I,c.u_texsize),u_texture:new o.bY(I,c.u_texture),u_translation:new o.c1(I,c.u_translation),u_pitched_scale:new o.bo(I,c.u_pitched_scale)}),symbolSDF:(I,c)=>({u_is_size_zoom_constant:new o.bY(I,c.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bY(I,c.u_is_size_feature_constant),u_size_t:new o.bo(I,c.u_size_t),u_size:new o.bo(I,c.u_size),u_camera_to_center_distance:new o.bo(I,c.u_camera_to_center_distance),u_pitch:new o.bo(I,c.u_pitch),u_rotate_symbol:new o.bY(I,c.u_rotate_symbol),u_aspect_ratio:new o.bo(I,c.u_aspect_ratio),u_fade_change:new o.bo(I,c.u_fade_change),u_label_plane_matrix:new o.b_(I,c.u_label_plane_matrix),u_coord_matrix:new o.b_(I,c.u_coord_matrix),u_is_text:new o.bY(I,c.u_is_text),u_pitch_with_map:new o.bY(I,c.u_pitch_with_map),u_is_along_line:new o.bY(I,c.u_is_along_line),u_is_variable_anchor:new o.bY(I,c.u_is_variable_anchor),u_texsize:new o.c1(I,c.u_texsize),u_texture:new o.bY(I,c.u_texture),u_gamma_scale:new o.bo(I,c.u_gamma_scale),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_is_halo:new o.bY(I,c.u_is_halo),u_translation:new o.c1(I,c.u_translation),u_pitched_scale:new o.bo(I,c.u_pitched_scale)}),symbolTextAndIcon:(I,c)=>({u_is_size_zoom_constant:new o.bY(I,c.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bY(I,c.u_is_size_feature_constant),u_size_t:new o.bo(I,c.u_size_t),u_size:new o.bo(I,c.u_size),u_camera_to_center_distance:new o.bo(I,c.u_camera_to_center_distance),u_pitch:new o.bo(I,c.u_pitch),u_rotate_symbol:new o.bY(I,c.u_rotate_symbol),u_aspect_ratio:new o.bo(I,c.u_aspect_ratio),u_fade_change:new o.bo(I,c.u_fade_change),u_label_plane_matrix:new o.b_(I,c.u_label_plane_matrix),u_coord_matrix:new o.b_(I,c.u_coord_matrix),u_is_text:new o.bY(I,c.u_is_text),u_pitch_with_map:new o.bY(I,c.u_pitch_with_map),u_is_along_line:new o.bY(I,c.u_is_along_line),u_is_variable_anchor:new o.bY(I,c.u_is_variable_anchor),u_texsize:new o.c1(I,c.u_texsize),u_texsize_icon:new o.c1(I,c.u_texsize_icon),u_texture:new o.bY(I,c.u_texture),u_texture_icon:new o.bY(I,c.u_texture_icon),u_gamma_scale:new o.bo(I,c.u_gamma_scale),u_device_pixel_ratio:new o.bo(I,c.u_device_pixel_ratio),u_is_halo:new o.bY(I,c.u_is_halo),u_translation:new o.c1(I,c.u_translation),u_pitched_scale:new o.bo(I,c.u_pitched_scale)}),background:(I,c)=>({u_opacity:new o.bo(I,c.u_opacity),u_color:new o.bZ(I,c.u_color)}),backgroundPattern:(I,c)=>({u_opacity:new o.bo(I,c.u_opacity),u_image:new o.bY(I,c.u_image),u_pattern_tl_a:new o.c1(I,c.u_pattern_tl_a),u_pattern_br_a:new o.c1(I,c.u_pattern_br_a),u_pattern_tl_b:new o.c1(I,c.u_pattern_tl_b),u_pattern_br_b:new o.c1(I,c.u_pattern_br_b),u_texsize:new o.c1(I,c.u_texsize),u_mix:new o.bo(I,c.u_mix),u_pattern_size_a:new o.c1(I,c.u_pattern_size_a),u_pattern_size_b:new o.c1(I,c.u_pattern_size_b),u_scale_a:new o.bo(I,c.u_scale_a),u_scale_b:new o.bo(I,c.u_scale_b),u_pixel_coord_upper:new o.c1(I,c.u_pixel_coord_upper),u_pixel_coord_lower:new o.c1(I,c.u_pixel_coord_lower),u_tile_units_to_pixels:new o.bo(I,c.u_tile_units_to_pixels)}),terrain:(I,c)=>({u_texture:new o.bY(I,c.u_texture),u_ele_delta:new o.bo(I,c.u_ele_delta),u_fog_matrix:new o.b_(I,c.u_fog_matrix),u_fog_color:new o.bZ(I,c.u_fog_color),u_fog_ground_blend:new o.bo(I,c.u_fog_ground_blend),u_fog_ground_blend_opacity:new o.bo(I,c.u_fog_ground_blend_opacity),u_horizon_color:new o.bZ(I,c.u_horizon_color),u_horizon_fog_blend:new o.bo(I,c.u_horizon_fog_blend),u_is_globe_mode:new o.bo(I,c.u_is_globe_mode)}),terrainDepth:(I,c)=>({u_ele_delta:new o.bo(I,c.u_ele_delta)}),terrainCoords:(I,c)=>({u_texture:new o.bY(I,c.u_texture),u_terrain_coords_id:new o.bo(I,c.u_terrain_coords_id),u_ele_delta:new o.bo(I,c.u_ele_delta)}),projectionErrorMeasurement:(I,c)=>({u_input:new o.bo(I,c.u_input),u_output_expected:new o.bo(I,c.u_output_expected)}),atmosphere:(I,c)=>({u_sun_pos:new o.c0(I,c.u_sun_pos),u_atmosphere_blend:new o.bo(I,c.u_atmosphere_blend),u_globe_position:new o.c0(I,c.u_globe_position),u_globe_radius:new o.bo(I,c.u_globe_radius),u_inv_proj_matrix:new o.b_(I,c.u_inv_proj_matrix)}),sky:(I,c)=>({u_sky_color:new o.bZ(I,c.u_sky_color),u_horizon_color:new o.bZ(I,c.u_horizon_color),u_horizon:new o.c1(I,c.u_horizon),u_horizon_normal:new o.c1(I,c.u_horizon_normal),u_sky_horizon_blend:new o.bo(I,c.u_sky_horizon_blend),u_sky_blend:new o.bo(I,c.u_sky_blend)})};class ps{constructor(c,f,b){this.context=c;let S=c.gl;this.buffer=S.createBuffer(),this.dynamicDraw=!!b,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),S.bufferData(S.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||f.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){let f=this.context.gl;if(!this.dynamicDraw)throw new Error(\"Attempted to update data while not in dynamic mode.\");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let TM={Int8:\"BYTE\",Uint8:\"UNSIGNED_BYTE\",Int16:\"SHORT\",Uint16:\"UNSIGNED_SHORT\",Int32:\"INT\",Uint32:\"UNSIGNED_INT\",Float32:\"FLOAT\"};class m2{constructor(c,f,b,S){this.length=f.length,this.attributes=b,this.itemSize=f.bytesPerElement,this.dynamicDraw=S,this.context=c;let D=c.gl;this.buffer=D.createBuffer(),c.bindVertexBuffer.set(this.buffer),D.bufferData(D.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?D.DYNAMIC_DRAW:D.STATIC_DRAW),this.dynamicDraw||f.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){if(c.length!==this.length)throw new Error(`Length of new data is ${c.length}, which doesn't match current length of ${this.length}`);let f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,f){for(let b=0;b<this.attributes.length;b++){let S=f.attributes[this.attributes[b].name];S!==void 0&&c.enableVertexAttribArray(S)}}setVertexAttribPointers(c,f,b){for(let S=0;S<this.attributes.length;S++){let D=this.attributes[S],N=f.attributes[D.name];N!==void 0&&c.vertexAttribPointer(N,D.components,c[TM[D.type]],!1,this.itemSize,D.offset+this.itemSize*(b||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Vi{constructor(c){this.gl=c.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(c){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class X_ extends Vi{getDefault(){return o.bn.transparent}set(c){let f=this.current;(c.r!==f.r||c.g!==f.g||c.b!==f.b||c.a!==f.a||this.dirty)&&(this.gl.clearColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class g2 extends Vi{getDefault(){return 1}set(c){(c!==this.current||this.dirty)&&(this.gl.clearDepth(c),this.current=c,this.dirty=!1)}}class Im extends Vi{getDefault(){return 0}set(c){(c!==this.current||this.dirty)&&(this.gl.clearStencil(c),this.current=c,this.dirty=!1)}}class JA extends Vi{getDefault(){return[!0,!0,!0,!0]}set(c){let f=this.current;(c[0]!==f[0]||c[1]!==f[1]||c[2]!==f[2]||c[3]!==f[3]||this.dirty)&&(this.gl.colorMask(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class ty extends Vi{getDefault(){return!0}set(c){(c!==this.current||this.dirty)&&(this.gl.depthMask(c),this.current=c,this.dirty=!1)}}class Z_ extends Vi{getDefault(){return 255}set(c){(c!==this.current||this.dirty)&&(this.gl.stencilMask(c),this.current=c,this.dirty=!1)}}class tn extends Vi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(c){let f=this.current;(c.func!==f.func||c.ref!==f.ref||c.mask!==f.mask||this.dirty)&&(this.gl.stencilFunc(c.func,c.ref,c.mask),this.current=c,this.dirty=!1)}}class gf extends Vi{getDefault(){let c=this.gl;return[c.KEEP,c.KEEP,c.KEEP]}set(c){let f=this.current;(c[0]!==f[0]||c[1]!==f[1]||c[2]!==f[2]||this.dirty)&&(this.gl.stencilOp(c[0],c[1],c[2]),this.current=c,this.dirty=!1)}}class Af extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;c?f.enable(f.STENCIL_TEST):f.disable(f.STENCIL_TEST),this.current=c,this.dirty=!1}}class Yl extends Vi{getDefault(){return[0,1]}set(c){let f=this.current;(c[0]!==f[0]||c[1]!==f[1]||this.dirty)&&(this.gl.depthRange(c[0],c[1]),this.current=c,this.dirty=!1)}}class A2 extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;c?f.enable(f.DEPTH_TEST):f.disable(f.DEPTH_TEST),this.current=c,this.dirty=!1}}class y2 extends Vi{getDefault(){return this.gl.LESS}set(c){(c!==this.current||this.dirty)&&(this.gl.depthFunc(c),this.current=c,this.dirty=!1)}}class ey extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;c?f.enable(f.BLEND):f.disable(f.BLEND),this.current=c,this.dirty=!1}}class th extends Vi{getDefault(){let c=this.gl;return[c.ONE,c.ZERO]}set(c){let f=this.current;(c[0]!==f[0]||c[1]!==f[1]||this.dirty)&&(this.gl.blendFunc(c[0],c[1]),this.current=c,this.dirty=!1)}}class Vp extends Vi{getDefault(){return o.bn.transparent}set(c){let f=this.current;(c.r!==f.r||c.g!==f.g||c.b!==f.b||c.a!==f.a||this.dirty)&&(this.gl.blendColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class ry extends Vi{getDefault(){return this.gl.FUNC_ADD}set(c){(c!==this.current||this.dirty)&&(this.gl.blendEquation(c),this.current=c,this.dirty=!1)}}class km extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;c?f.enable(f.CULL_FACE):f.disable(f.CULL_FACE),this.current=c,this.dirty=!1}}class iy extends Vi{getDefault(){return this.gl.BACK}set(c){(c!==this.current||this.dirty)&&(this.gl.cullFace(c),this.current=c,this.dirty=!1)}}class K_ extends Vi{getDefault(){return this.gl.CCW}set(c){(c!==this.current||this.dirty)&&(this.gl.frontFace(c),this.current=c,this.dirty=!1)}}class jp extends Vi{getDefault(){return null}set(c){(c!==this.current||this.dirty)&&(this.gl.useProgram(c),this.current=c,this.dirty=!1)}}class Xh extends Vi{getDefault(){return this.gl.TEXTURE0}set(c){(c!==this.current||this.dirty)&&(this.gl.activeTexture(c),this.current=c,this.dirty=!1)}}class ny extends Vi{getDefault(){let c=this.gl;return[0,0,c.drawingBufferWidth,c.drawingBufferHeight]}set(c){let f=this.current;(c[0]!==f[0]||c[1]!==f[1]||c[2]!==f[2]||c[3]!==f[3]||this.dirty)&&(this.gl.viewport(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class Q_ extends Vi{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.bindFramebuffer(f.FRAMEBUFFER,c),this.current=c,this.dirty=!1}}class pi extends Vi{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.bindRenderbuffer(f.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Rm extends Vi{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.bindTexture(f.TEXTURE_2D,c),this.current=c,this.dirty=!1}}class _2 extends Vi{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.bindBuffer(f.ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class v2 extends Vi{getDefault(){return null}set(c){let f=this.gl;f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class Dm extends Vi{getDefault(){return null}set(c){var f;if(c===this.current&&!this.dirty)return;let b=this.gl;Ar(b)?b.bindVertexArray(c):(f=b.getExtension(\"OES_vertex_array_object\"))===null||f===void 0||f.bindVertexArrayOES(c),this.current=c,this.dirty=!1}}class SM extends Vi{getDefault(){return 4}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_ALIGNMENT,c),this.current=c,this.dirty=!1}}class MM extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),this.current=c,this.dirty=!1}}class Fs extends Vi{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,c),this.current=c,this.dirty=!1}}class eh extends Vi{constructor(c,f){super(c),this.context=c,this.parent=f}getDefault(){return null}}class Ns extends eh{setDirty(){this.dirty=!0}set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,c,0),this.current=c,this.dirty=!1}}class $p extends eh{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Gp extends eh{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,c),this.current=c,this.dirty=!1}}let Zh=\"Framebuffer is not complete\";class J_{constructor(c,f,b,S,D){this.context=c,this.width=f,this.height=b;let N=c.gl,G=this.framebuffer=N.createFramebuffer();if(this.colorAttachment=new Ns(c,G),S)this.depthAttachment=D?new Gp(c,G):new $p(c,G);else if(D)throw new Error(\"Stencil cannot be set without depth\");if(N.checkFramebufferStatus(N.FRAMEBUFFER)!==N.FRAMEBUFFER_COMPLETE)throw new Error(Zh)}destroy(){let c=this.context.gl,f=this.colorAttachment.get();if(f&&c.deleteTexture(f),this.depthAttachment){let b=this.depthAttachment.get();b&&c.deleteRenderbuffer(b)}c.deleteFramebuffer(this.framebuffer)}}class b2{constructor(c){var f,b;if(this.gl=c,this.clearColor=new X_(this),this.clearDepth=new g2(this),this.clearStencil=new Im(this),this.colorMask=new JA(this),this.depthMask=new ty(this),this.stencilMask=new Z_(this),this.stencilFunc=new tn(this),this.stencilOp=new gf(this),this.stencilTest=new Af(this),this.depthRange=new Yl(this),this.depthTest=new A2(this),this.depthFunc=new y2(this),this.blend=new ey(this),this.blendFunc=new th(this),this.blendColor=new Vp(this),this.blendEquation=new ry(this),this.cullFace=new km(this),this.cullFaceSide=new iy(this),this.frontFace=new K_(this),this.program=new jp(this),this.activeTexture=new Xh(this),this.viewport=new ny(this),this.bindFramebuffer=new Q_(this),this.bindRenderbuffer=new pi(this),this.bindTexture=new Rm(this),this.bindVertexBuffer=new _2(this),this.bindElementBuffer=new v2(this),this.bindVertexArray=new Dm(this),this.pixelStoreUnpack=new SM(this),this.pixelStoreUnpackPremultiplyAlpha=new MM(this),this.pixelStoreUnpackFlipY=new Fs(this),this.extTextureFilterAnisotropic=c.getExtension(\"EXT_texture_filter_anisotropic\"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=c.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE),Ar(c)){this.HALF_FLOAT=c.HALF_FLOAT;let S=c.getExtension(\"EXT_color_buffer_half_float\");this.RGBA16F=(f=c.RGBA16F)!==null&&f!==void 0?f:S?.RGBA16F_EXT,this.RGB16F=(b=c.RGB16F)!==null&&b!==void 0?b:S?.RGB16F_EXT,c.getExtension(\"EXT_color_buffer_float\")}else{c.getExtension(\"EXT_color_buffer_half_float\"),c.getExtension(\"OES_texture_half_float_linear\");let S=c.getExtension(\"OES_texture_half_float\");this.HALF_FLOAT=S?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(c,f){return new ps(this,c,f)}createVertexBuffer(c,f,b){return new m2(this,c,f,b)}createRenderbuffer(c,f,b){let S=this.gl,D=S.createRenderbuffer();return this.bindRenderbuffer.set(D),S.renderbufferStorage(S.RENDERBUFFER,c,f,b),this.bindRenderbuffer.set(null),D}createFramebuffer(c,f,b,S){return new J_(this,c,f,b,S)}clear({color:c,depth:f,stencil:b}){let S=this.gl,D=0;c&&(D|=S.COLOR_BUFFER_BIT,this.clearColor.set(c),this.colorMask.set([!0,!0,!0,!0])),f!==void 0&&(D|=S.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(f),this.depthMask.set(!0)),b!==void 0&&(D|=S.STENCIL_BUFFER_BIT,this.clearStencil.set(b),this.stencilMask.set(255)),S.clear(D)}setCullFace(c){c.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(c.mode),this.frontFace.set(c.frontFace))}setDepthMode(c){c.func!==this.gl.ALWAYS||c.mask?(this.depthTest.set(!0),this.depthFunc.set(c.func),this.depthMask.set(c.mask),this.depthRange.set(c.range)):this.depthTest.set(!1)}setStencilMode(c){c.test.func!==this.gl.ALWAYS||c.mask?(this.stencilTest.set(!0),this.stencilMask.set(c.mask),this.stencilOp.set([c.fail,c.depthFail,c.pass]),this.stencilFunc.set({func:c.test.func,ref:c.ref,mask:c.test.mask})):this.stencilTest.set(!1)}setColorMode(c){o.bP(c.blendFunction,Rn.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(c.blendFunction),this.blendColor.set(c.blendColor)),this.colorMask.set(c.mask)}createVertexArray(){var c;return Ar(this.gl)?this.gl.createVertexArray():(c=this.gl.getExtension(\"OES_vertex_array_object\"))===null||c===void 0?void 0:c.createVertexArrayOES()}deleteVertexArray(c){var f;return Ar(this.gl)?this.gl.deleteVertexArray(c):(f=this.gl.getExtension(\"OES_vertex_array_object\"))===null||f===void 0?void 0:f.deleteVertexArrayOES(c)}unbindVAO(){this.bindVertexArray.set(null)}}let yf;function Wp(I,c,f,b,S){let D=I.context,N=I.transform,G=D.gl,q=I.useProgram(\"collisionBox\"),K=[],it=0,ct=0;for(let Rt=0;Rt<b.length;Rt++){let Ut=b[Rt],Gt=c.getTile(Ut).getBucket(f);if(!Gt)continue;let zt=S?Gt.textCollisionBox:Gt.iconCollisionBox,jt=Gt.collisionCircleArray;jt.length>0&&(K.push({circleArray:jt,circleOffset:ct,coord:Ut}),it+=jt.length/4,ct=it),zt&&q.draw(D,G.LINES,ii.disabled,ke.disabled,I.colorModeForRenderPass(),Ii.disabled,ml(I.transform),I.style.map.terrain&&I.style.map.terrain.getTerrainData(Ut),N.getProjectionData({overscaledTileID:Ut,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),f.id,zt.layoutVertexBuffer,zt.indexBuffer,zt.segments,null,I.transform.zoom,null,null,zt.collisionVertexBuffer)}if(!S||!K.length)return;let ut=I.useProgram(\"collisionCircle\"),gt=new o.c8;gt.resize(4*it),gt._trim();let yt=0;for(let Rt of K)for(let Ut=0;Ut<Rt.circleArray.length/4;Ut++){let Gt=4*Ut,zt=Rt.circleArray[Gt+0],jt=Rt.circleArray[Gt+1],Wt=Rt.circleArray[Gt+2],It=Rt.circleArray[Gt+3];gt.emplace(yt++,zt,jt,Wt,It,0),gt.emplace(yt++,zt,jt,Wt,It,1),gt.emplace(yt++,zt,jt,Wt,It,2),gt.emplace(yt++,zt,jt,Wt,It,3)}(!yf||yf.length<2*it)&&(yf=(function(Rt){let Ut=2*Rt,Gt=new o.ca;Gt.resize(Ut),Gt._trim();for(let zt=0;zt<Ut;zt++){let jt=6*zt;Gt.uint16[jt+0]=4*zt+0,Gt.uint16[jt+1]=4*zt+1,Gt.uint16[jt+2]=4*zt+2,Gt.uint16[jt+3]=4*zt+2,Gt.uint16[jt+4]=4*zt+3,Gt.uint16[jt+5]=4*zt+0}return Gt})(it));let Pt=D.createIndexBuffer(yf,!0),Ct=D.createVertexBuffer(gt,o.c9.members,!0);for(let Rt of K){let Ut=mf(I.transform);ut.draw(D,G.TRIANGLES,ii.disabled,ke.disabled,I.colorModeForRenderPass(),Ii.disabled,Ut,I.style.map.terrain&&I.style.map.terrain.getTerrainData(Rt.coord),null,f.id,Ct,Pt,o.aV.simpleSegment(0,2*Rt.circleOffset,Rt.circleArray.length,Rt.circleArray.length/2),null,I.transform.zoom,null,null,null)}Ct.destroy(),Pt.destroy()}let Kh=o.ao(new Float32Array(16));function Xl(I,c,f,b,S,D){let{horizontalAlign:N,verticalAlign:G}=o.aP(I);return new o.P((-(N-.5)*c/S+b[0])*D,(-(G-.5)*f/S+b[1])*D)}function oy(I,c,f,b,S,D){let N=c.tileAnchorPoint.add(new o.P(c.translation[0],c.translation[1]));if(c.pitchWithMap){let G=b.mult(D);f||(G=G.rotate(-S));let q=N.add(G);return kp(q.x,q.y,c.pitchedLabelPlaneMatrix,c.getElevation).point}if(f){let G=tu(c.tileAnchorPoint.x+1,c.tileAnchorPoint.y,c).point.sub(I),q=Math.atan(G.y/G.x)+(G.x<0?Math.PI:0);return I.add(b.rotate(q))}return I.add(b)}function x2(I,c,f,b,S,D,N,G,q,K,it,ct){let ut=I.text.placedSymbolArray,gt=I.text.dynamicLayoutVertexArray,yt=I.icon.dynamicLayoutVertexArray,Pt={};gt.clear();for(let Ct=0;Ct<ut.length;Ct++){let Rt=ut.get(Ct),Ut=Rt.hidden||!Rt.crossTileID||I.allowVerticalPlacement&&!Rt.placedOrientation?null:b[Rt.crossTileID];if(Ut){let Gt=new o.P(Rt.anchorX,Rt.anchorY),zt={getElevation:ct,width:S.width,height:S.height,pitchedLabelPlaneMatrix:D,pitchWithMap:f,transform:S,tileAnchorPoint:Gt,translation:K,unwrappedTileID:it},jt=f?Nn(Gt.x,Gt.y,zt):tu(Gt.x,Gt.y,zt),Wt=Gh(S.cameraToCenterDistance,jt.signedDistanceFromCamera),It=o.ax(I.textSizeData,G,Rt)*Wt/o.aJ;f&&(It*=I.tilePixelRatio/N);let{width:Xt,height:Kt,anchor:de,textOffset:le,textBoxScale:me}=Ut,Le=Xl(de,Xt,Kt,le,me,It),$e=S.getPitchedTextCorrection(Gt.x+K[0],Gt.y+K[1],it),Ee=oy(jt.point,zt,c,Le,-S.bearingInRadians,$e),sr=I.allowVerticalPlacement&&Rt.placedOrientation===o.aw.vertical?Math.PI/2:0;for(let ur=0;ur<Rt.numGlyphs;ur++)o.aD(gt,Ee,sr);q&&Rt.associatedIconIndex>=0&&(Pt[Rt.associatedIconIndex]={shiftedAnchor:Ee,angle:sr})}else pl(Rt.numGlyphs,gt)}if(q){yt.clear();let Ct=I.icon.placedSymbolArray;for(let Rt=0;Rt<Ct.length;Rt++){let Ut=Ct.get(Rt);if(Ut.hidden)pl(Ut.numGlyphs,yt);else{let Gt=Pt[Rt];if(Gt)for(let zt=0;zt<Ut.numGlyphs;zt++)o.aD(yt,Gt.shiftedAnchor,Gt.angle);else pl(Ut.numGlyphs,yt)}}I.icon.dynamicLayoutVertexBuffer.updateData(yt)}I.text.dynamicLayoutVertexBuffer.updateData(gt)}function Qh(I,c,f){return f.iconsInText&&c?\"symbolTextAndIcon\":I?\"symbolSDF\":\"symbolIcon\"}function Jh(I,c,f,b,S,D,N,G,q,K,it,ct,ut){let gt=I.context,yt=gt.gl,Pt=I.transform,Ct=G===\"map\",Rt=q===\"map\",Ut=G!==\"viewport\"&&f.layout.get(\"symbol-placement\")!==\"point\",Gt=Ct&&!Rt&&!Ut,zt=!f.layout.get(\"symbol-sort-key\").isConstant(),jt=!1,Wt=I.getDepthModeForSublayer(0,ii.ReadOnly),It=f._unevaluatedLayout.hasValue(\"text-variable-anchor\")||f._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"),Xt=[],Kt=Pt.getCircleRadiusCorrection();for(let de of b){let le=c.getTile(de),me=le.getBucket(f);if(!me)continue;let Le=S?me.text:me.icon;if(!Le||!Le.segments.get().length||!Le.hasVisibleVertices)continue;let $e=Le.programConfigurations.get(f.id),Ee=S||me.sdfIcons,sr=S?me.textSizeData:me.iconSizeData,ur=Rt||Pt.pitch!==0,ji=I.useProgram(Qh(Ee,S,me),$e),Me=o.av(sr,Pt.zoom),Re=I.style.map.terrain&&I.style.map.terrain.getTerrainData(de),wn,fn,oo,en,so=[0,0],pn=null;if(S)fn=le.glyphAtlasTexture,oo=yt.LINEAR,wn=le.glyphAtlasTexture.size,me.iconsInText&&(so=le.imageAtlasTexture.size,pn=le.imageAtlasTexture,en=ur||I.options.rotating||I.options.zooming||sr.kind===\"composite\"||sr.kind===\"camera\"?yt.LINEAR:yt.NEAREST);else{let xt=f.layout.get(\"icon-size\").constantOr(0)!==1||me.iconsNeedLinear;fn=le.imageAtlasTexture,oo=Ee||I.options.rotating||I.options.zooming||xt||ur?yt.LINEAR:yt.NEAREST,wn=le.imageAtlasTexture.size}let Do=o.aK(le,1,I.transform.zoom),ao=Hr(Ct,I.transform,Do),y=o.N();o.ay(y,ao);let _=gi(Rt,Ct,I.transform,Do),x=o.aL(Pt,le,D,N),E=Pt.getProjectionData({overscaledTileID:de,applyGlobeMatrix:!ut,applyTerrainMatrix:!0}),k=It&&me.hasTextData(),B=f.layout.get(\"icon-text-fit\")!==\"none\"&&k&&me.hasIconData();if(Ut){let xt=I.style.map.terrain?(Ot,Dt)=>I.style.map.terrain.getElevation(de,Ot,Dt):null,kt=f.layout.get(\"text-rotation-alignment\")===\"map\";jA(me,I,S,ao,y,Rt,K,kt,de.toUnwrapped(),Pt.width,Pt.height,x,xt)}let U=S&&It||B,$=Ut||U?Kh:Rt?ao:I.transform.clipSpaceToPixelsMatrix,Z=Ee&&f.paint.get(S?\"text-halo-width\":\"icon-halo-width\").constantOr(1)!==0,ot;ot=Ee?me.iconsInText?p2(sr.kind,Me,Gt,Rt,Ut,U,I,$,_,x,wn,so,Kt):KA(sr.kind,Me,Gt,Rt,Ut,U,I,$,_,x,S,wn,0,Kt):ZA(sr.kind,Me,Gt,Rt,Ut,U,I,$,_,x,S,wn,Kt);let ht={program:ji,buffers:Le,uniformValues:ot,projectionData:E,atlasTexture:fn,atlasTextureIcon:pn,atlasInterpolation:oo,atlasInterpolationIcon:en,isSDF:Ee,hasHalo:Z};if(zt&&me.canOverlap){jt=!0;let xt=Le.segments.get();for(let kt of xt)Xt.push({segments:new o.aV([kt]),sortKey:kt.sortKey,state:ht,terrainData:Re})}else Xt.push({segments:Le.segments,sortKey:0,state:ht,terrainData:Re})}jt&&Xt.sort(((de,le)=>de.sortKey-le.sortKey));for(let de of Xt){let le=de.state;if(gt.activeTexture.set(yt.TEXTURE0),le.atlasTexture.bind(le.atlasInterpolation,yt.CLAMP_TO_EDGE),le.atlasTextureIcon&&(gt.activeTexture.set(yt.TEXTURE1),le.atlasTextureIcon&&le.atlasTextureIcon.bind(le.atlasInterpolationIcon,yt.CLAMP_TO_EDGE)),le.isSDF){let me=le.uniformValues;le.hasHalo&&(me.u_is_halo=1,ou(le.buffers,de.segments,f,I,le.program,Wt,it,ct,me,le.projectionData,de.terrainData)),me.u_is_halo=0}ou(le.buffers,de.segments,f,I,le.program,Wt,it,ct,le.uniformValues,le.projectionData,de.terrainData)}}function ou(I,c,f,b,S,D,N,G,q,K,it){let ct=b.context;S.draw(ct,ct.gl.TRIANGLES,D,N,G,Ii.backCCW,q,it,K,f.id,I.layoutVertexBuffer,I.indexBuffer,c,f.paint,b.transform.zoom,I.programConfigurations.get(f.id),I.dynamicLayoutVertexBuffer,I.opacityVertexBuffer)}function Om(I,c,f,b,S){let D=I.context,N=D.gl,G=ke.disabled,q=new Rn([N.ONE,N.ONE],o.bn.transparent,[!0,!0,!0,!0]),K=c.getBucket(f);if(!K)return;let it=b.key,ct=f.heatmapFbos.get(it);ct||(ct=Lm(D,c.tileSize,c.tileSize),f.heatmapFbos.set(it,ct)),D.bindFramebuffer.set(ct.framebuffer),D.viewport.set([0,0,c.tileSize,c.tileSize]),D.clear({color:o.bn.transparent});let ut=K.programConfigurations.get(f.id),gt=I.useProgram(\"heatmap\",ut,!S),yt=I.transform.getProjectionData({overscaledTileID:c.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),Pt=I.style.map.terrain.getTerrainData(b);gt.draw(D,N.TRIANGLES,ii.disabled,G,q,Ii.disabled,Mm(c,I.transform.zoom,f.paint.get(\"heatmap-intensity\"),1),Pt,yt,f.id,K.layoutVertexBuffer,K.indexBuffer,K.segments,f.paint,I.transform.zoom,ut)}function sy(I,c,f,b,S){let D=I.context,N=D.gl,G=I.transform;D.setColorMode(I.colorModeForRenderPass());let q=tv(D,c),K=f.key,it=c.heatmapFbos.get(K);if(!it)return;D.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_2D,it.colorAttachment.get()),D.activeTexture.set(N.TEXTURE1),q.bind(N.LINEAR,N.CLAMP_TO_EDGE);let ct=G.getProjectionData({overscaledTileID:f,applyTerrainMatrix:S,applyGlobeMatrix:!b});I.useProgram(\"heatmapTexture\").draw(D,N.TRIANGLES,ii.disabled,ke.disabled,I.colorModeForRenderPass(),Ii.disabled,q_(I,c,0,1),null,ct,c.id,I.rasterBoundsBuffer,I.quadTriangleIndexBuffer,I.rasterBoundsSegments,c.paint,G.zoom),it.destroy(),c.heatmapFbos.delete(K)}function Lm(I,c,f){var b,S;let D=I.gl,N=D.createTexture();D.bindTexture(D.TEXTURE_2D,N),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),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,D.LINEAR),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,D.LINEAR);let G=(b=I.HALF_FLOAT)!==null&&b!==void 0?b:D.UNSIGNED_BYTE,q=(S=I.RGBA16F)!==null&&S!==void 0?S:D.RGBA;D.texImage2D(D.TEXTURE_2D,0,q,c,f,0,D.RGBA,G,null);let K=I.createFramebuffer(c,f,!1,!1);return K.colorAttachment.set(N),K}function tv(I,c){return c.colorRampTexture||(c.colorRampTexture=new o.T(I,c.colorRamp,I.gl.RGBA)),c.colorRampTexture}function Bm(I,c,f,b,S,D,N,G){let q=256;if(S.stepInterpolant){let K=c.getSource().maxzoom,it=N.canonical.z===K?Math.ceil(1<<I.transform.maxZoom-N.canonical.z):1;q=o.ak(o.cc(D.maxLineLength/o.a5*1024*it),256,f.maxTextureSize)}return G.gradient=o.cd({expression:S.gradientExpression(),evaluationKey:\"lineProgress\",resolution:q,image:G.gradient||void 0,clips:D.lineClipsArray}),G.texture?G.texture.update(G.gradient):G.texture=new o.T(f,G.gradient,b.RGBA),G.version=S.gradientVersion,G.texture}function ay(I,c,f,b,S){I.activeTexture.set(c.TEXTURE0),f.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),b.updatePaintBuffers(S)}function EM(I,c,f,b,S,D){(S||I.lineAtlas.dirty)&&(c.activeTexture.set(f.TEXTURE0),I.lineAtlas.bind(c)),b.updatePaintBuffers(D)}function w2(I,c,f,b,S,D,N){let G=D.gradients[S.id],q=G.texture;S.gradientVersion!==G.version&&(q=Bm(I,c,f,b,S,D,N,G)),f.activeTexture.set(b.TEXTURE0),q.bind(S.stepInterpolant?b.NEAREST:b.LINEAR,b.CLAMP_TO_EDGE)}function vo(I,c,f,b,S,D,N,G,q){let K=D.gradients[S.id],it=K.texture;S.gradientVersion!==K.version&&(it=Bm(I,c,f,b,S,D,N,K)),f.activeTexture.set(b.TEXTURE0),it.bind(S.stepInterpolant?b.NEAREST:b.LINEAR,b.CLAMP_TO_EDGE),f.activeTexture.set(b.TEXTURE1),I.lineAtlas.bind(f),G.updatePaintBuffers(q)}function td(I,c,f,b,S){if(!f||!b||!b.imageAtlas)return;let D=b.imageAtlas.patternPositions,N=D[f.to.toString()],G=D[f.from.toString()];if(!N&&G&&(N=G),!G&&N&&(G=N),!N||!G){let q=S.getPaintProperty(c);N=D[q],G=D[q]}N&&G&&I.setConstantPatternPositions(N,G)}function Ga(I,c,f,b,S,D,N,G){let q=I.context.gl,K=\"fill-pattern\",it=f.paint.get(K),ct=it&&it.constantOr(1),ut=f.getCrossfadeParameters(),gt,yt,Pt,Ct,Rt,Ut=I.transform,Gt=f.paint.get(\"fill-translate\"),zt=f.paint.get(\"fill-translate-anchor\");N?(yt=ct&&!f.getPaintProperty(\"fill-outline-color\")?\"fillOutlinePattern\":\"fillOutline\",gt=q.LINES):(yt=ct?\"fillPattern\":\"fill\",gt=q.TRIANGLES);let jt=it.constantOr(null);for(let Wt of b){let It=c.getTile(Wt);if(ct&&!It.patternsLoaded())continue;let Xt=It.getBucket(f);if(!Xt)continue;let Kt=Xt.programConfigurations.get(f.id),de=I.useProgram(yt,Kt),le=I.style.map.terrain&&I.style.map.terrain.getTerrainData(Wt);ct&&(I.context.activeTexture.set(q.TEXTURE0),It.imageAtlasTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE),Kt.updatePaintBuffers(ut)),td(Kt,K,jt,It,f);let me=Ut.getProjectionData({overscaledTileID:Wt,applyGlobeMatrix:!G,applyTerrainMatrix:!0}),Le=o.aL(Ut,It,Gt,zt);if(N){Ct=Xt.indexBuffer2,Rt=Xt.segments2;let Ee=[q.drawingBufferWidth,q.drawingBufferHeight];Pt=yt===\"fillOutlinePattern\"&&ct?u2(I,ut,It,Ee,Le):W_(Ee,Le)}else Ct=Xt.indexBuffer,Rt=Xt.segments,Pt=ct?pf(I,ut,It,Le):{u_fill_translate:Le};let $e=I.stencilModeForClipping(Wt);de.draw(I.context,gt,S,$e,D,Ii.backCCW,Pt,le,me,f.id,Xt.layoutVertexBuffer,Ct,Rt,f.paint,I.transform.zoom,Kt)}}function qp(I,c,f,b,S,D,N,G){let q=I.context,K=q.gl,it=\"fill-extrusion-pattern\",ct=f.paint.get(it),ut=ct.constantOr(1),gt=f.getCrossfadeParameters(),yt=f.paint.get(\"fill-extrusion-opacity\"),Pt=ct.constantOr(null),Ct=I.transform;for(let Rt of b){let Ut=c.getTile(Rt),Gt=Ut.getBucket(f);if(!Gt)continue;let zt=I.style.map.terrain&&I.style.map.terrain.getTerrainData(Rt),jt=Gt.programConfigurations.get(f.id),Wt=I.useProgram(ut?\"fillExtrusionPattern\":\"fillExtrusion\",jt);ut&&(I.context.activeTexture.set(K.TEXTURE0),Ut.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),jt.updatePaintBuffers(gt));let It=Ct.getProjectionData({overscaledTileID:Rt,applyGlobeMatrix:!G,applyTerrainMatrix:!0});td(jt,it,Pt,Ut,f);let Xt=o.aL(Ct,Ut,f.paint.get(\"fill-extrusion-translate\"),f.paint.get(\"fill-extrusion-translate-anchor\")),Kt=f.paint.get(\"fill-extrusion-vertical-gradient\"),de=ut?Zi(I,Kt,yt,Xt,Rt,gt,Ut):Di(I,Kt,yt,Xt);Wt.draw(q,q.gl.TRIANGLES,S,D,N,Ii.backCCW,de,zt,It,f.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.segments,f.paint,I.transform.zoom,jt,I.style.map.terrain&&Gt.centroidVertexBuffer)}}function Hp(I,c,f,b,S,D,N,G,q){var K;let it=I.style.projection,ct=I.context,ut=I.transform,gt=ct.gl,yt=[`#define NUM_ILLUMINATION_SOURCES ${f.paint.get(\"hillshade-highlight-color\").values.length}`],Pt=I.useProgram(\"hillshade\",null,!1,yt),Ct=!I.options.moving;for(let Rt of b){let Ut=c.getTile(Rt),Gt=Ut.fbo;if(!Gt)continue;let zt=it.getMeshFromTileID(ct,Rt.canonical,G,!0,\"raster\"),jt=(K=I.style.map.terrain)===null||K===void 0?void 0:K.getTerrainData(Rt);ct.activeTexture.set(gt.TEXTURE0),gt.bindTexture(gt.TEXTURE_2D,Gt.colorAttachment.get());let Wt=ut.getProjectionData({overscaledTileID:Rt,aligned:Ct,applyGlobeMatrix:!q,applyTerrainMatrix:!0});Pt.draw(ct,gt.TRIANGLES,D,S[Rt.overscaledZ],N,Ii.backCCW,gl(I,Ut,f),jt,Wt,f.id,zt.vertexBuffer,zt.indexBuffer,zt.segments)}}function ly(I,c,f,b,S,D,N,G,q){var K;let it=I.style.projection,ct=I.context,ut=I.transform,gt=ct.gl,yt=I.useProgram(\"colorRelief\"),Pt=!I.options.moving,Ct=f.paint.get(\"resampling\")===\"nearest\"?gt.NEAREST:gt.LINEAR,Rt=!0,Ut=0;for(let Gt of b){let zt=c.getTile(Gt),jt=zt.dem;if(Rt){let le=gt.getParameter(gt.MAX_TEXTURE_SIZE),{elevationTexture:me,colorTexture:Le}=f.getColorRampTextures(ct,le,jt.getUnpackVector());ct.activeTexture.set(gt.TEXTURE1),me.bind(gt.NEAREST,gt.CLAMP_TO_EDGE),ct.activeTexture.set(gt.TEXTURE4),Le.bind(gt.LINEAR,gt.CLAMP_TO_EDGE),Rt=!1,Ut=me.size[0]}if(!jt||!jt.data)continue;let Wt=jt.stride,It=jt.getPixels();if(ct.activeTexture.set(gt.TEXTURE0),ct.pixelStoreUnpackPremultiplyAlpha.set(!1),zt.demTexture=zt.demTexture||I.getTileTexture(Wt),zt.demTexture){let le=zt.demTexture;le.update(It,{premultiply:!1}),le.bind(Ct,gt.CLAMP_TO_EDGE)}else zt.demTexture=new o.T(ct,It,gt.RGBA,{premultiply:!1}),zt.demTexture.bind(Ct,gt.CLAMP_TO_EDGE);let Xt=it.getMeshFromTileID(ct,Gt.canonical,G,!0,\"raster\"),Kt=(K=I.style.map.terrain)===null||K===void 0?void 0:K.getTerrainData(Gt),de=ut.getProjectionData({overscaledTileID:Gt,aligned:Pt,applyGlobeMatrix:!q,applyTerrainMatrix:!0});yt.draw(ct,gt.TRIANGLES,D,S[Gt.overscaledZ],N,Ii.backCCW,Ur(f,zt.dem,Ut),Kt,de,f.id,Xt.vertexBuffer,Xt.indexBuffer,Xt.segments)}}let yc=[new o.P(0,0),new o.P(o.a5,0),new o.P(o.a5,o.a5),new o.P(0,o.a5)];function Yp(I,c,f,b,S,D,N,G,q=!1,K=!1){let it=b[b.length-1].overscaledZ,ct=I.context,ut=ct.gl,gt=I.useProgram(\"raster\"),yt=I.transform,Pt=I.style.projection,Ct=I.colorModeForRenderPass(),Rt=!I.options.moving,Ut=f.paint.get(\"raster-opacity\"),Gt=f.paint.get(\"resampling\")===\"nearest\"||f.paint.get(\"raster-resampling\")===\"nearest\"?ut.NEAREST:ut.LINEAR,zt=f.paint.get(\"raster-fade-duration\"),jt=!!I.style.map.terrain;for(let Wt of b){let It=I.getDepthModeForSublayer(Wt.overscaledZ-it,Ut===1?ii.ReadWrite:ii.ReadOnly,ut.LESS),Xt=c.getTile(Wt);ct.activeTexture.set(ut.TEXTURE0),Xt.texture.bind(Gt,ut.CLAMP_TO_EDGE,ut.LINEAR_MIPMAP_NEAREST),ct.activeTexture.set(ut.TEXTURE1);let{parentTile:Kt,parentScaleBy:de,parentTopLeft:le,fadeValues:me}=Fm(Xt,c,zt,jt);Xt.fadeOpacity=me.tileOpacity,Kt?(Kt.fadeOpacity=me.parentTileOpacity,Kt.texture.bind(Gt,ut.CLAMP_TO_EDGE,ut.LINEAR_MIPMAP_NEAREST)):Xt.texture.bind(Gt,ut.CLAMP_TO_EDGE,ut.LINEAR_MIPMAP_NEAREST),Xt.texture.useMipmap&&ct.extTextureFilterAnisotropic&&I.transform.pitch>I.options.anisotropicFilterPitch&&ut.texParameterf(ut.TEXTURE_2D,ct.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ct.extTextureFilterAnisotropicMax);let Le=I.style.map.terrain&&I.style.map.terrain.getTerrainData(Wt),$e=yt.getProjectionData({overscaledTileID:Wt,aligned:Rt,applyGlobeMatrix:!K,applyTerrainMatrix:!0}),Ee=Ju(le,de,me.fadeMix,f,G),sr=Pt.getMeshFromTileID(ct,Wt.canonical,D,N,\"raster\");gt.draw(ct,ut.TRIANGLES,It,S?S[Wt.overscaledZ]:ke.disabled,Ct,q?Ii.frontCCW:Ii.backCCW,Ee,Le,$e,f.id,sr.vertexBuffer,sr.indexBuffer,sr.segments)}}function Fm(I,c,f,b){let S={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(f===0||b)return S;if(I.fadingParentID){let D=c.getLoadedTile(I.fadingParentID);if(!D)return S;let N=Math.pow(2,D.tileID.overscaledZ-I.tileID.overscaledZ),G=[I.tileID.canonical.x*N%1,I.tileID.canonical.y*N%1],q=(function(K,it,ct){let ut=R(),gt=(ut-it.timeAdded)/ct,yt=K.fadingDirection===dl.Incoming,Pt=o.ak((ut-K.timeAdded)/ct,0,1),Ct=o.ak(1-gt,0,1),Rt=yt?Pt:Ct;return{tileOpacity:Rt,parentTileOpacity:yt?Ct:Pt,fadeMix:{opacity:1,mix:1-Rt}}})(I,D,f);return{parentTile:D,parentScaleBy:N,parentTopLeft:G,fadeValues:q}}if(I.selfFading){let D=(function(N,G){let q=(R()-N.timeAdded)/G,K=o.ak(q,0,1);return{tileOpacity:K,fadeMix:{opacity:K,mix:0}}})(I,f);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:D}}return S}let ev=new o.bn(1,0,0,1),Xp=new o.bn(0,1,0,1),T2=new o.bn(0,0,1,1),cy=new o.bn(1,0,1,1),rv=new o.bn(0,1,1,1);function ed(I,c,f,b){_f(I,0,c+f/2,I.transform.width,f,b)}function rh(I,c,f,b){_f(I,c-f/2,0,f,I.transform.height,b)}function _f(I,c,f,b,S,D){let N=I.context,G=N.gl;G.enable(G.SCISSOR_TEST),G.scissor(c*I.pixelRatio,f*I.pixelRatio,b*I.pixelRatio,S*I.pixelRatio),N.clear({color:D}),G.disable(G.SCISSOR_TEST)}function iv(I,c,f){let b=I.context,S=b.gl,D=I.useProgram(\"debug\"),N=ii.disabled,G=ke.disabled,q=I.colorModeForRenderPass(),K=\"$debug\",it=I.style.map.terrain&&I.style.map.terrain.getTerrainData(f);b.activeTexture.set(S.TEXTURE0);let ct=c.getTileByID(f.key).latestRawTileData,ut=Math.floor((ct&&ct.byteLength||0)/1024),gt=c.getTile(f).tileSize,yt=512/Math.min(gt,512)*(f.overscaledZ/I.transform.zoom)*.5,Pt=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(Pt+=` => ${f.overscaledZ}`),(function(Rt,Ut){Rt.initDebugOverlayCanvas();let Gt=Rt.debugOverlayCanvas,zt=Rt.context.gl,jt=Rt.debugOverlayCanvas.getContext(\"2d\");jt.clearRect(0,0,Gt.width,Gt.height),jt.shadowColor=\"white\",jt.shadowBlur=2,jt.lineWidth=1.5,jt.strokeStyle=\"white\",jt.textBaseline=\"top\",jt.font=\"bold 36px Open Sans, sans-serif\",jt.fillText(Ut,5,5),jt.strokeText(Ut,5,5),Rt.debugOverlayTexture.update(Gt),Rt.debugOverlayTexture.bind(zt.LINEAR,zt.CLAMP_TO_EDGE)})(I,`${Pt} ${ut}kB`);let Ct=I.transform.getProjectionData({overscaledTileID:f,applyGlobeMatrix:!0,applyTerrainMatrix:!0});D.draw(b,S.TRIANGLES,N,G,Rn.alphaBlended,Ii.disabled,Bs(o.bn.transparent,yt),null,Ct,K,I.debugBuffer,I.quadTriangleIndexBuffer,I.debugSegments),D.draw(b,S.LINE_STRIP,N,G,q,Ii.disabled,Bs(o.bn.red),it,Ct,K,I.debugBuffer,I.tileBorderIndexBuffer,I.debugSegments)}function nv(I,c,f,b){let{isRenderingGlobe:S}=b,D=I.context,N=D.gl,G=I.transform,q=I.colorModeForRenderPass(),K=I.getDepthModeFor3D(),it=I.useProgram(\"terrain\");D.bindFramebuffer.set(null),D.viewport.set([0,0,I.width,I.height]);for(let ct of f){let ut=c.getTerrainMesh(ct.tileID),gt=I.renderToTexture.getTexture(ct),yt=c.getTerrainData(ct.tileID);D.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_2D,gt.texture);let Pt=c.getMeshFrameDelta(G.zoom),Ct=G.calculateFogMatrix(ct.tileID.toUnwrapped()),Rt=$a(Pt,Ct,I.style.sky,G.pitch,S),Ut=G.getProjectionData({overscaledTileID:ct.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});it.draw(D,N.TRIANGLES,K,ke.disabled,q,Ii.backCCW,Rt,yt,Ut,\"terrain\",ut.vertexBuffer,ut.indexBuffer,ut.segments)}}function uy(I,c){if(!c.mesh){let f=new o.aU;f.emplaceBack(-1,-1),f.emplaceBack(1,-1),f.emplaceBack(1,1),f.emplaceBack(-1,1);let b=new o.aW;b.emplaceBack(0,1,2),b.emplaceBack(0,2,3),c.mesh=new jo(I.createVertexBuffer(f,Hn.members),I.createIndexBuffer(b),o.aV.simpleSegment(0,0,f.length,b.length))}return c.mesh}class Nm{constructor(c,f){this.context=new b2(c),this.transform=f,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:o.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Os.maxOverzooming+Os.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new l2}resize(c,f,b){if(this.width=Math.floor(c*b),this.height=Math.floor(f*b),this.pixelRatio=b,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let S of this.style._order)this.style._layers[S].resize()}setup(){let c=this.context,f=new o.aU;f.emplaceBack(0,0),f.emplaceBack(o.a5,0),f.emplaceBack(0,o.a5),f.emplaceBack(o.a5,o.a5),this.tileExtentBuffer=c.createVertexBuffer(f,Hn.members),this.tileExtentSegments=o.aV.simpleSegment(0,0,4,2);let b=new o.aU;b.emplaceBack(0,0),b.emplaceBack(o.a5,0),b.emplaceBack(0,o.a5),b.emplaceBack(o.a5,o.a5),this.debugBuffer=c.createVertexBuffer(b,Hn.members),this.debugSegments=o.aV.simpleSegment(0,0,4,5);let S=new o.cf;S.emplaceBack(0,0,0,0),S.emplaceBack(o.a5,0,o.a5,0),S.emplaceBack(0,o.a5,0,o.a5),S.emplaceBack(o.a5,o.a5,o.a5,o.a5),this.rasterBoundsBuffer=c.createVertexBuffer(S,_t.members),this.rasterBoundsSegments=o.aV.simpleSegment(0,0,4,2);let D=new o.aU;D.emplaceBack(0,0),D.emplaceBack(o.a5,0),D.emplaceBack(0,o.a5),D.emplaceBack(o.a5,o.a5),this.rasterBoundsBufferPosOnly=c.createVertexBuffer(D,Hn.members),this.rasterBoundsSegmentsPosOnly=o.aV.simpleSegment(0,0,4,5);let N=new o.aU;N.emplaceBack(0,0),N.emplaceBack(1,0),N.emplaceBack(0,1),N.emplaceBack(1,1),this.viewportBuffer=c.createVertexBuffer(N,Hn.members),this.viewportSegments=o.aV.simpleSegment(0,0,4,2);let G=new o.cg;G.emplaceBack(0),G.emplaceBack(1),G.emplaceBack(3),G.emplaceBack(2),G.emplaceBack(0),this.tileBorderIndexBuffer=c.createIndexBuffer(G);let q=new o.aW;q.emplaceBack(1,0,2),q.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=c.createIndexBuffer(q);let K=this.context.gl;this.stencilClearMode=new ke({func:K.ALWAYS,mask:0},0,255,K.ZERO,K.ZERO,K.ZERO),this.tileExtentMesh=new jo(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let c=this.context,f=c.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let b=o.N();o.c5(b,0,this.width,this.height,0,0,1),o.Q(b,b,[f.drawingBufferWidth,f.drawingBufferHeight,0]);let S={mainMatrix:b,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:b};this.useProgram(\"clippingMask\",null,!0).draw(c,f.TRIANGLES,ii.disabled,this.stencilClearMode,Rn.disabled,Ii.disabled,null,null,S,\"$clipping\",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(c,f,b){if(this.currentStencilSource===c.source||!c.isTileClipped()||!f||!f.length)return;this.currentStencilSource=c.source,this.nextStencilID+f.length>256&&this.clearStencil();let S=this.context;S.setColorMode(Rn.disabled),S.setDepthMode(ii.disabled);let D={};for(let N of f)D[N.key]=this.nextStencilID++;this._renderTileMasks(D,f,b,!0),this._renderTileMasks(D,f,b,!1),this._tileClippingMaskIDs=D}_renderTileMasks(c,f,b,S){let D=this.context,N=D.gl,G=this.style.projection,q=this.transform,K=this.useProgram(\"clippingMask\");for(let it of f){let ct=c[it.key],ut=this.style.map.terrain&&this.style.map.terrain.getTerrainData(it),gt=G.getMeshFromTileID(this.context,it.canonical,S,!0,\"stencil\"),yt=q.getProjectionData({overscaledTileID:it,applyGlobeMatrix:!b,applyTerrainMatrix:!0});K.draw(D,N.TRIANGLES,ii.disabled,new ke({func:N.ALWAYS,mask:0},ct,255,N.KEEP,N.KEEP,N.REPLACE),Rn.disabled,b?Ii.disabled:Ii.backCCW,null,ut,yt,\"$clipping\",gt.vertexBuffer,gt.indexBuffer,gt.segments)}}_renderTilesDepthBuffer(){let c=this.context,f=c.gl,b=this.style.projection,S=this.transform,D=this.useProgram(\"depth\"),N=this.getDepthModeFor3D(),G=jh(S,{tileSize:S.tileSize});for(let q of G){let K=this.style.map.terrain&&this.style.map.terrain.getTerrainData(q),it=b.getMeshFromTileID(this.context,q.canonical,!0,!0,\"raster\"),ct=S.getProjectionData({overscaledTileID:q,applyGlobeMatrix:!0,applyTerrainMatrix:!0});D.draw(c,f.TRIANGLES,N,ke.disabled,Rn.disabled,Ii.backCCW,null,K,ct,\"$clipping\",it.vertexBuffer,it.indexBuffer,it.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let c=this.nextStencilID++,f=this.context.gl;return new ke({func:f.NOTEQUAL,mask:255},c,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(c){let f=this.context.gl;return new ke({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,f.KEEP,f.KEEP,f.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(c){let f=this.context.gl,b=c.sort(((N,G)=>G.overscaledZ-N.overscaledZ)),S=b[b.length-1].overscaledZ,D=b[0].overscaledZ-S+1;if(D>1){this.currentStencilSource=void 0,this.nextStencilID+D>256&&this.clearStencil();let N={};for(let G=0;G<D;G++)N[G+S]=new ke({func:f.GEQUAL,mask:255},G+this.nextStencilID,255,f.KEEP,f.KEEP,f.REPLACE);return this.nextStencilID+=D,[N,b]}return[{[S]:ke.disabled},b]}stencilConfigForOverlapTwoPass(c){let f=this.context.gl,b=c.sort(((N,G)=>G.overscaledZ-N.overscaledZ)),S=b[b.length-1].overscaledZ,D=b[0].overscaledZ-S+1;if(this.clearStencil(),D>1){let N={},G={};for(let q=0;q<D;q++)N[q+S]=new ke({func:f.GREATER,mask:255},D+1+q,255,f.KEEP,f.KEEP,f.REPLACE),G[q+S]=new ke({func:f.GREATER,mask:255},1+q,255,f.KEEP,f.KEEP,f.REPLACE);return this.nextStencilID=2*D+1,[N,G,b]}return this.nextStencilID=3,[{[S]:new ke({func:f.GREATER,mask:255},2,255,f.KEEP,f.KEEP,f.REPLACE)},{[S]:new ke({func:f.GREATER,mask:255},1,255,f.KEEP,f.KEEP,f.REPLACE)},b]}colorModeForRenderPass(){let c=this.context.gl;return this._showOverdrawInspector?new Rn([c.CONSTANT_COLOR,c.ONE],new o.bn(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass===\"opaque\"?Rn.unblended:Rn.alphaBlended}getDepthModeForSublayer(c,f,b){if(!this.opaquePassEnabledForLayer())return ii.disabled;let S=1-((1+this.currentLayer)*this.numSublayers+c)*this.depthEpsilon;return new ii(b||this.context.gl.LEQUAL,f,[S,S])}getDepthModeFor3D(){return new ii(this.context.gl.LEQUAL,ii.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(c,f){var b,S;this.style=c,this.options=f,this.lineAtlas=c.lineAtlas,this.imageManager=c.imageManager,this.glyphManager=c.glyphManager,this.symbolFadeChange=c.placement.symbolFadeChange(R()),this.imageManager.beginFrame();let D=this.style._order,N=this.style.tileManagers,G={},q={},K={},it={isRenderingToTexture:!1,isRenderingGlobe:((b=c.projection)===null||b===void 0?void 0:b.transitionState)>0};for(let ut in N){let gt=N[ut];gt.used&&gt.prepare(this.context),G[ut]=gt.getVisibleCoordinates(!1),q[ut]=G[ut].slice().reverse(),K[ut]=gt.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let ut=0;ut<D.length;ut++)if(this.style._layers[D[ut]].is3D()){this.opaquePassCutoff=ut;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass=\"offscreen\";for(let ut of D){let gt=this.style._layers[ut];if(!gt.hasOffscreenPass()||gt.isHidden(this.transform.zoom))continue;let yt=q[gt.source];(gt.type===\"custom\"||yt.length)&&this.renderLayer(this,N[gt.source],gt,yt,it)}if((S=this.style.projection)===null||S===void 0||S.updateGPUdependent({context:this.context,useProgram:ut=>this.useProgram(ut)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:f.showOverdrawInspector?o.bn.black:o.bn.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(ut,gt){let yt=ut.context,Pt=yt.gl,Ct=((Wt,It,Xt)=>{let Kt=Math.cos(It.rollInRadians),de=Math.sin(It.rollInRadians),le=Yu(It),me=It.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:Wt.properties.get(\"sky-color\"),u_horizon_color:Wt.properties.get(\"horizon-color\"),u_horizon:[(It.width/2-le*de)*Xt,(It.height/2+le*Kt)*Xt],u_horizon_normal:[-de,Kt],u_sky_horizon_blend:Wt.properties.get(\"sky-horizon-blend\")*It.height/2*Xt,u_sky_blend:me}})(gt,ut.style.map.transform,ut.pixelRatio),Rt=new ii(Pt.LEQUAL,ii.ReadWrite,[0,1]),Ut=ke.disabled,Gt=ut.colorModeForRenderPass(),zt=ut.useProgram(\"sky\"),jt=uy(yt,gt);zt.draw(yt,Pt.TRIANGLES,Rt,Ut,Gt,Ii.disabled,Ct,null,void 0,\"sky\",jt.vertexBuffer,jt.indexBuffer,jt.segments)})(this,this.style.sky),this._showOverdrawInspector=f.showOverdrawInspector,this.depthRangeFor3D=[0,1-(c._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass=\"opaque\",this.currentLayer=D.length-1;this.currentLayer>=0;this.currentLayer--){let ut=this.style._layers[D[this.currentLayer]],gt=N[ut.source],yt=G[ut.source];this._renderTileClippingMasks(ut,yt,!1),this.renderLayer(this,gt,ut,yt,it)}this.renderPass=\"translucent\";let ct=!1;for(this.currentLayer=0;this.currentLayer<D.length;this.currentLayer++){let ut=this.style._layers[D[this.currentLayer]],gt=N[ut.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(ut,it))continue;this.opaquePassEnabledForLayer()||ct||(ct=!0,it.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let yt=(ut.type===\"symbol\"?K:q)[ut.source];this._renderTileClippingMasks(ut,G[ut.source],!!this.renderToTexture),this.renderLayer(this,gt,ut,yt,it)}if(it.isRenderingGlobe&&(function(ut,gt,yt){let Pt=ut.context,Ct=Pt.gl,Rt=ut.useProgram(\"atmosphere\"),Ut=new ii(Ct.LEQUAL,ii.ReadOnly,[0,1]),Gt=ut.transform,zt=(function(me,Le){let $e=me.properties.get(\"position\"),Ee=[-$e.x,-$e.y,-$e.z],sr=o.ao(new Float64Array(16));return me.properties.get(\"anchor\")===\"map\"&&(o.be(sr,sr,Le.rollInRadians),o.bf(sr,sr,-Le.pitchInRadians),o.be(sr,sr,Le.bearingInRadians),o.bf(sr,sr,Le.center.lat*Math.PI/180),o.bH(sr,sr,-Le.center.lng*Math.PI/180)),o.ce(Ee,Ee,sr),Ee})(yt,ut.transform),jt=Gt.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),Wt=gt.properties.get(\"atmosphere-blend\")*jt.projectionTransition;if(Wt===0)return;let It=Hl(Gt.worldSize,Gt.center.lat),Xt=Gt.inverseProjectionMatrix,Kt=new Float64Array(4);Kt[3]=1,o.aE(Kt,Kt,Gt.modelViewProjectionMatrix),Kt[0]/=Kt[3],Kt[1]/=Kt[3],Kt[2]/=Kt[3],Kt[3]=1,o.aE(Kt,Kt,Xt),Kt[0]/=Kt[3],Kt[1]/=Kt[3],Kt[2]/=Kt[3],Kt[3]=1;let de=((me,Le,$e,Ee,sr)=>({u_sun_pos:me,u_atmosphere_blend:Le,u_globe_position:$e,u_globe_radius:Ee,u_inv_proj_matrix:sr}))(zt,Wt,[Kt[0],Kt[1],Kt[2]],It,Xt),le=uy(Pt,gt);Rt.draw(Pt,Ct.TRIANGLES,Ut,ke.disabled,Rn.alphaBlended,Ii.disabled,de,null,null,\"atmosphere\",le.vertexBuffer,le.indexBuffer,le.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let ut=(function(gt,yt){let Pt=null,Ct=Object.values(gt._layers).flatMap((zt=>zt.source&&!zt.isHidden(yt)?[gt.tileManagers[zt.source]]:[])),Rt=Ct.filter((zt=>zt.getSource().type===\"vector\")),Ut=Ct.filter((zt=>zt.getSource().type!==\"vector\")),Gt=zt=>{(!Pt||Pt.getSource().maxzoom<zt.getSource().maxzoom)&&(Pt=zt)};return Rt.forEach((zt=>Gt(zt))),Pt||Ut.forEach((zt=>Gt(zt))),Pt})(this.style,this.transform.zoom);ut&&(function(gt,yt,Pt){for(let Ct=0;Ct<Pt.length;Ct++)iv(gt,yt,Pt[Ct])})(this,ut,ut.getVisibleCoordinates())}this.options.showPadding&&(function(ut){let gt=ut.transform.padding;ed(ut,ut.transform.height-(gt.top||0),3,ev),ed(ut,gt.bottom||0,3,Xp),rh(ut,gt.left||0,3,T2),rh(ut,ut.transform.width-(gt.right||0),3,cy);let yt=ut.transform.centerPoint;(function(Pt,Ct,Rt,Ut){_f(Pt,Ct-1,Rt-10,2,20,Ut),_f(Pt,Ct-10,Rt-1,20,2,Ut)})(ut,yt.x,ut.transform.height-yt.y,rv)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(c){if(!this.style||!this.style.map||!this.style.map.terrain)return;let f=this.terrainFacilitator.matrix,b=this.transform.modelViewProjectionMatrix,S=this.terrainFacilitator.dirty;S||(S=c?!o.ch(f,b):!o.ci(f,b)),S||(S=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),S&&(o.cj(f,b),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(D,N){let G=D.context,q=G.gl,K=D.transform,it=Rn.unblended,ct=new ii(q.LEQUAL,ii.ReadWrite,[0,1]),ut=N.tileManager.getRenderableTiles(),gt=D.useProgram(\"terrainDepth\");G.bindFramebuffer.set(N.getFramebuffer(\"depth\").framebuffer),G.viewport.set([0,0,D.width/devicePixelRatio,D.height/devicePixelRatio]),G.clear({color:o.bn.transparent,depth:1});for(let yt of ut){let Pt=N.getTerrainMesh(yt.tileID),Ct=N.getTerrainData(yt.tileID),Rt=K.getProjectionData({overscaledTileID:yt.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),Ut={u_ele_delta:N.getMeshFrameDelta(K.zoom)};gt.draw(G,q.TRIANGLES,ct,ke.disabled,it,Ii.backCCW,Ut,Ct,Rt,\"terrain\",Pt.vertexBuffer,Pt.indexBuffer,Pt.segments)}G.bindFramebuffer.set(null),G.viewport.set([0,0,D.width,D.height])})(this,this.style.map.terrain),(function(D,N){let G=D.context,q=G.gl,K=D.transform,it=Rn.unblended,ct=new ii(q.LEQUAL,ii.ReadWrite,[0,1]),ut=N.getCoordsTexture(),gt=N.tileManager.getRenderableTiles(),yt=D.useProgram(\"terrainCoords\");G.bindFramebuffer.set(N.getFramebuffer(\"coords\").framebuffer),G.viewport.set([0,0,D.width/devicePixelRatio,D.height/devicePixelRatio]),G.clear({color:o.bn.transparent,depth:1}),N.coordsIndex=[];for(let Pt of gt){let Ct=N.getTerrainMesh(Pt.tileID),Rt=N.getTerrainData(Pt.tileID);G.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,ut.texture);let Ut={u_terrain_coords_id:(255-N.coordsIndex.length)/255,u_texture:0,u_ele_delta:N.getMeshFrameDelta(K.zoom)},Gt=K.getProjectionData({overscaledTileID:Pt.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});yt.draw(G,q.TRIANGLES,ct,ke.disabled,it,Ii.backCCW,Ut,Rt,Gt,\"terrain\",Ct.vertexBuffer,Ct.indexBuffer,Ct.segments),N.coordsIndex.push(Pt.tileID.key)}G.bindFramebuffer.set(null),G.viewport.set([0,0,D.width,D.height])})(this,this.style.map.terrain))}renderLayer(c,f,b,S,D){b.isHidden(this.transform.zoom)||(b.type===\"background\"||b.type===\"custom\"||(S||[]).length)&&(this.id=b.id,o.aQ(b)?(function(N,G,q,K,it,ct){if(N.renderPass!==\"translucent\")return;let{isRenderingToTexture:ut}=ct,gt=ke.disabled,yt=N.colorModeForRenderPass();(q._unevaluatedLayout.hasValue(\"text-variable-anchor\")||q._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"))&&(function(Pt,Ct,Rt,Ut,Gt,zt,jt,Wt,It){let Xt=Ct.transform,Kt=Ct.style.map.terrain,de=Gt===\"map\",le=zt===\"map\";for(let me of Pt){let Le=Ut.getTile(me),$e=Le.getBucket(Rt);if(!$e||!$e.text||!$e.text.segments.get().length)continue;let Ee=o.av($e.textSizeData,Xt.zoom),sr=o.aK(Le,1,Ct.transform.zoom),ur=Hr(de,Ct.transform,sr),ji=Rt.layout.get(\"icon-text-fit\")!==\"none\"&&$e.hasIconData();if(Ee){let Me=Math.pow(2,Xt.zoom-Le.tileID.overscaledZ),Re=Kt?(wn,fn)=>Kt.getElevation(me,wn,fn):null;x2($e,de,le,It,Xt,ur,Me,Ee,ji,o.aL(Xt,Le,jt,Wt),me.toUnwrapped(),Re)}}})(K,N,q,G,q.layout.get(\"text-rotation-alignment\"),q.layout.get(\"text-pitch-alignment\"),q.paint.get(\"text-translate\"),q.paint.get(\"text-translate-anchor\"),it),q.paint.get(\"icon-opacity\").constantOr(1)!==0&&Jh(N,G,q,K,!1,q.paint.get(\"icon-translate\"),q.paint.get(\"icon-translate-anchor\"),q.layout.get(\"icon-rotation-alignment\"),q.layout.get(\"icon-pitch-alignment\"),q.layout.get(\"icon-keep-upright\"),gt,yt,ut),q.paint.get(\"text-opacity\").constantOr(1)!==0&&Jh(N,G,q,K,!0,q.paint.get(\"text-translate\"),q.paint.get(\"text-translate-anchor\"),q.layout.get(\"text-rotation-alignment\"),q.layout.get(\"text-pitch-alignment\"),q.layout.get(\"text-keep-upright\"),gt,yt,ut),G.map.showCollisionBoxes&&(Wp(N,G,q,K,!0),Wp(N,G,q,K,!1))})(c,f,b,S,this.style.placement.variableOffsets,D):o.ck(b)?(function(N,G,q,K,it){if(N.renderPass!==\"translucent\")return;let{isRenderingToTexture:ct}=it,ut=q.paint.get(\"circle-opacity\"),gt=q.paint.get(\"circle-stroke-width\"),yt=q.paint.get(\"circle-stroke-opacity\"),Pt=!q.layout.get(\"circle-sort-key\").isConstant();if(ut.constantOr(1)===0&&(gt.constantOr(1)===0||yt.constantOr(1)===0))return;let Ct=N.context,Rt=Ct.gl,Ut=N.transform,Gt=N.getDepthModeForSublayer(0,ii.ReadOnly),zt=ke.disabled,jt=N.colorModeForRenderPass(),Wt=[],It=Ut.getCircleRadiusCorrection();for(let Xt=0;Xt<K.length;Xt++){let Kt=K[Xt],de=G.getTile(Kt),le=de.getBucket(q);if(!le)continue;let me=q.paint.get(\"circle-translate\"),Le=q.paint.get(\"circle-translate-anchor\"),$e=o.aL(Ut,de,me,Le),Ee=le.programConfigurations.get(q.id),sr=N.useProgram(\"circle\",Ee),ur=le.layoutVertexBuffer,ji=le.indexBuffer,Me=N.style.map.terrain&&N.style.map.terrain.getTerrainData(Kt),Re={programConfiguration:Ee,program:sr,layoutVertexBuffer:ur,indexBuffer:ji,uniformValues:XA(N,de,q,$e,It),terrainData:Me,projectionData:Ut.getProjectionData({overscaledTileID:Kt,applyGlobeMatrix:!ct,applyTerrainMatrix:!0})};if(Pt){let wn=le.segments.get();for(let fn of wn)Wt.push({segments:new o.aV([fn]),sortKey:fn.sortKey,state:Re})}else Wt.push({segments:le.segments,sortKey:0,state:Re})}Pt&&Wt.sort(((Xt,Kt)=>Xt.sortKey-Kt.sortKey));for(let Xt of Wt){let{programConfiguration:Kt,program:de,layoutVertexBuffer:le,indexBuffer:me,uniformValues:Le,terrainData:$e,projectionData:Ee}=Xt.state;de.draw(Ct,Rt.TRIANGLES,Gt,zt,jt,Ii.backCCW,Le,$e,Ee,q.id,le,me,Xt.segments,q.paint,N.transform.zoom,Kt)}})(c,f,b,S,D):o.cl(b)?(function(N,G,q,K,it){if(q.paint.get(\"heatmap-opacity\")===0)return;let ct=N.context,{isRenderingToTexture:ut,isRenderingGlobe:gt}=it;if(N.style.map.terrain){for(let yt of K){let Pt=G.getTile(yt);G.hasRenderableParent(yt)||(N.renderPass===\"offscreen\"?Om(N,Pt,q,yt,gt):N.renderPass===\"translucent\"&&sy(N,q,yt,ut,gt))}ct.viewport.set([0,0,N.width,N.height])}else N.renderPass===\"offscreen\"?(function(yt,Pt,Ct,Rt){let Ut=yt.context,Gt=Ut.gl,zt=yt.transform,jt=ke.disabled,Wt=new Rn([Gt.ONE,Gt.ONE],o.bn.transparent,[!0,!0,!0,!0]);(function(It,Xt,Kt){let de=It.gl;It.activeTexture.set(de.TEXTURE1),It.viewport.set([0,0,Xt.width/4,Xt.height/4]);let le=Kt.heatmapFbos.get(o.cb);le?(de.bindTexture(de.TEXTURE_2D,le.colorAttachment.get()),It.bindFramebuffer.set(le.framebuffer)):(le=Lm(It,Xt.width/4,Xt.height/4),Kt.heatmapFbos.set(o.cb,le))})(Ut,yt,Ct),Ut.clear({color:o.bn.transparent});for(let It=0;It<Rt.length;It++){let Xt=Rt[It];if(Pt.hasRenderableParent(Xt))continue;let Kt=Pt.getTile(Xt),de=Kt.getBucket(Ct);if(!de)continue;let le=de.programConfigurations.get(Ct.id),me=yt.useProgram(\"heatmap\",le),Le=zt.getProjectionData({overscaledTileID:Xt,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),$e=zt.getCircleRadiusCorrection();me.draw(Ut,Gt.TRIANGLES,ii.disabled,jt,Wt,Ii.backCCW,Mm(Kt,zt.zoom,Ct.paint.get(\"heatmap-intensity\"),$e),null,Le,Ct.id,de.layoutVertexBuffer,de.indexBuffer,de.segments,Ct.paint,zt.zoom,le)}Ut.viewport.set([0,0,yt.width,yt.height])})(N,G,q,K):N.renderPass===\"translucent\"&&(function(yt,Pt){let Ct=yt.context,Rt=Ct.gl;Ct.setColorMode(yt.colorModeForRenderPass());let Ut=Pt.heatmapFbos.get(o.cb);Ut&&(Ct.activeTexture.set(Rt.TEXTURE0),Rt.bindTexture(Rt.TEXTURE_2D,Ut.colorAttachment.get()),Ct.activeTexture.set(Rt.TEXTURE1),tv(Ct,Pt).bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE),yt.useProgram(\"heatmapTexture\").draw(Ct,Rt.TRIANGLES,ii.disabled,ke.disabled,yt.colorModeForRenderPass(),Ii.disabled,q_(yt,Pt,0,1),null,null,Pt.id,yt.viewportBuffer,yt.quadTriangleIndexBuffer,yt.viewportSegments,Pt.paint,yt.transform.zoom))})(N,q)})(c,f,b,S,D):o.cm(b)?(function(N,G,q,K,it){if(N.renderPass!==\"translucent\")return;let{isRenderingToTexture:ct}=it,ut=q.paint.get(\"line-opacity\"),gt=q.paint.get(\"line-width\");if(ut.constantOr(1)===0||gt.constantOr(1)===0)return;let yt=N.getDepthModeForSublayer(0,ii.ReadOnly),Pt=N.colorModeForRenderPass(),Ct=q.paint.get(\"line-dasharray\"),Rt=Ct.constantOr(1),Ut=q.paint.get(\"line-pattern\"),Gt=Ut.constantOr(1),zt=q.paint.get(\"line-gradient\"),jt=q.getCrossfadeParameters(),Wt;Wt=Gt?\"linePattern\":Rt&&zt?\"lineGradientSDF\":Rt?\"lineSDF\":zt?\"lineGradient\":\"line\";let It=N.context,Xt=It.gl,Kt=N.transform,de=!0;for(let le of K){let me=G.getTile(le);if(Gt&&!me.patternsLoaded())continue;let Le=me.getBucket(q);if(!Le)continue;let $e=Le.programConfigurations.get(q.id),Ee=N.context.program.get(),sr=N.useProgram(Wt,$e),ur=de||sr.program!==Ee,ji=N.style.map.terrain&&N.style.map.terrain.getTerrainData(le),Me=Ut.constantOr(null),Re=Ct&&Ct.constantOr(null);if(Me&&me.imageAtlas){let so=me.imageAtlas,pn=so.patternPositions[Me.to.toString()],Do=so.patternPositions[Me.from.toString()];pn&&Do&&$e.setConstantPatternPositions(pn,Do)}else if(Re){let so=q.layout.get(\"line-cap\")===\"round\",pn=N.lineAtlas.getDash(Re.to,so),Do=N.lineAtlas.getDash(Re.from,so);$e.setConstantDashPositions(pn,Do)}let wn=Kt.getProjectionData({overscaledTileID:le,applyGlobeMatrix:!ct,applyTerrainMatrix:!0}),fn=Kt.getPixelScale(),oo;Gt?(oo=d2(N,me,q,fn,jt),ay(It,Xt,me,$e,jt)):Rt&&zt?(oo=H_(N,me,q,fn,jt,Le.lineClipsArray.length),vo(N,G,It,Xt,q,Le,le,$e,jt)):Rt?(oo=f2(N,me,q,fn,jt),EM(N,It,Xt,$e,ur,jt)):zt?(oo=h2(N,me,q,fn,Le.lineClipsArray.length),w2(N,G,It,Xt,q,Le,le)):oo=Em(N,me,q,fn);let en=N.stencilModeForClipping(le);sr.draw(It,Xt.TRIANGLES,yt,en,Pt,Ii.disabled,oo,ji,wn,q.id,Le.layoutVertexBuffer,Le.indexBuffer,Le.segments,q.paint,N.transform.zoom,$e,Le.layoutVertexBuffer2),de=!1}})(c,f,b,S,D):o.cn(b)?(function(N,G,q,K,it){let ct=q.paint.get(\"fill-color\"),ut=q.paint.get(\"fill-opacity\");if(ut.constantOr(1)===0)return;let{isRenderingToTexture:gt}=it,yt=N.colorModeForRenderPass(),Pt=q.paint.get(\"fill-pattern\"),Ct=N.opaquePassEnabledForLayer()&&!Pt.constantOr(1)&&ct.constantOr(o.bn.transparent).a===1&&ut.constantOr(0)===1?\"opaque\":\"translucent\";if(N.renderPass===Ct){let Rt=N.getDepthModeForSublayer(1,N.renderPass===\"opaque\"?ii.ReadWrite:ii.ReadOnly);Ga(N,G,q,K,Rt,yt,!1,gt)}if(N.renderPass===\"translucent\"&&q.paint.get(\"fill-antialias\")){let Rt=N.getDepthModeForSublayer(q.getPaintProperty(\"fill-outline-color\")?2:0,ii.ReadOnly);Ga(N,G,q,K,Rt,yt,!0,gt)}})(c,f,b,S,D):o.co(b)?(function(N,G,q,K,it){let ct=q.paint.get(\"fill-extrusion-opacity\");if(ct===0)return;let{isRenderingToTexture:ut}=it;if(N.renderPass===\"translucent\"){let gt=new ii(N.context.gl.LEQUAL,ii.ReadWrite,N.depthRangeFor3D);if(ct!==1||q.paint.get(\"fill-extrusion-pattern\").constantOr(1))qp(N,G,q,K,gt,ke.disabled,Rn.disabled,ut),qp(N,G,q,K,gt,N.stencilModeFor3D(),N.colorModeForRenderPass(),ut);else{let yt=N.colorModeForRenderPass();qp(N,G,q,K,gt,ke.disabled,yt,ut)}}})(c,f,b,S,D):o.cp(b)?(function(N,G,q,K,it){if(N.renderPass!==\"offscreen\"&&N.renderPass!==\"translucent\")return;let{isRenderingToTexture:ct}=it,ut=N.context,gt=N.style.projection.useSubdivision,yt=N.getDepthModeForSublayer(0,ii.ReadOnly),Pt=N.colorModeForRenderPass();if(N.renderPass===\"offscreen\")(function(Ct,Rt,Ut,Gt,zt,jt,Wt){let It=Ct.context,Xt=It.gl,Kt=Gt.paint.get(\"resampling\")===\"nearest\"?Xt.NEAREST:Xt.LINEAR;for(let de of Ut){let le=Rt.getTile(de),me=le.dem;if(!me||!me.data||!le.needsHillshadePrepare)continue;let Le=me.dim,$e=me.stride,Ee=me.getPixels();if(It.activeTexture.set(Xt.TEXTURE1),It.pixelStoreUnpackPremultiplyAlpha.set(!1),le.demTexture=le.demTexture||Ct.getTileTexture($e),le.demTexture){let ur=le.demTexture;ur.update(Ee,{premultiply:!1}),ur.bind(Xt.NEAREST,Xt.CLAMP_TO_EDGE)}else le.demTexture=new o.T(It,Ee,Xt.RGBA,{premultiply:!1}),le.demTexture.bind(Xt.NEAREST,Xt.CLAMP_TO_EDGE);It.activeTexture.set(Xt.TEXTURE0);let sr=le.fbo;if(!sr){let ur=new o.T(It,{width:Le,height:Le,data:null},Xt.RGBA);ur.bind(Kt,Xt.CLAMP_TO_EDGE),sr=le.fbo=It.createFramebuffer(Le,Le,!0,!1),sr.colorAttachment.set(ur.texture)}It.bindFramebuffer.set(sr.framebuffer),It.viewport.set([0,0,Le,Le]),Ct.useProgram(\"hillshadePrepare\").draw(It,Xt.TRIANGLES,zt,jt,Wt,Ii.disabled,ni(le.tileID,me),null,null,Gt.id,Ct.rasterBoundsBuffer,Ct.quadTriangleIndexBuffer,Ct.rasterBoundsSegments),le.needsHillshadePrepare=!1}})(N,G,K,q,yt,ke.disabled,Pt),ut.viewport.set([0,0,N.width,N.height]);else if(N.renderPass===\"translucent\")if(gt){let[Ct,Rt,Ut]=N.stencilConfigForOverlapTwoPass(K);Hp(N,G,q,Ut,Ct,yt,Pt,!1,ct),Hp(N,G,q,Ut,Rt,yt,Pt,!0,ct)}else{let[Ct,Rt]=N.getStencilConfigForOverlapAndUpdateStencilID(K);Hp(N,G,q,Rt,Ct,yt,Pt,!1,ct)}})(c,f,b,S,D):o.cq(b)?(function(N,G,q,K,it){if(N.renderPass!==\"translucent\"||!K.length)return;let{isRenderingToTexture:ct}=it,ut=N.style.projection.useSubdivision,gt=N.getDepthModeForSublayer(0,ii.ReadOnly),yt=N.colorModeForRenderPass();if(ut){let[Pt,Ct,Rt]=N.stencilConfigForOverlapTwoPass(K);ly(N,G,q,Rt,Pt,gt,yt,!1,ct),ly(N,G,q,Rt,Ct,gt,yt,!0,ct)}else{let[Pt,Ct]=N.getStencilConfigForOverlapAndUpdateStencilID(K);ly(N,G,q,Ct,Pt,gt,yt,!1,ct)}})(c,f,b,S,D):o.bS(b)?(function(N,G,q,K,it){if(N.renderPass!==\"translucent\"||q.paint.get(\"raster-opacity\")===0||!K.length)return;let{isRenderingToTexture:ct}=it,ut=G.getSource(),gt=N.style.projection.useSubdivision;if(ut instanceof Rs)Yp(N,G,q,K,null,!1,!1,ut.tileCoords,ut.flippedWindingOrder,ct);else if(gt){let[yt,Pt,Ct]=N.stencilConfigForOverlapTwoPass(K);Yp(N,G,q,Ct,yt,!1,!0,yc,!1,ct),Yp(N,G,q,Ct,Pt,!0,!0,yc,!1,ct)}else{let[yt,Pt]=N.getStencilConfigForOverlapAndUpdateStencilID(K);Yp(N,G,q,Pt,yt,!1,!0,yc,!1,ct)}})(c,f,b,S,D):o.cr(b)?(function(N,G,q,K,it){let ct=q.paint.get(\"background-color\"),ut=q.paint.get(\"background-opacity\");if(ut===0)return;let{isRenderingToTexture:gt}=it,yt=N.context,Pt=yt.gl,Ct=N.style.projection,Rt=N.transform,Ut=Rt.tileSize,Gt=q.paint.get(\"background-pattern\");if(N.isPatternMissing(Gt))return;let zt=!Gt&&ct.a===1&&ut===1&&N.opaquePassEnabledForLayer()?\"opaque\":\"translucent\";if(N.renderPass!==zt)return;let jt=ke.disabled,Wt=N.getDepthModeForSublayer(0,zt===\"opaque\"?ii.ReadWrite:ii.ReadOnly),It=N.colorModeForRenderPass(),Xt=N.useProgram(Gt?\"backgroundPattern\":\"background\"),Kt=K||jh(Rt,{tileSize:Ut,terrain:N.style.map.terrain});Gt&&(yt.activeTexture.set(Pt.TEXTURE0),N.imageManager.bind(N.context));let de=q.getCrossfadeParameters();for(let le of Kt){let me=Rt.getProjectionData({overscaledTileID:le,applyGlobeMatrix:!gt,applyTerrainMatrix:!0}),Le=Gt?Yh(ut,N,Gt,{tileID:le,tileSize:Ut},de):QA(ut,ct),$e=N.style.map.terrain&&N.style.map.terrain.getTerrainData(le),Ee=Ct.getMeshFromTileID(yt,le.canonical,!1,!0,\"raster\");Xt.draw(yt,Pt.TRIANGLES,Wt,jt,It,Ii.backCCW,Le,$e,me,q.id,Ee.vertexBuffer,Ee.indexBuffer,Ee.segments)}})(c,0,b,S,D):o.cs(b)&&(function(N,G,q,K){let{isRenderingGlobe:it}=K,ct=N.context,ut=q.implementation,gt=N.style.projection,yt=N.transform,Pt=yt.getProjectionDataForCustomLayer(it),Ct={farZ:yt.farZ,nearZ:yt.nearZ,fov:yt.fov*Math.PI/180,modelViewProjectionMatrix:yt.modelViewProjectionMatrix,projectionMatrix:yt.projectionMatrix,shaderData:{variantName:gt.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${gt.shaderPreludeCode.vertexSource}`,define:gt.shaderDefine},defaultProjectionData:Pt},Rt=ut.renderingMode?ut.renderingMode:\"2d\";if(N.renderPass===\"offscreen\"){let Ut=ut.prerender;Ut&&(N.setCustomLayerDefaults(),ct.setColorMode(N.colorModeForRenderPass()),Ut.call(ut,ct.gl,Ct),ct.setDirty(),N.setBaseState())}else if(N.renderPass===\"translucent\"){N.setCustomLayerDefaults(),ct.setColorMode(N.colorModeForRenderPass()),ct.setStencilMode(ke.disabled);let Ut=Rt===\"3d\"?N.getDepthModeFor3D():N.getDepthModeForSublayer(0,ii.ReadOnly);ct.setDepthMode(Ut),ut.render(ct.gl,Ct),ct.setDirty(),N.setBaseState(),ct.bindFramebuffer.set(null)}})(c,0,b,D))}saveTileTexture(c){let f=this._tileTextures[c.size[0]];f?f.length<Nm.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?f.push(c):c.destroy():this._tileTextures[c.size[0]]=[c]}getTileTexture(c){let f=this._tileTextures[c];return f&&f.length>0?f.pop():null}isPatternMissing(c){if(!c)return!1;if(!c.from||!c.to)return!0;let f=this.imageManager.getPattern(c.from.toString()),b=this.imageManager.getPattern(c.to.toString());return!f||!b}useProgram(c,f,b=!1,S=[]){this.cache=this.cache||{};let D=!!this.style.map.terrain,N=this.style.projection,G=b?yo.projectionMercator:N.shaderPreludeCode,q=b?Yn:N.shaderDefine,K=c+(f?f.cacheKey:\"\")+`/${b?c2:N.shaderVariantName}`+(this._showOverdrawInspector?\"/overdraw\":\"\")+(D?\"/terrain\":\"\")+(S?`/${S.join(\"/\")}`:\"\");return this.cache[K]||(this.cache[K]=new un(this.context,yo[c],f,nu[c],this._showOverdrawInspector,D,G,q,S)),this.cache[K]}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(){let c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement(\"canvas\"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var c,f;if(this._tileTextures){for(let b in this._tileTextures){let S=this._tileTextures[b];if(S)for(let D of S)D.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((c=this.tileExtentMesh.vertexBuffer)===null||c===void 0||c.destroy()),this.tileExtentMesh&&((f=this.tileExtentMesh.indexBuffer)===null||f===void 0||f.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let b in this.cache){let S=this.cache[b];S&&S.program&&this.context.gl.deleteProgram(S.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:c,drawingBufferHeight:f}=this.context.gl;return this.width!==c||this.height!==f}}function ov(I,c){let f,b=!1,S=null,D=null,N=()=>{S=null,b&&(I.apply(D,f),S=setTimeout(N,c),b=!1)};return(...G)=>(b=!0,D=this,f=G,S||N(),S)}Nm.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class zm{constructor(c){this._getCurrentHash=()=>{let f=window.location.hash.replace(\"#\",\"\");if(this._hashName){let b;return f.split(\"&\").map((S=>S.split(\"=\"))).forEach((S=>{S[0]===this._hashName&&(b=S)})),(b&&b[1]||\"\").split(\"/\")}return f.split(\"/\")},this._onHashChange=()=>{let f=this._getCurrentHash();if(!this._isValidHash(f))return!1;let b=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:b,pitch:+(f[4]||0)}),!0},this._updateHashUnthrottled=()=>{let f=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,f)},this._removeHash=()=>{let f=this._getCurrentHash();if(f.length===0)return;let b=f.join(\"/\"),S=b;S.split(\"&\").length>0&&(S=S.split(\"&\")[0]),this._hashName&&(S=`${this._hashName}=${b}`);let D=window.location.hash.replace(S,\"\");D.startsWith(\"#&\")?D=D.slice(0,1)+D.slice(2):D===\"#\"&&(D=\"\");let N=window.location.href.replace(/(#.+)?$/,D);N=N.replace(\"&&\",\"&\"),window.history.replaceState(window.history.state,null,N)},this._updateHash=ov(this._updateHashUnthrottled,300),this._hashName=c&&encodeURIComponent(c)}addTo(c){return this._map=c,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(c){let f=this._map.getCenter(),b=Math.round(100*this._map.getZoom())/100,S=Math.ceil((b*Math.LN2+Math.log(512/360/.5))/Math.LN10),D=Math.pow(10,S),N=Math.round(f.lng*D)/D,G=Math.round(f.lat*D)/D,q=this._map.getBearing(),K=this._map.getPitch(),it=\"\";if(it+=c?`/${N}/${G}/${b}`:`${b}/${G}/${N}`,(q||K)&&(it+=\"/\"+Math.round(10*q)/10),K&&(it+=`/${Math.round(K)}`),this._hashName){let ct=this._hashName,ut=!1,gt=window.location.hash.slice(1).split(\"&\").map((yt=>{let Pt=yt.split(\"=\")[0];return Pt===ct?(ut=!0,`${Pt}=${it}`):yt})).filter((yt=>yt));return ut||gt.push(`${ct}=${it}`),`#${gt.join(\"&\")}`}return`#${it}`}_isValidHash(c){if(c.length<3||c.some(isNaN))return!1;try{new o.V(+c[2],+c[1])}catch{return!1}let f=+c[0],b=+(c[3]||0),S=+(c[4]||0);return f>=this._map.getMinZoom()&&f<=this._map.getMaxZoom()&&b>=-180&&b<=180&&S>=this._map.getMinPitch()&&S<=this._map.getMaxPitch()}}let Zp={linearity:.3,easing:o.ct(0,0,.3,1)},hy=o.e({deceleration:2500,maxSpeed:1400},Zp),Kp=o.e({deceleration:20,maxSpeed:1400},Zp),Qp=o.e({deceleration:1e3,maxSpeed:360},Zp),Ei=o.e({deceleration:1e3,maxSpeed:90},Zp),_c=o.e({deceleration:1e3,maxSpeed:360},Zp);class sv{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:R(),settings:c})}_drainInertiaBuffer(){let c=this._inertiaBuffer,f=R();for(;c.length>0&&f-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let f={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:D}of this._inertiaBuffer)f.zoom+=D.zoomDelta||0,f.bearing+=D.bearingDelta||0,f.pitch+=D.pitchDelta||0,f.roll+=D.rollDelta||0,D.panDelta&&f.pan._add(D.panDelta),D.around&&(f.around=D.around),D.pinchAround&&(f.pinchAround=D.pinchAround);let b=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,S={};if(f.pan.mag()){let D=Um(f.pan.mag(),b,o.e({},hy,c||{})),N=f.pan.mult(D.amount/f.pan.mag()),G=this._map.cameraHelper.handlePanInertia(N,this._map.transform);S.center=G.easingCenter,S.offset=G.easingOffset,ia(S,D)}if(f.zoom){let D=Um(f.zoom,b,Kp),N=o.cu(this._map.transform.zoom+D.amount,this._map.getZoomSnap(),D.amount);S.zoom=N,ia(S,D)}if(f.bearing){let D=Um(f.bearing,b,Qp);S.bearing=this._map.transform.bearing+o.ak(D.amount,-179,179),ia(S,D)}if(f.pitch){let D=Um(f.pitch,b,Ei);S.pitch=this._map.transform.pitch+D.amount,ia(S,D)}if(f.roll){let D=Um(f.roll,b,_c);S.roll=this._map.transform.roll+o.ak(D.amount,-179,179),ia(S,D)}if(S.zoom||S.bearing){let D=f.pinchAround===void 0?f.around:f.pinchAround;S.around=D?this._map.unproject(D):this._map.getCenter()}return this.clear(),o.e(S,{noMoveStart:!0})}}function ia(I,c){(!I.duration||I.duration<c.duration)&&(I.duration=c.duration,I.easing=c.easing)}function Um(I,c,f){let{maxSpeed:b,linearity:S,deceleration:D}=f,N=o.ak(I*S/(c/1e3),-b,b),G=Math.abs(N)/(D*S);return{easing:f.easing,duration:1e3*G,amount:N*(G/2)}}class Al extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,f,b,S={}){b=b instanceof MouseEvent?b:new MouseEvent(c,b);let D=z.mousePos(f.getCanvas(),b),N=f.unproject(D);super(c,o.e({point:D,lngLat:N,originalEvent:b},S)),this._defaultPrevented=!1,this.target=f}}class Vm extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,f,b){let S=c===\"touchend\"?b.changedTouches:b.touches,D=z.touchPos(f.getCanvasContainer(),S),N=D.map((q=>f.unproject(q))),G=D.reduce(((q,K,it,ct)=>q.add(K.div(ct.length))),new o.P(0,0));super(c,{points:D,point:G,lngLats:N,lngLat:f.unproject(G),originalEvent:b}),this._defaultPrevented=!1}}class vf extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,f,b){super(c,{originalEvent:b}),this._defaultPrevented=!1}}class Wa{constructor(c,f){this._map=c,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(c){return this._firePreventable(new vf(c.type,this._map,c))}mousedown(c,f){return this._mousedownPos=f,this._firePreventable(new Al(c.type,this._map,c))}mouseup(c){this._map.fire(new Al(c.type,this._map,c))}click(c,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new Al(c.type,this._map,c))}dblclick(c){return this._firePreventable(new Al(c.type,this._map,c))}mouseover(c){this._map.fire(new Al(c.type,this._map,c))}mouseout(c){this._map.fire(new Al(c.type,this._map,c))}touchstart(c){return this._firePreventable(new Vm(c.type,this._map,c))}touchmove(c){this._map.fire(new Vm(c.type,this._map,c))}touchend(c){this._map.fire(new Vm(c.type,this._map,c))}touchcancel(c){this._map.fire(new Vm(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class av{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(c){this._map.fire(new Al(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Al(\"contextmenu\",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._ignoreContextMenu||this._map.fire(new Al(c.type,this._map,c)),this._map.listens(\"contextmenu\")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vc{constructor(c){this._map=c}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(c){return this.transform.screenPointToLocation(o.P.convert(c),this._map.terrain)}}class S2{constructor(c,f){this._map=c,this._tr=new vc(c),this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=f.clickTolerance||1,f.boxZoom&&typeof f.boxZoom==\"object\"&&(this._boxZoomEnd=f.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,f){this.isEnabled()&&c.shiftKey&&c.button===0&&(z.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(c,f){if(!this._active)return;let b=f;if(this._lastPos.equals(b)||!this._box&&b.dist(this._startPos)<this._clickTolerance)return;let S=this._startPos;this._lastPos=b,this._box||(this._box=z.create(\"div\",\"maplibregl-boxzoom\",this._container),this._container.classList.add(\"maplibregl-crosshair\"),this._fireEvent(\"boxzoomstart\",c));let D=Math.min(S.x,b.x),N=Math.max(S.x,b.x),G=Math.min(S.y,b.y),q=Math.max(S.y,b.y);this._box.style.transform=`translate(${D}px,${G}px)`,this._box.style.width=N-D+\"px\",this._box.style.height=q-G+\"px\"}mouseupWindow(c,f){if(!this._active||c.button!==0)return;let b=this._startPos,S=f;if(this.reset(),z.suppressClick(),b.x!==S.x||b.y!==S.y)return this._map.fire(new o.l(\"boxzoomend\",{originalEvent:c})),this._boxZoomEnd?void this._boxZoomEnd(this._map,b,S,c):{cameraAnimation:D=>D.fitScreenCoordinates(b,S,this._tr.bearing,{linear:!0})};this._fireEvent(\"boxzoomcancel\",c)}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent(\"boxzoomcancel\",c))}reset(){this._active=!1,this._container.classList.remove(\"maplibregl-crosshair\"),this._box&&(this._box.remove(),this._box=null),z.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(c,f){return this._map.fire(new o.l(c,{originalEvent:f}))}}function Jp(I,c){if(I.length!==c.length)throw new Error(`The number of touches and points are not equal - touches ${I.length}, points ${c.length}`);let f={};for(let b=0;b<I.length;b++)f[I[b].identifier]=c[b];return f}class jm{constructor(c){this.reset(),this.numTouches=c.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(c,f,b){(this.centroid||b.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=c.timeStamp),b.length===this.numTouches&&(this.centroid=(function(S){let D=new o.P(0,0);for(let N of S)D._add(N);return D.div(S.length)})(f),this.touches=Jp(b,f)))}touchmove(c,f,b){if(this.aborted||!this.centroid)return;let S=Jp(b,f);for(let D in this.touches){let N=S[D];(!N||N.dist(this.touches[D])>30)&&(this.aborted=!0)}}touchend(c,f,b){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),b.length===0){let S=!this.aborted&&this.centroid;if(this.reset(),S)return S}}}class bo{constructor(c){this.singleTap=new jm(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(c,f,b){this.singleTap.touchstart(c,f,b)}touchmove(c,f,b){this.singleTap.touchmove(c,f,b)}touchend(c,f,b){let S=this.singleTap.touchend(c,f,b);if(S){let D=c.timeStamp-this.lastTime<500,N=!this.lastTap||this.lastTap.dist(S)<30;if(D&&N||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=S,this.count===this.numTaps)return this.reset(),S}}}class ir{constructor(c){this._tr=new vc(c),this._zoomIn=new bo({numTouches:1,numTaps:2}),this._zoomOut=new bo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,f,b){this._zoomIn.touchstart(c,f,b),this._zoomOut.touchstart(c,f,b)}touchmove(c,f,b){this._zoomIn.touchmove(c,f,b),this._zoomOut.touchmove(c,f,b)}touchend(c,f,b){let S=this._zoomIn.touchend(c,f,b),D=this._zoomOut.touchend(c,f,b),N=this._tr;return S?(this._active=!0,c.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:G=>G.easeTo({duration:300,zoom:o.cu(N.zoom+1,G.getZoomSnap()),around:N.unproject(S)},{originalEvent:c})}):D?(this._active=!0,c.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:G=>G.easeTo({duration:300,zoom:o.cu(N.zoom-1,G.getZoomSnap()),around:N.unproject(D)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rd{constructor(c){this._enabled=!!c.enable,this._moveStateManager=c.moveStateManager,this._clickTolerance=c.clickTolerance||1,this._moveFunction=c.move,this._activateOnStart=!!c.activateOnStart,c.assignEvents(this),this.reset()}reset(c){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(c)}_move(...c){let f=this._moveFunction(...c);if(f.bearingDelta||f.pitchDelta||f.rollDelta||f.around||f.panDelta)return this._active=!0,f}dragStart(c,f){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(c)&&(this._moveStateManager.startMove(c),this._lastPoint=Array.isArray(f)?f[0]:f,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(c,f){if(!this.isEnabled())return;let b=this._lastPoint;if(!b)return;if(c.preventDefault(),!this._moveStateManager.isValidMoveEvent(c))return void this.reset(c);let S=Array.isArray(f)?f[0]:f;return!this._moved&&S.dist(b)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=S,this._move(b,S))}dragEnd(c){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(c)&&(this._moved&&z.suppressClick(),this.reset(c))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let id=0,nd=2,su={[id]:1,[nd]:2};class ih{constructor(c){this._correctEvent=c.checkCorrectEvent}startMove(c){this._eventButton=c.button}endMove(c){delete this._eventButton}isValidStartEvent(c){return this._correctEvent(c)}isValidMoveEvent(c){return!(function(f,b){let S=su[b];return f.buttons===void 0||(f.buttons&S)!==S})(c,this._eventButton)}isValidEndEvent(c){return c.button===this._eventButton}}class dy{constructor(){this._firstTouch=void 0}_isOneFingerTouch(c){return c.targetTouches.length===1}_isSameTouchEvent(c){return c.targetTouches[0].identifier===this._firstTouch}startMove(c){this._firstTouch=c.targetTouches[0].identifier}endMove(c){delete this._firstTouch}isValidStartEvent(c){return this._isOneFingerTouch(c)}isValidMoveEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}isValidEndEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}}class PM{constructor(c=new ih({checkCorrectEvent:()=>!0}),f=new dy){this.mouseMoveStateManager=c,this.oneFingerTouchMoveStateManager=f}_executeRelevantHandler(c,f,b){return c instanceof MouseEvent?f(c):typeof TouchEvent<\"u\"&&c instanceof TouchEvent?b(c):void 0}startMove(c){this._executeRelevantHandler(c,(f=>this.mouseMoveStateManager.startMove(f)),(f=>this.oneFingerTouchMoveStateManager.startMove(f)))}endMove(c){this._executeRelevantHandler(c,(f=>this.mouseMoveStateManager.endMove(f)),(f=>this.oneFingerTouchMoveStateManager.endMove(f)))}isValidStartEvent(c){return this._executeRelevantHandler(c,(f=>this.mouseMoveStateManager.isValidStartEvent(f)),(f=>this.oneFingerTouchMoveStateManager.isValidStartEvent(f)))}isValidMoveEvent(c){return this._executeRelevantHandler(c,(f=>this.mouseMoveStateManager.isValidMoveEvent(f)),(f=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(f)))}isValidEndEvent(c){return this._executeRelevantHandler(c,(f=>this.mouseMoveStateManager.isValidEndEvent(f)),(f=>this.oneFingerTouchMoveStateManager.isValidEndEvent(f)))}}let od=I=>{I.mousedown=I.dragStart,I.mousemoveWindow=I.dragMove,I.mouseup=I.dragEnd,I.contextmenu=c=>{c.preventDefault()}};class M2{constructor(c,f){this._clickTolerance=c.clickTolerance||1,this._map=f,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(c){return c<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(c,f,b){return this._calculateTransform(c,f,b)}touchmove(c,f,b){if(this._active){if(!this._shouldBePrevented(b.length))return c.preventDefault(),this._calculateTransform(c,f,b);this._map.cooperativeGestures.notifyGestureBlocked(\"touch_pan\",c)}}touchend(c,f,b){this._calculateTransform(c,f,b),this._active&&this._shouldBePrevented(b.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(c,f,b){b.length>0&&(this._active=!0);let S=Jp(b,f),D=new o.P(0,0),N=new o.P(0,0),G=0;for(let K in S){let it=S[K],ct=this._touches[K];ct&&(D._add(it),N._add(it.sub(ct)),G++,S[K]=it)}if(this._touches=S,this._shouldBePrevented(G)||!N.mag())return;let q=N.div(G);return this._sum._add(q),this._sum.mag()<this._clickTolerance?void 0:{around:D.div(G),panDelta:q}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $m{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(c,f,b){this._firstTwoTouches||b.length<2||(this._firstTwoTouches=[b[0].identifier,b[1].identifier],this._start([f[0],f[1]]))}touchmove(c,f,b){if(!this._firstTwoTouches)return;c.preventDefault();let[S,D]=this._firstTwoTouches,N=t0(b,f,S),G=t0(b,f,D);if(!N||!G)return;let q=this._aroundCenter?null:N.add(G).div(2);return this._move([N,G],q,c)}touchend(c,f,b){if(!this._firstTwoTouches)return;let[S,D]=this._firstTwoTouches,N=t0(b,f,S),G=t0(b,f,D);N&&G||(this._active&&z.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(c){this._enabled=!0,this._aroundCenter=!!c&&c.around===\"center\"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function t0(I,c,f){for(let b=0;b<I.length;b++)if(I[b].identifier===f)return c[b]}function fy(I,c){return Math.log(I/c)/Math.LN2}class py extends $m{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(c){this._startDistance=this._distance=c[0].dist(c[1])}_move(c,f){let b=this._distance;if(this._distance=c[0].dist(c[1]),this._active||!(Math.abs(fy(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:fy(this._distance,b),pinchAround:f}}}function e0(I,c){return 180*I.angleWith(c)/Math.PI}class sd extends $m{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(c){this._startVector=this._vector=c[0].sub(c[1]),this._minDiameter=c[0].dist(c[1])}_move(c,f,b){let S=this._vector;if(this._vector=c[0].sub(c[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:e0(this._vector,S),pinchAround:f}}_isBelowThreshold(c){this._minDiameter=Math.min(this._minDiameter,c.mag());let f=25/(Math.PI*this._minDiameter)*360,b=e0(c,this._startVector);return Math.abs(b)<f}}function xa(I){return Math.abs(I.y)>Math.abs(I.x)}class lv extends $m{constructor(c){super(),this._currentTouchCount=0,this._map=c}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(c,f,b){super.touchstart(c,f,b),this._currentTouchCount=b.length}_start(c){this._lastPoints=c,xa(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,f,b){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let S=c[0].sub(this._lastPoints[0]),D=c[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(S,D,b.timeStamp),this._valid?(this._lastPoints=c,this._active=!0,{pitchDelta:(S.y+D.y)/2*-.5}):void 0}gestureBeginsVertically(c,f,b){if(this._valid!==void 0)return this._valid;let S=c.mag()>=2,D=f.mag()>=2;if(!S&&!D)return;if(!S||!D)return this._firstMove===void 0&&(this._firstMove=b),b-this._firstMove<100&&void 0;let N=c.y>0==f.y>0;return xa(c)&&xa(f)&&N}}let Gm={panStep:100,bearingStep:15,pitchStep:10};class E2{constructor(c){this._tr=new vc(c);let f=Gm;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let f=0,b=0,S=0,D=0,N=0;switch(c.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:c.shiftKey?b=-1:(c.preventDefault(),D=-1);break;case 39:c.shiftKey?b=1:(c.preventDefault(),D=1);break;case 38:c.shiftKey?S=1:(c.preventDefault(),N=-1);break;case 40:c.shiftKey?S=-1:(c.preventDefault(),N=1);break;default:return}return this._rotationDisabled&&(b=0,S=0),{cameraAnimation:G=>{let q=this._tr;G.easeTo({duration:300,easeId:\"keyboardHandler\",easing:ad,zoom:f?o.cu(q.zoom+f*(c.shiftKey?2:1),G.getZoomSnap()):q.zoom,bearing:q.bearing+b*this._bearingStep,pitch:q.pitch+S*this._pitchStep,offset:[-D*this._panStep,-N*this._panStep],center:q.center},{originalEvent:c})}}}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 ad(I){return I*(2-I)}let hn=4.000244140625,P2=1/450;class Wm{constructor(c,f){this._onTimeout=b=>{this._type=\"wheel\",this._delta-=this._lastValue,this._active||this._start(b)},this._map=c,this._tr=new vc(c),this._triggerRenderFrame=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=P2}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!c&&c.around===\"center\")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(c){return!!this._map.cooperativeGestures.isEnabled()&&!(c.ctrlKey||this._map.cooperativeGestures.isBypassed(c))}wheel(c){if(!this.isEnabled())return;if(this._shouldBePrevented(c))return void this._map.cooperativeGestures.notifyGestureBlocked(\"wheel_zoom\",c);let f=c.deltaMode===WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY,b=R(),S=b-(this._lastWheelEventTime||0);this._lastWheelEventTime=b,f!==0&&f%hn==0?this._type=\"wheel\":f!==0&&Math.abs(f)<4?this._type=\"trackpad\":S>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(S*f)<200?\"trackpad\":\"wheel\",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),c.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=c,this._delta-=f,this._active||this._start(c)),c.preventDefault()}_start(c){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);let f=z.mousePos(this._map.getCanvas(),c),b=this._tr;this._aroundPoint=this._aroundCenter?b.transform.locationToScreenPoint(o.V.convert(b.center)):f,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let c=this._tr.transform;if(typeof this._lastExpectedZoom==\"number\"){let G=c.zoom-this._lastExpectedZoom;typeof this._startZoom==\"number\"&&(this._startZoom+=G),typeof this._targetZoom==\"number\"&&(this._targetZoom+=G)}if(this._delta!==0){let G=this._type===\"wheel\"&&Math.abs(this._delta)>hn?this._wheelZoomRate:this._defaultZoomRate,q=2/(1+Math.exp(-Math.abs(this._delta*G)));this._delta<0&&q!==0&&(q=1/q);let K=typeof this._targetZoom!=\"number\"?c.scale:o.an(this._targetZoom),it=c.applyConstrain(c.getCameraLngLat(),o.aq(K*q)).zoom,ct=this._map.getZoomSnap();if(this._type===\"wheel\"&&ct>0){let ut=o.cu(c.zoom,ct);this._targetZoom=o.cu(it,ct,it-ut)}else this._targetZoom=it;this._type===\"wheel\"&&(this._startZoom=c.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let f=typeof this._targetZoom!=\"number\"?c.zoom:this._targetZoom,b=this._startZoom,S=this._easing,D,N=!1;if(this._type===\"wheel\"&&b&&S){let G=R()-this._lastWheelEventTime,q=Math.min((G+5)/200,1),K=S(q);D=o.G.number(b,f,K),q<1?this._frameId||(this._frameId=!0):N=!0}else D=f,N=!0;return this._active=!0,N&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=D,{noInertia:!0,needsRenderFrame:!N,zoomDelta:D-c.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let f=o.cw;if(this._prevEase){let b=this._prevEase,S=(R()-b.start)/b.duration,D=b.easing(S+.01)-b.easing(S),N=.27/Math.sqrt(D*D+1e-4)*.01,G=Math.sqrt(.0729-N*N);f=o.ct(N,G,.25,1)}return this._prevEase={start:R(),duration:c,easing:f},f}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class qm{constructor(c,f){this._clickZoom=c,this._tapZoom=f}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 cv{constructor(c){this._tr=new vc(c),this.reset()}reset(){this._active=!1}dblclick(c,f){return c.preventDefault(),{cameraAnimation:b=>{b.easeTo({duration:300,zoom:o.cu(this._tr.zoom+(c.shiftKey?-1:1),b.getZoomSnap()),around:this._tr.unproject(f)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hm{constructor(){this._tap=new bo({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(c,f,b){if(!this._swipePoint)if(this._tapTime){let S=f[0],D=c.timeStamp-this._tapTime<500,N=this._tapPoint.dist(S)<30;D&&N?b.length>0&&(this._swipePoint=S,this._swipeTouch=b[0].identifier):this.reset()}else this._tap.touchstart(c,f,b)}touchmove(c,f,b){if(this._tapTime){if(this._swipePoint){if(b[0].identifier!==this._swipeTouch)return;let S=f[0],D=S.y-this._swipePoint.y;return this._swipePoint=S,c.preventDefault(),this._active=!0,{zoomDelta:D/128}}}else this._tap.touchmove(c,f,b)}touchend(c,f,b){if(this._tapTime)this._swipePoint&&b.length===0&&this.reset();else{let S=this._tap.touchend(c,f,b);S&&(this._tapTime=c.timeStamp,this._tapPoint=S)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class my{constructor(c,f,b){this._el=c,this._mousePan=f,this._touchPan=b}enable(c){this._inertiaOptions=c||{},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 Ym{constructor(c,f,b,S){this._pitchWithRotate=c.pitchWithRotate,this._rollEnabled=c.rollEnabled,this._mouseRotate=f,this._mousePitch=b,this._mouseRoll=S}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class C2{constructor(c,f,b,S){this._el=c,this._touchZoom=f,this._touchRotate=b,this._tapDragZoom=S,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),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 bc{constructor(c,f){this._bypassKey=navigator.userAgent.indexOf(\"Mac\")!==-1?\"metaKey\":\"ctrlKey\",this._map=c,this._options=f,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let c=this._map.getCanvasContainer();c.classList.add(\"maplibregl-cooperative-gestures\"),this._container=z.create(\"div\",\"maplibregl-cooperative-gesture-screen\",c);let f=this._map._getUIString(\"CooperativeGesturesHandler.WindowsHelpText\");this._bypassKey===\"metaKey\"&&(f=this._map._getUIString(\"CooperativeGesturesHandler.MacHelpText\"));let b=this._map._getUIString(\"CooperativeGesturesHandler.MobileHelpText\"),S=document.createElement(\"div\");S.className=\"maplibregl-desktop-message\",S.textContent=f,this._container.appendChild(S);let D=document.createElement(\"div\");D.className=\"maplibregl-mobile-message\",D.textContent=b,this._container.appendChild(D),this._container.setAttribute(\"aria-hidden\",\"true\")}_destroyUI(){this._container&&(this._container.remove(),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(c){return c[this._bypassKey]}notifyGestureBlocked(c,f){this._enabled&&(this._map.fire(new o.l(\"cooperativegestureprevented\",{gestureType:c,originalEvent:f})),this._container.classList.add(\"maplibregl-show\"),setTimeout((()=>{this._container.classList.remove(\"maplibregl-show\")}),100))}}let bf=I=>I.zoom||I.drag||I.roll||I.pitch||I.rotate;class fr extends o.l{}function Mr(I){return I.panDelta&&I.panDelta.mag()||I.zoomDelta||I.bearingDelta||I.pitchDelta||I.rollDelta}class Xm{get _ownerDocument(){var c;return((c=this._el)===null||c===void 0?void 0:c.ownerDocument)||document}get _ownerWindow(){var c,f;return((f=(c=this._el)===null||c===void 0?void 0:c.ownerDocument)===null||f===void 0?void 0:f.defaultView)||window}constructor(c,f){this.handleWindowEvent=S=>{this.handleEvent(S,`${S.type}Window`)},this.handleEvent=(S,D)=>{if(S.type===\"blur\")return void this.stop(!0);this._updatingCamera=!0;let N=S.type===\"renderFrame\"?void 0:S,G={needsRenderFrame:!1},q={},K={};for(let{handlerName:ut,handler:gt,allowed:yt}of this._handlers){if(!gt.isEnabled())continue;let Pt;if(this._blockedByActive(K,yt,ut))gt.reset();else if(gt[D||S.type]){if(o.cx(S,D||S.type)){let Ct=z.mousePos(this._map.getCanvas(),S);Pt=gt[D||S.type](S,Ct)}else if(o.cy(S,D||S.type)){let Ct=this._getMapTouches(S.touches),Rt=z.touchPos(this._map.getCanvas(),Ct);Pt=gt[D||S.type](S,Rt,Ct)}else o.cz(D||S.type)||(Pt=gt[D||S.type](S));this.mergeHandlerResult(G,q,Pt,ut,N),Pt&&Pt.needsRenderFrame&&this._triggerRenderFrame()}(Pt||gt.isActive())&&(K[ut]=gt)}let it={};for(let ut in this._previousActiveHandlers)K[ut]||(it[ut]=N);this._previousActiveHandlers=K,(Object.keys(it).length||Mr(G))&&(this._changes.push([G,q,it]),this._triggerRenderFrame()),(Object.keys(K).length||Mr(G))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:ct}=G;ct&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ct(this._map))},this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new sv(c),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f);let b=this._el;this._listeners=[[b,\"touchstart\",{passive:!0}],[b,\"touchmove\",{passive:!1}],[b,\"touchend\",void 0],[b,\"touchcancel\",void 0],[b,\"mousedown\",void 0],[b,\"mousemove\",void 0],[b,\"mouseup\",void 0],[this._ownerDocument,\"mousemove\",{capture:!0}],[this._ownerDocument,\"mouseup\",void 0],[b,\"mouseover\",void 0],[b,\"mouseout\",void 0],[b,\"dblclick\",void 0],[b,\"click\",void 0],[b,\"keydown\",{capture:!1}],[b,\"keyup\",void 0],[b,\"wheel\",{passive:!1}],[b,\"contextmenu\",void 0],[this._ownerWindow,\"blur\",void 0]];for(let[S,D,N]of this._listeners)S.addEventListener(D,S===this._ownerDocument?this.handleWindowEvent:this.handleEvent,N)}destroy(){for(let[c,f,b]of this._listeners)c.removeEventListener(f,c===this._ownerDocument?this.handleWindowEvent:this.handleEvent,b)}_addDefaultHandlers(c){let f=this._map,b=f.getCanvasContainer();this._add(\"mapEvent\",new Wa(f,c));let S=f.boxZoom=new S2(f,c);this._add(\"boxZoom\",S),c.interactive&&c.boxZoom&&S.enable();let D=f.cooperativeGestures=new bc(f,c.cooperativeGestures);this._add(\"cooperativeGestures\",D),c.cooperativeGestures&&D.enable();let N=new ir(f),G=new cv(f);f.doubleClickZoom=new qm(G,N),this._add(\"tapZoom\",N),this._add(\"clickZoom\",G),c.interactive&&c.doubleClickZoom&&f.doubleClickZoom.enable();let q=new Hm;this._add(\"tapDragZoom\",q);let K=f.touchPitch=new lv(f);this._add(\"touchPitch\",K),c.interactive&&c.touchPitch&&f.touchPitch.enable(c.touchPitch);let it=()=>f.project(f.getCenter()),ct=(function({enable:zt,clickTolerance:jt,aroundCenter:Wt=!0,minPixelCenterThreshold:It=100,rotateDegreesPerPixelMoved:Xt=.8},Kt){let de=new ih({checkCorrectEvent:le=>le.button===0&&le.ctrlKey||le.button===2&&!le.ctrlKey});return new rd({clickTolerance:jt,move:(le,me)=>{let Le=Kt();if(Wt&&Math.abs(Le.y-le.y)>It)return{bearingDelta:o.cv(new o.P(le.x,me.y),me,Le)};let $e=(me.x-le.x)*Xt;return Wt&&me.y<Le.y&&($e=-$e),{bearingDelta:$e}},moveStateManager:de,enable:zt,assignEvents:od})})(c,it),ut=(function({enable:zt,clickTolerance:jt,pitchDegreesPerPixelMoved:Wt=-.5}){let It=new ih({checkCorrectEvent:Xt=>Xt.button===0&&Xt.ctrlKey||Xt.button===2});return new rd({clickTolerance:jt,move:(Xt,Kt)=>({pitchDelta:(Kt.y-Xt.y)*Wt}),moveStateManager:It,enable:zt,assignEvents:od})})(c),gt=(function({enable:zt,clickTolerance:jt,rollDegreesPerPixelMoved:Wt=.3},It){let Xt=new ih({checkCorrectEvent:Kt=>Kt.button===2&&Kt.ctrlKey});return new rd({clickTolerance:jt,move:(Kt,de)=>{let le=It(),me=(de.x-Kt.x)*Wt;return de.y<le.y&&(me=-me),{rollDelta:me}},moveStateManager:Xt,enable:zt,assignEvents:od})})(c,it);f.dragRotate=new Ym(c,ct,ut,gt),this._add(\"mouseRotate\",ct,[\"mousePitch\"]),this._add(\"mousePitch\",ut,[\"mouseRotate\",\"mouseRoll\"]),this._add(\"mouseRoll\",gt,[\"mousePitch\"]),c.interactive&&c.dragRotate&&f.dragRotate.enable();let yt=(function({enable:zt,clickTolerance:jt}){let Wt=new ih({checkCorrectEvent:It=>It.button===0&&!It.ctrlKey});return new rd({clickTolerance:jt,move:(It,Xt)=>({around:Xt,panDelta:Xt.sub(It)}),activateOnStart:!0,moveStateManager:Wt,enable:zt,assignEvents:od})})(c),Pt=new M2(c,f);f.dragPan=new my(b,yt,Pt),this._add(\"mousePan\",yt),this._add(\"touchPan\",Pt,[\"touchZoom\",\"touchRotate\"]),c.interactive&&c.dragPan&&f.dragPan.enable(c.dragPan);let Ct=new sd,Rt=new py;f.touchZoomRotate=new C2(b,Rt,Ct,q),this._add(\"touchRotate\",Ct,[\"touchPan\",\"touchZoom\"]),this._add(\"touchZoom\",Rt,[\"touchPan\",\"touchRotate\"]),c.interactive&&c.touchZoomRotate&&f.touchZoomRotate.enable(c.touchZoomRotate),this._add(\"blockableMapEvent\",new av(f));let Ut=f.scrollZoom=new Wm(f,(()=>this._triggerRenderFrame()));this._add(\"scrollZoom\",Ut,[\"mousePan\"]),c.interactive&&c.scrollZoom&&f.scrollZoom.enable(c.scrollZoom);let Gt=f.keyboard=new E2(f);this._add(\"keyboard\",Gt),c.interactive&&c.keyboard&&f.keyboard.enable()}_add(c,f,b){this._handlers.push({handlerName:c,handler:f,allowed:b}),this._handlersById[c]=f}stop(c){if(!this._updatingCamera){for(let{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(let{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!bf(this._eventsInProgress)||this.isZooming()}_blockedByActive(c,f,b){for(let S in c)if(S!==b&&(!f||f.indexOf(S)<0))return!0;return!1}_getMapTouches(c){let f=[];for(let b of c)this._el.contains(b.target)&&f.push(b);return f}mergeHandlerResult(c,f,b,S,D){if(!b)return;o.e(c,b);let N={handlerName:S,originalEvent:b.originalEvent||D};b.zoomDelta!==void 0&&(f.zoom=N),b.panDelta!==void 0&&(f.drag=N),b.rollDelta!==void 0&&(f.roll=N),b.pitchDelta!==void 0&&(f.pitch=N),b.bearingDelta!==void 0&&(f.rotate=N)}_applyChanges(){let c={},f={},b={};for(let[S,D,N]of this._changes)S.panDelta&&(c.panDelta=(c.panDelta||new o.P(0,0))._add(S.panDelta)),S.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+S.zoomDelta),S.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+S.bearingDelta),S.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+S.pitchDelta),S.rollDelta&&(c.rollDelta=(c.rollDelta||0)+S.rollDelta),S.around!==void 0&&(c.around=S.around),S.pinchAround!==void 0&&(c.pinchAround=S.pinchAround),S.noInertia&&(c.noInertia=S.noInertia),o.e(f,D),o.e(b,N);this._updateMapTransform(c,f,b),this._changes=[]}_updateMapTransform(c,f,b){let S=this._map,D=S._getTransformForUpdate(),N=S.terrain;if(!(Mr(c)||N&&this._terrainMovement))return this._fireEvents(f,b,!0);S._stop(!0);let{panDelta:G,zoomDelta:q,bearingDelta:K,pitchDelta:it,rollDelta:ct,around:ut,pinchAround:gt}=c;gt!==void 0&&(ut=gt),ut=ut||S.transform.centerPoint,N&&!D.isPointOnMapSurface(ut)&&(ut=D.centerPoint);let yt={panDelta:G,zoomDelta:q,rollDelta:ct,pitchDelta:it,bearingDelta:K,around:ut};this._map.cameraHelper.useGlobeControls&&!D.isPointOnMapSurface(ut)&&(ut=D.centerPoint);let Pt=ut.distSqr(D.centerPoint)<.01?D.center:D.screenPointToLocation(G?ut.sub(G):ut);this._handleMapControls({terrain:N,tr:D,deltasForHelper:yt,preZoomAroundLoc:Pt,combinedEventsInProgress:f,panDelta:G}),S._applyUpdatedTransform(D),this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(f,b,!0)}_handleMapControls({terrain:c,tr:f,deltasForHelper:b,preZoomAroundLoc:S,combinedEventsInProgress:D,panDelta:N}){let G=this._map.cameraHelper;if(G.handleMapControlsRollPitchBearingZoom(b,f),c)return G.useGlobeControls?(this._terrainMovement||!D.drag&&!D.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void G.handleMapControlsPan(b,f,S)):this._terrainMovement||!D.drag&&!D.zoom?void(D.drag&&this._terrainMovement&&N?f.setCenter(f.screenPointToLocation(f.centerPoint.sub(N))):G.handleMapControlsPan(b,f,S)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void G.handleMapControlsPan(b,f,S));G.handleMapControlsPan(b,f,S)}_fireEvents(c,f,b){let S=bf(this._eventsInProgress),D=bf(c),N={};for(let ct in c){let{originalEvent:ut}=c[ct];this._eventsInProgress[ct]||(N[`${ct}start`]=ut),this._eventsInProgress[ct]=c[ct]}!S&&D&&this._fireEvent(\"movestart\",D.originalEvent);for(let ct in N)this._fireEvent(ct,N[ct]);D&&this._fireEvent(\"move\",D.originalEvent);for(let ct in c){let{originalEvent:ut}=c[ct];this._fireEvent(ct,ut)}let G={},q;for(let ct in this._eventsInProgress){let{handlerName:ut,originalEvent:gt}=this._eventsInProgress[ct];this._handlersById[ut].isActive()||(delete this._eventsInProgress[ct],q=f[ut]||gt,G[`${ct}end`]=q)}for(let ct in G)this._fireEvent(ct,G[ct]);let K=bf(this._eventsInProgress),it=(S||D)&&!K;if(it&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let ct=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&ct.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(ct)}if(b&&it){this._updatingCamera=!0;let ct=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ut=gt=>gt!==0&&-this._bearingSnap<gt&&gt<this._bearingSnap;!ct||!ct.essential&&w.prefersReducedMotion?(this._map.fire(new o.l(\"moveend\",{originalEvent:q})),ut(this._map.getBearing())&&this._map.resetNorth()):(ut(ct.bearing||this._map.getBearing())&&(ct.bearing=0),ct.freezeElevation=!0,this._map.easeTo(ct,{originalEvent:q})),this._updatingCamera=!1}}_fireEvent(c,f){this._map.fire(new o.l(c,f?{originalEvent:f}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((c=>{delete this._frameId,this.handleEvent(new fr(\"renderFrame\",{timeStamp:c})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class I2 extends o.E{constructor(c,f,b){super(),this._renderFrameCallback=()=>{let S=Math.min((R()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(S)),S<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=b.bearingSnap,this._zoomSnap=b.zoomSnap,this.cameraHelper=f,this.on(\"moveend\",(()=>{delete this._requestedCameraState}))}migrateProjection(c,f){c.apply(this.transform,!0),this.transform=c,this.cameraHelper=f}getCenter(){return new o.V(this.transform.center.lng,this.transform.center.lat)}setCenter(c,f){return this.jumpTo({center:c},f)}getCenterElevation(){return this.transform.elevation}setCenterElevation(c,f){return this.jumpTo({elevation:c},f),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(c){this._centerClampedToGround=c}panBy(c,f,b){return c=o.P.convert(c).mult(-1),this.panTo(this.transform.center,o.e({offset:c},f),b)}panTo(c,f,b){return this.easeTo(o.e({center:c},f),b)}getZoom(){return this.transform.zoom}setZoom(c,f){return this.jumpTo({zoom:c},f),this}zoomTo(c,f,b){return this.easeTo(o.e({zoom:c},f),b)}zoomIn(c,f){return this.zoomTo(o.cu(this.getZoom()+1,this._zoomSnap),c,f),this}zoomOut(c,f){return this.zoomTo(o.cu(this.getZoom()-1,this._zoomSnap),c,f),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(c,f){return c!=this.transform.fov&&(this.transform.setFov(c),this.fire(new o.l(\"movestart\",f)).fire(new o.l(\"move\",f)).fire(new o.l(\"moveend\",f))),this}getBearing(){return this.transform.bearing}setZoomSnap(c){return this._zoomSnap=c,this}getZoomSnap(){return this._zoomSnap}setBearing(c,f){return this.jumpTo({bearing:c},f),this}getPadding(){return this.transform.padding}setPadding(c,f){return this.jumpTo({padding:c},f),this}rotateTo(c,f,b){return this.easeTo(o.e({bearing:c},f),b)}resetNorth(c,f){return this.rotateTo(0,o.e({duration:1e3},c),f),this}resetNorthPitch(c,f){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},c),f),this}snapToNorth(c,f){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(c,f):this}getPitch(){return this.transform.pitch}setPitch(c,f){return this.jumpTo({pitch:c},f),this}getRoll(){return this.transform.roll}setRoll(c,f){return this.jumpTo({roll:c},f),this}cameraForBounds(c,f){c=wr.convert(c).adjustAntiMeridian();let b=f&&f.bearing||0;return this._cameraForBoxAndBearing(c.getNorthWest(),c.getSouthEast(),b,f)}_cameraForBoxAndBearing(c,f,b,S){let D={top:0,bottom:0,right:0,left:0};if(typeof(S=o.e({padding:D,offset:[0,0],maxZoom:this.transform.maxZoom},S)).padding==\"number\"){let K=S.padding;S.padding={top:K,bottom:K,right:K,left:K}}let N=o.e(D,S.padding);S.padding=N;let G=this.transform,q=new wr(c,f);return this.cameraHelper.cameraForBoxAndBearing(S,N,q,b,G)}fitBounds(c,f,b){return this._fitInternal(this.cameraForBounds(c,f),f,b)}fitScreenCoordinates(c,f,b,S,D){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(c)),this.transform.screenPointToLocation(o.P.convert(f)),b,S),S,D)}_fitInternal(c,f,b){return c?(delete(f=o.e(c,f)).padding,f.linear?this.easeTo(f,b):this.flyTo(f,b)):this}jumpTo(c,f){this.stop();let b=this._getTransformForUpdate(),S=!1,D=!1,N=!1,G=b.zoom;this.terrain&&b.setElevation(this.terrain.getElevationForLngLatZoom(c.center?o.V.convert(c.center):b.center,c.zoom||b.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(b,c);let q=b.zoom!==G;return\"elevation\"in c&&b.elevation!==+c.elevation&&b.setElevation(+c.elevation),\"bearing\"in c&&b.bearing!==+c.bearing&&(S=!0,b.setBearing(+c.bearing)),\"pitch\"in c&&b.pitch!==+c.pitch&&(D=!0,b.setPitch(+c.pitch)),\"roll\"in c&&b.roll!==+c.roll&&(N=!0,b.setRoll(+c.roll)),c.padding==null||b.isPaddingEqual(c.padding)||b.setPadding(c.padding),this._applyUpdatedTransform(b),this.fire(new o.l(\"movestart\",f)).fire(new o.l(\"move\",f)),q&&this.fire(new o.l(\"zoomstart\",f)).fire(new o.l(\"zoom\",f)).fire(new o.l(\"zoomend\",f)),S&&this.fire(new o.l(\"rotatestart\",f)).fire(new o.l(\"rotate\",f)).fire(new o.l(\"rotateend\",f)),D&&this.fire(new o.l(\"pitchstart\",f)).fire(new o.l(\"pitch\",f)).fire(new o.l(\"pitchend\",f)),N&&this.fire(new o.l(\"rollstart\",f)).fire(new o.l(\"roll\",f)).fire(new o.l(\"rollend\",f)),this.fire(new o.l(\"moveend\",f))}calculateCameraOptionsFromTo(c,f,b,S=0){let D=o.a6.fromLngLat(c,f),N=o.a6.fromLngLat(b,S),G=N.x-D.x,q=N.y-D.y,K=N.z-D.z,it=Math.hypot(G,q,K);if(it===0)throw new Error(\"Can't calculate camera options with same From and To\");let ct=Math.hypot(G,q),ut=o.aq(this.transform.cameraToCenterDistance/it/this.transform.tileSize),gt=180*Math.atan2(G,-q)/Math.PI,yt=180*Math.acos(ct/it)/Math.PI;return yt=K<0?90-yt:90+yt,{center:N.toLngLat(),elevation:S,zoom:ut,pitch:yt,bearing:gt}}calculateCameraOptionsFromCameraLngLatAltRotation(c,f,b,S,D){let N=this.transform.calculateCenterFromCameraLngLatAlt(c,f,b,S);return{center:N.center,elevation:N.elevation,zoom:N.zoom,bearing:b,pitch:S,roll:D}}easeTo(c,f){this._stop(!1,c.easeId),((c=o.e({offset:[0,0],duration:500,easing:o.cw},c)).animate===!1||!c.essential&&w.prefersReducedMotion)&&(c.duration=0);let b=this._getTransformForUpdate(),S=this.getBearing(),D=b.pitch,N=b.roll,G=\"bearing\"in c?this._normalizeBearing(c.bearing,S):S,q=\"pitch\"in c?+c.pitch:D,K=\"roll\"in c?this._normalizeBearing(c.roll,N):N,it=\"padding\"in c?c.padding:b.padding,ct=o.P.convert(c.offset),ut,gt;c.around&&(ut=o.V.convert(c.around),gt=b.locationToScreenPoint(ut));let yt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},Pt=this.cameraHelper.handleEaseTo(b,{bearing:G,pitch:q,roll:K,padding:it,around:ut,aroundPoint:gt,offsetAsPoint:ct,offset:c.offset,zoom:c.zoom,center:c.center});return this._rotating=this._rotating||S!==G,this._pitching=this._pitching||q!==D,this._rolling=this._rolling||K!==N,this._padding=!b.isPaddingEqual(it),this._zooming=this._zooming||Pt.isZooming,this._easeId=c.easeId,this._prepareEase(f,c.noMoveStart,yt),this.terrain&&this._prepareElevation(Pt.elevationCenter),this._ease((Ct=>{Pt.easeFunc(Ct),this.terrain&&!c.freezeElevation&&this._updateElevation(Ct),this._applyUpdatedTransform(b),this._fireMoveEvents(f)}),(Ct=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(f,Ct)}),c),this}_prepareEase(c,f,b={}){this._moving=!0,f||b.moving||this.fire(new o.l(\"movestart\",c)),this._zooming&&!b.zooming&&this.fire(new o.l(\"zoomstart\",c)),this._rotating&&!b.rotating&&this.fire(new o.l(\"rotatestart\",c)),this._pitching&&!b.pitching&&this.fire(new o.l(\"pitchstart\",c)),this._rolling&&!b.rolling&&this.fire(new o.l(\"rollstart\",c))}_prepareElevation(c){this._elevationCenter=c,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(c,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(c){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let f=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(c<1&&f!==this._elevationTarget){let b=this._elevationTarget-this._elevationStart;this._elevationStart+=c*(b-(f-(b*c+this._elevationStart))/(1-c)),this._elevationTarget=f}this.transform.setElevation(o.G.number(this._elevationStart,this._elevationTarget,c))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(c){if(!this.terrain&&c.elevation>=0&&c.pitch<=90)return{};let f=c.getCameraLngLat(),b=c.getCameraAltitude(),S=this.terrain?this.terrain.getElevationForLngLatZoom(f,c.zoom):0;if(b<S){let D=this.calculateCameraOptionsFromTo(f,S,c.center,c.elevation);return{pitch:D.pitch,zoom:D.zoom}}return{}}_applyUpdatedTransform(c){let f=[];if(f.push((S=>this._elevateCameraIfInsideTerrain(S))),this.transformCameraUpdate&&f.push((S=>this.transformCameraUpdate(S))),!f.length)return;let b=c.clone();for(let S of f){let D=b.clone(),{center:N,zoom:G,roll:q,pitch:K,bearing:it,elevation:ct}=S(D);N&&D.setCenter(N),ct!==void 0&&D.setElevation(ct),G!==void 0&&D.setZoom(G),q!==void 0&&D.setRoll(q),K!==void 0&&D.setPitch(K),it!==void 0&&D.setBearing(it),b.apply(D,!1)}this.transform.apply(b,!1)}_fireMoveEvents(c){this.fire(new o.l(\"move\",c)),this._zooming&&this.fire(new o.l(\"zoom\",c)),this._rotating&&this.fire(new o.l(\"rotate\",c)),this._pitching&&this.fire(new o.l(\"pitch\",c)),this._rolling&&this.fire(new o.l(\"roll\",c))}_afterEase(c,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId;let b=this._zooming,S=this._rotating,D=this._pitching,N=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,b&&this.fire(new o.l(\"zoomend\",c)),S&&this.fire(new o.l(\"rotateend\",c)),D&&this.fire(new o.l(\"pitchend\",c)),N&&this.fire(new o.l(\"rollend\",c)),this.fire(new o.l(\"moveend\",c))}flyTo(c,f){if(!c.essential&&w.prefersReducedMotion){let me=o.U(c,[\"center\",\"zoom\",\"bearing\",\"pitch\",\"roll\",\"elevation\",\"padding\"]);return this.jumpTo(me,f)}this.stop(),c=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cw},c);let b=this._getTransformForUpdate(),S=b.bearing,D=b.pitch,N=b.roll,G=b.padding,q=\"bearing\"in c?this._normalizeBearing(c.bearing,S):S,K=\"pitch\"in c?+c.pitch:D,it=\"roll\"in c?this._normalizeBearing(c.roll,N):N,ct=\"padding\"in c?c.padding:b.padding,ut=o.P.convert(c.offset),gt=b.centerPoint.add(ut),yt=b.screenPointToLocation(gt),Pt=this.cameraHelper.handleFlyTo(b,{bearing:q,pitch:K,roll:it,padding:ct,locationAtOffset:yt,offsetAsPoint:ut,center:c.center,minZoom:c.minZoom,zoom:c.zoom}),Ct=c.curve,Rt=Math.max(b.width,b.height),Ut=Rt/Pt.scaleOfZoom,Gt=Pt.pixelPathLength;typeof Pt.scaleOfMinZoom==\"number\"&&(Ct=Math.sqrt(Rt/Pt.scaleOfMinZoom/Gt*2));let zt=Ct*Ct;function jt(me){let Le=(Ut*Ut-Rt*Rt+(me?-1:1)*zt*zt*Gt*Gt)/(2*(me?Ut:Rt)*zt*Gt);return Math.log(Math.sqrt(Le*Le+1)-Le)}function Wt(me){return(Math.exp(me)-Math.exp(-me))/2}function It(me){return(Math.exp(me)+Math.exp(-me))/2}let Xt=jt(!1),Kt=function(me){return It(Xt)/It(Xt+Ct*me)},de=function(me){return Rt*((It(Xt)*(Wt(Le=Xt+Ct*me)/It(Le))-Wt(Xt))/zt)/Gt;var Le},le=(jt(!0)-Xt)/Ct;if(Math.abs(Gt)<2e-6||!isFinite(le)){if(Math.abs(Rt-Ut)<1e-6)return this.easeTo(c,f);let me=Ut<Rt?-1:1;le=Math.abs(Math.log(Ut/Rt))/Ct,de=()=>0,Kt=Le=>Math.exp(me*Ct*Le)}return c.duration=\"duration\"in c?+c.duration:1e3*le/(\"screenSpeed\"in c?+c.screenSpeed/Ct:+c.speed),c.maxDuration&&c.duration>c.maxDuration&&(c.duration=0),this._zooming=!0,this._rotating=S!==q,this._pitching=K!==D,this._rolling=it!==N,this._padding=!b.isPaddingEqual(ct),this._prepareEase(f,!1),this.terrain&&this._prepareElevation(Pt.targetCenter),this._ease((me=>{let Le=me*le,$e=1/Kt(Le),Ee=de(Le);this._rotating&&b.setBearing(o.G.number(S,q,me)),this._pitching&&b.setPitch(o.G.number(D,K,me)),this._rolling&&b.setRoll(o.G.number(N,it,me)),this._padding&&(b.interpolatePadding(G,ct,me),gt=b.centerPoint.add(ut)),Pt.easeFunc(me,$e,Ee,gt),this.terrain&&!c.freezeElevation&&this._updateElevation(me),this._applyUpdatedTransform(b),this._fireMoveEvents(f)}),(()=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(f)}),c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,f){var b;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,f)}return c||(b=this.handlers)===null||b===void 0||b.stop(!1),this}_ease(c,f,b){b.animate===!1||b.duration===0?(c(1),f()):(this._easeStart=R(),this._easeOptions=b,this._onEaseFrame=c,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(c,f){c=o.W(c,-180,180);let b=Math.abs(c-f);return Math.abs(c-360-f)<b&&(c-=360),Math.abs(c+360-f)<b&&(c+=360),c}queryTerrainElevation(c){return this.terrain?this.terrain.getElevationForLngLat(o.V.convert(c),this.transform):null}}let r0={compact:!0,customAttribution:'<a href=\"https://maplibre.org/\" target=\"_blank\">MapLibre</a>'};class na{constructor(c=r0){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=f=>{!f||f.sourceDataType!==\"metadata\"&&f.sourceDataType!==\"visibility\"&&f.dataType!==\"style\"&&f.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=c}getDefaultPosition(){return\"bottom-right\"}onAdd(c){return this._map=c,this._compact=this.options.compact,this._container=z.create(\"details\",\"maplibregl-ctrl maplibregl-ctrl-attrib\"),this._compactButton=z.create(\"summary\",\"maplibregl-ctrl-attrib-button\",this._container),this._compactButton.addEventListener(\"click\",this._toggleAttribution),this._setElementTitle(this._compactButton,\"ToggleAttribution\"),this._innerContainer=z.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(){this._container.remove(),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(c,f){let b=this._map._getUIString(`AttributionControl.${f}`);c.title=b,c.setAttribute(\"aria-label\",b)}_updateAttributions(){if(!this._map.style)return;let c=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=c.concat(this.options.customAttribution.map((S=>typeof S!=\"string\"?\"\":S))):typeof this.options.customAttribution==\"string\"&&c.push(this.options.customAttribution)),this._map.style.stylesheet){let S=this._map.style.stylesheet;this.styleOwner=S.owner,this.styleId=S.id}let f=this._map.style.tileManagers;for(let S in f){let D=f[S];if(D.used||D.usedForTerrain){let N=D.getSource();N.attribution&&c.indexOf(N.attribution)<0&&c.push(N.attribution)}}c=c.filter((S=>String(S).trim())),c.sort(((S,D)=>S.length-D.length)),c=c.filter(((S,D)=>{for(let N=D+1;N<c.length;N++)if(c[N].indexOf(S)>=0)return!1;return!0}));let b=c.join(\" | \");b!==this._attribHTML&&(this._attribHTML=b,c.length?(this._innerContainer.innerHTML=z.sanitize(b),this._container.classList.remove(\"maplibregl-attrib-empty\")):this._container.classList.add(\"maplibregl-attrib-empty\"),this._updateCompact(),this._editLink=null)}}class yl{constructor(c={}){this._updateCompact=()=>{let f=this._container.children;if(f.length){let b=f[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&b.classList.add(\"maplibregl-compact\"):b.classList.remove(\"maplibregl-compact\")}},this.options=c}getDefaultPosition(){return\"bottom-left\"}onAdd(c){this._map=c,this._compact=this.options&&this.options.compact,this._container=z.create(\"div\",\"maplibregl-ctrl\");let f=z.create(\"a\",\"maplibregl-ctrl-logo\");return f.target=\"_blank\",f.rel=\"noopener nofollow\",f.href=\"https://maplibre.org/\",f.setAttribute(\"aria-label\",this._map._getUIString(\"LogoControl.Title\")),f.setAttribute(\"rel\",\"noopener nofollow\"),this._container.appendChild(f),this._container.style.display=\"block\",this._map.on(\"resize\",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off(\"resize\",this._updateCompact),this._map=void 0,this._compact=void 0}}class au{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){let f=++this._id;return this._queue.push({callback:c,id:f,cancelled:!1}),f}remove(c){let f=this._currentlyRunning,b=f?this._queue.concat(f):this._queue;for(let S of b)if(S.id===c)return void(S.cancelled=!0)}run(c=0){if(this._currentlyRunning)throw new Error(\"Attempting to run(), but is already running.\");let f=this._currentlyRunning=this._queue;this._queue=[];for(let b of f)if(!b.cancelled&&(b.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var k2=o.aS([{name:\"a_pos3d\",type:\"Int16\",components:3}]);class CM extends o.E{constructor(c){super(),this._lastTilesetChange=R(),this.tileManager=c,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=c._source.tileSize*2**this.deltaZoom,c.usedForTerrain=!0,c.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(c,f){this.tileManager.update(c,f),this._renderableTilesKeys=[];let b={};for(let S of jh(c,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f,calculateTileZoom:this.tileManager._source.calculateTileZoom}))b[S.key]=!0,this._renderableTilesKeys.push(S.key),this._tiles[S.key]||(S.terrainRttPosMatrix32f=new Float64Array(16),o.c5(S.terrainRttPosMatrix32f,0,o.a5,o.a5,0,0,1),this._tiles[S.key]=new af(S,this.tileSize),this._lastTilesetChange=R());for(let S in this._tiles)b[S]||delete this._tiles[S]}freeRtt(c){for(let f in this._tiles){let b=this._tiles[f];(!c||b.tileID.equals(c)||b.tileID.isChildOf(c)||c.isChildOf(b.tileID))&&(b.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((c=>this.getTileByID(c)))}getTileByID(c){return this._tiles[c]}getTerrainCoords(c,f){return f?this._getTerrainCoordsForTileRanges(c,f):this._getTerrainCoordsForRegularTile(c)}_getTerrainCoordsForRegularTile(c){let f={};for(let b of this._renderableTilesKeys){let S=this._tiles[b].tileID,D=c.clone(),N=o.bi();if(S.canonical.equals(c.canonical))o.c5(N,0,o.a5,o.a5,0,0,1);else if(S.canonical.isChildOf(c.canonical)){let G=S.canonical.z-c.canonical.z,q=S.canonical.x-(S.canonical.x>>G<<G),K=S.canonical.y-(S.canonical.y>>G<<G),it=o.a5>>G;o.c5(N,0,it,it,0,0,1),o.O(N,N,[-q*it,-K*it,0])}else{if(!c.canonical.isChildOf(S.canonical))continue;{let G=c.canonical.z-S.canonical.z,q=c.canonical.x-(c.canonical.x>>G<<G),K=c.canonical.y-(c.canonical.y>>G<<G),it=o.a5>>G;o.c5(N,0,o.a5,o.a5,0,0,1),o.O(N,N,[q*it,K*it,0]),o.Q(N,N,[1/2**G,1/2**G,0])}}D.terrainRttPosMatrix32f=new Float32Array(N),f[b]=D}return f}_getTerrainCoordsForTileRanges(c,f){let b={};for(let S of this._renderableTilesKeys){let D=this._tiles[S].tileID;if(!this._isWithinTileRanges(D,f))continue;let N=c.clone(),G=o.bi();if(D.canonical.z===c.canonical.z){let q=c.canonical.x-D.canonical.x+c.wrap*(1<<c.canonical.z),K=c.canonical.y-D.canonical.y;o.c5(G,0,o.a5,o.a5,0,0,1),o.O(G,G,[q*o.a5,K*o.a5,0])}else if(D.canonical.z>c.canonical.z){let q=D.canonical.z-c.canonical.z,K=D.canonical.x-(D.canonical.x>>q<<q)+c.wrap*(1<<D.canonical.z),it=D.canonical.y-(D.canonical.y>>q<<q),ct=c.canonical.x-(D.canonical.x>>q),ut=c.canonical.y-(D.canonical.y>>q),gt=o.a5>>q;o.c5(G,0,gt,gt,0,0,1),o.O(G,G,[-K*gt+ct*o.a5,-it*gt+ut*o.a5,0])}else{let q=c.canonical.z-D.canonical.z,K=c.canonical.x-(c.canonical.x>>q<<q)+c.wrap*(1<<c.canonical.z),it=c.canonical.y-(c.canonical.y>>q<<q),ct=(c.canonical.x>>q)-D.canonical.x,ut=(c.canonical.y>>q)-D.canonical.y,gt=o.a5<<q;o.c5(G,0,gt,gt,0,0,1),o.O(G,G,[K*o.a5+ct*gt,it*o.a5+ut*gt,0])}N.terrainRttPosMatrix32f=new Float32Array(G),b[S]=N}return b}getSourceTile(c,f){let b=this.tileManager._source,S=c.overscaledZ-this.deltaZoom;if(S>b.maxzoom&&(S=b.maxzoom),S<b.minzoom)return;this._sourceTileCache[c.key]||(this._sourceTileCache[c.key]=c.scaledTo(S).key);let D=this.findTileInCaches(this._sourceTileCache[c.key]);if(!D?.dem&&f)for(;S>=b.minzoom&&!D?.dem;)D=this.findTileInCaches(c.scaledTo(S--).key);return D}findTileInCaches(c){let f=this.tileManager.getTileByID(c);return f||(f=this.tileManager._outOfViewCache.getByKey(c),f)}anyTilesAfterTime(c=Date.now()){return this._lastTilesetChange>=c}_isWithinTileRanges(c,f){let b=f[c.canonical.z];return!!b&&(c.wrap>b.minWrap||c.wrap<b.maxWrap||c.canonical.x>=b.minTileXWrapped&&c.canonical.x<=b.maxTileXWrapped&&c.canonical.y>=b.minTileY&&c.canonical.y<=b.maxTileY)}}class IM{constructor(c,f,b){this._meshCache={},this.painter=c,this.tileManager=new CM(f),this.options=b,this.exaggeration=typeof b.exaggeration==\"number\"?b.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(let c in this._meshCache)this._meshCache[c].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(c,f,b,S=o.a5){var D;let N=c.normalizeCoordinates(f,b,S);if(!N)return 0;let G=this.getTerrainData(N.tileID),q=(D=G.tile)===null||D===void 0?void 0:D.dem;if(!q)return 0;let K=o.cA([],[N.x/S*o.a5,N.y/S*o.a5],G.u_terrain_matrix),it=[K[0]*q.dim,K[1]*q.dim],ct=Math.floor(it[0]),ut=Math.floor(it[1]),gt=it[0]-ct,yt=it[1]-ut;return q.get(ct,ut)*(1-gt)*(1-yt)+q.get(ct+1,ut)*gt*(1-yt)+q.get(ct,ut+1)*(1-gt)*yt+q.get(ct+1,ut+1)*gt*yt}getElevationForLngLatZoom(c,f){if(!o.cB(f,c.wrap()))return 0;let{tileID:b,mercatorX:S,mercatorY:D}=this._getOverscaledTileIDFromLngLatZoom(c,f);return this.getElevation(b,S%o.a5,D%o.a5,o.a5)}getElevationForLngLat(c,f){let b=jh(f,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),S=0;for(let D of b)D.canonical.z>S&&(S=Math.min(D.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(c,S)}getElevation(c,f,b,S=o.a5){return this.getDEMElevation(c,f,b,S)*this.exaggeration}getTerrainData(c){if(!this._emptyDemTexture){let S=this.painter.context,D=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new o.T(S,D,S.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new o.T(S,new o.R({width:1,height:1}),S.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(S.gl.NEAREST,S.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.ao([])}let f=this.tileManager.getSourceTile(c,!0);if(f&&f.dem&&(!f.demTexture||f.needsTerrainPrepare)){let S=this.painter.context;f.demTexture=this.painter.getTileTexture(f.dem.stride),f.demTexture?f.demTexture.update(f.dem.getPixels(),{premultiply:!1}):f.demTexture=new o.T(S,f.dem.getPixels(),S.gl.RGBA,{premultiply:!1}),f.demTexture.bind(S.gl.NEAREST,S.gl.CLAMP_TO_EDGE),f.needsTerrainPrepare=!1}let b=f&&f.toString()+f.tileID.key+c.key;if(b&&!this._demMatrixCache[b]){let S=this.tileManager.getSource().maxzoom,D=c.canonical.z-f.tileID.canonical.z;c.overscaledZ>c.canonical.z&&(c.canonical.z>=S?D=c.canonical.z-S:o.w(\"cannot calculate elevation if elevation maxzoom > source.maxzoom\"));let N=c.canonical.x-(c.canonical.x>>D<<D),G=c.canonical.y-(c.canonical.y>>D<<D),q=o.cC(new Float64Array(16),[1/(o.a5<<D),1/(o.a5<<D),0]);o.O(q,q,[N*o.a5,G*o.a5,0]),this._demMatrixCache[c.key]={matrix:q,coord:c}}return{u_depth:2,u_terrain:3,u_terrain_dim:f&&f.dem&&f.dem.dim||1,u_terrain_matrix:b?this._demMatrixCache[c.key].matrix:this._emptyDemMatrix,u_terrain_unpack:f&&f.dem&&f.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(f&&f.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:f}}getFramebuffer(c){let f=this.painter,b=f.width/devicePixelRatio,S=f.height/devicePixelRatio;return!this._fbo||this._fbo.width===b&&this._fbo.height===S||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new o.T(f.context,{width:b,height:S,data:null},f.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(f.context.gl.NEAREST,f.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new o.T(f.context,{width:b,height:S,data:null},f.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(f.context.gl.NEAREST,f.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=f.context.createFramebuffer(b,S,!0,!1),this._fbo.depthAttachment.set(f.context.createRenderbuffer(f.context.gl.DEPTH_COMPONENT16,b,S))),this._fbo.colorAttachment.set(c===\"coords\"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let c=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let f=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let D=0,N=0;D<this._coordsTextureSize;D++)for(let G=0;G<this._coordsTextureSize;G++,N+=4)f[N+0]=255&G,f[N+1]=255&D,f[N+2]=G>>8<<4|D>>8,f[N+3]=0;let b=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),S=new o.T(c,b,c.gl.RGBA,{premultiply:!1});return S.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._coordsTexture=S,S}pointCoordinate(c){this.painter.maybeDrawDepthAndCoords(!0);let f=new Uint8Array(4),b=this.painter.context,S=b.gl,D=Math.round(c.x*this.painter.pixelRatio/devicePixelRatio),N=Math.round(c.y*this.painter.pixelRatio/devicePixelRatio),G=Math.round(this.painter.height/devicePixelRatio);b.bindFramebuffer.set(this.getFramebuffer(\"coords\").framebuffer),S.readPixels(D,G-N-1,1,1,S.RGBA,S.UNSIGNED_BYTE,f),b.bindFramebuffer.set(null);let q=f[0]+(f[2]>>4<<8),K=f[1]+((15&f[2])<<8),it=this.coordsIndex[255-f[3]],ct=it&&this.tileManager.getTileByID(it);if(!ct)return null;let ut=this._coordsTextureSize,gt=(1<<ct.tileID.canonical.z)*ut;return new o.a6((ct.tileID.canonical.x*ut+q)/gt+ct.tileID.wrap,(ct.tileID.canonical.y*ut+K)/gt,this.getElevation(ct.tileID,q,K,ut))}depthAtPoint(c){let f=new Uint8Array(4),b=this.painter.context,S=b.gl;return b.bindFramebuffer.set(this.getFramebuffer(\"depth\").framebuffer),S.readPixels(c.x,this.painter.height/devicePixelRatio-c.y-1,1,1,S.RGBA,S.UNSIGNED_BYTE,f),b.bindFramebuffer.set(null),(f[0]/16777216+f[1]/65536+f[2]/256+f[3])/256}getTerrainMesh(c){var f;let b=((f=this.painter.style.projection)===null||f===void 0?void 0:f.transitionState)>0,S=b&&c.canonical.y===0,D=b&&c.canonical.y===(1<<c.canonical.z)-1,N=`m_${S?\"n\":\"\"}_${D?\"s\":\"\"}`;if(this._meshCache[N])return this._meshCache[N];let G=this.painter.context,q=new o.cD,K=new o.aW,it=this.meshSize,ct=o.a5/it,ut=it*it;for(let It=0;It<=it;It++)for(let Xt=0;Xt<=it;Xt++)q.emplaceBack(Xt*ct,It*ct,0);for(let It=0;It<ut;It+=it+1)for(let Xt=0;Xt<it;Xt++)K.emplaceBack(Xt+It,it+Xt+It+1,it+Xt+It+2),K.emplaceBack(Xt+It,it+Xt+It+2,Xt+It+1);let gt=q.length,yt=gt+(it+1),Pt=(it+1)*it,Ct=S?o.bp:0,Rt=S?0:1,Ut=D?o.bq:o.a5,Gt=D?0:1;for(let It=0;It<=it;It++)q.emplaceBack(It*ct,Ct,Rt);for(let It=0;It<=it;It++)q.emplaceBack(It*ct,Ut,Gt);for(let It=0;It<it;It++)K.emplaceBack(Pt+It,yt+It,yt+It+1),K.emplaceBack(Pt+It,yt+It+1,Pt+It+1),K.emplaceBack(0+It,gt+It+1,gt+It),K.emplaceBack(0+It,0+It+1,gt+It+1);let zt=q.length,jt=zt+2*(it+1);for(let It of[0,1])for(let Xt=0;Xt<=it;Xt++)for(let Kt of[0,1])q.emplaceBack(It*o.a5,Xt*ct,Kt);for(let It=0;It<2*it;It+=2)K.emplaceBack(zt+It,zt+It+1,zt+It+3),K.emplaceBack(zt+It,zt+It+3,zt+It+2),K.emplaceBack(jt+It,jt+It+3,jt+It+1),K.emplaceBack(jt+It,jt+It+2,jt+It+3);let Wt=new jo(G.createVertexBuffer(q,k2.members),G.createIndexBuffer(K),o.aV.simpleSegment(0,0,q.length,K.length));return this._meshCache[N]=Wt,Wt}getMeshFrameDelta(c){return 2*Math.PI*o.bC/Math.pow(2,Math.max(c,0))/5}getMinTileElevationForLngLatZoom(c,f){var b;if(!o.cB(f,c.wrap()))return 0;let{tileID:S}=this._getOverscaledTileIDFromLngLatZoom(c,f);return(b=this.getMinMaxElevation(S).minElevation)!==null&&b!==void 0?b:0}getMinMaxElevation(c){let f=this.getTerrainData(c).tile,b={minElevation:null,maxElevation:null};return f&&f.dem&&(b.minElevation=f.dem.min*this.exaggeration,b.maxElevation=f.dem.max*this.exaggeration),b}_getOverscaledTileIDFromLngLatZoom(c,f){let b=o.a6.fromLngLat(c.wrap()),S=(1<<f)*o.a5,D=b.x*S,N=b.y*S,G=Math.floor(D/o.a5),q=Math.floor(N/o.a5);return{tileID:new o.a2(f,0,f,G,q),mercatorX:D,mercatorY:N}}}class Zm{constructor(c,f,b){this._context=c,this._size=f,this._tileSize=b,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let c of this._objects)c.texture.destroy(),c.fbo.destroy()}_createObject(c){let f=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),b=new o.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return b.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),f.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),f.colorAttachment.set(b.texture),{id:c,fbo:f,texture:b,stamp:-1,inUse:!1}}getObjectForId(c){return this._objects[c]}useObject(c){c.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((f=>c.id!==f)),this._recentlyUsed.push(c.id)}stampObject(c){c.stamp=++this._stamp}getOrCreateFreeObject(){for(let f of this._recentlyUsed)if(!this._objects[f].inUse)return this._objects[f];if(this._objects.length>=this._size)throw new Error(\"No free RenderPool available, call freeAllObjects() required!\");let c=this._createObject(this._objects.length);return this._objects.push(c),c}freeObject(c){c.inUse=!1}freeAllObjects(){for(let c of this._objects)this.freeObject(c)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((c=>!c.inUse))===!1}}let dn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,\"color-relief\":!0};class xo{constructor(c,f){this.painter=c,this.terrain=f,this.pool=new Zm(c.context,30,f.tileManager.tileSize*f.qualityFactor)}destruct(){this.pool.destruct()}getTexture(c){return this.pool.getObjectForId(c.rtt[this._stacks.length-1].id).texture}prepareForRender(c,f){var b,S;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=c._order.filter((D=>!c._layers[D].isHidden(f))),this._coordsAscending={};for(let D in c.tileManagers){this._coordsAscending[D]={};let N=c.tileManagers[D].getVisibleCoordinates(),G=c.tileManagers[D].getSource(),q=G instanceof Rs?G.terrainTileRanges:null;for(let K of N){let it=this.terrain.tileManager.getTerrainCoords(K,q);for(let ct in it)this._coordsAscending[D][ct]||(this._coordsAscending[D][ct]=[]),this._coordsAscending[D][ct].push(it[ct])}}this._rttFingerprints={};for(let D of c._order){let N=c._layers[D],G=N.source;if(dn[N.type]&&!this._rttFingerprints[G]){this._rttFingerprints[G]={};let q=(S=(b=c.tileManagers[G])===null||b===void 0?void 0:b.getState().revision)!==null&&S!==void 0?S:0;for(let K in this._coordsAscending[G])this._rttFingerprints[G][K]=`${this._coordsAscending[G][K].map((it=>it.key)).sort().join()}#${q}`}}for(let D of this._renderableTiles)for(let N in this._rttFingerprints){let G=this._rttFingerprints[N][D.tileID.key];G&&G!==D.rttFingerprint[N]&&(D.rtt=[])}}renderLayer(c,f){if(c.isHidden(this.painter.transform.zoom))return!1;let b=Object.assign(Object.assign({},f),{isRenderingToTexture:!0}),S=c.type,D=this.painter,N=this._renderableLayerIds[this._renderableLayerIds.length-1]===c.id;if(dn[S]&&(this._prevType&&dn[this._prevType]||this._stacks.push([]),this._prevType=S,this._stacks[this._stacks.length-1].push(c.id),!N))return!0;if(dn[this._prevType]||dn[S]&&N){this._prevType=S;let G=this._stacks.length-1,q=this._stacks[G]||[];for(let K of this._renderableTiles){if(this.pool.isFull()&&(nv(this.painter,this.terrain,this._rttTiles,b),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(K),K.rtt[G]){let ct=this.pool.getObjectForId(K.rtt[G].id);if(ct.stamp===K.rtt[G].stamp){this.pool.useObject(ct);continue}}let it=this.pool.getOrCreateFreeObject();this.pool.useObject(it),this.pool.stampObject(it),K.rtt[G]={id:it.id,stamp:it.stamp},D.context.bindFramebuffer.set(it.fbo.framebuffer),D.context.clear({color:o.bn.transparent,stencil:0}),D.currentStencilSource=void 0;for(let ct=0;ct<q.length;ct++){let ut=D.style._layers[q[ct]],gt=ut.source?this._coordsAscending[ut.source][K.tileID.key]:[K.tileID];D.context.viewport.set([0,0,it.fbo.width,it.fbo.height]),D._renderTileClippingMasks(ut,gt,!0),D.renderLayer(D,D.style.tileManagers[ut.source],ut,gt,b),ut.source&&(K.rttFingerprint[ut.source]=this._rttFingerprints[ut.source][K.tileID.key])}}return nv(this.painter,this.terrain,this._rttTiles,b),this._rttTiles=[],this.pool.freeAllObjects(),dn[S]}return!1}}let nh={\"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\":\"Drag to rotate map, click to reset 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\",\"GlobeControl.Enable\":\"Enable globe\",\"GlobeControl.Disable\":\"Disable globe\",\"TerrainControl.Enable\":\"Enable terrain\",\"TerrainControl.Disable\":\"Disable terrain\",\"CooperativeGesturesHandler.WindowsHelpText\":\"Use Ctrl + scroll to zoom the map\",\"CooperativeGesturesHandler.MacHelpText\":\"Use \\u2318 + scroll to zoom the map\",\"CooperativeGesturesHandler.MobileHelpText\":\"Use two fingers to move the map\"},xf=s,Km={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:r0,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:\"high-performance\",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 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],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:o.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:\"sans-serif\",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20},wf=class extends I2{get _ownerWindow(){var I,c;return((c=(I=this._container)===null||I===void 0?void 0:I.ownerDocument)===null||c===void 0?void 0:c.defaultView)||window}constructor(I){var c,f;o.cE.mark(o.cF.create);let b=Object.assign(Object.assign(Object.assign({},Km),I),{canvasContextAttributes:Object.assign(Object.assign({},Km.canvasContextAttributes),I.canvasContextAttributes)});if(b.minZoom!=null&&b.maxZoom!=null&&b.minZoom>b.maxZoom)throw new Error(\"maxZoom must be greater than or equal to minZoom\");if(b.minPitch!=null&&b.maxPitch!=null&&b.minPitch>b.maxPitch)throw new Error(\"maxPitch must be greater than or equal to minPitch\");if(b.minPitch!=null&&b.minPitch<0)throw new Error(\"minPitch must be greater than or equal to 0\");if(b.maxPitch!=null&&b.maxPitch>180)throw new Error(\"maxPitch must be less than or equal to 180\");let S=new Xu,D=new HA;b.minZoom!==void 0&&S.setMinZoom(b.minZoom),b.maxZoom!==void 0&&S.setMaxZoom(b.maxZoom),b.minPitch!==void 0&&S.setMinPitch(b.minPitch),b.maxPitch!==void 0&&S.setMaxPitch(b.maxPitch),b.renderWorldCopies!==void 0&&S.setRenderWorldCopies(b.renderWorldCopies),b.transformConstrain!==null&&S.setConstrainOverride(b.transformConstrain),super(S,D,{bearingSnap:b.bearingSnap,zoomSnap:b.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new au,this._controls=[],this._mapId=o.ac(),this._lostContextStyle={style:null,images:null},this._contextLost=G=>{if(G.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let q of Object.values(this.style._layers))if(q.type===\"custom\"&&console.warn(`Custom layer with id '${q.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),q._listeners)for(let[K]of Object.entries(q._listeners))console.warn(`Custom layer with id '${q.id}' had event listeners for event '${K}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new o.l(\"webglcontextlost\",{originalEvent:G}))}else this.fire(new o.l(\"webglcontextlost\",{originalEvent:G}))},this._contextRestored=G=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new o.l(\"webglcontextrestored\",{originalEvent:G}))},this._onMapScroll=G=>{if(G.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=b.interactive,this._maxTileCacheSize=b.maxTileCacheSize,this._maxTileCacheZoomLevels=b.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},b.canvasContextAttributes),this._trackResize=b.trackResize===!0,this._bearingSnap=b.bearingSnap,this._zoomSnap=b.zoomSnap,this._centerClampedToGround=b.centerClampedToGround,this._refreshExpiredTiles=b.refreshExpiredTiles===!0,this._fadeDuration=b.fadeDuration,this._crossSourceCollisions=b.crossSourceCollisions===!0,this._collectResourceTiming=b.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},nh),b.locale),this._clickTolerance=b.clickTolerance,this._overridePixelRatio=b.pixelRatio,this._maxCanvasSize=b.maxCanvasSize,this._zoomLevelsToOverscale=b.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=b.transformCameraUpdate,this.transformConstrain=b.transformConstrain,this.cancelPendingTileRequestsWhileZooming=b.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(b.anisotropicFilterPitch),b.reduceMotion!==void 0&&(w.prefersReducedMotion=b.reduceMotion),this._imageQueueHandle=W.addThrottleControl((()=>this.isMoving())),this._requestManager=new Y(b.transformRequest),this._container=this._resolveContainer(b.container),b.maxBounds&&this.setMaxBounds(b.maxBounds),this._setupContainer(),this._setupPainter(),this.on(\"move\",(()=>this._update(!1))),this.on(\"moveend\",(()=>this._update(!1))),this.on(\"zoom\",(()=>this._update(!0))),this.on(\"terrain\",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),this.once(\"idle\",(()=>{this._idleTriggered=!0})),typeof window<\"u\"&&(this._ownerWindow.addEventListener(\"online\",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Xm(this,b),this._hash=b.hash&&new zm(typeof b.hash==\"string\"&&b.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:b.center,elevation:b.elevation,zoom:b.zoom,bearing:b.bearing,pitch:b.pitch,roll:b.roll}),b.bounds&&(this.resize(),this.fitBounds(b.bounds,o.e({},b.fitBoundsOptions,{duration:0}))));let N=typeof b.style==\"string\"||((f=(c=b.style)===null||c===void 0?void 0:c.projection)===null||f===void 0?void 0:f.type)!==\"globe\";this.resize(null,N),this._localIdeographFontFamily=b.localIdeographFontFamily,this._validateStyle=b.validateStyle,b.style&&this.setStyle(b.style,{localIdeographFontFamily:b.localIdeographFontFamily}),b.attributionControl&&this.addControl(new na(typeof b.attributionControl==\"boolean\"?void 0:b.attributionControl)),b.maplibreLogo&&this.addControl(new yl,b.logoPosition),this.on(\"style.load\",(()=>{if(N||this._resizeTransform(),this.transform.unmodified){let G=o.U(this.style.stylesheet,[\"center\",\"zoom\",\"bearing\",\"pitch\",\"roll\"]);this.jumpTo(G)}})),this.on(\"data\",(G=>{this._update(G.dataType===\"style\"),this.fire(new o.l(`${G.dataType}data`,G))})),this.on(\"dataloading\",(G=>{this.fire(new o.l(`${G.dataType}dataloading`,G))})),this.on(\"dataabort\",(G=>{this.fire(new o.l(\"sourcedataabort\",G))}))}_getMapId(){return this._mapId}setGlobalStateProperty(I,c){return this.style.setGlobalStateProperty(I,c),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(I,c){if(c===void 0&&(c=I.getDefaultPosition?I.getDefaultPosition():\"top-right\"),!I||!I.onAdd)return this.fire(new o.k(new Error(\"Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.\")));let f=I.onAdd(this);this._controls.push(I);let b=this._controlPositions[c];return c.indexOf(\"bottom\")!==-1?b.insertBefore(f,b.firstChild):b.appendChild(f),this}removeControl(I){if(!I||!I.onRemove)return this.fire(new o.k(new Error(\"Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.\")));let c=this._controls.indexOf(I);return c>-1&&this._controls.splice(c,1),I.onRemove(this),this}hasControl(I){return this._controls.indexOf(I)>-1}coveringTiles(I){return jh(this.transform,I)}calculateCameraOptionsFromTo(I,c,f,b){return b==null&&this.terrain&&(b=this.terrain.getElevationForLngLat(f,this.transform)),super.calculateCameraOptionsFromTo(I,c,f,b)}resize(I,c=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(c);let f=!this._moving;return f&&(this.stop(),this.fire(new o.l(\"movestart\",I)).fire(new o.l(\"move\",I))),this.fire(new o.l(\"resize\",I)),f&&this.fire(new o.l(\"moveend\",I)),this}_resizeInternal(I=!0){let[c,f]=this._containerDimensions(),b=this._getClampedPixelRatio(c,f);if(this._resizeCanvas(c,f,b),this.painter.resize(c,f,b),this.painter.overLimit()){let S=this.painter.context.gl;this._maxCanvasSize=[S.drawingBufferWidth,S.drawingBufferHeight];let D=this._getClampedPixelRatio(c,f);this._resizeCanvas(c,f,D),this.painter.resize(c,f,D)}this._resizeTransform(I)}_resizeTransform(I=!0){var c;let[f,b]=this._containerDimensions();this.transform.resize(f,b,I),(c=this._requestedCameraState)===null||c===void 0||c.resize(f,b,I)}_getClampedPixelRatio(I,c){let{0:f,1:b}=this._maxCanvasSize,S=this.getPixelRatio(),D=I*S,N=c*S;return Math.min(D>f?f/D:1,N>b?b/N:1)*S}getPixelRatio(){var I;return(I=this._overridePixelRatio)!==null&&I!==void 0?I:devicePixelRatio}setPixelRatio(I){this._overridePixelRatio=I,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(I){return this.transform.setMaxBounds(wr.convert(I)),this._update()}setMinZoom(I){if((I=I??-2)>=-2&&I<=this.transform.maxZoom){let c=this.transform.zoom,f=this._getTransformForUpdate();return f.setMinZoom(I),this._applyUpdatedTransform(f),this._update(),c!==this.transform.zoom&&this.fire(new o.l(\"zoomstart\")).fire(new o.l(\"zoom\")).fire(new o.l(\"zoomend\")).fire(new o.l(\"movestart\")).fire(new o.l(\"move\")).fire(new o.l(\"moveend\")),this}throw new Error(\"minZoom must be between -2 and the current maxZoom, inclusive\")}getMinZoom(){return this.transform.minZoom}setMaxZoom(I){if((I=I??22)>=this.transform.minZoom){let c=this.transform.zoom,f=this._getTransformForUpdate();return f.setMaxZoom(I),this._applyUpdatedTransform(f),this._update(),c!==this.transform.zoom&&this.fire(new o.l(\"zoomstart\")).fire(new o.l(\"zoom\")).fire(new o.l(\"zoomend\")).fire(new o.l(\"movestart\")).fire(new o.l(\"move\")).fire(new o.l(\"moveend\")),this}throw new Error(\"maxZoom must be greater than the current minZoom\")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(I){if((I=I??0)<0)throw new Error(\"minPitch must be greater than or equal to 0\");if(I>=0&&I<=this.transform.maxPitch){let c=this.transform.pitch,f=this._getTransformForUpdate();return f.setMinPitch(I),this._applyUpdatedTransform(f),this._update(),c!==this.transform.pitch&&this.fire(new o.l(\"pitchstart\")).fire(new o.l(\"pitch\")).fire(new o.l(\"pitchend\")).fire(new o.l(\"movestart\")).fire(new o.l(\"move\")).fire(new o.l(\"moveend\")),this}throw new Error(\"minPitch must be between 0 and the current maxPitch, inclusive\")}getMinPitch(){return this.transform.minPitch}setMaxPitch(I){if((I=I??60)>180)throw new Error(\"maxPitch must be less than or equal to 180\");if(I>=this.transform.minPitch){let c=this.transform.pitch,f=this._getTransformForUpdate();return f.setMaxPitch(I),this._applyUpdatedTransform(f),this._update(),c!==this.transform.pitch&&this.fire(new o.l(\"pitchstart\")).fire(new o.l(\"pitch\")).fire(new o.l(\"pitchend\")).fire(new o.l(\"movestart\")).fire(new o.l(\"move\")).fire(new o.l(\"moveend\")),this}throw new Error(\"maxPitch must be greater than the current minPitch\")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(I){if((I=I??20)>180)throw new Error(\"anisotropicFilterPitch must be less than or equal to 180\");if(I<0)throw new Error(\"anisotropicFilterPitch must be greater than or equal to 0\");return this._anisotropicFilterPitch=I,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(I){return this.transform.setRenderWorldCopies(I),this._update()}setTransformConstrain(I){return this.transform.setConstrainOverride(I),this._update()}project(I){return this.transform.locationToScreenPoint(o.V.convert(I),this.style&&this.terrain)}unproject(I){return this.transform.screenPointToLocation(o.P.convert(I),this.terrain)}isMoving(){var I;return this._moving||((I=this.handlers)===null||I===void 0?void 0:I.isMoving())}isZooming(){var I;return this._zooming||((I=this.handlers)===null||I===void 0?void 0:I.isZooming())}isRotating(){var I;return this._rotating||((I=this.handlers)===null||I===void 0?void 0:I.isRotating())}_createDelegatedListener(I,c,f){if(I===\"mouseenter\"||I===\"mouseover\"){let b=!1;return{layers:c,listener:f,delegates:{mousemove:D=>{let N=c.filter((q=>this.getLayer(q))),G=N.length!==0?this.queryRenderedFeatures(D.point,{layers:N}):[];G.length?b||(b=!0,f.call(this,new Al(I,this,D.originalEvent,{features:G}))):b=!1},mouseout:()=>{b=!1}}}}if(I===\"mouseleave\"||I===\"mouseout\"){let b=!1;return{layers:c,listener:f,delegates:{mousemove:N=>{let G=c.filter((q=>this.getLayer(q)));(G.length!==0?this.queryRenderedFeatures(N.point,{layers:G}):[]).length?b=!0:b&&(b=!1,f.call(this,new Al(I,this,N.originalEvent)))},mouseout:N=>{b&&(b=!1,f.call(this,new Al(I,this,N.originalEvent)))}}}}{let b=S=>{let D=c.filter((G=>this.getLayer(G))),N=D.length!==0?this.queryRenderedFeatures(S.point,{layers:D}):[];N.length&&(S.features=N,f.call(this,S),delete S.features)};return{layers:c,listener:f,delegates:{[I]:b}}}}_saveDelegatedListener(I,c){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[I]=this._delegatedListeners[I]||[],this._delegatedListeners[I].push(c)}_removeDelegatedListener(I,c,f){if(!this._delegatedListeners||!this._delegatedListeners[I])return;let b=this._delegatedListeners[I];for(let S=0;S<b.length;S++){let D=b[S];if(D.listener===f&&D.layers.length===c.length&&D.layers.every((N=>c.includes(N)))){for(let N in D.delegates)this.off(N,D.delegates[N]);return void b.splice(S,1)}}}on(I,c,f){if(f===void 0)return super.on(I,c);let b=typeof c==\"string\"?[c]:c,S=this._createDelegatedListener(I,b,f);this._saveDelegatedListener(I,S);for(let D in S.delegates)this.on(D,S.delegates[D]);return{unsubscribe:()=>{this._removeDelegatedListener(I,b,f)}}}once(I,c,f){if(f===void 0)return super.once(I,c);let b=typeof c==\"string\"?[c]:c,S=this._createDelegatedListener(I,b,f);for(let D in S.delegates){let N=S.delegates[D];S.delegates[D]=(...G)=>{this._removeDelegatedListener(I,b,f),N(...G)}}this._saveDelegatedListener(I,S);for(let D in S.delegates)this.once(D,S.delegates[D]);return this}off(I,c,f){return f===void 0?super.off(I,c):(this._removeDelegatedListener(I,typeof c==\"string\"?[c]:c,f),this)}queryRenderedFeatures(I,c){if(!this.style)return[];let f,b=I instanceof o.P||Array.isArray(I),S=b?I:[[0,0],[this.transform.width,this.transform.height]];if(c=c||(b?{}:I)||{},S instanceof o.P||typeof S[0]==\"number\")f=[o.P.convert(S)];else{let D=o.P.convert(S[0]),N=o.P.convert(S[1]);f=[D,new o.P(N.x,D.y),N,new o.P(D.x,N.y),D]}return this.style.queryRenderedFeatures(f,c,this.transform)}querySourceFeatures(I,c){return this.style.querySourceFeatures(I,c)}setStyle(I,c){return(c=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},c)).diff!==!1&&c.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&I?(this._diffStyle(I,c),this):(this._localIdeographFontFamily=c.localIdeographFontFamily,this._updateStyle(I,c))}setTransformRequest(I){return this._requestManager.setTransformRequest(I),this}_getUIString(I){let c=this._locale[I];if(c==null)throw new Error(`Missing UI string '${I}'`);return c}_updateStyle(I,c){var f,b;if(c.transformStyle&&this.style&&!this.style._loaded)return void this.style.once(\"style.load\",(()=>this._updateStyle(I,c)));let S=this.style&&c.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!I)),I?(this.style=new Ni(this,c||{}),this.style.setEventedParent(this,{style:this.style}),typeof I==\"string\"?this.style.loadURL(I,c,S):this.style.loadJSON(I,c,S),this):((b=(f=this.style)===null||f===void 0?void 0:f.projection)===null||b===void 0||b.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(I,c){return o._(this,void 0,void 0,(function*(){if(typeof I==\"string\"){let f=I,b=yield this._requestManager.transformRequest(f,\"Style\");try{let S=yield o.j(b,new AbortController);this._updateDiff(S.data,c)}catch(S){S&&this.fire(new o.k(S))}}else typeof I==\"object\"&&this._updateDiff(I,c)}))}_updateDiff(I,c){try{this.style.setState(I,c)&&this._update(!0)}catch(f){o.w(`Unable to perform style diff: ${f.message||f.error||f}.  Rebuilding the style from scratch.`),this._updateStyle(I,c)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():o.w(\"There is no style added to the map.\")}addSource(I,c){return this._lazyInitEmptyStyle(),this.style.addSource(I,c),this._update(!0)}isSourceLoaded(I){let c=this.style&&this.style.tileManagers[I];if(c!==void 0)return c.loaded();this.fire(new o.k(new Error(`There is no tile manager with ID '${I}'`)))}setTerrain(I){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off(\"data\",this._terrainDataCallback),I){let c=this.style.tileManagers[I.source];if(!c)throw new Error(`cannot load terrain, because there exists no source with ID: ${I.source}`);this.terrain===null&&c.reload();for(let f in this.style._layers){let b=this.style._layers[f];b.type===\"hillshade\"&&b.source===I.source&&o.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.\"),b.type===\"color-relief\"&&b.source===I.source&&o.w(\"You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.\")}this.terrain=new IM(this.painter,c,I),this.painter.renderToTexture=new xo(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=f=>{var b;f.dataType===\"style\"?this.terrain.tileManager.freeRtt():f.dataType===\"source\"&&f.tile&&(f.sourceId!==I.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((b=f.source)===null||b===void 0?void 0:b.type)===\"image\"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(f.tile.tileID))},this.style.on(\"data\",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new o.l(\"terrain\",{terrain:I})),this}getTerrain(){var I,c;return(c=(I=this.terrain)===null||I===void 0?void 0:I.options)!==null&&c!==void 0?c:null}areTilesLoaded(){let I=this.style&&this.style.tileManagers;for(let c of Object.values(I))if(!c.areTilesLoaded())return!1;return!0}removeSource(I){return this.style.removeSource(I),this._update(!0)}getSource(I){return this.style.getSource(I)}setSourceTileLodParams(I,c,f){if(f){let b=this.getSource(f);if(!b)throw new Error(`There is no source with ID \"${f}\", cannot set LOD parameters`);b.calculateTileZoom=UA(Math.max(1,I),Math.max(1,c))}else for(let b in this.style.tileManagers)this.style.tileManagers[b].getSource().calculateTileZoom=UA(Math.max(1,I),Math.max(1,c));return this._update(!0),this}refreshTiles(I,c){let f=this.style.tileManagers[I];if(!f)throw new Error(`There is no tile manager with ID \"${I}\", cannot refresh tile`);c===void 0?f.reload(!0):f.refreshTiles(c.map((b=>new o.a9(b.z,b.x,b.y))))}addImage(I,c,f={}){let{pixelRatio:b=1,sdf:S=!1,stretchX:D,stretchY:N,content:G,textFitWidth:q,textFitHeight:K}=f;if(this._lazyInitEmptyStyle(),!(c instanceof HTMLImageElement||o.b(c))){if(c.width===void 0||c.height===void 0)return this.fire(new o.k(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`\")));{let{width:it,height:ct,data:ut}=c,gt=c;return this.style.addImage(I,{data:new o.R({width:it,height:ct},new Uint8Array(ut)),pixelRatio:b,stretchX:D,stretchY:N,content:G,textFitWidth:q,textFitHeight:K,sdf:S,version:0,userImage:gt}),gt.onAdd&&gt.onAdd(this,I),this}}{let{width:it,height:ct,data:ut}=w.getImageData(c);this.style.addImage(I,{data:new o.R({width:it,height:ct},ut),pixelRatio:b,stretchX:D,stretchY:N,content:G,textFitWidth:q,textFitHeight:K,sdf:S,version:0})}}updateImage(I,c){let f=this.style.getImage(I);if(!f)return this.fire(new o.k(new Error(\"The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.\")));let b=c instanceof HTMLImageElement||o.b(c)?w.getImageData(c):c,{width:S,height:D,data:N}=b;if(S===void 0||D===void 0)return this.fire(new o.k(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(S!==f.data.width||D!==f.data.height)return this.fire(new o.k(new Error(\"The width and height of the updated image must be that same as the previous version of the image\")));let G=!(c instanceof HTMLImageElement||o.b(c));return f.data.replace(N,G),this.style.updateImage(I,f),this}getImage(I){return this.style.getImage(I)}hasImage(I){return I?!!this.style.getImage(I):(this.fire(new o.k(new Error(\"Missing required image id\"))),!1)}removeImage(I){this.style.removeImage(I)}loadImage(I){return o._(this,void 0,void 0,(function*(){return W.getImage(yield this._requestManager.transformRequest(I,\"Image\"),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(I,c){return this._lazyInitEmptyStyle(),this.style.addLayer(I,c),this._update(!0)}moveLayer(I,c){return this.style.moveLayer(I,c),this._update(!0)}removeLayer(I){return this.style.removeLayer(I),this._update(!0)}getLayer(I){return this.style.getLayer(I)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(I,c,f){return this.style.setLayerZoomRange(I,c,f),this._update(!0)}setFilter(I,c,f={}){return this.style.setFilter(I,c,f),this._update(!0)}getFilter(I){return this.style.getFilter(I)}setPaintProperty(I,c,f,b={}){return this.style.setPaintProperty(I,c,f,b),this._update(!0)}getPaintProperty(I,c){return this.style.getPaintProperty(I,c)}setLayoutProperty(I,c,f,b={}){return this.style.setLayoutProperty(I,c,f,b),this._update(!0)}getLayoutProperty(I,c){return this.style.getLayoutProperty(I,c)}setGlyphs(I,c={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(I,c),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(I,c,f={}){return this._lazyInitEmptyStyle(),this.style.addSprite(I,c,f,(b=>{b||this._update(!0)})),this}removeSprite(I){return this._lazyInitEmptyStyle(),this.style.removeSprite(I),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(I,c={}){return this._lazyInitEmptyStyle(),this.style.setSprite(I,c,(f=>{f||this._update(!0)})),this}setLight(I,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(I,c),this._update(!0)}getLight(){return this.style.getLight()}setSky(I,c={}){return this._lazyInitEmptyStyle(),this.style.setSky(I,c),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(I,c){return this.style.setFeatureState(I,c),this._update()}removeFeatureState(I,c){return this.style.removeFeatureState(I,c),this._update()}getFeatureState(I){return this.style.getFeatureState(I)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let I=0,c=0;return this._container&&(I=this._container.clientWidth||400,c=this._container.clientHeight||300),[I,c]}_setupResizeObserver(){var I;let c=!1,f=ov((S=>{this._trackResize&&!this._removed&&(this.resize(S),this.redraw())}),50),b=(I=this._ownerWindow.ResizeObserver)!==null&&I!==void 0?I:ResizeObserver;this._resizeObserver=new b((S=>{c?f(S):c=!0})),this._resizeObserver.observe(this._container)}_resolveContainer(I){if(typeof I==\"string\"){let c=document.getElementById(I);if(!c)throw new Error(`Container '${I}' not found.`);return c}if(I instanceof HTMLElement||I&&typeof I==\"object\"&&I.nodeType===1)return I;throw new Error(\"Invalid type: 'container' must be a String or HTMLElement.\")}_setupContainer(){let I=this._container;I.classList.add(\"maplibregl-map\");let c=this._canvasContainer=z.create(\"div\",\"maplibregl-canvas-container\",I);this._interactive&&c.classList.add(\"maplibregl-interactive\"),this._canvas=z.create(\"canvas\",\"maplibregl-canvas\",c),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\");let f=this._containerDimensions(),b=this._getClampedPixelRatio(f[0],f[1]);this._resizeCanvas(f[0],f[1],b);let S=this._controlContainer=z.create(\"div\",\"maplibregl-control-container\",I),D=this._controlPositions={};[\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"].forEach((N=>{D[N]=z.create(\"div\",`maplibregl-ctrl-${N} `,S)})),this._container.addEventListener(\"scroll\",this._onMapScroll,!1)}_resizeCanvas(I,c,f){this._canvas.width=Math.floor(f*I),this._canvas.height=Math.floor(f*c),this._canvas.style.width=`${I}px`,this._canvas.style.height=`${c}px`}_setupPainter(){let I=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),c=null;this._canvas.addEventListener(\"webglcontextcreationerror\",(b=>{c={requestedAttributes:I},b&&(c.statusMessage=b.statusMessage,c.type=b.type)}),{once:!0});let f=null;if(f=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,I):this._canvas.getContext(\"webgl2\",I)||this._canvas.getContext(\"webgl\",I),!f){let b=\"Failed to initialize WebGL\";throw c?(c.message=b,new Error(JSON.stringify(c))):new Error(b)}this.painter=new Nm(f,this.transform)}migrateProjection(I,c){super.migrateProjection(I,c),this.painter.transform=I,this.fire(new o.l(\"projectiontransition\",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(I){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||I,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(I){return this._update(),this._renderTaskQueue.add(I)}_cancelRenderFrame(I){this._renderTaskQueue.remove(I)}_render(I){var c,f,b,S,D;let N=this._idleTriggered?this._fadeDuration:0,G=((c=this.style.projection)===null||c===void 0?void 0:c.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(I),this._removed)return;let q=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let ct=this.transform.zoom,ut=R();this.style.zoomHistory.update(ct,ut);let gt=new o.H(ct,{now:ut,fadeDuration:N,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),yt=gt.crossFadingFactor();yt===1&&yt===this._crossFadingFactor||(q=!0,this._crossFadingFactor=yt),this.style.update(gt)}let K=((f=this.style.projection)===null||f===void 0?void 0:f.transitionState)>0!==G;(b=this.style.projection)===null||b===void 0||b.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((S=this.style.projection)===null||S===void 0?void 0:S.transitionState,(D=this.style.projection)===null||D===void 0?void 0:D.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||K)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,N,this._crossSourceCollisions,K),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:N,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new o.l(\"render\")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.cE.mark(o.cF.load),this.fire(new o.l(\"load\"))),this.style&&(this.style.hasTransitions()||q)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let it=this._sourcesDirty||this._styleDirty||this._placementDirty;return it||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.l(\"idle\")),!this._loaded||this._fullyLoaded||it||(this._fullyLoaded=!0,o.cE.mark(o.cF.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var I;this._hash&&this._hash.remove();for(let f of this._controls)f.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\"&&this._ownerWindow.removeEventListener(\"online\",this._onWindowOnline,!1),W.removeThrottleControl(this._imageQueueHandle),(I=this._resizeObserver)===null||I===void 0||I.disconnect();let c=this.painter.context.gl.getExtension(\"WEBGL_lose_context\");c?.loseContext&&c.loseContext(),this._canvas.removeEventListener(\"webglcontextrestored\",this._contextRestored,!1),this._canvas.removeEventListener(\"webglcontextlost\",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener(\"scroll\",this._onMapScroll,!1),this._container.classList.remove(\"maplibregl-map\"),o.cE.remove(),this._removed=!0,this.fire(new o.l(\"remove\"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,w.frame(this._frameRequest,(I=>{o.cE.recordStartOfFrameAt(I),this._frameRequest=null;try{this._render(I)}catch(c){if(!o.Z(c)&&!(function(f){return f.message===Zh})(c))throw c}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(I){this._showTileBoundaries!==I&&(this._showTileBoundaries=I,this._update())}get showPadding(){return!!this._showPadding}set showPadding(I){this._showPadding!==I&&(this._showPadding=I,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(I){this._showCollisionBoxes!==I&&(this._showCollisionBoxes=I,I?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(I){this._showOverdrawInspector!==I&&(this._showOverdrawInspector=I,this._update())}get repaint(){return!!this._repaint}set repaint(I){this._repaint!==I&&(this._repaint=I,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(I){this._vertices=I,this._update()}get version(){return xf}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(I){return this._lazyInitEmptyStyle(),this.style.setProjection(I),this._update(!0)}},gy={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class uv{constructor(c,f,b=!1){this.mousedown=D=>{this.startMove(D,z.mousePos(this.element,D)),window.addEventListener(\"mousemove\",this.mousemove),window.addEventListener(\"mouseup\",this.mouseup)},this.mousemove=D=>{this.move(D,z.mousePos(this.element,D))},this.mouseup=D=>{this._rotatePitchHandler.dragEnd(D),this.offTemp()},this.touchstart=D=>{D.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=z.touchPos(this.element,D.targetTouches)[0],this.startMove(D,this._startPos),window.addEventListener(\"touchmove\",this.touchmove,{passive:!1}),window.addEventListener(\"touchend\",this.touchend))},this.touchmove=D=>{D.targetTouches.length!==1?this.reset():(this._lastPos=z.touchPos(this.element,D.targetTouches)[0],this.move(D,this._lastPos))},this.touchend=D=>{D.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=f;let S=new PM;this._rotatePitchHandler=new rd({clickTolerance:3,move:(D,N)=>{let G=f.getBoundingClientRect(),q=new o.P((G.bottom-G.top)/2,(G.right-G.left)/2);return{bearingDelta:o.cv(new o.P(D.x,N.y),N,q),pitchDelta:b?-.5*(N.y-D.y):void 0}},moveStateManager:S,enable:!0,assignEvents:()=>{}}),this.map=c,f.addEventListener(\"mousedown\",this.mousedown),f.addEventListener(\"touchstart\",this.touchstart,{passive:!1}),f.addEventListener(\"touchcancel\",this.reset)}startMove(c,f){this._rotatePitchHandler.dragStart(c,f),z.disableDrag()}move(c,f){let b=this.map,{bearingDelta:S,pitchDelta:D}=this._rotatePitchHandler.dragMove(c,f)||{};S&&b.setBearing(b.getBearing()+S),D&&b.setPitch(b.getPitch()+D)}off(){let c=this.element;c.removeEventListener(\"mousedown\",this.mousedown),c.removeEventListener(\"touchstart\",this.touchstart),window.removeEventListener(\"touchmove\",this.touchmove),window.removeEventListener(\"touchend\",this.touchend),c.removeEventListener(\"touchcancel\",this.reset),this.offTemp()}offTemp(){z.enableDrag(),window.removeEventListener(\"mousemove\",this.mousemove),window.removeEventListener(\"mouseup\",this.mouseup),window.removeEventListener(\"touchmove\",this.touchmove),window.removeEventListener(\"touchend\",this.touchend)}}let xc;function ld(I,c,f,b=!1){if(b||!f.getCoveringTilesDetailsProvider().allowWorldCopies())return I?.wrap();let S=new o.V(I.lng,I.lat);if(I=new o.V(I.lng,I.lat),c){let D=new o.V(I.lng-360,I.lat),N=new o.V(I.lng+360,I.lat),G=f.locationToScreenPoint(I).distSqr(c);f.locationToScreenPoint(D).distSqr(c)<G?I=D:f.locationToScreenPoint(N).distSqr(c)<G&&(I=N)}for(;Math.abs(I.lng-f.center.lng)>180;){let D=f.locationToScreenPoint(I);if(D.x>=0&&D.y>=0&&D.x<=f.width&&D.y<=f.height)break;I.lng>f.center.lng?I.lng-=360:I.lng+=360}return I.lng!==S.lng&&f.isPointOnMapSurface(f.locationToScreenPoint(I))?I:S}let i0={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 cd(I,c,f){let b=I.classList;for(let S in i0)b.remove(`maplibregl-${f}-anchor-${S}`);b.add(`maplibregl-${f}-anchor-${c}`)}class Tf extends o.E{constructor(c){if(super(),this._onClick=f=>{this.fire(new o.l(\"click\",{originalEvent:f}))},this._onKeyPress=f=>{f.code!==\"Space\"&&f.code!==\"Enter\"||this.togglePopup()},this._onMapClick=f=>{let b=f.originalEvent.target,S=this._element;this._popup&&(b===S||S.contains(b))&&this.togglePopup()},this._update=f=>{if(!this._map)return;let b=this._map.loaded()&&!this._map.isMoving();(f?.type===\"terrain\"||f?.type===\"render\"&&!b)&&this._map.once(\"render\",this._update),this._lngLat=ld(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let S=\"\";this._rotationAlignment===\"viewport\"||this._rotationAlignment===\"auto\"?S=`rotateZ(${this._rotation}deg)`:this._rotationAlignment===\"map\"&&(S=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let D=\"\";this._pitchAlignment===\"viewport\"||this._pitchAlignment===\"auto\"?D=\"rotateX(0deg)\":this._pitchAlignment===\"map\"&&(D=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||f&&f.type!==\"moveend\"||(this._pos=this._pos.round()),this._element.style.transform=`${i0[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${D} ${S}`,w.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(f&&f.type===\"moveend\")})).catch((()=>{}))},this._onMove=f=>{if(!this._isDragging){let b=this._clickTolerance||this._map._clickTolerance;this._isDragging=f.point.dist(this._pointerdownPos)>=b}this._isDragging&&(this._pos=f.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 o.l(\"dragstart\"))),this.fire(new o.l(\"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 o.l(\"dragend\")),this._state=\"inactive\"},this._addDragHandler=f=>{this._element.contains(f.originalEvent.target)&&(f.preventDefault(),this._positionDelta=f.point.sub(this._pos).add(this._offset),this._pointerdownPos=f.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=c&&c.anchor||\"center\",this._color=c&&c.color||\"#3FB1CE\",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._subpixelPositioning=c&&c.subpixelPositioning||!1,this._isDragging=!1,this._state=\"inactive\",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||\"auto\",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment!==\"auto\"?c.pitchAlignment:this._rotationAlignment,this.setOpacity(c?.opacity,c?.opacityWhenCovered),c&&c.element)this._element=c.element,this._offset=o.P.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=z.create(\"div\");let f=z.createNS(\"http://www.w3.org/2000/svg\",\"svg\"),b=41,S=27;f.setAttributeNS(null,\"display\",\"block\"),f.setAttributeNS(null,\"height\",`${b}px`),f.setAttributeNS(null,\"width\",`${S}px`),f.setAttributeNS(null,\"viewBox\",`0 0 ${S} ${b}`);let D=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");D.setAttributeNS(null,\"stroke\",\"none\"),D.setAttributeNS(null,\"stroke-width\",\"1\"),D.setAttributeNS(null,\"fill\",\"none\"),D.setAttributeNS(null,\"fill-rule\",\"evenodd\");let N=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");N.setAttributeNS(null,\"fill-rule\",\"nonzero\");let G=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");G.setAttributeNS(null,\"transform\",\"translate(3.0, 29.0)\"),G.setAttributeNS(null,\"fill\",\"#000000\");let q=[{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(let Rt of q){let Ut=z.createNS(\"http://www.w3.org/2000/svg\",\"ellipse\");Ut.setAttributeNS(null,\"opacity\",\"0.04\"),Ut.setAttributeNS(null,\"cx\",\"10.5\"),Ut.setAttributeNS(null,\"cy\",\"5.80029008\"),Ut.setAttributeNS(null,\"rx\",Rt.rx),Ut.setAttributeNS(null,\"ry\",Rt.ry),G.appendChild(Ut)}let K=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");K.setAttributeNS(null,\"fill\",this._color);let it=z.createNS(\"http://www.w3.org/2000/svg\",\"path\");it.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\"),K.appendChild(it);let ct=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");ct.setAttributeNS(null,\"opacity\",\"0.25\"),ct.setAttributeNS(null,\"fill\",\"#000000\");let ut=z.createNS(\"http://www.w3.org/2000/svg\",\"path\");ut.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\"),ct.appendChild(ut);let gt=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");gt.setAttributeNS(null,\"transform\",\"translate(6.0, 7.0)\"),gt.setAttributeNS(null,\"fill\",\"#FFFFFF\");let yt=z.createNS(\"http://www.w3.org/2000/svg\",\"g\");yt.setAttributeNS(null,\"transform\",\"translate(8.0, 8.0)\");let Pt=z.createNS(\"http://www.w3.org/2000/svg\",\"circle\");Pt.setAttributeNS(null,\"fill\",\"#000000\"),Pt.setAttributeNS(null,\"opacity\",\"0.25\"),Pt.setAttributeNS(null,\"cx\",\"5.5\"),Pt.setAttributeNS(null,\"cy\",\"5.5\"),Pt.setAttributeNS(null,\"r\",\"5.4999962\");let Ct=z.createNS(\"http://www.w3.org/2000/svg\",\"circle\");Ct.setAttributeNS(null,\"fill\",\"#FFFFFF\"),Ct.setAttributeNS(null,\"cx\",\"5.5\"),Ct.setAttributeNS(null,\"cy\",\"5.5\"),Ct.setAttributeNS(null,\"r\",\"5.4999962\"),yt.appendChild(Pt),yt.appendChild(Ct),N.appendChild(G),N.appendChild(K),N.appendChild(ct),N.appendChild(gt),N.appendChild(yt),f.appendChild(N),f.setAttributeNS(null,\"height\",b*this._scale+\"px\"),f.setAttributeNS(null,\"width\",S*this._scale+\"px\"),this._element.appendChild(f),this._offset=o.P.convert(c&&c.offset||[0,-14])}if(this._element.classList.add(\"maplibregl-marker\"),this._element.addEventListener(\"dragstart\",(f=>{f.preventDefault()})),this._element.addEventListener(\"mousedown\",(f=>{f.preventDefault()})),cd(this._element,this._anchor,\"marker\"),c&&c.className)for(let f of c.className.split(\" \"))this._element.classList.add(f);this._popup=null}addTo(c){return this.remove(),this._map=c,this._element.hasAttribute(\"aria-label\")||this._element.setAttribute(\"aria-label\",c._getUIString(\"Marker.Title\")),this._element.hasAttribute(\"role\")||this._element.setAttribute(\"role\",\"button\"),c.getCanvasContainer().appendChild(this._element),c.on(\"move\",this._update),c.on(\"moveend\",this._update),c.on(\"terrain\",this._update),c.on(\"projectiontransition\",this._update),this._element.addEventListener(\"click\",this._onClick),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(\"projectiontransition\",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),this._element.removeEventListener(\"click\",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=o.V.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(c){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(\"keypress\",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute(\"tabindex\")),c){if(!(\"offset\"in c.options)){let S=Math.abs(13.5)/Math.SQRT2;c.options.offset=this._defaultMarker?{top:[0,0],\"top-left\":[0,0],\"top-right\":[0,0],bottom:[0,-38.1],\"bottom-left\":[S,-1*(38.1-13.5+S)],\"bottom-right\":[-S,-1*(38.1-13.5+S)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=c,this._originalTabIndex=this._element.getAttribute(\"tabindex\"),this._originalTabIndex||this._element.setAttribute(\"tabindex\",\"0\"),this._element.addEventListener(\"keypress\",this._onKeyPress)}return this}setSubpixelPositioning(c){return this._subpixelPositioning=c,this}getPopup(){return this._popup}togglePopup(){let c=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:c?(c.isOpen()?c.remove():(c.setLngLat(this._lngLat),c.addTo(this._map)),this):this}_updateOpacity(c=!1){var f,b;let S=(f=this._map)===null||f===void 0?void 0:f.terrain,D=this._map.transform.isLocationOccluded(this._lngLat);if(!S||D){let gt=D?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==gt&&(this._element.style.opacity=gt))}if(c)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let N=this._map,G=N.terrain.depthAtPoint(this._pos),q=N.terrain.getElevationForLngLat(this._lngLat,N.transform);if(N.transform.lngLatToCameraDepth(this._lngLat,q)-G<.006)return void(this._element.style.opacity=this._opacity);let K=-this._offset.y/N.transform.pixelsPerMeter,it=Math.sin(N.getPitch()*Math.PI/180)*K,ct=N.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),ut=N.transform.lngLatToCameraDepth(this._lngLat,q+it)-ct>.006;!((b=this._popup)===null||b===void 0)&&b.isOpen()&&ut&&this._popup.remove(),this._element.style.opacity=ut?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(c){return this._offset=o.P.convert(c),this._update(),this}addClassName(c){this._element.classList.add(c)}removeClassName(c){this._element.classList.remove(c)}toggleClassName(c){return this._element.classList.toggle(c)}setDraggable(c){return this._draggable=!!c,this._map&&(c?(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(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||\"auto\",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c&&c!==\"auto\"?c:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(c,f){return(this._opacity===void 0||c===void 0&&f===void 0)&&(this._opacity=\"1\",this._opacityWhenCovered=\"0.2\"),c!==void 0&&(this._opacity=c),f!==void 0&&(this._opacityWhenCovered=f),this._map&&this._updateOpacity(!0),this}}let Qm={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Sf=0,lu=!1,Ay={maxWidth:100,unit:\"metric\"};function yy(I,c,f){let b=f&&f.maxWidth||100,S=I._container.clientHeight/2,D=I._container.clientWidth/2,N=I.unproject([D-b/2,S]),G=I.unproject([D+b/2,S]),q=Math.round(I.project(G).x-I.project(N).x),K=Math.min(b,q,I._container.clientWidth),it=N.distanceTo(G);if(f&&f.unit===\"imperial\"){let ct=3.2808*it;ct>5280?ud(c,K,ct/5280,I._getUIString(\"ScaleControl.Miles\")):ud(c,K,ct,I._getUIString(\"ScaleControl.Feet\"))}else f&&f.unit===\"nautical\"?ud(c,K,it/1852,I._getUIString(\"ScaleControl.NauticalMiles\")):it>=1e3?ud(c,K,it/1e3,I._getUIString(\"ScaleControl.Kilometers\")):ud(c,K,it,I._getUIString(\"ScaleControl.Meters\"))}function ud(I,c,f,b){let S=(function(D){let N=Math.pow(10,`${Math.floor(D)}`.length-1),G=D/N;return G=G>=10?10:G>=5?5:G>=3?3:G>=2?2:G>=1?1:(function(q){let K=Math.pow(10,Math.ceil(-Math.log(q)/Math.LN10));return Math.round(q*K)/K})(G),N*G})(f);I.style.width=c*(S/f)+\"px\",I.innerHTML=`${S}&nbsp;${b}`}let hv={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:\"\",maxWidth:\"240px\",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},dv=[\"a[href]\",\"[tabindex]:not([tabindex='-1'])\",\"[contenteditable]:not([contenteditable='false'])\",\"button:not([disabled])\",\"input:not([disabled])\",\"select:not([disabled])\",\"textarea:not([disabled])\"].join(\", \");function Jm(I){if(I){if(typeof I==\"number\"){let c=Math.round(Math.abs(I)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,I),\"top-left\":new o.P(c,c),\"top-right\":new o.P(-c,c),bottom:new o.P(0,-I),\"bottom-left\":new o.P(c,-c),\"bottom-right\":new o.P(-c,-c),left:new o.P(I,0),right:new o.P(-I,0)}}if(I instanceof o.P||Array.isArray(I)){let c=o.P.convert(I);return{center:c,top:c,\"top-left\":c,\"top-right\":c,bottom:c,\"bottom-left\":c,\"bottom-right\":c,left:c,right:c}}return{center:o.P.convert(I.center||[0,0]),top:o.P.convert(I.top||[0,0]),\"top-left\":o.P.convert(I[\"top-left\"]||[0,0]),\"top-right\":o.P.convert(I[\"top-right\"]||[0,0]),bottom:o.P.convert(I.bottom||[0,0]),\"bottom-left\":o.P.convert(I[\"bottom-left\"]||[0,0]),\"bottom-right\":o.P.convert(I[\"bottom-right\"]||[0,0]),left:o.P.convert(I.left||[0,0]),right:o.P.convert(I.right||[0,0])}}return Jm(new o.P(0,0))}let fv=s;n.AJAXError=o.cG,n.EXTENT=o.a5,n.Event=o.l,n.Evented=o.E,n.LngLat=o.V,n.MercatorCoordinate=o.a6,n.Point=o.P,n.addProtocol=o.cH,n.config=o.c,n.removeProtocol=o.cI,n.AttributionControl=na,n.BoxZoomHandler=S2,n.CanvasSource=Vl,n.CooperativeGesturesHandler=bc,n.DoubleClickZoomHandler=qm,n.DragPanHandler=my,n.DragRotateHandler=Ym,n.EdgeInsets=ea,n.FullscreenControl=class extends o.E{constructor(I={}){var c;super(),this._onFullscreenChange=()=>{var f;let b=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((f=b?.shadowRoot)===null||f===void 0)&&f.fullscreenElement;)b=b.shadowRoot.fullscreenElement;b===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(c=I.pseudo)!==null&&c!==void 0&&c,I&&I.container&&(I.container instanceof HTMLElement?this._container=I.container:o.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(I){return this._map=I,this._container||(this._container=this._map.getContainer()),this._controlContainer=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let I=this._fullscreenButton=z.create(\"button\",\"maplibregl-ctrl-fullscreen\",this._controlContainer);z.create(\"span\",\"maplibregl-ctrl-icon\",I).setAttribute(\"aria-hidden\",\"true\"),I.type=\"button\",this._updateTitle(),this._fullscreenButton.addEventListener(\"click\",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let I=this._getTitle();this._fullscreenButton.setAttribute(\"aria-label\",I),this._fullscreenButton.title=I}_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 o.l(\"fullscreenstart\")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.l(\"fullscreenend\")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle(\"maplibregl-pseudo-fullscreen\"),this._handleFullscreenChange(),this._map.resize()}},n.GeoJSONSource=qu,n.GeolocateControl=class extends o.E{constructor(I){super(),this._onSuccess=c=>{if(this._map){if(this._isOutOfMapMaxBounds(c))return this._setErrorState(),this.fire(new o.l(\"outofmaxbounds\",c)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=c,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(c),this.options.trackUserLocation&&this._watchState!==\"ACTIVE_LOCK\"||this._updateCamera(c),this.options.showUserLocation&&this._dotElement.classList.remove(\"maplibregl-user-location-dot-stale\"),this.fire(new o.l(\"geolocate\",c)),this._finish()}},this._updateCamera=c=>{let f=new o.V(c.coords.longitude,c.coords.latitude),b=c.coords.accuracy,S=this._map.getBearing(),D=o.e({bearing:S},this.options.fitBoundsOptions),N=wr.fromLngLat(f,b);this._map.fitBounds(N,D,{geolocateSource:!0})},this._updateMarker=c=>{if(c){let f=new o.V(c.coords.longitude,c.coords.latitude);this._accuracyCircleMarker.setLngLat(f).addTo(this._map),this._userLocationDotMarker.setLngLat(f).addTo(this._map),this._accuracy=c.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=c=>{if(this._map){if(c.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;let f=this._map._getUIString(\"GeolocateControl.LocationNotAvailable\");this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(c.code===3&&lu)return;this._setErrorState()}this._watchState!==\"OFF\"&&this.options.showUserLocation&&this._dotElement.classList.add(\"maplibregl-user-location-dot-stale\"),this.fire(new o.l(\"error\",c)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=c=>{if(!this._map)return;let f=c?.[0]instanceof ResizeObserverEntry;c.geolocateSource||this._watchState!==\"ACTIVE_LOCK\"||f||this._map.isZooming()||(this._watchState=\"BACKGROUND\",this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-background\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this.fire(new o.l(\"trackuserlocationend\")),this.fire(new o.l(\"userlocationlostfocus\")))},this._setupUI=()=>{this._map&&(this._container.addEventListener(\"contextmenu\",(c=>c.preventDefault())),this._geolocateButton=z.create(\"button\",\"maplibregl-ctrl-geolocate\",this._container),z.create(\"span\",\"maplibregl-ctrl-icon\",this._geolocateButton).setAttribute(\"aria-hidden\",\"true\"),this._geolocateButton.type=\"button\",this._geolocateButton.disabled=!0)},this._finishSetupUI=c=>{if(this._map){if(c===!1){o.w(\"Geolocation support is not available so the GeolocateControl will be disabled.\");let f=this._map._getUIString(\"GeolocateControl.LocationNotAvailable\");this._geolocateButton.disabled=!0,this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f)}else{let f=this._map._getUIString(\"GeolocateControl.FindMyLocation\");this._geolocateButton.disabled=!1,this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(\"aria-pressed\",\"false\"),this._watchState=\"OFF\"),this.options.showUserLocation&&(this._dotElement=z.create(\"div\",\"maplibregl-user-location-dot\"),this._userLocationDotMarker=new Tf({element:this._dotElement}),this._circleElement=z.create(\"div\",\"maplibregl-user-location-accuracy-circle\"),this._accuracyCircleMarker=new Tf({element:this._circleElement,pitchAlignment:\"map\"}),this.options.trackUserLocation&&(this._watchState=\"OFF\"),this._map.on(\"zoom\",this._onUpdate),this._map.on(\"move\",this._onUpdate),this._map.on(\"rotate\",this._onUpdate),this._map.on(\"pitch\",this._onUpdate)),this._geolocateButton.addEventListener(\"click\",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on(\"movestart\",this._onMoveStart)}},this.options=o.e({},Qm,I)}onAdd(I){return this._map=I,this._container=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._setupUI(),(function(){return o._(this,arguments,void 0,(function*(c=!1){if(xc!==void 0&&!c)return xc;if(window.navigator.permissions===void 0)return xc=!!window.navigator.geolocation,xc;try{xc=(yield window.navigator.permissions.query({name:\"geolocation\"})).state!==\"denied\"}catch{xc=!!window.navigator.geolocation}return xc}))})().then((c=>this._finishSetupUI(c))),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(),this._container.remove(),this._map.off(\"movestart\",this._onMoveStart),this._map.off(\"zoom\",this._onUpdate),this._map.off(\"move\",this._onUpdate),this._map.off(\"rotate\",this._onUpdate),this._map.off(\"pitch\",this._onUpdate),this._map=void 0,Sf=0,lu=!1}_isOutOfMapMaxBounds(I){let c=this._map.getMaxBounds(),f=I.coords;return c&&(f.longitude<c.getWest()||f.longitude>c.getEast()||f.latitude<c.getSouth()||f.latitude>c.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\":case\"BACKGROUND_ERROR\":case\"OFF\":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let I=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&I))return;let c=this._map.project(I),f=this._map.unproject([c.x+100,c.y]),b=I.distanceTo(f)/100,S=2*this._accuracy/b;this._circleElement.style.width=`${S.toFixed(2)}px`,this._circleElement.style.height=`${S.toFixed(2)}px`}trigger(){if(!this._setup)return o.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 o.l(\"trackuserlocationstart\"));break;case\"WAITING_ACTIVE\":case\"ACTIVE_LOCK\":case\"ACTIVE_ERROR\":case\"BACKGROUND_ERROR\":Sf--,lu=!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 o.l(\"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 o.l(\"trackuserlocationstart\")),this.fire(new o.l(\"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 I;this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.setAttribute(\"aria-pressed\",\"true\"),Sf++,Sf>1?(I={maximumAge:6e5,timeout:0},lu=!0):(I=this.options.positionOptions,lu=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,I)}}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)}},n.GlobeControl=class{constructor(){this._toggleProjection=()=>{var I;let c=(I=this._map.getProjection())===null||I===void 0?void 0:I.type;this._map.setProjection(c!==\"mercator\"&&c?{type:\"mercator\"}:{type:\"globe\"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var I;this._globeButton.classList.remove(\"maplibregl-ctrl-globe\"),this._globeButton.classList.remove(\"maplibregl-ctrl-globe-enabled\"),((I=this._map.getProjection())===null||I===void 0?void 0:I.type)===\"globe\"?(this._globeButton.classList.add(\"maplibregl-ctrl-globe-enabled\"),this._globeButton.title=this._map._getUIString(\"GlobeControl.Disable\")):(this._globeButton.classList.add(\"maplibregl-ctrl-globe\"),this._globeButton.title=this._map._getUIString(\"GlobeControl.Enable\"))}}onAdd(I){return this._map=I,this._container=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._globeButton=z.create(\"button\",\"maplibregl-ctrl-globe\",this._container),z.create(\"span\",\"maplibregl-ctrl-icon\",this._globeButton).setAttribute(\"aria-hidden\",\"true\"),this._globeButton.type=\"button\",this._globeButton.addEventListener(\"click\",this._toggleProjection),this._updateGlobeIcon(),this._map.on(\"styledata\",this._updateGlobeIcon),this._map.on(\"projectiontransition\",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off(\"styledata\",this._updateGlobeIcon),this._map.off(\"projectiontransition\",this._updateGlobeIcon),this._globeButton.removeEventListener(\"click\",this._toggleProjection),this._map=void 0}},n.Hash=zm,n.ImageSource=Rs,n.KeyboardHandler=E2,n.LngLatBounds=wr,n.LogoControl=yl,n.Map=wf,n.MapLibreMap=wf,n.MapMouseEvent=Al,n.MapTouchEvent=Vm,n.MapWheelEvent=vf,n.Marker=Tf,n.NavigationControl=class{constructor(I){this._updateZoomButtons=()=>{let c=this._map.getZoom(),f=c===this._map.getMaxZoom(),b=c===this._map.getMinZoom();this._zoomInButton.disabled=f,this._zoomOutButton.disabled=b,this._zoomInButton.setAttribute(\"aria-disabled\",f.toString()),this._zoomOutButton.setAttribute(\"aria-disabled\",b.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(c,f)=>{let b=this._map._getUIString(`NavigationControl.${f}`);c.title=b,c.setAttribute(\"aria-label\",b)},this.options=o.e({},gy,I),this._container=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._container.addEventListener(\"contextmenu\",(c=>c.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton(\"maplibregl-ctrl-zoom-in\",(c=>this._map.zoomIn({},{originalEvent:c}))),z.create(\"span\",\"maplibregl-ctrl-icon\",this._zoomInButton).setAttribute(\"aria-hidden\",\"true\"),this._zoomOutButton=this._createButton(\"maplibregl-ctrl-zoom-out\",(c=>this._map.zoomOut({},{originalEvent:c}))),z.create(\"span\",\"maplibregl-ctrl-icon\",this._zoomOutButton).setAttribute(\"aria-hidden\",\"true\")),this.options.showCompass&&(this._compass=this._createButton(\"maplibregl-ctrl-compass\",(c=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:c}):this._map.resetNorth({},{originalEvent:c})})),this._compassIcon=z.create(\"span\",\"maplibregl-ctrl-icon\",this._compass),this._compassIcon.setAttribute(\"aria-hidden\",\"true\"))}onAdd(I){return this._map=I,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.options.visualizeRoll&&this._map.on(\"roll\",this._rotateCompassArrow),this._map.on(\"rotate\",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new uv(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off(\"zoom\",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off(\"pitch\",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off(\"roll\",this._rotateCompassArrow),this._map.off(\"rotate\",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(I,c){let f=z.create(\"button\",I,this._container);return f.type=\"button\",f.addEventListener(\"click\",c),f}},n.Popup=class extends o.E{constructor(I){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:\"\")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),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._update),this._map.off(\"mouseup\",this._update),this._map.off(\"drag\",this._update),this._map._canvasContainer.classList.remove(\"maplibregl-track-pointer\"),delete this._map,this.fire(new o.l(\"close\"))),this),this._update=c=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=z.create(\"div\",\"maplibregl-popup\",this._map.getContainer()),this._tip=z.create(\"div\",\"maplibregl-popup-tip\",this._container),this._container.appendChild(this._content),this.options.className)for(let G of this.options.className.split(\" \"))this._container.classList.add(G);this._closeButton&&this._closeButton.setAttribute(\"aria-label\",this._map._getUIString(\"Popup.Close\")),this._trackPointer&&this._container.classList.add(\"maplibregl-popup-track-pointer\")}let f;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=ld(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),c&&\"point\"in c&&c.point&&(f=c.point),this._trackPointer&&!f)return;let b=this._flatPos=this._pos=this._trackPointer&&f?f:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&f?f:this._map.transform.locationToScreenPoint(this._lngLat));let S=this.options.anchor,D=Jm(this.options.offset);if(!S){let G=this._container.offsetWidth,q=this._container.offsetHeight,K=(function(ct){var ut,gt,yt,Pt;return ct?{top:(ut=ct.top)!==null&&ut!==void 0?ut:0,right:(gt=ct.right)!==null&&gt!==void 0?gt:0,bottom:(yt=ct.bottom)!==null&&yt!==void 0?yt:0,left:(Pt=ct.left)!==null&&Pt!==void 0?Pt:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding),it;it=b.y+D.bottom.y<q+K.top?[\"top\"]:b.y>this._map.transform.height-q-K.bottom?[\"bottom\"]:[],b.x<G/2+K.left?it.push(\"left\"):b.x>this._map.transform.width-G/2-K.right&&it.push(\"right\"),S=it.length===0?\"bottom\":it.join(\"-\")}let N=b.add(D[S]);this.options.subpixelPositioning||(N=N.round()),this._container.style.transform=`${i0[S]} translate(${N.x}px,${N.y}px)`,cd(this._container,S,\"popup\"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(hv),I)}addTo(I){return this._map&&this.remove(),this._map=I,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._update),this._map.on(\"mouseup\",this._update),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 o.l(\"open\")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=o.V.convert(I),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on(\"move\",this._update),this._map.off(\"mousemove\",this._update),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._update),this._map.on(\"drag\",this._update),this._container&&this._container.classList.add(\"maplibregl-popup-track-pointer\"),this._map._canvasContainer.classList.add(\"maplibregl-track-pointer\")),this}getElement(){return this._container}setText(I){return this.setDOMContent(document.createTextNode(I))}setHTML(I){let c=document.createDocumentFragment(),f=document.createElement(\"body\"),b;for(f.innerHTML=I;b=f.firstChild,b;)c.appendChild(b);return this.setDOMContent(c)}getMaxWidth(){var I;return(I=this._container)===null||I===void 0?void 0:I.style.maxWidth}setMaxWidth(I){return this.options.maxWidth=I,this._update(),this}setDOMContent(I){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=z.create(\"div\",\"maplibregl-popup-content\",this._container);return this._content.appendChild(I),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(I){return this._container&&this._container.classList.add(I),this}removeClassName(I){return this._container&&this._container.classList.remove(I),this}setOffset(I){return this.options.offset=I,this._update(),this}toggleClassName(I){if(this._container)return this._container.classList.toggle(I)}setSubpixelPositioning(I){this.options.subpixelPositioning=I}setPadding(I){this.options.padding=I,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=z.create(\"button\",\"maplibregl-popup-close-button\",this._content),this._closeButton.type=\"button\",this._closeButton.innerHTML=\"&#215;\",this._closeButton.addEventListener(\"click\",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let I=this._container.querySelector(dv);I&&I.focus()}},n.RasterDEMTileSource=Io,n.RasterTileSource=ln,n.ScaleControl=class{constructor(I){this._onMove=()=>{yy(this._map,this._container,this.options)},this.setUnit=c=>{this.options.unit=c,yy(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ay),I)}getDefaultPosition(){return\"bottom-left\"}onAdd(I){return this._map=I,this._container=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-scale\",I.getContainer()),this._map.on(\"move\",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off(\"move\",this._onMove),this._map=void 0}},n.ScrollZoomHandler=Wm,n.Style=Ni,n.TerrainControl=class{constructor(I){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=I}onAdd(I){return this._map=I,this._container=z.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._terrainButton=z.create(\"button\",\"maplibregl-ctrl-terrain\",this._container),z.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(){this._container.remove(),this._map.off(\"terrain\",this._updateTerrainIcon),this._map=void 0}},n.TwoFingersTouchPitchHandler=lv,n.TwoFingersTouchRotateHandler=sd,n.TwoFingersTouchZoomHandler=py,n.TwoFingersTouchZoomRotateHandler=C2,n.VectorTileSource=Ui,n.VideoSource=ba,n.addSourceType=(I,c)=>o._(void 0,void 0,void 0,(function*(){if(NA(I))throw new Error(`A source type called \"${I}\" already exists.`);((f,b)=>{FA[f]=b})(I,c)})),n.clearPrewarmedResources=function(){let I=Ue;I&&(I.isPreloaded()&&I.numActive()===1?(I.release(_e),Ue=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()\"))},n.createTileMesh=no,n.getMaxParallelImageRequests=function(){return o.c.MAX_PARALLEL_IMAGE_REQUESTS},n.getRTLTextPluginStatus=function(){return ja().getRTLTextPluginStatus()},n.getVersion=function(){return fv},n.getWorkerCount=function(){return Pe.workerCount},n.getWorkerUrl=function(){return o.c.WORKER_URL},n.importScriptInWorkers=function(I){return mr().broadcast(\"IS\",I)},n.isTimeFrozen=function(){return C.isFrozen()},n.now=R,n.prewarm=function(){ee().acquire(_e)},n.restoreNow=function(){C.restoreNow()},n.setMaxParallelImageRequests=function(I){o.c.MAX_PARALLEL_IMAGE_REQUESTS=I},n.setNow=function(I){C.setNow(I)},n.setRTLTextPlugin=function(I,c){return ja().setRTLTextPlugin(I,c)},n.setWorkerCount=function(I){Pe.workerCount=I},n.setWorkerUrl=function(I){o.c.WORKER_URL=I}}));var i=e;return i}))});var _u=xe(ze(),1),Iht=xe(Cht(),1),kht=_u.createContext(null);function SLt(){let e=_u.useContext(kht);if(!e)throw new Error(\"RenderContext not found\");return e}function Q5(){return SLt().model}function gh(e){let t=Q5(),r=_u.useSyncExternalStore(n=>(t.on(`change:${e}`,n),()=>t.off(`change:${e}`,n)),()=>t.get(e)),i=_u.useCallback(n=>{t.set(e,typeof n==\"function\"?n(t.get(e)):n),t.save_changes()},[t,e]);return[r,i]}function Rht(e){return({el:t,model:r,experimental:i})=>{let n=Iht.createRoot(t);return n.render(_u.createElement(_u.StrictMode,null,_u.createElement(kht.Provider,{value:{model:r,experimental:i}},_u.createElement(e)))),()=>n.unmount()}}function e1(e,t){if(!e)throw new Error(t||\"loader assertion failed.\")}var d0={self:typeof self<\"u\"&&self,window:typeof window<\"u\"&&window,global:typeof global<\"u\"&&global,document:typeof document<\"u\"&&document},MLt=d0.self||d0.window||d0.global||{},ELt=d0.window||d0.self||d0.global||{},PLt=d0.global||d0.self||d0.window||{},CLt=d0.document||{};var Vv=!!(typeof process!=\"object\"||String(process)!==\"[object process]\"||process.browser);var Dht=typeof process<\"u\"&&process.version&&/v([0-9]*)/.exec(process.version),ILt=Dht&&parseFloat(Dht[1])||0;J5();var HW=\"4.3.3\",NLt=HW[0]>=\"0\"&&HW[0]<=\"9\"?`v${HW}`:\"\";function zLt(){let e=new Ic({id:\"loaders.gl\"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=NLt,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var YW=zLt();function XW(e,t){return Zht(e||{},t)}function Zht(e,t,r=0){if(r>3)return t;let i={...e};for(let[n,o]of Object.entries(t))o&&typeof o==\"object\"&&!Array.isArray(o)?i[n]=Zht(i[n]||{},t[n],r+1):i[n]=t[n];return i}var Kht=\"latest\";function ULt(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version=\"4.3.3\"),globalThis._loadersgl_.version}var ZW=ULt();function kc(e,t){if(!e)throw new Error(t||\"loaders.gl assertion failed.\")}var f0={self:typeof self<\"u\"&&self,window:typeof window<\"u\"&&window,global:typeof global<\"u\"&&global,document:typeof document<\"u\"&&document},Q1e=f0.self||f0.window||f0.global||{},J1e=f0.window||f0.self||f0.global||{},t_e=f0.global||f0.self||f0.window||{},e_e=f0.document||{};var wd=typeof process!=\"object\"||String(process)!==\"[object process]\"||process.browser;var Jht=typeof window<\"u\"&&typeof window.orientation<\"u\",Qht=typeof process<\"u\"&&process.version&&/v([0-9]*)/.exec(process.version),r_e=Qht&&parseFloat(Qht[1])||0;var tE=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:\"loaders.gl\",type:t,payload:r})}done(t){kc(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){kc(this.isRunning),this.isRunning=!1,this._reject(t)}};var Kw=class{terminate(){}};var KW=new Map;function tdt(e){kc(e.source&&!e.url||!e.source&&e.url);let t=KW.get(e.source||e.url);return t||(e.url&&(t=VLt(e.url),KW.set(e.url,t)),e.source&&(t=edt(e.source),KW.set(e.source,t))),kc(t),t}function VLt(e){if(!e.startsWith(\"http\"))return e;let t=jLt(e);return edt(t)}function edt(e){let t=new Blob([e],{type:\"application/javascript\"});return URL.createObjectURL(t)}function jLt(e){return`try {\n  importScripts('${e}');\n} catch (error) {\n  console.error(error);\n  throw error;\n}`}function QW(e,t=!0,r){let i=r||new Set;if(e){if(rdt(e))i.add(e);else if(rdt(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e==\"object\")for(let n in e)QW(e[n],t,i)}}return r===void 0?Array.from(i):[]}function rdt(e){return e?e instanceof ArrayBuffer||typeof MessagePort<\"u\"&&e instanceof MessagePort||typeof ImageBitmap<\"u\"&&e instanceof ImageBitmap||typeof OffscreenCanvas<\"u\"&&e instanceof OffscreenCanvas:!1}var JW=()=>{},i1=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL=\"\";static isSupported(){return typeof Worker<\"u\"&&wd||typeof Kw<\"u\"&&!wd}constructor(t){let{name:r,source:i,url:n}=t;kc(i||n),this.name=r,this.source=i,this.url=n,this.onMessage=JW,this.onError=o=>console.log(o),this.worker=wd?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=JW,this.onError=JW,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(t,r){r=r||QW(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r=\"Failed to load \";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=tdt({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error(\"No data received\"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let i=this.url.includes(\":/\")||this.url.startsWith(\"/\")?this.url:`./${this.url}`;t=new Kw(i,{eval:!1})}else if(this.source)t=new Kw(this.source,{eval:!0});else throw new Error(\"no worker\");return t.on(\"message\",r=>{this.onMessage(r)}),t.on(\"error\",r=>{this.onError(r)}),t.on(\"exit\",r=>{}),t}};var eE=class{name=\"unnamed\";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return i1.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(n,o,s)=>n.done(s),i=(n,o)=>n.error(o)){let n=new Promise(o=>(this.jobQueue.push({name:t,onMessage:r,onError:i,onStart:o}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:\"Starting job\",name:r.name,workerThread:t,backlog:this.jobQueue.length});let i=new tE(r.name,t);t.onMessage=n=>r.onMessage(i,n.type,n.payload),t.onError=n=>r.onError(i,n),r.onStart(i);try{await i.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!wd||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new i1({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Jht?this.maxMobileConcurrency:this.maxConcurrency}};var $Lt={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},$v=class e{props;workerPools=new Map;static _workerFarm;static isSupported(){return i1.isSupported()}static getWorkerFarm(t={}){return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}constructor(t){this.props={...$Lt},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:i,url:n}=t,o=this.workerPools.get(r);return o||(o=new eE({name:r,source:i,url:n}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};function tq(e,t={}){let r=t[e.id]||{},i=wd?`${e.id}-worker.js`:`${e.id}-worker-node.js`,n=r.workerUrl;if(!n&&e.id===\"compression\"&&(n=t.workerUrl),t._workerType===\"test\"&&(wd?n=`modules/${e.module}/dist/${i}`:n=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!n){let o=e.version;o===\"latest\"&&(o=Kht);let s=o?`@${o}`:\"\";n=`https://unpkg.com/@loaders.gl/${e.module}${s}/dist/${i}`}return kc(n),n}function eq(e,t=ZW){kc(e,\"no worker provided\");let r=e.version;return!(!t||!r)}function rq(e,t){return!$v.isSupported()||!wd&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function iq(e,t,r,i,n){let o=e.id,s=tq(e,r),h=$v.getWorkerFarm(r).getWorkerPool({name:o,url:s});r=JSON.parse(JSON.stringify(r)),i=JSON.parse(JSON.stringify(i||{}));let p=await h.startJob(\"process-on-worker\",GLt.bind(null,n));return p.postMessage(\"process\",{input:t,options:r,context:i}),await(await p.result).result}async function GLt(e,t,r,i){switch(r){case\"done\":t.done(i);break;case\"error\":t.error(new Error(i.error));break;case\"process\":let{id:n,input:o,options:s}=i;try{let a=await e(o,s);t.postMessage(\"done\",{id:n,result:a})}catch(a){let h=a instanceof Error?a.message:\"unknown error\";t.postMessage(\"error\",{id:n,error:h})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function nq(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let i=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<i.length;++o)if(i[o]!==n[o])return!1;return!0}function oq(...e){return idt(e)}function idt(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,s)=>o+s.byteLength,0),i=new Uint8Array(r),n=0;for(let o of t)i.set(o,n),n+=o.byteLength;return i.buffer}async function sq(e){let t=[];for await(let r of e)t.push(r);return oq(...t)}Qw();var WLt=\"Queued Requests\",qLt=\"Active Requests\",HLt=\"Cancelled Requests\",YLt=\"Queued Requests Ever\",XLt=\"Active Requests Ever\",ZLt={id:\"request-scheduler\",throttleRequests:!0,maxRequests:6,debounceTime:0},Jw=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...ZLt,...t},this.stats=new vu({id:this.props.id}),this.stats.get(WLt),this.stats.get(qLt),this.stats.get(HLt),this.stats.get(YLt),this.stats.get(XLt)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let i={handle:t,priority:0,getPriority:r},n=new Promise(o=>(i.resolve=o,i));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:i}=t,n=!1,o=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let i=this.requestQueue.shift();i&&this._issueRequest(i)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let i=t[r];this._updateRequest(i)||(t.splice(r,1),this.requestMap.delete(i.handle),r--)}t.sort((r,i)=>r.priority-i.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var KLt=\"\",odt={};function cq(e){for(let t in odt)if(e.startsWith(t)){let r=odt[t];e=e.replace(t,r)}return!e.startsWith(\"http://\")&&!e.startsWith(\"https://\")&&(e=`${KLt}${e}`),e}function sdt(e){return e&&typeof e==\"object\"&&e.isBuffer}function _D(e){if(sdt(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e==\"string\"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e==\"object\"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(\"toArrayBuffer\")}var Wv={};Ql(Wv,{dirname:()=>JLt,filename:()=>QLt,join:()=>t9t,resolve:()=>e9t});function adt(){if(typeof process<\"u\"&&typeof process.cwd<\"u\")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf(\"/\")+1)||\"\"}function QLt(e){let t=e?e.lastIndexOf(\"/\"):-1;return t>=0?e.substr(t+1):\"\"}function JLt(e){let t=e?e.lastIndexOf(\"/\"):-1;return t>=0?e.substr(0,t):\"\"}function t9t(...e){return e=e.map((r,i)=>(i&&(r=r.replace(new RegExp(\"^/\"),\"\")),i!==e.length-1&&(r=r.replace(new RegExp(\"/$\"),\"\")),r)),e.join(\"/\")}function e9t(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r=\"\",i=!1,n;for(let o=t.length-1;o>=-1&&!i;o--){let s;o>=0?s=t[o]:(n===void 0&&(n=adt()),s=n),s.length!==0&&(r=`${s}/${r}`,i=s.charCodeAt(0)===iE)}return r=r9t(r,!i),i?`/${r}`:r.length>0?r:\".\"}var iE=47,uq=46;function r9t(e,t){let r=\"\",i=-1,n=0,o,s=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===iE)break;o=iE}if(o===iE){if(!(i===a-1||n===1))if(i!==a-1&&n===2){if(r.length<2||!s||r.charCodeAt(r.length-1)!==uq||r.charCodeAt(r.length-2)!==uq){if(r.length>2){let h=r.length-1,p=h;for(;p>=0&&r.charCodeAt(p)!==iE;--p);if(p!==h){r=p===-1?\"\":r.slice(0,p),i=a,n=0,s=!1;continue}}else if(r.length===2||r.length===1){r=\"\",i=a,n=0,s=!1;continue}}t&&(r.length>0?r+=\"/..\":r=\"..\",s=!0)}else{let h=e.slice(i+1,a);r.length>0?r+=`/${h}`:r=h,s=!1}i=a,n=0}else o===uq&&n!==-1?++n:n=-1}return r}var i9t=e=>typeof e==\"boolean\",nE=e=>typeof e==\"function\",qv=e=>e!==null&&typeof e==\"object\",hq=e=>qv(e)&&e.constructor==={}.constructor;var ldt=e=>!!e&&typeof e[Symbol.iterator]==\"function\",cdt=e=>e&&typeof e[Symbol.asyncIterator]==\"function\";var Td=e=>typeof Response<\"u\"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var Sd=e=>typeof Blob<\"u\"&&e instanceof Blob,udt=e=>e&&typeof e==\"object\"&&e.isBuffer;var n9t=e=>typeof ReadableStream<\"u\"&&e instanceof ReadableStream||qv(e)&&nE(e.tee)&&nE(e.cancel)&&nE(e.getReader);var o9t=e=>qv(e)&&nE(e.read)&&nE(e.pipe)&&i9t(e.readable),vD=e=>n9t(e)||o9t(e);var bD=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var s9t=/^data:([-\\w.]+\\/[-\\w.+]+)(;|,)/,a9t=/^([-\\w.]+\\/[-\\w.+]+)/;function dq(e,t){return e.toLowerCase()===t.toLowerCase()}function hdt(e){let t=a9t.exec(e);return t?t[1]:e}function fq(e){let t=s9t.exec(e);return t?t[1]:\"\"}var ddt=/\\?.*/;function fdt(e){let t=e.match(ddt);return t&&t[0]}function t3(e){return e.replace(ddt,\"\")}function pdt(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Hv(e){return Td(e)?e.url:Sd(e)?e.name||\"\":typeof e==\"string\"?e:\"\"}function oE(e){if(Td(e)){let t=e,r=t.headers.get(\"content-type\")||\"\",i=t3(t.url);return hdt(r)||fq(i)}return Sd(e)?e.type||\"\":typeof e==\"string\"?fq(e):\"\"}function mdt(e){return Td(e)?e.headers[\"content-length\"]||-1:Sd(e)?e.size:typeof e==\"string\"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function xD(e){if(Td(e))return e;let t={},r=mdt(e);r>=0&&(t[\"content-length\"]=String(r));let i=Hv(e),n=oE(e);n&&(t[\"content-type\"]=n);let o=await c9t(e);o&&(t[\"x-first-bytes\"]=o),typeof e==\"string\"&&(e=new TextEncoder().encode(e));let s=new Response(e,{headers:t});return Object.defineProperty(s,\"url\",{value:i}),s}async function gdt(e){if(!e.ok)throw await l9t(e)}async function l9t(e){let t=pdt(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let i={reason:e.statusText,url:e.url,response:e};try{let n=e.headers.get(\"Content-Type\");i.reason=!e.bodyUsed&&n?.includes(\"application/json\")?await e.json():await e.text()}catch{}return new bD(r,i)}async function c9t(e){if(typeof e==\"string\")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(i=>{let n=new FileReader;n.onload=o=>i(o?.target?.result),n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${u9t(r)}`}return null}function u9t(e){let t=\"\",r=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)t+=String.fromCharCode(r[i]);return btoa(t)}function h9t(e){return!d9t(e)&&!f9t(e)}function d9t(e){return e.startsWith(\"http:\")||e.startsWith(\"https:\")}function f9t(e){return e.startsWith(\"data:\")}async function pq(e,t){if(typeof e==\"string\"){let r=cq(e);return h9t(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await xD(e)}J5();var mq=new Ic({id:\"loaders.gl\"}),wD=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},TD=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var gq={fetch:null,mimeType:void 0,nothrow:!1,log:new TD,useLocalLibraries:!1,CDN:\"https://unpkg.com/@loaders.gl\",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Vv,_nodeWorkers:!1,_workerType:\"\",limit:0,_limitMB:0,batchSize:\"auto\",batchDebounceMs:0,metadata:!1,transforms:[]},Adt={throws:\"nothrow\",dataType:\"(no longer used)\",uri:\"baseUri\",method:\"fetch.method\",headers:\"fetch.headers\",body:\"fetch.body\",mode:\"fetch.mode\",credentials:\"fetch.credentials\",cache:\"fetch.cache\",redirect:\"fetch.redirect\",referrer:\"fetch.referrer\",referrerPolicy:\"fetch.referrerPolicy\",integrity:\"fetch.integrity\",keepalive:\"fetch.keepalive\",signal:\"fetch.signal\"};function Aq(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function yq(){let e=Aq();return e.globalOptions=e.globalOptions||{...gq},e.globalOptions}function vdt(e,t,r,i){return r=r||[],r=Array.isArray(r)?r:[r],p9t(e,r),g9t(t,e,i)}function p9t(e,t){ydt(e,null,gq,Adt,t);for(let r of t){let i=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},o=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};ydt(i,r.id,n,o,t)}}function ydt(e,t,r,i,n){let o=t||\"Top level\",s=t?`${t}.`:\"\";for(let a in e){let h=!t&&qv(e[a]),p=a===\"baseUri\"&&!t,g=a===\"workerUrl\"&&t;if(!(a in r)&&!p&&!g){if(a in i)mq.warn(`${o} loader option '${s}${a}' no longer supported, use '${i[a]}'`)();else if(!h){let w=m9t(a,n);mq.warn(`${o} loader option '${s}${a}' not recognized. ${w}`)()}}}}function m9t(e,t){let r=e.toLowerCase(),i=\"\";for(let n of t)for(let o in n.options){if(e===o)return`Did you mean '${n.id}.${o}'?`;let s=o.toLowerCase();(r.startsWith(s)||s.startsWith(r))&&(i=i||`Did you mean '${n.id}.${o}'?`)}return i}function g9t(e,t,r){let n={...e.options||{}};return A9t(n,r),n.log===null&&(n.log=new wD),_dt(n,yq()),_dt(n,t),n}function _dt(e,t){for(let r in t)if(r in t){let i=t[r];hq(i)&&hq(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function A9t(e,t){t&&!(\"baseUri\"in e)&&(e.baseUri=t)}function sE(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function aE(e){e1(e,\"null loader\"),e1(sE(e),\"invalid loader\");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var bdt=()=>{let e=Aq();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function _q(e){let t=bdt();e=Array.isArray(e)?e:[e];for(let r of e){let i=aE(r);t.find(n=>i===n)||t.unshift(i)}}function xdt(){return bdt()}var y9t=/\\.([^.]+)$/;async function Sdt(e,t=[],r,i){if(!Mdt(e))return null;let n=wdt(e,t,{...r,nothrow:!0},i);if(n)return n;if(Sd(e)&&(e=await e.slice(0,10).arrayBuffer(),n=wdt(e,t,r,i)),!n&&!r?.nothrow)throw new Error(Edt(e));return n}function wdt(e,t=[],r,i){if(!Mdt(e))return null;if(t&&!Array.isArray(t))return aE(t);let n=[];t&&(n=n.concat(t)),r?.ignoreRegisteredLoaders||n.push(...xdt()),v9t(n);let o=_9t(e,n,r,i);if(!o&&!r?.nothrow)throw new Error(Edt(e));return o}function _9t(e,t,r,i){let n=Hv(e),o=oE(e),s=t3(n)||i?.url,a=null,h=\"\";return r?.mimeType&&(a=vq(t,r?.mimeType),h=`match forced by supplied MIME type ${r?.mimeType}`),a=a||b9t(t,s),h=h||(a?`matched url ${s}`:\"\"),a=a||vq(t,o),h=h||(a?`matched MIME type ${o}`:\"\"),a=a||w9t(t,e),h=h||(a?`matched initial data ${Pdt(e)}`:\"\"),r?.fallbackMimeType&&(a=a||vq(t,r?.fallbackMimeType),h=h||(a?`matched fallback MIME type ${o}`:\"\")),h&&YW.log(1,`selectLoader selected ${a?.name}: ${h}.`),a}function Mdt(e){return!(e instanceof Response&&e.status===204)}function Edt(e){let t=Hv(e),r=oE(e),i=\"No valid loader found (\";i+=t?`${Wv.filename(t)}, `:\"no url provided, \",i+=`MIME type: ${r?`\"${r}\"`:\"not provided\"}, `;let n=e?Pdt(e):\"\";return i+=n?` first bytes: \"${n}\"`:\"first bytes: not available\",i+=\")\",i}function v9t(e){for(let t of e)aE(t)}function b9t(e,t){let r=t&&y9t.exec(t),i=r&&r[1];return i?x9t(e,i):null}function x9t(e,t){t=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(i.toLowerCase()===t)return r;return null}function vq(e,t){for(let r of e)if(r.mimeTypes?.some(i=>dq(t,i))||dq(t,`application/x.${r.id}`))return r;return null}function w9t(e,t){if(!t)return null;for(let r of e)if(typeof t==\"string\"){if(T9t(t,r))return r}else if(ArrayBuffer.isView(t)){if(Tdt(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&Tdt(t,0,r))return r;return null}function T9t(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function Tdt(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>S9t(e,t,r,n))}function S9t(e,t,r,i){if(i instanceof ArrayBuffer)return nq(i,e,i.byteLength);switch(typeof i){case\"function\":return i(e);case\"string\":let n=bq(e,t,i.length);return i===n;default:return!1}}function Pdt(e,t=5){return typeof e==\"string\"?e.slice(0,t):ArrayBuffer.isView(e)?bq(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?bq(e,0,t):\"\"}function bq(e,t,r){if(e.byteLength<t+r)return\"\";let i=new DataView(e),n=\"\";for(let o=0;o<r;o++)n+=String.fromCharCode(i.getUint8(t+o));return n}function*Cdt(e,t){let r=t?.chunkSize||262144,i=0,n=new TextEncoder;for(;i<e.length;){let o=Math.min(e.length-i,r),s=e.slice(i,i+o);i+=o,yield n.encode(s)}}function*Idt(e,t={}){let{chunkSize:r=262144}=t,i=0;for(;i<e.byteLength;){let n=Math.min(e.byteLength-i,r),o=new ArrayBuffer(n),s=new Uint8Array(e,i,n);new Uint8Array(o).set(s),i+=n,yield o}}async function*kdt(e,t){let r=t?.chunkSize||1048576,i=0;for(;i<e.size;){let n=i+r,o=await e.slice(i,n).arrayBuffer();i=n,yield o}}function xq(e,t){return Vv?M9t(e,t):E9t(e,t)}async function*M9t(e,t){let r=e.getReader(),i;try{for(;;){let n=i||r.read();t?._streamReadAhead&&(i=r.read());let{done:o,value:s}=await n;if(o)return;yield _D(s)}}catch{r.releaseLock()}}async function*E9t(e,t){for await(let r of e)yield _D(r)}function Rdt(e,t){if(typeof e==\"string\")return Cdt(e,t);if(e instanceof ArrayBuffer)return Idt(e,t);if(Sd(e))return kdt(e,t);if(vD(e))return xq(e,t);if(Td(e))return xq(e.body,t);throw new Error(\"makeIterator\")}var Ddt=\"Cannot convert supplied data type\";function P9t(e,t,r){if(t.text&&typeof e==\"string\")return e;if(udt(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return t.text&&!t.binary?new TextDecoder(\"utf8\").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder(\"utf8\").decode(e);let i=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+n)),i}throw new Error(Ddt)}async function Odt(e,t,r){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e==\"string\"||i)return P9t(e,t,r);if(Sd(e)&&(e=await xD(e)),Td(e)){let n=e;return await gdt(n),t.binary?await n.arrayBuffer():await n.text()}if(vD(e)&&(e=Rdt(e,r)),ldt(e)||cdt(e))return sq(e);throw new Error(Ddt)}function SD(e,t){let r=yq(),i=e||r;return typeof i.fetch==\"function\"?i.fetch:qv(i.fetch)?n=>pq(n,i.fetch):t?.fetch?t?.fetch:pq}function Ldt(e,t,r){if(r)return r;let i={fetch:SD(t,e),...e};if(i.url){let n=t3(i.url);i.baseUrl=n,i.queryString=fdt(i.url),i.filename=Wv.filename(n),i.baseUrl=Wv.dirname(n)}return Array.isArray(i.loaders)||(i.loaders=null),i}function Bdt(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let i=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...i]:i}return r&&r.length?r:void 0}async function lE(e,t,r,i){t&&!Array.isArray(t)&&!sE(t)&&(i=void 0,r=t,t=void 0),e=await e,r=r||{};let n=Hv(e),s=Bdt(t,i),a=await Sdt(e,s,r);return a?(r=vdt(r,a,s,n),i=Ldt({url:n,_parse:lE,loaders:s},r,i||null),await C9t(a,e,r,i)):null}async function C9t(e,t,r,i){if(eq(e),r=XW(e.options,r),Td(t)){let o=t,{ok:s,redirected:a,status:h,statusText:p,type:g,url:w}=o,C=Object.fromEntries(o.headers.entries());i.response={headers:C,ok:s,redirected:a,status:h,statusText:p,type:g,url:w}}t=await Odt(t,e,r);let n=e;if(n.parseTextSync&&typeof t==\"string\")return n.parseTextSync(t,r,i);if(rq(e,r))return await iq(e,t,r,i,lE);if(n.parseText&&typeof t==\"string\")return await n.parseText(t,r,i);if(n.parse)return await n.parse(t,r,i);throw kc(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function wq(e){let t=1/0,r=1/0,i=1/0,n=-1/0,o=-1/0,s=-1/0,a=e.POSITION?e.POSITION.value:[],h=a&&a.length;for(let p=0;p<h;p+=3){let g=a[p],w=a[p+1],C=a[p+2];t=g<t?g:t,r=w<r?w:r,i=C<i?C:i,n=g>n?g:n,o=w>o?w:o,s=C>s?C:s}return[[t,r,i],[n,o,s]]}async function n1(e,t,r,i){let n,o;!Array.isArray(t)&&!sE(t)?(n=[],o=t,i=void 0):(n=t,o=r);let s=SD(o),a=e;return typeof e==\"string\"&&(a=await s(e)),Sd(e)&&(a=await s(e)),Array.isArray(n)?await lE(a,n,o):await lE(a,n,o)}var Fdt=\"4.3.3\";var I9t=globalThis.loaders?.parseImageNode,Tq=typeof Image<\"u\",Sq=typeof ImageBitmap<\"u\",k9t=!!I9t,Mq=Vv?!0:k9t;function Ndt(e){switch(e){case\"auto\":return Sq||Tq||Mq;case\"imagebitmap\":return Sq;case\"image\":return Tq;case\"data\":return Mq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function zdt(){if(Sq)return\"imagebitmap\";if(Tq)return\"image\";if(Mq)return\"data\";throw new Error(\"Install '@loaders.gl/polyfills' to parse images under Node.js\")}function R9t(e){let t=D9t(e);if(!t)throw new Error(\"Not an image\");return t}function Udt(e){switch(R9t(e)){case\"data\":return e;case\"image\":case\"imagebitmap\":let t=document.createElement(\"canvas\"),r=t.getContext(\"2d\");if(!r)throw new Error(\"getImageData\");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error(\"getImageData\")}}function D9t(e){return typeof ImageBitmap<\"u\"&&e instanceof ImageBitmap?\"imagebitmap\":typeof Image<\"u\"&&e instanceof Image?\"image\":e&&typeof e==\"object\"&&e.data&&e.width&&e.height?\"data\":null}var O9t=/^data:image\\/svg\\+xml/,L9t=/\\.svg((\\?|#).*)?$/;function MD(e){return e&&(O9t.test(e)||L9t.test(e))}function Vdt(e,t){if(MD(t)){let i=new TextDecoder().decode(e);try{typeof unescape==\"function\"&&typeof encodeURIComponent==\"function\"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Eq(e,t)}function Eq(e,t){if(MD(t))throw new Error(\"SVG cannot be parsed directly to imagebitmap\");return new Blob([new Uint8Array(e)])}async function ED(e,t,r){let i=Vdt(e,r),n=self.URL||self.webkitURL,o=typeof i!=\"string\"&&n.createObjectURL(i);try{return await B9t(o||i,t)}finally{o&&n.revokeObjectURL(o)}}async function B9t(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:\"error\";n(new Error(s))}}catch(o){n(o)}})}var F9t={},jdt=!0;async function $dt(e,t,r){let i;MD(r)?i=await ED(e,t,r):i=Eq(e,r);let n=t&&t.imagebitmap;return await N9t(i,n)}async function N9t(e,t=null){if((z9t(t)||!jdt)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),jdt=!1}return await createImageBitmap(e)}function z9t(e){for(let t in e||F9t)return!1;return!0}function Gdt(e){return!$9t(e,\"ftyp\",4)||(e[8]&96)===0?null:U9t(e)}function U9t(e){switch(V9t(e,8,12).replace(\"\\0\",\" \").trim()){case\"avif\":case\"avis\":return{extension:\"avif\",mimeType:\"image/avif\"};default:return null}}function V9t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function j9t(e){return[...e].map(t=>t.charCodeAt(0))}function $9t(e,t,r=0){let i=j9t(t);for(let n=0;n<i.length;++n)if(i[n]!==e[n+r])return!1;return!0}var p0=!1,cE=!0;function PD(e){let t=uE(e);return W9t(t)||Y9t(t)||q9t(t)||H9t(t)||G9t(t)}function G9t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=Gdt(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function W9t(e){let t=uE(e);return t.byteLength>=24&&t.getUint32(0,p0)===2303741511?{mimeType:\"image/png\",width:t.getUint32(16,p0),height:t.getUint32(20,p0)}:null}function q9t(e){let t=uE(e);return t.byteLength>=10&&t.getUint32(0,p0)===1195984440?{mimeType:\"image/gif\",width:t.getUint16(6,cE),height:t.getUint16(8,cE)}:null}function H9t(e){let t=uE(e);return t.byteLength>=14&&t.getUint16(0,p0)===16973&&t.getUint32(2,cE)===t.byteLength?{mimeType:\"image/bmp\",width:t.getUint32(18,cE),height:t.getUint32(22,cE)}:null}function Y9t(e){let t=uE(e);if(!(t.byteLength>=3&&t.getUint16(0,p0)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=X9t(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,p0);if(n.has(s))return{mimeType:\"image/jpeg\",height:t.getUint16(o+5,p0),width:t.getUint16(o+7,p0)};if(!i.has(s))return null;o+=2,o+=t.getUint16(o,p0)}return null}function X9t(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function uE(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error(\"toDataView\")}async function Wdt(e,t){let{mimeType:r}=PD(e)||{},i=globalThis.loaders?.parseImageNode;return e1(i),await i(e,r)}async function qdt(e,t,r){t=t||{};let n=(t.image||{}).type||\"auto\",{url:o}=r||{},s=Z9t(n),a;switch(s){case\"imagebitmap\":a=await $dt(e,t,o);break;case\"image\":a=await ED(e,t,o);break;case\"data\":a=await Wdt(e,t);break;default:e1(!1)}return n===\"data\"&&(a=Udt(a)),a}function Z9t(e){switch(e){case\"auto\":case\"data\":return zdt();default:return Ndt(e),e}}var K9t=[\"png\",\"jpg\",\"jpeg\",\"gif\",\"webp\",\"bmp\",\"ico\",\"svg\",\"avif\"],Q9t=[\"image/png\",\"image/jpeg\",\"image/gif\",\"image/webp\",\"image/avif\",\"image/bmp\",\"image/vnd.microsoft.icon\",\"image/svg+xml\"],J9t={image:{type:\"auto\",decode:!0}},Pq={dataType:null,batchType:null,id:\"image\",module:\"images\",name:\"Images\",version:Fdt,mimeTypes:Q9t,extensions:K9t,parse:qdt,tests:[e=>!!PD(new DataView(e))],options:J9t};J5();var tBt=new Ic({id:\"deck\"}),hr=tBt;var Cq={};function Hdt(e){Cq=e}function ys(e,t,r,i){hr.level>0&&Cq[e]&&Cq[e].call(null,t,r,i)}function eBt(e){let t=e[0],r=e[e.length-1];return t===\"{\"&&r===\"}\"||t===\"[\"&&r===\"]\"}var Ydt={dataType:null,batchType:null,id:\"JSON\",name:\"JSON\",module:\"\",version:\"\",options:{},extensions:[\"json\",\"geojson\"],mimeTypes:[\"application/json\",\"application/geo+json\"],testText:eBt,parseTextSync:JSON.parse};function rBt(){let e=\"9.2.11\",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(hr.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:hr,_registerLoggers:Hdt},_q([Ydt,[Pq,{imagebitmap:{premultiplyAlpha:\"none\"}}]])),e}var Xdt=rBt();function CD(e,t){if(!e)throw new Error(t||\"shadertools: assertion failed.\")}var Iq={number:{type:\"number\",validate(e,t){return Number.isFinite(e)&&typeof t==\"object\"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:\"array\",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function Kdt(e){let t={};for(let[r,i]of Object.entries(e))t[r]=iBt(i);return t}function iBt(e){let t=Zdt(e);if(t!==\"object\")return{value:e,...Iq[t],type:t};if(typeof e==\"object\")return e?e.type!==void 0?{...e,...Iq[e.type],type:e.type}:e.value===void 0?{type:\"object\",value:e}:(t=Zdt(e.value),{...e,...Iq[t],type:t}):{type:\"object\",value:null};throw new Error(\"props\")}function Zdt(e){return Array.isArray(e)||ArrayBuffer.isView(e)?\"array\":typeof e}var Qdt=`#ifdef MODULE_LOGDEPTH\n  logdepth_adjustPosition(gl_Position);\n#endif\n`,Jdt=`#ifdef MODULE_MATERIAL\n  fragColor = material_filterColor(fragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n  fragColor = lighting_filterColor(fragColor);\n#endif\n\n#ifdef MODULE_FOG\n  fragColor = fog_filterColor(fragColor);\n#endif\n\n#ifdef MODULE_PICKING\n  fragColor = picking_filterHighlightColor(fragColor);\n  fragColor = picking_filterPickingColor(fragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n  logdepth_setFragDepth();\n#endif\n`;var nBt={vertex:Qdt,fragment:Jdt},tft=/void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/,eft=/}\\n?[^{}]*$/,kq=[],hE=\"__LUMA_INJECT_DECLARATIONS__\";function rft(e){let t={vertex:{},fragment:{}};for(let r in e){let i=e[r],n=oBt(r);typeof i==\"string\"&&(i={order:0,injection:i}),t[n][r]=i}return t}function oBt(e){let t=e.slice(0,2);switch(t){case\"vs\":return\"vertex\";case\"fs\":return\"fragment\";default:throw new Error(t)}}function dE(e,t,r,i=!1){let n=t===\"vertex\";for(let o in r){let s=r[o];s.sort((h,p)=>h.order-p.order),kq.length=s.length;for(let h=0,p=s.length;h<p;++h)kq[h]=s[h].injection;let a=`${kq.join(`\n`)}\n`;switch(o){case\"vs:#decl\":n&&(e=e.replace(hE,a));break;case\"vs:#main-start\":n&&(e=e.replace(tft,h=>h+a));break;case\"vs:#main-end\":n&&(e=e.replace(eft,h=>a+h));break;case\"fs:#decl\":n||(e=e.replace(hE,a));break;case\"fs:#main-start\":n||(e=e.replace(tft,h=>h+a));break;case\"fs:#main-end\":n||(e=e.replace(eft,h=>a+h));break;default:e=e.replace(o,h=>h+a)}}return e=e.replace(hE,\"\"),i&&(e=e.replace(/\\}\\s*$/,o=>o+nBt[t])),e}function e3(e){e.map(t=>sBt(t))}function sBt(e){if(e.instance)return;e3(e.dependencies||[]);let{propTypes:t={},deprecations:r=[],inject:i={}}=e,n={normalizedInjections:rft(i),parsedDeprecations:aBt(r)};t&&(n.propValidators=Kdt(t)),e.instance=n;let o={};t&&(o=Object.entries(t).reduce((s,[a,h])=>{let p=h?.value;return p&&(s[a]=p),s},{})),e.defaultUniforms={...e.defaultUniforms,...o}}function Rq(e,t,r){e.deprecations?.forEach(i=>{i.regex?.test(t)&&(i.deprecated?r.deprecated(i.old,i.new)():r.removed(i.old,i.new)())})}function aBt(e){return e.forEach(t=>{t.type===\"function\"?t.regex=new RegExp(`\\\\b${t.old}\\\\(`):t.regex=new RegExp(`${t.type} ${t.old};`)}),e}function r3(e){e3(e);let t={},r={};ift({modules:e,level:0,moduleMap:t,moduleDepth:r});let i=Object.keys(r).sort((n,o)=>r[o]-r[n]).map(n=>t[n]);return e3(i),i}function ift(e){let{modules:t,level:r,moduleMap:i,moduleDepth:n}=e;if(r>=5)throw new Error(\"Possible loop in shader dependency graph\");for(let o of t)i[o.name]=o,(n[o.name]===void 0||n[o.name]<r)&&(n[o.name]=r);for(let o of t)o.dependencies&&ift({modules:o.dependencies,level:r+1,moduleMap:i,moduleDepth:n})}function nft(e){switch(e?.gpu.toLowerCase()){case\"apple\":return`#define APPLE_GPU\n// Apple optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n`;case\"nvidia\":return`#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n`;case\"intel\":return`#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n`;case\"amd\":return`#define AMD_GPU\n`;default:return`#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Headless Chrome's software shader 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// If the GPU doesn't have full 32 bits precision, will causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n`}}function sft(e,t){if(Number(e.match(/^#version[ \\t]+(\\d+)/m)?.[1]||100)!==300)throw new Error(\"luma.gl v9 only supports GLSL 3.00 shader sources\");switch(t){case\"vertex\":return e=oft(e,lBt),e;case\"fragment\":return e=oft(e,cBt),e;default:throw new Error(t)}}var aft=[[/^(#version[ \\t]+(100|300[ \\t]+es))?[ \\t]*\\n/,`#version 300 es\n`],[/\\btexture(2D|2DProj|Cube)Lod(EXT)?\\(/g,\"textureLod(\"],[/\\btexture(2D|2DProj|Cube)(EXT)?\\(/g,\"texture(\"]],lBt=[...aft,[Dq(\"attribute\"),\"in $1\"],[Dq(\"varying\"),\"out $1\"]],cBt=[...aft,[Dq(\"varying\"),\"in $1\"]];function oft(e,t){for(let[r,i]of t)e=e.replace(r,i);return e}function Dq(e){return new RegExp(`\\\\b${e}[ \\\\t]+(\\\\w+[ \\\\t]+\\\\w+(\\\\[\\\\w+\\\\])?;)`,\"g\")}function Oq(e,t){let r=\"\";for(let i in e){let n=e[i];if(r+=`void ${n.signature} {\n`,n.header&&(r+=`  ${n.header}`),t[i]){let o=t[i];o.sort((s,a)=>s.order-a.order);for(let s of o)r+=`  ${s.injection}\n`}n.footer&&(r+=`  ${n.footer}`),r+=`}\n`}return r}function Lq(e){let t={vertex:{},fragment:{}};for(let r of e){let i,n;typeof r!=\"string\"?(i=r,n=i.hook):(i={},n=r),n=n.trim();let[o,s]=n.split(\":\"),a=n.replace(/\\(.+/,\"\"),h=Object.assign(i,{signature:s});switch(o){case\"vs\":t.vertex[a]=h;break;case\"fs\":t.fragment[a]=h;break;default:throw new Error(o)}}return t}function lft(e,t){return{name:uBt(e,t),language:\"glsl\",version:hBt(e)}}function uBt(e,t=\"unnamed\"){let i=/#define[^\\S\\r\\n]*SHADER_NAME[^\\S\\r\\n]*([A-Za-z0-9_-]+)\\s*/.exec(e);return i?i[1]:t}function hBt(e){let t=100,r=e.match(/[^\\s]+/g);if(r&&r.length>=2&&r[0]===\"#version\"){let i=parseInt(r[1],10);Number.isFinite(i)&&(t=i)}if(t!==100&&t!==300)throw new Error(`Invalid GLSL version ${t}`);return t}var uft=`\n\n${hE}\n`,dBt=`precision highp float;\n`;function hft(e){let t=r3(e.modules||[]);return{source:fBt(e.platformInfo,{...e,source:e.source,stage:\"vertex\",modules:t}),getUniforms:fft(t)}}function dft(e){let{vs:t,fs:r}=e,i=r3(e.modules||[]);return{vs:cft(e.platformInfo,{...e,source:t,stage:\"vertex\",modules:i}),fs:cft(e.platformInfo,{...e,source:r,stage:\"fragment\",modules:i}),getUniforms:fft(i)}}function fBt(e,t){let{source:r,stage:i,modules:n,hookFunctions:o=[],inject:s={},log:a}=t;CD(typeof r==\"string\",\"shader source must be a string\");let h=r,p=\"\",g=Lq(o),w={},C={},R={};for(let W in s){let Y=typeof s[W]==\"string\"?{injection:s[W],order:0}:s[W],H=/^(v|f)s:(#)?([\\w-]+)$/.exec(W);if(H){let Q=H[2],tt=H[3];Q?tt===\"decl\"?C[W]=[Y]:R[W]=[Y]:w[W]=[Y]}else R[W]=[Y]}let z=n;for(let W of z){a&&Rq(W,h,a);let Y=pft(W,\"wgsl\");p+=Y;let H=W.injections?.[i]||{};for(let Q in H){let tt=/^(v|f)s:#([\\w-]+)$/.exec(Q);if(tt){let at=tt[2]===\"decl\"?C:R;at[Q]=at[Q]||[],at[Q].push(H[Q])}else w[Q]=w[Q]||[],w[Q].push(H[Q])}}return p+=uft,p=dE(p,i,C),p+=Oq(g[i],w),p+=h,p=dE(p,i,R),p}function cft(e,t){let{source:r,stage:i,language:n=\"glsl\",modules:o,defines:s={},hookFunctions:a=[],inject:h={},prologue:p=!0,log:g}=t;CD(typeof r==\"string\",\"shader source must be a string\");let w=n===\"glsl\"?lft(r).version:-1,C=e.shaderLanguageVersion,R=w===100?\"#version 100\":\"#version 300 es\",W=r.split(`\n`).slice(1).join(`\n`),Y={};o.forEach(et=>{Object.assign(Y,et.defines)}),Object.assign(Y,s);let H=\"\";switch(n){case\"wgsl\":break;case\"glsl\":H=p?`${R}\n\n// ----- PROLOGUE -------------------------\n${`#define SHADER_TYPE_${i.toUpperCase()}`}\n\n${nft(e)}\n${i===\"fragment\"?dBt:\"\"}\n\n// ----- APPLICATION DEFINES -------------------------\n\n${pBt(Y)}\n\n`:`${R}\n`;break}let Q=Lq(a),tt={},rt={},at={};for(let et in h){let lt=typeof h[et]==\"string\"?{injection:h[et],order:0}:h[et],J=/^(v|f)s:(#)?([\\w-]+)$/.exec(et);if(J){let ft=J[2],dt=J[3];ft?dt===\"decl\"?rt[et]=[lt]:at[et]=[lt]:tt[et]=[lt]}else at[et]=[lt]}for(let et of o){g&&Rq(et,W,g);let lt=pft(et,i);H+=lt;let J=et.instance?.normalizedInjections[i]||{};for(let ft in J){let dt=/^(v|f)s:#([\\w-]+)$/.exec(ft);if(dt){let Ft=dt[2]===\"decl\"?rt:at;Ft[ft]=Ft[ft]||[],Ft[ft].push(J[ft])}else tt[ft]=tt[ft]||[],tt[ft].push(J[ft])}}return H+=\"// ----- MAIN SHADER SOURCE -------------------------\",H+=uft,H=dE(H,i,rt),H+=Oq(Q[i],tt),H+=W,H=dE(H,i,at),n===\"glsl\"&&w!==C&&(H=sft(H,i)),H.trim()}function fft(e){return function(r){let i={};for(let n of e){let o=n.getUniforms?.(r,i);Object.assign(i,o)}return i}}function pBt(e={}){let t=\"\";for(let r in e){let i=e[r];(i||Number.isFinite(i))&&(t+=`#define ${r.toUpperCase()} ${e[r]}\n`)}return t}function pft(e,t){let r;switch(t){case\"vertex\":r=e.vs||\"\";break;case\"fragment\":r=e.fs||\"\";break;case\"wgsl\":r=e.source||\"\";break;default:CD(!1)}if(!e.name)throw new Error(\"Shader module must have a name\");let i=e.name.toUpperCase().replace(/[^0-9a-z]/gi,\"_\"),n=`// ----- MODULE ${e.name} ---------------\n\n`;return t!==\"wgsl\"&&(n+=`#define MODULE_${i}\n`),n+=`${r}\n`,n}var mBt=/^\\s*\\#\\s*ifdef\\s*([a-zA-Z_]+)\\s*$/,gBt=/^\\s*\\#\\s*endif\\s*$/;function mft(e,t){let r=e.split(`\n`),i=[],n=!0,o=null;for(let s of r){let a=s.match(mBt),h=s.match(gBt);a?(o=a[1],n=!!t?.defines?.[o]):h?n=!0:n&&i.push(s)}return i.join(`\n`)}var Yv=class e{static defaultShaderAssembler;_hookFunctions=[];_defaultModules=[];static getDefaultShaderAssembler(){return e.defaultShaderAssembler=e.defaultShaderAssembler||new e,e.defaultShaderAssembler}addDefaultModule(t){this._defaultModules.find(r=>r.name===(typeof t==\"string\"?t:t.name))||this._defaultModules.push(t)}removeDefaultModule(t){let r=typeof t==\"string\"?t:t.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==r)}addShaderHook(t,r){r&&(t=Object.assign(r,{hook:t})),this._hookFunctions.push(t)}assembleWGSLShader(t){let r=this._getModuleList(t.modules),i=this._hookFunctions,{source:n,getUniforms:o}=hft({...t,source:t.source,modules:r,hookFunctions:i});return{source:t.platformInfo.shaderLanguage===\"wgsl\"?mft(n):n,getUniforms:o,modules:r}}assembleGLSLShaderPair(t){let r=this._getModuleList(t.modules),i=this._hookFunctions;return{...dft({...t,vs:t.vs,fs:t.fs,modules:r,hookFunctions:i}),modules:r}}_getModuleList(t=[]){let r=new Array(this._defaultModules.length+t.length),i={},n=0;for(let o=0,s=this._defaultModules.length;o<s;++o){let a=this._defaultModules[o],h=a.name;r[n++]=a,i[h]=!0}for(let o=0,s=t.length;o<s;++o){let a=t[o],h=a.name;i[h]||(r[n++]=a,i[h]=!0)}return r.length=n,e3(r),r}};var ABt=`out vec4 transform_output;\nvoid main() {\n  transform_output = vec4(0);\n}`,yBt=`#version 300 es\n${ABt}`;function fE(e){let{input:t,inputChannels:r,output:i}=e||{};if(!t)return yBt;if(!r)throw new Error(\"inputChannels\");let n=_Bt(r),o=gft(t,r);return`#version 300 es\nin ${n} ${t};\nout vec4 ${i};\nvoid main() {\n  ${i} = ${o};\n}`}function _Bt(e){switch(e){case 1:return\"float\";case 2:return\"vec2\";case 3:return\"vec3\";case 4:return\"vec4\";default:throw new Error(`invalid channels: ${e}`)}}function gft(e,t){switch(t){case 1:return`vec4(${e}, 0.0, 0.0, 1.0)`;case 2:return`vec4(${e}, 0.0, 1.0)`;case 3:return`vec4(${e}, 1.0)`;case 4:return e;default:throw new Error(`invalid channels: ${t}`)}}Ci();var bu=class{constructor(t,r){this.name=t,this.attributes=r,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}get isPointer(){return!1}getTypeName(){return this.name}},$D=class{constructor(t,r,i){this.name=t,this.type=r,this.attributes=i,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}},g0=class extends bu{constructor(t,r){super(t,r),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}},A0=class extends bu{constructor(t,r){super(t,r),this.count=0,this.stride=0}get isArray(){return!0}getTypeName(){return`array<${this.format.getTypeName()}, ${this.count}>`}},IE=class extends bu{constructor(t,r,i){super(t,i),this.format=r}get isPointer(){return!0}getTypeName(){return`&${this.format.getTypeName()}`}},Pg=class extends bu{constructor(t,r,i,n){super(t,i),this.format=r,this.access=n}get isTemplate(){return!0}getTypeName(){let t=this.name;if(this.format!==null){if(t===\"vec2\"||t===\"vec3\"||t===\"vec4\"||t===\"mat2x2\"||t===\"mat2x3\"||t===\"mat2x4\"||t===\"mat3x2\"||t===\"mat3x3\"||t===\"mat3x4\"||t===\"mat4x2\"||t===\"mat4x3\"||t===\"mat4x4\"){if(this.format.name===\"f32\")return t+=\"f\",t;if(this.format.name===\"i32\")return t+=\"i\",t;if(this.format.name===\"u32\")return t+=\"u\",t;if(this.format.name===\"bool\")return t+=\"b\",t;if(this.format.name===\"f16\")return t+=\"h\",t}t+=`<${this.format.name}>`}else if(t===\"vec2\"||t===\"vec3\"||t===\"vec4\")return t;return t}},s1;(e=>{e[e.Uniform=0]=\"Uniform\",e[e.Storage=1]=\"Storage\",e[e.Texture=2]=\"Texture\",e[e.Sampler=3]=\"Sampler\",e[e.StorageTexture=4]=\"StorageTexture\"})(s1||(s1={}));var l3=class{constructor(t,r,i,n,o,s,a){this.name=t,this.type=r,this.group=i,this.binding=n,this.attributes=o,this.resourceType=s,this.access=a}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}},aH=class{constructor(t,r){this.name=t,this.type=r}},lH=class{constructor(t,r,i,n){this.name=t,this.type=r,this.locationType=i,this.location=n,this.interpolation=null}},GD=class{constructor(t,r,i,n){this.name=t,this.type=r,this.locationType=i,this.location=n}},cH=class{constructor(t,r,i,n){this.name=t,this.type=r,this.attributes=i,this.id=n}},uH=class{constructor(t,r,i){this.name=t,this.type=r,this.attributes=i}},hH=class{constructor(t,r=null,i){this.stage=null,this.inputs=[],this.outputs=[],this.arguments=[],this.returnType=null,this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=t,this.stage=r,this.attributes=i}},dH=class{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}};function rFt(e){var t=(32768&e)>>15,r=(31744&e)>>10,i=1023&e;return r==0?(t?-1:1)*Math.pow(2,-14)*(i/Math.pow(2,10)):r==31?i?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+i/Math.pow(2,10))}var ipt=new Float32Array(1),iFt=new Int32Array(ipt.buffer),ec=new Uint16Array(1);function nFt(e){ipt[0]=e;let t=iFt[0],r=t>>31&1,i=t>>23&255,n=8388607&t;if(i===255)return ec[0]=r<<15|31744|(n!==0?512:0),ec[0];if(i===0){if(n===0)return ec[0]=r<<15,ec[0];n|=8388608;let o=113;for(;!(8388608&n);)n<<=1,o--;return i=127-o,n&=8388607,i>0?(n=(n>>126-i)+(n>>127-i&1),ec[0]=r<<15|i<<10|n>>13,ec[0]):(ec[0]=r<<15,ec[0])}return i=i-127+15,i>=31?(ec[0]=r<<15|31744,ec[0]):i<=0?i<-10?(ec[0]=r<<15,ec[0]):(n=(8388608|n)>>1-i,ec[0]=r<<15|n>>13,ec[0]):(n>>=13,ec[0]=r<<15|i<<10|n,ec[0])}var EH=new Uint32Array(1),npt=new Float32Array(EH.buffer,0,1);function ept(e){let t=112+(e>>6&31)<<23|(63&e)<<17;return EH[0]=t,npt[0]}function oFt(e,t,r,i,n,o,s,a,h){let p=i*(s>>=n)*(o>>=n)+r*s+t*a;switch(h){case\"r8unorm\":return[Cn(e,p,\"8unorm\",1)[0]];case\"r8snorm\":return[Cn(e,p,\"8snorm\",1)[0]];case\"r8uint\":return[Cn(e,p,\"8uint\",1)[0]];case\"r8sint\":return[Cn(e,p,\"8sint\",1)[0]];case\"rg8unorm\":{let g=Cn(e,p,\"8unorm\",2);return[g[0],g[1]]}case\"rg8snorm\":{let g=Cn(e,p,\"8snorm\",2);return[g[0],g[1]]}case\"rg8uint\":{let g=Cn(e,p,\"8uint\",2);return[g[0],g[1]]}case\"rg8sint\":{let g=Cn(e,p,\"8sint\",2);return[g[0],g[1]]}case\"rgba8unorm-srgb\":case\"rgba8unorm\":{let g=Cn(e,p,\"8unorm\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba8snorm\":{let g=Cn(e,p,\"8snorm\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba8uint\":{let g=Cn(e,p,\"8uint\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba8sint\":{let g=Cn(e,p,\"8sint\",4);return[g[0],g[1],g[2],g[3]]}case\"bgra8unorm-srgb\":case\"bgra8unorm\":{let g=Cn(e,p,\"8unorm\",4);return[g[2],g[1],g[0],g[3]]}case\"r16uint\":return[Cn(e,p,\"16uint\",1)[0]];case\"r16sint\":return[Cn(e,p,\"16sint\",1)[0]];case\"r16float\":return[Cn(e,p,\"16float\",1)[0]];case\"rg16uint\":{let g=Cn(e,p,\"16uint\",2);return[g[0],g[1]]}case\"rg16sint\":{let g=Cn(e,p,\"16sint\",2);return[g[0],g[1]]}case\"rg16float\":{let g=Cn(e,p,\"16float\",2);return[g[0],g[1]]}case\"rgba16uint\":{let g=Cn(e,p,\"16uint\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba16sint\":{let g=Cn(e,p,\"16sint\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba16float\":{let g=Cn(e,p,\"16float\",4);return[g[0],g[1],g[2],g[3]]}case\"r32uint\":return[Cn(e,p,\"32uint\",1)[0]];case\"r32sint\":return[Cn(e,p,\"32sint\",1)[0]];case\"depth16unorm\":case\"depth24plus\":case\"depth24plus-stencil8\":case\"depth32float\":case\"depth32float-stencil8\":case\"r32float\":return[Cn(e,p,\"32float\",1)[0]];case\"rg32uint\":{let g=Cn(e,p,\"32uint\",2);return[g[0],g[1]]}case\"rg32sint\":{let g=Cn(e,p,\"32sint\",2);return[g[0],g[1]]}case\"rg32float\":{let g=Cn(e,p,\"32float\",2);return[g[0],g[1]]}case\"rgba32uint\":{let g=Cn(e,p,\"32uint\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba32sint\":{let g=Cn(e,p,\"32sint\",4);return[g[0],g[1],g[2],g[3]]}case\"rgba32float\":{let g=Cn(e,p,\"32float\",4);return[g[0],g[1],g[2],g[3]]}case\"rg11b10ufloat\":{let g=new Uint32Array(e.buffer,p,1)[0],w=(4192256&g)>>11,C=(4290772992&g)>>22;return[ept(2047&g),ept(w),(function(R){let z=112+(R>>5&31)<<23|(31&R)<<18;return EH[0]=z,npt[0]})(C),1]}}return null}function Cn(e,t,r,i){let n=[0,0,0,0];for(let o=0;o<i;++o)switch(r){case\"8unorm\":n[o]=e[t]/255,t++;break;case\"8snorm\":n[o]=e[t]/255*2-1,t++;break;case\"8uint\":n[o]=e[t],t++;break;case\"8sint\":n[o]=e[t]-127,t++;break;case\"16uint\":n[o]=e[t]|e[t+1]<<8,t+=2;break;case\"16sint\":n[o]=(e[t]|e[t+1]<<8)-32768,t+=2;break;case\"16float\":n[o]=rFt(e[t]|e[t+1]<<8),t+=2;break;case\"32uint\":case\"32sint\":n[o]=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,t+=4;break;case\"32float\":n[o]=new Float32Array(e.buffer,t,1)[0],t+=4}return n}function Dn(e,t,r,i,n){for(let o=0;o<i;++o)switch(r){case\"8unorm\":e[t]=255*n[o],t++;break;case\"8snorm\":e[t]=.5*(n[o]+1)*255,t++;break;case\"8uint\":e[t]=n[o],t++;break;case\"8sint\":e[t]=n[o]+127,t++;break;case\"16uint\":new Uint16Array(e.buffer,t,1)[0]=n[o],t+=2;break;case\"16sint\":new Int16Array(e.buffer,t,1)[0]=n[o],t+=2;break;case\"16float\":{let s=nFt(n[o]);new Uint16Array(e.buffer,t,1)[0]=s,t+=2;break}case\"32uint\":new Uint32Array(e.buffer,t,1)[0]=n[o],t+=4;break;case\"32sint\":new Int32Array(e.buffer,t,1)[0]=n[o],t+=4;break;case\"32float\":new Float32Array(e.buffer,t,1)[0]=n[o],t+=4}return n}var oH={r8unorm:{bytesPerBlock:1,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r8snorm:{bytesPerBlock:1,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r8uint:{bytesPerBlock:1,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r8sint:{bytesPerBlock:1,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},rg8unorm:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg8snorm:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg8uint:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg8sint:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rgba8unorm:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},\"rgba8unorm-srgb\":{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba8snorm:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba8uint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba8sint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},bgra8unorm:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},\"bgra8unorm-srgb\":{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},r16uint:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r16sint:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r16float:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},rg16uint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg16sint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg16float:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rgba16uint:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba16sint:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba16float:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},r32uint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r32sint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},r32float:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:1},rg32uint:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg32sint:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rg32float:{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,channels:2},rgba32uint:{bytesPerBlock:16,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba32sint:{bytesPerBlock:16,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgba32float:{bytesPerBlock:16,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgb10a2uint:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rgb10a2unorm:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},rg11b10ufloat:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},stencil8:{bytesPerBlock:1,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!1,hasStencil:!0,channels:1},depth16unorm:{bytesPerBlock:2,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!0,hasStencil:!1,channels:1},depth24plus:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!0,hasStencil:!1,depthOnlyFormat:\"depth32float\",channels:1},\"depth24plus-stencil8\":{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!0,hasStencil:!0,depthOnlyFormat:\"depth32float\",channels:1},depth32float:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!0,hasStencil:!1,channels:1},\"depth32float-stencil8\":{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!1,isDepthStencil:!0,hasDepth:!0,hasStencil:!0,stencilOnlyFormat:\"depth32float\",channels:1},rgb9e5ufloat:{bytesPerBlock:4,blockWidth:1,blockHeight:1,isCompressed:!1,channels:4},\"bc1-rgba-unorm\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc1-rgba-unorm-srgb\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc2-rgba-unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc2-rgba-unorm-srgb\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc3-rgba-unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc3-rgba-unorm-srgb\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc4-r-unorm\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:1},\"bc4-r-snorm\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:1},\"bc5-rg-unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:2},\"bc5-rg-snorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:2},\"bc6h-rgb-ufloat\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc6h-rgb-float\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc7-rgba-unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"bc7-rgba-unorm-srgb\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgb8unorm\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgb8unorm-srgb\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgb8a1unorm\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgb8a1unorm-srgb\":{bytesPerBlock:8,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgba8unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"etc2-rgba8unorm-srgb\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"eac-r11unorm\":{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!0,channels:1},\"eac-r11snorm\":{bytesPerBlock:8,blockWidth:1,blockHeight:1,isCompressed:!0,channels:1},\"eac-rg11unorm\":{bytesPerBlock:16,blockWidth:1,blockHeight:1,isCompressed:!0,channels:2},\"eac-rg11snorm\":{bytesPerBlock:16,blockWidth:1,blockHeight:1,isCompressed:!0,channels:2},\"astc-4x4-unorm\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"astc-4x4-unorm-srgb\":{bytesPerBlock:16,blockWidth:4,blockHeight:4,isCompressed:!0,channels:4},\"astc-5x4-unorm\":{bytesPerBlock:16,blockWidth:5,blockHeight:4,isCompressed:!0,channels:4},\"astc-5x4-unorm-srgb\":{bytesPerBlock:16,blockWidth:5,blockHeight:4,isCompressed:!0,channels:4},\"astc-5x5-unorm\":{bytesPerBlock:16,blockWidth:5,blockHeight:5,isCompressed:!0,channels:4},\"astc-5x5-unorm-srgb\":{bytesPerBlock:16,blockWidth:5,blockHeight:5,isCompressed:!0,channels:4},\"astc-6x5-unorm\":{bytesPerBlock:16,blockWidth:6,blockHeight:5,isCompressed:!0,channels:4},\"astc-6x5-unorm-srgb\":{bytesPerBlock:16,blockWidth:6,blockHeight:5,isCompressed:!0,channels:4},\"astc-6x6-unorm\":{bytesPerBlock:16,blockWidth:6,blockHeight:6,isCompressed:!0,channels:4},\"astc-6x6-unorm-srgb\":{bytesPerBlock:16,blockWidth:6,blockHeight:6,isCompressed:!0,channels:4},\"astc-8x5-unorm\":{bytesPerBlock:16,blockWidth:8,blockHeight:5,isCompressed:!0,channels:4},\"astc-8x5-unorm-srgb\":{bytesPerBlock:16,blockWidth:8,blockHeight:5,isCompressed:!0,channels:4},\"astc-8x6-unorm\":{bytesPerBlock:16,blockWidth:8,blockHeight:6,isCompressed:!0,channels:4},\"astc-8x6-unorm-srgb\":{bytesPerBlock:16,blockWidth:8,blockHeight:6,isCompressed:!0,channels:4},\"astc-8x8-unorm\":{bytesPerBlock:16,blockWidth:8,blockHeight:8,isCompressed:!0,channels:4},\"astc-8x8-unorm-srgb\":{bytesPerBlock:16,blockWidth:8,blockHeight:8,isCompressed:!0,channels:4},\"astc-10x5-unorm\":{bytesPerBlock:16,blockWidth:10,blockHeight:5,isCompressed:!0,channels:4},\"astc-10x5-unorm-srgb\":{bytesPerBlock:16,blockWidth:10,blockHeight:5,isCompressed:!0,channels:4},\"astc-10x6-unorm\":{bytesPerBlock:16,blockWidth:10,blockHeight:6,isCompressed:!0,channels:4},\"astc-10x6-unorm-srgb\":{bytesPerBlock:16,blockWidth:10,blockHeight:6,isCompressed:!0,channels:4},\"astc-10x8-unorm\":{bytesPerBlock:16,blockWidth:10,blockHeight:8,isCompressed:!0,channels:4},\"astc-10x8-unorm-srgb\":{bytesPerBlock:16,blockWidth:10,blockHeight:8,isCompressed:!0,channels:4},\"astc-10x10-unorm\":{bytesPerBlock:16,blockWidth:10,blockHeight:10,isCompressed:!0,channels:4},\"astc-10x10-unorm-srgb\":{bytesPerBlock:16,blockWidth:10,blockHeight:10,isCompressed:!0,channels:4},\"astc-12x10-unorm\":{bytesPerBlock:16,blockWidth:12,blockHeight:10,isCompressed:!0,channels:4},\"astc-12x10-unorm-srgb\":{bytesPerBlock:16,blockWidth:12,blockHeight:10,isCompressed:!0,channels:4},\"astc-12x12-unorm\":{bytesPerBlock:16,blockWidth:12,blockHeight:12,isCompressed:!0,channels:4},\"astc-12x12-unorm-srgb\":{bytesPerBlock:16,blockWidth:12,blockHeight:12,isCompressed:!0,channels:4}},Ed=class e{constructor(){this.id=e._id++,this.line=0}get isAstNode(){return!0}get astNodeType(){return\"\"}search(t){t(this)}searchBlock(t,r){if(t){r(m3.instance);for(let i of t)i instanceof Array?this.searchBlock(i,r):i.search(r);r(g3.instance)}}constEvaluate(t,r){throw new Error(\"Cannot evaluate node\")}constEvaluateString(t){return this.constEvaluate(t).toString()}};Ed._id=0;var m3=class extends Ed{};m3.instance=new m3;var g3=class extends Ed{};g3.instance=new g3;var opt=new Set([\"all\",\"all\",\"any\",\"select\",\"arrayLength\",\"abs\",\"acos\",\"acosh\",\"asin\",\"asinh\",\"atan\",\"atanh\",\"atan2\",\"ceil\",\"clamp\",\"cos\",\"cosh\",\"countLeadingZeros\",\"countOneBits\",\"countTrailingZeros\",\"cross\",\"degrees\",\"determinant\",\"distance\",\"dot\",\"dot4U8Packed\",\"dot4I8Packed\",\"exp\",\"exp2\",\"extractBits\",\"faceForward\",\"firstLeadingBit\",\"firstTrailingBit\",\"floor\",\"fma\",\"fract\",\"frexp\",\"insertBits\",\"inverseSqrt\",\"ldexp\",\"length\",\"log\",\"log2\",\"max\",\"min\",\"mix\",\"modf\",\"normalize\",\"pow\",\"quantizeToF16\",\"radians\",\"reflect\",\"refract\",\"reverseBits\",\"round\",\"saturate\",\"sign\",\"sin\",\"sinh\",\"smoothStep\",\"sqrt\",\"step\",\"tan\",\"tanh\",\"transpose\",\"trunc\",\"dpdx\",\"dpdxCoarse\",\"dpdxFine\",\"dpdy\",\"dpdyCoarse\",\"dpdyFine\",\"fwidth\",\"fwidthCoarse\",\"fwidthFine\",\"textureDimensions\",\"textureGather\",\"textureGatherCompare\",\"textureLoad\",\"textureNumLayers\",\"textureNumLevels\",\"textureNumSamples\",\"textureSample\",\"textureSampleBias\",\"textureSampleCompare\",\"textureSampleCompareLevel\",\"textureSampleGrad\",\"textureSampleLevel\",\"textureSampleBaseClampToEdge\",\"textureStore\",\"atomicLoad\",\"atomicStore\",\"atomicAdd\",\"atomicSub\",\"atomicMax\",\"atomicMin\",\"atomicAnd\",\"atomicOr\",\"atomicXor\",\"atomicExchange\",\"atomicCompareExchangeWeak\",\"pack4x8snorm\",\"pack4x8unorm\",\"pack4xI8\",\"pack4xU8\",\"pack4x8Clamp\",\"pack4xU8Clamp\",\"pack2x16snorm\",\"pack2x16unorm\",\"pack2x16float\",\"unpack4x8snorm\",\"unpack4x8unorm\",\"unpack4xI8\",\"unpack4xU8\",\"unpack2x16snorm\",\"unpack2x16unorm\",\"unpack2x16float\",\"storageBarrier\",\"textureBarrier\",\"workgroupBarrier\",\"workgroupUniformLoad\",\"subgroupAdd\",\"subgroupExclusiveAdd\",\"subgroupInclusiveAdd\",\"subgroupAll\",\"subgroupAnd\",\"subgroupAny\",\"subgroupBallot\",\"subgroupBroadcast\",\"subgroupBroadcastFirst\",\"subgroupElect\",\"subgroupMax\",\"subgroupMin\",\"subgroupMul\",\"subgroupExclusiveMul\",\"subgroupInclusiveMul\",\"subgroupOr\",\"subgroupShuffle\",\"subgroupShuffleDown\",\"subgroupShuffleUp\",\"subgroupShuffleXor\",\"subgroupXor\",\"quadBroadcast\",\"quadSwapDiagonal\",\"quadSwapX\",\"quadSwapY\"]),So=class extends Ed{constructor(){super()}},nb=class extends So{constructor(t,r,i,n,o,s){super(),this.calls=new Set,this.name=t,this.args=r,this.returnType=i,this.body=n,this.startLine=o,this.endLine=s}get astNodeType(){return\"function\"}search(t){if(this.attributes)for(let r of this.attributes)t(r);t(this);for(let r of this.args)t(r);this.searchBlock(this.body,t)}},fH=class extends So{constructor(t){super(),this.expression=t}get astNodeType(){return\"staticAssert\"}search(t){this.expression.search(t)}},WD=class extends So{constructor(t,r){super(),this.condition=t,this.body=r}get astNodeType(){return\"while\"}search(t){this.condition.search(t),this.searchBlock(this.body,t)}},kE=class extends So{constructor(t,r){super(),this.body=t,this.loopId=r}get astNodeType(){return\"continuing\"}search(t){this.searchBlock(this.body,t)}},qD=class extends So{constructor(t,r,i,n){super(),this.init=t,this.condition=r,this.increment=i,this.body=n}get astNodeType(){return\"for\"}search(t){var r,i,n;(r=this.init)===null||r===void 0||r.search(t),(i=this.condition)===null||i===void 0||i.search(t),(n=this.increment)===null||n===void 0||n.search(t),this.searchBlock(this.body,t)}},Nf=class extends So{constructor(t,r,i,n,o){super(),this.attributes=null,this.name=t,this.type=r,this.storage=i,this.access=n,this.value=o}get astNodeType(){return\"var\"}search(t){var r;t(this),(r=this.value)===null||r===void 0||r.search(t)}},RE=class extends So{constructor(t,r,i){super(),this.attributes=null,this.name=t,this.type=r,this.value=i}get astNodeType(){return\"override\"}search(t){var r;(r=this.value)===null||r===void 0||r.search(t)}},eb=class extends So{constructor(t,r,i,n,o){super(),this.attributes=null,this.name=t,this.type=r,this.storage=i,this.access=n,this.value=o}get astNodeType(){return\"let\"}search(t){var r;t(this),(r=this.value)===null||r===void 0||r.search(t)}},h3=class extends So{constructor(t,r,i,n,o){super(),this.attributes=null,this.name=t,this.type=r,this.storage=i,this.access=n,this.value=o}get astNodeType(){return\"const\"}constEvaluate(t,r){return this.value.constEvaluate(t,r)}search(t){var r;t(this),(r=this.value)===null||r===void 0||r.search(t)}},c3,CE,ge,ne;(e=>{e.increment=\"++\",e.decrement=\"--\"})(c3||(c3={})),(e=>{e.parse=function(t){let r=t;if(r==\"parse\")throw new Error(\"Invalid value for IncrementOperator\");return e[r]}})(c3||(c3={}));var HD=class extends So{constructor(t,r){super(),this.operator=t,this.variable=r}get astNodeType(){return\"increment\"}search(t){this.variable.search(t)}};(e=>{e.assign=\"=\",e.addAssign=\"+=\",e.subtractAssin=\"-=\",e.multiplyAssign=\"*=\",e.divideAssign=\"/=\",e.moduloAssign=\"%=\",e.andAssign=\"&=\",e.orAssign=\"|=\",e.xorAssign=\"^=\",e.shiftLeftAssign=\"<<=\",e.shiftRightAssign=\">>=\"})(CE||(CE={})),(e=>{e.parse=function(t){let r=t;if(r==\"parse\")throw new Error(\"Invalid value for AssignOperator\");return r}})(CE||(CE={}));var YD=class extends So{constructor(t,r,i){super(),this.operator=t,this.variable=r,this.value=i}get astNodeType(){return\"assign\"}search(t){this.variable.search(t),this.value.search(t)}},DE=class extends So{constructor(t,r){super(),this.name=t,this.args=r}get astNodeType(){return\"call\"}isBuiltin(){return opt.has(this.name)}search(t){for(let r of this.args)r.search(t);t(this)}},XD=class extends So{constructor(t,r){super(),this.body=t,this.continuing=r}get astNodeType(){return\"loop\"}search(t){var r;this.searchBlock(this.body,t),(r=this.continuing)===null||r===void 0||r.search(t)}},ZD=class extends So{constructor(t,r){super(),this.condition=t,this.cases=r}get astNodeType(){return\"switch\"}search(t){t(this);for(let r of this.cases)r.search(t)}},KD=class extends So{constructor(t,r,i,n){super(),this.condition=t,this.body=r,this.elseif=i,this.else=n}get astNodeType(){return\"if\"}search(t){this.condition.search(t),this.searchBlock(this.body,t),this.searchBlock(this.elseif,t),this.searchBlock(this.else,t)}},QD=class extends So{constructor(t){super(),this.value=t}get astNodeType(){return\"return\"}search(t){var r;(r=this.value)===null||r===void 0||r.search(t)}},pH=class extends So{constructor(t){super(),this.name=t}get astNodeType(){return\"enable\"}},mH=class extends So{constructor(t){super(),this.extensions=t}get astNodeType(){return\"requires\"}},JD=class extends So{constructor(t,r){super(),this.severity=t,this.rule=r}get astNodeType(){return\"diagnostic\"}},OE=class extends So{constructor(t,r){super(),this.name=t,this.type=r}get astNodeType(){return\"alias\"}},gH=class extends So{constructor(){super()}get astNodeType(){return\"discard\"}},tO=class extends So{constructor(){super(),this.condition=null,this.loopId=-1}get astNodeType(){return\"break\"}},eO=class extends So{constructor(){super(),this.loopId=-1}get astNodeType(){return\"continue\"}},Ne=class e extends So{constructor(t){super(),this.attributes=null,this.name=t}get astNodeType(){return\"type\"}get isStruct(){return!1}get isArray(){return!1}static maxFormatType(t){let r=t[0];if(r.name===\"f32\")return r;for(let i=1;i<t.length;++i){let n=e._priority.get(r.name);e._priority.get(t[i].name)<n&&(r=t[i])}return r.name===\"x32\"?e.i32:r}getTypeName(){return this.name}};Ne.x32=new Ne(\"x32\"),Ne.f32=new Ne(\"f32\"),Ne.i32=new Ne(\"i32\"),Ne.u32=new Ne(\"u32\"),Ne.f16=new Ne(\"f16\"),Ne.bool=new Ne(\"bool\"),Ne.void=new Ne(\"void\"),Ne._priority=new Map([[\"f32\",0],[\"f16\",1],[\"u32\",2],[\"i32\",3],[\"x32\",3]]);var rO=class extends Ne{constructor(t){super(t)}},Ff=class extends Ne{constructor(t,r,i,n){super(t),this.members=r,this.startLine=i,this.endLine=n}get astNodeType(){return\"struct\"}get isStruct(){return!0}getMemberIndex(t){for(let r=0;r<this.members.length;r++)if(this.members[r].name==t)return r;return-1}search(t){for(let r of this.members)t(r)}},ce=class extends Ne{constructor(t,r,i){super(t),this.format=r,this.access=i}get astNodeType(){return\"template\"}getTypeName(){let t=this.name;if(this.format!==null){if(t===\"vec2\"||t===\"vec3\"||t===\"vec4\"||t===\"mat2x2\"||t===\"mat2x3\"||t===\"mat2x4\"||t===\"mat3x2\"||t===\"mat3x3\"||t===\"mat3x4\"||t===\"mat4x2\"||t===\"mat4x3\"||t===\"mat4x4\"){if(this.format.name===\"f32\")return t+=\"f\",t;if(this.format.name===\"i32\")return t+=\"i\",t;if(this.format.name===\"u32\")return t+=\"u\",t;if(this.format.name===\"bool\")return t+=\"b\",t;if(this.format.name===\"f16\")return t+=\"h\",t}t+=`<${this.format.name}>`}else if(t===\"vec2\"||t===\"vec3\"||t===\"vec4\")return t;return t}};ce.vec2f=new ce(\"vec2\",Ne.f32,null),ce.vec3f=new ce(\"vec3\",Ne.f32,null),ce.vec4f=new ce(\"vec4\",Ne.f32,null),ce.vec2i=new ce(\"vec2\",Ne.i32,null),ce.vec3i=new ce(\"vec3\",Ne.i32,null),ce.vec4i=new ce(\"vec4\",Ne.i32,null),ce.vec2u=new ce(\"vec2\",Ne.u32,null),ce.vec3u=new ce(\"vec3\",Ne.u32,null),ce.vec4u=new ce(\"vec4\",Ne.u32,null),ce.vec2h=new ce(\"vec2\",Ne.f16,null),ce.vec3h=new ce(\"vec3\",Ne.f16,null),ce.vec4h=new ce(\"vec4\",Ne.f16,null),ce.vec2b=new ce(\"vec2\",Ne.bool,null),ce.vec3b=new ce(\"vec3\",Ne.bool,null),ce.vec4b=new ce(\"vec4\",Ne.bool,null),ce.mat2x2f=new ce(\"mat2x2\",Ne.f32,null),ce.mat2x3f=new ce(\"mat2x3\",Ne.f32,null),ce.mat2x4f=new ce(\"mat2x4\",Ne.f32,null),ce.mat3x2f=new ce(\"mat3x2\",Ne.f32,null),ce.mat3x3f=new ce(\"mat3x3\",Ne.f32,null),ce.mat3x4f=new ce(\"mat3x4\",Ne.f32,null),ce.mat4x2f=new ce(\"mat4x2\",Ne.f32,null),ce.mat4x3f=new ce(\"mat4x3\",Ne.f32,null),ce.mat4x4f=new ce(\"mat4x4\",Ne.f32,null),ce.mat2x2h=new ce(\"mat2x2\",Ne.f16,null),ce.mat2x3h=new ce(\"mat2x3\",Ne.f16,null),ce.mat2x4h=new ce(\"mat2x4\",Ne.f16,null),ce.mat3x2h=new ce(\"mat3x2\",Ne.f16,null),ce.mat3x3h=new ce(\"mat3x3\",Ne.f16,null),ce.mat3x4h=new ce(\"mat3x4\",Ne.f16,null),ce.mat4x2h=new ce(\"mat4x2\",Ne.f16,null),ce.mat4x3h=new ce(\"mat4x3\",Ne.f16,null),ce.mat4x4h=new ce(\"mat4x4\",Ne.f16,null),ce.mat2x2i=new ce(\"mat2x2\",Ne.i32,null),ce.mat2x3i=new ce(\"mat2x3\",Ne.i32,null),ce.mat2x4i=new ce(\"mat2x4\",Ne.i32,null),ce.mat3x2i=new ce(\"mat3x2\",Ne.i32,null),ce.mat3x3i=new ce(\"mat3x3\",Ne.i32,null),ce.mat3x4i=new ce(\"mat3x4\",Ne.i32,null),ce.mat4x2i=new ce(\"mat4x2\",Ne.i32,null),ce.mat4x3i=new ce(\"mat4x3\",Ne.i32,null),ce.mat4x4i=new ce(\"mat4x4\",Ne.i32,null),ce.mat2x2u=new ce(\"mat2x2\",Ne.u32,null),ce.mat2x3u=new ce(\"mat2x3\",Ne.u32,null),ce.mat2x4u=new ce(\"mat2x4\",Ne.u32,null),ce.mat3x2u=new ce(\"mat3x2\",Ne.u32,null),ce.mat3x3u=new ce(\"mat3x3\",Ne.u32,null),ce.mat3x4u=new ce(\"mat3x4\",Ne.u32,null),ce.mat4x2u=new ce(\"mat4x2\",Ne.u32,null),ce.mat4x3u=new ce(\"mat4x3\",Ne.u32,null),ce.mat4x4u=new ce(\"mat4x4\",Ne.u32,null);var d3=class extends Ne{constructor(t,r,i,n){super(t),this.storage=r,this.type=i,this.access=n}get astNodeType(){return\"pointer\"}},rb=class extends Ne{constructor(t,r,i,n){super(t),this.attributes=r,this.format=i,this.count=n}get astNodeType(){return\"array\"}get isArray(){return!0}},tb=class extends Ne{constructor(t,r,i){super(t),this.format=r,this.access=i}get astNodeType(){return\"sampler\"}},yh=class extends Ed{constructor(){super(),this.postfix=null}},Cg=class extends yh{constructor(t){super(),this.value=t}get astNodeType(){return\"stringExpr\"}toString(){return this.value}constEvaluateString(){return this.value}},Md=class extends yh{constructor(t,r){super(),this.type=t,this.args=r}get astNodeType(){return\"createExpr\"}search(t){if(t(this),this.args)for(let r of this.args)r.search(t)}constEvaluate(t,r){return r&&(r[0]=this.type),t.evalExpression(this,t.context)}},LE=class extends yh{constructor(t,r){super(),this.cachedReturnValue=null,this.name=t,this.args=r}get astNodeType(){return\"callExpr\"}setCachedReturnValue(t){this.cachedReturnValue=t}get isBuiltin(){return opt.has(this.name)}constEvaluate(t,r){return t.evalExpression(this,t.context)}search(t){for(let r of this.args)r.search(t);t(this)}},Oc=class extends yh{constructor(t){super(),this.name=t}get astNodeType(){return\"varExpr\"}search(t){t(this),this.postfix&&this.postfix.search(t)}constEvaluate(t,r){return t.evalExpression(this,t.context)}},iO=class extends yh{constructor(t,r){super(),this.name=t,this.initializer=r}get astNodeType(){return\"constExpr\"}constEvaluate(t,r){if(this.initializer){let i=t.evalExpression(this.initializer,t.context);return i!==null&&this.postfix?i.getSubData(t,this.postfix,t.context):i}return null}search(t){this.initializer.search(t)}},js=class extends yh{constructor(t,r){super(),this.value=t,this.type=r}get astNodeType(){return\"literalExpr\"}constEvaluate(t,r){return r!==void 0&&(r[0]=this.type),this.value}get isScalar(){return this.value instanceof oe}get isVector(){return this.value instanceof Vt||this.value instanceof ui}get scalarValue(){return this.value instanceof oe?this.value.value:(console.error(\"Value is not scalar.\"),0)}get vectorValue(){return this.value instanceof Vt||this.value instanceof ui?this.value.data:(console.error(\"Value is not a vector or matrix.\"),new Float32Array(0))}},nO=class extends yh{constructor(t,r){super(),this.type=t,this.value=r}get astNodeType(){return\"bitcastExpr\"}search(t){this.value.search(t)}};var l1=class extends yh{constructor(t){super(),this.index=t}search(t){this.index.search(t)}},oO=class extends yh{constructor(){super()}},_s=class extends oO{constructor(t,r){super(),this.operator=t,this.right=r}get astNodeType(){return\"unaryOp\"}constEvaluate(t,r){return t.evalExpression(this,t.context)}search(t){this.right.search(t)}},Ah=class extends oO{constructor(t,r,i){super(),this.operator=t,this.left=r,this.right=i}get astNodeType(){return\"binaryOp\"}_getPromotedType(t,r){return t.name===r.name?t:t.name===\"f32\"||r.name===\"f32\"?Ne.f32:t.name===\"u32\"||r.name===\"u32\"?Ne.u32:Ne.i32}constEvaluate(t,r){return t.evalExpression(this,t.context)}search(t){this.left.search(t),this.right.search(t)}},sO=class extends Ed{constructor(t){super(),this.body=t}search(t){t(this),this.searchBlock(this.body,t)}},f3=class extends yh{constructor(){super()}get astNodeType(){return\"default\"}},aO=class extends sO{constructor(t,r){super(r),this.selectors=t}get astNodeType(){return\"case\"}search(t){this.searchBlock(this.body,t)}},lO=class extends sO{constructor(t){super(t)}get astNodeType(){return\"default\"}search(t){this.searchBlock(this.body,t)}},cO=class extends Ed{constructor(t,r,i){super(),this.name=t,this.type=r,this.attributes=i}get astNodeType(){return\"argument\"}},AH=class extends Ed{constructor(t,r){super(),this.condition=t,this.body=r}get astNodeType(){return\"elseif\"}search(t){this.condition.search(t),this.searchBlock(this.body,t)}},uO=class extends Ed{constructor(t,r,i){super(),this.name=t,this.type=r,this.attributes=i}get astNodeType(){return\"member\"}},hO=class extends Ed{constructor(t,r){super(),this.name=t,this.value=r}get astNodeType(){return\"attribute\"}},Pd=class e{constructor(t,r){this.parent=null,this.typeInfo=t,this.parent=r,this.id=e._id++}clone(){throw`Clone: Not implemented for ${this.constructor.name}`}setDataValue(t,r,i,n){console.error(`SetDataValue: Not implemented for ${this.constructor.name}`)}getSubData(t,r,i){return console.error(`GetDataValue: Not implemented for ${this.constructor.name}`),null}toString(){return`<${this.typeInfo.getTypeName()}>`}};Pd._id=0;var BE=class extends Pd{constructor(){super(new bu(\"void\",null),null)}toString(){return\"void\"}};BE.void=new BE;var a1=class extends Pd{constructor(t){super(new IE(\"pointer\",t.typeInfo,null),null),this.reference=t}clone(){return this}setDataValue(t,r,i,n){this.reference.setDataValue(t,r,i,n)}getSubData(t,r,i){return r?this.reference.getSubData(t,r,i):this}toString(){return`&${this.reference.toString()}`}},oe=class e extends Pd{constructor(t,r,i=null){super(r,i),t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array?this.data=t:this.typeInfo.name===\"x32\"?t-Math.floor(t)!==0?this.data=new Float32Array([t]):this.data=t>=0?new Uint32Array([t]):new Int32Array([t]):this.typeInfo.name===\"i32\"||this.typeInfo.name===\"bool\"?this.data=new Int32Array([t]):this.typeInfo.name===\"u32\"?this.data=new Uint32Array([t]):this.typeInfo.name===\"f32\"||this.typeInfo.name===\"f16\"?this.data=new Float32Array([t]):console.error(\"ScalarData2: Invalid type\",r)}clone(){if(this.data instanceof Float32Array)return new e(new Float32Array(this.data),this.typeInfo,null);if(this.data instanceof Int32Array)return new e(new Int32Array(this.data),this.typeInfo,null);if(this.data instanceof Uint32Array)return new e(new Uint32Array(this.data),this.typeInfo,null);throw\"ScalarData: Invalid data type\"}get value(){return this.data[0]}set value(t){this.data[0]=t}setDataValue(t,r,i,n){if(i)return void console.error(\"SetDataValue: Scalar data does not support postfix\",i);if(!(r instanceof e))return void console.error(\"SetDataValue: Invalid value\",r);let o=r.data[0];this.typeInfo.name===\"i32\"||this.typeInfo.name===\"u32\"?o=Math.floor(o):this.typeInfo.name===\"bool\"&&(o=o?1:0),this.data[0]=o}getSubData(t,r,i){return r?(console.error(\"getSubData: Scalar data does not support postfix\",r),null):this}toString(){return`${this.value}`}};function sFt(e,t,r){let i=t.length;return i===2?r===\"f32\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec2f\")):r===\"i32\"||r===\"bool\"?new Vt(new Int32Array(t),e.getTypeInfo(\"vec2i\")):r===\"u32\"?new Vt(new Uint32Array(t),e.getTypeInfo(\"vec2u\")):r===\"f16\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec2h\")):(console.error(`getSubData: Unknown format ${r}`),null):i===3?r===\"f32\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec3f\")):r===\"i32\"||r===\"bool\"?new Vt(new Int32Array(t),e.getTypeInfo(\"vec3i\")):r===\"u32\"?new Vt(new Uint32Array(t),e.getTypeInfo(\"vec3u\")):r===\"f16\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec3h\")):(console.error(`getSubData: Unknown format ${r}`),null):i===4?r===\"f32\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec4f\")):r===\"i32\"||r===\"bool\"?new Vt(new Int32Array(t),e.getTypeInfo(\"vec4i\")):r===\"u32\"?new Vt(new Uint32Array(t),e.getTypeInfo(\"vec4u\")):r===\"f16\"?new Vt(new Float32Array(t),e.getTypeInfo(\"vec4h\")):(console.error(`getSubData: Unknown format ${r}`),null):(console.error(`getSubData: Invalid vector size ${t.length}`),null)}var Vt=class e extends Pd{constructor(t,r,i=null){if(super(r,i),t instanceof Float32Array||t instanceof Uint32Array||t instanceof Int32Array)this.data=t;else{let n=this.typeInfo.name;n===\"vec2f\"||n===\"vec3f\"||n===\"vec4f\"?this.data=new Float32Array(t):n===\"vec2i\"||n===\"vec3i\"||n===\"vec4i\"?this.data=new Int32Array(t):n===\"vec2u\"||n===\"vec3u\"||n===\"vec4u\"?this.data=new Uint32Array(t):n===\"vec2h\"||n===\"vec3h\"||n===\"vec4h\"?this.data=new Float32Array(t):n===\"vec2b\"||n===\"vec3b\"||n===\"vec4b\"?this.data=new Int32Array(t):n===\"vec2\"||n===\"vec3\"||n===\"vec4\"?this.data=new Float32Array(t):console.error(`VectorData: Invalid type ${n}`)}}clone(){if(this.data instanceof Float32Array)return new e(new Float32Array(this.data),this.typeInfo,null);if(this.data instanceof Int32Array)return new e(new Int32Array(this.data),this.typeInfo,null);if(this.data instanceof Uint32Array)return new e(new Uint32Array(this.data),this.typeInfo,null);throw\"VectorData: Invalid data type\"}setDataValue(t,r,i,n){i instanceof Cg?console.error(\"TODO: Set vector postfix\"):r instanceof e?this.data=r.data:console.error(\"SetDataValue: Invalid value\",r)}getSubData(t,r,i){if(r===null)return this;let n=t.getTypeInfo(\"f32\");if(this.typeInfo instanceof Pg)n=this.typeInfo.format||n;else{let s=this.typeInfo.name;s===\"vec2f\"||s===\"vec3f\"||s===\"vec4f\"?n=t.getTypeInfo(\"f32\"):s===\"vec2i\"||s===\"vec3i\"||s===\"vec4i\"?n=t.getTypeInfo(\"i32\"):s===\"vec2b\"||s===\"vec3b\"||s===\"vec4b\"?n=t.getTypeInfo(\"bool\"):s===\"vec2u\"||s===\"vec3u\"||s===\"vec4u\"?n=t.getTypeInfo(\"u32\"):s===\"vec2h\"||s===\"vec3h\"||s===\"vec4h\"?n=t.getTypeInfo(\"f16\"):console.error(`GetSubData: Unknown type ${s}`)}let o=this;for(;r!==null&&o!==null;){if(r instanceof l1){let s=r.index,a=-1;if(s instanceof js){if(!(s.value instanceof oe))return console.error(`GetSubData: Invalid array index ${s.value}`),null;a=s.value.value}else{let h=t.evalExpression(s,i);if(!(h instanceof oe))return console.error(\"GetSubData: Unknown index type\",s),null;a=h.value}if(a<0||a>=o.data.length)return console.error(\"GetSubData: Index out of range\",a),null;if(o.data instanceof Float32Array){let h=new Float32Array(o.data.buffer,o.data.byteOffset+4*a,1);return new oe(h,n)}if(o.data instanceof Int32Array){let h=new Int32Array(o.data.buffer,o.data.byteOffset+4*a,1);return new oe(h,n)}if(o.data instanceof Uint32Array){let h=new Uint32Array(o.data.buffer,o.data.byteOffset+4*a,1);return new oe(h,n)}throw\"GetSubData: Invalid data type\"}if(!(r instanceof Cg))return console.error(\"GetSubData: Unknown postfix\",r),null;{let s=r.value.toLowerCase();if(s.length===1){let h=0;if(s===\"x\"||s===\"r\")h=0;else if(s===\"y\"||s===\"g\")h=1;else if(s===\"z\"||s===\"b\")h=2;else{if(s!==\"w\"&&s!==\"a\")return console.error(`GetSubData: Unknown member ${s}`),null;h=3}if(this.data instanceof Float32Array){let p=new Float32Array(this.data.buffer,this.data.byteOffset+4*h,1);return new oe(p,n,this)}if(this.data instanceof Int32Array){let p=new Int32Array(this.data.buffer,this.data.byteOffset+4*h,1);return new oe(p,n,this)}if(this.data instanceof Uint32Array){let p=new Uint32Array(this.data.buffer,this.data.byteOffset+4*h,1);return new oe(p,n,this)}}let a=[];for(let h of s)h===\"x\"||h===\"r\"?a.push(this.data[0]):h===\"y\"||h===\"g\"?a.push(this.data[1]):h===\"z\"||h===\"b\"?a.push(this.data[2]):h===\"w\"||h===\"a\"?a.push(this.data[3]):console.error(`GetDataValue: Unknown member ${h}`);o=sFt(t,a,n.name)}r=r.postfix}return o}toString(){let t=`${this.data[0]}`;for(let r=1;r<this.data.length;++r)t+=`, ${this.data[r]}`;return t}},ui=class e extends Pd{constructor(t,r,i=null){super(r,i),t instanceof Float32Array?this.data=t:this.data=new Float32Array(t)}clone(){return new e(new Float32Array(this.data),this.typeInfo,null)}setDataValue(t,r,i,n){i instanceof Cg?console.error(\"TODO: Set matrix postfix\"):r instanceof e?this.data=r.data:console.error(\"SetDataValue: Invalid value\",r)}getSubData(t,r,i){if(r===null)return this;let n=this.typeInfo.name;if(t.getTypeInfo(\"f32\"),this.typeInfo instanceof Pg)this.typeInfo.format;else if(n.endsWith(\"f\"))t.getTypeInfo(\"f32\");else if(n.endsWith(\"i\"))t.getTypeInfo(\"i32\");else if(n.endsWith(\"u\"))t.getTypeInfo(\"u32\");else{if(!n.endsWith(\"h\"))return console.error(`GetDataValue: Unknown type ${n}`),null;t.getTypeInfo(\"f16\")}if(r instanceof l1){let o=r.index,s=-1;if(o instanceof js){if(!(o.value instanceof oe))return console.error(`GetDataValue: Invalid array index ${o.value}`),null;s=o.value.value}else{let p=t.evalExpression(o,i);if(!(p instanceof oe))return console.error(\"GetDataValue: Unknown index type\",o),null;s=p.value}if(s<0||s>=this.data.length)return console.error(\"GetDataValue: Index out of range\",s),null;let a=n.endsWith(\"h\")?\"h\":\"f\",h;if(n===\"mat2x2\"||n===\"mat2x2f\"||n===\"mat2x2h\"||n===\"mat3x2\"||n===\"mat3x2f\"||n===\"mat3x2h\"||n===\"mat4x2\"||n===\"mat4x2f\"||n===\"mat4x2h\")h=new Vt(new Float32Array(this.data.buffer,this.data.byteOffset+2*s*4,2),t.getTypeInfo(`vec2${a}`));else if(n===\"mat2x3\"||n===\"mat2x3f\"||n===\"mat2x3h\"||n===\"mat3x3\"||n===\"mat3x3f\"||n===\"mat3x3h\"||n===\"mat4x3\"||n===\"mat4x3f\"||n===\"mat4x3h\")h=new Vt(new Float32Array(this.data.buffer,this.data.byteOffset+3*s*4,3),t.getTypeInfo(`vec3${a}`));else{if(n!==\"mat2x4\"&&n!==\"mat2x4f\"&&n!==\"mat2x4h\"&&n!==\"mat3x4\"&&n!==\"mat3x4f\"&&n!==\"mat3x4h\"&&n!==\"mat4x4\"&&n!==\"mat4x4f\"&&n!==\"mat4x4h\")return console.error(`GetDataValue: Unknown type ${n}`),null;h=new Vt(new Float32Array(this.data.buffer,this.data.byteOffset+4*s*4,4),t.getTypeInfo(`vec4${a}`))}return r.postfix?h.getSubData(t,r.postfix,i):h}return console.error(\"GetDataValue: Invalid postfix\",r),null}toString(){let t=`${this.data[0]}`;for(let r=1;r<this.data.length;++r)t+=`, ${this.data[r]}`;return t}},pa=class e extends Pd{constructor(t,r,i=0,n=null){super(r,n),this.buffer=t instanceof ArrayBuffer?t:t.buffer,this.offset=i}clone(){let t=new Uint8Array(new Uint8Array(this.buffer,this.offset,this.typeInfo.size));return new e(t.buffer,this.typeInfo,0,null)}setDataValue(t,r,i,n){if(r===null)return void console.log(\"setDataValue: NULL data.\");let o=this.offset,s=this.typeInfo;for(;i;){if(i instanceof l1)if(s instanceof A0){let a=i.index;if(a instanceof js){if(!(a.value instanceof oe))return void console.error(`SetDataValue: Invalid index type ${a.value}`);o+=a.value.value*s.stride}else{let h=t.evalExpression(a,n);if(!(h instanceof oe))return void console.error(\"SetDataValue: Unknown index type\",a);o+=h.value*s.stride}s=s.format}else console.error(`SetDataValue: Type ${s.getTypeName()} is not an array`);else{if(!(i instanceof Cg))return void console.error(\"SetDataValue: Unknown postfix type\",i);{let a=i.value;if(s instanceof g0){let h=!1;for(let p of s.members)if(p.name===a){o+=p.offset,s=p.type,h=!0;break}if(!h)return void console.error(`SetDataValue: Member ${a} not found`)}else if(s instanceof bu){let h=s.getTypeName(),p=0;if(a===\"x\"||a===\"r\")p=0;else if(a===\"y\"||a===\"g\")p=1;else if(a===\"z\"||a===\"b\")p=2;else{if(a!==\"w\"&&a!==\"a\")return void console.error(`SetDataValue: Unknown member ${a}`);p=3}if(!(r instanceof oe))return void console.error(\"SetDataValue: Invalid value\",r);let g=r.value;return h===\"vec2f\"?void(new Float32Array(this.buffer,o,2)[p]=g):h===\"vec3f\"?void(new Float32Array(this.buffer,o,3)[p]=g):h===\"vec4f\"?void(new Float32Array(this.buffer,o,4)[p]=g):h===\"vec2i\"?void(new Int32Array(this.buffer,o,2)[p]=g):h===\"vec3i\"?void(new Int32Array(this.buffer,o,3)[p]=g):h===\"vec4i\"?void(new Int32Array(this.buffer,o,4)[p]=g):h===\"vec2u\"?void(new Uint32Array(this.buffer,o,2)[p]=g):h===\"vec3u\"?void(new Uint32Array(this.buffer,o,3)[p]=g):h===\"vec4u\"?void(new Uint32Array(this.buffer,o,4)[p]=g):void console.error(`SetDataValue: Type ${h} is not a struct`)}}}i=i.postfix}this.setData(t,r,s,o,n)}setData(t,r,i,n,o){let s=i.getTypeName();if(s!==\"f32\"&&s!==\"f16\")if(s!==\"i32\"&&s!==\"atomic<i32>\"&&s!==\"x32\")if(s!==\"u32\"&&s!==\"atomic<u32>\")if(s!==\"bool\"){if(s===\"vec2f\"||s===\"vec2h\"){let a=new Float32Array(this.buffer,n,2);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1]):(a[0]=r[0],a[1]=r[1]))}if(s===\"vec3f\"||s===\"vec3h\"){let a=new Float32Array(this.buffer,n,3);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2]):(a[0]=r[0],a[1]=r[1],a[2]=r[2]))}if(s===\"vec4f\"||s===\"vec4h\"){let a=new Float32Array(this.buffer,n,4);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3]))}if(s===\"vec2i\"){let a=new Int32Array(this.buffer,n,2);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1]):(a[0]=r[0],a[1]=r[1]))}if(s===\"vec3i\"){let a=new Int32Array(this.buffer,n,3);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2]):(a[0]=r[0],a[1]=r[1],a[2]=r[2]))}if(s===\"vec4i\"){let a=new Int32Array(this.buffer,n,4);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3]))}if(s===\"vec2u\"){let a=new Uint32Array(this.buffer,n,2);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1]):(a[0]=r[0],a[1]=r[1]))}if(s===\"vec3u\"){let a=new Uint32Array(this.buffer,n,3);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2]):(a[0]=r[0],a[1]=r[1],a[2]=r[2]))}if(s===\"vec4u\"){let a=new Uint32Array(this.buffer,n,4);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3]))}if(s===\"vec2b\"){let a=new Uint32Array(this.buffer,n,2);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1]):(a[0]=r[0],a[1]=r[1]))}if(s===\"vec3b\"){let a=new Uint32Array(this.buffer,n,3);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2]):(a[0]=r[0],a[1]=r[1],a[2]=r[2]))}if(s===\"vec4b\"){let a=new Uint32Array(this.buffer,n,4);return void(r instanceof Vt?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3]))}if(s===\"mat2x2f\"||s===\"mat2x2h\"){let a=new Float32Array(this.buffer,n,4);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3]))}if(s===\"mat2x3f\"||s===\"mat2x3h\"){let a=new Float32Array(this.buffer,n,6);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5]))}if(s===\"mat2x4f\"||s===\"mat2x4h\"){let a=new Float32Array(this.buffer,n,8);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7]))}if(s===\"mat3x2f\"||s===\"mat3x2h\"){let a=new Float32Array(this.buffer,n,6);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5]))}if(s===\"mat3x3f\"||s===\"mat3x3h\"){let a=new Float32Array(this.buffer,n,9);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7],a[8]=r.data[8]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8]))}if(s===\"mat3x4f\"||s===\"mat3x4h\"){let a=new Float32Array(this.buffer,n,12);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7],a[8]=r.data[8],a[9]=r.data[9],a[10]=r.data[10],a[11]=r.data[11]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11]))}if(s===\"mat4x2f\"||s===\"mat4x2h\"){let a=new Float32Array(this.buffer,n,8);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7]))}if(s===\"mat4x3f\"||s===\"mat4x3h\"){let a=new Float32Array(this.buffer,n,12);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7],a[8]=r.data[8],a[9]=r.data[9],a[10]=r.data[10],a[11]=r.data[11]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11]))}if(s===\"mat4x4f\"||s===\"mat4x4h\"){let a=new Float32Array(this.buffer,n,16);return void(r instanceof ui?(a[0]=r.data[0],a[1]=r.data[1],a[2]=r.data[2],a[3]=r.data[3],a[4]=r.data[4],a[5]=r.data[5],a[6]=r.data[6],a[7]=r.data[7],a[8]=r.data[8],a[9]=r.data[9],a[10]=r.data[10],a[11]=r.data[11],a[12]=r.data[12],a[13]=r.data[13],a[14]=r.data[14],a[15]=r.data[15]):(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11],a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15]))}if(r instanceof e){if(i===r.typeInfo)return void new Uint8Array(this.buffer,n,r.buffer.byteLength).set(new Uint8Array(r.buffer));console.error(\"SetDataValue: Type mismatch\",s,r.typeInfo.getTypeName())}else console.error(`SetData: Unknown type ${s}`)}else r instanceof oe&&(new Int32Array(this.buffer,n,1)[0]=r.value);else r instanceof oe&&(new Uint32Array(this.buffer,n,1)[0]=r.value);else r instanceof oe&&(new Int32Array(this.buffer,n,1)[0]=r.value);else r instanceof oe&&(new Float32Array(this.buffer,n,1)[0]=r.value)}getSubData(t,r,i){var n,o,s;if(r===null)return this;let a=this.offset,h=this.typeInfo;for(;r;){if(r instanceof l1){let g=r.index,w=g instanceof yh?t.evalExpression(g,i):g,C=0;if(w instanceof oe?C=w.value:typeof w==\"number\"?C=w:console.error(\"GetDataValue: Invalid index type\",g),h instanceof A0)a+=C*h.stride,h=h.format;else{let R=h.getTypeName();R===\"mat4x4\"||R===\"mat4x4f\"||R===\"mat4x4h\"?(a+=16*C,h=t.getTypeInfo(\"vec4f\")):console.error(`getDataValue: Type ${h.getTypeName()} is not an array`)}}else{if(!(r instanceof Cg))return console.error(\"GetDataValue: Unknown postfix type\",r),null;{let g=r.value;if(h instanceof g0){let w=!1;for(let C of h.members)if(C.name===g){a+=C.offset,h=C.type,w=!0;break}if(!w)return console.error(`GetDataValue: Member ${g} not found`),null}else if(h instanceof bu){let w=h.getTypeName();if(w===\"vec2f\"||w===\"vec3f\"||w===\"vec4f\"||w===\"vec2i\"||w===\"vec3i\"||w===\"vec4i\"||w===\"vec2u\"||w===\"vec3u\"||w===\"vec4u\"||w===\"vec2b\"||w===\"vec3b\"||w===\"vec4b\"||w===\"vec2h\"||w===\"vec3h\"||w===\"vec4h\"||w===\"vec2\"||w===\"vec3\"||w===\"vec4\"){if(g.length>0&&g.length<5){let C=\"f\",R=[];for(let z=0;z<g.length;++z){let W=g[z].toLowerCase(),Y=0;if(W===\"x\"||W===\"r\")Y=0;else if(W===\"y\"||W===\"g\")Y=1;else if(W===\"z\"||W===\"b\")Y=2;else{if(W!==\"w\"&&W!==\"a\")return console.error(`Unknown member ${g}`),null;Y=3}if(g.length===1){if(w.endsWith(\"f\"))return this.buffer.byteLength<a+4*Y+4?(console.log(\"Insufficient buffer data\"),null):new oe(new Float32Array(this.buffer,a+4*Y,1),t.getTypeInfo(\"f32\"),this);if(w.endsWith(\"h\"))return new oe(new Float32Array(this.buffer,a+4*Y,1),t.getTypeInfo(\"f16\"),this);if(w.endsWith(\"i\"))return new oe(new Int32Array(this.buffer,a+4*Y,1),t.getTypeInfo(\"i32\"),this);if(w.endsWith(\"b\"))return new oe(new Int32Array(this.buffer,a+4*Y,1),t.getTypeInfo(\"bool\"),this);if(w.endsWith(\"u\"))return new oe(new Uint32Array(this.buffer,a+4*Y,1),t.getTypeInfo(\"i32\"),this)}if(w===\"vec2f\")R.push(new Float32Array(this.buffer,a,2)[Y]);else if(w===\"vec3f\"){if(a+12>=this.buffer.byteLength)return console.log(\"Insufficient buffer data\"),null;let H=new Float32Array(this.buffer,a,3);R.push(H[Y])}else if(w===\"vec4f\")R.push(new Float32Array(this.buffer,a,4)[Y]);else if(w===\"vec2i\")C=\"i\",R.push(new Int32Array(this.buffer,a,2)[Y]);else if(w===\"vec3i\")C=\"i\",R.push(new Int32Array(this.buffer,a,3)[Y]);else if(w===\"vec4i\")C=\"i\",R.push(new Int32Array(this.buffer,a,4)[Y]);else if(w===\"vec2u\"){C=\"u\";let H=new Uint32Array(this.buffer,a,2);R.push(H[Y])}else w===\"vec3u\"?(C=\"u\",R.push(new Uint32Array(this.buffer,a,3)[Y])):w===\"vec4u\"&&(C=\"u\",R.push(new Uint32Array(this.buffer,a,4)[Y]))}return R.length===2?h=t.getTypeInfo(`vec2${C}`):R.length===3?h=t.getTypeInfo(`vec3${C}`):R.length===4?h=t.getTypeInfo(`vec4${C}`):console.error(`GetDataValue: Invalid vector length ${R.length}`),new Vt(R,h,null)}return console.error(`GetDataValue: Unknown member ${g}`),null}return console.error(`GetDataValue: Type ${w} is not a struct`),null}}}r=r.postfix}let p=h.getTypeName();return p===\"f32\"?new oe(new Float32Array(this.buffer,a,1),h,this):p===\"i32\"?new oe(new Int32Array(this.buffer,a,1),h,this):p===\"u32\"?new oe(new Uint32Array(this.buffer,a,1),h,this):p===\"vec2f\"?new Vt(new Float32Array(this.buffer,a,2),h,this):p===\"vec3f\"?new Vt(new Float32Array(this.buffer,a,3),h,this):p===\"vec4f\"?new Vt(new Float32Array(this.buffer,a,4),h,this):p===\"vec2i\"?new Vt(new Int32Array(this.buffer,a,2),h,this):p===\"vec3i\"?new Vt(new Int32Array(this.buffer,a,3),h,this):p===\"vec4i\"?new Vt(new Int32Array(this.buffer,a,4),h,this):p===\"vec2u\"?new Vt(new Uint32Array(this.buffer,a,2),h,this):p===\"vec3u\"?new Vt(new Uint32Array(this.buffer,a,3),h,this):p===\"vec4u\"?new Vt(new Uint32Array(this.buffer,a,4),h,this):h instanceof Pg&&h.name===\"atomic\"?((n=h.format)===null||n===void 0?void 0:n.name)===\"u32\"?new oe(new Uint32Array(this.buffer,a,1)[0],h.format,this):((o=h.format)===null||o===void 0?void 0:o.name)===\"i32\"?new oe(new Int32Array(this.buffer,a,1)[0],h.format,this):(console.error(`GetDataValue: Invalid atomic format ${(s=h.format)===null||s===void 0?void 0:s.name}`),null):new e(this.buffer,h,a,this)}toString(){let t=\"\";if(this.typeInfo instanceof A0)if(this.typeInfo.format.name===\"f32\"){let r=new Float32Array(this.buffer,this.offset);t=`[${r[0]}`;for(let i=1;i<r.length;++i)t+=`, ${r[i]}`}else if(this.typeInfo.format.name===\"i32\"){let r=new Int32Array(this.buffer,this.offset);t=`[${r[0]}`;for(let i=1;i<r.length;++i)t+=`, ${r[i]}`}else if(this.typeInfo.format.name===\"u32\"){let r=new Uint32Array(this.buffer,this.offset);t=`[${r[0]}`;for(let i=1;i<r.length;++i)t+=`, ${r[i]}`}else if(this.typeInfo.format.name===\"vec2f\"){let r=new Float32Array(this.buffer,this.offset);t=`[${r[0]}, ${r[1]}]`;for(let i=1;i<r.length/2;++i)t+=`, [${r[2*i]}, ${r[2*i+1]}]`}else if(this.typeInfo.format.name===\"vec3f\"){let r=new Float32Array(this.buffer,this.offset);t=`[${r[0]}, ${r[1]}, ${r[2]}]`;for(let i=4;i<r.length;i+=4)t+=`, [${r[i]}, ${r[i+1]}, ${r[i+2]}]`}else if(this.typeInfo.format.name===\"vec4f\"){let r=new Float32Array(this.buffer,this.offset);t=`[${r[0]}, ${r[1]}, ${r[2]}, ${r[3]}]`;for(let i=4;i<r.length;i+=4)t+=`, [${r[i]}, ${r[i+1]}, ${r[i+2]}, ${r[i+3]}]`}else t=\"[...]\";else this.typeInfo instanceof g0?t+=\"{...}\":t=\"[...]\";return t}},Eg=class e extends Pd{constructor(t,r,i,n){super(r,null),this.data=t,this.descriptor=i,this.view=n}clone(){return new e(this.data,this.typeInfo,this.descriptor,this.view)}get width(){var t,r;let i=this.descriptor.size;return i instanceof Array&&i.length>0?(t=i[0])!==null&&t!==void 0?t:0:i instanceof Object&&(r=i.width)!==null&&r!==void 0?r:0}get height(){var t,r;let i=this.descriptor.size;return i instanceof Array&&i.length>1?(t=i[1])!==null&&t!==void 0?t:0:i instanceof Object&&(r=i.height)!==null&&r!==void 0?r:0}get depthOrArrayLayers(){var t,r;let i=this.descriptor.size;return i instanceof Array&&i.length>2?(t=i[2])!==null&&t!==void 0?t:0:i instanceof Object&&(r=i.depthOrArrayLayers)!==null&&r!==void 0?r:0}get format(){var t;return this.descriptor&&(t=this.descriptor.format)!==null&&t!==void 0?t:\"rgba8unorm\"}get sampleCount(){var t;return this.descriptor&&(t=this.descriptor.sampleCount)!==null&&t!==void 0?t:1}get mipLevelCount(){var t;return this.descriptor&&(t=this.descriptor.mipLevelCount)!==null&&t!==void 0?t:1}get dimension(){var t;return this.descriptor&&(t=this.descriptor.dimension)!==null&&t!==void 0?t:\"2d\"}getMipLevelSize(t){if(t>=this.mipLevelCount)return[0,0,0];let r=[this.width,this.height,this.depthOrArrayLayers];for(let i=0;i<r.length;++i)r[i]=Math.max(1,r[i]>>t);return r}get texelByteSize(){let t=this.format,r=oH[t];return r?r.isDepthStencil?4:r.bytesPerBlock:0}get bytesPerRow(){return this.width*this.texelByteSize}get isDepthStencil(){let t=this.format,r=oH[t];return!!r&&r.isDepthStencil}getGpuSize(){let t=this.format,r=oH[t],i=this.width;if(!t||i<=0||!r)return-1;let n=this.height,o=this.depthOrArrayLayers,s=this.dimension;return i/r.blockWidth*(s===\"1d\"?1:n/r.blockHeight)*r.bytesPerBlock*o}getPixel(t,r,i=0,n=0){let o=this.texelByteSize,s=this.bytesPerRow,a=this.height,h=this.data[n];return oFt(new Uint8Array(h),t,r,i,n,a,s,o,this.format)}setPixel(t,r,i,n,o){let s=this.texelByteSize,a=this.bytesPerRow,h=this.height,p=this.data[n];(function(g,w,C,R,z,W,Y,H,Q,tt){let rt=R*(Y>>=z)*(W>>=z)+C*Y+w*H;switch(Q){case\"r8unorm\":return void Dn(g,rt,\"8unorm\",1,tt);case\"r8snorm\":return void Dn(g,rt,\"8snorm\",1,tt);case\"r8uint\":return void Dn(g,rt,\"8uint\",1,tt);case\"r8sint\":return void Dn(g,rt,\"8sint\",1,tt);case\"rg8unorm\":return void Dn(g,rt,\"8unorm\",2,tt);case\"rg8snorm\":return void Dn(g,rt,\"8snorm\",2,tt);case\"rg8uint\":return void Dn(g,rt,\"8uint\",2,tt);case\"rg8sint\":return void Dn(g,rt,\"8sint\",2,tt);case\"rgba8unorm-srgb\":case\"rgba8unorm\":case\"bgra8unorm-srgb\":case\"bgra8unorm\":return void Dn(g,rt,\"8unorm\",4,tt);case\"rgba8snorm\":return void Dn(g,rt,\"8snorm\",4,tt);case\"rgba8uint\":return void Dn(g,rt,\"8uint\",4,tt);case\"rgba8sint\":return void Dn(g,rt,\"8sint\",4,tt);case\"r16uint\":return void Dn(g,rt,\"16uint\",1,tt);case\"r16sint\":return void Dn(g,rt,\"16sint\",1,tt);case\"r16float\":return void Dn(g,rt,\"16float\",1,tt);case\"rg16uint\":return void Dn(g,rt,\"16uint\",2,tt);case\"rg16sint\":return void Dn(g,rt,\"16sint\",2,tt);case\"rg16float\":return void Dn(g,rt,\"16float\",2,tt);case\"rgba16uint\":return void Dn(g,rt,\"16uint\",4,tt);case\"rgba16sint\":return void Dn(g,rt,\"16sint\",4,tt);case\"rgba16float\":return void Dn(g,rt,\"16float\",4,tt);case\"r32uint\":return void Dn(g,rt,\"32uint\",1,tt);case\"r32sint\":return void Dn(g,rt,\"32sint\",1,tt);case\"depth16unorm\":case\"depth24plus\":case\"depth24plus-stencil8\":case\"depth32float\":case\"depth32float-stencil8\":case\"r32float\":return void Dn(g,rt,\"32float\",1,tt);case\"rg32uint\":return void Dn(g,rt,\"32uint\",2,tt);case\"rg32sint\":return void Dn(g,rt,\"32sint\",2,tt);case\"rg32float\":return void Dn(g,rt,\"32float\",2,tt);case\"rgba32uint\":return void Dn(g,rt,\"32uint\",4,tt);case\"rgba32sint\":return void Dn(g,rt,\"32sint\",4,tt);case\"rgba32float\":return void Dn(g,rt,\"32float\",4,tt);case\"rg11b10ufloat\":console.error(\"TODO: rg11b10ufloat not supported for writing\")}})(new Uint8Array(p),t,r,i,n,h,a,s,this.format,o)}};(e=>{e[e.token=0]=\"token\",e[e.keyword=1]=\"keyword\",e[e.reserved=2]=\"reserved\"})(ne||(ne={}));var ie=class{constructor(t,r,i){this.name=t,this.type=r,this.rule=i}toString(){return this.name}},Lt=class{};ge=Lt,Lt.none=new ie(\"\",ne.reserved,\"\"),Lt.eof=new ie(\"EOF\",ne.token,\"\"),Lt.reserved={asm:new ie(\"asm\",ne.reserved,\"asm\"),bf16:new ie(\"bf16\",ne.reserved,\"bf16\"),do:new ie(\"do\",ne.reserved,\"do\"),enum:new ie(\"enum\",ne.reserved,\"enum\"),f16:new ie(\"f16\",ne.reserved,\"f16\"),f64:new ie(\"f64\",ne.reserved,\"f64\"),handle:new ie(\"handle\",ne.reserved,\"handle\"),i8:new ie(\"i8\",ne.reserved,\"i8\"),i16:new ie(\"i16\",ne.reserved,\"i16\"),i64:new ie(\"i64\",ne.reserved,\"i64\"),mat:new ie(\"mat\",ne.reserved,\"mat\"),premerge:new ie(\"premerge\",ne.reserved,\"premerge\"),regardless:new ie(\"regardless\",ne.reserved,\"regardless\"),typedef:new ie(\"typedef\",ne.reserved,\"typedef\"),u8:new ie(\"u8\",ne.reserved,\"u8\"),u16:new ie(\"u16\",ne.reserved,\"u16\"),u64:new ie(\"u64\",ne.reserved,\"u64\"),unless:new ie(\"unless\",ne.reserved,\"unless\"),using:new ie(\"using\",ne.reserved,\"using\"),vec:new ie(\"vec\",ne.reserved,\"vec\"),void:new ie(\"void\",ne.reserved,\"void\")},Lt.keywords={array:new ie(\"array\",ne.keyword,\"array\"),atomic:new ie(\"atomic\",ne.keyword,\"atomic\"),bool:new ie(\"bool\",ne.keyword,\"bool\"),f32:new ie(\"f32\",ne.keyword,\"f32\"),i32:new ie(\"i32\",ne.keyword,\"i32\"),mat2x2:new ie(\"mat2x2\",ne.keyword,\"mat2x2\"),mat2x3:new ie(\"mat2x3\",ne.keyword,\"mat2x3\"),mat2x4:new ie(\"mat2x4\",ne.keyword,\"mat2x4\"),mat3x2:new ie(\"mat3x2\",ne.keyword,\"mat3x2\"),mat3x3:new ie(\"mat3x3\",ne.keyword,\"mat3x3\"),mat3x4:new ie(\"mat3x4\",ne.keyword,\"mat3x4\"),mat4x2:new ie(\"mat4x2\",ne.keyword,\"mat4x2\"),mat4x3:new ie(\"mat4x3\",ne.keyword,\"mat4x3\"),mat4x4:new ie(\"mat4x4\",ne.keyword,\"mat4x4\"),ptr:new ie(\"ptr\",ne.keyword,\"ptr\"),sampler:new ie(\"sampler\",ne.keyword,\"sampler\"),sampler_comparison:new ie(\"sampler_comparison\",ne.keyword,\"sampler_comparison\"),struct:new ie(\"struct\",ne.keyword,\"struct\"),texture_1d:new ie(\"texture_1d\",ne.keyword,\"texture_1d\"),texture_2d:new ie(\"texture_2d\",ne.keyword,\"texture_2d\"),texture_2d_array:new ie(\"texture_2d_array\",ne.keyword,\"texture_2d_array\"),texture_3d:new ie(\"texture_3d\",ne.keyword,\"texture_3d\"),texture_cube:new ie(\"texture_cube\",ne.keyword,\"texture_cube\"),texture_cube_array:new ie(\"texture_cube_array\",ne.keyword,\"texture_cube_array\"),texture_multisampled_2d:new ie(\"texture_multisampled_2d\",ne.keyword,\"texture_multisampled_2d\"),texture_storage_1d:new ie(\"texture_storage_1d\",ne.keyword,\"texture_storage_1d\"),texture_storage_2d:new ie(\"texture_storage_2d\",ne.keyword,\"texture_storage_2d\"),texture_storage_2d_array:new ie(\"texture_storage_2d_array\",ne.keyword,\"texture_storage_2d_array\"),texture_storage_3d:new ie(\"texture_storage_3d\",ne.keyword,\"texture_storage_3d\"),texture_depth_2d:new ie(\"texture_depth_2d\",ne.keyword,\"texture_depth_2d\"),texture_depth_2d_array:new ie(\"texture_depth_2d_array\",ne.keyword,\"texture_depth_2d_array\"),texture_depth_cube:new ie(\"texture_depth_cube\",ne.keyword,\"texture_depth_cube\"),texture_depth_cube_array:new ie(\"texture_depth_cube_array\",ne.keyword,\"texture_depth_cube_array\"),texture_depth_multisampled_2d:new ie(\"texture_depth_multisampled_2d\",ne.keyword,\"texture_depth_multisampled_2d\"),texture_external:new ie(\"texture_external\",ne.keyword,\"texture_external\"),u32:new ie(\"u32\",ne.keyword,\"u32\"),vec2:new ie(\"vec2\",ne.keyword,\"vec2\"),vec3:new ie(\"vec3\",ne.keyword,\"vec3\"),vec4:new ie(\"vec4\",ne.keyword,\"vec4\"),bitcast:new ie(\"bitcast\",ne.keyword,\"bitcast\"),block:new ie(\"block\",ne.keyword,\"block\"),break:new ie(\"break\",ne.keyword,\"break\"),case:new ie(\"case\",ne.keyword,\"case\"),continue:new ie(\"continue\",ne.keyword,\"continue\"),continuing:new ie(\"continuing\",ne.keyword,\"continuing\"),default:new ie(\"default\",ne.keyword,\"default\"),diagnostic:new ie(\"diagnostic\",ne.keyword,\"diagnostic\"),discard:new ie(\"discard\",ne.keyword,\"discard\"),else:new ie(\"else\",ne.keyword,\"else\"),enable:new ie(\"enable\",ne.keyword,\"enable\"),fallthrough:new ie(\"fallthrough\",ne.keyword,\"fallthrough\"),false:new ie(\"false\",ne.keyword,\"false\"),fn:new ie(\"fn\",ne.keyword,\"fn\"),for:new ie(\"for\",ne.keyword,\"for\"),function:new ie(\"function\",ne.keyword,\"function\"),if:new ie(\"if\",ne.keyword,\"if\"),let:new ie(\"let\",ne.keyword,\"let\"),const:new ie(\"const\",ne.keyword,\"const\"),loop:new ie(\"loop\",ne.keyword,\"loop\"),while:new ie(\"while\",ne.keyword,\"while\"),private:new ie(\"private\",ne.keyword,\"private\"),read:new ie(\"read\",ne.keyword,\"read\"),read_write:new ie(\"read_write\",ne.keyword,\"read_write\"),return:new ie(\"return\",ne.keyword,\"return\"),requires:new ie(\"requires\",ne.keyword,\"requires\"),storage:new ie(\"storage\",ne.keyword,\"storage\"),switch:new ie(\"switch\",ne.keyword,\"switch\"),true:new ie(\"true\",ne.keyword,\"true\"),alias:new ie(\"alias\",ne.keyword,\"alias\"),type:new ie(\"type\",ne.keyword,\"type\"),uniform:new ie(\"uniform\",ne.keyword,\"uniform\"),var:new ie(\"var\",ne.keyword,\"var\"),override:new ie(\"override\",ne.keyword,\"override\"),workgroup:new ie(\"workgroup\",ne.keyword,\"workgroup\"),write:new ie(\"write\",ne.keyword,\"write\"),r8unorm:new ie(\"r8unorm\",ne.keyword,\"r8unorm\"),r8snorm:new ie(\"r8snorm\",ne.keyword,\"r8snorm\"),r8uint:new ie(\"r8uint\",ne.keyword,\"r8uint\"),r8sint:new ie(\"r8sint\",ne.keyword,\"r8sint\"),r16uint:new ie(\"r16uint\",ne.keyword,\"r16uint\"),r16sint:new ie(\"r16sint\",ne.keyword,\"r16sint\"),r16float:new ie(\"r16float\",ne.keyword,\"r16float\"),rg8unorm:new ie(\"rg8unorm\",ne.keyword,\"rg8unorm\"),rg8snorm:new ie(\"rg8snorm\",ne.keyword,\"rg8snorm\"),rg8uint:new ie(\"rg8uint\",ne.keyword,\"rg8uint\"),rg8sint:new ie(\"rg8sint\",ne.keyword,\"rg8sint\"),r32uint:new ie(\"r32uint\",ne.keyword,\"r32uint\"),r32sint:new ie(\"r32sint\",ne.keyword,\"r32sint\"),r32float:new ie(\"r32float\",ne.keyword,\"r32float\"),rg16uint:new ie(\"rg16uint\",ne.keyword,\"rg16uint\"),rg16sint:new ie(\"rg16sint\",ne.keyword,\"rg16sint\"),rg16float:new ie(\"rg16float\",ne.keyword,\"rg16float\"),rgba8unorm:new ie(\"rgba8unorm\",ne.keyword,\"rgba8unorm\"),rgba8unorm_srgb:new ie(\"rgba8unorm_srgb\",ne.keyword,\"rgba8unorm_srgb\"),rgba8snorm:new ie(\"rgba8snorm\",ne.keyword,\"rgba8snorm\"),rgba8uint:new ie(\"rgba8uint\",ne.keyword,\"rgba8uint\"),rgba8sint:new ie(\"rgba8sint\",ne.keyword,\"rgba8sint\"),bgra8unorm:new ie(\"bgra8unorm\",ne.keyword,\"bgra8unorm\"),bgra8unorm_srgb:new ie(\"bgra8unorm_srgb\",ne.keyword,\"bgra8unorm_srgb\"),rgb10a2unorm:new ie(\"rgb10a2unorm\",ne.keyword,\"rgb10a2unorm\"),rg11b10float:new ie(\"rg11b10float\",ne.keyword,\"rg11b10float\"),rg32uint:new ie(\"rg32uint\",ne.keyword,\"rg32uint\"),rg32sint:new ie(\"rg32sint\",ne.keyword,\"rg32sint\"),rg32float:new ie(\"rg32float\",ne.keyword,\"rg32float\"),rgba16uint:new ie(\"rgba16uint\",ne.keyword,\"rgba16uint\"),rgba16sint:new ie(\"rgba16sint\",ne.keyword,\"rgba16sint\"),rgba16float:new ie(\"rgba16float\",ne.keyword,\"rgba16float\"),rgba32uint:new ie(\"rgba32uint\",ne.keyword,\"rgba32uint\"),rgba32sint:new ie(\"rgba32sint\",ne.keyword,\"rgba32sint\"),rgba32float:new ie(\"rgba32float\",ne.keyword,\"rgba32float\"),static_assert:new ie(\"static_assert\",ne.keyword,\"static_assert\")},Lt.tokens={decimal_float_literal:new ie(\"decimal_float_literal\",ne.token,/((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?[fh]?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+[fh]?)|(-?[0-9]+[fh])/),hex_float_literal:new ie(\"hex_float_literal\",ne.token,/-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+[fh]?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+[fh]?))/),int_literal:new ie(\"int_literal\",ne.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ie(\"uint_literal\",ne.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),name:new ie(\"name\",ne.token,/([_\\p{XID_Start}][\\p{XID_Continue}]+)|([\\p{XID_Start}])/u),ident:new ie(\"ident\",ne.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new ie(\"and\",ne.token,\"&\"),and_and:new ie(\"and_and\",ne.token,\"&&\"),arrow:new ie(\"arrow \",ne.token,\"->\"),attr:new ie(\"attr\",ne.token,\"@\"),forward_slash:new ie(\"forward_slash\",ne.token,\"/\"),bang:new ie(\"bang\",ne.token,\"!\"),bracket_left:new ie(\"bracket_left\",ne.token,\"[\"),bracket_right:new ie(\"bracket_right\",ne.token,\"]\"),brace_left:new ie(\"brace_left\",ne.token,\"{\"),brace_right:new ie(\"brace_right\",ne.token,\"}\"),colon:new ie(\"colon\",ne.token,\":\"),comma:new ie(\"comma\",ne.token,\",\"),equal:new ie(\"equal\",ne.token,\"=\"),equal_equal:new ie(\"equal_equal\",ne.token,\"==\"),not_equal:new ie(\"not_equal\",ne.token,\"!=\"),greater_than:new ie(\"greater_than\",ne.token,\">\"),greater_than_equal:new ie(\"greater_than_equal\",ne.token,\">=\"),shift_right:new ie(\"shift_right\",ne.token,\">>\"),less_than:new ie(\"less_than\",ne.token,\"<\"),less_than_equal:new ie(\"less_than_equal\",ne.token,\"<=\"),shift_left:new ie(\"shift_left\",ne.token,\"<<\"),modulo:new ie(\"modulo\",ne.token,\"%\"),minus:new ie(\"minus\",ne.token,\"-\"),minus_minus:new ie(\"minus_minus\",ne.token,\"--\"),period:new ie(\"period\",ne.token,\".\"),plus:new ie(\"plus\",ne.token,\"+\"),plus_plus:new ie(\"plus_plus\",ne.token,\"++\"),or:new ie(\"or\",ne.token,\"|\"),or_or:new ie(\"or_or\",ne.token,\"||\"),paren_left:new ie(\"paren_left\",ne.token,\"(\"),paren_right:new ie(\"paren_right\",ne.token,\")\"),semicolon:new ie(\"semicolon\",ne.token,\";\"),star:new ie(\"star\",ne.token,\"*\"),tilde:new ie(\"tilde\",ne.token,\"~\"),underscore:new ie(\"underscore\",ne.token,\"_\"),xor:new ie(\"xor\",ne.token,\"^\"),plus_equal:new ie(\"plus_equal\",ne.token,\"+=\"),minus_equal:new ie(\"minus_equal\",ne.token,\"-=\"),times_equal:new ie(\"times_equal\",ne.token,\"*=\"),division_equal:new ie(\"division_equal\",ne.token,\"/=\"),modulo_equal:new ie(\"modulo_equal\",ne.token,\"%=\"),and_equal:new ie(\"and_equal\",ne.token,\"&=\"),or_equal:new ie(\"or_equal\",ne.token,\"|=\"),xor_equal:new ie(\"xor_equal\",ne.token,\"^=\"),shift_right_equal:new ie(\"shift_right_equal\",ne.token,\">>=\"),shift_left_equal:new ie(\"shift_left_equal\",ne.token,\"<<=\")},Lt.simpleTokens={\"@\":ge.tokens.attr,\"{\":ge.tokens.brace_left,\"}\":ge.tokens.brace_right,\":\":ge.tokens.colon,\",\":ge.tokens.comma,\"(\":ge.tokens.paren_left,\")\":ge.tokens.paren_right,\";\":ge.tokens.semicolon},Lt.literalTokens={\"&\":ge.tokens.and,\"&&\":ge.tokens.and_and,\"->\":ge.tokens.arrow,\"/\":ge.tokens.forward_slash,\"!\":ge.tokens.bang,\"[\":ge.tokens.bracket_left,\"]\":ge.tokens.bracket_right,\"=\":ge.tokens.equal,\"==\":ge.tokens.equal_equal,\"!=\":ge.tokens.not_equal,\">\":ge.tokens.greater_than,\">=\":ge.tokens.greater_than_equal,\">>\":ge.tokens.shift_right,\"<\":ge.tokens.less_than,\"<=\":ge.tokens.less_than_equal,\"<<\":ge.tokens.shift_left,\"%\":ge.tokens.modulo,\"-\":ge.tokens.minus,\"--\":ge.tokens.minus_minus,\".\":ge.tokens.period,\"+\":ge.tokens.plus,\"++\":ge.tokens.plus_plus,\"|\":ge.tokens.or,\"||\":ge.tokens.or_or,\"*\":ge.tokens.star,\"~\":ge.tokens.tilde,_:ge.tokens.underscore,\"^\":ge.tokens.xor,\"+=\":ge.tokens.plus_equal,\"-=\":ge.tokens.minus_equal,\"*=\":ge.tokens.times_equal,\"/=\":ge.tokens.division_equal,\"%=\":ge.tokens.modulo_equal,\"&=\":ge.tokens.and_equal,\"|=\":ge.tokens.or_equal,\"^=\":ge.tokens.xor_equal,\">>=\":ge.tokens.shift_right_equal,\"<<=\":ge.tokens.shift_left_equal},Lt.regexTokens={decimal_float_literal:ge.tokens.decimal_float_literal,hex_float_literal:ge.tokens.hex_float_literal,int_literal:ge.tokens.int_literal,uint_literal:ge.tokens.uint_literal,ident:ge.tokens.ident},Lt.storage_class=[ge.keywords.function,ge.keywords.private,ge.keywords.workgroup,ge.keywords.uniform,ge.keywords.storage],Lt.access_mode=[ge.keywords.read,ge.keywords.write,ge.keywords.read_write],Lt.sampler_type=[ge.keywords.sampler,ge.keywords.sampler_comparison],Lt.sampled_texture_type=[ge.keywords.texture_1d,ge.keywords.texture_2d,ge.keywords.texture_2d_array,ge.keywords.texture_3d,ge.keywords.texture_cube,ge.keywords.texture_cube_array],Lt.multisampled_texture_type=[ge.keywords.texture_multisampled_2d],Lt.storage_texture_type=[ge.keywords.texture_storage_1d,ge.keywords.texture_storage_2d,ge.keywords.texture_storage_2d_array,ge.keywords.texture_storage_3d],Lt.depth_texture_type=[ge.keywords.texture_depth_2d,ge.keywords.texture_depth_2d_array,ge.keywords.texture_depth_cube,ge.keywords.texture_depth_cube_array,ge.keywords.texture_depth_multisampled_2d],Lt.texture_external_type=[ge.keywords.texture_external],Lt.any_texture_type=[...ge.sampled_texture_type,...ge.multisampled_texture_type,...ge.storage_texture_type,...ge.depth_texture_type,...ge.texture_external_type],Lt.texel_format=[ge.keywords.r8unorm,ge.keywords.r8snorm,ge.keywords.r8uint,ge.keywords.r8sint,ge.keywords.r16uint,ge.keywords.r16sint,ge.keywords.r16float,ge.keywords.rg8unorm,ge.keywords.rg8snorm,ge.keywords.rg8uint,ge.keywords.rg8sint,ge.keywords.r32uint,ge.keywords.r32sint,ge.keywords.r32float,ge.keywords.rg16uint,ge.keywords.rg16sint,ge.keywords.rg16float,ge.keywords.rgba8unorm,ge.keywords.rgba8unorm_srgb,ge.keywords.rgba8snorm,ge.keywords.rgba8uint,ge.keywords.rgba8sint,ge.keywords.bgra8unorm,ge.keywords.bgra8unorm_srgb,ge.keywords.rgb10a2unorm,ge.keywords.rg11b10float,ge.keywords.rg32uint,ge.keywords.rg32sint,ge.keywords.rg32float,ge.keywords.rgba16uint,ge.keywords.rgba16sint,ge.keywords.rgba16float,ge.keywords.rgba32uint,ge.keywords.rgba32sint,ge.keywords.rgba32float],Lt.const_literal=[ge.tokens.int_literal,ge.tokens.uint_literal,ge.tokens.decimal_float_literal,ge.tokens.hex_float_literal,ge.keywords.true,ge.keywords.false],Lt.literal_or_ident=[ge.tokens.ident,ge.tokens.int_literal,ge.tokens.uint_literal,ge.tokens.decimal_float_literal,ge.tokens.hex_float_literal,ge.tokens.name],Lt.element_count_expression=[ge.tokens.int_literal,ge.tokens.uint_literal,ge.tokens.ident],Lt.template_types=[ge.keywords.vec2,ge.keywords.vec3,ge.keywords.vec4,ge.keywords.mat2x2,ge.keywords.mat2x3,ge.keywords.mat2x4,ge.keywords.mat3x2,ge.keywords.mat3x3,ge.keywords.mat3x4,ge.keywords.mat4x2,ge.keywords.mat4x3,ge.keywords.mat4x4,ge.keywords.atomic,ge.keywords.bitcast,...ge.any_texture_type],Lt.attribute_name=[ge.tokens.ident,ge.keywords.block,ge.keywords.diagnostic],Lt.assignment_operators=[ge.tokens.equal,ge.tokens.plus_equal,ge.tokens.minus_equal,ge.tokens.times_equal,ge.tokens.division_equal,ge.tokens.modulo_equal,ge.tokens.and_equal,ge.tokens.or_equal,ge.tokens.xor_equal,ge.tokens.shift_right_equal,ge.tokens.shift_left_equal],Lt.increment_operators=[ge.tokens.plus_plus,ge.tokens.minus_minus];var dO=class{constructor(t,r,i,n,o){this.type=t,this.lexeme=r,this.line=i,this.start=n,this.end=o}toString(){return this.lexeme}isTemplateType(){return Lt.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==Lt.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}},yH=class{constructor(t){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=t??\"\"}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new dO(Lt.eof,\"\",this._line,this._current,this._current)),this._tokens}scanToken(){let t=this._advance();if(t==`\n`)return this._line++,!0;if(this._isWhitespace(t))return!0;if(t==\"/\"){if(this._peekAhead()==\"/\"){for(;t!=`\n`;){if(this._isAtEnd())return!0;t=this._advance()}return this._line++,!0}if(this._peekAhead()==\"*\"){this._advance();let s=1;for(;s>0;){if(this._isAtEnd())return!0;if(t=this._advance(),t==`\n`)this._line++;else if(t==\"*\"){if(this._peekAhead()==\"/\"&&(this._advance(),s--,s==0))return!0}else t==\"/\"&&this._peekAhead()==\"*\"&&(this._advance(),s++)}return!0}}let r=Lt.simpleTokens[t];if(r)return this._addToken(r),!0;let i=Lt.none,n=this._isAlpha(t),o=t===\"_\";if(this._isAlphaNumeric(t)){let s=this._peekAhead();for(;this._isAlphaNumeric(s);)t+=this._advance(),s=this._peekAhead()}if(n){let s=Lt.keywords[t];if(s)return this._addToken(s),!0}if(n||o)return this._addToken(Lt.tokens.ident),!0;for(;;){let s=this._findType(t),a=this._peekAhead();if(t==\"-\"&&this._tokens.length>0){if(a==\"=\")return this._current++,t+=a,this._addToken(Lt.tokens.minus_equal),!0;if(a==\"-\")return this._current++,t+=a,this._addToken(Lt.tokens.minus_minus),!0;let h=this._tokens.length-1;if((Lt.literal_or_ident.indexOf(this._tokens[h].type)!=-1||this._tokens[h].type==Lt.tokens.paren_right)&&a!=\">\")return this._addToken(s),!0}if(t==\">\"&&(a==\">\"||a==\"=\")){let h=!1,p=this._tokens.length-1;for(let g=0;g<5&&p>=0&&Lt.assignment_operators.indexOf(this._tokens[p].type)===-1;++g,--p)if(this._tokens[p].type===Lt.tokens.less_than){p>0&&this._tokens[p-1].isArrayOrTemplateType()&&(h=!0);break}if(h)return this._addToken(s),!0}if(s===Lt.none){let h=t,p=0,g=2;for(let w=0;w<g;++w)if(h+=this._peekAhead(w),s=this._findType(h),s!==Lt.none){p=w;break}if(s===Lt.none)return i!==Lt.none&&(this._current--,this._addToken(i),!0);t=h,this._current+=p+1}if(i=s,this._isAtEnd())break;t+=this._advance()}return i!==Lt.none&&(this._addToken(i),!0)}_findType(t){for(let i in Lt.regexTokens){let n=Lt.regexTokens[i];if(this._match(t,n.rule))return n}return Lt.literalTokens[t]||Lt.none}_match(t,r){let i=r.exec(t);return i&&i.index==0&&i[0]==t}_isAtEnd(){return this._current>=this._source.length}_isAlpha(t){return!this._isNumeric(t)&&!this._isWhitespace(t)&&t!==\"_\"&&t!==\".\"&&t!==\"(\"&&t!==\")\"&&t!==\"[\"&&t!==\"]\"&&t!==\"{\"&&t!==\"}\"&&t!==\",\"&&t!==\";\"&&t!==\":\"&&t!==\"=\"&&t!==\"!\"&&t!==\"<\"&&t!==\">\"&&t!==\"+\"&&t!==\"-\"&&t!==\"*\"&&t!==\"/\"&&t!==\"%\"&&t!==\"&\"&&t!==\"|\"&&t!==\"^\"&&t!==\"~\"&&t!==\"@\"&&t!==\"#\"&&t!==\"?\"&&t!==\"'\"&&t!==\"`\"&&t!=='\"'&&t!==\"\\\\\"&&t!==`\n`&&t!==\"\\r\"&&t!==\"\t\"&&t!==\"\\0\"}_isNumeric(t){return t>=\"0\"&&t<=\"9\"}_isAlphaNumeric(t){return this._isAlpha(t)||this._isNumeric(t)||t===\"_\"}_isWhitespace(t){return t==\" \"||t==\"\t\"||t==\"\\r\"}_advance(t=0){let r=this._source[this._current];return t=t||0,t++,this._current+=t,r}_peekAhead(t=0){return t=t||0,this._current+t>=this._source.length?\"\\0\":this._source[this._current+t]}_addToken(t){let r=this._source.substring(this._start,this._current);this._tokens.push(new dO(t,r,this._line,this._start,this._current))}};function dr(e){return Array.isArray(e)||e?.buffer instanceof ArrayBuffer}var fO=new Float32Array(1),aFt=new Uint32Array(fO.buffer),lFt=new Uint32Array(fO.buffer),pO=new Int32Array(1),cFt=new Float32Array(pO.buffer),uFt=new Uint32Array(pO.buffer),mO=new Uint32Array(1),hFt=new Float32Array(mO.buffer),dFt=new Int32Array(mO.buffer);function rpt(e,t,r){if(t===r)return e;if(t===\"f32\"){if(r===\"i32\"||r===\"x32\")return fO[0]=e,aFt[0];if(r===\"u32\")return fO[0]=e,lFt[0]}else if(t===\"i32\"||t===\"x32\"){if(r===\"f32\")return pO[0]=e,cFt[0];if(r===\"u32\")return pO[0]=e,uFt[0]}else if(t===\"u32\"){if(r===\"f32\")return mO[0]=e,hFt[0];if(r===\"i32\"||r===\"x32\")return mO[0]=e,dFt[0]}return console.error(`Unsupported cast from ${t} to ${r}`),e}var _H=class{constructor(t){this.resources=null,this.inUse=!1,this.info=null,this.node=t}},u3=class{constructor(t,r){this.align=t,this.size=r}},ib=class e{constructor(){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new dH,this.functions=[],this._types=new Map,this._functions=new Map}_isStorageTexture(t){return t.name==\"texture_storage_1d\"||t.name==\"texture_storage_2d\"||t.name==\"texture_storage_2d_array\"||t.name==\"texture_storage_3d\"}updateAST(t){for(let r of t)r instanceof nb&&this._functions.set(r.name,new _H(r));for(let r of t)if(r instanceof Ff){let i=this.getTypeInfo(r,null);i instanceof g0&&this.structs.push(i)}for(let r of t)if(r instanceof OE)this.aliases.push(this._getAliasInfo(r));else{if(r instanceof RE){let i=r,n=this._getAttributeNum(i.attributes,\"id\",0),o=i.type!=null?this.getTypeInfo(i.type,i.attributes):null;this.overrides.push(new cH(i.name,o,i.attributes,n));continue}if(this._isUniformVar(r)){let i=r,n=this._getAttributeNum(i.attributes,\"group\",0),o=this._getAttributeNum(i.attributes,\"binding\",0),s=this.getTypeInfo(i.type,i.attributes),a=new l3(i.name,s,n,o,i.attributes,s1.Uniform,i.access);a.access||(a.access=\"read\"),this.uniforms.push(a);continue}if(this._isStorageVar(r)){let i=r,n=this._getAttributeNum(i.attributes,\"group\",0),o=this._getAttributeNum(i.attributes,\"binding\",0),s=this.getTypeInfo(i.type,i.attributes),a=this._isStorageTexture(s),h=new l3(i.name,s,n,o,i.attributes,a?s1.StorageTexture:s1.Storage,i.access);h.access||(h.access=\"read\"),this.storage.push(h);continue}if(this._isTextureVar(r)){let i=r,n=this._getAttributeNum(i.attributes,\"group\",0),o=this._getAttributeNum(i.attributes,\"binding\",0),s=this.getTypeInfo(i.type,i.attributes),a=this._isStorageTexture(s),h=new l3(i.name,s,n,o,i.attributes,a?s1.StorageTexture:s1.Texture,i.access);h.access||(h.access=\"read\"),a?this.storage.push(h):this.textures.push(h);continue}if(this._isSamplerVar(r)){let i=r,n=this._getAttributeNum(i.attributes,\"group\",0),o=this._getAttributeNum(i.attributes,\"binding\",0),s=this.getTypeInfo(i.type,i.attributes),a=new l3(i.name,s,n,o,i.attributes,s1.Sampler,i.access);this.samplers.push(a);continue}}for(let r of t)if(r instanceof nb){let i=this._getAttribute(r,\"vertex\"),n=this._getAttribute(r,\"fragment\"),o=this._getAttribute(r,\"compute\"),s=i||n||o,a=new hH(r.name,s?.name,r.attributes);a.attributes=r.attributes,a.startLine=r.startLine,a.endLine=r.endLine,this.functions.push(a),this._functions.get(r.name).info=a,s&&(this._functions.get(r.name).inUse=!0,a.inUse=!0,a.resources=this._findResources(r,!!s),a.inputs=this._getInputs(r.args),a.outputs=this._getOutputs(r.returnType),this.entry[s.name].push(a)),a.arguments=r.args.map(h=>new uH(h.name,this.getTypeInfo(h.type,h.attributes),h.attributes)),a.returnType=r.returnType?this.getTypeInfo(r.returnType,r.attributes):null;continue}for(let r of this._functions.values())r.info&&(r.info.inUse=r.inUse,this._addCalls(r.node,r.info.calls));for(let r of this._functions.values())r.node.search(i=>{var n,o,s;if(i instanceof hO){if(i.value)if(dr(i.value))for(let a of i.value)for(let h of this.overrides)a===h.name&&((n=r.info)===null||n===void 0||n.overrides.push(h));else for(let a of this.overrides)i.value===a.name&&((o=r.info)===null||o===void 0||o.overrides.push(a))}else if(i instanceof Oc)for(let a of this.overrides)i.name===a.name&&((s=r.info)===null||s===void 0||s.overrides.push(a))});for(let r of this.uniforms)this._markStructsInUse(r.type);for(let r of this.storage)this._markStructsInUse(r.type)}getFunctionInfo(t){for(let r of this.functions)if(r.name==t)return r;return null}getStructInfo(t){for(let r of this.structs)if(r.name==t)return r;return null}getOverrideInfo(t){for(let r of this.overrides)if(r.name==t)return r;return null}_markStructsInUse(t){if(t)if(t.isStruct){if(t.inUse=!0,t.members)for(let r of t.members)this._markStructsInUse(r.type)}else if(t.isArray)this._markStructsInUse(t.format);else if(t.isTemplate)t.format&&this._markStructsInUse(t.format);else{let r=this._getAlias(t.name);r&&this._markStructsInUse(r)}}_addCalls(t,r){var i;for(let n of t.calls){let o=(i=this._functions.get(n.name))===null||i===void 0?void 0:i.info;o&&r.add(o)}}findResource(t,r,i){if(i){for(let n of this.entry.compute)if(n.name===i){for(let o of n.resources)if(o.group==t&&o.binding==r)return o}for(let n of this.entry.vertex)if(n.name===i){for(let o of n.resources)if(o.group==t&&o.binding==r)return o}for(let n of this.entry.fragment)if(n.name===i){for(let o of n.resources)if(o.group==t&&o.binding==r)return o}}for(let n of this.uniforms)if(n.group==t&&n.binding==r)return n;for(let n of this.storage)if(n.group==t&&n.binding==r)return n;for(let n of this.textures)if(n.group==t&&n.binding==r)return n;for(let n of this.samplers)if(n.group==t&&n.binding==r)return n;return null}_findResource(t){for(let r of this.uniforms)if(r.name==t)return r;for(let r of this.storage)if(r.name==t)return r;for(let r of this.textures)if(r.name==t)return r;for(let r of this.samplers)if(r.name==t)return r;return null}_markStructsFromAST(t){let r=this.getTypeInfo(t,null);this._markStructsInUse(r)}_findResources(t,r){let i=[],n=this,o=[];return t.search(s=>{if(s instanceof m3)o.push({});else if(s instanceof g3)o.pop();else if(s instanceof Nf){let a=s;r&&a.type!==null&&this._markStructsFromAST(a.type),o.length>0&&(o[o.length-1][a.name]=a)}else if(s instanceof Md){let a=s;r&&a.type!==null&&this._markStructsFromAST(a.type)}else if(s instanceof eb){let a=s;r&&a.type!==null&&this._markStructsFromAST(a.type),o.length>0&&(o[o.length-1][a.name]=a)}else if(s instanceof Oc){let a=s;if(o.length>0&&o[o.length-1][a.name])return;let h=n._findResource(a.name);h&&i.push(h)}else if(s instanceof LE){let a=s,h=n._functions.get(a.name);h&&(r&&(h.inUse=!0),t.calls.add(h.node),h.resources===null&&(h.resources=n._findResources(h.node,r)),i.push(...h.resources))}else if(s instanceof DE){let a=s,h=n._functions.get(a.name);h&&(r&&(h.inUse=!0),t.calls.add(h.node),h.resources===null&&(h.resources=n._findResources(h.node,r)),i.push(...h.resources))}}),[...new Map(i.map(s=>[s.name,s])).values()]}getBindGroups(){let t=[];function r(i,n){i>=t.length&&(t.length=i+1),t[i]===void 0&&(t[i]=[]),n>=t[i].length&&(t[i].length=n+1)}for(let i of this.uniforms)r(i.group,i.binding),t[i.group][i.binding]=i;for(let i of this.storage)r(i.group,i.binding),t[i.group][i.binding]=i;for(let i of this.textures)r(i.group,i.binding),t[i.group][i.binding]=i;for(let i of this.samplers)r(i.group,i.binding),t[i.group][i.binding]=i;return t}_getOutputs(t,r=void 0){if(r===void 0&&(r=[]),t instanceof Ff)this._getStructOutputs(t,r);else{let i=this._getOutputInfo(t);i!==null&&r.push(i)}return r}_getStructOutputs(t,r){for(let i of t.members)if(i.type instanceof Ff)this._getStructOutputs(i.type,r);else{let n=this._getAttribute(i,\"location\")||this._getAttribute(i,\"builtin\");if(n!==null){let o=this.getTypeInfo(i.type,i.type.attributes),s=this._parseInt(n.value),a=new GD(i.name,o,n.name,s);r.push(a)}}}_getOutputInfo(t){let r=this._getAttribute(t,\"location\")||this._getAttribute(t,\"builtin\");if(r!==null){let i=this.getTypeInfo(t,t.attributes),n=this._parseInt(r.value);return new GD(\"\",i,r.name,n)}return null}_getInputs(t,r=void 0){r===void 0&&(r=[]);for(let i of t)if(i.type instanceof Ff)this._getStructInputs(i.type,r);else{let n=this._getInputInfo(i);n!==null&&r.push(n)}return r}_getStructInputs(t,r){for(let i of t.members)if(i.type instanceof Ff)this._getStructInputs(i.type,r);else{let n=this._getInputInfo(i);n!==null&&r.push(n)}}_getInputInfo(t){let r=this._getAttribute(t,\"location\")||this._getAttribute(t,\"builtin\");if(r!==null){let i=this._getAttribute(t,\"interpolation\"),n=this.getTypeInfo(t.type,t.attributes),o=this._parseInt(r.value),s=new lH(t.name,n,r.name,o);return i!==null&&(s.interpolation=this._parseString(i.value)),s}return null}_parseString(t){return t instanceof Array&&(t=t[0]),t}_parseInt(t){t instanceof Array&&(t=t[0]);let r=parseInt(t);return isNaN(r)?t:r}_getAlias(t){for(let r of this.aliases)if(r.name==t)return r.type;return null}_getAliasInfo(t){return new aH(t.name,this.getTypeInfo(t.type,null))}getTypeInfoByName(t){for(let r of this.structs)if(r.name==t)return r;for(let r of this.aliases)if(r.name==t)return r.type;return null}getTypeInfo(t,r=null){if(this._types.has(t))return this._types.get(t);if(t instanceof d3){let n=t.type?this.getTypeInfo(t.type,t.attributes):null,o=new IE(t.name,n,r);return this._types.set(t,o),this._updateTypeInfo(o),o}if(t instanceof rb){let n=t,o=n.format?this.getTypeInfo(n.format,n.attributes):null,s=new A0(n.name,r);return s.format=o,s.count=n.count,this._types.set(t,s),this._updateTypeInfo(s),s}if(t instanceof Ff){let n=t,o=new g0(n.name,r);o.startLine=n.startLine,o.endLine=n.endLine;for(let s of n.members){let a=this.getTypeInfo(s.type,s.attributes);o.members.push(new $D(s.name,a,s.attributes))}return this._types.set(t,o),this._updateTypeInfo(o),o}if(t instanceof tb){let n=t,o=n.format instanceof Ne,s=n.format?o?this.getTypeInfo(n.format,null):new bu(n.format,null):null,a=new Pg(n.name,s,r,n.access);return this._types.set(t,a),this._updateTypeInfo(a),a}if(t instanceof ce){let n=t,o=n.format?this.getTypeInfo(n.format,null):null,s=new Pg(n.name,o,r,n.access);return this._types.set(t,s),this._updateTypeInfo(s),s}let i=new bu(t.name,r);return this._types.set(t,i),this._updateTypeInfo(i),i}_updateTypeInfo(t){var r,i,n;let o=this._getTypeSize(t);if(t.size=(r=o?.size)!==null&&r!==void 0?r:0,t instanceof A0&&t.format){let s=this._getTypeSize(t.format);t.stride=Math.max((i=s?.size)!==null&&i!==void 0?i:0,(n=s?.align)!==null&&n!==void 0?n:0),this._updateTypeInfo(t.format)}t instanceof IE&&this._updateTypeInfo(t.format),t instanceof g0&&this._updateStructInfo(t)}_updateStructInfo(t){var r;let i=0,n=0,o=0,s=0;for(let a=0,h=t.members.length;a<h;++a){let p=t.members[a],g=this._getTypeSize(p);if(!g)continue;(r=this._getAlias(p.type.name))!==null&&r!==void 0||p.type;let w=g.align,C=g.size;i=this._roundUp(w,i+n),n=C,o=i,s=Math.max(s,w),p.offset=i,p.size=C,this._updateTypeInfo(p.type)}t.size=this._roundUp(s,o+n),t.align=s}_getTypeSize(t){var r,i;if(t==null)return null;let n=this._getAttributeNum(t.attributes,\"size\",0),o=this._getAttributeNum(t.attributes,\"align\",0);if(t instanceof $D&&(t=t.type),t instanceof bu){let s=this._getAlias(t.name);s!==null&&(t=s)}{let s=e._typeInfo[t.name];if(s!==void 0){let a=((r=t.format)===null||r===void 0?void 0:r.name)===\"f16\"?2:1;return new u3(Math.max(o,s.align/a),Math.max(n,s.size/a))}}{let s=e._typeInfo[t.name.substring(0,t.name.length-1)];if(s){let a=t.name[t.name.length-1]===\"h\"?2:1;return new u3(Math.max(o,s.align/a),Math.max(n,s.size/a))}}if(t instanceof A0){let s=t,a=8,h=8,p=this._getTypeSize(s.format);return p!==null&&(h=p.size,a=p.align),h=s.count*this._getAttributeNum((i=t?.attributes)!==null&&i!==void 0?i:null,\"stride\",this._roundUp(a,h)),n&&(h=n),new u3(Math.max(o,a),Math.max(n,h))}if(t instanceof g0){let s=0,a=0,h=0,p=0,g=0;for(let w of t.members){let C=this._getTypeSize(w.type);C!==null&&(s=Math.max(C.align,s),h=this._roundUp(C.align,h+p),p=C.size,g=h)}return a=this._roundUp(s,g+p),new u3(Math.max(o,s),Math.max(n,a))}return null}_isUniformVar(t){return t instanceof Nf&&t.storage==\"uniform\"}_isStorageVar(t){return t instanceof Nf&&t.storage==\"storage\"}_isTextureVar(t){return t instanceof Nf&&t.type!==null&&e._textureTypes.indexOf(t.type.name)!=-1}_isSamplerVar(t){return t instanceof Nf&&t.type!==null&&e._samplerTypes.indexOf(t.type.name)!=-1}_getAttribute(t,r){let i=t;if(!i||!i.attributes)return null;let n=i.attributes;for(let o of n)if(o.name==r)return o;return null}_getAttributeNum(t,r,i){if(t===null)return i;for(let n of t)if(n.name==r){let o=n!==null&&n.value!==null?n.value:i;return o instanceof Array&&(o=o[0]),typeof o==\"number\"?o:typeof o==\"string\"?parseInt(o):i}return i}_roundUp(t,r){return Math.ceil(r/t)*t}};ib._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},ib._textureTypes=Lt.any_texture_type.map(e=>e.name),ib._samplerTypes=Lt.sampler_type.map(e=>e.name);var PH=0,vH=class e{constructor(t,r,i){this.id=PH++,this.name=t,this.value=r,this.node=i}clone(){return new e(this.name,this.value,this.node)}},bH=class e{constructor(t){this.id=PH++,this.name=t.name,this.node=t}clone(){return new e(this.node)}},xH=class e{constructor(t){this.parent=null,this.variables=new Map,this.functions=new Map,this.currentFunctionName=\"\",this.id=PH++,t&&(this.parent=t,this.currentFunctionName=t.currentFunctionName)}getVariable(t){var r;return this.variables.has(t)?(r=this.variables.get(t))!==null&&r!==void 0?r:null:this.parent?this.parent.getVariable(t):null}getFunction(t){var r;return this.functions.has(t)?(r=this.functions.get(t))!==null&&r!==void 0?r:null:this.parent?this.parent.getFunction(t):null}createVariable(t,r,i){this.variables.set(t,new vH(t,r,i??null))}setVariable(t,r,i){let n=this.getVariable(t);n!==null?n.value=r:this.createVariable(t,r,i)}getVariableValue(t){var r;let i=this.getVariable(t);return(r=i?.value)!==null&&r!==void 0?r:null}clone(){return new e(this)}},wH=class{evalExpression(t,r){return null}getTypeInfo(t){return null}getVariableName(t,r){return\"\"}},TH=class{constructor(t){this.exec=t}getTypeInfo(t){return this.exec.getTypeInfo(t)}All(t,r){let i=this.exec.evalExpression(t.args[0],r),n=!0;if(i instanceof Vt)return i.data.forEach(o=>{o||(n=!1)}),new oe(n?1:0,this.getTypeInfo(\"bool\"));throw new Error(`All() expects a vector argument. Line ${t.line}`)}Any(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt){let n=i.data.some(o=>o);return new oe(n?1:0,this.getTypeInfo(\"bool\"))}throw new Error(`Any() expects a vector argument. Line ${t.line}`)}Select(t,r){let i=this.exec.evalExpression(t.args[2],r);if(!(i instanceof oe))throw new Error(`Select() expects a bool condition. Line ${t.line}`);return i.value?this.exec.evalExpression(t.args[1],r):this.exec.evalExpression(t.args[0],r)}ArrayLength(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.evalExpression(i,r);if(n instanceof pa&&n.typeInfo.size===0){let o=n.typeInfo,s=n.buffer.byteLength/o.stride;return new oe(s,this.getTypeInfo(\"u32\"))}return new oe(n.typeInfo.size,this.getTypeInfo(\"u32\"))}Abs(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.abs(o)),i.typeInfo);let n=i;return new oe(Math.abs(n.value),n.typeInfo)}Acos(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.acos(o)),i.typeInfo);let n=i;return new oe(Math.acos(n.value),i.typeInfo)}Acosh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.acosh(o)),i.typeInfo);let n=i;return new oe(Math.acosh(n.value),i.typeInfo)}Asin(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.asin(o)),i.typeInfo);let n=i;return new oe(Math.asin(n.value),i.typeInfo)}Asinh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.asinh(o)),i.typeInfo);let n=i;return new oe(Math.asinh(n.value),i.typeInfo)}Atan(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.atan(o)),i.typeInfo);let n=i;return new oe(Math.atan(n.value),i.typeInfo)}Atanh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.atanh(o)),i.typeInfo);let n=i;return new oe(Math.atanh(n.value),i.typeInfo)}Atan2(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((a,h)=>Math.atan2(a,n.data[h])),i.typeInfo);let o=i,s=n;return new oe(Math.atan2(o.value,s.value),i.typeInfo)}Ceil(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.ceil(o)),i.typeInfo);let n=i;return new oe(Math.ceil(n.value),i.typeInfo)}_clamp(t,r,i){return Math.min(Math.max(t,r),i)}Clamp(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(i instanceof Vt&&n instanceof Vt&&o instanceof Vt)return new Vt(i.data.map((p,g)=>this._clamp(p,n.data[g],o.data[g])),i.typeInfo);let s=i,a=n,h=o;return new oe(this._clamp(s.value,a.value,h.value),i.typeInfo)}Cos(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.cos(o)),i.typeInfo);let n=i;return new oe(Math.cos(n.value),i.typeInfo)}Cosh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.cosh(o)),i.typeInfo);let n=i;return new oe(Math.cos(n.value),i.typeInfo)}CountLeadingZeros(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.clz32(o)),i.typeInfo);let n=i;return new oe(Math.clz32(n.value),i.typeInfo)}_countOneBits(t){let r=0;for(;t!==0;)1&t&&r++,t>>=1;return r}CountOneBits(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>this._countOneBits(o)),i.typeInfo);let n=i;return new oe(this._countOneBits(n.value),i.typeInfo)}_countTrailingZeros(t){if(t===0)return 32;let r=0;for(;!(1&t);)t>>=1,r++;return r}CountTrailingZeros(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>this._countTrailingZeros(o)),i.typeInfo);let n=i;return new oe(this._countTrailingZeros(n.value),i.typeInfo)}Cross(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt){if(i.data.length!==3||n.data.length!==3)return console.error(`Cross() expects 3D vectors. Line ${t.line}`),null;let o=i.data,s=n.data;return new Vt([o[1]*s[2]-s[1]*o[2],o[2]*s[0]-s[2]*o[0],o[0]*s[1]-s[0]*o[1]],i.typeInfo)}return console.error(`Cross() expects vector arguments. Line ${t.line}`),null}Degrees(t,r){let i=this.exec.evalExpression(t.args[0],r),n=180/Math.PI;return i instanceof Vt?new Vt(i.data.map(o=>o*n),i.typeInfo):new oe(i.value*n,this.getTypeInfo(\"f32\"))}Determinant(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof ui){let n=i.data,o=i.typeInfo.getTypeName(),s=o.endsWith(\"h\")?this.getTypeInfo(\"f16\"):this.getTypeInfo(\"f32\");if(o===\"mat2x2\"||o===\"mat2x2f\"||o===\"mat2x2h\")return new oe(n[0]*n[3]-n[1]*n[2],s);if(o===\"mat2x3\"||o===\"mat2x3f\"||o===\"mat2x3h\")return new oe(n[0]*(n[4]*n[8]-n[5]*n[7])-n[1]*(n[3]*n[8]-n[5]*n[6])+n[2]*(n[3]*n[7]-n[4]*n[6]),s);if(o===\"mat2x4\"||o===\"mat2x4f\"||o===\"mat2x4h\")console.error(`TODO: Determinant for ${o}`);else if(o===\"mat3x2\"||o===\"mat3x2f\"||o===\"mat3x2h\")console.error(`TODO: Determinant for ${o}`);else{if(o===\"mat3x3\"||o===\"mat3x3f\"||o===\"mat3x3h\")return new oe(n[0]*(n[4]*n[8]-n[5]*n[7])-n[1]*(n[3]*n[8]-n[5]*n[6])+n[2]*(n[3]*n[7]-n[4]*n[6]),s);o===\"mat3x4\"||o===\"mat3x4f\"||o===\"mat3x4h\"||o===\"mat4x2\"||o===\"mat4x2f\"||o===\"mat4x2h\"||o===\"mat4x3\"||o===\"mat4x3f\"||o===\"mat4x3h\"?console.error(`TODO: Determinant for ${o}`):o!==\"mat4x4\"&&o!==\"mat4x4f\"&&o!==\"mat4x4h\"||console.error(`TODO: Determinant for ${o}`)}}return console.error(`Determinant expects a matrix argument. Line ${t.line}`),null}Distance(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt){let a=0;for(let h=0;h<i.data.length;++h)a+=(i.data[h]-n.data[h])*(i.data[h]-n.data[h]);return new oe(Math.sqrt(a),this.getTypeInfo(\"f32\"))}let o=i,s=n;return new oe(Math.abs(o.value-s.value),i.typeInfo)}_dot(t,r){let i=0;for(let n=0;n<t.length;++n)i+=r[n]*t[n];return i}Dot(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);return i instanceof Vt&&n instanceof Vt?new oe(this._dot(i.data,n.data),this.getTypeInfo(\"f32\")):(console.error(`Dot() expects vector arguments. Line ${t.line}`),null)}Dot4U8Packed(t,r){return console.error(`TODO: dot4U8Packed. Line ${t.line}`),null}Dot4I8Packed(t,r){return console.error(`TODO: dot4I8Packed. Line ${t.line}`),null}Exp(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.exp(o)),i.typeInfo);let n=i;return new oe(Math.exp(n.value),i.typeInfo)}Exp2(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.pow(2,o)),i.typeInfo);let n=i;return new oe(Math.pow(2,n.value),i.typeInfo)}ExtractBits(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(n.typeInfo.name!==\"u32\"&&n.typeInfo.name!==\"x32\")return console.error(`ExtractBits() expects an i32 offset argument. Line ${t.line}`),null;if(o.typeInfo.name!==\"u32\"&&o.typeInfo.name!==\"x32\")return console.error(`ExtractBits() expects an i32 count argument. Line ${t.line}`),null;let s=n.value,a=o.value;if(i instanceof Vt)return new Vt(i.data.map(p=>p>>s&(1<<a)-1),i.typeInfo);if(i.typeInfo.name!==\"i32\"&&i.typeInfo.name!==\"x32\")return console.error(`ExtractBits() expects an i32 argument. Line ${t.line}`),null;let h=i.value;return new oe(h>>s&(1<<a)-1,this.getTypeInfo(\"i32\"))}FaceForward(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(i instanceof Vt&&n instanceof Vt&&o instanceof Vt){let s=this._dot(n.data,o.data);return new Vt(s<0?Array.from(i.data):i.data.map(a=>-a),i.typeInfo)}return console.error(`FaceForward() expects vector arguments. Line ${t.line}`),null}_firstLeadingBit(t){return t===0?-1:31-Math.clz32(t)}FirstLeadingBit(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>this._firstLeadingBit(o)),i.typeInfo);let n=i;return new oe(this._firstLeadingBit(n.value),i.typeInfo)}_firstTrailingBit(t){return t===0?-1:Math.log2(t&-t)}FirstTrailingBit(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>this._firstTrailingBit(o)),i.typeInfo);let n=i;return new oe(this._firstTrailingBit(n.value),i.typeInfo)}Floor(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.floor(o)),i.typeInfo);let n=i;return new oe(Math.floor(n.value),i.typeInfo)}Fma(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(i instanceof Vt&&n instanceof Vt&&o instanceof Vt)return i.data.length!==n.data.length||i.data.length!==o.data.length?(console.error(`Fma() expects vectors of the same length. Line ${t.line}`),null):new Vt(i.data.map((p,g)=>p*n.data[g]+o.data[g]),i.typeInfo);let s=i,a=n,h=o;return new oe(s.value*a.value+h.value,s.typeInfo)}Fract(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>o-Math.floor(o)),i.typeInfo);let n=i;return new oe(n.value-Math.floor(n.value),i.typeInfo)}Frexp(t,r){return console.error(`TODO: frexp. Line ${t.line}`),null}InsertBits(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r),s=this.exec.evalExpression(t.args[3],r);if(o.typeInfo.name!==\"u32\"&&o.typeInfo.name!==\"x32\")return console.error(`InsertBits() expects an i32 offset argument. Line ${t.line}`),null;let a=o.value,h=(1<<s.value)-1<<a,p=~h;if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((C,R)=>C&p|n.data[R]<<a&h),i.typeInfo);let g=i.value,w=n.value;return new oe(g&p|w<<a&h,i.typeInfo)}InverseSqrt(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>1/Math.sqrt(o)),i.typeInfo);let n=i;return new oe(1/Math.sqrt(n.value),i.typeInfo)}Ldexp(t,r){return console.error(`TODO: ldexp. Line ${t.line}`),null}Length(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt){let o=0;return i.data.forEach(s=>{o+=s*s}),new oe(Math.sqrt(o),this.getTypeInfo(\"f32\"))}let n=i;return new oe(Math.abs(n.value),i.typeInfo)}Log(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.log(o)),i.typeInfo);let n=i;return new oe(Math.log(n.value),i.typeInfo)}Log2(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.log2(o)),i.typeInfo);let n=i;return new oe(Math.log2(n.value),i.typeInfo)}Max(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((a,h)=>Math.max(a,n.data[h])),i.typeInfo);let o=i,s=n;return new oe(Math.max(o.value,s.value),i.typeInfo)}Min(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((a,h)=>Math.min(a,n.data[h])),i.typeInfo);let o=i,s=n;return new oe(Math.min(o.value,s.value),i.typeInfo)}Mix(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(i instanceof Vt&&n instanceof Vt&&o instanceof Vt)return new Vt(i.data.map((h,p)=>i.data[p]*(1-o.data[p])+n.data[p]*o.data[p]),i.typeInfo);let s=n,a=o;return new oe(i.value*(1-a.value)+s.value*a.value,i.typeInfo)}Modf(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((s,a)=>s%n.data[a]),i.typeInfo);let o=n;return new oe(i.value%o.value,i.typeInfo)}Normalize(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt){let n=this.Length(t,r).value;return new Vt(i.data.map(o=>o/n),i.typeInfo)}return console.error(`Normalize() expects a vector argument. Line ${t.line}`),null}Pow(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt)return new Vt(i.data.map((a,h)=>Math.pow(a,n.data[h])),i.typeInfo);let o=i,s=n;return new oe(Math.pow(o.value,s.value),i.typeInfo)}QuantizeToF16(t,r){let i=this.exec.evalExpression(t.args[0],r);return i instanceof Vt?new Vt(i.data.map(n=>n),i.typeInfo):new oe(i.value,i.typeInfo)}Radians(t,r){let i=this.exec.evalExpression(t.args[0],r);return i instanceof Vt?new Vt(i.data.map(n=>n*Math.PI/180),i.typeInfo):new oe(i.value*Math.PI/180,this.getTypeInfo(\"f32\"))}Reflect(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(i instanceof Vt&&n instanceof Vt){let o=this._dot(i.data,n.data);return new Vt(i.data.map((s,a)=>s-2*o*n.data[a]),i.typeInfo)}return console.error(`Reflect() expects vector arguments. Line ${t.line}`),null}Refract(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(i instanceof Vt&&n instanceof Vt&&o instanceof oe){let s=this._dot(n.data,i.data);return new Vt(i.data.map((a,h)=>{let p=1-o.value*o.value*(1-s*s);if(p<0)return 0;let g=Math.sqrt(p);return o.value*a-(o.value*s+g)*n.data[h]}),i.typeInfo)}return console.error(`Refract() expects vector arguments and a scalar argument. Line ${t.line}`),null}ReverseBits(t,r){return console.error(`TODO: reverseBits. Line ${t.line}`),null}Round(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.round(o)),i.typeInfo);let n=i;return new oe(Math.round(n.value),i.typeInfo)}Saturate(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.min(Math.max(o,0),1)),i.typeInfo);let n=i;return new oe(Math.min(Math.max(n.value,0),1),i.typeInfo)}Sign(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.sign(o)),i.typeInfo);let n=i;return new oe(Math.sign(n.value),i.typeInfo)}Sin(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.sin(o)),i.typeInfo);let n=i;return new oe(Math.sin(n.value),i.typeInfo)}Sinh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.sinh(o)),i.typeInfo);let n=i;return new oe(Math.sinh(n.value),i.typeInfo)}_smoothstep(t,r,i){let n=Math.min(Math.max((i-t)/(r-t),0),1);return n*n*(3-2*n)}SmoothStep(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r),o=this.exec.evalExpression(t.args[2],r);if(o instanceof Vt&&i instanceof Vt&&n instanceof Vt)return new Vt(o.data.map((p,g)=>this._smoothstep(i.data[g],n.data[g],p)),o.typeInfo);let s=i,a=n,h=o;return new oe(this._smoothstep(s.value,a.value,h.value),o.typeInfo)}Sqrt(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.sqrt(o)),i.typeInfo);let n=i;return new oe(Math.sqrt(n.value),i.typeInfo)}Step(t,r){let i=this.exec.evalExpression(t.args[0],r),n=this.exec.evalExpression(t.args[1],r);if(n instanceof Vt&&i instanceof Vt)return new Vt(n.data.map((s,a)=>s<i.data[a]?0:1),n.typeInfo);let o=i;return new oe(n.value<o.value?0:1,o.typeInfo)}Tan(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.tan(o)),i.typeInfo);let n=i;return new oe(Math.tan(n.value),i.typeInfo)}Tanh(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.tanh(o)),i.typeInfo);let n=i;return new oe(Math.tanh(n.value),i.typeInfo)}_getTransposeType(t){let r=t.getTypeName();return r===\"mat2x2f\"||r===\"mat2x2h\"?t:r===\"mat2x3f\"?this.getTypeInfo(\"mat3x2f\"):r===\"mat2x3h\"?this.getTypeInfo(\"mat3x2h\"):r===\"mat2x4f\"?this.getTypeInfo(\"mat4x2f\"):r===\"mat2x4h\"?this.getTypeInfo(\"mat4x2h\"):r===\"mat3x2f\"?this.getTypeInfo(\"mat2x3f\"):r===\"mat3x2h\"?this.getTypeInfo(\"mat2x3h\"):r===\"mat3x3f\"||r===\"mat3x3h\"?t:r===\"mat3x4f\"?this.getTypeInfo(\"mat4x3f\"):r===\"mat3x4h\"?this.getTypeInfo(\"mat4x3h\"):r===\"mat4x2f\"?this.getTypeInfo(\"mat2x4f\"):r===\"mat4x2h\"?this.getTypeInfo(\"mat2x4h\"):r===\"mat4x3f\"?this.getTypeInfo(\"mat3x4f\"):r===\"mat4x3h\"?this.getTypeInfo(\"mat3x4h\"):(r===\"mat4x4f\"||r===\"mat4x4h\"||console.error(`Invalid matrix type ${r}`),t)}Transpose(t,r){let i=this.exec.evalExpression(t.args[0],r);if(!(i instanceof ui))return console.error(`Transpose() expects a matrix argument. Line ${t.line}`),null;let n=this._getTransposeType(i.typeInfo);if(i.typeInfo.name===\"mat2x2\"||i.typeInfo.name===\"mat2x2f\"||i.typeInfo.name===\"mat2x2h\"){let o=i.data;return new ui([o[0],o[2],o[1],o[3]],n)}if(i.typeInfo.name===\"mat2x3\"||i.typeInfo.name===\"mat2x3f\"||i.typeInfo.name===\"mat2x3h\"){let o=i.data;return new ui([o[0],o[3],o[6],o[1],o[4],o[7]],n)}if(i.typeInfo.name===\"mat2x4\"||i.typeInfo.name===\"mat2x4f\"||i.typeInfo.name===\"mat2x4h\"){let o=i.data;return new ui([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13]],n)}if(i.typeInfo.name===\"mat3x2\"||i.typeInfo.name===\"mat3x2f\"||i.typeInfo.name===\"mat3x2h\"){let o=i.data;return new ui([o[0],o[3],o[1],o[4],o[2],o[5]],n)}if(i.typeInfo.name===\"mat3x3\"||i.typeInfo.name===\"mat3x3f\"||i.typeInfo.name===\"mat3x3h\"){let o=i.data;return new ui([o[0],o[3],o[6],o[1],o[4],o[7],o[2],o[5],o[8]],n)}if(i.typeInfo.name===\"mat3x4\"||i.typeInfo.name===\"mat3x4f\"||i.typeInfo.name===\"mat3x4h\"){let o=i.data;return new ui([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14]],n)}if(i.typeInfo.name===\"mat4x2\"||i.typeInfo.name===\"mat4x2f\"||i.typeInfo.name===\"mat4x2h\"){let o=i.data;return new ui([o[0],o[4],o[1],o[5],o[2],o[6]],n)}if(i.typeInfo.name===\"mat4x3\"||i.typeInfo.name===\"mat4x3f\"||i.typeInfo.name===\"mat4x3h\"){let o=i.data;return new ui([o[0],o[4],o[8],o[1],o[5],o[9],o[2],o[6],o[10]],n)}if(i.typeInfo.name===\"mat4x4\"||i.typeInfo.name===\"mat4x4f\"||i.typeInfo.name===\"mat4x4h\"){let o=i.data;return new ui([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14],o[3],o[7],o[11],o[15]],n)}return console.error(`Invalid matrix type ${i.typeInfo.name}`),null}Trunc(t,r){let i=this.exec.evalExpression(t.args[0],r);if(i instanceof Vt)return new Vt(i.data.map(o=>Math.trunc(o)),i.typeInfo);let n=i;return new oe(Math.trunc(n.value),i.typeInfo)}Dpdx(t,r){return console.error(`TODO: dpdx. Line ${t.line}`),null}DpdxCoarse(t,r){return console.error(`TODO: dpdxCoarse. Line ${t.line}`),null}DpdxFine(t,r){return console.error(\"TODO: dpdxFine\"),null}Dpdy(t,r){return console.error(\"TODO: dpdy\"),null}DpdyCoarse(t,r){return console.error(\"TODO: dpdyCoarse\"),null}DpdyFine(t,r){return console.error(\"TODO: dpdyFine\"),null}Fwidth(t,r){return console.error(\"TODO: fwidth\"),null}FwidthCoarse(t,r){return console.error(\"TODO: fwidthCoarse\"),null}FwidthFine(t,r){return console.error(\"TODO: fwidthFine\"),null}TextureDimensions(t,r){let i=t.args[0],n=t.args.length>1?this.exec.evalExpression(t.args[1],r).value:0;if(i instanceof Oc){let o=i.name,s=r.getVariableValue(o);if(s instanceof Eg){if(n<0||n>=s.mipLevelCount)return console.error(`Invalid mip level for textureDimensions. Line ${t.line}`),null;let a=s.getMipLevelSize(n),h=s.dimension;return h===\"1d\"?new oe(a[0],this.getTypeInfo(\"u32\")):h===\"3d\"?new Vt(a,this.getTypeInfo(\"vec3u\")):h===\"2d\"?new Vt(a.slice(0,2),this.getTypeInfo(\"vec2u\")):(console.error(`Invalid texture dimension ${h} not found. Line ${t.line}`),null)}return console.error(`Texture ${o} not found. Line ${t.line}`),null}return console.error(`Invalid texture argument for textureDimensions. Line ${t.line}`),null}TextureGather(t,r){return console.error(\"TODO: textureGather\"),null}TextureGatherCompare(t,r){return console.error(\"TODO: textureGatherCompare\"),null}TextureLoad(t,r){let i=t.args[0],n=this.exec.evalExpression(t.args[1],r),o=t.args.length>2?this.exec.evalExpression(t.args[2],r).value:0;if(!(n instanceof Vt)||n.data.length!==2)return console.error(`Invalid UV argument for textureLoad. Line ${t.line}`),null;if(i instanceof Oc){let s=i.name,a=r.getVariableValue(s);if(a instanceof Eg){let h=Math.floor(n.data[0]),p=Math.floor(n.data[1]);if(h<0||h>=a.width||p<0||p>=a.height)return console.error(`Texture ${s} out of bounds. Line ${t.line}`),null;let g=a.getPixel(h,p,0,o);return g===null?(console.error(`Invalid texture format for textureLoad. Line ${t.line}`),null):new Vt(g,this.getTypeInfo(\"vec4f\"))}return console.error(`Texture ${s} not found. Line ${t.line}`),null}return console.error(`Invalid texture argument for textureLoad. Line ${t.line}`),null}TextureNumLayers(t,r){let i=t.args[0];if(i instanceof Oc){let n=i.name,o=r.getVariableValue(n);return o instanceof Eg?new oe(o.depthOrArrayLayers,this.getTypeInfo(\"u32\")):(console.error(`Texture ${n} not found. Line ${t.line}`),null)}return console.error(`Invalid texture argument for textureNumLayers. Line ${t.line}`),null}TextureNumLevels(t,r){let i=t.args[0];if(i instanceof Oc){let n=i.name,o=r.getVariableValue(n);return o instanceof Eg?new oe(o.mipLevelCount,this.getTypeInfo(\"u32\")):(console.error(`Texture ${n} not found. Line ${t.line}`),null)}return console.error(`Invalid texture argument for textureNumLevels. Line ${t.line}`),null}TextureNumSamples(t,r){let i=t.args[0];if(i instanceof Oc){let n=i.name,o=r.getVariableValue(n);return o instanceof Eg?new oe(o.sampleCount,this.getTypeInfo(\"u32\")):(console.error(`Texture ${n} not found. Line ${t.line}`),null)}return console.error(`Invalid texture argument for textureNumSamples. Line ${t.line}`),null}TextureSample(t,r){return console.error(\"TODO: textureSample\"),null}TextureSampleBias(t,r){return console.error(\"TODO: textureSampleBias\"),null}TextureSampleCompare(t,r){return console.error(\"TODO: textureSampleCompare\"),null}TextureSampleCompareLevel(t,r){return console.error(\"TODO: textureSampleCompareLevel\"),null}TextureSampleGrad(t,r){return console.error(\"TODO: textureSampleGrad\"),null}TextureSampleLevel(t,r){return console.error(\"TODO: textureSampleLevel\"),null}TextureSampleBaseClampToEdge(t,r){return console.error(\"TODO: textureSampleBaseClampToEdge\"),null}TextureStore(t,r){let i=t.args[0],n=this.exec.evalExpression(t.args[1],r),o=t.args.length===4?this.exec.evalExpression(t.args[2],r).value:0,s=t.args.length===4?this.exec.evalExpression(t.args[3],r).data:this.exec.evalExpression(t.args[2],r).data;if(s.length!==4)return console.error(`Invalid value argument for textureStore. Line ${t.line}`),null;if(!(n instanceof Vt)||n.data.length!==2)return console.error(`Invalid UV argument for textureStore. Line ${t.line}`),null;if(i instanceof Oc){let a=i.name,h=r.getVariableValue(a);if(h instanceof Eg){let p=h.getMipLevelSize(0),g=Math.floor(n.data[0]),w=Math.floor(n.data[1]);return g<0||g>=p[0]||w<0||w>=p[1]?(console.error(`Texture ${a} out of bounds. Line ${t.line}`),null):(h.setPixel(g,w,0,o,Array.from(s)),null)}return console.error(`Texture ${a} not found. Line ${t.line}`),null}return console.error(`Invalid texture argument for textureStore. Line ${t.line}`),null}AtomicLoad(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r);return r.getVariable(n).value.getSubData(this.exec,i.postfix,r)}AtomicStore(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r);return h instanceof oe&&a instanceof oe&&(h.value=a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),null}AtomicAdd(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value+=a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicSub(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value-=a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicMax(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=Math.max(h.value,a.value)),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicMin(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=Math.min(h.value,a.value)),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicAnd(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=h.value&a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicOr(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=h.value|a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicXor(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=h.value^a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicExchange(t,r){let i=t.args[0];i instanceof _s&&(i=i.right);let n=this.exec.getVariableName(i,r),o=r.getVariable(n),s=t.args[1],a=this.exec.evalExpression(s,r),h=o.value.getSubData(this.exec,i.postfix,r),p=new oe(h.value,h.typeInfo);return h instanceof oe&&a instanceof oe&&(h.value=a.value),o.value instanceof pa&&o.value.setDataValue(this.exec,h,i.postfix,r),p}AtomicCompareExchangeWeak(t,r){return console.error(\"TODO: atomicCompareExchangeWeak\"),null}Pack4x8snorm(t,r){return console.error(\"TODO: pack4x8snorm\"),null}Pack4x8unorm(t,r){return console.error(\"TODO: pack4x8unorm\"),null}Pack4xI8(t,r){return console.error(\"TODO: pack4xI8\"),null}Pack4xU8(t,r){return console.error(\"TODO: pack4xU8\"),null}Pack4x8Clamp(t,r){return console.error(\"TODO: pack4x8Clamp\"),null}Pack4xU8Clamp(t,r){return console.error(\"TODO: pack4xU8Clamp\"),null}Pack2x16snorm(t,r){return console.error(\"TODO: pack2x16snorm\"),null}Pack2x16unorm(t,r){return console.error(\"TODO: pack2x16unorm\"),null}Pack2x16float(t,r){return console.error(\"TODO: pack2x16float\"),null}Unpack4x8snorm(t,r){return console.error(\"TODO: unpack4x8snorm\"),null}Unpack4x8unorm(t,r){return console.error(\"TODO: unpack4x8unorm\"),null}Unpack4xI8(t,r){return console.error(\"TODO: unpack4xI8\"),null}Unpack4xU8(t,r){return console.error(\"TODO: unpack4xU8\"),null}Unpack2x16snorm(t,r){return console.error(\"TODO: unpack2x16snorm\"),null}Unpack2x16unorm(t,r){return console.error(\"TODO: unpack2x16unorm\"),null}Unpack2x16float(t,r){return console.error(\"TODO: unpack2x16float\"),null}StorageBarrier(t,r){return null}TextureBarrier(t,r){return null}WorkgroupBarrier(t,r){return null}WorkgroupUniformLoad(t,r){return null}SubgroupAdd(t,r){return console.error(\"TODO: subgroupAdd\"),null}SubgroupExclusiveAdd(t,r){return console.error(\"TODO: subgroupExclusiveAdd\"),null}SubgroupInclusiveAdd(t,r){return console.error(\"TODO: subgroupInclusiveAdd\"),null}SubgroupAll(t,r){return console.error(\"TODO: subgroupAll\"),null}SubgroupAnd(t,r){return console.error(\"TODO: subgroupAnd\"),null}SubgroupAny(t,r){return console.error(\"TODO: subgroupAny\"),null}SubgroupBallot(t,r){return console.error(\"TODO: subgroupBallot\"),null}SubgroupBroadcast(t,r){return console.error(\"TODO: subgroupBroadcast\"),null}SubgroupBroadcastFirst(t,r){return console.error(\"TODO: subgroupBroadcastFirst\"),null}SubgroupElect(t,r){return console.error(\"TODO: subgroupElect\"),null}SubgroupMax(t,r){return console.error(\"TODO: subgroupMax\"),null}SubgroupMin(t,r){return console.error(\"TODO: subgroupMin\"),null}SubgroupMul(t,r){return console.error(\"TODO: subgroupMul\"),null}SubgroupExclusiveMul(t,r){return console.error(\"TODO: subgroupExclusiveMul\"),null}SubgroupInclusiveMul(t,r){return console.error(\"TODO: subgroupInclusiveMul\"),null}SubgroupOr(t,r){return console.error(\"TODO: subgroupOr\"),null}SubgroupShuffle(t,r){return console.error(\"TODO: subgroupShuffle\"),null}SubgroupShuffleDown(t,r){return console.error(\"TODO: subgroupShuffleDown\"),null}SubgroupShuffleUp(t,r){return console.error(\"TODO: subgroupShuffleUp\"),null}SubgroupShuffleXor(t,r){return console.error(\"TODO: subgroupShuffleXor\"),null}SubgroupXor(t,r){return console.error(\"TODO: subgroupXor\"),null}QuadBroadcast(t,r){return console.error(\"TODO: quadBroadcast\"),null}QuadSwapDiagonal(t,r){return console.error(\"TODO: quadSwapDiagonal\"),null}QuadSwapX(t,r){return console.error(\"TODO: quadSwapX\"),null}QuadSwapY(t,r){return console.error(\"TODO: quadSwapY\"),null}},sH={vec2:2,vec2f:2,vec2i:2,vec2u:2,vec2b:2,vec2h:2,vec3:3,vec3f:3,vec3i:3,vec3u:3,vec3b:3,vec3h:3,vec4:4,vec4f:4,vec4i:4,vec4u:4,vec4b:4,vec4h:4},Dc={mat2x2:[2,2,4],mat2x2f:[2,2,4],mat2x2h:[2,2,4],mat2x3:[2,3,6],mat2x3f:[2,3,6],mat2x3h:[2,3,6],mat2x4:[2,4,8],mat2x4f:[2,4,8],mat2x4h:[2,4,8],mat3x2:[3,2,6],mat3x2f:[3,2,6],mat3x2h:[3,2,6],mat3x3:[3,3,9],mat3x3f:[3,3,9],mat3x3h:[3,3,9],mat3x4:[3,4,12],mat3x4f:[3,4,12],mat3x4h:[3,4,12],mat4x2:[4,2,8],mat4x2f:[4,2,8],mat4x2h:[4,2,8],mat4x3:[4,3,12],mat4x3f:[4,3,12],mat4x3h:[4,3,12],mat4x4:[4,4,16],mat4x4f:[4,4,16],mat4x4h:[4,4,16]},p3=class e extends wH{constructor(t,r){var i;super(),this.ast=t??[],this.reflection=new ib,this.reflection.updateAST(this.ast),this.context=(i=r?.clone())!==null&&i!==void 0?i:new xH,this.builtins=new TH(this),this.typeInfo={bool:this.getTypeInfo(Ne.bool),i32:this.getTypeInfo(Ne.i32),u32:this.getTypeInfo(Ne.u32),f32:this.getTypeInfo(Ne.f32),f16:this.getTypeInfo(Ne.f16),vec2f:this.getTypeInfo(ce.vec2f),vec2u:this.getTypeInfo(ce.vec2u),vec2i:this.getTypeInfo(ce.vec2i),vec2h:this.getTypeInfo(ce.vec2h),vec3f:this.getTypeInfo(ce.vec3f),vec3u:this.getTypeInfo(ce.vec3u),vec3i:this.getTypeInfo(ce.vec3i),vec3h:this.getTypeInfo(ce.vec3h),vec4f:this.getTypeInfo(ce.vec4f),vec4u:this.getTypeInfo(ce.vec4u),vec4i:this.getTypeInfo(ce.vec4i),vec4h:this.getTypeInfo(ce.vec4h),mat2x2f:this.getTypeInfo(ce.mat2x2f),mat2x3f:this.getTypeInfo(ce.mat2x3f),mat2x4f:this.getTypeInfo(ce.mat2x4f),mat3x2f:this.getTypeInfo(ce.mat3x2f),mat3x3f:this.getTypeInfo(ce.mat3x3f),mat3x4f:this.getTypeInfo(ce.mat3x4f),mat4x2f:this.getTypeInfo(ce.mat4x2f),mat4x3f:this.getTypeInfo(ce.mat4x3f),mat4x4f:this.getTypeInfo(ce.mat4x4f)}}getVariableValue(t){var r,i;let n=(i=(r=this.context.getVariable(t))===null||r===void 0?void 0:r.value)!==null&&i!==void 0?i:null;if(n===null)return null;if(n instanceof oe)return n.value;if(n instanceof Vt||n instanceof ui)return Array.from(n.data);if(n instanceof pa&&n.typeInfo instanceof A0){if(n.typeInfo.format.name===\"u32\")return Array.from(new Uint32Array(n.buffer,n.offset,n.typeInfo.count));if(n.typeInfo.format.name===\"i32\")return Array.from(new Int32Array(n.buffer,n.offset,n.typeInfo.count));if(n.typeInfo.format.name===\"f32\")return Array.from(new Float32Array(n.buffer,n.offset,n.typeInfo.count))}return console.error(`Unsupported return variable type ${n.typeInfo.name}`),null}execute(t){(t=t??{}).constants&&this._setOverrides(t.constants,this.context),this._execStatements(this.ast,this.context)}dispatchWorkgroups(t,r,i,n){let o=this.context.clone();(n=n??{}).constants&&this._setOverrides(n.constants,o),this._execStatements(this.ast,o);let s=o.getFunction(t);if(!s)return void console.error(`Function ${t} not found`);if(typeof r==\"number\")r=[r,1,1];else{if(r.length===0)return void console.error(\"Invalid dispatch count\");r.length===1?r=[r[0],1,1]:r.length===2?r=[r[0],r[1],1]:r.length>3&&(r=[r[0],r[1],r[2]])}let a=r[0],h=r[1],p=r[2],g=this.getTypeInfo(\"vec3u\");o.setVariable(\"@num_workgroups\",new Vt(r,g));let w=this.reflection.getFunctionInfo(t);w===null&&console.error(`Function ${t} not found in reflection data`);for(let C in i)for(let R in i[C]){let z=i[C][R];o.variables.forEach(W=>{var Y;let H=W.node;if(H?.attributes){let Q=null,tt=null;for(let rt of H.attributes)rt.name===\"binding\"?Q=rt.value:rt.name===\"group\"&&(tt=rt.value);if(R==Q&&C==tt){let rt=!1;for(let at of w.resources)if(at.name===W.name&&at.group===parseInt(C)&&at.binding===parseInt(R)){rt=!0;break}if(rt)if(z.texture!==void 0&&z.descriptor!==void 0){let at=new Eg(z.texture,this.getTypeInfo(H.type),z.descriptor,(Y=z.texture.view)!==null&&Y!==void 0?Y:null);W.value=at}else z.uniform!==void 0?W.value=new pa(z.uniform,this.getTypeInfo(H.type)):W.value=new pa(z,this.getTypeInfo(H.type))}}})}for(let C=0;C<p;++C)for(let R=0;R<h;++R)for(let z=0;z<a;++z)o.setVariable(\"@workgroup_id\",new Vt([z,R,C],this.getTypeInfo(\"vec3u\"))),this._dispatchWorkgroup(s,[z,R,C],o)}execStatement(t,r){if(t instanceof QD)return this.evalExpression(t.value,r);if(t instanceof tO){if(t.condition){let i=this.evalExpression(t.condition,r);if(!(i instanceof oe))throw new Error(\"Invalid break-if condition\");if(!i.value)return null}return e._breakObj}if(t instanceof eO)return e._continueObj;if(t instanceof eb)this._let(t,r);else if(t instanceof Nf)this._var(t,r);else if(t instanceof h3)this._const(t,r);else if(t instanceof nb)this._function(t,r);else{if(t instanceof KD)return this._if(t,r);if(t instanceof ZD)return this._switch(t,r);if(t instanceof qD)return this._for(t,r);if(t instanceof WD)return this._while(t,r);if(t instanceof XD)return this._loop(t,r);if(t instanceof kE){let i=r.clone();return i.currentFunctionName=r.currentFunctionName,this._execStatements(t.body,i)}if(t instanceof YD)this._assign(t,r);else if(t instanceof HD)this._increment(t,r);else{if(t instanceof Ff)return null;if(t instanceof RE){let i=t.name;r.getVariable(i)===null&&r.setVariable(i,new oe(0,this.getTypeInfo(\"u32\")))}else if(t instanceof DE)this._call(t,r);else{if(t instanceof JD||t instanceof OE)return null;console.error(\"Invalid statement type.\",t,`Line ${t.line}`)}}}return null}evalExpression(t,r){return t instanceof Ah?this._evalBinaryOp(t,r):t instanceof js?this._evalLiteral(t,r):t instanceof Oc?this._evalVariable(t,r):t instanceof LE?this._evalCall(t,r):t instanceof Md?this._evalCreate(t,r):t instanceof iO?this._evalConst(t,r):t instanceof nO?this._evalBitcast(t,r):t instanceof _s?this._evalUnaryOp(t,r):(console.error(\"Invalid expression type\",t,`Line ${t.line}`),null)}getTypeInfo(t){var r;if(t instanceof Ne){let n=this.reflection.getTypeInfo(t);if(n!==null)return n}let i=(r=this.typeInfo[t])!==null&&r!==void 0?r:null;return i!==null||(i=this.reflection.getTypeInfoByName(t)),i}_setOverrides(t,r){for(let i in t){let n=t[i],o=this.reflection.getOverrideInfo(i);o!==null?(o.type===null&&(o.type=this.getTypeInfo(\"u32\")),o.type.name===\"u32\"||o.type.name===\"i32\"||o.type.name===\"f32\"||o.type.name===\"f16\"?r.setVariable(i,new oe(n,o.type)):o.type.name===\"bool\"?r.setVariable(i,new oe(n?1:0,o.type)):o.type.name===\"vec2\"||o.type.name===\"vec3\"||o.type.name===\"vec4\"||o.type.name===\"vec2f\"||o.type.name===\"vec3f\"||o.type.name===\"vec4f\"||o.type.name===\"vec2i\"||o.type.name===\"vec3i\"||o.type.name===\"vec4i\"||o.type.name===\"vec2u\"||o.type.name===\"vec3u\"||o.type.name===\"vec4u\"||o.type.name===\"vec2h\"||o.type.name===\"vec3h\"||o.type.name===\"vec4h\"?r.setVariable(i,new Vt(n,o.type)):console.error(`Invalid constant type for ${i}`)):console.error(`Override ${i} does not exist in the shader.`)}}_dispatchWorkgroup(t,r,i){let n=[1,1,1];for(let g of t.node.attributes)if(g.name===\"workgroup_size\"){if(g.value.length>0){let w=i.getVariableValue(g.value[0]);n[0]=w instanceof oe?w.value:parseInt(g.value[0])}if(g.value.length>1){let w=i.getVariableValue(g.value[1]);n[1]=w instanceof oe?w.value:parseInt(g.value[1])}if(g.value.length>2){let w=i.getVariableValue(g.value[2]);n[2]=w instanceof oe?w.value:parseInt(g.value[2])}}let o=this.getTypeInfo(\"vec3u\"),s=this.getTypeInfo(\"u32\");i.setVariable(\"@workgroup_size\",new Vt(n,o));let a=n[0],h=n[1],p=n[2];for(let g=0,w=0;g<p;++g)for(let C=0;C<h;++C)for(let R=0;R<a;++R,++w){let z=[R,C,g],W=[R+r[0]*n[0],C+r[1]*n[1],g+r[2]*n[2]];i.setVariable(\"@local_invocation_id\",new Vt(z,o)),i.setVariable(\"@global_invocation_id\",new Vt(W,o)),i.setVariable(\"@local_invocation_index\",new oe(w,s)),this._dispatchExec(t,i)}}_dispatchExec(t,r){for(let i of t.node.args)for(let n of i.attributes)if(n.name===\"builtin\"){let o=`@${n.value}`,s=r.getVariable(o);s!==void 0&&r.variables.set(i.name,s)}this._execStatements(t.node.body,r)}getVariableName(t,r){for(;t instanceof _s;)t=t.right;return t instanceof Oc?t.name:(console.error(\"Unknown variable type\",t,\"Line\",t.line),null)}_execStatements(t,r){for(let i of t){if(i instanceof Array){let o=r.clone(),s=this._execStatements(i,o);if(s)return s;continue}let n=this.execStatement(i,r);if(n)return n}return null}_call(t,r){let i=r.clone();i.currentFunctionName=t.name;let n=r.getFunction(t.name);if(n){for(let o=0;o<n.node.args.length;++o){let s=n.node.args[o],a=this.evalExpression(t.args[o],i);i.setVariable(s.name,a,s)}this._execStatements(n.node.body,i)}else t.isBuiltin?this._callBuiltinFunction(t,i):this.getTypeInfo(t.name)&&this._evalCreate(t,r)}_increment(t,r){let i=this.getVariableName(t.variable,r),n=r.getVariable(i);n?t.operator===\"++\"?n.value instanceof oe?n.value.value++:console.error(`Variable ${i} is not a scalar. Line ${t.line}`):t.operator===\"--\"?n.value instanceof oe?n.value.value--:console.error(`Variable ${i} is not a scalar. Line ${t.line}`):console.error(`Unknown increment operator ${t.operator}. Line ${t.line}`):console.error(`Variable ${i} not found. Line ${t.line}`)}_getVariableData(t,r){if(t instanceof Oc){let i=this.getVariableName(t,r),n=r.getVariable(i);return n===null?(console.error(`Variable ${i} not found. Line ${t.line}`),null):n.value.getSubData(this,t.postfix,r)}if(t instanceof _s){if(t.operator===\"*\"){let i=this._getVariableData(t.right,r);return i instanceof a1?i.reference.getSubData(this,t.postfix,r):(console.error(`Variable ${t.right} is not a pointer. Line ${t.line}`),null)}if(t.operator===\"&\"){let i=this._getVariableData(t.right,r);return new a1(i)}}return null}_assign(t,r){let i=null,n=\"<var>\",o=null;if(t.variable instanceof _s){let h=this._getVariableData(t.variable,r),p=this.evalExpression(t.value,r),g=t.operator;if(g===\"=\"){if(h instanceof oe||h instanceof Vt||h instanceof ui){if(p instanceof oe||p instanceof Vt||p instanceof ui&&h.data.length===p.data.length)return void h.data.set(p.data);console.error(`Invalid assignment. Line ${t.line}`)}else if(h instanceof pa&&p instanceof pa&&h.buffer.byteLength-h.offset>=p.buffer.byteLength-p.offset)return void(h.buffer.byteLength%4==0?new Uint32Array(h.buffer,h.offset,h.typeInfo.size/4).set(new Uint32Array(p.buffer,p.offset,p.typeInfo.size/4)):new Uint8Array(h.buffer,h.offset,h.typeInfo.size).set(new Uint8Array(p.buffer,p.offset,p.typeInfo.size)));return console.error(`Invalid assignment. Line ${t.line}`),null}if(g===\"+=\")return h instanceof oe||h instanceof Vt||h instanceof ui?p instanceof oe||p instanceof Vt||p instanceof ui?void h.data.set(p.data.map((w,C)=>h.data[C]+w)):void console.error(`Invalid assignment . Line ${t.line}`):void console.error(`Invalid assignment. Line ${t.line}`);if(g===\"-=\")return(h instanceof oe||h instanceof Vt||h instanceof ui)&&(p instanceof oe||p instanceof Vt||p instanceof ui)?void h.data.set(p.data.map((w,C)=>h.data[C]-w)):void console.error(`Invalid assignment. Line ${t.line}`)}if(t.variable instanceof _s){if(t.variable.operator===\"*\"){n=this.getVariableName(t.variable.right,r);let h=r.getVariable(n);if(!(h&&h.value instanceof a1))return void console.error(`Variable ${n} is not a pointer. Line ${t.line}`);i=h.value.reference;let p=t.variable.postfix;if(!p){let g=t.variable.right;for(;g instanceof _s;){if(g.postfix){p=g.postfix;break}g=g.right}}p&&(i=i.getSubData(this,p,r))}}else{o=t.variable.postfix,n=this.getVariableName(t.variable,r);let h=r.getVariable(n);if(h===null)return void console.error(`Variable ${n} not found. Line ${t.line}`);i=h.value}if(i instanceof a1&&(i=i.reference),i===null)return void console.error(`Variable ${n} not found. Line ${t.line}`);let s=this.evalExpression(t.value,r),a=t.operator;if(a!==\"=\"){let h=i.getSubData(this,o,r);if(h instanceof Vt&&s instanceof oe){let p=h.data,g=s.value;if(a===\"+=\")for(let w=0;w<p.length;++w)p[w]+=g;else if(a===\"-=\")for(let w=0;w<p.length;++w)p[w]-=g;else if(a===\"*=\")for(let w=0;w<p.length;++w)p[w]*=g;else if(a===\"/=\")for(let w=0;w<p.length;++w)p[w]/=g;else if(a===\"%=\")for(let w=0;w<p.length;++w)p[w]%=g;else if(a===\"&=\")for(let w=0;w<p.length;++w)p[w]&=g;else if(a===\"|=\")for(let w=0;w<p.length;++w)p[w]|=g;else if(a===\"^=\")for(let w=0;w<p.length;++w)p[w]^=g;else if(a===\"<<=\")for(let w=0;w<p.length;++w)p[w]<<=g;else if(a===\">>=\")for(let w=0;w<p.length;++w)p[w]>>=g;else console.error(`Invalid operator ${a}. Line ${t.line}`)}else if(h instanceof Vt&&s instanceof Vt){let p=h.data,g=s.data;if(p.length!==g.length)return void console.error(`Vector length mismatch. Line ${t.line}`);if(a===\"+=\")for(let w=0;w<p.length;++w)p[w]+=g[w];else if(a===\"-=\")for(let w=0;w<p.length;++w)p[w]-=g[w];else if(a===\"*=\")for(let w=0;w<p.length;++w)p[w]*=g[w];else if(a===\"/=\")for(let w=0;w<p.length;++w)p[w]/=g[w];else if(a===\"%=\")for(let w=0;w<p.length;++w)p[w]%=g[w];else if(a===\"&=\")for(let w=0;w<p.length;++w)p[w]&=g[w];else if(a===\"|=\")for(let w=0;w<p.length;++w)p[w]|=g[w];else if(a===\"^=\")for(let w=0;w<p.length;++w)p[w]^=g[w];else if(a===\"<<=\")for(let w=0;w<p.length;++w)p[w]<<=g[w];else if(a===\">>=\")for(let w=0;w<p.length;++w)p[w]>>=g[w];else console.error(`Invalid operator ${a}. Line ${t.line}`)}else{if(!(h instanceof oe&&s instanceof oe))return void console.error(`Invalid type for ${t.operator} operator. Line ${t.line}`);a===\"+=\"?h.value+=s.value:a===\"-=\"?h.value-=s.value:a===\"*=\"?h.value*=s.value:a===\"/=\"?h.value/=s.value:a===\"%=\"?h.value%=s.value:a===\"&=\"?h.value&=s.value:a===\"|=\"?h.value|=s.value:a===\"^=\"?h.value^=s.value:a===\"<<=\"?h.value<<=s.value:a===\">>=\"?h.value>>=s.value:console.error(`Invalid operator ${a}. Line ${t.line}`)}return void(i instanceof pa&&i.setDataValue(this,h,o,r))}if(i instanceof pa)i.setDataValue(this,s,o,r);else if(o){if(!(i instanceof Vt||i instanceof ui))return void console.error(`Variable ${n} is not a vector or matrix. Line ${t.line}`);if(o instanceof l1){let h=this.evalExpression(o.index,r).value;if(i instanceof Vt){if(!(s instanceof oe))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[h]=s.value}else{if(!(i instanceof ui))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);{let p=this.evalExpression(o.index,r).value;if(p<0)return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);if(!(s instanceof Vt))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);{let g=i.typeInfo.getTypeName();if(g===\"mat2x2\"||g===\"mat2x2f\"||g===\"mat2x2h\"){if(!(p<2&&s.data.length===2))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[2*p]=s.data[0],i.data[2*p+1]=s.data[1]}else if(g===\"mat2x3\"||g===\"mat2x3f\"||g===\"mat2x3h\"){if(!(p<2&&s.data.length===3))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[3*p]=s.data[0],i.data[3*p+1]=s.data[1],i.data[3*p+2]=s.data[2]}else if(g===\"mat2x4\"||g===\"mat2x4f\"||g===\"mat2x4h\"){if(!(p<2&&s.data.length===4))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[4*p]=s.data[0],i.data[4*p+1]=s.data[1],i.data[4*p+2]=s.data[2],i.data[4*p+3]=s.data[3]}else if(g===\"mat3x2\"||g===\"mat3x2f\"||g===\"mat3x2h\"){if(!(p<3&&s.data.length===2))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[2*p]=s.data[0],i.data[2*p+1]=s.data[1]}else if(g===\"mat3x3\"||g===\"mat3x3f\"||g===\"mat3x3h\"){if(!(p<3&&s.data.length===3))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[3*p]=s.data[0],i.data[3*p+1]=s.data[1],i.data[3*p+2]=s.data[2]}else if(g===\"mat3x4\"||g===\"mat3x4f\"||g===\"mat3x4h\"){if(!(p<3&&s.data.length===4))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[4*p]=s.data[0],i.data[4*p+1]=s.data[1],i.data[4*p+2]=s.data[2],i.data[4*p+3]=s.data[3]}else if(g===\"mat4x2\"||g===\"mat4x2f\"||g===\"mat4x2h\"){if(!(p<4&&s.data.length===2))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[2*p]=s.data[0],i.data[2*p+1]=s.data[1]}else if(g===\"mat4x3\"||g===\"mat4x3f\"||g===\"mat4x3h\"){if(!(p<4&&s.data.length===3))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[3*p]=s.data[0],i.data[3*p+1]=s.data[1],i.data[3*p+2]=s.data[2]}else{if(g!==\"mat4x4\"&&g!==\"mat4x4f\"&&g!==\"mat4x4h\")return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);if(!(p<4&&s.data.length===4))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);i.data[4*p]=s.data[0],i.data[4*p+1]=s.data[1],i.data[4*p+2]=s.data[2],i.data[4*p+3]=s.data[3]}}}}}else if(o instanceof Cg){let h=o.value;if(!(i instanceof Vt))return void console.error(`Invalid assignment to ${h}. Variable ${n} is not a vector. Line ${t.line}`);if(s instanceof oe){if(h.length>1)return void console.error(`Invalid assignment to ${h} for variable ${n}. Line ${t.line}`);if(h===\"x\")i.data[0]=s.value;else if(h===\"y\"){if(i.data.length<2)return void console.error(`Invalid assignment to ${h} for variable ${n}. Line ${t.line}`);i.data[1]=s.value}else if(h===\"z\"){if(i.data.length<3)return void console.error(`Invalid assignment to ${h} for variable ${n}. Line ${t.line}`);i.data[2]=s.value}else if(h===\"w\"){if(i.data.length<4)return void console.error(`Invalid assignment to ${h} for variable ${n}. Line ${t.line}`);i.data[3]=s.value}}else{if(!(s instanceof Vt))return void console.error(`Invalid assignment to ${n}. Line ${t.line}`);if(h.length!==s.data.length)return void console.error(`Invalid assignment to ${h} for variable ${n}. Line ${t.line}`);for(let p=0;p<h.length;++p){let g=h[p];if(g===\"x\"||g===\"r\")i.data[0]=s.data[p];else if(g===\"y\"||g===\"g\"){if(s.data.length<2)return void console.error(`Invalid assignment to ${g} for variable ${n}. Line ${t.line}`);i.data[1]=s.data[p]}else if(g===\"z\"||g===\"b\"){if(s.data.length<3)return void console.error(`Invalid assignment to ${g} for variable ${n}. Line ${t.line}`);i.data[2]=s.data[p]}else{if(g!==\"w\"&&g!==\"a\")return void console.error(`Invalid assignment to ${g} for variable ${n}. Line ${t.line}`);if(s.data.length<4)return void console.error(`Invalid assignment to ${g} for variable ${n}. Line ${t.line}`);i.data[3]=s.data[p]}}}}}else i instanceof oe&&s instanceof oe?i.value=s.value:i instanceof Vt&&s instanceof Vt||i instanceof ui&&s instanceof ui?i.data.set(s.data):console.error(`Invalid assignment to ${n}. Line ${t.line}`)}_function(t,r){let i=new bH(t);r.functions.set(t.name,i)}_const(t,r){let i=null;t.value!==null&&(i=this.evalExpression(t.value,r)),r.createVariable(t.name,i,t)}_let(t,r){let i=null;if(t.value!==null){if(i=this.evalExpression(t.value,r),i===null)return void console.error(`Invalid value for variable ${t.name}. Line ${t.line}`);t.value instanceof _s||(i=i.clone())}else{let n=t.type.name;if(n===\"f32\"||n===\"i32\"||n===\"u32\"||n===\"bool\"||n===\"f16\"||n===\"vec2\"||n===\"vec3\"||n===\"vec4\"||n===\"vec2f\"||n===\"vec3f\"||n===\"vec4f\"||n===\"vec2i\"||n===\"vec3i\"||n===\"vec4i\"||n===\"vec2u\"||n===\"vec3u\"||n===\"vec4u\"||n===\"vec2h\"||n===\"vec3h\"||n===\"vec4h\"||n===\"vec2b\"||n===\"vec3b\"||n===\"vec4b\"||n===\"mat2x2\"||n===\"mat2x3\"||n===\"mat2x4\"||n===\"mat3x2\"||n===\"mat3x3\"||n===\"mat3x4\"||n===\"mat4x2\"||n===\"mat4x3\"||n===\"mat4x4\"||n===\"mat2x2f\"||n===\"mat2x3f\"||n===\"mat2x4f\"||n===\"mat3x2f\"||n===\"mat3x3f\"||n===\"mat3x4f\"||n===\"mat4x2f\"||n===\"mat4x3f\"||n===\"mat4x4f\"||n===\"mat2x2h\"||n===\"mat2x3h\"||n===\"mat2x4h\"||n===\"mat3x2h\"||n===\"mat3x3h\"||n===\"mat3x4h\"||n===\"mat4x2h\"||n===\"mat4x3h\"||n===\"mat4x4h\"||n===\"array\"){let o=new Md(t.type,[]);i=this._evalCreate(o,r)}}r.createVariable(t.name,i,t)}_var(t,r){let i=null;if(t.value!==null){if(i=this.evalExpression(t.value,r),i===null)return void console.error(`Invalid value for variable ${t.name}. Line ${t.line}`);t.value instanceof _s||(i=i.clone())}else{if(t.type===null)return void console.error(`Variable ${t.name} has no type. Line ${t.line}`);let n=t.type.name;if(n===\"f32\"||n===\"i32\"||n===\"u32\"||n===\"bool\"||n===\"f16\"||n===\"vec2\"||n===\"vec3\"||n===\"vec4\"||n===\"vec2f\"||n===\"vec3f\"||n===\"vec4f\"||n===\"vec2i\"||n===\"vec3i\"||n===\"vec4i\"||n===\"vec2u\"||n===\"vec3u\"||n===\"vec4u\"||n===\"vec2h\"||n===\"vec3h\"||n===\"vec4h\"||n===\"vec2b\"||n===\"vec3b\"||n===\"vec4b\"||n===\"mat2x2\"||n===\"mat2x3\"||n===\"mat2x4\"||n===\"mat3x2\"||n===\"mat3x3\"||n===\"mat3x4\"||n===\"mat4x2\"||n===\"mat4x3\"||n===\"mat4x4\"||n===\"mat2x2f\"||n===\"mat2x3f\"||n===\"mat2x4f\"||n===\"mat3x2f\"||n===\"mat3x3f\"||n===\"mat3x4f\"||n===\"mat4x2f\"||n===\"mat4x3f\"||n===\"mat4x4f\"||n===\"mat2x2h\"||n===\"mat2x3h\"||n===\"mat2x4h\"||n===\"mat3x2h\"||n===\"mat3x3h\"||n===\"mat3x4h\"||n===\"mat4x2h\"||n===\"mat4x3h\"||n===\"mat4x4h\"||t.type instanceof rb||t.type instanceof Ff||t.type instanceof ce){let o=new Md(t.type,[]);i=this._evalCreate(o,r)}}r.createVariable(t.name,i,t)}_switch(t,r){r=r.clone();let i=this.evalExpression(t.condition,r);if(!(i instanceof oe))return console.error(`Invalid if condition. Line ${t.line}`),null;let n=null;for(let o of t.cases)if(o instanceof aO)for(let s of o.selectors){if(s instanceof f3){n=o;continue}let a=this.evalExpression(s,r);if(!(a instanceof oe))return console.error(`Invalid case selector. Line ${t.line}`),null;if(a.value===i.value)return this._execStatements(o.body,r)}else o instanceof lO&&(n=o);return n?this._execStatements(n.body,r):null}_if(t,r){r=r.clone();let i=this.evalExpression(t.condition,r);if(!(i instanceof oe))return console.error(`Invalid if condition. Line ${t.line}`),null;if(i.value)return this._execStatements(t.body,r);for(let n of t.elseif){let o=this.evalExpression(n.condition,r);if(!(o instanceof oe))return console.error(`Invalid if condition. Line ${t.line}`),null;if(o.value)return this._execStatements(n.body,r)}return t.else?this._execStatements(t.else,r):null}_getScalarValue(t){return t instanceof oe?t.value:(console.error(\"Expected scalar value.\",t),0)}_for(t,r){for(r=r.clone(),this.execStatement(t.init,r);this._getScalarValue(this.evalExpression(t.condition,r));){let i=this._execStatements(t.body,r);if(i===e._breakObj)break;if(i!==null&&i!==e._continueObj)return i;this.execStatement(t.increment,r)}return null}_loop(t,r){for(r=r.clone();;){let i=this._execStatements(t.body,r);if(i===e._breakObj)break;if(i===e._continueObj){if(t.continuing&&this._execStatements(t.continuing.body,r)===e._breakObj)break}else if(i!==null)return i}return null}_while(t,r){for(r=r.clone();this._getScalarValue(this.evalExpression(t.condition,r));){let i=this._execStatements(t.body,r);if(i===e._breakObj)break;if(i!==e._continueObj&&i!==null)return i}return null}_evalBitcast(t,r){let i=this.evalExpression(t.value,r),n=t.type;if(i instanceof oe){let o=rpt(i.value,i.typeInfo.name,n.name);return new oe(o,this.getTypeInfo(n))}if(i instanceof Vt){let o=i.typeInfo.getTypeName(),s=\"\";if(o.endsWith(\"f\"))s=\"f32\";else if(o.endsWith(\"i\"))s=\"i32\";else if(o.endsWith(\"u\"))s=\"u32\";else if(o.endsWith(\"b\"))s=\"bool\";else{if(!o.endsWith(\"h\"))return console.error(`Unknown vector type ${o}. Line ${t.line}`),null;s=\"f16\"}let a=n.getTypeName(),h=\"\";if(a.endsWith(\"f\"))h=\"f32\";else if(a.endsWith(\"i\"))h=\"i32\";else if(a.endsWith(\"u\"))h=\"u32\";else if(a.endsWith(\"b\"))h=\"bool\";else{if(!a.endsWith(\"h\"))return console.error(`Unknown vector type ${h}. Line ${t.line}`),null;h=\"f16\"}let p=(function(g,w,C){if(w===C)return g;let R=new Array(g.length);for(let z=0;z<g.length;z++)R[z]=rpt(g[z],w,C);return R})(Array.from(i.data),s,h);return new Vt(p,this.getTypeInfo(n))}return console.error(`TODO: bitcast for ${i.typeInfo.name}. Line ${t.line}`),null}_evalConst(t,r){return r.getVariableValue(t.name).clone().getSubData(this,t.postfix,r)}_evalCreate(t,r){var i;if(t instanceof Md){if(t.type===null)return BE.void;switch(t.type.getTypeName()){case\"bool\":case\"i32\":case\"u32\":case\"f32\":case\"f16\":return this._callConstructorValue(t,r);case\"vec2\":case\"vec3\":case\"vec4\":case\"vec2f\":case\"vec3f\":case\"vec4f\":case\"vec2h\":case\"vec3h\":case\"vec4h\":case\"vec2i\":case\"vec3i\":case\"vec4i\":case\"vec2u\":case\"vec3u\":case\"vec4u\":case\"vec2b\":case\"vec3b\":case\"vec4b\":return this._callConstructorVec(t,r);case\"mat2x2\":case\"mat2x2f\":case\"mat2x2h\":case\"mat2x3\":case\"mat2x3f\":case\"mat2x3h\":case\"mat2x4\":case\"mat2x4f\":case\"mat2x4h\":case\"mat3x2\":case\"mat3x2f\":case\"mat3x2h\":case\"mat3x3\":case\"mat3x3f\":case\"mat3x3h\":case\"mat3x4\":case\"mat3x4f\":case\"mat3x4h\":case\"mat4x2\":case\"mat4x2f\":case\"mat4x2h\":case\"mat4x3\":case\"mat4x3f\":case\"mat4x3h\":case\"mat4x4\":case\"mat4x4f\":case\"mat4x4h\":return this._callConstructorMatrix(t,r)}}let n=t instanceof Md?t.type.name:t.name,o=t instanceof Md?this.getTypeInfo(t.type):this.getTypeInfo(t.name);if(o===null)return console.error(`Unknown type ${n}. Line ${t.line}`),null;if(o.size===0)return null;let s=new pa(new ArrayBuffer(o.size),o,0);if(o instanceof g0){if(t.args)for(let a=0;a<t.args.length;++a){let h=o.members[a],p=t.args[a],g=this.evalExpression(p,r);s.setData(this,g,h.type,h.offset,r)}}else if(o instanceof A0){let a=0;if(t.args)for(let h=0;h<t.args.length;++h){let p=t.args[h],g=this.evalExpression(p,r);o.format===null&&(((i=g.typeInfo)===null||i===void 0?void 0:i.name)===\"x32\"?o.format=this.getTypeInfo(\"i32\"):o.format=g.typeInfo),s.setData(this,g,o.format,a,r),a+=o.stride}}else console.error(`Unknown type \"${n}\". Line ${t.line}`);return t instanceof Md?s.getSubData(this,t.postfix,r):s}_evalLiteral(t,r){let i=this.getTypeInfo(t.type),n=i.name;return n===\"x32\"||n===\"u32\"||n===\"f32\"||n===\"f16\"||n===\"i32\"||n===\"bool\"?new oe(t.scalarValue,i):n===\"vec2\"||n===\"vec3\"||n===\"vec4\"||n===\"vec2f\"||n===\"vec3f\"||n===\"vec4f\"||n===\"vec2h\"||n===\"vec3h\"||n===\"vec4h\"||n===\"vec2i\"||n===\"vec3i\"||n===\"vec4i\"||n===\"vec2u\"||n===\"vec3u\"||n===\"vec4u\"?this._callConstructorVec(t,r):n===\"mat2x2\"||n===\"mat2x3\"||n===\"mat2x4\"||n===\"mat3x2\"||n===\"mat3x3\"||n===\"mat3x4\"||n===\"mat4x2\"||n===\"mat4x3\"||n===\"mat4x4\"||n===\"mat2x2f\"||n===\"mat2x3f\"||n===\"mat2x4f\"||n===\"mat3x2f\"||n===\"mat3x3f\"||n===\"mat3x4f\"||n===\"mat4x2f\"||n===\"mat4x3f\"||n===\"mat4x4f\"||n===\"mat2x2h\"||n===\"mat2x3h\"||n===\"mat2x4h\"||n===\"mat3x2h\"||n===\"mat3x3h\"||n===\"mat3x4h\"||n===\"mat4x2h\"||n===\"mat4x3h\"||n===\"mat4x4h\"?this._callConstructorMatrix(t,r):t.value}_evalVariable(t,r){let i=r.getVariableValue(t.name);return i===null?i:i.getSubData(this,t.postfix,r)}_maxFormatTypeInfo(t){let r=t[0];if(r.name===\"f32\")return r;for(let i=1;i<t.length;++i){let n=e._priority.get(r.name);e._priority.get(t[i].name)<n&&(r=t[i])}return r.name===\"x32\"?this.getTypeInfo(\"i32\"):r}_evalUnaryOp(t,r){let i=this.evalExpression(t.right,r);if(t.operator===\"&\")return new a1(i);if(t.operator===\"*\")return i instanceof a1?i.reference.getSubData(this,t.postfix,r):(console.error(`Invalid dereference. Line ${t.line}`),null);let n=i instanceof oe?i.value:i instanceof Vt?Array.from(i.data):null;switch(t.operator){case\"+\":{if(dr(n)){let a=n.map((h,p)=>+h);return new Vt(a,i.typeInfo)}let o=n,s=this._maxFormatTypeInfo([i.typeInfo,i.typeInfo]);return new oe(+o,s)}case\"-\":{if(dr(n)){let a=n.map((h,p)=>-h);return new Vt(a,i.typeInfo)}let o=n,s=this._maxFormatTypeInfo([i.typeInfo,i.typeInfo]);return new oe(-o,s)}case\"!\":{if(dr(n)){let a=n.map((h,p)=>h?0:1);return new Vt(a,i.typeInfo)}let o=n,s=this._maxFormatTypeInfo([i.typeInfo,i.typeInfo]);return new oe(o?0:1,s)}case\"~\":{if(dr(n)){let a=n.map((h,p)=>~h);return new Vt(a,i.typeInfo)}let o=n,s=this._maxFormatTypeInfo([i.typeInfo,i.typeInfo]);return new oe(~o,s)}}return console.error(`Invalid unary operator ${t.operator}. Line ${t.line}`),null}_evalBinaryOp(t,r){let i=this.evalExpression(t.left,r),n=this.evalExpression(t.right,r),o=i instanceof oe?i.value:i instanceof Vt||i instanceof ui?Array.from(i.data):null,s=n instanceof oe?n.value:n instanceof Vt||n instanceof ui?Array.from(n.data):null;switch(t.operator){case\"+\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R+w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C+g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g+C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a+h,p)}case\"-\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R-w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C-g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g-C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a-h,p)}case\"*\":{if(dr(o)&&dr(s)){let g=o,w=s;if(i instanceof ui&&n instanceof ui){let C=(function(Y,H,Q,tt){if(Dc[H.name]===void 0||Dc[tt.name]===void 0)return null;let rt=Dc[H.name][0],at=Dc[H.name][1],et=Dc[tt.name][0];if(rt!==Dc[tt.name][1])return null;let lt=new Array(et*at);for(let J=0;J<at;J++)for(let ft=0;ft<et;ft++){let dt=0;for(let Mt=0;Mt<rt;Mt++)dt+=Y[Mt*at+J]*Q[ft*rt+Mt];lt[J*et+ft]=dt}return lt})(g,i.typeInfo,w,n.typeInfo);if(C===null)return console.error(`Matrix multiplication failed. Line ${t.line}.`),null;let R=Dc[n.typeInfo.name][0],z=Dc[i.typeInfo.name][1],W=this.getTypeInfo(`mat${R}x${z}f`);return new ui(C,W)}if(i instanceof ui&&n instanceof Vt){let C=(function(R,z,W,Y){if(Dc[z.name]===void 0||sH[Y.name]===void 0)return null;let H=Dc[z.name][0],Q=Dc[z.name][1];if(H!==W.length)return null;let tt=new Array(Q);for(let rt=0;rt<Q;rt++){let at=0;for(let et=0;et<H;et++)at+=R[et*Q+rt]*W[et];tt[rt]=at}return tt})(g,i.typeInfo,w,n.typeInfo);return C===null?(console.error(`Matrix vector multiplication failed. Line ${t.line}.`),null):new Vt(C,n.typeInfo)}if(i instanceof Vt&&n instanceof ui){let C=(function(R,z,W,Y){if(sH[z.name]===void 0||Dc[Y.name]===void 0)return null;let H=Dc[Y.name][0],Q=Dc[Y.name][1];if(Q!==R.length)return null;let tt=[];for(let rt=0;rt<H;rt++){let at=0;for(let et=0;et<Q;et++)at+=R[et]*W[et*H+rt];tt[rt]=at}return tt})(g,i.typeInfo,w,n.typeInfo);return C===null?(console.error(`Matrix vector multiplication failed. Line ${t.line}.`),null):new Vt(C,i.typeInfo)}{if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R*w[z]);return new Vt(C,i.typeInfo)}}if(dr(o)){let g=s,w=o.map((C,R)=>C*g);return i instanceof ui?new ui(w,i.typeInfo):new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g*C);return n instanceof ui?new ui(w,n.typeInfo):new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a*h,p)}case\"%\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R%w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C%g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g%C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a%h,p)}case\"/\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R/w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C/g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g/C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a/h,p)}case\"&\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R&w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C&g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g&C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a&h,p)}case\"|\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R|w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C|g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g|C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a|h,p)}case\"^\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R^w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C^g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g^C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a^h,p)}case\"<<\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R<<w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C<<g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g<<C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a<<h,p)}case\">>\":{if(dr(o)&&dr(s)){let g=o,w=s;if(g.length!==w.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let C=g.map((R,z)=>R>>w[z]);return new Vt(C,i.typeInfo)}if(dr(o)){let g=s,w=o.map((C,R)=>C>>g);return new Vt(w,i.typeInfo)}if(dr(s)){let g=o,w=s.map((C,R)=>g>>C);return new Vt(w,n.typeInfo)}let a=o,h=s,p=this._maxFormatTypeInfo([i.typeInfo,n.typeInfo]);return new oe(a>>h,p)}case\">\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g>h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p>a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a>p?1:0);return new Vt(h,n.typeInfo)}return new oe(o>s?1:0,this.getTypeInfo(\"bool\"));case\"<\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g<h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p<a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a<p?1:0);return new Vt(h,n.typeInfo)}return new oe(o<s?1:0,this.getTypeInfo(\"bool\"));case\"==\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g===h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p==a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a==p?1:0);return new Vt(h,n.typeInfo)}return new oe(o===s?1:0,this.getTypeInfo(\"bool\"));case\"!=\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g!==h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p!==a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a!==p?1:0);return new Vt(h,n.typeInfo)}return new oe(o!==s?1:0,this.getTypeInfo(\"bool\"));case\">=\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g>=h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p>=a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a>=p?1:0);return new Vt(h,n.typeInfo)}return new oe(o>=s?1:0,this.getTypeInfo(\"bool\"));case\"<=\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g<=h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p<=a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a<=p?1:0);return new Vt(h,n.typeInfo)}return new oe(o<=s?1:0,this.getTypeInfo(\"bool\"));case\"&&\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g&&h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p&&a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a&&p?1:0);return new Vt(h,n.typeInfo)}return new oe(o&&s?1:0,this.getTypeInfo(\"bool\"));case\"||\":if(dr(o)&&dr(s)){let a=o,h=s;if(a.length!==h.length)return console.error(`Vector length mismatch. Line ${t.line}.`),null;let p=a.map((g,w)=>g||h[w]?1:0);return new Vt(p,i.typeInfo)}if(dr(o)){let a=s,h=o.map((p,g)=>p||a?1:0);return new Vt(h,i.typeInfo)}if(dr(s)){let a=o,h=s.map((p,g)=>a||p?1:0);return new Vt(h,n.typeInfo)}return new oe(o||s?1:0,this.getTypeInfo(\"bool\"))}return console.error(`Unknown operator ${t.operator}. Line ${t.line}`),null}_evalCall(t,r){if(t.cachedReturnValue!==null)return t.cachedReturnValue;let i=r.clone();i.currentFunctionName=t.name;let n=r.getFunction(t.name);if(!n)return t.isBuiltin?this._callBuiltinFunction(t,i):this.getTypeInfo(t.name)?this._evalCreate(t,r):(console.error(`Unknown function \"${t.name}\". Line ${t.line}`),null);for(let o=0;o<n.node.args.length;++o){let s=n.node.args[o],a=this.evalExpression(t.args[o],i);i.createVariable(s.name,a,s)}return this._execStatements(n.node.body,i)}_callBuiltinFunction(t,r){switch(t.name){case\"all\":return this.builtins.All(t,r);case\"any\":return this.builtins.Any(t,r);case\"select\":return this.builtins.Select(t,r);case\"arrayLength\":return this.builtins.ArrayLength(t,r);case\"abs\":return this.builtins.Abs(t,r);case\"acos\":return this.builtins.Acos(t,r);case\"acosh\":return this.builtins.Acosh(t,r);case\"asin\":return this.builtins.Asin(t,r);case\"asinh\":return this.builtins.Asinh(t,r);case\"atan\":return this.builtins.Atan(t,r);case\"atanh\":return this.builtins.Atanh(t,r);case\"atan2\":return this.builtins.Atan2(t,r);case\"ceil\":return this.builtins.Ceil(t,r);case\"clamp\":return this.builtins.Clamp(t,r);case\"cos\":return this.builtins.Cos(t,r);case\"cosh\":return this.builtins.Cosh(t,r);case\"countLeadingZeros\":return this.builtins.CountLeadingZeros(t,r);case\"countOneBits\":return this.builtins.CountOneBits(t,r);case\"countTrailingZeros\":return this.builtins.CountTrailingZeros(t,r);case\"cross\":return this.builtins.Cross(t,r);case\"degrees\":return this.builtins.Degrees(t,r);case\"determinant\":return this.builtins.Determinant(t,r);case\"distance\":return this.builtins.Distance(t,r);case\"dot\":return this.builtins.Dot(t,r);case\"dot4U8Packed\":return this.builtins.Dot4U8Packed(t,r);case\"dot4I8Packed\":return this.builtins.Dot4I8Packed(t,r);case\"exp\":return this.builtins.Exp(t,r);case\"exp2\":return this.builtins.Exp2(t,r);case\"extractBits\":return this.builtins.ExtractBits(t,r);case\"faceForward\":return this.builtins.FaceForward(t,r);case\"firstLeadingBit\":return this.builtins.FirstLeadingBit(t,r);case\"firstTrailingBit\":return this.builtins.FirstTrailingBit(t,r);case\"floor\":return this.builtins.Floor(t,r);case\"fma\":return this.builtins.Fma(t,r);case\"fract\":return this.builtins.Fract(t,r);case\"frexp\":return this.builtins.Frexp(t,r);case\"insertBits\":return this.builtins.InsertBits(t,r);case\"inverseSqrt\":return this.builtins.InverseSqrt(t,r);case\"ldexp\":return this.builtins.Ldexp(t,r);case\"length\":return this.builtins.Length(t,r);case\"log\":return this.builtins.Log(t,r);case\"log2\":return this.builtins.Log2(t,r);case\"max\":return this.builtins.Max(t,r);case\"min\":return this.builtins.Min(t,r);case\"mix\":return this.builtins.Mix(t,r);case\"modf\":return this.builtins.Modf(t,r);case\"normalize\":return this.builtins.Normalize(t,r);case\"pow\":return this.builtins.Pow(t,r);case\"quantizeToF16\":return this.builtins.QuantizeToF16(t,r);case\"radians\":return this.builtins.Radians(t,r);case\"reflect\":return this.builtins.Reflect(t,r);case\"refract\":return this.builtins.Refract(t,r);case\"reverseBits\":return this.builtins.ReverseBits(t,r);case\"round\":return this.builtins.Round(t,r);case\"saturate\":return this.builtins.Saturate(t,r);case\"sign\":return this.builtins.Sign(t,r);case\"sin\":return this.builtins.Sin(t,r);case\"sinh\":return this.builtins.Sinh(t,r);case\"smoothstep\":return this.builtins.SmoothStep(t,r);case\"sqrt\":return this.builtins.Sqrt(t,r);case\"step\":return this.builtins.Step(t,r);case\"tan\":return this.builtins.Tan(t,r);case\"tanh\":return this.builtins.Tanh(t,r);case\"transpose\":return this.builtins.Transpose(t,r);case\"trunc\":return this.builtins.Trunc(t,r);case\"dpdx\":return this.builtins.Dpdx(t,r);case\"dpdxCoarse\":return this.builtins.DpdxCoarse(t,r);case\"dpdxFine\":return this.builtins.DpdxFine(t,r);case\"dpdy\":return this.builtins.Dpdy(t,r);case\"dpdyCoarse\":return this.builtins.DpdyCoarse(t,r);case\"dpdyFine\":return this.builtins.DpdyFine(t,r);case\"fwidth\":return this.builtins.Fwidth(t,r);case\"fwidthCoarse\":return this.builtins.FwidthCoarse(t,r);case\"fwidthFine\":return this.builtins.FwidthFine(t,r);case\"textureDimensions\":return this.builtins.TextureDimensions(t,r);case\"textureGather\":return this.builtins.TextureGather(t,r);case\"textureGatherCompare\":return this.builtins.TextureGatherCompare(t,r);case\"textureLoad\":return this.builtins.TextureLoad(t,r);case\"textureNumLayers\":return this.builtins.TextureNumLayers(t,r);case\"textureNumLevels\":return this.builtins.TextureNumLevels(t,r);case\"textureNumSamples\":return this.builtins.TextureNumSamples(t,r);case\"textureSample\":return this.builtins.TextureSample(t,r);case\"textureSampleBias\":return this.builtins.TextureSampleBias(t,r);case\"textureSampleCompare\":return this.builtins.TextureSampleCompare(t,r);case\"textureSampleCompareLevel\":return this.builtins.TextureSampleCompareLevel(t,r);case\"textureSampleGrad\":return this.builtins.TextureSampleGrad(t,r);case\"textureSampleLevel\":return this.builtins.TextureSampleLevel(t,r);case\"textureSampleBaseClampToEdge\":return this.builtins.TextureSampleBaseClampToEdge(t,r);case\"textureStore\":return this.builtins.TextureStore(t,r);case\"atomicLoad\":return this.builtins.AtomicLoad(t,r);case\"atomicStore\":return this.builtins.AtomicStore(t,r);case\"atomicAdd\":return this.builtins.AtomicAdd(t,r);case\"atomicSub\":return this.builtins.AtomicSub(t,r);case\"atomicMax\":return this.builtins.AtomicMax(t,r);case\"atomicMin\":return this.builtins.AtomicMin(t,r);case\"atomicAnd\":return this.builtins.AtomicAnd(t,r);case\"atomicOr\":return this.builtins.AtomicOr(t,r);case\"atomicXor\":return this.builtins.AtomicXor(t,r);case\"atomicExchange\":return this.builtins.AtomicExchange(t,r);case\"atomicCompareExchangeWeak\":return this.builtins.AtomicCompareExchangeWeak(t,r);case\"pack4x8snorm\":return this.builtins.Pack4x8snorm(t,r);case\"pack4x8unorm\":return this.builtins.Pack4x8unorm(t,r);case\"pack4xI8\":return this.builtins.Pack4xI8(t,r);case\"pack4xU8\":return this.builtins.Pack4xU8(t,r);case\"pack4x8Clamp\":return this.builtins.Pack4x8Clamp(t,r);case\"pack4xU8Clamp\":return this.builtins.Pack4xU8Clamp(t,r);case\"pack2x16snorm\":return this.builtins.Pack2x16snorm(t,r);case\"pack2x16unorm\":return this.builtins.Pack2x16unorm(t,r);case\"pack2x16float\":return this.builtins.Pack2x16float(t,r);case\"unpack4x8snorm\":return this.builtins.Unpack4x8snorm(t,r);case\"unpack4x8unorm\":return this.builtins.Unpack4x8unorm(t,r);case\"unpack4xI8\":return this.builtins.Unpack4xI8(t,r);case\"unpack4xU8\":return this.builtins.Unpack4xU8(t,r);case\"unpack2x16snorm\":return this.builtins.Unpack2x16snorm(t,r);case\"unpack2x16unorm\":return this.builtins.Unpack2x16unorm(t,r);case\"unpack2x16float\":return this.builtins.Unpack2x16float(t,r);case\"storageBarrier\":return this.builtins.StorageBarrier(t,r);case\"textureBarrier\":return this.builtins.TextureBarrier(t,r);case\"workgroupBarrier\":return this.builtins.WorkgroupBarrier(t,r);case\"workgroupUniformLoad\":return this.builtins.WorkgroupUniformLoad(t,r);case\"subgroupAdd\":return this.builtins.SubgroupAdd(t,r);case\"subgroupExclusiveAdd\":return this.builtins.SubgroupExclusiveAdd(t,r);case\"subgroupInclusiveAdd\":return this.builtins.SubgroupInclusiveAdd(t,r);case\"subgroupAll\":return this.builtins.SubgroupAll(t,r);case\"subgroupAnd\":return this.builtins.SubgroupAnd(t,r);case\"subgroupAny\":return this.builtins.SubgroupAny(t,r);case\"subgroupBallot\":return this.builtins.SubgroupBallot(t,r);case\"subgroupBroadcast\":return this.builtins.SubgroupBroadcast(t,r);case\"subgroupBroadcastFirst\":return this.builtins.SubgroupBroadcastFirst(t,r);case\"subgroupElect\":return this.builtins.SubgroupElect(t,r);case\"subgroupMax\":return this.builtins.SubgroupMax(t,r);case\"subgroupMin\":return this.builtins.SubgroupMin(t,r);case\"subgroupMul\":return this.builtins.SubgroupMul(t,r);case\"subgroupExclusiveMul\":return this.builtins.SubgroupExclusiveMul(t,r);case\"subgroupInclusiveMul\":return this.builtins.SubgroupInclusiveMul(t,r);case\"subgroupOr\":return this.builtins.SubgroupOr(t,r);case\"subgroupShuffle\":return this.builtins.SubgroupShuffle(t,r);case\"subgroupShuffleDown\":return this.builtins.SubgroupShuffleDown(t,r);case\"subgroupShuffleUp\":return this.builtins.SubgroupShuffleUp(t,r);case\"subgroupShuffleXor\":return this.builtins.SubgroupShuffleXor(t,r);case\"subgroupXor\":return this.builtins.SubgroupXor(t,r);case\"quadBroadcast\":return this.builtins.QuadBroadcast(t,r);case\"quadSwapDiagonal\":return this.builtins.QuadSwapDiagonal(t,r);case\"quadSwapX\":return this.builtins.QuadSwapX(t,r);case\"quadSwapY\":return this.builtins.QuadSwapY(t,r)}let i=r.getFunction(t.name);if(i){let n=r.clone();for(let o=0;o<i.node.args.length;++o){let s=i.node.args[o],a=this.evalExpression(t.args[o],n);n.setVariable(s.name,a,s)}return this._execStatements(i.node.body,n)}return null}_callConstructorValue(t,r){if(!t.args||t.args.length===0)return new oe(0,this.getTypeInfo(t.type));let i=this.evalExpression(t.args[0],r);return i.typeInfo=this.getTypeInfo(t.type),i.getSubData(this,t.postfix,r).clone()}_callConstructorVec(t,r){let i=this.getTypeInfo(t.type),n=t.type.getTypeName(),o=sH[n];if(o===void 0)return console.error(`Invalid vec constructor ${n}. Line ${t.line}`),null;let s=[];if(t instanceof js)if(t.isVector){let a=t.vectorValue;for(let h of a)s.push(h)}else s.push(t.scalarValue);else if(t.args)for(let a of t.args){let h=this.evalExpression(a,r);if(h instanceof Vt){let p=h.data;for(let g=0;g<p.length;++g){let w=p[g];s.push(w)}}else if(h instanceof oe){let p=h.value;s.push(p)}}if(t.type instanceof ce&&t.type.format===null&&(t.type.format=ce.f32),s.length===0){let a=new Array(o).fill(0);return new Vt(a,i).getSubData(this,t.postfix,r)}if(s.length===1)for(;s.length<o;)s.push(s[0]);return s.length<o?(console.error(`Invalid vec constructor. Line ${t.line}`),null):new Vt(s.length>o?s.slice(0,o):s,i).getSubData(this,t.postfix,r)}_callConstructorMatrix(t,r){let i=this.getTypeInfo(t.type),n=t.type.getTypeName(),o=Dc[n];if(o===void 0)return console.error(`Invalid matrix constructor ${n}. Line ${t.line}`),null;let s=[];if(t instanceof js)if(t.isVector){let a=t.vectorValue;for(let h of a)s.push(h)}else s.push(t.scalarValue);else if(t.args)for(let a of t.args){let h=this.evalExpression(a,r);h instanceof Vt?s.push(...h.data):h instanceof oe?s.push(h.value):h instanceof ui&&s.push(...h.data)}if(i instanceof Pg&&i.format===null&&(i.format=this.getTypeInfo(\"f32\")),s.length===0){let a=new Array(o[2]).fill(0);return new ui(a,i).getSubData(this,t.postfix,r)}return s.length!==o[2]?(console.error(`Invalid matrix constructor. Line ${t.line}`),null):new ui(s,i).getSubData(this,t.postfix,r)}};p3._breakObj=new Pd(new bu(\"BREAK\",null),null),p3._continueObj=new Pd(new bu(\"CONTINUE\",null),null),p3._priority=new Map([[\"f32\",0],[\"f16\",1],[\"u32\",2],[\"i32\",3],[\"x32\",3]]);var SH=class{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}},MH=class{constructor(){this._tokens=[],this._current=0,this._currentLine=1,this._deferArrayCountEval=[],this._currentLoop=[],this._context=new SH,this._exec=new p3,this._forwardTypeCount=0}parse(t){this._initialize(t),this._deferArrayCountEval.length=0;let r=[];for(;!this._isAtEnd();){let i=this._global_decl_or_directive();if(!i)break;r.push(i)}if(this._deferArrayCountEval.length>0){for(let i of this._deferArrayCountEval){let n=i.arrayType,o=i.countNode;if(o instanceof Oc){let s=o.name,a=this._context.constants.get(s);if(a)try{let h=a.constEvaluate(this._exec);n.count=h}catch{}}}this._deferArrayCountEval.length=0}if(this._forwardTypeCount>0)for(let i of r)i.search(n=>{n instanceof uO||n instanceof d3?n.type=this._forwardType(n.type):n instanceof rb?n.format=this._forwardType(n.format):n instanceof Nf||n instanceof eb||n instanceof h3?n.type=this._forwardType(n.type):n instanceof nb?n.returnType=this._forwardType(n.returnType):n instanceof cO&&(n.type=this._forwardType(n.type))});return r}_forwardType(t){if(t instanceof rO){let r=this._getType(t.name);if(r)return r}else t instanceof d3?t.type=this._forwardType(t.type):t instanceof rb&&(t.format=this._forwardType(t.format));return t}_initialize(t){if(t)if(typeof t==\"string\"){let r=new yH(t);this._tokens=r.scanTokens()}else this._tokens=t;else this._tokens=[];this._current=0}_updateNode(t,r){return t.line=r??this._currentLine,t}_error(t,r){return{token:t,message:r,toString:()=>`${r}`}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==Lt.eof}_match(t){if(t instanceof ie)return!!this._check(t)&&(this._advance(),!0);for(let r=0,i=t.length;r<i;++r){let n=t[r];if(this._check(n))return this._advance(),!0}return!1}_consume(t,r){if(this._check(t))return this._advance();throw this._error(this._peek(),`${r}. Line:${this._currentLine}`)}_check(t){if(this._isAtEnd())return!1;let r=this._peek();if(t instanceof Array){let i=r.type,n=!1;for(let o of t){if(i===o)return!0;o===Lt.tokens.name&&(n=!0)}if(n){let o=Lt.tokens.name.rule.exec(r.lexeme);if(o&&o.index==0&&o[0]==r.lexeme)return!0}return!1}if(r.type===t)return!0;if(t===Lt.tokens.name){let i=Lt.tokens.name.rule.exec(r.lexeme);return i&&i.index==0&&i[0]==r.lexeme}return!1}_advance(){var t,r;return this._currentLine=(r=(t=this._peek())===null||t===void 0?void 0:t.line)!==null&&r!==void 0?r:-1,this._isAtEnd()||this._current++,this._previous()}_peek(){return this._tokens[this._current]}_previous(){return this._tokens[this._current-1]}_global_decl_or_directive(){for(;this._match(Lt.tokens.semicolon)&&!this._isAtEnd(););if(this._match(Lt.keywords.alias)){let r=this._type_alias();return this._consume(Lt.tokens.semicolon,\"Expected ';'\"),this._exec.reflection.updateAST([r]),r}if(this._match(Lt.keywords.diagnostic)){let r=this._diagnostic();return this._consume(Lt.tokens.semicolon,\"Expected ';'\"),this._exec.reflection.updateAST([r]),r}if(this._match(Lt.keywords.requires)){let r=this._requires_directive();return this._consume(Lt.tokens.semicolon,\"Expected ';'\"),this._exec.reflection.updateAST([r]),r}if(this._match(Lt.keywords.enable)){let r=this._enable_directive();return this._consume(Lt.tokens.semicolon,\"Expected ';'\"),this._exec.reflection.updateAST([r]),r}let t=this._attribute();if(this._check(Lt.keywords.var)){let r=this._global_variable_decl();return r!=null&&(r.attributes=t),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),this._exec.reflection.updateAST([r]),r}if(this._check(Lt.keywords.override)){let r=this._override_variable_decl();return r!=null&&(r.attributes=t),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),this._exec.reflection.updateAST([r]),r}if(this._check(Lt.keywords.let)){let r=this._global_let_decl();return r!=null&&(r.attributes=t),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),this._exec.reflection.updateAST([r]),r}if(this._check(Lt.keywords.const)){let r=this._global_const_decl();return r!=null&&(r.attributes=t),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),this._exec.reflection.updateAST([r]),r}if(this._check(Lt.keywords.struct)){let r=this._struct_decl();return r!=null&&(r.attributes=t),this._exec.reflection.updateAST([r]),r}if(this._check(Lt.keywords.fn)){let r=this._function_decl();return r!=null&&(r.attributes=t),this._exec.reflection.updateAST([r]),r}return null}_function_decl(){if(!this._match(Lt.keywords.fn))return null;let t=this._currentLine,r=this._consume(Lt.tokens.ident,\"Expected function name.\").toString();this._consume(Lt.tokens.paren_left,\"Expected '(' for function arguments.\");let i=[];if(!this._check(Lt.tokens.paren_right))do{if(this._check(Lt.tokens.paren_right))break;let a=this._attribute(),h=this._consume(Lt.tokens.name,\"Expected argument name.\").toString();this._consume(Lt.tokens.colon,\"Expected ':' for argument type.\");let p=this._attribute(),g=this._type_decl();g!=null&&(g.attributes=p,i.push(this._updateNode(new cO(h,g,a))))}while(this._match(Lt.tokens.comma));this._consume(Lt.tokens.paren_right,\"Expected ')' after function arguments.\");let n=null;if(this._match(Lt.tokens.arrow)){let a=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=a)}let o=this._compound_statement(),s=this._currentLine;return this._updateNode(new nb(r,i,n,o,t,s),t)}_compound_statement(){let t=[];for(this._consume(Lt.tokens.brace_left,\"Expected '{' for block.\");!this._check(Lt.tokens.brace_right);){let r=this._statement();r!==null&&t.push(r)}return this._consume(Lt.tokens.brace_right,\"Expected '}' for block.\"),t}_statement(){for(;this._match(Lt.tokens.semicolon)&&!this._isAtEnd(););if(this._check(Lt.tokens.attr)&&this._attribute(),this._check(Lt.keywords.if))return this._if_statement();if(this._check(Lt.keywords.switch))return this._switch_statement();if(this._check(Lt.keywords.loop))return this._loop_statement();if(this._check(Lt.keywords.for))return this._for_statement();if(this._check(Lt.keywords.while))return this._while_statement();if(this._check(Lt.keywords.continuing))return this._continuing_statement();if(this._check(Lt.keywords.static_assert))return this._static_assert_statement();if(this._check(Lt.tokens.brace_left))return this._compound_statement();let t=null;if(this._check(Lt.keywords.return))t=this._return_statement();else if(this._check([Lt.keywords.var,Lt.keywords.let,Lt.keywords.const]))t=this._variable_statement();else if(this._match(Lt.keywords.discard))t=this._updateNode(new gH);else if(this._match(Lt.keywords.break)){let r=this._updateNode(new tO);if(this._currentLoop.length>0){let i=this._currentLoop[this._currentLoop.length-1];r.loopId=i.id}t=r,this._check(Lt.keywords.if)&&(this._advance(),r.condition=this._optional_paren_expression())}else if(this._match(Lt.keywords.continue)){let r=this._updateNode(new eO);if(!(this._currentLoop.length>0))throw this._error(this._peek(),`Continue statement must be inside a loop. Line: ${r.line}`);{let i=this._currentLoop[this._currentLoop.length-1];r.loopId=i.id}t=r}else t=this._increment_decrement_statement()||this._func_call_statement()||this._assignment_statement();return t!=null&&this._consume(Lt.tokens.semicolon,\"Expected ';' after statement.\"),t}_static_assert_statement(){if(!this._match(Lt.keywords.static_assert))return null;let t=this._currentLine,r=this._optional_paren_expression();return this._updateNode(new fH(r),t)}_while_statement(){if(!this._match(Lt.keywords.while))return null;let t=this._updateNode(new WD(null,null));return this._currentLoop.push(t),t.condition=this._optional_paren_expression(),this._check(Lt.tokens.attr)&&this._attribute(),t.body=this._compound_statement(),this._currentLoop.pop(),t}_continuing_statement(){let t=this._currentLoop.length>0?this._currentLoop[this._currentLoop.length-1].id:-1;if(!this._match(Lt.keywords.continuing))return null;let r=this._currentLine,i=this._compound_statement();return this._updateNode(new kE(i,t),r)}_for_statement(){if(!this._match(Lt.keywords.for))return null;this._consume(Lt.tokens.paren_left,\"Expected '('.\");let t=this._updateNode(new qD(null,null,null,null));return this._currentLoop.push(t),t.init=this._check(Lt.tokens.semicolon)?null:this._for_init(),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),t.condition=this._check(Lt.tokens.semicolon)?null:this._short_circuit_or_expression(),this._consume(Lt.tokens.semicolon,\"Expected ';'.\"),t.increment=this._check(Lt.tokens.paren_right)?null:this._for_increment(),this._consume(Lt.tokens.paren_right,\"Expected ')'.\"),this._check(Lt.tokens.attr)&&this._attribute(),t.body=this._compound_statement(),this._currentLoop.pop(),t}_for_init(){return this._variable_statement()||this._func_call_statement()||this._assignment_statement()}_for_increment(){return this._func_call_statement()||this._increment_decrement_statement()||this._assignment_statement()}_variable_statement(){if(this._check(Lt.keywords.var)){let t=this._variable_decl();if(t===null)throw this._error(this._peek(),\"Variable declaration expected.\");let r=null;return this._match(Lt.tokens.equal)&&(r=this._short_circuit_or_expression()),this._updateNode(new Nf(t.name,t.type,t.storage,t.access,r),t.line)}if(this._match(Lt.keywords.let)){let t=this._currentLine,r=this._consume(Lt.tokens.name,\"Expected name for let.\").toString(),i=null;if(this._match(Lt.tokens.colon)){let o=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=o)}this._consume(Lt.tokens.equal,\"Expected '=' for let.\");let n=this._short_circuit_or_expression();return this._updateNode(new eb(r,i,null,null,n),t)}if(this._match(Lt.keywords.const)){let t=this._currentLine,r=this._consume(Lt.tokens.name,\"Expected name for const.\").toString(),i=null;if(this._match(Lt.tokens.colon)){let o=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=o)}this._consume(Lt.tokens.equal,\"Expected '=' for const.\");let n=this._short_circuit_or_expression();return i===null&&n instanceof js&&(i=n.type),this._updateNode(new h3(r,i,null,null,n),t)}return null}_increment_decrement_statement(){let t=this._current,r=this._unary_expression();if(r==null)return null;if(!this._check(Lt.increment_operators))return this._current=t,null;let i=this._consume(Lt.increment_operators,\"Expected increment operator\");return this._updateNode(new HD(i.type===Lt.tokens.plus_plus?c3.increment:c3.decrement,r))}_assignment_statement(){let t=null,r=this._currentLine;if(this._check(Lt.tokens.brace_right))return null;let i=this._match(Lt.tokens.underscore);if(i||(t=this._unary_expression()),!i&&t==null)return null;let n=this._consume(Lt.assignment_operators,\"Expected assignment operator.\"),o=this._short_circuit_or_expression();return this._updateNode(new YD(CE.parse(n.lexeme),t,o),r)}_func_call_statement(){if(!this._check(Lt.tokens.ident))return null;let t=this._currentLine,r=this._current,i=this._consume(Lt.tokens.ident,\"Expected function name.\"),n=this._argument_expression_list();return n===null?(this._current=r,null):this._updateNode(new DE(i.lexeme,n),t)}_loop_statement(){if(!this._match(Lt.keywords.loop))return null;this._check(Lt.tokens.attr)&&this._attribute(),this._consume(Lt.tokens.brace_left,\"Expected '{' for loop.\");let t=this._updateNode(new XD([],null));this._currentLoop.push(t);let r=this._statement();for(;r!==null;){if(Array.isArray(r))for(let i of r)t.body.push(i);else t.body.push(r);if(r instanceof kE){t.continuing=r;break}r=this._statement()}return this._currentLoop.pop(),this._consume(Lt.tokens.brace_right,\"Expected '}' for loop.\"),t}_switch_statement(){if(!this._match(Lt.keywords.switch))return null;let t=this._updateNode(new ZD(null,[]));if(this._currentLoop.push(t),t.condition=this._optional_paren_expression(),this._check(Lt.tokens.attr)&&this._attribute(),this._consume(Lt.tokens.brace_left,\"Expected '{' for switch.\"),t.cases=this._switch_body(),t.cases==null||t.cases.length==0)throw this._error(this._previous(),\"Expected 'case' or 'default'.\");return this._consume(Lt.tokens.brace_right,\"Expected '}' for switch.\"),this._currentLoop.pop(),t}_switch_body(){let t=[],r=!1;for(;this._check([Lt.keywords.default,Lt.keywords.case]);){if(this._match(Lt.keywords.case)){let i=this._case_selectors();for(let o of i)if(o instanceof f3){if(r)throw this._error(this._previous(),\"Multiple default cases in switch statement.\");r=!0;break}this._match(Lt.tokens.colon),this._check(Lt.tokens.attr)&&this._attribute(),this._consume(Lt.tokens.brace_left,\"Exected '{' for switch case.\");let n=this._case_body();this._consume(Lt.tokens.brace_right,\"Exected '}' for switch case.\"),t.push(this._updateNode(new aO(i,n)))}if(this._match(Lt.keywords.default)){if(r)throw this._error(this._previous(),\"Multiple default cases in switch statement.\");this._match(Lt.tokens.colon),this._check(Lt.tokens.attr)&&this._attribute(),this._consume(Lt.tokens.brace_left,\"Exected '{' for switch default.\");let i=this._case_body();this._consume(Lt.tokens.brace_right,\"Exected '}' for switch default.\"),t.push(this._updateNode(new lO(i)))}}return t}_case_selectors(){let t=[];for(this._match(Lt.keywords.default)?t.push(this._updateNode(new f3)):t.push(this._shift_expression());this._match(Lt.tokens.comma);)this._match(Lt.keywords.default)?t.push(this._updateNode(new f3)):t.push(this._shift_expression());return t}_case_body(){if(this._match(Lt.keywords.fallthrough))return this._consume(Lt.tokens.semicolon,\"Expected ';'\"),[];let t=this._statement();if(t==null)return[];t instanceof Array||(t=[t]);let r=this._case_body();return r.length==0?t:[...t,r[0]]}_if_statement(){if(!this._match(Lt.keywords.if))return null;let t=this._currentLine,r=this._optional_paren_expression();this._check(Lt.tokens.attr)&&this._attribute();let i=this._compound_statement(),n=[];this._match_elseif()&&(this._check(Lt.tokens.attr)&&this._attribute(),n=this._elseif_statement(n));let o=null;return this._match(Lt.keywords.else)&&(this._check(Lt.tokens.attr)&&this._attribute(),o=this._compound_statement()),this._updateNode(new KD(r,i,n,o),t)}_match_elseif(){return this._tokens[this._current].type===Lt.keywords.else&&this._tokens[this._current+1].type===Lt.keywords.if&&(this._advance(),this._advance(),!0)}_elseif_statement(t=[]){let r=this._optional_paren_expression(),i=this._compound_statement();return t.push(this._updateNode(new AH(r,i))),this._match_elseif()&&(this._check(Lt.tokens.attr)&&this._attribute(),this._elseif_statement(t)),t}_return_statement(){if(!this._match(Lt.keywords.return))return null;let t=this._short_circuit_or_expression();return this._updateNode(new QD(t))}_short_circuit_or_expression(){let t=this._short_circuit_and_expr();for(;this._match(Lt.tokens.or_or);)t=this._updateNode(new Ah(this._previous().toString(),t,this._short_circuit_and_expr()));return t}_short_circuit_and_expr(){let t=this._inclusive_or_expression();for(;this._match(Lt.tokens.and_and);)t=this._updateNode(new Ah(this._previous().toString(),t,this._inclusive_or_expression()));return t}_inclusive_or_expression(){let t=this._exclusive_or_expression();for(;this._match(Lt.tokens.or);)t=this._updateNode(new Ah(this._previous().toString(),t,this._exclusive_or_expression()));return t}_exclusive_or_expression(){let t=this._and_expression();for(;this._match(Lt.tokens.xor);)t=this._updateNode(new Ah(this._previous().toString(),t,this._and_expression()));return t}_and_expression(){let t=this._equality_expression();for(;this._match(Lt.tokens.and);)t=this._updateNode(new Ah(this._previous().toString(),t,this._equality_expression()));return t}_equality_expression(){let t=this._relational_expression();return this._match([Lt.tokens.equal_equal,Lt.tokens.not_equal])?this._updateNode(new Ah(this._previous().toString(),t,this._relational_expression())):t}_relational_expression(){let t=this._shift_expression();for(;this._match([Lt.tokens.less_than,Lt.tokens.greater_than,Lt.tokens.less_than_equal,Lt.tokens.greater_than_equal]);)t=this._updateNode(new Ah(this._previous().toString(),t,this._shift_expression()));return t}_shift_expression(){let t=this._additive_expression();for(;this._match([Lt.tokens.shift_left,Lt.tokens.shift_right]);)t=this._updateNode(new Ah(this._previous().toString(),t,this._additive_expression()));return t}_additive_expression(){let t=this._multiplicative_expression();for(;this._match([Lt.tokens.plus,Lt.tokens.minus]);)t=this._updateNode(new Ah(this._previous().toString(),t,this._multiplicative_expression()));return t}_multiplicative_expression(){let t=this._unary_expression();for(;this._match([Lt.tokens.star,Lt.tokens.forward_slash,Lt.tokens.modulo]);)t=this._updateNode(new Ah(this._previous().toString(),t,this._unary_expression()));return t}_unary_expression(){return this._match([Lt.tokens.minus,Lt.tokens.bang,Lt.tokens.tilde,Lt.tokens.star,Lt.tokens.and])?this._updateNode(new _s(this._previous().toString(),this._unary_expression())):this._singular_expression()}_singular_expression(){let t=this._primary_expression(),r=this._postfix_expression();return r&&(t.postfix=r),t}_postfix_expression(){if(this._match(Lt.tokens.bracket_left)){let t=this._short_circuit_or_expression();this._consume(Lt.tokens.bracket_right,\"Expected ']'.\");let r=this._updateNode(new l1(t)),i=this._postfix_expression();return i&&(r.postfix=i),r}if(this._match(Lt.tokens.period)){let t=this._consume(Lt.tokens.name,\"Expected member name.\"),r=this._postfix_expression(),i=this._updateNode(new Cg(t.lexeme));return r&&(i.postfix=r),i}return null}_getStruct(t){return this._context.aliases.has(t)?this._context.aliases.get(t).type:this._context.structs.has(t)?this._context.structs.get(t):null}_getType(t){let r=this._getStruct(t);if(r!==null)return r;switch(t){case\"void\":return Ne.void;case\"bool\":return Ne.bool;case\"i32\":return Ne.i32;case\"u32\":return Ne.u32;case\"f32\":return Ne.f32;case\"f16\":return Ne.f16;case\"vec2f\":return ce.vec2f;case\"vec3f\":return ce.vec3f;case\"vec4f\":return ce.vec4f;case\"vec2i\":return ce.vec2i;case\"vec3i\":return ce.vec3i;case\"vec4i\":return ce.vec4i;case\"vec2u\":return ce.vec2u;case\"vec3u\":return ce.vec3u;case\"vec4u\":return ce.vec4u;case\"vec2h\":return ce.vec2h;case\"vec3h\":return ce.vec3h;case\"vec4h\":return ce.vec4h;case\"mat2x2f\":return ce.mat2x2f;case\"mat2x3f\":return ce.mat2x3f;case\"mat2x4f\":return ce.mat2x4f;case\"mat3x2f\":return ce.mat3x2f;case\"mat3x3f\":return ce.mat3x3f;case\"mat3x4f\":return ce.mat3x4f;case\"mat4x2f\":return ce.mat4x2f;case\"mat4x3f\":return ce.mat4x3f;case\"mat4x4f\":return ce.mat4x4f;case\"mat2x2h\":return ce.mat2x2h;case\"mat2x3h\":return ce.mat2x3h;case\"mat2x4h\":return ce.mat2x4h;case\"mat3x2h\":return ce.mat3x2h;case\"mat3x3h\":return ce.mat3x3h;case\"mat3x4h\":return ce.mat3x4h;case\"mat4x2h\":return ce.mat4x2h;case\"mat4x3h\":return ce.mat4x3h;case\"mat4x4h\":return ce.mat4x4h;case\"mat2x2i\":return ce.mat2x2i;case\"mat2x3i\":return ce.mat2x3i;case\"mat2x4i\":return ce.mat2x4i;case\"mat3x2i\":return ce.mat3x2i;case\"mat3x3i\":return ce.mat3x3i;case\"mat3x4i\":return ce.mat3x4i;case\"mat4x2i\":return ce.mat4x2i;case\"mat4x3i\":return ce.mat4x3i;case\"mat4x4i\":return ce.mat4x4i;case\"mat2x2u\":return ce.mat2x2u;case\"mat2x3u\":return ce.mat2x3u;case\"mat2x4u\":return ce.mat2x4u;case\"mat3x2u\":return ce.mat3x2u;case\"mat3x3u\":return ce.mat3x3u;case\"mat3x4u\":return ce.mat3x4u;case\"mat4x2u\":return ce.mat4x2u;case\"mat4x3u\":return ce.mat4x3u;case\"mat4x4u\":return ce.mat4x4u}return null}_validateTypeRange(t,r){if(r.name===\"i32\"){if(t<-2147483648||t>2147483647)throw this._error(this._previous(),`Value out of range for i32: ${t}. Line: ${this._currentLine}.`)}else if(r.name===\"u32\"&&(t<0||t>4294967295))throw this._error(this._previous(),`Value out of range for u32: ${t}. Line: ${this._currentLine}.`)}_primary_expression(){if(this._match(Lt.tokens.ident)){let i=this._previous().toString();if(this._check(Lt.tokens.paren_left)){let n=this._argument_expression_list(),o=this._getType(i);return o!==null?this._updateNode(new Md(o,n)):this._updateNode(new LE(i,n))}if(this._context.constants.has(i)){let n=this._context.constants.get(i);return this._updateNode(new iO(i,n.value))}return this._updateNode(new Oc(i))}if(this._match(Lt.tokens.int_literal)){let i=this._previous().toString(),n=i.endsWith(\"i\")||i.endsWith(\"i\")?Ne.i32:i.endsWith(\"u\")||i.endsWith(\"U\")?Ne.u32:Ne.x32,o=parseInt(i);return this._validateTypeRange(o,n),this._updateNode(new js(new oe(o,this._exec.getTypeInfo(n)),n))}if(this._match(Lt.tokens.uint_literal)){let i=parseInt(this._previous().toString());return this._validateTypeRange(i,Ne.u32),this._updateNode(new js(new oe(i,this._exec.getTypeInfo(Ne.u32)),Ne.u32))}if(this._match([Lt.tokens.decimal_float_literal,Lt.tokens.hex_float_literal])){let i=this._previous().toString(),n=i.endsWith(\"h\");n&&(i=i.substring(0,i.length-1));let o=parseFloat(i);this._validateTypeRange(o,n?Ne.f16:Ne.f32);let s=n?Ne.f16:Ne.f32;return this._updateNode(new js(new oe(o,this._exec.getTypeInfo(s)),s))}if(this._match([Lt.keywords.true,Lt.keywords.false])){let i=this._previous().toString()===Lt.keywords.true.rule;return this._updateNode(new js(new oe(i?1:0,this._exec.getTypeInfo(Ne.bool)),Ne.bool))}if(this._check(Lt.tokens.paren_left))return this._paren_expression();if(this._match(Lt.keywords.bitcast)){this._consume(Lt.tokens.less_than,\"Expected '<'.\");let i=this._type_decl();this._consume(Lt.tokens.greater_than,\"Expected '>'.\");let n=this._paren_expression();return this._updateNode(new nO(i,n))}let t=this._type_decl(),r=this._argument_expression_list();return this._updateNode(new Md(t,r))}_argument_expression_list(){if(!this._match(Lt.tokens.paren_left))return null;let t=[];do{if(this._check(Lt.tokens.paren_right))break;let r=this._short_circuit_or_expression();t.push(r)}while(this._match(Lt.tokens.comma));return this._consume(Lt.tokens.paren_right,\"Expected ')' for agument list\"),t}_optional_paren_expression(){this._match(Lt.tokens.paren_left);let t=this._short_circuit_or_expression();return this._match(Lt.tokens.paren_right),t}_paren_expression(){this._consume(Lt.tokens.paren_left,\"Expected '('.\");let t=this._short_circuit_or_expression();return this._consume(Lt.tokens.paren_right,\"Expected ')'.\"),t}_struct_decl(){if(!this._match(Lt.keywords.struct))return null;let t=this._currentLine,r=this._consume(Lt.tokens.ident,\"Expected name for struct.\").toString();this._consume(Lt.tokens.brace_left,\"Expected '{' for struct body.\");let i=[];for(;!this._check(Lt.tokens.brace_right);){let s=this._attribute(),a=this._consume(Lt.tokens.name,\"Expected variable name.\").toString();this._consume(Lt.tokens.colon,\"Expected ':' for struct member type.\");let h=this._attribute(),p=this._type_decl();p!=null&&(p.attributes=h),this._check(Lt.tokens.brace_right)?this._match(Lt.tokens.comma):this._consume(Lt.tokens.comma,\"Expected ',' for struct member.\"),i.push(this._updateNode(new uO(a,p,s)))}this._consume(Lt.tokens.brace_right,\"Expected '}' after struct body.\");let n=this._currentLine,o=this._updateNode(new Ff(r,i,t,n),t);return this._context.structs.set(r,o),o}_global_variable_decl(){let t=this._variable_decl();if(!t)return null;if(this._match(Lt.tokens.equal)){let r=this._const_expression();t.value=r}if(t.type!==null&&t.value instanceof js){if(t.value.type.name!==\"x32\"&&t.type.getTypeName()!==t.value.type.getTypeName())throw this._error(this._peek(),`Invalid cast from ${t.value.type.name} to ${t.type.name}. Line:${this._currentLine}`);t.value.isScalar&&this._validateTypeRange(t.value.scalarValue,t.type),t.value.type=t.type}else t.type===null&&t.value instanceof js&&(t.type=t.value.type.name===\"x32\"?Ne.i32:t.value.type,t.value.isScalar&&this._validateTypeRange(t.value.scalarValue,t.type));return t}_override_variable_decl(){let t=this._override_decl();return t&&this._match(Lt.tokens.equal)&&(t.value=this._const_expression()),t}_global_const_decl(){var t;if(!this._match(Lt.keywords.const))return null;let r=this._consume(Lt.tokens.name,\"Expected variable name\"),i=this._currentLine,n=null;if(this._match(Lt.tokens.colon)){let h=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=h)}let o=null;this._consume(Lt.tokens.equal,\"const declarations require an assignment\");let s=this._short_circuit_or_expression();try{let h=[Ne.f32],p=s.constEvaluate(this._exec,h);p instanceof oe&&this._validateTypeRange(p.value,h[0]),h[0]instanceof ce&&h[0].format===null&&p.typeInfo instanceof Pg&&p.typeInfo.format!==null&&(p.typeInfo.format.name===\"f16\"?h[0].format=Ne.f16:p.typeInfo.format.name===\"f32\"?h[0].format=Ne.f32:p.typeInfo.format.name===\"i32\"?h[0].format=Ne.i32:p.typeInfo.format.name===\"u32\"?h[0].format=Ne.u32:p.typeInfo.format.name===\"bool\"?h[0].format=Ne.bool:console.error(`TODO: impelement template format type ${p.typeInfo.format.name}`)),o=this._updateNode(new js(p,h[0])),this._exec.context.setVariable(r.toString(),p)}catch{o=s}if(n!==null&&o instanceof js){if(o.type.name!==\"x32\"&&n.getTypeName()!==o.type.getTypeName())throw this._error(this._peek(),`Invalid cast from ${o.type.name} to ${n.name}. Line:${this._currentLine}`);o.type=n,o.isScalar&&this._validateTypeRange(o.scalarValue,o.type)}else n===null&&o instanceof js&&(n=(t=o?.type)!==null&&t!==void 0?t:Ne.f32,n===Ne.x32&&(n=Ne.i32));let a=this._updateNode(new h3(r.toString(),n,\"\",\"\",o),i);return this._context.constants.set(a.name,a),a}_global_let_decl(){if(!this._match(Lt.keywords.let))return null;let t=this._currentLine,r=this._consume(Lt.tokens.name,\"Expected variable name\"),i=null;if(this._match(Lt.tokens.colon)){let o=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=o)}let n=null;if(this._match(Lt.tokens.equal)&&(n=this._const_expression()),i!==null&&n instanceof js){if(n.type.name!==\"x32\"&&i.getTypeName()!==n.type.getTypeName())throw this._error(this._peek(),`Invalid cast from ${n.type.name} to ${i.name}. Line:${this._currentLine}`);n.type=i}else i===null&&n instanceof js&&(i=n.type.name===\"x32\"?Ne.i32:n.type);return n instanceof js&&n.isScalar&&this._validateTypeRange(n.scalarValue,i),this._updateNode(new eb(r.toString(),i,\"\",\"\",n),t)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(Lt.keywords.var))return null;let t=this._currentLine,r=\"\",i=\"\";this._match(Lt.tokens.less_than)&&(r=this._consume(Lt.storage_class,\"Expected storage_class.\").toString(),this._match(Lt.tokens.comma)&&(i=this._consume(Lt.access_mode,\"Expected access_mode.\").toString()),this._consume(Lt.tokens.greater_than,\"Expected '>'.\"));let n=this._consume(Lt.tokens.name,\"Expected variable name\"),o=null;if(this._match(Lt.tokens.colon)){let s=this._attribute();o=this._type_decl(),o!=null&&(o.attributes=s)}return this._updateNode(new Nf(n.toString(),o,r,i,null),t)}_override_decl(){if(!this._match(Lt.keywords.override))return null;let t=this._consume(Lt.tokens.name,\"Expected variable name\"),r=null;if(this._match(Lt.tokens.colon)){let i=this._attribute();r=this._type_decl(),r!=null&&(r.attributes=i)}return this._updateNode(new RE(t.toString(),r,null))}_diagnostic(){this._consume(Lt.tokens.paren_left,\"Expected '('\");let t=this._consume(Lt.tokens.ident,\"Expected severity control name.\");this._consume(Lt.tokens.comma,\"Expected ','\");let r=this._consume(Lt.tokens.ident,\"Expected diagnostic rule name.\").toString();return this._match(Lt.tokens.period)&&(r+=`.${this._consume(Lt.tokens.ident,\"Expected diagnostic message.\").toString()}`),this._consume(Lt.tokens.paren_right,\"Expected ')'\"),this._updateNode(new JD(t.toString(),r))}_enable_directive(){let t=this._consume(Lt.tokens.ident,\"identity expected.\");return this._updateNode(new pH(t.toString()))}_requires_directive(){let t=[this._consume(Lt.tokens.ident,\"identity expected.\").toString()];for(;this._match(Lt.tokens.comma);){let r=this._consume(Lt.tokens.ident,\"identity expected.\");t.push(r.toString())}return this._updateNode(new mH(t))}_type_alias(){let t=this._consume(Lt.tokens.ident,\"identity expected.\");this._consume(Lt.tokens.equal,\"Expected '=' for type alias.\");let r=this._type_decl();if(r===null)throw this._error(this._peek(),\"Expected Type for Alias.\");this._context.aliases.has(r.name)&&(r=this._context.aliases.get(r.name).type);let i=this._updateNode(new OE(t.toString(),r));return this._context.aliases.set(i.name,i),i}_type_decl(){if(this._check([Lt.tokens.ident,...Lt.texel_format,Lt.keywords.bool,Lt.keywords.f32,Lt.keywords.i32,Lt.keywords.u32])){let i=this._advance().toString();if(this._context.structs.has(i))return this._context.structs.get(i);if(this._context.aliases.has(i))return this._context.aliases.get(i).type;if(!this._getType(i)){let n=this._updateNode(new rO(i));return this._forwardTypeCount++,n}return this._updateNode(new Ne(i))}let t=this._texture_sampler_types();if(t)return t;if(this._check(Lt.template_types)){let i=this._advance().toString(),n=null,o=null;return this._match(Lt.tokens.less_than)&&(n=this._type_decl(),o=null,this._match(Lt.tokens.comma)&&(o=this._consume(Lt.access_mode,\"Expected access_mode for pointer\").toString()),this._consume(Lt.tokens.greater_than,\"Expected '>' for type.\")),this._updateNode(new ce(i,n,o))}if(this._match(Lt.keywords.ptr)){let i=this._previous().toString();this._consume(Lt.tokens.less_than,\"Expected '<' for pointer.\");let n=this._consume(Lt.storage_class,\"Expected storage_class for pointer\");this._consume(Lt.tokens.comma,\"Expected ',' for pointer.\");let o=this._type_decl(),s=null;return this._match(Lt.tokens.comma)&&(s=this._consume(Lt.access_mode,\"Expected access_mode for pointer\").toString()),this._consume(Lt.tokens.greater_than,\"Expected '>' for pointer.\"),this._updateNode(new d3(i,n.toString(),o,s))}let r=this._attribute();if(this._match(Lt.keywords.array)){let i=null,n=-1,o=this._previous(),s=null;if(this._match(Lt.tokens.less_than)){i=this._type_decl(),this._context.aliases.has(i.name)&&(i=this._context.aliases.get(i.name).type);let h=\"\";if(this._match(Lt.tokens.comma)){s=this._shift_expression();try{h=s.constEvaluate(this._exec).toString(),s=null}catch{h=\"1\"}}this._consume(Lt.tokens.greater_than,\"Expected '>' for array.\"),n=h?parseInt(h):0}let a=this._updateNode(new rb(o.toString(),r,i,n));return s&&this._deferArrayCountEval.push({arrayType:a,countNode:s}),a}return null}_texture_sampler_types(){if(this._match(Lt.sampler_type))return this._updateNode(new tb(this._previous().toString(),null,null));if(this._match(Lt.depth_texture_type))return this._updateNode(new tb(this._previous().toString(),null,null));if(this._match(Lt.sampled_texture_type)||this._match(Lt.multisampled_texture_type)){let t=this._previous();this._consume(Lt.tokens.less_than,\"Expected '<' for sampler type.\");let r=this._type_decl();return this._consume(Lt.tokens.greater_than,\"Expected '>' for sampler type.\"),this._updateNode(new tb(t.toString(),r,null))}if(this._match(Lt.storage_texture_type)){let t=this._previous();this._consume(Lt.tokens.less_than,\"Expected '<' for sampler type.\");let r=this._consume(Lt.texel_format,\"Invalid texel format.\").toString();this._consume(Lt.tokens.comma,\"Expected ',' after texel format.\");let i=this._consume(Lt.access_mode,\"Expected access mode for storage texture type.\").toString();return this._consume(Lt.tokens.greater_than,\"Expected '>' for sampler type.\"),this._updateNode(new tb(t.toString(),r,i))}return null}_attribute(){let t=[];for(;this._match(Lt.tokens.attr);){let r=this._consume(Lt.attribute_name,\"Expected attribute name\"),i=this._updateNode(new hO(r.toString(),null));if(this._match(Lt.tokens.paren_left)){if(i.value=this._consume(Lt.literal_or_ident,\"Expected attribute value\").toString(),this._check(Lt.tokens.comma)){this._advance();do{let n=this._consume(Lt.literal_or_ident,\"Expected attribute value\").toString();i.value instanceof Array||(i.value=[i.value]),i.value.push(n)}while(this._match(Lt.tokens.comma))}this._consume(Lt.tokens.paren_right,\"Expected ')'\")}t.push(i)}return t.length==0?null:t}},gO=class extends ib{constructor(t){super(),t&&this.update(t)}update(t){let r=new MH().parse(t);this.updateAST(r)}};function CH(e){let t={attributes:[],bindings:[]},r;try{r=fFt(e)}catch(o){return Ie.error(o.message)(),t}for(let o of r.uniforms){let s=[];for(let a of o.type?.members||[])s.push({name:a.name,type:spt(a.type)});t.bindings.push({type:\"uniform\",name:o.name,group:o.group,location:o.binding,members:s})}for(let o of r.textures)t.bindings.push({type:\"texture\",name:o.name,group:o.group,location:o.binding});for(let o of r.samplers)t.bindings.push({type:\"sampler\",name:o.name,group:o.group,location:o.binding});let i=r.entry.vertex[0],n=i?.inputs.length||0;for(let o=0;o<n;o++){let s=i.inputs[o];if(s.locationType===\"location\"){let a=spt(s.type);t.attributes.push({name:s.name,location:Number(s.location),type:a})}}return t}function spt(e){return e?.format?`${e.name}<${e.format.name}>`:e.name}function fFt(e){try{return new gO(e)}catch(t){if(t instanceof Error)throw t;let r=\"WGSL parse error\";throw typeof t==\"object\"&&t?.message&&(r+=`: ${t.message} `),typeof t==\"object\"&&t?.token&&(r+=t.token.line||\"\"),new Error(r,{cause:t})}}var pFt=1/Math.PI*180,mFt=1/180*Math.PI,gFt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...gFt}};var ts=globalThis.mathgl.config;function FE(e,{precision:t=ts.precision}={}){return e=AFt(e),`${parseFloat(e.toPrecision(t))}`}function zf(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A3(e,t){return IH(e,r=>r*mFt,t)}function c1(e,t){return IH(e,r=>r*pFt,t)}function _n(e,t,r){return IH(e,i=>Math.max(t,Math.min(r,i)))}function rc(e,t,r){return zf(e)?e.map((i,n)=>rc(i,t[n],r)):r*t+(1-r)*e}function $s(e,t,r){let i=ts.EPSILON;r&&(ts.EPSILON=r);try{if(e===t)return!0;if(zf(e)&&zf(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!$s(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e==\"number\"&&typeof t==\"number\"?Math.abs(e-t)<=ts.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{ts.EPSILON=i}}function AFt(e){return Math.round(e/ts.EPSILON)*ts.EPSILON}function yFt(e){return e.clone?e.clone():new Array(e.length)}function IH(e,t,r){if(zf(e)){let i=e;r=r||yFt(i);for(let n=0;n<r.length&&n<i.length;++n){let o=typeof e==\"number\"?e:e[n];r[n]=t(o,n,r)}return r}return t(e)}var u1=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=t[i+r];return this.check()}toArray(t=[],r=0){for(let i=0;i<this.ELEMENTS;++i)t[r+i]=this[i];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:zf(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(ts)}formatString(t){let r=\"\";for(let i=0;i<this.ELEMENTS;++i)r+=(i>0?\", \":\"\")+FE(this[i],t);return`${t.printTypes?this.constructor.name:\"\"}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!$s(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,i){if(i===void 0)return this.lerp(this,t,r);for(let n=0;n<this.ELEMENTS;++n){let o=t[n],s=typeof r==\"number\"?r:r[n];this[n]=o+i*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t[i]),r[i]);return this.check()}add(...t){for(let r of t)for(let i=0;i<this.ELEMENTS;++i)this[i]+=r[i];return this.check()}subtract(...t){for(let r of t)for(let i=0;i<this.ELEMENTS;++i)this[i]-=r[i];return this.check()}scale(t){if(typeof t==\"number\")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(ts.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t),r);return this.check()}get elements(){return this}};function _Ft(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function vn(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function h1(e,t,r=\"\"){if(ts.debug&&!_Ft(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function y0(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var y3=class extends u1{get x(){return this[0]}set x(t){this[0]=vn(t)}get y(){return this[1]}set y(t){this[1]=vn(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let i=0;i<this.ELEMENTS;++i){let n=this[i]-t[i];r+=n*n}return vn(r)}dot(t){let r=0;for(let i=0;i<this.ELEMENTS;++i)r+=this[i]*t[i];return vn(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let i=0;i<this.ELEMENTS;++i)this[i]*=r[i];return this.check()}divide(...t){for(let r of t)for(let i=0;i<this.ELEMENTS;++i)this[i]/=r[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return y0(t>=0&&t<this.ELEMENTS,\"index is out of range\"),vn(this[t])}setComponent(t,r){return y0(t>=0&&t<this.ELEMENTS,\"index is out of range\"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Ea={};Ql(Ea,{add:()=>TFt,angle:()=>jFt,ceil:()=>SFt,clone:()=>vFt,copy:()=>xFt,create:()=>apt,cross:()=>BFt,dist:()=>KFt,distance:()=>hpt,div:()=>ZFt,divide:()=>upt,dot:()=>LFt,equals:()=>qFt,exactEquals:()=>WFt,floor:()=>MFt,forEach:()=>tNt,fromValues:()=>bFt,inverse:()=>DFt,len:()=>HFt,length:()=>fpt,lerp:()=>FFt,max:()=>PFt,min:()=>EFt,mul:()=>XFt,multiply:()=>cpt,negate:()=>RFt,normalize:()=>OFt,random:()=>NFt,rotate:()=>VFt,round:()=>CFt,scale:()=>IFt,scaleAndAdd:()=>kFt,set:()=>wFt,sqrDist:()=>QFt,sqrLen:()=>JFt,squaredDistance:()=>dpt,squaredLength:()=>ppt,str:()=>GFt,sub:()=>YFt,subtract:()=>lpt,transformMat2:()=>zFt,transformMat2d:()=>UFt,transformMat3:()=>kH,transformMat4:()=>RH,zero:()=>$Ft});var Jn=typeof Float32Array<\"u\"?Float32Array:Array,_0=Math.random;function Cd(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var U3e=Math.PI/180;function apt(){let e=new Jn(2);return Jn!=Float32Array&&(e[0]=0,e[1]=0),e}function vFt(e){let t=new Jn(2);return t[0]=e[0],t[1]=e[1],t}function bFt(e,t){let r=new Jn(2);return r[0]=e,r[1]=t,r}function xFt(e,t){return e[0]=t[0],e[1]=t[1],e}function wFt(e,t,r){return e[0]=t,e[1]=r,e}function TFt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function lpt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function cpt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function upt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function SFt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function MFt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function EFt(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}function PFt(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}function CFt(e,t){return e[0]=Cd(t[0]),e[1]=Cd(t[1]),e}function IFt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function kFt(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}function hpt(e,t){let r=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(r*r+i*i)}function dpt(e,t){let r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function fpt(e){let t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function ppt(e){let t=e[0],r=e[1];return t*t+r*r}function RFt(e,t){return e[0]=-t[0],e[1]=-t[1],e}function DFt(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function OFt(e,t){let r=t[0],i=t[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e}function LFt(e,t){return e[0]*t[0]+e[1]*t[1]}function BFt(e,t,r){let i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e}function FFt(e,t,r,i){let n=t[0],o=t[1];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e}function NFt(e,t){t=t===void 0?1:t;let r=_0()*2*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e}function zFt(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e}function UFt(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e}function kH(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e}function RH(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e}function VFt(e,t,r,i){let n=t[0]-r[0],o=t[1]-r[1],s=Math.sin(i),a=Math.cos(i);return e[0]=n*a-o*s+r[0],e[1]=n*s+o*a+r[1],e}function jFt(e,t){let r=e[0],i=e[1],n=t[0],o=t[1],s=Math.sqrt((r*r+i*i)*(n*n+o*o)),a=s&&(r*n+i*o)/s;return Math.acos(Math.min(Math.max(a,-1),1))}function $Ft(e){return e[0]=0,e[1]=0,e}function GFt(e){return`vec2(${e[0]}, ${e[1]})`}function WFt(e,t){return e[0]===t[0]&&e[1]===t[1]}function qFt(e,t){let r=e[0],i=e[1],n=t[0],o=t[1];return Math.abs(r-n)<=1e-6*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))}var HFt=fpt,YFt=lpt,XFt=cpt,ZFt=upt,KFt=hpt,QFt=dpt,JFt=ppt,tNt=(function(){let e=apt();return function(t,r,i,n,o,s){let a,h;for(r||(r=2),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}})();function mpt(e,t,r){let i=t[0],n=t[1],o=r[3]*i+r[7]*n||1;return e[0]=(r[0]*i+r[4]*n)/o,e[1]=(r[1]*i+r[5]*n)/o,e}function AO(e,t,r){let i=t[0],n=t[1],o=t[2],s=r[3]*i+r[7]*n+r[11]*o||1;return e[0]=(r[0]*i+r[4]*n+r[8]*o)/s,e[1]=(r[1]*i+r[5]*n+r[9]*o)/s,e[2]=(r[2]*i+r[6]*n+r[10]*o)/s,e}function gpt(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e[2]=t[2],e}function Apt(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e[2]=t[2],e[3]=t[3],e}function yO(e,t,r){let i=t[0],n=t[1],o=t[2];return e[0]=r[0]*i+r[3]*n+r[6]*o,e[1]=r[1]*i+r[4]*n+r[7]*o,e[2]=r[2]*i+r[5]*n+r[8]*o,e[3]=t[3],e}var Cl={};Ql(Cl,{add:()=>nNt,angle:()=>FH,bezier:()=>ANt,ceil:()=>oNt,clone:()=>eNt,copy:()=>rNt,create:()=>_O,cross:()=>ob,dist:()=>MNt,distance:()=>bpt,div:()=>SNt,divide:()=>vpt,dot:()=>NE,equals:()=>xNt,exactEquals:()=>bNt,floor:()=>sNt,forEach:()=>CNt,fromValues:()=>bO,hermite:()=>gNt,inverse:()=>fNt,len:()=>NH,length:()=>vO,lerp:()=>pNt,max:()=>lNt,min:()=>aNt,mul:()=>TNt,multiply:()=>_pt,negate:()=>dNt,normalize:()=>DH,random:()=>yNt,rotateX:()=>OH,rotateY:()=>LH,rotateZ:()=>BH,round:()=>cNt,scale:()=>uNt,scaleAndAdd:()=>hNt,set:()=>iNt,slerp:()=>mNt,sqrDist:()=>ENt,sqrLen:()=>PNt,squaredDistance:()=>xpt,squaredLength:()=>wpt,str:()=>vNt,sub:()=>wNt,subtract:()=>ypt,transformMat3:()=>zE,transformMat4:()=>sb,transformQuat:()=>UE,zero:()=>_Nt});function _O(){let e=new Jn(3);return Jn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function eNt(e){let t=new Jn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function vO(e){let t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function bO(e,t,r){let i=new Jn(3);return i[0]=e,i[1]=t,i[2]=r,i}function rNt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function iNt(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e}function nNt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function ypt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function _pt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function vpt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function oNt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sNt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function aNt(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function lNt(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function cNt(e,t){return e[0]=Cd(t[0]),e[1]=Cd(t[1]),e[2]=Cd(t[2]),e}function uNt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function hNt(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function bpt(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}function xpt(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}function wpt(e){let t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}function dNt(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function fNt(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function DH(e,t){let r=t[0],i=t[1],n=t[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function NE(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ob(e,t,r){let i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],h=r[2];return e[0]=n*h-o*a,e[1]=o*s-i*h,e[2]=i*a-n*s,e}function pNt(e,t,r,i){let n=t[0],o=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e}function mNt(e,t,r,i){let n=Math.acos(Math.min(Math.max(NE(t,r),-1),1)),o=Math.sin(n),s=Math.sin((1-i)*n)/o,a=Math.sin(i*n)/o;return e[0]=s*t[0]+a*r[0],e[1]=s*t[1]+a*r[1],e[2]=s*t[2]+a*r[2],e}function gNt(e,t,r,i,n,o){let s=o*o,a=s*(2*o-3)+1,h=s*(o-2)+o,p=s*(o-1),g=s*(3-2*o);return e[0]=t[0]*a+r[0]*h+i[0]*p+n[0]*g,e[1]=t[1]*a+r[1]*h+i[1]*p+n[1]*g,e[2]=t[2]*a+r[2]*h+i[2]*p+n[2]*g,e}function ANt(e,t,r,i,n,o){let s=1-o,a=s*s,h=o*o,p=a*s,g=3*o*a,w=3*h*s,C=h*o;return e[0]=t[0]*p+r[0]*g+i[0]*w+n[0]*C,e[1]=t[1]*p+r[1]*g+i[1]*w+n[1]*C,e[2]=t[2]*p+r[2]*g+i[2]*w+n[2]*C,e}function yNt(e,t){t=t===void 0?1:t;let r=_0()*2*Math.PI,i=_0()*2-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e}function sb(e,t,r){let i=t[0],n=t[1],o=t[2],s=r[3]*i+r[7]*n+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/s,e[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/s,e}function zE(e,t,r){let i=t[0],n=t[1],o=t[2];return e[0]=i*r[0]+n*r[3]+o*r[6],e[1]=i*r[1]+n*r[4]+o*r[7],e[2]=i*r[2]+n*r[5]+o*r[8],e}function UE(e,t,r){let i=r[0],n=r[1],o=r[2],s=r[3],a=t[0],h=t[1],p=t[2],g=n*p-o*h,w=o*a-i*p,C=i*h-n*a,R=n*C-o*w,z=o*g-i*C,W=i*w-n*g,Y=s*2;return g*=Y,w*=Y,C*=Y,R*=2,z*=2,W*=2,e[0]=a+g+R,e[1]=h+w+z,e[2]=p+C+W,e}function OH(e,t,r,i){let n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function LH(e,t,r,i){let n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function BH(e,t,r,i){let n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function FH(e,t){let r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2],h=Math.sqrt((r*r+i*i+n*n)*(o*o+s*s+a*a)),p=h&&NE(e,t)/h;return Math.acos(Math.min(Math.max(p,-1),1))}function _Nt(e){return e[0]=0,e[1]=0,e[2]=0,e}function vNt(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function bNt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function xNt(e,t){let r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))}var wNt=ypt,TNt=_pt,SNt=vpt,MNt=bpt,ENt=xpt,NH=vO,PNt=wpt,CNt=(function(){let e=_O();return function(t,r,i,n,o,s){let a,h;for(r||(r=3),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}})();var zH=[0,0,0],xO,rr=class e extends y3{static get ZERO(){return xO||(xO=new e(0,0,0),Object.freeze(xO)),xO}constructor(t=0,r=0,i=0){super(-0,-0,-0),arguments.length===1&&zf(t)?this.copy(t):(ts.debug&&(vn(t),vn(r),vn(i)),this[0]=t,this[1]=r,this[2]=i)}set(t,r,i){return this[0]=t,this[1]=r,this[2]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return ts.debug&&(vn(t.x),vn(t.y),vn(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=vn(t)}angle(t){return FH(this,t)}cross(t){return ob(this,this,t),this.check()}rotateX({radians:t,origin:r=zH}){return OH(this,this,r,t),this.check()}rotateY({radians:t,origin:r=zH}){return LH(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=zH}){return BH(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return sb(this,this,t),this.check()}transformAsVector(t){return AO(this,this,t),this.check()}transformByMatrix3(t){return zE(this,this,t),this.check()}transformByMatrix2(t){return gpt(this,this,t),this.check()}transformByQuaternion(t){return UE(this,this,t),this.check()}};var wO,TO=class e extends y3{static get ZERO(){return wO||(wO=new e(0,0,0,0),Object.freeze(wO)),wO}constructor(t=0,r=0,i=0,n=0){super(-0,-0,-0,-0),zf(t)&&arguments.length===1?this.copy(t):(ts.debug&&(vn(t),vn(r),vn(i),vn(n)),this[0]=t,this[1]=r,this[2]=i,this[3]=n)}set(t,r,i,n){return this[0]=t,this[1]=r,this[2]=i,this[3]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return ts.debug&&(vn(t.x),vn(t.y),vn(t.z),vn(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=vn(t)}get w(){return this[3]}set w(t){this[3]=vn(t)}transform(t){return sb(this,this,t),this.check()}transformByMatrix3(t){return yO(this,this,t),this.check()}transformByMatrix2(t){return Apt(this,this,t),this.check()}transformByQuaternion(t){return UE(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var v3=class extends u1{toString(){let t=\"[\";if(ts.printRowMajor){t+=\"row-major:\";for(let r=0;r<this.RANK;++r)for(let i=0;i<this.RANK;++i)t+=` ${this[i*this.RANK+r]}`}else{t+=\"column-major:\";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+=\"]\",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,i){return this[r*this.RANK+t]=vn(i),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let i=t*this.RANK;for(let n=0;n<this.RANK;++n)r[n]=this[i+n];return r}setColumn(t,r){let i=t*this.RANK;for(let n=0;n<this.RANK;++n)this[i+n]=r[n];return this}};function Tpt(){let e=new Jn(9);return Jn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Spt(e,t){if(e===t){let r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mpt(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=t[6],p=t[7],g=t[8],w=g*s-a*p,C=-g*o+a*h,R=p*o-s*h,z=r*w+i*C+n*R;return z?(z=1/z,e[0]=w*z,e[1]=(-g*i+n*p)*z,e[2]=(a*i-n*s)*z,e[3]=C*z,e[4]=(g*r-n*h)*z,e[5]=(-a*r+n*o)*z,e[6]=R*z,e[7]=(-p*r+i*h)*z,e[8]=(s*r-i*o)*z,e):null}function Ept(e){let t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],s=e[5],a=e[6],h=e[7],p=e[8];return t*(p*o-s*h)+r*(-p*n+s*a)+i*(h*n-o*a)}function UH(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],p=t[6],g=t[7],w=t[8],C=r[0],R=r[1],z=r[2],W=r[3],Y=r[4],H=r[5],Q=r[6],tt=r[7],rt=r[8];return e[0]=C*i+R*s+z*p,e[1]=C*n+R*a+z*g,e[2]=C*o+R*h+z*w,e[3]=W*i+Y*s+H*p,e[4]=W*n+Y*a+H*g,e[5]=W*o+Y*h+H*w,e[6]=Q*i+tt*s+rt*p,e[7]=Q*n+tt*a+rt*g,e[8]=Q*o+tt*h+rt*w,e}function Ppt(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],p=t[6],g=t[7],w=t[8],C=r[0],R=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=h,e[6]=C*i+R*s+p,e[7]=C*n+R*a+g,e[8]=C*o+R*h+w,e}function Cpt(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],p=t[6],g=t[7],w=t[8],C=Math.sin(r),R=Math.cos(r);return e[0]=R*i+C*s,e[1]=R*n+C*a,e[2]=R*o+C*h,e[3]=R*s-C*i,e[4]=R*a-C*n,e[5]=R*h-C*o,e[6]=p,e[7]=g,e[8]=w,e}function VH(e,t,r){let i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Ipt(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,h=n+n,p=r*s,g=i*s,w=i*a,C=n*s,R=n*a,z=n*h,W=o*s,Y=o*a,H=o*h;return e[0]=1-w-z,e[3]=g-H,e[6]=C+Y,e[1]=g+H,e[4]=1-p-z,e[7]=R-W,e[2]=C-Y,e[5]=R+W,e[8]=1-p-w,e}var jH;(function(e){e[e.COL0ROW0=0]=\"COL0ROW0\",e[e.COL0ROW1=1]=\"COL0ROW1\",e[e.COL0ROW2=2]=\"COL0ROW2\",e[e.COL1ROW0=3]=\"COL1ROW0\",e[e.COL1ROW1=4]=\"COL1ROW1\",e[e.COL1ROW2=5]=\"COL1ROW2\",e[e.COL2ROW0=6]=\"COL2ROW0\",e[e.COL2ROW1=7]=\"COL2ROW1\",e[e.COL2ROW2=8]=\"COL2ROW2\"})(jH||(jH={}));var INt=Object.freeze([1,0,0,0,1,0,0,0,1]),es=class extends v3{static get IDENTITY(){return RNt()}static get ZERO(){return kNt()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return jH}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(INt)}fromObject(t){return this.check()}fromQuaternion(t){return Ipt(this,t),this.check()}set(t,r,i,n,o,s,a,h,p){return this[0]=t,this[1]=r,this[2]=i,this[3]=n,this[4]=o,this[5]=s,this[6]=a,this[7]=h,this[8]=p,this.check()}setRowMajor(t,r,i,n,o,s,a,h,p){return this[0]=t,this[1]=n,this[2]=a,this[3]=r,this[4]=o,this[5]=h,this[6]=i,this[7]=s,this[8]=p,this.check()}determinant(){return Ept(this)}transpose(){return Spt(this,this),this.check()}invert(){return Mpt(this,this),this.check()}multiplyLeft(t){return UH(this,t,this),this.check()}multiplyRight(t){return UH(this,this,t),this.check()}rotate(t){return Cpt(this,this,t),this.check()}scale(t){return Array.isArray(t)?VH(this,this,t):VH(this,this,[t,t]),this.check()}translate(t){return Ppt(this,this,t),this.check()}transform(t,r){let i;switch(t.length){case 2:i=kH(r||[-0,-0],t,this);break;case 3:i=zE(r||[-0,-0,-0],t,this);break;case 4:i=yO(r||[-0,-0,-0,-0],t,this);break;default:throw new Error(\"Illegal vector\")}return h1(i,t.length),i}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},SO,MO=null;function kNt(){return SO||(SO=new es([0,0,0,0,0,0,0,0,0]),Object.freeze(SO)),SO}function RNt(){return MO||(MO=new es,Object.freeze(MO)),MO}var Gs={};Ql(Gs,{add:()=>izt,adjoint:()=>NNt,clone:()=>ONt,copy:()=>LNt,create:()=>DNt,decompose:()=>YNt,determinant:()=>WH,equals:()=>azt,exactEquals:()=>szt,frob:()=>rzt,fromQuat:()=>QH,fromQuat2:()=>WNt,fromRotation:()=>VNt,fromRotationTranslation:()=>Dpt,fromRotationTranslationScale:()=>XNt,fromRotationTranslationScaleOrigin:()=>ZNt,fromScaling:()=>UNt,fromTranslation:()=>zNt,fromValues:()=>BNt,fromXRotation:()=>jNt,fromYRotation:()=>$Nt,fromZRotation:()=>GNt,frustum:()=>JH,getRotation:()=>HNt,getScaling:()=>Opt,getTranslation:()=>qNt,identity:()=>Rpt,invert:()=>GH,lookAt:()=>rY,mul:()=>lzt,multiply:()=>VE,multiplyScalar:()=>nzt,multiplyScalarAndAdd:()=>ozt,ortho:()=>eY,orthoNO:()=>Bpt,orthoZO:()=>JNt,perspective:()=>tY,perspectiveFromFieldOfView:()=>QNt,perspectiveNO:()=>Lpt,perspectiveZO:()=>KNt,rotate:()=>YH,rotateX:()=>XH,rotateY:()=>ZH,rotateZ:()=>KH,scale:()=>HH,set:()=>FNt,str:()=>ezt,sub:()=>czt,subtract:()=>Fpt,targetTo:()=>tzt,translate:()=>qH,transpose:()=>$H});function DNt(){let e=new Jn(16);return Jn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function ONt(e){let t=new Jn(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function LNt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function BNt(e,t,r,i,n,o,s,a,h,p,g,w,C,R,z,W){let Y=new Jn(16);return Y[0]=e,Y[1]=t,Y[2]=r,Y[3]=i,Y[4]=n,Y[5]=o,Y[6]=s,Y[7]=a,Y[8]=h,Y[9]=p,Y[10]=g,Y[11]=w,Y[12]=C,Y[13]=R,Y[14]=z,Y[15]=W,Y}function FNt(e,t,r,i,n,o,s,a,h,p,g,w,C,R,z,W,Y){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=h,e[8]=p,e[9]=g,e[10]=w,e[11]=C,e[12]=R,e[13]=z,e[14]=W,e[15]=Y,e}function Rpt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function $H(e,t){if(e===t){let r=t[1],i=t[2],n=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=o,e[11]=t[14],e[12]=n,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function GH(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=t[6],p=t[7],g=t[8],w=t[9],C=t[10],R=t[11],z=t[12],W=t[13],Y=t[14],H=t[15],Q=r*a-i*s,tt=r*h-n*s,rt=r*p-o*s,at=i*h-n*a,et=i*p-o*a,lt=n*p-o*h,J=g*W-w*z,ft=g*Y-C*z,dt=g*H-R*z,Mt=w*Y-C*W,Ft=w*H-R*W,Nt=C*H-R*Y,$t=Q*Nt-tt*Ft+rt*Mt+at*dt-et*ft+lt*J;return $t?($t=1/$t,e[0]=(a*Nt-h*Ft+p*Mt)*$t,e[1]=(n*Ft-i*Nt-o*Mt)*$t,e[2]=(W*lt-Y*et+H*at)*$t,e[3]=(C*et-w*lt-R*at)*$t,e[4]=(h*dt-s*Nt-p*ft)*$t,e[5]=(r*Nt-n*dt+o*ft)*$t,e[6]=(Y*rt-z*lt-H*tt)*$t,e[7]=(g*lt-C*rt+R*tt)*$t,e[8]=(s*Ft-a*dt+p*J)*$t,e[9]=(i*dt-r*Ft-o*J)*$t,e[10]=(z*et-W*rt+H*Q)*$t,e[11]=(w*rt-g*et-R*Q)*$t,e[12]=(a*ft-s*Mt-h*J)*$t,e[13]=(r*Mt-i*ft+n*J)*$t,e[14]=(W*tt-z*at-Y*Q)*$t,e[15]=(g*at-w*tt+C*Q)*$t,e):null}function NNt(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=t[6],p=t[7],g=t[8],w=t[9],C=t[10],R=t[11],z=t[12],W=t[13],Y=t[14],H=t[15],Q=r*a-i*s,tt=r*h-n*s,rt=r*p-o*s,at=i*h-n*a,et=i*p-o*a,lt=n*p-o*h,J=g*W-w*z,ft=g*Y-C*z,dt=g*H-R*z,Mt=w*Y-C*W,Ft=w*H-R*W,Nt=C*H-R*Y;return e[0]=a*Nt-h*Ft+p*Mt,e[1]=n*Ft-i*Nt-o*Mt,e[2]=W*lt-Y*et+H*at,e[3]=C*et-w*lt-R*at,e[4]=h*dt-s*Nt-p*ft,e[5]=r*Nt-n*dt+o*ft,e[6]=Y*rt-z*lt-H*tt,e[7]=g*lt-C*rt+R*tt,e[8]=s*Ft-a*dt+p*J,e[9]=i*dt-r*Ft-o*J,e[10]=z*et-W*rt+H*Q,e[11]=w*rt-g*et-R*Q,e[12]=a*ft-s*Mt-h*J,e[13]=r*Mt-i*ft+n*J,e[14]=W*tt-z*at-Y*Q,e[15]=g*at-w*tt+C*Q,e}function WH(e){let t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],s=e[5],a=e[6],h=e[7],p=e[8],g=e[9],w=e[10],C=e[11],R=e[12],z=e[13],W=e[14],Y=e[15],H=t*s-r*o,Q=t*a-i*o,tt=r*a-i*s,rt=p*z-g*R,at=p*W-w*R,et=g*W-w*z,lt=t*et-r*at+i*rt,J=o*et-s*at+a*rt,ft=p*tt-g*Q+w*H,dt=R*tt-z*Q+W*H;return h*lt-n*J+Y*ft-C*dt}function VE(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],p=t[6],g=t[7],w=t[8],C=t[9],R=t[10],z=t[11],W=t[12],Y=t[13],H=t[14],Q=t[15],tt=r[0],rt=r[1],at=r[2],et=r[3];return e[0]=tt*i+rt*a+at*w+et*W,e[1]=tt*n+rt*h+at*C+et*Y,e[2]=tt*o+rt*p+at*R+et*H,e[3]=tt*s+rt*g+at*z+et*Q,tt=r[4],rt=r[5],at=r[6],et=r[7],e[4]=tt*i+rt*a+at*w+et*W,e[5]=tt*n+rt*h+at*C+et*Y,e[6]=tt*o+rt*p+at*R+et*H,e[7]=tt*s+rt*g+at*z+et*Q,tt=r[8],rt=r[9],at=r[10],et=r[11],e[8]=tt*i+rt*a+at*w+et*W,e[9]=tt*n+rt*h+at*C+et*Y,e[10]=tt*o+rt*p+at*R+et*H,e[11]=tt*s+rt*g+at*z+et*Q,tt=r[12],rt=r[13],at=r[14],et=r[15],e[12]=tt*i+rt*a+at*w+et*W,e[13]=tt*n+rt*h+at*C+et*Y,e[14]=tt*o+rt*p+at*R+et*H,e[15]=tt*s+rt*g+at*z+et*Q,e}function qH(e,t,r){let i=r[0],n=r[1],o=r[2],s,a,h,p,g,w,C,R,z,W,Y,H;return t===e?(e[12]=t[0]*i+t[4]*n+t[8]*o+t[12],e[13]=t[1]*i+t[5]*n+t[9]*o+t[13],e[14]=t[2]*i+t[6]*n+t[10]*o+t[14],e[15]=t[3]*i+t[7]*n+t[11]*o+t[15]):(s=t[0],a=t[1],h=t[2],p=t[3],g=t[4],w=t[5],C=t[6],R=t[7],z=t[8],W=t[9],Y=t[10],H=t[11],e[0]=s,e[1]=a,e[2]=h,e[3]=p,e[4]=g,e[5]=w,e[6]=C,e[7]=R,e[8]=z,e[9]=W,e[10]=Y,e[11]=H,e[12]=s*i+g*n+z*o+t[12],e[13]=a*i+w*n+W*o+t[13],e[14]=h*i+C*n+Y*o+t[14],e[15]=p*i+R*n+H*o+t[15]),e}function HH(e,t,r){let i=r[0],n=r[1],o=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function YH(e,t,r,i){let n=i[0],o=i[1],s=i[2],a=Math.sqrt(n*n+o*o+s*s),h,p,g,w,C,R,z,W,Y,H,Q,tt,rt,at,et,lt,J,ft,dt,Mt,Ft,Nt,$t,Yt;return a<1e-6?null:(a=1/a,n*=a,o*=a,s*=a,p=Math.sin(r),h=Math.cos(r),g=1-h,w=t[0],C=t[1],R=t[2],z=t[3],W=t[4],Y=t[5],H=t[6],Q=t[7],tt=t[8],rt=t[9],at=t[10],et=t[11],lt=n*n*g+h,J=o*n*g+s*p,ft=s*n*g-o*p,dt=n*o*g-s*p,Mt=o*o*g+h,Ft=s*o*g+n*p,Nt=n*s*g+o*p,$t=o*s*g-n*p,Yt=s*s*g+h,e[0]=w*lt+W*J+tt*ft,e[1]=C*lt+Y*J+rt*ft,e[2]=R*lt+H*J+at*ft,e[3]=z*lt+Q*J+et*ft,e[4]=w*dt+W*Mt+tt*Ft,e[5]=C*dt+Y*Mt+rt*Ft,e[6]=R*dt+H*Mt+at*Ft,e[7]=z*dt+Q*Mt+et*Ft,e[8]=w*Nt+W*$t+tt*Yt,e[9]=C*Nt+Y*$t+rt*Yt,e[10]=R*Nt+H*$t+at*Yt,e[11]=z*Nt+Q*$t+et*Yt,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function XH(e,t,r){let i=Math.sin(r),n=Math.cos(r),o=t[4],s=t[5],a=t[6],h=t[7],p=t[8],g=t[9],w=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*n+p*i,e[5]=s*n+g*i,e[6]=a*n+w*i,e[7]=h*n+C*i,e[8]=p*n-o*i,e[9]=g*n-s*i,e[10]=w*n-a*i,e[11]=C*n-h*i,e}function ZH(e,t,r){let i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],h=t[3],p=t[8],g=t[9],w=t[10],C=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n-p*i,e[1]=s*n-g*i,e[2]=a*n-w*i,e[3]=h*n-C*i,e[8]=o*i+p*n,e[9]=s*i+g*n,e[10]=a*i+w*n,e[11]=h*i+C*n,e}function KH(e,t,r){let i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],h=t[3],p=t[4],g=t[5],w=t[6],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n+p*i,e[1]=s*n+g*i,e[2]=a*n+w*i,e[3]=h*n+C*i,e[4]=p*n-o*i,e[5]=g*n-s*i,e[6]=w*n-a*i,e[7]=C*n-h*i,e}function zNt(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function UNt(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function VNt(e,t,r){let i=r[0],n=r[1],o=r[2],s=Math.sqrt(i*i+n*n+o*o),a,h,p;return s<1e-6?null:(s=1/s,i*=s,n*=s,o*=s,h=Math.sin(t),a=Math.cos(t),p=1-a,e[0]=i*i*p+a,e[1]=n*i*p+o*h,e[2]=o*i*p-n*h,e[3]=0,e[4]=i*n*p-o*h,e[5]=n*n*p+a,e[6]=o*n*p+i*h,e[7]=0,e[8]=i*o*p+n*h,e[9]=n*o*p-i*h,e[10]=o*o*p+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function jNt(e,t){let r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function $Nt(e,t){let r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function GNt(e,t){let r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Dpt(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=i+i,h=n+n,p=o+o,g=i*a,w=i*h,C=i*p,R=n*h,z=n*p,W=o*p,Y=s*a,H=s*h,Q=s*p;return e[0]=1-(R+W),e[1]=w+Q,e[2]=C-H,e[3]=0,e[4]=w-Q,e[5]=1-(g+W),e[6]=z+Y,e[7]=0,e[8]=C+H,e[9]=z-Y,e[10]=1-(g+R),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function WNt(e,t){let r=new Jn(3),i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],h=t[5],p=t[6],g=t[7],w=i*i+n*n+o*o+s*s;return w>0?(r[0]=(a*s+g*i+h*o-p*n)*2/w,r[1]=(h*s+g*n+p*i-a*o)*2/w,r[2]=(p*s+g*o+a*n-h*i)*2/w):(r[0]=(a*s+g*i+h*o-p*n)*2,r[1]=(h*s+g*n+p*i-a*o)*2,r[2]=(p*s+g*o+a*n-h*i)*2),Dpt(e,t,r),e}function qNt(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Opt(e,t){let r=t[0],i=t[1],n=t[2],o=t[4],s=t[5],a=t[6],h=t[8],p=t[9],g=t[10];return e[0]=Math.sqrt(r*r+i*i+n*n),e[1]=Math.sqrt(o*o+s*s+a*a),e[2]=Math.sqrt(h*h+p*p+g*g),e}function HNt(e,t){let r=new Jn(3);Opt(r,t);let i=1/r[0],n=1/r[1],o=1/r[2],s=t[0]*i,a=t[1]*n,h=t[2]*o,p=t[4]*i,g=t[5]*n,w=t[6]*o,C=t[8]*i,R=t[9]*n,z=t[10]*o,W=s+g+z,Y=0;return W>0?(Y=Math.sqrt(W+1)*2,e[3]=.25*Y,e[0]=(w-R)/Y,e[1]=(C-h)/Y,e[2]=(a-p)/Y):s>g&&s>z?(Y=Math.sqrt(1+s-g-z)*2,e[3]=(w-R)/Y,e[0]=.25*Y,e[1]=(a+p)/Y,e[2]=(C+h)/Y):g>z?(Y=Math.sqrt(1+g-s-z)*2,e[3]=(C-h)/Y,e[0]=(a+p)/Y,e[1]=.25*Y,e[2]=(w+R)/Y):(Y=Math.sqrt(1+z-s-g)*2,e[3]=(a-p)/Y,e[0]=(C+h)/Y,e[1]=(w+R)/Y,e[2]=.25*Y),e}function YNt(e,t,r,i){t[0]=i[12],t[1]=i[13],t[2]=i[14];let n=i[0],o=i[1],s=i[2],a=i[4],h=i[5],p=i[6],g=i[8],w=i[9],C=i[10];r[0]=Math.sqrt(n*n+o*o+s*s),r[1]=Math.sqrt(a*a+h*h+p*p),r[2]=Math.sqrt(g*g+w*w+C*C);let R=1/r[0],z=1/r[1],W=1/r[2],Y=n*R,H=o*z,Q=s*W,tt=a*R,rt=h*z,at=p*W,et=g*R,lt=w*z,J=C*W,ft=Y+rt+J,dt=0;return ft>0?(dt=Math.sqrt(ft+1)*2,e[3]=.25*dt,e[0]=(at-lt)/dt,e[1]=(et-Q)/dt,e[2]=(H-tt)/dt):Y>rt&&Y>J?(dt=Math.sqrt(1+Y-rt-J)*2,e[3]=(at-lt)/dt,e[0]=.25*dt,e[1]=(H+tt)/dt,e[2]=(et+Q)/dt):rt>J?(dt=Math.sqrt(1+rt-Y-J)*2,e[3]=(et-Q)/dt,e[0]=(H+tt)/dt,e[1]=.25*dt,e[2]=(at+lt)/dt):(dt=Math.sqrt(1+J-Y-rt)*2,e[3]=(H-tt)/dt,e[0]=(et+Q)/dt,e[1]=(at+lt)/dt,e[2]=.25*dt),e}function XNt(e,t,r,i){let n=t[0],o=t[1],s=t[2],a=t[3],h=n+n,p=o+o,g=s+s,w=n*h,C=n*p,R=n*g,z=o*p,W=o*g,Y=s*g,H=a*h,Q=a*p,tt=a*g,rt=i[0],at=i[1],et=i[2];return e[0]=(1-(z+Y))*rt,e[1]=(C+tt)*rt,e[2]=(R-Q)*rt,e[3]=0,e[4]=(C-tt)*at,e[5]=(1-(w+Y))*at,e[6]=(W+H)*at,e[7]=0,e[8]=(R+Q)*et,e[9]=(W-H)*et,e[10]=(1-(w+z))*et,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function ZNt(e,t,r,i,n){let o=t[0],s=t[1],a=t[2],h=t[3],p=o+o,g=s+s,w=a+a,C=o*p,R=o*g,z=o*w,W=s*g,Y=s*w,H=a*w,Q=h*p,tt=h*g,rt=h*w,at=i[0],et=i[1],lt=i[2],J=n[0],ft=n[1],dt=n[2],Mt=(1-(W+H))*at,Ft=(R+rt)*at,Nt=(z-tt)*at,$t=(R-rt)*et,Yt=(1-(C+H))*et,_e=(Y+Q)*et,Pe=(z+tt)*lt,we=(Y-Q)*lt,Ue=(1-(C+W))*lt;return e[0]=Mt,e[1]=Ft,e[2]=Nt,e[3]=0,e[4]=$t,e[5]=Yt,e[6]=_e,e[7]=0,e[8]=Pe,e[9]=we,e[10]=Ue,e[11]=0,e[12]=r[0]+J-(Mt*J+$t*ft+Pe*dt),e[13]=r[1]+ft-(Ft*J+Yt*ft+we*dt),e[14]=r[2]+dt-(Nt*J+_e*ft+Ue*dt),e[15]=1,e}function QH(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,h=n+n,p=r*s,g=i*s,w=i*a,C=n*s,R=n*a,z=n*h,W=o*s,Y=o*a,H=o*h;return e[0]=1-w-z,e[1]=g+H,e[2]=C-Y,e[3]=0,e[4]=g-H,e[5]=1-p-z,e[6]=R+W,e[7]=0,e[8]=C+Y,e[9]=R-W,e[10]=1-p-w,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JH(e,t,r,i,n,o,s){let a=1/(r-t),h=1/(n-i),p=1/(o-s);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*h,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(n+i)*h,e[10]=(s+o)*p,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*p,e[15]=0,e}function Lpt(e,t,r,i,n){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0){let s=1/(i-n);e[10]=(n+i)*s,e[14]=2*n*i*s}else e[10]=-1,e[14]=-2*i;return e}var tY=Lpt;function KNt(e,t,r,i,n){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0){let s=1/(i-n);e[10]=n*s,e[14]=n*i*s}else e[10]=-1,e[14]=-i;return e}function QNt(e,t,r,i){let n=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),h=2/(s+a),p=2/(n+o);return e[0]=h,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=p,e[6]=0,e[7]=0,e[8]=-((s-a)*h*.5),e[9]=(n-o)*p*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e}function Bpt(e,t,r,i,n,o,s){let a=1/(t-r),h=1/(i-n),p=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*p,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*h,e[14]=(s+o)*p,e[15]=1,e}var eY=Bpt;function JNt(e,t,r,i,n,o,s){let a=1/(t-r),h=1/(i-n),p=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=p,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*h,e[14]=o*p,e[15]=1,e}function rY(e,t,r,i){let n,o,s,a,h,p,g,w,C,R,z=t[0],W=t[1],Y=t[2],H=i[0],Q=i[1],tt=i[2],rt=r[0],at=r[1],et=r[2];return Math.abs(z-rt)<1e-6&&Math.abs(W-at)<1e-6&&Math.abs(Y-et)<1e-6?Rpt(e):(w=z-rt,C=W-at,R=Y-et,n=1/Math.sqrt(w*w+C*C+R*R),w*=n,C*=n,R*=n,o=Q*R-tt*C,s=tt*w-H*R,a=H*C-Q*w,n=Math.sqrt(o*o+s*s+a*a),n?(n=1/n,o*=n,s*=n,a*=n):(o=0,s=0,a=0),h=C*a-R*s,p=R*o-w*a,g=w*s-C*o,n=Math.sqrt(h*h+p*p+g*g),n?(n=1/n,h*=n,p*=n,g*=n):(h=0,p=0,g=0),e[0]=o,e[1]=h,e[2]=w,e[3]=0,e[4]=s,e[5]=p,e[6]=C,e[7]=0,e[8]=a,e[9]=g,e[10]=R,e[11]=0,e[12]=-(o*z+s*W+a*Y),e[13]=-(h*z+p*W+g*Y),e[14]=-(w*z+C*W+R*Y),e[15]=1,e)}function tzt(e,t,r,i){let n=t[0],o=t[1],s=t[2],a=i[0],h=i[1],p=i[2],g=n-r[0],w=o-r[1],C=s-r[2],R=g*g+w*w+C*C;R>0&&(R=1/Math.sqrt(R),g*=R,w*=R,C*=R);let z=h*C-p*w,W=p*g-a*C,Y=a*w-h*g;return R=z*z+W*W+Y*Y,R>0&&(R=1/Math.sqrt(R),z*=R,W*=R,Y*=R),e[0]=z,e[1]=W,e[2]=Y,e[3]=0,e[4]=w*Y-C*W,e[5]=C*z-g*Y,e[6]=g*W-w*z,e[7]=0,e[8]=g,e[9]=w,e[10]=C,e[11]=0,e[12]=n,e[13]=o,e[14]=s,e[15]=1,e}function ezt(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function rzt(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function izt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function Fpt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function nzt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function ozt(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e[9]=t[9]+r[9]*i,e[10]=t[10]+r[10]*i,e[11]=t[11]+r[11]*i,e[12]=t[12]+r[12]*i,e[13]=t[13]+r[13]*i,e[14]=t[14]+r[14]*i,e[15]=t[15]+r[15]*i,e}function szt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function azt(e,t){let r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],p=e[7],g=e[8],w=e[9],C=e[10],R=e[11],z=e[12],W=e[13],Y=e[14],H=e[15],Q=t[0],tt=t[1],rt=t[2],at=t[3],et=t[4],lt=t[5],J=t[6],ft=t[7],dt=t[8],Mt=t[9],Ft=t[10],Nt=t[11],$t=t[12],Yt=t[13],_e=t[14],Pe=t[15];return Math.abs(r-Q)<=1e-6*Math.max(1,Math.abs(r),Math.abs(Q))&&Math.abs(i-tt)<=1e-6*Math.max(1,Math.abs(i),Math.abs(tt))&&Math.abs(n-rt)<=1e-6*Math.max(1,Math.abs(n),Math.abs(rt))&&Math.abs(o-at)<=1e-6*Math.max(1,Math.abs(o),Math.abs(at))&&Math.abs(s-et)<=1e-6*Math.max(1,Math.abs(s),Math.abs(et))&&Math.abs(a-lt)<=1e-6*Math.max(1,Math.abs(a),Math.abs(lt))&&Math.abs(h-J)<=1e-6*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(p-ft)<=1e-6*Math.max(1,Math.abs(p),Math.abs(ft))&&Math.abs(g-dt)<=1e-6*Math.max(1,Math.abs(g),Math.abs(dt))&&Math.abs(w-Mt)<=1e-6*Math.max(1,Math.abs(w),Math.abs(Mt))&&Math.abs(C-Ft)<=1e-6*Math.max(1,Math.abs(C),Math.abs(Ft))&&Math.abs(R-Nt)<=1e-6*Math.max(1,Math.abs(R),Math.abs(Nt))&&Math.abs(z-$t)<=1e-6*Math.max(1,Math.abs(z),Math.abs($t))&&Math.abs(W-Yt)<=1e-6*Math.max(1,Math.abs(W),Math.abs(Yt))&&Math.abs(Y-_e)<=1e-6*Math.max(1,Math.abs(Y),Math.abs(_e))&&Math.abs(H-Pe)<=1e-6*Math.max(1,Math.abs(H),Math.abs(Pe))}var lzt=VE,czt=Fpt;var xu={};Ql(xu,{add:()=>iY,ceil:()=>uzt,clone:()=>zpt,copy:()=>Vpt,create:()=>Npt,cross:()=>yzt,dist:()=>Mzt,distance:()=>qpt,div:()=>Szt,divide:()=>Wpt,dot:()=>sY,equals:()=>xzt,exactEquals:()=>Ypt,floor:()=>hzt,forEach:()=>Izt,fromValues:()=>Upt,inverse:()=>Azt,len:()=>Pzt,length:()=>EO,lerp:()=>aY,max:()=>fzt,min:()=>dzt,mul:()=>Tzt,multiply:()=>Gpt,negate:()=>gzt,normalize:()=>oY,random:()=>_zt,round:()=>pzt,scale:()=>nY,scaleAndAdd:()=>mzt,set:()=>jpt,sqrDist:()=>Ezt,sqrLen:()=>Czt,squaredDistance:()=>Hpt,squaredLength:()=>PO,str:()=>bzt,sub:()=>wzt,subtract:()=>$pt,transformMat4:()=>lY,transformQuat:()=>cY,zero:()=>vzt});function Npt(){let e=new Jn(4);return Jn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function zpt(e){let t=new Jn(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Upt(e,t,r,i){let n=new Jn(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function Vpt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function jpt(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function iY(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function $pt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function Gpt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function Wpt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function uzt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function hzt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function dzt(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function fzt(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function pzt(e,t){return e[0]=Cd(t[0]),e[1]=Cd(t[1]),e[2]=Cd(t[2]),e[3]=Cd(t[3]),e}function nY(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function mzt(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e}function qpt(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+o*o)}function Hpt(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return r*r+i*i+n*n+o*o}function EO(e){let t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)}function PO(e){let t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function gzt(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function Azt(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function oY(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=o*s,e}function sY(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function yzt(e,t,r,i){let n=r[0]*i[1]-r[1]*i[0],o=r[0]*i[2]-r[2]*i[0],s=r[0]*i[3]-r[3]*i[0],a=r[1]*i[2]-r[2]*i[1],h=r[1]*i[3]-r[3]*i[1],p=r[2]*i[3]-r[3]*i[2],g=t[0],w=t[1],C=t[2],R=t[3];return e[0]=w*p-C*h+R*a,e[1]=-(g*p)+C*s-R*o,e[2]=g*h-w*s+R*n,e[3]=-(g*a)+w*o-C*n,e}function aY(e,t,r,i){let n=t[0],o=t[1],s=t[2],a=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e[3]=a+i*(r[3]-a),e}function _zt(e,t){t=t===void 0?1:t;let r,i,n,o,s,a;do r=_0()*2-1,i=_0()*2-1,s=r*r+i*i;while(s>=1);do n=_0()*2-1,o=_0()*2-1,a=n*n+o*o;while(a>=1);let h=Math.sqrt((1-s)/a);return e[0]=t*r,e[1]=t*i,e[2]=t*n*h,e[3]=t*o*h,e}function lY(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*s,e}function cY(e,t,r){let i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],h=r[2],p=r[3],g=p*i+a*o-h*n,w=p*n+h*i-s*o,C=p*o+s*n-a*i,R=-s*i-a*n-h*o;return e[0]=g*p+R*-s+w*-h-C*-a,e[1]=w*p+R*-a+C*-s-g*-h,e[2]=C*p+R*-h+g*-a-w*-s,e[3]=t[3],e}function vzt(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function bzt(e){return`vec4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]})`}function Ypt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function xzt(e,t){let r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],h=t[2],p=t[3];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=1e-6*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-h)<=1e-6*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-p)<=1e-6*Math.max(1,Math.abs(o),Math.abs(p))}var wzt=$pt,Tzt=Gpt,Szt=Wpt,Mzt=qpt,Ezt=Hpt,Pzt=EO,Czt=PO,Izt=(function(){let e=Npt();return function(t,r,i,n,o,s){let a,h;for(r||(r=4),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}})();var dY;(function(e){e[e.COL0ROW0=0]=\"COL0ROW0\",e[e.COL0ROW1=1]=\"COL0ROW1\",e[e.COL0ROW2=2]=\"COL0ROW2\",e[e.COL0ROW3=3]=\"COL0ROW3\",e[e.COL1ROW0=4]=\"COL1ROW0\",e[e.COL1ROW1=5]=\"COL1ROW1\",e[e.COL1ROW2=6]=\"COL1ROW2\",e[e.COL1ROW3=7]=\"COL1ROW3\",e[e.COL2ROW0=8]=\"COL2ROW0\",e[e.COL2ROW1=9]=\"COL2ROW1\",e[e.COL2ROW2=10]=\"COL2ROW2\",e[e.COL2ROW3=11]=\"COL2ROW3\",e[e.COL3ROW0=12]=\"COL3ROW0\",e[e.COL3ROW1=13]=\"COL3ROW1\",e[e.COL3ROW2=14]=\"COL3ROW2\",e[e.COL3ROW3=15]=\"COL3ROW3\"})(dY||(dY={}));var kzt=45*Math.PI/180,Rzt=1,uY=.1,hY=500,Dzt=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ji=class extends v3{static get IDENTITY(){return Lzt()}static get ZERO(){return Ozt()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return dY}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,i,n,o,s,a,h,p,g,w,C,R,z,W,Y){return this[0]=t,this[1]=r,this[2]=i,this[3]=n,this[4]=o,this[5]=s,this[6]=a,this[7]=h,this[8]=p,this[9]=g,this[10]=w,this[11]=C,this[12]=R,this[13]=z,this[14]=W,this[15]=Y,this.check()}setRowMajor(t,r,i,n,o,s,a,h,p,g,w,C,R,z,W,Y){return this[0]=t,this[1]=o,this[2]=p,this[3]=R,this[4]=r,this[5]=s,this[6]=g,this[7]=z,this[8]=i,this[9]=a,this[10]=w,this[11]=W,this[12]=n,this[13]=h,this[14]=C,this[15]=Y,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(Dzt)}fromObject(t){return this.check()}fromQuaternion(t){return QH(this,t),this.check()}frustum(t){let{left:r,right:i,bottom:n,top:o,near:s=uY,far:a=hY}=t;return a===1/0?Bzt(this,r,i,n,o,s):JH(this,r,i,n,o,s,a),this.check()}lookAt(t){let{eye:r,center:i=[0,0,0],up:n=[0,1,0]}=t;return rY(this,r,i,n),this.check()}ortho(t){let{left:r,right:i,bottom:n,top:o,near:s=uY,far:a=hY}=t;return eY(this,r,i,n,o,s,a),this.check()}orthographic(t){let{fovy:r=kzt,aspect:i=Rzt,focalDistance:n=1,near:o=uY,far:s=hY}=t;Xpt(r);let a=r/2,h=n*Math.tan(a),p=h*i;return this.ortho({left:-p,right:p,bottom:-h,top:h,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:i=1,near:n=.1,far:o=500}=t;return Xpt(r),tY(this,r,i,n,o),this.check()}determinant(){return WH(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let i=this.getScale(r),n=1/i[0],o=1/i[1],s=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*o,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*o,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let i=this.getScale(r),n=1/i[0],o=1/i[1],s=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=this[4]*n,t[4]=this[5]*o,t[5]=this[6]*s,t[6]=this[8]*n,t[7]=this[9]*o,t[8]=this[10]*s,t}transpose(){return $H(this,this),this.check()}invert(){return GH(this,this),this.check()}multiplyLeft(t){return VE(this,t,this),this.check()}multiplyRight(t){return VE(this,this,t),this.check()}rotateX(t){return XH(this,this,t),this.check()}rotateY(t){return ZH(this,this,t),this.check()}rotateZ(t){return KH(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return YH(this,this,t,r),this.check()}scale(t){return HH(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return qH(this,this,t),this.check()}transform(t,r){return t.length===4?(r=lY(r||[-0,-0,-0,-0],t,this),h1(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:i}=t,n;switch(i){case 2:n=RH(r||[-0,-0],t,this);break;case 3:n=sb(r||[-0,-0,-0],t,this);break;default:throw new Error(\"Illegal vector\")}return h1(n,t.length),n}transformAsVector(t,r){let i;switch(t.length){case 2:i=mpt(r||[-0,-0],t,this);break;case 3:i=AO(r||[-0,-0,-0],t,this);break;default:throw new Error(\"Illegal vector\")}return h1(i,t.length),i}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,i){return this.identity().translate([t,r,i])}},CO,IO;function Ozt(){return CO||(CO=new Ji([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(CO)),CO}function Lzt(){return IO||(IO=new Ji,Object.freeze(IO)),IO}function Xpt(e){if(e>Math.PI*2)throw Error(\"expected radians\")}function Bzt(e,t,r,i,n,o){let s=2*o/(r-t),a=2*o/(n-i),h=(r+t)/(r-t),p=(n+i)/(n-i),g=-1,w=-1,C=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=h,e[9]=p,e[10]=g,e[11]=w,e[12]=0,e[13]=0,e[14]=C,e[15]=0,e}function Zpt(){let e=new Jn(4);return Jn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Kpt(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function fY(e,t,r){r=r*.5;let i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function pY(e,t,r){let i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],h=r[1],p=r[2],g=r[3];return e[0]=i*g+s*a+n*p-o*h,e[1]=n*g+s*h+o*a-i*p,e[2]=o*g+s*p+i*h-n*a,e[3]=s*g-i*a-n*h-o*p,e}function Qpt(e,t,r){r*=.5;let i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*a,e[1]=n*h+o*a,e[2]=o*h-n*a,e[3]=s*h-i*a,e}function Jpt(e,t,r){r*=.5;let i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h-o*a,e[1]=n*h+s*a,e[2]=o*h+i*a,e[3]=s*h-n*a,e}function t0t(e,t,r){r*=.5;let i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h+n*a,e[1]=n*h-i*a,e[2]=o*h+s*a,e[3]=s*h-o*a,e}function e0t(e,t){let r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e}function jE(e,t,r,i){let n=t[0],o=t[1],s=t[2],a=t[3],h=r[0],p=r[1],g=r[2],w=r[3],C,R,z,W,Y;return C=n*h+o*p+s*g+a*w,C<0&&(C=-C,h=-h,p=-p,g=-g,w=-w),1-C>1e-6?(R=Math.acos(C),Y=Math.sin(R),z=Math.sin((1-i)*R)/Y,W=Math.sin(i*R)/Y):(z=1-i,W=i),e[0]=z*n+W*h,e[1]=z*o+W*p,e[2]=z*s+W*g,e[3]=z*a+W*w,e}function r0t(e,t){let r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-n*a,e[3]=o*a,e}function i0t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function mY(e,t){let r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);let o=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[o*3+o]-t[s*3+s]+1),e[n]=.5*i,i=.5/i,e[3]=(t[o*3+s]-t[s*3+o])*i,e[o]=(t[o*3+n]+t[n*3+o])*i,e[s]=(t[s*3+n]+t[n*3+s])*i}return e}var n0t=iY;var o0t=nY,s0t=sY,a0t=aY,l0t=EO;var c0t=PO;var u0t=oY;var h0t=(function(){let e=_O(),t=bO(1,0,0),r=bO(0,1,0);return function(i,n,o){let s=NE(n,o);return s<-.999999?(ob(e,t,n),NH(e)<1e-6&&ob(e,r,n),DH(e,e),fY(i,e,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ob(e,n,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,u0t(i,i))}})(),_4e=(function(){let e=Zpt(),t=Zpt();return function(r,i,n,o,s,a){return jE(e,i,s,a),jE(t,n,o,a),jE(r,e,t,2*a*(1-a)),r}})(),v4e=(function(){let e=Tpt();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],u0t(t,mY(t,e))}})();var Nzt=[0,0,0,1],b3=class extends u1{constructor(t=0,r=0,i=0,n=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,i,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,i,n){return this[0]=t,this[1]=r,this[2]=i,this[3]=n,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return mY(this,t),this.check()}fromAxisRotation(t,r){return fY(this,t,r),this.check()}identity(){return Kpt(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=vn(t)}get y(){return this[1]}set y(t){this[1]=vn(t)}get z(){return this[2]}set z(t){this[2]=vn(t)}get w(){return this[3]}set w(t){this[3]=vn(t)}len(){return l0t(this)}lengthSquared(){return c0t(this)}dot(t){return s0t(this,t)}rotationTo(t,r){return h0t(this,t,r),this.check()}add(t){return n0t(this,this,t),this.check()}calculateW(){return e0t(this,this),this.check()}conjugate(){return i0t(this,this),this.check()}invert(){return r0t(this,this),this.check()}lerp(t,r,i){return i===void 0?this.lerp(this,t,r):(a0t(this,t,r,i),this.check())}multiplyRight(t){return pY(this,this,t),this.check()}multiplyLeft(t){return pY(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Qpt(this,this,t),this.check()}rotateY(t){return Jpt(this,this,t),this.check()}rotateZ(t){return t0t(this,this,t),this.check()}scale(t){return o0t(this,this,t),this.check()}slerp(t,r,i){let n,o,s;switch(arguments.length){case 1:({start:n=Nzt,target:o,ratio:s}=t);break;case 2:n=this,o=t,s=r;break;default:n=t,o=r,s=i}return jE(this,n,o,s),this.check()}transformVector4(t,r=new TO){return cY(r,t,this),h1(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var d0t=1e-6,zzt=6371e3,Ig=class e{constructor({phi:t=0,theta:r=0,radius:i=1,bearing:n,pitch:o,altitude:s,radiusScale:a=zzt}={}){this.phi=t,this.theta=r,this.radius=i||s||1,this.radiusScale=a||1,n!==void 0&&(this.bearing=n),o!==void 0&&(this.pitch=o),this.check()}toString(){return this.formatString(ts)}formatString({printTypes:t=!1}){let r=FE;return`${t?\"Spherical\":\"\"}[rho:${r(this.radius)},theta:${r(this.theta)},phi:${r(this.phi)}]`}equals(t){return $s(this.radius,t.radius)&&$s(this.theta,t.theta)&&$s(this.phi,t.phi)}exactEquals(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}get bearing(){return 180-c1(this.phi)}set bearing(t){this.phi=Math.PI-A3(t)}get pitch(){return c1(this.theta)}set pitch(t){this.theta=A3(t)}get longitude(){return c1(this.phi)}get latitude(){return c1(this.theta)}get lng(){return c1(this.phi)}get lat(){return c1(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(t,r,i){return this.radius=t,this.phi=r,this.theta=i,this.check()}clone(){return new e().copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}fromLngLatZ([t,r,i]){return this.radius=1+i/this.radiusScale,this.phi=A3(r),this.theta=A3(t),this.check()}fromVector3(t){return this.radius=vO(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(_n(t[2]/this.radius,-1,1))),this.check()}toVector3(){return new rr(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}makeSafe(){return this.phi=Math.max(d0t,Math.min(Math.PI-d0t,this.phi)),this}check(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error(\"SphericalCoordinates: some fields set to invalid numbers\");return this}};var $E={};Ql($E,{EPSILON1:()=>Uzt,EPSILON10:()=>Xzt,EPSILON11:()=>Zzt,EPSILON12:()=>Kzt,EPSILON13:()=>Qzt,EPSILON14:()=>Jzt,EPSILON15:()=>tUt,EPSILON16:()=>eUt,EPSILON17:()=>rUt,EPSILON18:()=>iUt,EPSILON19:()=>nUt,EPSILON2:()=>Vzt,EPSILON20:()=>oUt,EPSILON3:()=>jzt,EPSILON4:()=>$zt,EPSILON5:()=>Gzt,EPSILON6:()=>Wzt,EPSILON7:()=>qzt,EPSILON8:()=>Hzt,EPSILON9:()=>Yzt,PI_OVER_FOUR:()=>aUt,PI_OVER_SIX:()=>lUt,PI_OVER_TWO:()=>sUt,TWO_PI:()=>cUt});var Uzt=.1,Vzt=.01,jzt=.001,$zt=1e-4,Gzt=1e-5,Wzt=1e-6,qzt=1e-7,Hzt=1e-8,Yzt=1e-9,Xzt=1e-10,Zzt=1e-11,Kzt=1e-12,Qzt=1e-13,Jzt=1e-14,tUt=1e-15,eUt=1e-16,rUt=1e-17,iUt=1e-18,nUt=1e-19,oUt=1e-20,sUt=Math.PI/2,aUt=Math.PI/4,lUt=Math.PI/6,cUt=Math.PI*2;function gY(e,t=[],r=0){let i=Math.fround(e),n=e-i;return t[r]=i,t[r+1]=n,t}function f0t(e){return e-Math.fround(e)}function p0t(e){let t=new Float32Array(32);for(let r=0;r<4;++r)for(let i=0;i<4;++i){let n=r*4+i;gY(e[i*4+r],t,n*2)}return t}var uUt=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n\n// All these functions are for substituting tan() function from Intel GPU only\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!\n\nfloat sin_taylor_fp32(float a) {\n  float r, s, t, x;\n\n  if (a == 0.0) {\n    return 0.0;\n  }\n\n  x = -a * a;\n  s = a;\n  r = a;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_3;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_5;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_7;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_9;\n  s = s + t;\n\n  return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n  if (a == 0.0) {\n    sin_t = 0.0;\n    cos_t = 1.0;\n  }\n  sin_t = sin_taylor_fp32(a);\n  cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n    float sin_a;\n    float cos_a;\n\n    if (a == 0.0) {\n        return 0.0;\n    }\n\n    // 2pi range reduction\n    float z = floor(a / TWO_PI);\n    float r = a - TWO_PI * z;\n\n    float t;\n    float q = floor(r / PI_2 + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return 1.0 / 0.0;\n    }\n\n    t = r - PI_2 * q;\n\n    q = floor(t / PI_16 + 0.5);\n    int k = int(q);\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return 1.0 / 0.0;\n    } else {\n        t = t - PI_16 * q;\n    }\n\n    float u = 0.0;\n    float v = 0.0;\n\n    float sin_t, cos_t;\n    float s, c;\n    sincos_taylor_fp32(t, sin_t, cos_t);\n\n    if (k == 0) {\n        s = sin_t;\n        c = cos_t;\n    } else {\n        if (abs(float(abs_k) - 1.0) < 0.5) {\n            u = COS_TABLE_0;\n            v = SIN_TABLE_0;\n        } else if (abs(float(abs_k) - 2.0) < 0.5) {\n            u = COS_TABLE_1;\n            v = SIN_TABLE_1;\n        } else if (abs(float(abs_k) - 3.0) < 0.5) {\n            u = COS_TABLE_2;\n            v = SIN_TABLE_2;\n        } else if (abs(float(abs_k) - 4.0) < 0.5) {\n            u = COS_TABLE_3;\n            v = SIN_TABLE_3;\n        }\n        if (k > 0) {\n            s = u * sin_t + v * cos_t;\n            c = u * cos_t - v * sin_t;\n        } else {\n            s = u * sin_t - v * cos_t;\n            c = u * cos_t + v * sin_t;\n        }\n    }\n\n    if (j == 0) {\n        sin_a = s;\n        cos_a = c;\n    } else if (j == 1) {\n        sin_a = c;\n        cos_a = -s;\n    } else if (j == -1) {\n        sin_a = -c;\n        cos_a = s;\n    } else {\n        sin_a = -s;\n        cos_a = -c;\n    }\n    return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n  return tan_taylor_fp32(a);\n#else\n  return tan(a);\n#endif\n}\n`,AY={name:\"fp32\",vs:uUt};var m0t=`\nuniform fp64arithmeticUniforms {\n  uniform float ONE;\n} fp64;\n\n/*\nAbout LUMA_FP64_CODE_ELIMINATION_WORKAROUND\n\nThe purpose of this workaround is to prevent shader compilers from\noptimizing away necessary arithmetic operations by swapping their sequences\nor transform the equation to some 'equivalent' form.\n\nThe method is to multiply an artifical variable, ONE, which will be known to\nthe compiler to be 1 only at runtime. The whole expression is then represented\nas a polynomial with respective to ONE. In the coefficients of all terms, only one a\nand one b should appear\n\nerr = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE\n*/\n\n// Divide float number to high and low floats to extend fraction bits\nvec2 split(float a) {\n  const float SPLIT = 4097.0;\n  float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float a_hi = t * fp64.ONE - (t - a);\n  float a_lo = a * fp64.ONE - a_hi;\n#else\n  float a_hi = t - (t - a);\n  float a_lo = a - a_hi;\n#endif\n  return vec2(a_hi, a_lo);\n}\n\n// Divide float number again when high float uses too many fraction bits\nvec2 split2(vec2 a) {\n  vec2 b = split(a.x);\n  b.y += a.y;\n  return b;\n}\n\n// Special sum operation when a > b\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float sum = (a + b) * fp64.ONE;\n  float err = b - (sum - a) * fp64.ONE;\n#else\n  float sum = a + b;\n  float err = b - (sum - a);\n#endif\n  return vec2(sum, err);\n}\n\n// General sum operation\nvec2 twoSum(float a, float b) {\n  float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * fp64.ONE - a) * fp64.ONE;\n  float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) + (b - v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n  float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * fp64.ONE - a) * fp64.ONE;\n  float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) - (b + v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n  float prod = a * a;\n  vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x *\n    a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE;\n#else\n  float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n  return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n  float prod = a * b;\n  vec2 a_fp64 = split(a);\n  vec2 b_fp64 = split(b);\n  float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n    a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n  return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSum(a.x, b.x);\n  t = twoSum(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSub(a.x, b.x);\n  t = twoSub(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n  vec2 prod = twoProd(a.x, b.x);\n  // y component is for the error\n  prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n  float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n  vec2 yn = a * xn;\n#endif\n  float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n  vec2 prod = twoProd(xn, diff);\n  return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n  if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n  if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n  float x = 1.0 / sqrt(a.x);\n  float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  vec2 yn_sqr = twoSqr(yn) * fp64.ONE;\n#else\n  vec2 yn_sqr = twoSqr(yn);\n#endif\n  float diff = sub_fp64(a, yn_sqr).x;\n  vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  return sum_fp64(split(yn), prod);\n#else\n  return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n`;var hUt={ONE:1},yY={name:\"fp64arithmetic\",vs:m0t,defaultUniforms:hUt,uniformTypes:{ONE:\"f32\"},fp64ify:gY,fp64LowPart:f0t,fp64ifyMatrix4:p0t};var dUt=[0,1,1,1],fUt=`uniform pickingUniforms {\n  float isActive;\n  float isAttribute;\n  float isHighlightActive;\n  float useFloatColors;\n  vec3 highlightedObjectColor;\n  vec4 highlightColor;\n} picking;\n\nout vec4 picking_vRGBcolor_Avalid;\n\n// Normalize unsigned byte color to 0-1 range\nvec3 picking_normalizeColor(vec3 color) {\n  return picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\n\n// Normalize unsigned byte color to 0-1 range\nvec4 picking_normalizeColor(vec4 color) {\n  return picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\n\nbool picking_isColorZero(vec3 color) {\n  return dot(color, vec3(1.0)) < 0.00001;\n}\n\nbool picking_isColorValid(vec3 color) {\n  return dot(color, vec3(1.0)) > 0.00001;\n}\n\n// Check if this vertex is highlighted \nbool isVertexHighlighted(vec3 vertexColor) {\n  vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);\n  return\n    bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor));\n}\n\n// Set the current picking color\nvoid picking_setPickingColor(vec3 pickingColor) {\n  pickingColor = picking_normalizeColor(pickingColor);\n\n  if (bool(picking.isActive)) {\n    // Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable\n    picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n    if (!bool(picking.isAttribute)) {\n      // Stores the picking color so that the fragment shader can render it during picking\n      picking_vRGBcolor_Avalid.rgb = pickingColor;\n    }\n  } else {\n    // Do the comparison with selected item color in vertex shader as it should mean fewer compares\n    picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor));\n  }\n}\n\nvoid picking_setPickingAttribute(float value) {\n  if (bool(picking.isAttribute)) {\n    picking_vRGBcolor_Avalid.r = value;\n  }\n}\n\nvoid picking_setPickingAttribute(vec2 value) {\n  if (bool(picking.isAttribute)) {\n    picking_vRGBcolor_Avalid.rg = value;\n  }\n}\n\nvoid picking_setPickingAttribute(vec3 value) {\n  if (bool(picking.isAttribute)) {\n    picking_vRGBcolor_Avalid.rgb = value;\n  }\n}\n`,pUt=`uniform pickingUniforms {\n  float isActive;\n  float isAttribute;\n  float isHighlightActive;\n  float useFloatColors;\n  vec3 highlightedObjectColor;\n  vec4 highlightColor;\n} picking;\n\nin vec4 picking_vRGBcolor_Avalid;\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n  // If we are still picking, we don't highlight\n  if (picking.isActive > 0.5) {\n    return color;\n  }\n\n  bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n  if (selected) {\n    // Blend in highlight color based on its alpha value\n    float highLightAlpha = picking.highlightColor.a;\n    float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n    float highLightRatio = highLightAlpha / blendedAlpha;\n\n    vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);\n    return vec4(blendedRGB, blendedAlpha);\n  } else {\n    return color;\n  }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 picking_filterPickingColor(vec4 color) {\n  if (bool(picking.isActive)) {\n    if (picking_vRGBcolor_Avalid.a == 0.0) {\n      discard;\n    }\n    return picking_vRGBcolor_Avalid;\n  }\n  return color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 picking_filterColor(vec4 color) {\n  vec4 highlightColor = picking_filterHighlightColor(color);\n  return picking_filterPickingColor(highlightColor);\n}\n`,kO={props:{},uniforms:{},name:\"picking\",uniformTypes:{isActive:\"f32\",isAttribute:\"f32\",isHighlightActive:\"f32\",useFloatColors:\"f32\",highlightedObjectColor:\"vec3<f32>\",highlightColor:\"vec4<f32>\"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:dUt},vs:fUt,fs:pUt,getUniforms:mUt};function mUt(e={},t){let r={};if(e.highlightedObjectColor!==void 0)if(e.highlightedObjectColor===null)r.isHighlightActive=!1;else{r.isHighlightActive=!0;let i=e.highlightedObjectColor.slice(0,3);r.highlightedObjectColor=i}if(e.highlightColor){let i=Array.from(e.highlightColor,n=>n/255);Number.isFinite(i[3])||(i[3]=1),r.highlightColor=i}return e.isActive!==void 0&&(r.isActive=!!e.isActive,r.isAttribute=!!e.isAttribute),e.useFloatColors!==void 0&&(r.useFloatColors=!!e.useFloatColors),r}Ci();var _Y=`precision highp int;\n\n// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\nstruct AmbientLight {\n  vec3 color;\n};\n\nstruct PointLight {\n  vec3 color;\n  vec3 position;\n  vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential\n};\n\nstruct DirectionalLight {\n  vec3 color;\n  vec3 direction;\n};\n\nuniform lightingUniforms {\n  int enabled;\n  int lightType;\n\n  int directionalLightCount;\n  int pointLightCount;\n\n  vec3 ambientColor;\n\n  vec3 lightColor0;\n  vec3 lightPosition0;\n  vec3 lightDirection0;\n  vec3 lightAttenuation0;\n\n  vec3 lightColor1;\n  vec3 lightPosition1;\n  vec3 lightDirection1;\n  vec3 lightAttenuation1;\n\n  vec3 lightColor2;\n  vec3 lightPosition2;\n  vec3 lightDirection2;\n  vec3 lightAttenuation2;\n} lighting;\n\nPointLight lighting_getPointLight(int index) {\n  switch (index) {\n    case 0:\n      return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0);\n    case 1:\n      return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1);\n    case 2:\n    default:  \n      return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2);\n  }\n}\n\nDirectionalLight lighting_getDirectionalLight(int index) {\n  switch (index) {\n    case 0:\n      return DirectionalLight(lighting.lightColor0, lighting.lightDirection0);\n    case 1:\n      return DirectionalLight(lighting.lightColor1, lighting.lightDirection1);\n    case 2:\n    default:   \n      return DirectionalLight(lighting.lightColor2, lighting.lightDirection2);\n  }\n} \n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n  return pointLight.attenuation.x\n       + pointLight.attenuation.y * distance\n       + pointLight.attenuation.z * distance * distance;\n}\n\n// #endif\n`;var g0t=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\nstruct AmbientLight {\n  color: vec3<f32>,\n};\n\nstruct PointLight {\n  color: vec3<f32>,\n  position: vec3<f32>,\n  attenuation: vec3<f32>, // 2nd order x:Constant-y:Linear-z:Exponential\n};\n\nstruct DirectionalLight {\n  color: vec3<f32>,\n  direction: vec3<f32>,\n};\n\nstruct lightingUniforms {\n  enabled: i32,\n  pointLightCount: i32,\n  directionalLightCount: i32,\n\n  ambientColor: vec3<f32>,\n\n  // TODO - support multiple lights by uncommenting arrays below\n  lightType: i32,\n  lightColor: vec3<f32>,\n  lightDirection: vec3<f32>,\n  lightPosition: vec3<f32>,\n  lightAttenuation: vec3<f32>,\n\n  // AmbientLight ambientLight;\n  // PointLight pointLight[MAX_LIGHTS];\n  // DirectionalLight directionalLight[MAX_LIGHTS];\n};\n\n// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls)\n@binding(1) @group(0) var<uniform> lighting : lightingUniforms;\n\nfn lighting_getPointLight(index: i32) -> PointLight {\n  return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation);\n}\n\nfn lighting_getDirectionalLight(index: i32) -> DirectionalLight {\n  return DirectionalLight(lighting.lightColor, lighting.lightDirection);\n} \n\nfn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 {\n  return pointLight.attenuation.x\n       + pointLight.attenuation.y * distance\n       + pointLight.attenuation.z * distance * distance;\n}\n`;var gUt=5,AUt=255,GE;(function(e){e[e.POINT=0]=\"POINT\",e[e.DIRECTIONAL=1]=\"DIRECTIONAL\"})(GE||(GE={}));var ab={props:{},uniforms:{},name:\"lighting\",defines:{},uniformTypes:{enabled:\"i32\",lightType:\"i32\",directionalLightCount:\"i32\",pointLightCount:\"i32\",ambientColor:\"vec3<f32>\",lightColor0:\"vec3<f32>\",lightPosition0:\"vec3<f32>\",lightDirection0:\"vec3<f32>\",lightAttenuation0:\"vec3<f32>\",lightColor1:\"vec3<f32>\",lightPosition1:\"vec3<f32>\",lightDirection1:\"vec3<f32>\",lightAttenuation1:\"vec3<f32>\",lightColor2:\"vec3<f32>\",lightPosition2:\"vec3<f32>\",lightDirection2:\"vec3<f32>\",lightAttenuation2:\"vec3<f32>\"},defaultUniforms:{enabled:1,lightType:GE.POINT,directionalLightCount:0,pointLightCount:0,ambientColor:[.1,.1,.1],lightColor0:[1,1,1],lightPosition0:[1,1,2],lightDirection0:[1,1,1],lightAttenuation0:[1,0,0],lightColor1:[1,1,1],lightPosition1:[1,1,2],lightDirection1:[1,1,1],lightAttenuation1:[1,0,0],lightColor2:[1,1,1],lightPosition2:[1,1,2],lightDirection2:[1,1,1],lightAttenuation2:[1,0,0]},source:g0t,vs:_Y,fs:_Y,getUniforms:yUt};function yUt(e,t={}){if(e=e&&{...e},!e)return{...ab.defaultUniforms};e.lights&&(e={...e,...vUt(e.lights),lights:void 0});let{ambientLight:r,pointLights:i,directionalLights:n}=e||{};if(!(r||i&&i.length>0||n&&n.length>0))return{...ab.defaultUniforms,enabled:0};let s={...ab.defaultUniforms,...t,..._Ut({ambientLight:r,pointLights:i,directionalLights:n})};return e.enabled!==void 0&&(s.enabled=e.enabled?1:0),s}function _Ut({ambientLight:e,pointLights:t=[],directionalLights:r=[]}){let i={};i.ambientColor=vY(e);let n=0;for(let o of t){i.lightType=GE.POINT;let s=n;i[`lightColor${s}`]=vY(o),i[`lightPosition${s}`]=o.position,i[`lightAttenuation${s}`]=o.attenuation||[1,0,0],n++}for(let o of r){i.lightType=GE.DIRECTIONAL;let s=n;i[`lightColor${s}`]=vY(o),i[`lightDirection${s}`]=o.direction,n++}return n>gUt&&Ie.warn(\"MAX_LIGHTS exceeded\")(),i.directionalLightCount=r.length,i.pointLightCount=t.length,i}function vUt(e){let t={pointLights:[],directionalLights:[]};for(let r of e||[])switch(r.type){case\"ambient\":t.ambientLight=r;break;case\"directional\":t.directionalLights?.push(r);break;case\"point\":t.pointLights?.push(r);break;default:}return t}function vY(e={}){let{color:t=[0,0,0],intensity:r=1}=e;return t.map(i=>i*r/AUt)}var RO=`uniform phongMaterialUniforms {\n  uniform float ambient;\n  uniform float diffuse;\n  uniform float shininess;\n  uniform vec3  specularColor;\n} material;\n`,DO=`#define MAX_LIGHTS 3\n\nuniform phongMaterialUniforms {\n  uniform float ambient;\n  uniform float diffuse;\n  uniform float shininess;\n  uniform vec3  specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n  vec3 halfway_direction = normalize(light_direction + view_direction);\n  float lambertian = dot(light_direction, normal_worldspace);\n  float specular = 0.0;\n  if (lambertian > 0.0) {\n    float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n    specular = pow(specular_angle, material.shininess);\n  }\n  lambertian = max(lambertian, 0.0);\n  return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = surfaceColor;\n\n  if (lighting.enabled == 0) {\n    return lightColor;\n  }\n\n  vec3 view_direction = normalize(cameraPosition - position_worldspace);\n  lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n  for (int i = 0; i < lighting.pointLightCount; i++) {\n    PointLight pointLight = lighting_getPointLight(i);\n    vec3 light_position_worldspace = pointLight.position;\n    vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n    float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));\n    lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);\n  }\n\n  int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);\n  for (int i = lighting.pointLightCount; i < totalLights; i++) {\n    DirectionalLight directionalLight = lighting_getDirectionalLight(i);\n    lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n  }\n  \n  return lightColor;\n}\n`;var OO=`struct phongMaterialUniforms {\n  ambient: f32,\n  diffuse: f32,\n  shininess: f32,\n  specularColor: vec3<f32>,\n};\n\n@binding(2) @group(0) var<uniform> phongMaterial : phongMaterialUniforms;\n\nfn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {\n  let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);\n  var lambertian: f32 = dot(light_direction, normal_worldspace);\n  var specular: f32 = 0.0;\n  if (lambertian > 0.0) {\n    let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n    specular = pow(specular_angle, phongMaterial.shininess);\n  }\n  lambertian = max(lambertian, 0.0);\n  return (lambertian * phongMaterial.diffuse * surfaceColor + specular * phongMaterial.specularColor) * color;\n}\n\nfn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {\n  var lightColor: vec3<f32> = surfaceColor;\n\n  if (lighting.enabled == 0) {\n    return lightColor;\n  }\n\n  let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);\n  lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor;\n\n  if (lighting.lightType == 0) {\n    let pointLight: PointLight  = lighting_getPointLight(0);\n    let light_position_worldspace: vec3<f32> = pointLight.position;\n    let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n    lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n  } else if (lighting.lightType == 1) {\n    var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n    lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n  }\n  \n  return lightColor;\n  /*\n  for (int i = 0; i < MAX_LIGHTS; i++) {\n    if (i >= lighting.pointLightCount) {\n      break;\n    }\n    PointLight pointLight = lighting.pointLight[i];\n    vec3 light_position_worldspace = pointLight.position;\n    vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n    lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n  }\n\n  for (int i = 0; i < MAX_LIGHTS; i++) {\n    if (i >= lighting.directionalLightCount) {\n      break;\n    }\n    DirectionalLight directionalLight = lighting.directionalLight[i];\n    lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n  }\n  */\n}\n\nfn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{\n  var lightColor = vec3<f32>(0, 0, 0);\n  let surfaceColor = vec3<f32>(0, 0, 0);\n\n  if (lighting.enabled == 0) {\n    let view_direction = normalize(cameraPosition - position_worldspace);\n\n    switch (lighting.lightType) {\n      case 0, default: {\n        let pointLight: PointLight = lighting_getPointLight(0);\n        let light_position_worldspace: vec3<f32> = pointLight.position;\n        let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n        lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n      }\n      case 1: {\n        let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n        lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n      }\n    }\n  }\n  return lightColor;\n}\n`;var kg={props:{},name:\"gouraudMaterial\",vs:DO.replace(\"phongMaterial\",\"gouraudMaterial\"),fs:RO.replace(\"phongMaterial\",\"gouraudMaterial\"),source:OO.replaceAll(\"phongMaterial\",\"gouraudMaterial\"),defines:{LIGHTING_VERTEX:!0},dependencies:[ab],uniformTypes:{ambient:\"f32\",diffuse:\"f32\",shininess:\"f32\",specularColor:\"vec3<f32>\"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(e){let t={...e};return t.specularColor&&(t.specularColor=t.specularColor.map(r=>r/255)),{...kg.defaultUniforms,...t}}};var lb={name:\"phongMaterial\",dependencies:[ab],source:OO,vs:RO,fs:DO,defines:{LIGHTING_FRAGMENT:!0},uniformTypes:{ambient:\"f32\",diffuse:\"f32\",shininess:\"f32\",specularColor:\"vec3<f32>\"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(e){let t={...e};return t.specularColor&&(t.specularColor=t.specularColor.map(r=>r/255)),{...lb.defaultUniforms,...t}}};var A0t=`uniform layerUniforms {\n  uniform float opacity;\n} layer;\n`,bY={name:\"layer\",vs:A0t,fs:A0t,getUniforms:e=>({opacity:Math.pow(e.opacity,.45454545454545453)}),uniformTypes:{opacity:\"f32\"}};var bUt=`\n\nstruct ColorUniforms {\n  opacity: f32,\n};\n\nvar<private> color: ColorUniforms = ColorUniforms(1.0);\n// TODO (kaapp) avoiding binding index collisions to handle layer opacity \n// requires some thought.\n// @group(0) @binding(0) var<uniform> color: ColorUniforms;\n\n@must_use\nfn deckgl_premultiplied_alpha(fragColor: vec4<f32>) -> vec4<f32> {\n    return vec4(fragColor.rgb * fragColor.a, fragColor.a); \n};\n`,x3={name:\"color\",dependencies:[],source:bUt,getUniforms:e=>({}),uniformTypes:{opacity:\"f32\"}};var xUt=`const SMOOTH_EDGE_RADIUS: f32 = 0.5;\n\nstruct VertexGeometry {\n  position: vec4<f32>,\n  worldPosition: vec3<f32>,\n  worldPositionAlt: vec3<f32>,\n  normal: vec3<f32>,\n  uv: vec2<f32>,\n  pickingColor: vec3<f32>,\n};\n\nvar<private> geometry_: VertexGeometry = VertexGeometry(\n  vec4<f32>(0.0, 0.0, 1.0, 0.0),\n  vec3<f32>(0.0, 0.0, 0.0),\n  vec3<f32>(0.0, 0.0, 0.0),\n  vec3<f32>(0.0, 0.0, 0.0),\n  vec2<f32>(0.0, 0.0),\n  vec3<f32>(0.0, 0.0, 0.0)\n);\n\nstruct FragmentGeometry {\n  uv: vec2<f32>,\n};\n\nvar<private> fragmentGeometry: FragmentGeometry;\n\nfn smoothedge(edge: f32, x: f32) -> f32 {\n  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n`,y0t=\"#define SMOOTH_EDGE_RADIUS 0.5\",wUt=`${y0t}\n\nstruct VertexGeometry {\n  vec4 position;\n  vec3 worldPosition;\n  vec3 worldPositionAlt;\n  vec3 normal;\n  vec2 uv;\n  vec3 pickingColor;\n} geometry = VertexGeometry(\n  vec4(0.0, 0.0, 1.0, 0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec2(0.0),\n  vec3(0.0)\n);\n`,TUt=`${y0t}\n\nstruct FragmentGeometry {\n  vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n`,LO={name:\"geometry\",source:xUt,vs:wUt,fs:TUt};var On;(function(e){e[e.Start=1]=\"Start\",e[e.Move=2]=\"Move\",e[e.End=4]=\"End\",e[e.Cancel=8]=\"Cancel\"})(On||(On={}));var Uo;(function(e){e[e.None=0]=\"None\",e[e.Left=1]=\"Left\",e[e.Right=2]=\"Right\",e[e.Up=4]=\"Up\",e[e.Down=8]=\"Down\",e[e.Horizontal=3]=\"Horizontal\",e[e.Vertical=12]=\"Vertical\",e[e.All=15]=\"All\"})(Uo||(Uo={}));var Xr;(function(e){e[e.Possible=1]=\"Possible\",e[e.Began=2]=\"Began\",e[e.Changed=4]=\"Changed\",e[e.Ended=8]=\"Ended\",e[e.Recognized=8]=\"Recognized\",e[e.Cancelled=16]=\"Cancelled\",e[e.Failed=32]=\"Failed\"})(Xr||(Xr={}));var _0t=\"compute\",xY=\"auto\",WE=\"manipulation\",cb=\"none\",qE=\"pan-x\",HE=\"pan-y\";function wY(e){if(e.includes(cb))return cb;let t=e.includes(qE),r=e.includes(HE);return t&&r?cb:t||r?t?qE:HE:e.includes(WE)?WE:xY}var YE=class{constructor(t,r){this.actions=\"\",this.manager=t,this.set(r)}set(t){t===_0t&&(t=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=t,this.actions=t)}update(){this.set(this.manager.options.touchAction)}compute(){let t=[];for(let r of this.manager.recognizers)r.options.enable&&(t=t.concat(r.getTouchAction()));return wY(t.join(\" \"))}};function w3(e){return e.trim().split(/\\s+/g)}function BO(e,t,r){if(e)for(let i of w3(t))e.addEventListener(i,r,!1)}function FO(e,t,r){if(e)for(let i of w3(t))e.removeEventListener(i,r,!1)}function TY(e){return(e.ownerDocument||e).defaultView}function SY(e,t){let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1}function NO(e){let t=e.length;if(t===1)return{x:Math.round(e[0].clientX),y:Math.round(e[0].clientY)};let r=0,i=0,n=0;for(;n<t;)r+=e[n].clientX,i+=e[n].clientY,n++;return{x:Math.round(r/t),y:Math.round(i/t)}}function MY(e){let t=[],r=0;for(;r<e.pointers.length;)t[r]={clientX:Math.round(e.pointers[r].clientX),clientY:Math.round(e.pointers[r].clientY)},r++;return{timeStamp:Date.now(),pointers:t,center:NO(t),deltaX:e.deltaX,deltaY:e.deltaY}}function zO(e,t){let r=t.x-e.x,i=t.y-e.y;return Math.sqrt(r*r+i*i)}function EY(e,t){let r=t.clientX-e.clientX,i=t.clientY-e.clientY;return Math.sqrt(r*r+i*i)}function v0t(e,t){let r=t.x-e.x,i=t.y-e.y;return Math.atan2(i,r)*180/Math.PI}function PY(e,t){let r=t.clientX-e.clientX,i=t.clientY-e.clientY;return Math.atan2(i,r)*180/Math.PI}function UO(e,t){return e===t?Uo.None:Math.abs(e)>=Math.abs(t)?e<0?Uo.Left:Uo.Right:t<0?Uo.Up:Uo.Down}function b0t(e,t){let r=t.center,i=e.offsetDelta,n=e.prevDelta,o=e.prevInput;return(t.eventType===On.Start||o?.eventType===On.End)&&(n=e.prevDelta={x:o?.deltaX||0,y:o?.deltaY||0},i=e.offsetDelta={x:r.x,y:r.y}),{deltaX:n.x+(r.x-i.x),deltaY:n.y+(r.y-i.y)}}function VO(e,t,r){return{x:t/e||0,y:r/e||0}}function x0t(e,t){return EY(t[0],t[1])/EY(e[0],e[1])}function w0t(e,t){return PY(t[1],t[0])-PY(e[1],e[0])}function T0t(e,t){let r=e.lastInterval||t,i=t.timeStamp-r.timeStamp,n,o,s,a;if(t.eventType!==On.Cancel&&(i>25||r.velocity===void 0)){let h=t.deltaX-r.deltaX,p=t.deltaY-r.deltaY,g=VO(i,h,p);o=g.x,s=g.y,n=Math.abs(g.x)>Math.abs(g.y)?g.x:g.y,a=UO(h,p),e.lastInterval=t}else n=r.velocity,o=r.velocityX,s=r.velocityY,a=r.direction;t.velocity=n,t.velocityX=o,t.velocityY=s,t.direction=a}function S0t(e,t){let{session:r}=e,{pointers:i}=t,{length:n}=i;r.firstInput||(r.firstInput=MY(t)),n>1&&!r.firstMultiple?r.firstMultiple=MY(t):n===1&&(r.firstMultiple=!1);let{firstInput:o,firstMultiple:s}=r,a=s?s.center:o.center,h=t.center=NO(i);t.timeStamp=Date.now(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=v0t(a,h),t.distance=zO(a,h);let{deltaX:p,deltaY:g}=b0t(r,t);t.deltaX=p,t.deltaY=g,t.offsetDirection=UO(t.deltaX,t.deltaY);let w=VO(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=w.x,t.overallVelocityY=w.y,t.overallVelocity=Math.abs(w.x)>Math.abs(w.y)?w.x:w.y,t.scale=s?x0t(s.pointers,i):1,t.rotation=s?w0t(s.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length;let C=e.element;return SY(t.srcEvent.target,C)&&(C=t.srcEvent.target),t.target=C,T0t(r,t),t}function M0t(e,t,r){let i=r.pointers.length,n=r.changedPointers.length,o=t&On.Start&&i-n===0,s=t&(On.End|On.Cancel)&&i-n===0;r.isFirst=!!o,r.isFinal=!!s,o&&(e.session={}),r.eventType=t;let a=S0t(e,r);e.emit(\"hammer.input\",a),e.recognize(a),e.session.prevInput=a}var XE=class{constructor(t){this.evEl=\"\",this.evWin=\"\",this.evTarget=\"\",this.domHandler=r=>{this.manager.options.enable&&this.handler(r)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,r){M0t(this.manager,t,r)}init(){BO(this.element,this.evEl,this.domHandler),BO(this.target,this.evTarget,this.domHandler),BO(TY(this.element),this.evWin,this.domHandler)}destroy(){FO(this.element,this.evEl,this.domHandler),FO(this.target,this.evTarget,this.domHandler),FO(TY(this.element),this.evWin,this.domHandler)}};var MUt={pointerdown:On.Start,pointermove:On.Move,pointerup:On.End,pointercancel:On.Cancel,pointerout:On.Cancel},EUt=\"pointerdown\",PUt=\"pointermove pointerup pointercancel\",ZE=class extends XE{constructor(t){super(t),this.evEl=EUt,this.evWin=PUt,this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){let{store:r}=this,i=!1,n=MUt[t.type],o=t.pointerType,s=o===\"touch\",a=r.findIndex(h=>h.pointerId===t.pointerId);n&On.Start&&(t.buttons||s)?a<0&&(r.push(t),a=r.length-1):n&(On.End|On.Cancel)&&(i=!0),!(a<0)&&(r[a]=t,this.callback(n,{pointers:r,changedPointers:[t],eventType:n,pointerType:o,srcEvent:t}),i&&r.splice(a,1))}};var CUt=[\"\",\"webkit\",\"Moz\",\"MS\",\"ms\",\"o\"];function E0t(e,t){let r=t[0].toUpperCase()+t.slice(1);for(let i of CUt){let n=i?i+r:t;if(n in e)return n}}var IUt=1,P0t=2,C0t={touchAction:\"compute\",enable:!0,inputTarget:null,cssProps:{userSelect:\"none\",userDrag:\"none\",touchCallout:\"none\",tapHighlightColor:\"rgba(0,0,0,0)\"}},KE=class{constructor(t,r){this.options={...C0t,...r,cssProps:{...C0t.cssProps,...r.cssProps},inputTarget:r.inputTarget||t},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new ZE(this),this.touchAction=new YE(this,this.options.touchAction),this.toggleCssProps(!0)}set(t){return Object.assign(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}stop(t){this.session.stopped=t?P0t:IUt}recognize(t){let{session:r}=this;if(r.stopped)return;this.session.prevented&&t.srcEvent.preventDefault();let i,{recognizers:n}=this,{curRecognizer:o}=r;(!o||o&&o.state&Xr.Recognized)&&(o=r.curRecognizer=null);let s=0;for(;s<n.length;)i=n[s],r.stopped!==P0t&&(!o||i===o||i.canRecognizeWith(o))?i.recognize(t):i.reset(),!o&&i.state&(Xr.Began|Xr.Changed|Xr.Ended)&&(o=r.curRecognizer=i),s++}get(t){let{recognizers:r}=this;for(let i=0;i<r.length;i++)if(r[i].options.event===t)return r[i];return null}add(t){if(Array.isArray(t)){for(let i of t)this.add(i);return this}let r=this.get(t.options.event);return r&&this.remove(r),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}remove(t){if(Array.isArray(t)){for(let i of t)this.remove(i);return this}let r=typeof t==\"string\"?this.get(t):t;if(r){let{recognizers:i}=this,n=i.indexOf(r);n!==-1&&(i.splice(n,1),this.touchAction.update())}return this}on(t,r){if(!t||!r)return;let{handlers:i}=this;for(let n of w3(t))i[n]=i[n]||[],i[n].push(r)}off(t,r){if(!t)return;let{handlers:i}=this;for(let n of w3(t))r?i[n]&&i[n].splice(i[n].indexOf(r),1):delete i[n]}emit(t,r){let i=this.handlers[t]&&this.handlers[t].slice();if(!i||!i.length)return;let n=r;n.type=t,n.preventDefault=function(){r.srcEvent.preventDefault()};let o=0;for(;o<i.length;)i[o](n),o++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(t){let{element:r}=this;if(r){for(let[i,n]of Object.entries(this.options.cssProps)){let o=E0t(r.style,i);t?(this.oldCssProps[o]=r.style[o],r.style[o]=n):r.style[o]=this.oldCssProps[o]||\"\"}t||(this.oldCssProps={})}}};var kUt=1;function I0t(){return kUt++}function CY(e){return e&Xr.Cancelled?\"cancel\":e&Xr.Ended?\"end\":e&Xr.Changed?\"move\":e&Xr.Began?\"start\":\"\"}var Rg=class{constructor(t){this.options=t,this.id=I0t(),this.state=Xr.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(let n of t)this.recognizeWith(n);return this}let r;if(typeof t==\"string\"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{simultaneous:i}=this;return i[r.id]||(i[r.id]=r,r.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(let i of t)this.dropRecognizeWith(i);return this}let r;return typeof t==\"string\"?r=this.manager.get(t):r=t,r&&delete this.simultaneous[r.id],this}requireFailure(t){if(Array.isArray(t)){for(let n of t)this.requireFailure(n);return this}let r;if(typeof t==\"string\"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{requireFail:i}=this;return i.indexOf(r)===-1&&(i.push(r),r.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(let i of t)this.dropRequireFailure(i);return this}let r;if(typeof t==\"string\"?r=this.manager.get(t):r=t,r){let i=this.requireFail.indexOf(r);i>-1&&this.requireFail.splice(i,1)}return this}hasRequireFailures(){return!!this.requireFail.find(t=>t.options.enable)}canRecognizeWith(t){return!!this.simultaneous[t.id]}emit(t){if(!t)return;let{state:r}=this;r<Xr.Ended&&this.manager.emit(this.options.event+CY(r),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),r>=Xr.Ended&&this.manager.emit(this.options.event+CY(r),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=Xr.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Xr.Failed|Xr.Possible)))return!1;t++}return!0}recognize(t){let r={...t};if(!this.options.enable){this.reset(),this.state=Xr.Failed;return}this.state&(Xr.Recognized|Xr.Cancelled|Xr.Failed)&&(this.state=Xr.Possible),this.state=this.process(r),this.state&(Xr.Began|Xr.Changed|Xr.Ended|Xr.Cancelled)&&this.tryEmit(r)}getEventNames(){return[this.options.event]}reset(){}};var Dg=class extends Rg{attrTest(t){let r=this.options.pointers;return r===0||t.pointers.length===r}process(t){let{state:r}=this,{eventType:i}=t,n=r&(Xr.Began|Xr.Changed),o=this.attrTest(t);return n&&(i&On.Cancel||!o)?r|Xr.Cancelled:n||o?i&On.End?r|Xr.Ended:r&Xr.Began?r|Xr.Changed:Xr.Began:Xr.Failed}};var ub=class extends Rg{constructor(t={}){super({enable:!0,event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[WE]}process(t){let{options:r}=this,i=t.pointers.length===r.pointers,n=t.distance<r.threshold,o=t.deltaTime<r.time;if(this.reset(),t.eventType&On.Start&&this.count===0)return this.failTimeout();if(n&&o&&i){if(t.eventType!==On.End)return this.failTimeout();let s=this.pTime?t.timeStamp-this.pTime<r.interval:!0,a=!this.pCenter||zO(this.pCenter,t.center)<r.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,!a||!s?this.count=1:this.count+=1,this._input=t,this.count%r.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=Xr.Recognized,this.tryEmit(this._input)},r.interval),Xr.Began):Xr.Recognized}return Xr.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Xr.Failed},this.options.interval),Xr.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===Xr.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}};var RUt=[\"\",\"start\",\"move\",\"end\",\"cancel\",\"up\",\"down\",\"left\",\"right\"],d1=class extends Dg{constructor(t={}){super({enable:!0,pointers:1,event:\"pan\",threshold:10,direction:Uo.All,...t}),this.pX=null,this.pY=null}getTouchAction(){let{options:{direction:t}}=this,r=[];return t&Uo.Horizontal&&r.push(HE),t&Uo.Vertical&&r.push(qE),r}getEventNames(){return RUt.map(t=>this.options.event+t)}directionTest(t){let{options:r}=this,i=!0,{distance:n}=t,{direction:o}=t,s=t.deltaX,a=t.deltaY;return o&r.direction||(r.direction&Uo.Horizontal?(o=s===0?Uo.None:s<0?Uo.Left:Uo.Right,i=s!==this.pX,n=Math.abs(t.deltaX)):(o=a===0?Uo.None:a<0?Uo.Up:Uo.Down,i=a!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>r.threshold&&!!(o&r.direction)}attrTest(t){return super.attrTest(t)&&(!!(this.state&Xr.Began)||!(this.state&Xr.Began)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;let r=Uo[t.direction].toLowerCase();r&&(t.additionalEvent=this.options.event+r),super.emit(t)}};var DUt=[\"\",\"start\",\"move\",\"end\",\"cancel\",\"in\",\"out\"],T3=class extends Dg{constructor(t={}){super({enable:!0,event:\"pinch\",threshold:0,pointers:2,...t})}getTouchAction(){return[cb]}getEventNames(){return DUt.map(t=>this.options.event+t)}attrTest(t){return super.attrTest(t)&&(Math.abs(t.scale-1)>this.options.threshold||!!(this.state&Xr.Began))}emit(t){if(t.scale!==1){let r=t.scale<1?\"in\":\"out\";t.additionalEvent=this.options.event+r}super.emit(t)}};var v0=class{constructor(t,r,i){this.element=t,this.callback=r,this.options=i}};var k0t=typeof navigator<\"u\"&&navigator.userAgent?navigator.userAgent.toLowerCase():\"\",GMe=typeof window<\"u\"?window:global;var FUt=k0t.indexOf(\"firefox\")!==-1,R0t=4.000244140625,NUt=40,zUt=.25,jO=class extends v0{constructor(t,r,i){super(t,r,{enable:!0,...i}),this.handleEvent=n=>{if(!this.options.enable)return;let o=n.deltaY;globalThis.WheelEvent&&(FUt&&n.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(o/=globalThis.devicePixelRatio),n.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(o*=NUt)),o!==0&&o%R0t===0&&(o=Math.floor(o/R0t)),n.shiftKey&&o&&(o=o*zUt),this.callback({type:\"wheel\",center:{x:n.clientX,y:n.clientY},delta:-o,srcEvent:n,pointerType:\"mouse\",target:n.target})},t.addEventListener(\"wheel\",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener(\"wheel\",this.handleEvent)}enableEventType(t,r){t===\"wheel\"&&(this.options.enable=r)}};var D0t=[\"mousedown\",\"mousemove\",\"mouseup\",\"mouseover\",\"mouseout\",\"mouseleave\"],$O=class extends v0{constructor(t,r,i){super(t,r,{enable:!0,...i}),this.handleEvent=o=>{this.handleOverEvent(o),this.handleOutEvent(o),this.handleEnterEvent(o),this.handleLeaveEvent(o),this.handleMoveEvent(o)},this.pressed=!1;let{enable:n}=this.options;this.enableMoveEvent=n,this.enableLeaveEvent=n,this.enableEnterEvent=n,this.enableOutEvent=n,this.enableOverEvent=n,D0t.forEach(o=>t.addEventListener(o,this.handleEvent))}destroy(){D0t.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){switch(t){case\"pointermove\":this.enableMoveEvent=r;break;case\"pointerover\":this.enableOverEvent=r;break;case\"pointerout\":this.enableOutEvent=r;break;case\"pointerenter\":this.enableEnterEvent=r;break;case\"pointerleave\":this.enableLeaveEvent=r;break;default:}}handleOverEvent(t){this.enableOverEvent&&t.type===\"mouseover\"&&this._emit(\"pointerover\",t)}handleOutEvent(t){this.enableOutEvent&&t.type===\"mouseout\"&&this._emit(\"pointerout\",t)}handleEnterEvent(t){this.enableEnterEvent&&t.type===\"mouseenter\"&&this._emit(\"pointerenter\",t)}handleLeaveEvent(t){this.enableLeaveEvent&&t.type===\"mouseleave\"&&this._emit(\"pointerleave\",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case\"mousedown\":t.button>=0&&(this.pressed=!0);break;case\"mousemove\":t.buttons===0&&(this.pressed=!1),this.pressed||this._emit(\"pointermove\",t);break;case\"mouseup\":this.pressed=!1;break;default:}}_emit(t,r){this.callback({type:t,center:{x:r.clientX,y:r.clientY},srcEvent:r,pointerType:\"mouse\",target:r.target})}};var O0t=[\"keydown\",\"keyup\"],GO=class extends v0{constructor(t,r,i){super(t,r,{enable:!0,tabIndex:0,...i}),this.handleEvent=n=>{let o=n.target||n.srcElement;o.tagName===\"INPUT\"&&o.type===\"text\"||o.tagName===\"TEXTAREA\"||(this.enableDownEvent&&n.type===\"keydown\"&&this.callback({type:\"keydown\",srcEvent:n,key:n.key,target:n.target}),this.enableUpEvent&&n.type===\"keyup\"&&this.callback({type:\"keyup\",srcEvent:n,key:n.key,target:n.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,t.tabIndex=this.options.tabIndex,t.style.outline=\"none\",O0t.forEach(n=>t.addEventListener(n,this.handleEvent))}destroy(){O0t.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){t===\"keydown\"&&(this.enableDownEvent=r),t===\"keyup\"&&(this.enableUpEvent=r)}};var WO=class extends v0{constructor(t,r,i){super(t,r,i),this.handleEvent=n=>{this.options.enable&&this.callback({type:\"contextmenu\",center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:\"mouse\",target:n.target})},t.addEventListener(\"contextmenu\",this.handleEvent)}destroy(){this.element.removeEventListener(\"contextmenu\",this.handleEvent)}enableEventType(t,r){t===\"contextmenu\"&&(this.options.enable=r)}};var UUt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},VUt=0,jUt=1,$Ut=2,GUt=1,WUt=2,qUt=4;function L0t(e){let t=UUt[e.srcEvent.type];if(!t)return null;let{buttons:r,button:i}=e.srcEvent,n=!1,o=!1,s=!1;return t===2?(n=!!(r&GUt),o=!!(r&qUt),s=!!(r&WUt)):(n=i===VUt,o=i===jUt,s=i===$Ut),{leftButton:n,middleButton:o,rightButton:s}}function B0t(e,t){let r=e.center;if(!r)return null;let i=t.getBoundingClientRect(),n=i.width/t.offsetWidth||1,o=i.height/t.offsetHeight||1,s={x:(r.x-i.left-t.clientLeft)/n,y:(r.y-i.top-t.clientTop)/o};return{center:r,offsetCenter:s}}var HUt={srcElement:\"root\",priority:0},qO=class{constructor(t,r){this.handleEvent=i=>{if(this.isEmpty())return;let n=this._normalizeEvent(i),o=i.srcEvent.target;for(;o&&o!==n.rootElement;){if(this._emit(n,o),n.handled)return;o=o.parentNode}this._emit(n,\"root\")},this.eventManager=t,this.recognizerName=r,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,r,i,n=!1,o=!1){let{handlers:s,handlersByElement:a}=this,h={...HUt,...i},p=a.get(h.srcElement);p||(p=[],a.set(h.srcElement,p));let g={type:t,handler:r,srcElement:h.srcElement,priority:h.priority};n&&(g.once=!0),o&&(g.passive=!0),s.push(g),this._active=this._active||!g.passive;let w=p.length-1;for(;w>=0&&!(p[w].priority>=g.priority);)w--;p.splice(w+1,0,g)}remove(t,r){let{handlers:i,handlersByElement:n}=this;for(let o=i.length-1;o>=0;o--){let s=i[o];if(s.type===t&&s.handler===r){i.splice(o,1);let a=n.get(s.srcElement);a.splice(a.indexOf(s),1),a.length===0&&n.delete(s.srcElement)}}this._active=i.some(o=>!o.passive)}_emit(t,r){let i=this.handlersByElement.get(r);if(i){let n=!1,o=()=>{t.handled=!0},s=()=>{t.handled=!0,n=!0},a=[];for(let h=0;h<i.length;h++){let{type:p,handler:g,once:w}=i[h];if(g({...t,type:p,stopPropagation:o,stopImmediatePropagation:s}),w&&a.push(i[h]),n)break}for(let h=0;h<a.length;h++){let{type:p,handler:g}=a[h];this.remove(p,g)}}}_normalizeEvent(t){let r=this.eventManager.getElement();return{...t,...L0t(t),...B0t(t,r),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:r}}};function YUt(e){if(\"recognizer\"in e)return e;let t,r=Array.isArray(e)?[...e]:[e];if(typeof r[0]==\"function\"){let i=r.shift(),n=r.shift()||{};t=new i(n)}else t=r.shift();return{recognizer:t,recognizeWith:typeof r[0]==\"string\"?[r[0]]:r[0],requireFailure:typeof r[1]==\"string\"?[r[1]]:r[1]}}var QE=class{constructor(t=null,r={}){if(this._onBasicInput=i=>{this.manager.emit(i.srcEvent.type,i)},this._onOtherEvent=i=>{this.manager.emit(i.type,i)},this.options={recognizers:[],events:{},touchAction:\"compute\",tabIndex:0,cssProps:{},...r},this.events=new Map,this.element=t,!!t){this.manager=new KE(t,this.options);for(let i of this.options.recognizers){let{recognizer:n,recognizeWith:o,requireFailure:s}=YUt(i);this.manager.add(n),o&&n.recognizeWith(o),s&&n.requireFailure(s)}this.manager.on(\"hammer.input\",this._onBasicInput),this.wheelInput=new jO(t,this._onOtherEvent,{enable:!1}),this.moveInput=new $O(t,this._onOtherEvent,{enable:!1}),this.keyInput=new GO(t,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new WO(t,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(t,r,i){this._addEventHandler(t,r,i,!1)}once(t,r,i){this._addEventHandler(t,r,i,!0)}watch(t,r,i){this._addEventHandler(t,r,i,!1,!0)}off(t,r){this._removeEventHandler(t,r)}_toggleRecognizer(t,r){let{manager:i}=this;if(!i)return;let n=i.get(t);n&&(n.set({enable:r}),i.touchAction.update()),this.wheelInput?.enableEventType(t,r),this.moveInput?.enableEventType(t,r),this.keyInput?.enableEventType(t,r),this.contextmenuInput?.enableEventType(t,r)}_addEventHandler(t,r,i,n,o){if(typeof t!=\"string\"){i=r;for(let[p,g]of Object.entries(t))this._addEventHandler(p,g,i,n,o);return}let{manager:s,events:a}=this;if(!s)return;let h=a.get(t);if(!h){let p=this._getRecognizerName(t)||t;h=new qO(this,p),a.set(t,h),s&&s.on(t,h.handleEvent)}h.add(t,r,i,n,o),h.isEmpty()||this._toggleRecognizer(h.recognizerName,!0)}_removeEventHandler(t,r){if(typeof t!=\"string\"){for(let[o,s]of Object.entries(t))this._removeEventHandler(o,s);return}let{events:i}=this,n=i.get(t);if(n&&(n.remove(t,r),n.isEmpty())){let{recognizerName:o}=n,s=!1;for(let a of i.values())if(a.recognizerName===o&&!a.isEmpty()){s=!0;break}s||this._toggleRecognizer(o,!1)}}_getRecognizerName(t){return this.manager.recognizers.find(r=>r.getEventNames().includes(t))?.options.event}};var Vr={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Vr,\"IDENTITY\",{get:()=>(hr.deprecated(\"COORDINATE_SYSTEM.IDENTITY\",\"COORDINATE_SYSTEM.CARTESIAN\")(),0)});var Pa={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},rs={common:0,meters:1,pixels:2},JE={click:\"onClick\",dblclick:\"onClick\",panstart:\"onDragStart\",panmove:\"onDrag\",panend:\"onDragEnd\"},IY={multipan:[d1,{threshold:10,direction:Uo.Vertical,pointers:2}],pinch:[T3,{},null,[\"multipan\"]],pan:[d1,{threshold:1},[\"pinch\"],[\"multipan\"]],dblclick:[ub,{event:\"dblclick\",taps:2}],click:[ub,{event:\"click\"},null,[\"dblclick\"]]};function XUt(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}return!1}function b0(e){let t={},r;return i=>{for(let n in i)if(!XUt(i[n],t[n])){r=e(i),t=i;break}return r}}var F0t=[0,0,0,0],ZUt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],N0t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],KUt=[0,0,0],z0t=[0,0,0],QUt=b0(tVt);function kY(e,t,r=z0t){r.length<3&&(r=[r[0],r[1],0]);let i=r,n,o=!0;switch(t===Vr.LNGLAT_OFFSETS||t===Vr.METER_OFFSETS?n=r:n=e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case Pa.WEB_MERCATOR:(t===Vr.LNGLAT||t===Vr.CARTESIAN)&&(n=[0,0,0],o=!1);break;case Pa.WEB_MERCATOR_AUTO_OFFSET:t===Vr.LNGLAT?i=n:t===Vr.CARTESIAN&&(i=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],n=e.unprojectPosition(i),i[0]-=r[0],i[1]-=r[1],i[2]-=r[2]);break;case Pa.IDENTITY:i=e.position.map(Math.fround),i[2]=i[2]||0;break;case Pa.GLOBE:o=!1,n=null;break;default:o=!1}return{geospatialOrigin:n,shaderCoordinateOrigin:i,offsetMode:o}}function JUt(e,t,r){let{viewMatrixUncentered:i,projectionMatrix:n}=e,{viewMatrix:o,viewProjectionMatrix:s}=e,a=F0t,h=F0t,p=e.cameraPosition,{geospatialOrigin:g,shaderCoordinateOrigin:w,offsetMode:C}=kY(e,t,r);return C&&(h=e.projectPosition(g||w),p=[p[0]-h[0],p[1]-h[1],p[2]-h[2]],h[3]=1,a=xu.transformMat4([],h,s),o=i||o,s=Gs.multiply([],n,o),s=Gs.multiply([],s,ZUt)),{viewMatrix:o,viewProjectionMatrix:s,projectionCenter:a,originCommon:h,cameraPosCommon:p,shaderCoordinateOrigin:w,geospatialOrigin:g}}function U0t({viewport:e,devicePixelRatio:t=1,modelMatrix:r=null,coordinateSystem:i=Vr.DEFAULT,coordinateOrigin:n=z0t,autoWrapLongitude:o=!1}){i===Vr.DEFAULT&&(i=e.isGeospatial?Vr.LNGLAT:Vr.CARTESIAN);let s=QUt({viewport:e,devicePixelRatio:t,coordinateSystem:i,coordinateOrigin:n});return s.wrapLongitude=o,s.modelMatrix=r||N0t,s}function tVt({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:i}){let{projectionCenter:n,viewProjectionMatrix:o,originCommon:s,cameraPosCommon:a,shaderCoordinateOrigin:h,geospatialOrigin:p}=JUt(e,r,i),g=e.getDistanceScales(),w=[e.width*t,e.height*t],C=xu.transformMat4([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,R={coordinateSystem:r,projectionMode:e.projectionMode,coordinateOrigin:h,commonOrigin:s.slice(0,3),center:n,pseudoMeters:!!e._pseudoMeters,viewportSize:w,devicePixelRatio:t,focalDistance:C,commonUnitsPerMeter:g.unitsPerMeter,commonUnitsPerWorldUnit:g.unitsPerMeter,commonUnitsPerWorldUnit2:KUt,scale:e.scale,wrapLongitude:!1,viewProjectionMatrix:o,modelMatrix:N0t,cameraPosition:a};if(p){let z=e.getDistanceScales(p);switch(r){case Vr.METER_OFFSETS:R.commonUnitsPerWorldUnit=z.unitsPerMeter,R.commonUnitsPerWorldUnit2=z.unitsPerMeter2;break;case Vr.LNGLAT:case Vr.LNGLAT_OFFSETS:e._pseudoMeters||(R.commonUnitsPerMeter=z.unitsPerMeter),R.commonUnitsPerWorldUnit=z.unitsPerDegree,R.commonUnitsPerWorldUnit2=z.unitsPerDegree2;break;case Vr.CARTESIAN:R.commonUnitsPerWorldUnit=[1,1,z.unitsPerMeter[2]],R.commonUnitsPerWorldUnit2=[0,0,z.unitsPerMeter2[2]];break;default:break}}return R}var eVt=Object.keys(Vr).map(e=>`const COORDINATE_SYSTEM_${e}: i32 = ${Vr[e]};`).join(\"\"),rVt=Object.keys(Pa).map(e=>`const PROJECTION_MODE_${e}: i32 = ${Pa[e]};`).join(\"\"),iVt=Object.keys(rs).map(e=>`const UNIT_${e.toUpperCase()}: i32 = ${rs[e]};`).join(\"\"),nVt=`${eVt}\n${rVt}\n${iVt}\n\nconst TILE_SIZE: f32 = 512.0;\nconst PI: f32 = 3.1415926536;\nconst WORLD_SCALE: f32 = TILE_SIZE / (PI * 2.0);\nconst ZERO_64_LOW: vec3<f32> = vec3<f32>(0.0, 0.0, 0.0);\nconst EARTH_RADIUS: f32 = 6370972.0; // meters\nconst GLOBE_RADIUS: f32 = 256.0;\n\n// -----------------------------------------------------------------------------\n// Uniform block (converted from GLSL uniform block)\n// -----------------------------------------------------------------------------\nstruct ProjectUniforms {\n  wrapLongitude: i32,\n  coordinateSystem: i32,\n  commonUnitsPerMeter: vec3<f32>,\n  projectionMode: i32,\n  scale: f32,\n  commonUnitsPerWorldUnit: vec3<f32>,\n  commonUnitsPerWorldUnit2: vec3<f32>,\n  center: vec4<f32>,\n  modelMatrix: mat4x4<f32>,\n  viewProjectionMatrix: mat4x4<f32>,\n  viewportSize: vec2<f32>,\n  devicePixelRatio: f32,\n  focalDistance: f32,\n  cameraPosition: vec3<f32>,\n  coordinateOrigin: vec3<f32>,\n  commonOrigin: vec3<f32>,\n  pseudoMeters: i32,\n};\n\n@group(0) @binding(0)\nvar<uniform> project: ProjectUniforms;\n\n// -----------------------------------------------------------------------------\n// Geometry data\n// (In your GLSL code, \"geometry\" was assumed to be available globally. In WGSL,\n// you might supply this via vertex attributes or a uniform. Here we define a\n// uniform struct for demonstration.)\n// -----------------------------------------------------------------------------\n\n// Structure to carry additional geometry data used by deck.gl filters.\nstruct Geometry {\n  worldPosition: vec3<f32>,\n  worldPositionAlt: vec3<f32>,\n  position: vec4<f32>,\n  normal: vec3<f32>,\n  uv: vec2<f32>,\n  pickingColor: vec3<f32>,\n};\n\n// @group(0) @binding(1)\nvar<private> geometry: Geometry;\n`,V0t=`${nVt}\n\n// -----------------------------------------------------------------------------\n// Functions\n// -----------------------------------------------------------------------------\n\n// Returns an adjustment factor for commonUnitsPerMeter\nfn _project_size_at_latitude(lat: f32) -> f32 {\n  let y = clamp(lat, -89.9, 89.9);\n  return 1.0 / cos(radians(y));\n}\n\n// Overloaded version: scales a value in meters at a given latitude.\nfn _project_size_at_latitude_m(meters: f32, lat: f32) -> f32 {\n  return meters * project.commonUnitsPerMeter.z * _project_size_at_latitude(lat);\n}\n\n// Computes a non-linear scale factor based on geometry.\n// (Note: This function relies on \"geometry\" being provided.)\nfn project_size() -> f32 {\n  if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n      project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n      project.pseudoMeters == 0) {\n    if (geometry.position.w == 0.0) {\n      return _project_size_at_latitude(geometry.worldPosition.y);\n    }\n    let y: f32 = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n    let y2 = y * y;\n    let y4 = y2 * y2;\n    let y6 = y4 * y2;\n    return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n  }\n  return 1.0;\n}\n\n// Overloads to scale offsets (meters to world units)\nfn project_size_float(meters: f32) -> f32 {\n  return meters * project.commonUnitsPerMeter.z * project_size();\n}\n\nfn project_size_vec2(meters: vec2<f32>) -> vec2<f32> {\n  return meters * project.commonUnitsPerMeter.xy * project_size();\n}\n\nfn project_size_vec3(meters: vec3<f32>) -> vec3<f32> {\n  return meters * project.commonUnitsPerMeter * project_size();\n}\n\nfn project_size_vec4(meters: vec4<f32>) -> vec4<f32> {\n  return vec4<f32>(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\n\n// Returns a rotation matrix aligning the z\\u2011axis with the given up vector.\nfn project_get_orientation_matrix(up: vec3<f32>) -> mat3x3<f32> {\n  let uz = normalize(up);\n  let ux = select(\n    vec3<f32>(1.0, 0.0, 0.0),\n    normalize(vec3<f32>(uz.y, -uz.x, 0.0)),\n    abs(uz.z) == 1.0\n  );\n  let uy = cross(uz, ux);\n  return mat3x3<f32>(ux, uy, uz);\n}\n\n// Since WGSL does not support \"out\" parameters, we return a struct.\nstruct RotationResult {\n  needsRotation: bool,\n  transform: mat3x3<f32>,\n};\n\nfn project_needs_rotation(commonPosition: vec3<f32>) -> RotationResult {\n  if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n    return RotationResult(true, project_get_orientation_matrix(commonPosition));\n  } else {\n    return RotationResult(false, mat3x3<f32>());  // identity alternative if needed\n  };\n}\n\n// Projects a normal vector from the current coordinate system to world space.\nfn project_normal(vector: vec3<f32>) -> vec3<f32> {\n  let normal_modelspace = project.modelMatrix * vec4<f32>(vector, 0.0);\n  var n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\n  let rotResult = project_needs_rotation(geometry.position.xyz);\n  if (rotResult.needsRotation) {\n    n = rotResult.transform * n;\n  }\n  return n;\n}\n\n// Applies a scale offset based on y-offset (dy)\nfn project_offset_(offset: vec4<f32>) -> vec4<f32> {\n  let dy: f32 = offset.y;\n  let commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\n  return vec4<f32>(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\n\n// Projects lng/lat coordinates to a unit tile [0,1]\nfn project_mercator_(lnglat: vec2<f32>) -> vec2<f32> {\n  var x = lnglat.x;\n  if (project.wrapLongitude != 0) {\n    x = ((x + 180.0) % 360.0) - 180.0;\n  }\n  let y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2<f32>(\n    radians(x) + PI,\n    PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\n// Projects lng/lat/z coordinates for a globe projection.\nfn project_globe_(lnglatz: vec3<f32>) -> vec3<f32> {\n  let lambda = radians(lnglatz.x);\n  let phi = radians(lnglatz.y);\n  let cosPhi = cos(phi);\n  let D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n  return vec3<f32>(\n    sin(lambda) * cosPhi,\n    -cos(lambda) * cosPhi,\n    sin(phi)\n  ) * D;\n}\n\n// Projects positions (with an optional 64-bit low part) from the input\n// coordinate system to the common space.\nfn project_position_vec4_f64(position: vec4<f32>, position64Low: vec3<f32>) -> vec4<f32> {\n  var position_world = project.modelMatrix * position;\n\n  // Work around for a Mac+NVIDIA bug:\n  if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n    if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4<f32>(\n        project_mercator_(position_world.xy),\n        _project_size_at_latitude_m(position_world.z, position_world.y),\n        position_world.w\n      );\n    }\n    if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n      position_world = vec4f(position_world.xyz + project.coordinateOrigin, position_world.w);\n    }\n  }\n  if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n    if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4<f32>(\n        project_globe_(position_world.xyz),\n        position_world.w\n      );\n    }\n  }\n  if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n    if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\n        return vec4<f32>(\n          project_mercator_(position_world.xy) - project.commonOrigin.xy,\n          project_size_float(position_world.z),\n          position_world.w\n        );\n      }\n    }\n  }\n  if (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n      (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n       (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n        project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n    position_world = vec4f(position_world.xyz - project.coordinateOrigin, position_world.w);\n  }\n\n  return project_offset_(position_world) +\n         project_offset_(project.modelMatrix * vec4<f32>(position64Low, 0.0));\n}\n\n// Overloaded versions for different input types.\nfn project_position_vec4_f32(position: vec4<f32>) -> vec4<f32> {\n  return project_position_vec4_f64(position, ZERO_64_LOW);\n}\n\nfn project_position_vec3_f64(position: vec3<f32>, position64Low: vec3<f32>) -> vec3<f32> {\n  let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), position64Low);\n  return projected_position.xyz;\n}\n\nfn project_position_vec3_f32(position: vec3<f32>) -> vec3<f32> {\n  let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), ZERO_64_LOW);\n  return projected_position.xyz;\n}\n\nfn project_position_vec2_f32(position: vec2<f32>) -> vec2<f32> {\n  let projected_position = project_position_vec4_f64(vec4<f32>(position, 0.0, 1.0), ZERO_64_LOW);\n  return projected_position.xy;\n}\n\n// Transforms a common space position to clip space.\nfn project_common_position_to_clipspace_with_projection(position: vec4<f32>, viewProjectionMatrix: mat4x4<f32>, center: vec4<f32>) -> vec4<f32> {\n  return viewProjectionMatrix * position + center;\n}\n\n// Uses the project viewProjectionMatrix and center.\nfn project_common_position_to_clipspace(position: vec4<f32>) -> vec4<f32> {\n  return project_common_position_to_clipspace_with_projection(position, project.viewProjectionMatrix, project.center);\n}\n\n// Returns a clip space offset corresponding to a given number of screen pixels.\nfn project_pixel_size_to_clipspace(pixels: vec2<f32>) -> vec2<f32> {\n  let offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\n  return offset * project.focalDistance;\n}\n\nfn project_meter_size_to_pixel(meters: f32) -> f32 {\n  return project_size_float(meters) * project.scale;\n}\n\nfn project_unit_size_to_pixel(size: f32, unit: i32) -> f32 {\n  if (unit == UNIT_METERS) {\n    return project_meter_size_to_pixel(size);\n  } else if (unit == UNIT_COMMON) {\n    return size * project.scale;\n  }\n  // UNIT_PIXELS: no scaling applied.\n  return size;\n}\n\nfn project_pixel_size_float(pixels: f32) -> f32 {\n  return pixels / project.scale;\n}\n\nfn project_pixel_size_vec2(pixels: vec2<f32>) -> vec2<f32> {\n  return pixels / project.scale;\n}\n`;var oVt=Object.keys(Vr).map(e=>`const int COORDINATE_SYSTEM_${e} = ${Vr[e]};`).join(\"\"),sVt=Object.keys(Pa).map(e=>`const int PROJECTION_MODE_${e} = ${Pa[e]};`).join(\"\"),aVt=Object.keys(rs).map(e=>`const int UNIT_${e.toUpperCase()} = ${rs[e]};`).join(\"\"),j0t=`${oVt}\n${sVt}\n${aVt}\nuniform projectUniforms {\nbool wrapLongitude;\nint coordinateSystem;\nvec3 commonUnitsPerMeter;\nint projectionMode;\nfloat scale;\nvec3 commonUnitsPerWorldUnit;\nvec3 commonUnitsPerWorldUnit2;\nvec4 center;\nmat4 modelMatrix;\nmat4 viewProjectionMatrix;\nvec2 viewportSize;\nfloat devicePixelRatio;\nfloat focalDistance;\nvec3 cameraPosition;\nvec3 coordinateOrigin;\nvec3 commonOrigin;\nbool pseudoMeters;\n} project;\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\nfloat y = clamp(lat, -89.9, 89.9);\nreturn 1.0 / cos(radians(y));\n}\nfloat project_size() {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\nproject.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\nproject.pseudoMeters == false) {\nif (geometry.position.w == 0.0) {\nreturn project_size_at_latitude(geometry.worldPosition.y);\n}\nfloat y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\nfloat y2 = y * y;\nfloat y4 = y2 * y2;\nfloat y6 = y4 * y2;\nreturn 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n}\nreturn 1.0;\n}\nfloat project_size_at_latitude(float meters, float lat) {\nreturn meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\nreturn meters * project.commonUnitsPerMeter.z * project_size();\n}\nvec2 project_size(vec2 meters) {\nreturn meters * project.commonUnitsPerMeter.xy * project_size();\n}\nvec3 project_size(vec3 meters) {\nreturn meters * project.commonUnitsPerMeter * project_size();\n}\nvec4 project_size(vec4 meters) {\nreturn vec4(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\nvec3 uz = normalize(up);\nvec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\nvec3 uy = cross(uz, ux);\nreturn mat3(ux, uy, uz);\n}\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\ntransform = project_get_orientation_matrix(commonPosition);\nreturn true;\n}\nreturn false;\n}\nvec3 project_normal(vec3 vector) {\nvec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0);\nvec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\nmat3 rotation;\nif (project_needs_rotation(geometry.position.xyz, rotation)) {\nn = rotation * n;\n}\nreturn n;\n}\nvec4 project_offset_(vec4 offset) {\nfloat dy = offset.y;\nvec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\nreturn vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\nfloat x = lnglat.x;\nif (project.wrapLongitude) {\nx = mod(x + 180., 360.0) - 180.;\n}\nfloat y = clamp(lnglat.y, -89.9, 89.9);\nreturn vec2(\nradians(x) + PI,\nPI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n) * WORLD_SCALE;\n}\nvec3 project_globe_(vec3 lnglatz) {\nfloat lambda = radians(lnglatz.x);\nfloat phi = radians(lnglatz.y);\nfloat cosPhi = cos(phi);\nfloat D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\nreturn vec3(\nsin(lambda) * cosPhi,\n-cos(lambda) * cosPhi,\nsin(phi)\n) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\nvec4 position_world = project.modelMatrix * position;\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_mercator_(position_world.xy),\nproject_size_at_latitude(position_world.z, position_world.y),\nposition_world.w\n);\n}\nif (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\nposition_world.xyz += project.coordinateOrigin;\n}\n}\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_globe_(position_world.xyz),\nposition_world.w\n);\n}\n}\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nif (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\nreturn vec4(\nproject_mercator_(position_world.xy) - project.commonOrigin.xy,\nproject_size(position_world.z),\nposition_world.w\n);\n}\n}\n}\nif (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\nposition_world.xyz -= project.coordinateOrigin;\n}\nreturn project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0));\n}\nvec4 project_position(vec4 position) {\nreturn project_position(position, ZERO_64_LOW);\n}\nvec3 project_position(vec3 position, vec3 position64Low) {\nvec4 projected_position = project_position(vec4(position, 1.0), position64Low);\nreturn projected_position.xyz;\n}\nvec3 project_position(vec3 position) {\nvec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\nreturn projected_position.xyz;\n}\nvec2 project_position(vec2 position) {\nvec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\nreturn projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\nreturn viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\nreturn project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\nvec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\nreturn offset * project.focalDistance;\n}\nfloat project_size_to_pixel(float meters) {\nreturn project_size(meters) * project.scale;\n}\nfloat project_size_to_pixel(float size, int unit) {\nif (unit == UNIT_METERS) return project_size_to_pixel(size);\nif (unit == UNIT_COMMON) return size * project.scale;\nreturn size;\n}\nfloat project_pixel_size(float pixels) {\nreturn pixels / project.scale;\n}\nvec2 project_pixel_size(vec2 pixels) {\nreturn pixels / project.scale;\n}\n`;var lVt={};function cVt(e=lVt){return\"viewport\"in e?U0t(e):{}}var Uf={name:\"project\",dependencies:[AY,LO],source:V0t,vs:j0t,getUniforms:cVt,uniformTypes:{wrapLongitude:\"f32\",coordinateSystem:\"i32\",commonUnitsPerMeter:\"vec3<f32>\",projectionMode:\"i32\",scale:\"f32\",commonUnitsPerWorldUnit:\"vec3<f32>\",commonUnitsPerWorldUnit2:\"vec3<f32>\",center:\"vec4<f32>\",modelMatrix:\"mat4x4<f32>\",viewProjectionMatrix:\"mat4x4<f32>\",viewportSize:\"vec2<f32>\",devicePixelRatio:\"f32\",focalDistance:\"f32\",cameraPosition:\"vec3<f32>\",coordinateOrigin:\"vec3<f32>\",commonOrigin:\"vec3<f32>\",pseudoMeters:\"f32\"}};var uVt=`// Define a structure to hold both the clip-space position and the common position.\nstruct ProjectResult {\n  clipPosition: vec4<f32>,\n  commonPosition: vec4<f32>,\n};\n\n// This function mimics the GLSL version with the 'out' parameter by returning both values.\nfn project_position_to_clipspace_and_commonspace(\n    position: vec3<f32>,\n    position64Low: vec3<f32>,\n    offset: vec3<f32>\n) -> ProjectResult {\n  // Compute the projected position.\n  let projectedPosition: vec3<f32> = project_position_vec3_f64(position, position64Low);\n\n  // Start with the provided offset.\n  var finalOffset: vec3<f32> = offset;\n\n  // Get whether a rotation is needed and the rotation matrix.\n  let rotationResult = project_needs_rotation(projectedPosition);\n\n  // If rotation is needed, update the offset.\n  if (rotationResult.needsRotation) {\n    finalOffset = rotationResult.transform * offset;\n  }\n\n  // Compute the common position.\n  let commonPosition: vec4<f32> = vec4<f32>(projectedPosition + finalOffset, 1.0);\n\n  // Convert to clip-space.\n  let clipPosition: vec4<f32> = project_common_position_to_clipspace(commonPosition);\n\n  return ProjectResult(clipPosition, commonPosition);\n}\n\n// A convenience overload that returns only the clip-space position.\nfn project_position_to_clipspace(\n    position: vec3<f32>,\n    position64Low: vec3<f32>,\n    offset: vec3<f32>\n) -> vec4<f32> {\n  return project_position_to_clipspace_and_commonspace(position, position64Low, offset).clipPosition;\n}\n`,hVt=`vec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n  vec3 projectedPosition = project_position(position, position64Low);\n  mat3 rotation;\n  if (project_needs_rotation(projectedPosition, rotation)) {\n    // offset is specified as ENU\n    // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n    offset = rotation * offset;\n  }\n  commonPosition = vec4(projectedPosition + offset, 1.0);\n  return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset\n) {\n  vec4 commonPosition;\n  return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n`,Mo={name:\"project32\",dependencies:[Uf],source:uVt,vs:hVt};function RY(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function f1(e,t){let r=xu.transformMat4([],t,e);return xu.scale(r,r,1/r[3]),r}function DY(e,t){let r=e%t;return r<0?t+r:r}function $0t(e,t,r){return r*t+(1-r)*e}function tP(e,t,r){return e<t?t:e>r?r:e}function dVt(e){return Math.log(e)*Math.LOG2E}var S3=Math.log2||dVt;function Vf(e,t){if(!e)throw new Error(t||\"@math.gl/web-mercator: assertion failed.\")}var jf=Math.PI,G0t=jf/4,Id=jf/180,OY=180/jf,M3=512,HO=4003e4,wu=85.051129,W0t=1.5;function eP(e){return Math.pow(2,e)}function YO(e){return S3(e)}function vs(e){let[t,r]=e;Vf(Number.isFinite(t)),Vf(Number.isFinite(r)&&r>=-90&&r<=90,\"invalid latitude\");let i=t*Id,n=r*Id,o=M3*(i+jf)/(2*jf),s=M3*(jf+Math.log(Math.tan(G0t+n*.5)))/(2*jf);return[o,s]}function ic(e){let[t,r]=e,i=t/M3*(2*jf)-jf,n=2*(Math.atan(Math.exp(r/M3*(2*jf)-jf))-G0t);return[i*OY,n*OY]}function rP(e){let{latitude:t}=e;Vf(Number.isFinite(t));let r=Math.cos(t*Id);return YO(HO*r)-9}function hb(e){let t=Math.cos(e*Id);return M3/HO/t}function E3(e){let{latitude:t,longitude:r,highPrecision:i=!1}=e;Vf(Number.isFinite(t)&&Number.isFinite(r));let n=M3,o=Math.cos(t*Id),s=n/360,a=s/o,h=n/HO/o,p={unitsPerMeter:[h,h,h],metersPerUnit:[1/h,1/h,1/h],unitsPerDegree:[s,a,h],degreesPerUnit:[1/s,1/a,1/h]};if(i){let g=Id*Math.tan(t*Id)/o,w=s*g/2,C=n/HO*g,R=C/a*h;p.unitsPerDegree2=[0,w,C],p.unitsPerMeter2=[R,0,R]}return p}function iP(e,t){let[r,i,n]=e,[o,s,a]=t,{unitsPerMeter:h,unitsPerMeter2:p}=E3({longitude:r,latitude:i,highPrecision:!0}),g=vs(e);g[0]+=o*(h[0]+p[0]*s),g[1]+=s*(h[1]+p[1]*s);let w=ic(g),C=(n||0)+(a||0);return Number.isFinite(n)||Number.isFinite(a)?[w[0],w[1],C]:w}function XO(e){let{height:t,pitch:r,bearing:i,altitude:n,scale:o,center:s}=e,a=RY();Gs.translate(a,a,[0,0,-n]),Gs.rotateX(a,a,-r*Id),Gs.rotateZ(a,a,i*Id);let h=o/t;return Gs.scale(a,a,[h,h,h]),s&&Gs.translate(a,a,Cl.negate([],s)),a}function LY(e){let{width:t,height:r,altitude:i,pitch:n=0,offset:o,center:s,scale:a,nearZMultiplier:h=1,farZMultiplier:p=1}=e,{fovy:g=Og(W0t)}=e;i!==void 0&&(g=Og(i));let w=g*Id,C=n*Id,R=Lg(g),z=R;s&&(z+=s[2]*a/Math.cos(C)/r);let W=w*(.5+(o?o[1]:0)/r),Y=Math.sin(W)*z/Math.sin(tP(Math.PI/2-C-W,.01,Math.PI-.01)),H=Math.sin(C)*Y+z,Q=z*10,tt=Math.min(H*p,Q);return{fov:w,aspect:t/r,focalDistance:R,near:h,far:tt}}function Og(e){return 2*Math.atan(.5/e)*OY}function Lg(e){return .5/Math.tan(.5*e*Id)}function P3(e,t){let[r,i,n=0]=e;return Vf(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(n)),f1(t,[r,i,n,1])}function kd(e,t,r=0){let[i,n,o]=e;if(Vf(Number.isFinite(i)&&Number.isFinite(n),\"invalid pixel coordinate\"),Number.isFinite(o))return f1(t,[i,n,o,1]);let s=f1(t,[i,n,0,1]),a=f1(t,[i,n,1,1]),h=s[2],p=a[2],g=h===p?0:((r||0)-h)/(p-h);return Ea.lerp([],s,a,g)}function ZO(e){let{width:t,height:r,bounds:i,minExtent:n=0,maxZoom:o=24,offset:s=[0,0]}=e,[[a,h],[p,g]]=i,w=fVt(e.padding),C=vs([a,tP(g,-wu,wu)]),R=vs([p,tP(h,-wu,wu)]),z=[Math.max(Math.abs(R[0]-C[0]),n),Math.max(Math.abs(R[1]-C[1]),n)],W=[t-w.left-w.right-Math.abs(s[0])*2,r-w.top-w.bottom-Math.abs(s[1])*2];Vf(W[0]>0&&W[1]>0);let Y=W[0]/z[0],H=W[1]/z[1],Q=(w.right-w.left)/2/Y,tt=(w.top-w.bottom)/2/H,rt=[(R[0]+C[0])/2+Q,(R[1]+C[1])/2+tt],at=ic(rt),et=Math.min(o,S3(Math.abs(Math.min(Y,H))));return Vf(Number.isFinite(et)),{longitude:at[0],latitude:at[1],zoom:et}}function fVt(e=0){return typeof e==\"number\"?{top:e,bottom:e,left:e,right:e}:(Vf(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var q0t=Math.PI/180;function KO(e,t=0){let{width:r,height:i,unproject:n}=e,o={targetZ:t},s=n([0,i],o),a=n([r,i],o),h,p,g=e.fovy?.5*e.fovy*q0t:Math.atan(.5/e.altitude),w=(90-e.pitch)*q0t;return g>w-.01?(h=H0t(e,0,t),p=H0t(e,r,t)):(h=n([0,0],o),p=n([r,0],o)),[s,a,p,h]}function H0t(e,t,r){let{pixelUnprojectionMatrix:i}=e,n=f1(i,[t,0,1,1]),o=f1(i,[t,e.height,1,1]),a=(r*e.distanceScales.unitsPerMeter[2]-n[2])/(o[2]-n[2]),h=Ea.lerp([],n,o,a),p=ic(h);return p.push(r),p}var Y0t=512;function BY(e){let{width:t,height:r,pitch:i=0}=e,{longitude:n,latitude:o,zoom:s,bearing:a=0}=e;(n<-180||n>180)&&(n=DY(n+180,360)-180),(a<-180||a>180)&&(a=DY(a+180,360)-180);let h=S3(r/Y0t);if(s<=h)s=h,o=0;else{let p=r/2/Math.pow(2,s),g=ic([0,p])[1];if(o<g)o=g;else{let w=ic([0,Y0t-p])[1];o>w&&(o=w)}}return{width:t,height:r,longitude:n,latitude:o,zoom:s,pitch:i,bearing:a}}var X0t=.01,mVt=[\"longitude\",\"latitude\",\"zoom\"],Z0t={curve:1.414,speed:1.2};function FY(e,t,r,i){let{startZoom:n,startCenterXY:o,uDelta:s,w0:a,u1:h,S:p,rho:g,rho2:w,r0:C}=K0t(e,t,i);if(h<X0t){let rt={};for(let at of mVt){let et=e[at],lt=t[at];rt[at]=$0t(et,lt,r)}return rt}let R=r*p,z=Math.cosh(C)/Math.cosh(C+g*R),W=a*((Math.cosh(C)*Math.tanh(C+g*R)-Math.sinh(C))/w)/h,Y=1/z,H=n+YO(Y),Q=Ea.scale([],s,W);Ea.add(Q,Q,o);let tt=ic(Q);return{longitude:tt[0],latitude:tt[1],zoom:H}}function NY(e,t,r){let i={...Z0t,...r},{screenSpeed:n,speed:o,maxDuration:s}=i,{S:a,rho:h}=K0t(e,t,i),p=1e3*a,g;return Number.isFinite(n)?g=p/(n/h):g=p/o,Number.isFinite(s)&&g>s?0:g}function K0t(e,t,r){r=Object.assign({},Z0t,r);let i=r.curve,n=e.zoom,o=[e.longitude,e.latitude],s=eP(n),a=t.zoom,h=[t.longitude,t.latitude],p=eP(a-n),g=vs(o),w=vs(h),C=Ea.sub([],w,g),R=Math.max(e.width,e.height),z=R/p,W=Ea.length(C)*s,Y=Math.max(W,X0t),H=i*i,Q=(z*z-R*R+H*H*Y*Y)/(2*R*H*Y),tt=(z*z-R*R-H*H*Y*Y)/(2*z*H*Y),rt=Math.log(Math.sqrt(Q*Q+1)-Q),at=Math.log(Math.sqrt(tt*tt+1)-tt),et=(at-rt)/i;return{startZoom:n,startCenterXY:g,uDelta:C,w0:R,u1:W,S:et,rho:i,rho2:H,r0:rt,r1:at}}var Q0t=`\nuniform shadowUniforms {\n  bool drawShadowMap;\n  bool useShadowMap;\n  vec4 color;\n  highp int lightId;\n  float lightCount;\n  mat4 viewProjectionMatrix0;\n  mat4 viewProjectionMatrix1;\n  vec4 projectCenter0;\n  vec4 projectCenter1;\n} shadow;\n`,AVt=`\nconst int max_lights = 2;\n\nout vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n  mat4 viewProjectionMatrices[max_lights];\n  viewProjectionMatrices[0] = shadow.viewProjectionMatrix0;\n  viewProjectionMatrices[1] = shadow.viewProjectionMatrix1;\n  vec4 projectCenters[max_lights];\n  projectCenters[0] = shadow.projectCenter0;\n  projectCenters[1] = shadow.projectCenter1;\n\n  if (shadow.drawShadowMap) {\n    return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]);\n  }\n  if (shadow.useShadowMap) {\n    for (int i = 0; i < max_lights; i++) {\n      if(i < int(shadow.lightCount)) {\n        vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]);\n        shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n      }\n    }\n  }\n  return gl_Position;\n}\n`,yVt=`\n${Q0t}\n${AVt}\n`,_Vt=`\nconst int max_lights = 2;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\n\nin vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0,  0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n  vec4 rgbaDepth = texture(shadowMap, position.xy);\n\n  float z = dot(rgbaDepth, bitUnpackShift);\n  return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n  if (shadow.drawShadowMap) {\n    vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n    rgbaDepth -= rgbaDepth.gbaa * bitMask;\n    return rgbaDepth;\n  }\n  if (shadow.useShadowMap) {\n    float shadowAlpha = 0.0;\n    shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n    if(shadow.lightCount > 1.0) {\n      shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n    }\n    shadowAlpha *= shadow.color.a / shadow.lightCount;\n    float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n    return vec4(\n      mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha),\n      blendedAlpha\n    );\n  }\n  return color;\n}\n`,vVt=`\n${Q0t}\n${_Vt}\n`,bVt=b0(MVt),xVt=b0(EVt),wVt=[0,0,0,1],TVt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function SVt(e,t){let[r,i,n]=e,o=kd([r,i,n],t);return Number.isFinite(n)?o:[o[0],o[1],0]}function MVt({viewport:e,center:t}){return new Ji(e.viewProjectionMatrix).invert().transform(t)}function EVt({viewport:e,shadowMatrices:t}){let r=[],i=e.pixelUnprojectionMatrix,n=e.isGeospatial?void 0:1,o=[[0,0,n],[e.width,0,n],[0,e.height,n],[e.width,e.height,n],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(s=>SVt(s,i));for(let s of t){let a=s.clone().translate(new rr(e.center).negate()),h=o.map(g=>a.transform(g)),p=new Ji().ortho({left:Math.min(...h.map(g=>g[0])),right:Math.max(...h.map(g=>g[0])),bottom:Math.min(...h.map(g=>g[1])),top:Math.max(...h.map(g=>g[1])),near:Math.min(...h.map(g=>-g[2])),far:Math.max(...h.map(g=>-g[2]))});r.push(p.multiplyRight(s))}return r}function PVt(e){let{shadowEnabled:t=!0,project:r}=e;if(!t||!r||!e.shadowMatrices||!e.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:e.dummyShadowMap,shadow_uShadowMap1:e.dummyShadowMap};let i=Uf.getUniforms(r),n=bVt({viewport:r.viewport,center:i.center}),o=[],s=xVt({shadowMatrices:e.shadowMatrices,viewport:r.viewport}).slice();for(let h=0;h<e.shadowMatrices.length;h++){let p=s[h],g=p.clone().translate(new rr(r.viewport.center).negate());i.coordinateSystem===Vr.LNGLAT&&i.projectionMode===Pa.WEB_MERCATOR?(s[h]=g,o[h]=n):(s[h]=p.clone().multiplyRight(TVt),o[h]=g.transform(n))}let a={drawShadowMap:!!e.drawToShadowMap,useShadowMap:e.shadowMaps?e.shadowMaps.length>0:!1,color:e.shadowColor||wVt,lightId:e.shadowLightId||0,lightCount:e.shadowMatrices.length,shadow_uShadowMap0:e.dummyShadowMap,shadow_uShadowMap1:e.dummyShadowMap};for(let h=0;h<s.length;h++)a[`viewProjectionMatrix${h}`]=s[h],a[`projectCenter${h}`]=o[h];for(let h=0;h<2;h++)a[`shadow_uShadowMap${h}`]=e.shadowMaps&&e.shadowMaps[h]||e.dummyShadowMap;return a}var QO={name:\"shadow\",dependencies:[Uf],vs:yVt,fs:vVt,inject:{\"vs:DECKGL_FILTER_GL_POSITION\":`\n    position = shadow_setVertexPosition(geometry.position);\n    `,\"fs:DECKGL_FILTER_COLOR\":`\n    color = shadow_filterShadowColor(color);\n    `},getUniforms:PVt,uniformTypes:{drawShadowMap:\"f32\",useShadowMap:\"f32\",color:\"vec4<f32>\",lightId:\"i32\",lightCount:\"f32\",viewProjectionMatrix0:\"mat4x4<f32>\",viewProjectionMatrix1:\"mat4x4<f32>\",projectCenter0:\"vec4<f32>\",projectCenter1:\"vec4<f32>\"}};var bs={...kO,defaultUniforms:{...kO.defaultUniforms,useFloatColors:!1},inject:{\"vs:DECKGL_FILTER_GL_POSITION\":`\n    // for picking depth values\n    picking_setPickingAttribute(position.z / position.w);\n  `,\"vs:DECKGL_FILTER_COLOR\":`\n  picking_setPickingColor(geometry.pickingColor);\n  `,\"fs:DECKGL_FILTER_COLOR\":{order:99,injection:`\n  // use highlight color if this fragment belongs to the selected object.\n  color = picking_filterHighlightColor(color);\n\n  // use picking color if rendering to picking FBO.\n  color = picking_filterPickingColor(color);\n    `}}};var CVt=[LO],IVt=[\"vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)\",\"vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)\",\"vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)\",\"fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)\"],kVt=[];function J0t(e){let t=Yv.getDefaultShaderAssembler();for(let i of CVt)t.addDefaultModule(i);t._hookFunctions.length=0;let r=e===\"glsl\"?IVt:kVt;for(let i of r)t.addShaderHook(i);return t}var RVt=[255,255,255],DVt=1,OVt=0,JO=class{constructor(t={}){this.type=\"ambient\";let{color:r=RVt}=t,{intensity:i=DVt}=t;this.id=t.id||`ambient-${OVt++}`,this.color=r,this.intensity=i}};var LVt=[255,255,255],BVt=1,FVt=[0,0,-1],NVt=0,nP=class{constructor(t={}){this.type=\"directional\";let{color:r=LVt}=t,{intensity:i=BVt}=t,{direction:n=FVt}=t,{_shadow:o=!1}=t;this.id=t.id||`directional-${NVt++}`,this.color=r,this.intensity=i,this.type=\"directional\",this.direction=new rr(n).normalize().toArray(),this.shadow=o}getProjectedLight(t){return this}};var oP=class{constructor(t,r={id:\"pass\"}){let{id:i}=r;this.id=i,this.device=t,this.props={...r}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}};var Rd=class extends oP{constructor(){super(...arguments),this._lastRenderIndex=-1}render(t){let[r,i]=this.device.canvasContext.getDrawingBufferSize(),n=t.clearCanvas??!0,o=t.clearColor??(n?[0,0,0,0]:!1),s=n?1:!1,a=n?0:!1,h=t.colorMask??15,p={viewport:[0,0,r,i]};t.colorMask&&(p.colorMask=h),t.scissorRect&&(p.scissorRect=t.scissorRect);let g=this.device.beginRenderPass({framebuffer:t.target,parameters:p,clearColor:o,clearDepth:s,clearStencil:a});try{return this._drawLayers(g,t)}finally{g.end(),this.device.submit()}}_drawLayers(t,r){let{target:i,shaderModuleProps:n,viewports:o,views:s,onViewportActive:a,clearStack:h=!0}=r;r.pass=r.pass||\"unknown\",h&&(this._lastRenderIndex=-1);let p=[];for(let g of o){let w=s&&s[g.id];a?.(g);let C=this._getDrawLayerParams(g,r),R=g.subViewports||[g];for(let z of R){let W=this._drawLayersInViewport(t,{target:i,shaderModuleProps:n,viewport:z,view:w,pass:r.pass,layers:r.layers},C);p.push(W)}}return p}_getDrawLayerParams(t,{layers:r,pass:i,isPicking:n=!1,layerFilter:o,cullRect:s,effects:a,shaderModuleProps:h},p=!1){let g=[],w=emt(this._lastRenderIndex+1),C={layer:r[0],viewport:t,isPicking:n,renderPass:i,cullRect:s},R={};for(let z=0;z<r.length;z++){let W=r[z],Y=this._shouldDrawLayer(W,C,o,R),H={shouldDrawLayer:Y};Y&&!p&&(H.shouldDrawLayer=!0,H.layerRenderIndex=w(W,Y),H.shaderModuleProps=this._getShaderModuleProps(W,a,i,h),H.layerParameters={...W.context.deck?.props.parameters,...this.getLayerParameters(W,z,t)}),g[z]=H}return g}_drawLayersInViewport(t,{layers:r,shaderModuleProps:i,pass:n,target:o,viewport:s,view:a},h){let p=zVt(this.device,{shaderModuleProps:i,target:o,viewport:s});if(a){let{clear:w,clearColor:C,clearDepth:R,clearStencil:z}=a.props;if(w){let W=[0,0,0,0],Y=1,H=0;Array.isArray(C)?W=[...C.slice(0,3),C[3]||255].map(tt=>tt/255):C===!1&&(W=!1),R!==void 0&&(Y=R),z!==void 0&&(H=z),this.device.beginRenderPass({framebuffer:o,parameters:{viewport:p,scissorRect:p},clearColor:W,clearDepth:Y,clearStencil:H}).end()}}let g={totalCount:r.length,visibleCount:0,compositeCount:0,pickableCount:0};t.setParameters({viewport:p});for(let w=0;w<r.length;w++){let C=r[w],R=h[w],{shouldDrawLayer:z}=R;if(z&&C.props.pickable&&g.pickableCount++,C.isComposite&&g.compositeCount++,C.isDrawable&&R.shouldDrawLayer){let{layerRenderIndex:W,shaderModuleProps:Y,layerParameters:H}=R;g.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,W),Y.project&&(Y.project.viewport=s),C.context.renderPass=t;try{C._drawLayer({renderPass:t,shaderModuleProps:Y,uniforms:{layerIndex:W},parameters:H})}catch(Q){C.raiseError(Q,`drawing ${C} to ${n}`)}}}return g}shouldDrawLayer(t){return!0}getShaderModuleProps(t,r,i){return null}getLayerParameters(t,r,i){return t.props.parameters}_shouldDrawLayer(t,r,i,n){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;r.layer=t;let s=t.parent;for(;s;){if(!s.props.visible||!s.filterSubLayer(r))return!1;r.layer=s,s=s.parent}if(i){let a=r.layer.id;if(a in n||(n[a]=i(r)),!n[a])return!1}return t.activateViewport(r.viewport),!0}_getShaderModuleProps(t,r,i,n){let o=this.device.canvasContext.cssToDeviceRatio(),s=t.internalState?.propsInTransition||t.props,a={layer:s,picking:{isActive:!1},project:{viewport:t.context.viewport,devicePixelRatio:o,modelMatrix:s.modelMatrix,coordinateSystem:s.coordinateSystem,coordinateOrigin:s.coordinateOrigin,autoWrapLongitude:t.wrapLongitude}};if(r)for(let h of r)tmt(a,h.getShaderModuleProps?.(t,a));return tmt(a,this.getShaderModuleProps(t,r,a),n)}};function emt(e=0,t={}){let r={},i=(n,o)=>{let s=n.props._offset,a=n.id,h=n.parent&&n.parent.id,p;if(h&&!(h in t)&&i(n.parent,!1),h in r){let g=r[h]=r[h]||emt(t[h],t);p=g(n,o),r[a]=g}else Number.isFinite(s)?(p=s+(t[h]||0),r[a]=null):p=e;return o&&p>=e&&(e=p+1),t[a]=p,p};return i}function zVt(e,{shaderModuleProps:t,target:r,viewport:i}){let n=t?.project?.devicePixelRatio??e.canvasContext.cssToDeviceRatio(),[,o]=e.canvasContext.getDrawingBufferSize(),s=r?r.height:o,a=i;return[a.x*n,s-(a.y+a.height)*n,a.width*n,a.height*n]}function tmt(e,...t){for(let r of t)if(r)for(let i in r)e[i]?Object.assign(e[i],r[i]):e[i]=r[i];return e}var sP=class extends Rd{constructor(t,r){super(t,r);let i=t.createTexture({format:\"rgba8unorm\",width:1,height:1,sampler:{minFilter:\"linear\",magFilter:\"linear\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\"}}),n=t.createTexture({format:\"depth16unorm\",width:1,height:1});this.fbo=t.createFramebuffer({id:\"shadowmap\",width:1,height:1,colorAttachments:[i],depthStencilAttachment:n})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(t){let r=this.fbo,i=this.device.canvasContext.cssToDeviceRatio(),n=t.viewports[0],o=n.width*i,s=n.height*i,a=[1,1,1,1];(o!==r.width||s!==r.height)&&r.resize({width:o,height:s}),super.render({...t,clearColor:a,target:r,pass:\"shadow\"})}getLayerParameters(t,r,i){return{...t.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:\"less-equal\"}}shouldDrawLayer(t){return t.props.shadowEnabled!==!1}getShaderModuleProps(t,r,i){return{shadow:{project:i.project,drawToShadowMap:!0}}}};var UVt={color:[255,255,255],intensity:1},rmt=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],VVt=[0,0,0,200/255],C3=class{constructor(t={}){this.id=\"lighting-effect\",this.shadowColor=VVt,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(t)}setup(t){this.context=t;let{device:r,deck:i}=t;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(r),i._addDefaultShaderModule(QO),this.dummyShadowMap=r.createTexture({width:1,height:1}))}setProps(t){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(let r in t){let i=t[r];switch(i.type){case\"ambient\":this.ambientLight=i;break;case\"directional\":this.directionalLights.push(i);break;case\"point\":this.pointLights.push(i);break;default:}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(r=>r.shadow),this.context&&this.setup(this.context),this.props=t}preRender({layers:t,layerFilter:r,viewports:i,onViewportActive:n,views:o}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let s=0;s<this.shadowPasses.length;s++)this.shadowPasses[s].render({layers:t,layerFilter:r,viewports:i,onViewportActive:n,views:o,shaderModuleProps:{shadow:{shadowLightId:s,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}}})}}getShaderModuleProps(t,r){let i=this.shadow?{project:r.project,shadowMaps:this.shadowPasses.map(s=>s.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},n={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(s=>s.getProjectedLight({layer:t})),pointLights:this.pointLights.map(s=>s.getProjectedLight({layer:t}))},o=t.props.material;return{shadow:i,lighting:n,phongMaterial:o,gouraudMaterial:o}}cleanup(t){for(let r of this.shadowPasses)r.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,t.deck._removeDefaultShaderModule(QO))}_calculateMatrices(){let t=[];for(let r of this.directionalLights){let i=new Ji().lookAt({eye:new rr(r.direction).negate()});t.push(i)}return t}_createShadowPasses(t){for(let r=0;r<this.directionalLights.length;r++){let i=new sP(t);this.shadowPasses[r]=i}}_applyDefaultLights(){let{ambientLight:t,pointLights:r,directionalLights:i}=this;!t&&r.length===0&&i.length===0&&(this.ambientLight=new JO(UVt),this.directionalLights.push(new nP(rmt[0]),new nP(rmt[1])))}};var zY=class{constructor(t={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,r,{size:i=1,type:n,padding:o=0,copy:s=!1,initialize:a=!1,maxCount:h}){let p=n||t&&t.constructor||Float32Array,g=r*i+o;if(ArrayBuffer.isView(t)){if(g<=t.length)return t;if(g*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new p(t.buffer,0,g)}let w=1/0;h&&(w=h*i+o);let C=this._allocate(p,g,a,w);return t&&s?C.set(t):a||C.fill(0,0,4),this._release(t),C}release(t){this._release(t)}_allocate(t,r,i,n){let o=Math.max(Math.ceil(r*this.opts.overAlloc),1);o>n&&(o=n);let s=this._pool,a=t.BYTES_PER_ELEMENT*o,h=s.findIndex(p=>p.byteLength>=a);if(h>=0){let p=new t(s.splice(h,1)[0],0,o);return i&&p.fill(0),p}return new t(o)}_release(t){if(!ArrayBuffer.isView(t))return;let r=this._pool,{buffer:i}=t,{byteLength:n}=i,o=r.findIndex(s=>s.byteLength>=n);o<0?r.push(i):(o>0||r.length<this.opts.poolSize)&&r.splice(o,0,i),r.length>this.opts.poolSize&&r.shift()}},$f=new zY;function k3(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function db(e,t){let r=e%t;return r<0?t+r:r}function nmt(e){return[e[12],e[13],e[14]]}function omt(e){return{left:I3(e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),right:I3(e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),bottom:I3(e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),top:I3(e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),near:I3(e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]),far:I3(e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14])}}var imt=new rr;function I3(e,t,r,i){imt.set(e,t,r);let n=imt.len();return{distance:i/n,normal:new rr(-e/n,-t/n,-r/n)}}function jVt(e){return e-Math.fround(e)}var aP;function tL(e,t){let{size:r=1,startIndex:i=0}=t,n=t.endIndex!==void 0?t.endIndex:e.length,o=(n-i)/r;aP=$f.allocate(aP,o,{type:Float32Array,size:r*2});let s=i,a=0;for(;s<n;){for(let h=0;h<r;h++){let p=e[s++];aP[a+h]=p,aP[a+h+r]=jVt(p)}a+=r*2}return aP.subarray(0,o*r*2)}function smt(e){let t=null,r=!1;for(let i of e)i&&(t?(r||(t=[[t[0][0],t[0][1]],[t[1][0],t[1][1]]],r=!0),t[0][0]=Math.min(t[0][0],i[0][0]),t[0][1]=Math.min(t[0][1],i[0][1]),t[1][0]=Math.max(t[1][0],i[1][0]),t[1][1]=Math.max(t[1][1],i[1][1])):t=i);return t}var $Vt=Math.PI/180,GVt=k3(),amt=[0,0,0],WVt={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function qVt({width:e,height:t,orthographic:r,fovyRadians:i,focalDistance:n,padding:o,near:s,far:a}){let h=e/t,p=r?new Ji().orthographic({fovy:i,aspect:h,focalDistance:n,near:s,far:a}):new Ji().perspective({fovy:i,aspect:h,near:s,far:a});if(o){let{left:g=0,right:w=0,top:C=0,bottom:R=0}=o,z=_n((g+e-w)/2,0,e)-e/2,W=_n((C+t-R)/2,0,t)-t/2;p[8]-=z*2/e,p[9]+=W*2/t}return p}var eL=class e{constructor(t={}){this._frustumPlanes={},this.id=t.id||this.constructor.displayName||\"viewport\",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||WVt,this.focalDistance=t.focalDistance||1,this.position=t.position||amt,this.modelMatrix=t.modelMatrix||null;let{longitude:r,latitude:i}=t;this.isGeospatial=Number.isFinite(i)&&Number.isFinite(r),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?Pa.WEB_MERCATOR:Pa.WEB_MERCATOR_AUTO_OFFSET:Pa.IDENTITY}equals(t){return t instanceof e?this===t?!0:t.width===this.width&&t.height===this.height&&t.scale===this.scale&&$s(t.projectionMatrix,this.projectionMatrix)&&$s(t.viewMatrix,this.viewMatrix):!1}project(t,{topLeft:r=!0}={}){let i=this.projectPosition(t),n=P3(i,this.pixelProjectionMatrix),[o,s]=n,a=r?s:this.height-s;return t.length===2?[o,a]:[o,a,n[2]]}unproject(t,{topLeft:r=!0,targetZ:i}={}){let[n,o,s]=t,a=r?o:this.height-o,h=i&&i*this.distanceScales.unitsPerMeter[2],p=kd([n,a,s],this.pixelUnprojectionMatrix,h),[g,w,C]=this.unprojectPosition(p);return Number.isFinite(s)?[g,w,C]:Number.isFinite(i)?[g,w,i]:[g,w]}projectPosition(t){let[r,i]=this.projectFlat(t),n=(t[2]||0)*this.distanceScales.unitsPerMeter[2];return[r,i,n]}unprojectPosition(t){let[r,i]=this.unprojectFlat(t),n=(t[2]||0)*this.distanceScales.metersPerUnit[2];return[r,i,n]}projectFlat(t){if(this.isGeospatial){let r=vs(t);return r[1]=_n(r[1],-318,830),r}return t}unprojectFlat(t){return this.isGeospatial?ic(t):t}getBounds(t={}){let r={targetZ:t.z||0},i=this.unproject([0,0],r),n=this.unproject([this.width,0],r),o=this.unproject([0,this.height],r),s=this.unproject([this.width,this.height],r);return[Math.min(i[0],n[0],o[0],s[0]),Math.min(i[1],n[1],o[1],s[1]),Math.max(i[0],n[0],o[0],s[0]),Math.max(i[1],n[1],o[1],s[1])]}getDistanceScales(t){return t&&this.isGeospatial?E3({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:r,width:i=1,height:n=1}){return t<this.x+this.width&&this.x<t+i&&r<this.y+this.height&&this.y<r+n}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,omt(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(t,r,i){return null}_initProps(t){let r=t.longitude,i=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=rP({latitude:i})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||E3({latitude:i,longitude:r}));let n=Math.pow(2,this.zoom);this.scale=n;let{position:o,modelMatrix:s}=t,a=amt;if(o&&(a=s?new Ji(s).transformAsVector(o,[]):o),this.isGeospatial){let h=this.projectPosition([r,i,0]);this.center=new rr(a).scale(this.distanceScales.unitsPerMeter).add(h)}else this.center=this.projectPosition(a)}_initMatrices(t){let{viewMatrix:r=GVt,projectionMatrix:i=null,orthographic:n=!1,fovyRadians:o,fovy:s=75,near:a=.1,far:h=1e3,padding:p=null,focalDistance:g=1}=t;this.viewMatrixUncentered=r,this.viewMatrix=new Ji().multiplyRight(r).translate(new rr(this.center).negate()),this.projectionMatrix=i||qVt({width:this.width,height:this.height,orthographic:n,fovyRadians:o||s*$Vt,focalDistance:g,padding:p,near:a,far:h});let w=k3();Gs.multiply(w,w,this.projectionMatrix),Gs.multiply(w,w,this.viewMatrix),this.viewProjectionMatrix=w,this.viewMatrixInverse=Gs.invert([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=nmt(this.viewMatrixInverse);let C=k3(),R=k3();Gs.scale(C,C,[this.width/2,-this.height/2,1]),Gs.translate(C,C,[1,-1,0]),Gs.multiply(R,C,this.viewProjectionMatrix),this.pixelProjectionMatrix=R,this.pixelUnprojectionMatrix=Gs.invert(k3(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||hr.warn(\"Pixel project matrix not invertible\")()}};eL.displayName=\"Viewport\";var Dd=eL;var rL=class e extends Dd{constructor(t={}){let{latitude:r=0,longitude:i=0,zoom:n=0,pitch:o=0,bearing:s=0,nearZMultiplier:a=.1,farZMultiplier:h=1.01,nearZ:p,farZ:g,orthographic:w=!1,projectionMatrix:C,repeat:R=!1,worldOffset:z=0,position:W,padding:Y,legacyMeterSizes:H=!1}=t,{width:Q,height:tt,altitude:rt=1.5}=t,at=Math.pow(2,n);Q=Q||1,tt=tt||1;let et,lt=null;if(C)rt=C[5]/2,et=Og(rt);else{t.fovy?(et=t.fovy,rt=Lg(et)):et=Og(rt);let ft;if(Y){let{top:dt=0,bottom:Mt=0}=Y;ft=[0,_n((dt+tt-Mt)/2,0,tt)-tt/2]}lt=LY({width:Q,height:tt,scale:at,center:W&&[0,0,W[2]*hb(r)],offset:ft,pitch:o,fovy:et,nearZMultiplier:a,farZMultiplier:h}),Number.isFinite(p)&&(lt.near=p),Number.isFinite(g)&&(lt.far=g)}let J=XO({height:tt,pitch:o,bearing:s,scale:at,altitude:rt});z&&(J=new Ji().translate([512*z,0,0]).multiplyLeft(J)),super({...t,width:Q,height:tt,viewMatrix:J,longitude:i,latitude:r,zoom:n,...lt,fovy:et,focalDistance:rt}),this.latitude=r,this.longitude=i,this.zoom=n,this.pitch=o,this.bearing=s,this.altitude=rt,this.fovy=et,this.orthographic=w,this._subViewports=R?[]:null,this._pseudoMeters=H,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){let t=this.getBounds(),r=Math.floor((t[0]+180)/360),i=Math.ceil((t[2]-180)/360);for(let n=r;n<=i;n++){let o=n?new e({...this,worldOffset:n}):this;this._subViewports.push(o)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);let[r,i]=this.projectFlat(t),n=(t[2]||0)*hb(t[1]);return[r,i,n]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);let[r,i]=this.unprojectFlat(t),n=(t[2]||0)/hb(i);return[r,i,n]}addMetersToLngLat(t,r){return iP(t,r)}panByPosition(t,r,i){let n=kd(r,this.pixelUnprojectionMatrix),o=this.projectFlat(t),s=Ea.add([],o,Ea.negate([],n)),a=Ea.add([],this.center,s),[h,p]=this.unprojectFlat(a);return{longitude:h,latitude:p}}getBounds(t={}){let r=KO(this,t.z||0);return[Math.min(r[0][0],r[1][0],r[2][0],r[3][0]),Math.min(r[0][1],r[1][1],r[2][1],r[3][1]),Math.max(r[0][0],r[1][0],r[2][0],r[3][0]),Math.max(r[0][1],r[1][1],r[2][1],r[3][1])]}fitBounds(t,r={}){let{width:i,height:n}=this,{longitude:o,latitude:s,zoom:a}=ZO({width:i,height:n,bounds:t,...r});return new e({width:i,height:n,longitude:o,latitude:s,zoom:a})}};rL.displayName=\"WebMercatorViewport\";var _h=rL;var lmt=[0,0,0];function UY(e,t,r=!1){let i=t.projectPosition(e);if(r&&t instanceof _h){let[n,o,s=0]=e,a=t.getDistanceScales([n,o]);i[2]=s*a.unitsPerMeter[2]}return i}function HVt(e){let{viewport:t,modelMatrix:r,coordinateOrigin:i}=e,{coordinateSystem:n,fromCoordinateSystem:o,fromCoordinateOrigin:s}=e;return n===Vr.DEFAULT&&(n=t.isGeospatial?Vr.LNGLAT:Vr.CARTESIAN),o===void 0&&(o=n),s===void 0&&(s=i),{viewport:t,coordinateSystem:n,coordinateOrigin:i,modelMatrix:r,fromCoordinateSystem:o,fromCoordinateOrigin:s}}function VY(e,{viewport:t,modelMatrix:r,coordinateSystem:i,coordinateOrigin:n,offsetMode:o}){let[s,a,h=0]=e;switch(r&&([s,a,h]=xu.transformMat4([],[s,a,h,1],r)),i){case Vr.LNGLAT:return UY([s,a,h],t,o);case Vr.LNGLAT_OFFSETS:return UY([s+n[0],a+n[1],h+(n[2]||0)],t,o);case Vr.METER_OFFSETS:return UY(iP(n,[s,a,h]),t,o);case Vr.CARTESIAN:default:return t.isGeospatial?[s+n[0],a+n[1],h+n[2]]:t.projectPosition([s,a,h])}}function cmt(e,t){let{viewport:r,coordinateSystem:i,coordinateOrigin:n,modelMatrix:o,fromCoordinateSystem:s,fromCoordinateOrigin:a}=HVt(t),{autoOffset:h=!0}=t,{geospatialOrigin:p=lmt,shaderCoordinateOrigin:g=lmt,offsetMode:w=!1}=h?kY(r,i,n):{},C=VY(e,{viewport:r,modelMatrix:o,coordinateSystem:s,coordinateOrigin:a,offsetMode:w});if(w){let R=r.projectPosition(p||g);Cl.sub(C,C,R)}return C}var YVt=1,XVt=1,fb=class{time=0;channels=new Map;animations=new Map;playing=!1;lastEngineTime=-1;constructor(){}addChannel(t){let{delay:r=0,duration:i=Number.POSITIVE_INFINITY,rate:n=1,repeat:o=1}=t,s=YVt++,a={time:0,delay:r,duration:i,rate:n,repeat:o};return this._setChannelTime(a,this.time),this.channels.set(s,a),s}removeChannel(t){this.channels.delete(t);for(let[r,i]of this.animations)i.channel===t&&this.detachAnimation(r)}isFinished(t){let r=this.channels.get(t);return r===void 0?!1:this.time>=r.delay+r.duration*r.repeat}getTime(t){if(t===void 0)return this.time;let r=this.channels.get(t);return r===void 0?-1:r.time}setTime(t){this.time=Math.max(0,t);let r=this.channels.values();for(let n of r)this._setChannelTime(n,this.time);let i=this.animations.values();for(let n of i){let{animation:o,channel:s}=n;o.setTime(this.getTime(s))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,r){let i=XVt++;return this.animations.set(i,{animation:t,channel:r}),t.setTime(this.getTime(r)),i}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,r){let i=r-t.delay,n=t.duration*t.repeat;i>=n?t.time=t.duration*t.rate:(t.time=Math.max(0,i)%t.duration,t.time*=t.rate)}};Ci();function umt(e){return typeof window<\"u\"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function hmt(e){return typeof window<\"u\"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}Qw();var ZVt=0,lP=class e{static defaultAnimationLoopProps={device:null,onAddHTML:()=>\"\",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:n3.stats.get(`animation-loop-${ZVt++}`),autoResizeViewport:!1};device=null;canvas=null;props;animationProps=null;timeline=null;stats;cpuTime;gpuTime;frameRate;display;needsRedraw=\"initialized\";_initialized=!1;_running=!1;_animationFrameId=null;_nextFramePromise=null;_resolveNextFrame=null;_cpuStartTime=0;_error=null;constructor(t){if(this.props={...e.defaultAnimationLoopProps,...t},t=this.props,!t.device)throw new Error(\"No device provided\");this.stats=t.stats||new vu({id:\"animation-loop-stats\"}),this.cpuTime=this.stats.get(\"CPU Time\"),this.gpuTime=this.stats.get(\"GPU Time\"),this.frameRate=this.stats.get(\"Frame Rate\"),this.setProps({autoResizeViewport:t.autoResizeViewport}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}reportError(t){this.props.onError(t),this._error=t}setNeedsRedraw(t){return this.needsRedraw=this.needsRedraw||t,this}setProps(t){return\"autoResizeViewport\"in t&&(this.props.autoResizeViewport=t.autoResizeViewport||!1),this}async start(){if(this._running)return this;this._running=!0;try{let t;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(t!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(t){let r=t instanceof Error?t:new Error(\"Unknown error\");throw this.props.onError(r),r}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){return this.device?.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw(\"waitForRender\"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw(\"toDataURL\"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error(\"OffscreenCanvas\")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeViewport()}_setDisplay(t){this.display&&(this.display.destroy(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_requestAnimationFrame(){this._running&&(this._animationFrameId=umt(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(hmt(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(t){if(this.display){this.display._renderFrame(t);return}this.props.onRender(this._getAnimationProps()),this.device?.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeViewport()}_initializeAnimationProps(){let t=this.device?.getDefaultCanvasContext();if(!this.device||!t)throw new Error(\"loop\");let r=t?.canvas,i=t.props.useDevicePixels;this.animationProps={animationLoop:this,device:this.device,canvasContext:t,canvas:r,useDevicePixels:i,timeline:this.timeline,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error(\"animationProps\");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;let{width:t,height:r,aspect:i}=this._getSizeAndAspect();(t!==this.animationProps.width||r!==this.animationProps.height)&&this.setNeedsRedraw(\"drawing buffer resized\"),i!==this.animationProps.aspect&&this.setNeedsRedraw(\"drawing buffer aspect changed\"),this.animationProps.width=t,this.animationProps.height=r,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){if(this.device=await this.props.device,!this.device)throw new Error(\"No device provided\");this.canvas=this.device.getDefaultCanvasContext().canvas||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){let t=document.createElement(\"div\");document.body.appendChild(t),t.style.position=\"relative\";let r=document.createElement(\"div\");r.style.position=\"absolute\",r.style.left=\"10px\",r.style.bottom=\"10px\",r.style.width=\"300px\",r.style.background=\"white\",this.canvas instanceof HTMLCanvasElement&&t.appendChild(this.canvas),t.appendChild(r);let i=this.props.onAddHTML(r);i&&(r.innerHTML=i)}}_getSizeAndAspect(){if(!this.device)return{width:1,height:1,aspect:1};let[t,r]=this.device?.getDefaultCanvasContext().getDevicePixelSize()||[1,1],i=1,n=this.device?.getDefaultCanvasContext().canvas;return n&&n.clientHeight?i=n.clientWidth/n.clientHeight:t>0&&r>0&&(i=t/r),{width:t,height:r,aspect:i}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener(\"mousemove\",this._onMousemove.bind(this)),this.canvas.addEventListener(\"mouseleave\",this._onMouseleave.bind(this)))}_onMousemove(t){t instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[t.offsetX,t.offsetY])}_onMouseleave(t){this._getAnimationProps()._mousePosition=null}};Ci();Ci();var jY={};function Od(e=\"id\"){jY[e]=jY[e]||1;let t=jY[e]++;return`${e}-${t}`}var iL=class{id;userData={};topology;bufferLayout=[];vertexCount;indices;attributes;constructor(t){if(this.id=t.id||Od(\"geometry\"),this.topology=t.topology,this.indices=t.indices||null,this.attributes=t.attributes,this.vertexCount=t.vertexCount,this.bufferLayout=t.bufferLayout||[],this.indices&&!(this.indices.usage&on.INDEX))throw new Error(\"Index buffer must have INDEX usage\")}destroy(){this.indices?.destroy();for(let t of Object.values(this.attributes))t.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(t){return t.byteLength/12}};function dmt(e,t){if(t instanceof iL)return t;let r=KVt(e,t),{attributes:i,bufferLayout:n}=QVt(e,t);return new iL({topology:t.topology||\"triangle-list\",bufferLayout:n,vertexCount:t.vertexCount,indices:r,attributes:i})}function KVt(e,t){if(!t.indices)return;let r=t.indices.value;return e.createBuffer({usage:on.INDEX,data:r})}function QVt(e,t){let r=[],i={};for(let[o,s]of Object.entries(t.attributes)){let a=o;switch(o){case\"POSITION\":a=\"positions\";break;case\"NORMAL\":a=\"normals\";break;case\"TEXCOORD_0\":a=\"texCoords\";break;case\"COLOR_0\":a=\"colors\";break}if(s){i[a]=e.createBuffer({data:s.value,id:`${o}-buffer`});let{value:h,size:p,normalized:g}=s;r.push({name:a,format:Vq(h,p,g)})}}let n=t._calculateVertexCount(t.attributes,t.indices);return{attributes:i,bufferLayout:r,vertexCount:n}}Ci();var nL=class e{static defaultProps={...Bf.defaultProps};static getDefaultPipelineFactory(t){return t._lumaData.defaultPipelineFactory=t._lumaData.defaultPipelineFactory||new e(t),t._lumaData.defaultPipelineFactory}device;cachingEnabled;destroyPolicy;debug;_hashCounter=0;_hashes={};_renderPipelineCache={};_computePipelineCache={};get[Symbol.toStringTag](){return\"PipelineFactory\"}toString(){return`PipelineFactory(${this.device.id})`}constructor(t){this.device=t,this.cachingEnabled=t.props._cachePipelines,this.destroyPolicy=t.props._cacheDestroyPolicy,this.debug=t.props.debugFactories}createRenderPipeline(t){if(!this.cachingEnabled)return this.device.createRenderPipeline(t);let r={...Bf.defaultProps,...t},i=this._renderPipelineCache,n=this._hashRenderPipeline(r),o=i[n]?.pipeline;return o?(i[n].useCount++,this.debug&&Ie.log(3,`${this}: ${i[n].pipeline} reused, count=${i[n].useCount}, (id=${t.id})`)()):(o=this.device.createRenderPipeline({...r,id:r.id?`${r.id}-cached`:Od(\"unnamed-cached\")}),o.hash=n,i[n]={pipeline:o,useCount:1},this.debug&&Ie.log(3,`${this}: ${o} created, count=${i[n].useCount}`)()),o}createComputePipeline(t){if(!this.cachingEnabled)return this.device.createComputePipeline(t);let r={...s3.defaultProps,...t},i=this._computePipelineCache,n=this._hashComputePipeline(r),o=i[n]?.pipeline;return o?(i[n].useCount++,this.debug&&Ie.log(3,`${this}: ${i[n].pipeline} reused, count=${i[n].useCount}, (id=${t.id})`)()):(o=this.device.createComputePipeline({...r,id:r.id?`${r.id}-cached`:void 0}),o.hash=n,i[n]={pipeline:o,useCount:1},this.debug&&Ie.log(3,`${this}: ${o} created, count=${i[n].useCount}`)()),o}release(t){if(!this.cachingEnabled){t.destroy();return}let r=this._getCache(t),i=t.hash;r[i].useCount--,r[i].useCount===0?(this._destroyPipeline(t),this.debug&&Ie.log(3,`${this}: ${t} released and destroyed`)()):r[i].useCount<0?(Ie.error(`${this}: ${t} released, useCount < 0, resetting`)(),r[i].useCount=0):this.debug&&Ie.log(3,`${this}: ${t} released, count=${r[i].useCount}`)()}_destroyPipeline(t){let r=this._getCache(t);switch(this.destroyPolicy){case\"never\":return!1;case\"unused\":return delete r[t.hash],t.destroy(),!0}}_getCache(t){let r;if(t instanceof s3&&(r=this._computePipelineCache),t instanceof Bf&&(r=this._renderPipelineCache),!r)throw new Error(`${this}`);if(!r[t.hash])throw new Error(`${this}: ${t} matched incorrect entry`);return r}_hashComputePipeline(t){let{type:r}=this.device,i=this._getHash(t.shader.source);return`${r}/C/${i}`}_hashRenderPipeline(t){let r=t.vs?this._getHash(t.vs.source):0,i=t.fs?this._getHash(t.fs.source):0,n=\"-\",o=this._getHash(JSON.stringify(t.bufferLayout)),{type:s}=this.device;if(s===\"webgl\")return`${s}/R/${r}/${i}V${n}BL${o}`;{let a=this._getHash(JSON.stringify(t.parameters));return`${s}/R/${r}/${i}V${n}T${t.topology}P${a}BL${o}`}}_getHash(t){return this._hashes[t]===void 0&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}};Ci();var oL=class e{static defaultProps={...Qv.defaultProps};static getDefaultShaderFactory(t){return t._lumaData.defaultShaderFactory||=new e(t),t._lumaData.defaultShaderFactory}device;cachingEnabled;destroyPolicy;debug;_cache={};get[Symbol.toStringTag](){return\"ShaderFactory\"}toString(){return`${this[Symbol.toStringTag]}(${this.device.id})`}constructor(t){this.device=t,this.cachingEnabled=t.props._cacheShaders,this.destroyPolicy=t.props._cacheDestroyPolicy,this.debug=!0}createShader(t){if(!this.cachingEnabled)return this.device.createShader(t);let r=this._hashShader(t),i=this._cache[r];if(i)i.useCount++,this.debug&&Ie.log(3,`${this}: Reusing shader ${i.shader.id} count=${i.useCount}`)();else{let n=this.device.createShader({...t,id:t.id?`${t.id}-cached`:void 0});this._cache[r]=i={shader:n,useCount:1},this.debug&&Ie.log(3,`${this}: Created new shader ${n.id}`)()}return i.shader}release(t){if(!this.cachingEnabled){t.destroy();return}let r=this._hashShader(t),i=this._cache[r];if(i)if(i.useCount--,i.useCount===0)this.destroyPolicy===\"unused\"&&(delete this._cache[r],i.shader.destroy(),this.debug&&Ie.log(3,`${this}: Releasing shader ${t.id}, destroyed`)());else{if(i.useCount<0)throw new Error(`ShaderFactory: Shader ${t.id} released too many times`);this.debug&&Ie.log(3,`${this}: Releasing shader ${t.id} count=${i.useCount}`)()}}_hashShader(t){return`${t.stage}:${t.source}`}};function fmt(e,t){let r={},i=\"Values\";if(e.attributes.length===0&&!e.varyings?.length)return{\"No attributes or varyings\":{[i]:\"N/A\"}};for(let n of e.attributes)if(n){let o=`${n.location} ${n.name}: ${n.type}`;r[`in ${o}`]={[i]:n.stepMode||\"vertex\"}}for(let n of e.varyings||[]){let o=`${n.location} ${n.name}`;r[`out ${o}`]={[i]:JSON.stringify(n)}}return r}var tl=null,$Y=null;function pmt(e,{id:t,minimap:r,opaque:i,top:n=\"0\",left:o=\"0\",rgbaScale:s=1}){tl||(tl=document.createElement(\"canvas\"),tl.id=t,tl.title=t,tl.style.zIndex=\"100\",tl.style.position=\"absolute\",tl.style.top=n,tl.style.left=o,tl.style.border=\"blue 5px solid\",tl.style.transform=\"scaleY(-1)\",document.body.appendChild(tl),$Y=tl.getContext(\"2d\")),(tl.width!==e.width||tl.height!==e.height)&&(tl.width=e.width/2,tl.height=e.height/2,tl.style.width=\"400px\",tl.style.height=\"400px\");let a=e.device.readPixelsToArrayWebGL(e),h=$Y?.createImageData(e.width,e.height);if(h){for(let g=0;g<a.length;g+=4)h.data[0+g+0]=a[g+0]*s,h.data[0+g+1]=a[g+1]*s,h.data[0+g+2]=a[g+2]*s,h.data[0+g+3]=i?255:a[g+3]*s;$Y?.putImageData(h,0,0)}}function sL(e,t,r){if(e===t)return!0;if(!r||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!sL(e[i],t[i],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(typeof e==\"object\"&&typeof t==\"object\"){let i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(let o of i)if(!t.hasOwnProperty(o)||!sL(e[o],t[o],r-1))return!1;return!0}return!1}Ci();var R3=class{bufferLayouts;constructor(t){this.bufferLayouts=t}getBufferLayout(t){return this.bufferLayouts.find(r=>r.name===t)||null}getAttributeNamesForBuffer(t){return t.attributes?t.attributes?.map(r=>r.attribute):[t.name]}mergeBufferLayouts(t,r){let i=[...t];for(let n of r){let o=i.findIndex(s=>s.name===n.name);o<0?i.push(n):i[o]=n}return i}getBufferIndex(t){let r=this.bufferLayouts.findIndex(i=>i.name===t);return r===-1&&Ie.warn(`BufferLayout: Missing buffer for \"${t}\".`)(),r}};function mmt(e,t){let r=Object.fromEntries(e.attributes.map(n=>[n.name,n.location])),i=t.slice();return i.sort((n,o)=>{let s=n.attributes?n.attributes.map(g=>g.attribute):[n.name],a=o.attributes?o.attributes.map(g=>g.attribute):[o.name],h=Math.min(...s.map(g=>r[g])),p=Math.min(...a.map(g=>r[g]));return h-p}),i}Ci();function gmt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Amt(e){return Array.isArray(e)?e.length===0||typeof e[0]==\"number\":!1}function GY(e){return gmt(e)||Amt(e)}function JVt(e){return GY(e)||typeof e==\"number\"||typeof e==\"boolean\"}function ymt(e){let t={bindings:{},uniforms:{}};return Object.keys(e).forEach(r=>{let i=e[r];JVt(i)?t.uniforms[r]=i:t.bindings[r]=i}),t}var aL=class{options={disableWarnings:!1};modules;moduleUniforms;moduleBindings;constructor(t,r){Object.assign(this.options,r);let i=r3(Object.values(t).filter(n=>n.dependencies));for(let n of i)t[n.name]=n;Ie.log(1,\"Creating ShaderInputs with modules\",Object.keys(t))(),this.modules=t,this.moduleUniforms={},this.moduleBindings={};for(let[n,o]of Object.entries(t))this._addModule(o),o.name&&n!==o.name&&!this.options.disableWarnings&&Ie.warn(`Module name: ${n} vs ${o.name}`)()}destroy(){}setProps(t){for(let r of Object.keys(t)){let i=r,n=t[i]||{},o=this.modules[i];if(!o){this.options.disableWarnings||Ie.warn(`Module ${r} not found`)();continue}let s=this.moduleUniforms[i],a=this.moduleBindings[i],h=o.getUniforms?.(n,s)||n,{uniforms:p,bindings:g}=ymt(h);this.moduleUniforms[i]={...s,...p},this.moduleBindings[i]={...a,...g}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){let t={};for(let r of Object.values(this.moduleBindings))Object.assign(t,r);return t}getDebugTable(){let t={};for(let[r,i]of Object.entries(this.moduleUniforms))for(let[n,o]of Object.entries(i))t[`${r}.${n}`]={type:this.modules[r].uniformTypes?.[n],value:String(o)};return t}_addModule(t){let r=t.name;this.moduleUniforms[r]=t.defaultUniforms||{},this.moduleBindings[r]={}}};Ci();var tjt=\"\";async function _mt(e,t){let r=new Image;return r.crossOrigin=t?.crossOrigin||\"anonymous\",r.src=e.startsWith(\"http\")?e:tjt+e,await r.decode(),t?await createImageBitmap(r,t):await createImageBitmap(r)}var ejt=[\"+X\",\"-X\",\"+Y\",\"-Y\",\"+Z\",\"-Z\"];var rjt=[\"+X\",\"-X\",\"+Y\",\"-Y\",\"+Z\",\"-Z\"],D3=class e{device;id;props;texture;sampler;view;ready;isReady=!1;destroyed=!1;resolveReady=()=>{};rejectReady=()=>{};get[Symbol.toStringTag](){return\"AsyncTexture\"}toString(){return`AsyncTexture:\"${this.id}\"(${this.isReady?\"ready\":\"loading\"})`}constructor(t,r){this.device=t;let i=Od(\"async-texture\");this.props={...e.defaultProps,id:i,...r},this.id=this.props.id,r={...r},typeof r?.data==\"string\"&&r.dimension===\"2d\"&&(r.data=_mt(r.data)),r.mipmaps&&(r.mipLevels=\"auto\"),this.ready=new Promise((n,o)=>{this.resolveReady=()=>{this.isReady=!0,n()},this.rejectReady=o}),this.initAsync(r)}async initAsync(t){let r=t.data,i=await vmt(r).then(void 0,this.rejectReady);if(this.destroyed)return;let n=this.props.width&&this.props.height?{width:this.props.width,height:this.props.height}:this.getTextureDataSize(i);if(!n)throw new Error(\"Texture size could not be determined\");let o={...n,...t,data:void 0,mipLevels:1},s=this.device.getMipLevelCount(o.width,o.height);if(o.mipLevels=this.props.mipLevels===\"auto\"?s:Math.min(s,this.props.mipLevels),this.texture=this.device.createTexture(o),this.sampler=this.texture.sampler,this.view=this.texture.view,t.data)switch(this.props.dimension){case\"1d\":this._setTexture1DData(this.texture,i);break;case\"2d\":this._setTexture2DData(i);break;case\"3d\":this._setTexture3DData(this.texture,i);break;case\"2d-array\":this._setTextureArrayData(this.texture,i);break;case\"cube\":this._setTextureCubeData(this.texture,i);break;case\"cube-array\":this._setTextureCubeArrayData(this.texture,i);break}this.props.mipmaps&&this.generateMipmaps(),Ie.info(1,`${this} loaded`),this.resolveReady()}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}generateMipmaps(){this.texture.generateMipmapsWebGL()}setSampler(t={}){this.texture.setSampler(t instanceof Lf?t:this.device.createSampler(t))}resize(t){if(!this.isReady)throw new Error(\"Cannot resize texture before it is ready\");if(t.width===this.texture.width&&t.height===this.texture.height)return!1;if(this.texture){let r=this.texture;this.texture=r.clone(t),r.destroy()}return!0}isTextureLevelData(t){let r=t?.data;return ArrayBuffer.isView(r)}getTextureDataSize(t){if(!t||ArrayBuffer.isView(t))return null;if(Array.isArray(t))return this.getTextureDataSize(t[0]);if(this.device.isExternalImage(t))return this.device.getExternalImageSize(t);if(t&&typeof t==\"object\"&&t.constructor===Object){let i=Object.values(t)[0];return{width:i.width,height:i.height}}throw new Error(\"texture size deduction failed\")}getCubeFaceDepth(t){switch(t){case\"+X\":return 0;case\"-X\":return 1;case\"+Y\":return 2;case\"-Y\":return 3;case\"+Z\":return 4;case\"-Z\":return 5;default:throw new Error(t)}}setTextureData(t){}_setTexture1DData(t,r){throw new Error(\"setTexture1DData not supported in WebGL.\")}_setTexture2DData(t,r=0){if(!this.texture)throw new Error(\"Texture not initialized\");let i=this._normalizeTextureData(t);i.length>1&&this.props.mipmaps!==!1&&Ie.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let n=0;n<i.length;n++){let o=i[n];this.device.isExternalImage(o)?this.texture.copyExternalImage({image:o,depth:r,mipLevel:n,flipY:!0}):this.texture.copyImageData({data:o.data,mipLevel:n})}}_setTexture3DData(t,r){if(this.texture?.props.dimension!==\"3d\")throw new Error(this.id);for(let i=0;i<r.length;i++)this._setTexture2DData(r[i],i)}_setTextureCubeData(t,r){if(this.texture?.props.dimension!==\"cube\")throw new Error(this.id);for(let[i,n]of Object.entries(r)){let o=rjt.indexOf(i);this._setTexture2DData(n,o)}}_setTextureArrayData(t,r){if(this.texture?.props.dimension!==\"2d-array\")throw new Error(this.id);for(let i=0;i<r.length;i++)this._setTexture2DData(r[i],i)}_setTextureCubeArrayData(t,r){throw new Error(\"setTextureCubeArrayData not supported in WebGL2.\")}_setTextureCubeFaceData(t,r,i,n=0){Array.isArray(r)&&r.length>1&&this.props.mipmaps!==!1&&Ie.warn(`${this.id} has mipmap and multiple LODs.`)();let o=ejt.indexOf(i);this._setTexture2DData(r,o)}_normalizeTextureData(t){let r=this.texture,i;return ArrayBuffer.isView(t)?i=[{data:t,width:r.width,height:r.height}]:Array.isArray(t)?i=t:i=[t],i}static defaultProps={...Jo.defaultProps,data:null,mipmaps:!1}};async function vmt(e){if(e=await e,Array.isArray(e))return await Promise.all(e.map(vmt));if(e&&typeof e==\"object\"&&e.constructor===Object){let t=e,r=await Promise.all(Object.values(t)),i=Object.keys(t),n={};for(let o=0;o<i.length;o++)n[i[o]]=r[o];return n}return e}var pb=2,ijt=1e4,sn=class e{static defaultProps={...Bf.defaultProps,source:void 0,vs:null,fs:null,id:\"unnamed\",handle:void 0,userData:{},defines:{},modules:[],geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:Yv.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0};device;id;source;vs;fs;pipelineFactory;shaderFactory;userData={};parameters;topology;bufferLayout;isInstanced=void 0;instanceCount=0;vertexCount;indexBuffer=null;bufferAttributes={};constantAttributes={};bindings={};vertexArray;transformFeedback=null;pipeline;shaderInputs;_uniformStore;_attributeInfos={};_gpuGeometry=null;props;_pipelineNeedsUpdate=\"newly created\";_needsRedraw=\"initializing\";_destroyed=!1;_lastDrawTimestamp=-1;get[Symbol.toStringTag](){return\"Model\"}toString(){return`Model(${this.id})`}constructor(t,r){this.props={...e.defaultProps,...r},r=this.props,this.id=r.id||Od(\"model\"),this.device=t,Object.assign(this.userData,r.userData);let i=Object.fromEntries(this.props.modules?.map(h=>[h.name,h])||[]),n=r.shaderInputs||new aL(i,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(n);let o=ojt(t),s=(this.props.modules?.length>0?this.props.modules:this.shaderInputs?.getModules())||[];if(this.device.type===\"webgpu\"&&this.props.source){let{source:h,getUniforms:p}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:o,...this.props,modules:s});this.source=h,this._getModuleUniforms=p,this.props.shaderLayout||=CH(this.source)}else{let{vs:h,fs:p,getUniforms:g}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:o,...this.props,modules:s});this.vs=h,this.fs=p,this._getModuleUniforms=g}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,r.geometry&&this.setGeometry(r.geometry),this.pipelineFactory=r.pipelineFactory||nL.getDefaultPipelineFactory(this.device),this.shaderFactory=r.shaderFactory||oL.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=t.createVertexArray({shaderLayout:this.pipeline.shaderLayout,bufferLayout:this.pipeline.bufferLayout}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),\"isInstanced\"in r&&(this.isInstanced=r.isInstanced),r.instanceCount&&this.setInstanceCount(r.instanceCount),r.vertexCount&&this.setVertexCount(r.vertexCount),r.indexBuffer&&this.setIndexBuffer(r.indexBuffer),r.attributes&&this.setAttributes(r.attributes),r.constantAttributes&&this.setConstantAttributes(r.constantAttributes),r.bindings&&this.setBindings(r.bindings),r.transformFeedback&&(this.transformFeedback=r.transformFeedback),Object.seal(this)}destroy(){this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),this._gpuGeometry?.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw(\"contents of bound textures or buffers updated\");let t=this._needsRedraw;return this._needsRedraw=!1,t}setNeedsRedraw(t){this._needsRedraw||=t}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(t){let r=this._areBindingsLoading();if(r)return Ie.info(pb,`>>> DRAWING ABORTED ${this.id}: ${r} not loaded`)(),!1;try{t.pushDebugGroup(`${this}.predraw(${t})`),this.predraw()}finally{t.popDebugGroup()}let i;try{t.pushDebugGroup(`${this}.draw(${t})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();let n=this._getBindings();this.pipeline.setBindings(n,{disableWarnings:this.props.disableWarnings});let{indexBuffer:o}=this.vertexArray,s=o?o.byteLength/(o.indexType===\"uint32\"?4:2):void 0;i=this.pipeline.draw({renderPass:t,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:s,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{t.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(t),i?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw=\"waiting for resource initialization\",i}setGeometry(t){this._gpuGeometry?.destroy();let r=t&&dmt(this.device,t);if(r){this.setTopology(r.topology||\"triangle-list\");let i=new R3(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(r.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(r)}this._gpuGeometry=r}setTopology(t){t!==this.topology&&(this.topology=t,this._setPipelineNeedsUpdate(\"topology\"))}setBufferLayout(t){let r=new R3(this.bufferLayout);this.bufferLayout=this._gpuGeometry?r.mergeBufferLayouts(t,this._gpuGeometry.bufferLayout):t,this._setPipelineNeedsUpdate(\"bufferLayout\"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({shaderLayout:this.pipeline.shaderLayout,bufferLayout:this.pipeline.bufferLayout}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(t){sL(t,this.parameters,2)||(this.parameters=t,this._setPipelineNeedsUpdate(\"parameters\"))}setInstanceCount(t){this.instanceCount=t,this.isInstanced===void 0&&t>0&&(this.isInstanced=!0),this.setNeedsRedraw(\"instanceCount\")}setVertexCount(t){this.vertexCount=t,this.setNeedsRedraw(\"vertexCount\")}setShaderInputs(t){this.shaderInputs=t,this._uniformStore=new PE(this.shaderInputs.modules);for(let[r,i]of Object.entries(this.shaderInputs.modules))if(njt(i)){let n=this._uniformStore.getManagedUniformBuffer(this.device,r);this.bindings[`${r}Uniforms`]=n}this.setNeedsRedraw(\"shaderInputs\")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw(\"shaderInputs\")}setBindings(t){Object.assign(this.bindings,t),this.setNeedsRedraw(\"bindings\")}setTransformFeedback(t){this.transformFeedback=t,this.setNeedsRedraw(\"transformFeedback\")}setIndexBuffer(t){this.vertexArray.setIndexBuffer(t),this.setNeedsRedraw(\"indexBuffer\")}setAttributes(t,r){let i=r?.disableWarnings??this.props.disableWarnings;t.indices&&Ie.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)(),this.bufferLayout=mmt(this.pipeline.shaderLayout,this.bufferLayout);let n=new R3(this.bufferLayout);for(let[o,s]of Object.entries(t)){let a=n.getBufferLayout(o);if(!a){i||Ie.warn(`Model(${this.id}): Missing layout for buffer \"${o}\".`)();continue}let h=n.getAttributeNamesForBuffer(a),p=!1;for(let g of h){let w=this._attributeInfos[g];if(w){let C=this.device.type===\"webgpu\"?n.getBufferIndex(w.bufferName):w.location;this.vertexArray.setBuffer(C,s),p=!0}}!p&&!i&&Ie.warn(`Model(${this.id}): Ignoring buffer \"${s.id}\" for unknown attribute \"${o}\"`)()}this.setNeedsRedraw(\"attributes\")}setConstantAttributes(t,r){for(let[i,n]of Object.entries(t)){let o=this._attributeInfos[i];o?this.vertexArray.setConstantWebGL(o.location,n):(r?.disableWarnings??this.props.disableWarnings)||Ie.warn(`Model \"${this.id}: Ignoring constant supplied for unknown attribute \"${i}\"`)()}this.setNeedsRedraw(\"constants\")}_areBindingsLoading(){for(let t of Object.values(this.bindings))if(t instanceof D3&&!t.isReady)return t.id;return!1}_getBindings(){let t={};for(let[r,i]of Object.entries(this.bindings))i instanceof D3?i.isReady&&(t[r]=i.texture):t[r]=i;return t}_getBindingsUpdateTimestamp(){let t=0;for(let r of Object.values(this.bindings))r instanceof Kv?t=Math.max(t,r.texture.updateTimestamp):r instanceof on||r instanceof Jo?t=Math.max(t,r.updateTimestamp):r instanceof D3?t=r.texture?Math.max(t,r.texture.updateTimestamp):1/0:r instanceof Lf||(t=Math.max(t,r.buffer.updateTimestamp));return t}_setGeometryAttributes(t){let r={...t.attributes};for(let[i]of Object.entries(r))!this.pipeline.shaderLayout.attributes.find(n=>n.name===i)&&i!==\"positions\"&&delete r[i];this.vertexCount=t.vertexCount,this.setIndexBuffer(t.indices||null),this.setAttributes(t.attributes,{disableWarnings:!0}),this.setAttributes(r,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw(\"geometry attributes\")}_setPipelineNeedsUpdate(t){this._pipelineNeedsUpdate||=t,this.setNeedsRedraw(t)}_updatePipeline(){if(this._pipelineNeedsUpdate){let t=null,r=null;this.pipeline&&(Ie.log(1,`Model ${this.id}: Recreating pipeline because \"${this._pipelineNeedsUpdate}\".`)(),t=this.pipeline.vs,r=this.pipeline.fs),this._pipelineNeedsUpdate=!1;let i=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:\"vertex\",source:this.source||this.vs,debugShaders:this.props.debugShaders}),n=null;this.source?n=i:this.fs&&(n=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:\"fragment\",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:i,fs:n}),this._attributeInfos=zD(this.pipeline.shaderLayout,this.bufferLayout),t&&this.shaderFactory.release(t),r&&this.shaderFactory.release(r)}return this.pipeline}_lastLogTime=0;_logOpen=!1;_logDrawCallStart(){let t=Ie.level>3?0:ijt;Ie.level<2||Date.now()-this._lastLogTime<t||(this._lastLogTime=Date.now(),this._logOpen=!0,Ie.group(pb,`>>> DRAWING MODEL ${this.id}`,{collapsed:Ie.level<=2})())}_logDrawCallEnd(){if(this._logOpen){let t=fmt(this.pipeline.shaderLayout,this.id);Ie.table(pb,t)();let r=this.shaderInputs.getDebugTable();Ie.table(pb,r)();let i=this._getAttributeDebugTable();Ie.table(pb,this._attributeInfos)(),Ie.table(pb,i)(),Ie.groupEnd(pb)(),this._logOpen=!1}}_drawCount=0;_logFramebuffer(t){let r=this.device.props.debugFramebuffers;if(this._drawCount++,!r)return;let i=t.props.framebuffer;i&&pmt(i,{id:i.id,minimap:!0})}_getAttributeDebugTable(){let t={};for(let[r,i]of Object.entries(this._attributeInfos)){let n=this.vertexArray.attributes[i.location];t[i.location]={name:r,type:i.shaderType,values:n?this._getBufferOrConstantValues(n,i.bufferDataType):\"null\"}}if(this.vertexArray.indexBuffer){let{indexBuffer:r}=this.vertexArray,i=r.indexType===\"uint32\"?new Uint32Array(r.debugData):new Uint16Array(r.debugData);t.indices={name:\"indices\",type:r.indexType,values:i.toString()}}return t}_getBufferOrConstantValues(t,r){let i=Zv(r);return(t instanceof on?new i(t.debugData):t).toString()}};function njt(e){return!!(e.uniformTypes&&!sjt(e.uniformTypes))}function ojt(e){return{type:e.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}function sjt(e){for(let t in e)return!1;return!0}Ci();var p1=class e{device;model;transformFeedback;static defaultProps={...sn.defaultProps,outputs:void 0,feedbackBuffers:void 0};static isSupported(t){return t?.info?.type===\"webgl\"}constructor(t,r=e.defaultProps){if(!e.isSupported(t))throw new Error(\"BufferTransform not yet implemented on WebGPU\");this.device=t,this.model=new sn(this.device,{id:r.id||\"buffer-transform-model\",fs:r.fs||fE(),topology:r.topology||\"point-list\",varyings:r.outputs||r.varyings,...r}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:r.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(t){t?.inputBuffers&&this.model.setAttributes(t.inputBuffers),t?.outputBuffers&&this.transformFeedback.setBuffers(t.outputBuffers);let r=this.device.beginRenderPass(t);this.model.draw(r),r.end()}getBuffer(t){return this.transformFeedback.getBuffer(t)}readAsync(t){let r=this.getBuffer(t);if(!r)throw new Error(\"BufferTransform#getBuffer\");if(r instanceof on)return r.readAsync();let{buffer:i,byteOffset:n=0,byteLength:o=i.byteLength}=r;return i.readAsync(n,o)}};var ajt=\"transform_output\",O3=class{device;model;sampler;currentIndex=0;samplerTextureMap=null;bindings=[];resources={};constructor(t,r){this.device=t,this.sampler=t.createSampler({addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\",minFilter:\"nearest\",magFilter:\"nearest\",mipmapFilter:\"nearest\"}),this.model=new sn(this.device,{id:r.id||Od(\"texture-transform-model\"),fs:r.fs||fE({input:r.targetTextureVarying,inputChannels:r.targetTextureChannels,output:ajt}),vertexCount:r.vertexCount,...r}),this._initialize(r),Object.seal(this)}destroy(){this.model.destroy();for(let t of this.bindings)t.framebuffer?.destroy()}delete(){this.destroy()}run(t){let{framebuffer:r}=this.bindings[this.currentIndex],i=this.device.beginRenderPass({framebuffer:r,...t});this.model.draw(i),i.end(),this.device.submit()}getTargetTexture(){let{targetTexture:t}=this.bindings[this.currentIndex];return t}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}_initialize(t){this._updateBindings(t)}_updateBindings(t){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t)}_updateBinding(t,{sourceBuffers:r,sourceTextures:i,targetTexture:n}){if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,r),n){t.targetTexture=n;let{width:o,height:s}=n;t.framebuffer&&t.framebuffer.destroy(),t.framebuffer=this.device.createFramebuffer({id:\"transform-framebuffer\",width:o,height:s,colorAttachments:[n]}),t.framebuffer.resize({width:o,height:s})}return t}_setSourceTextureParameters(){let t=this.currentIndex,{sourceTextures:r}=this.bindings[t];for(let i in r)r[i].sampler=this.sampler}};var xs=class{id;topology;vertexCount;indices;attributes;userData={};constructor(t){let{attributes:r={},indices:i=null,vertexCount:n=null}=t;this.id=t.id||Od(\"geometry\"),this.topology=t.topology,i&&(this.indices=ArrayBuffer.isView(i)?{value:i,size:1}:i),this.attributes={};for(let[o,s]of Object.entries(r)){let a=ArrayBuffer.isView(s)?{value:s}:s;if(!ArrayBuffer.isView(a.value))throw new Error(`${this._print(o)}: must be typed array or object with value as typed array`);if((o===\"POSITION\"||o===\"positions\")&&!a.size&&(a.size=3),o===\"indices\"){if(this.indices)throw new Error(\"Multiple indices detected\");this.indices=a}else this.attributes[o]=a}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=n||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,r){return this}_calculateVertexCount(t,r){if(r)return r.value.length;let i=1/0;for(let n of Object.values(t)){let{value:o,size:s,constant:a}=n;!a&&o&&s!==void 0&&s>=1&&(i=Math.min(i,o.length/s))}return i}};var ljt={blendColorOperation:\"add\",blendColorSrcFactor:\"one\",blendColorDstFactor:\"zero\",blendAlphaOperation:\"add\",blendAlphaSrcFactor:\"constant\",blendAlphaDstFactor:\"zero\"},mb=class extends Rd{constructor(){super(...arguments),this._colorEncoderState=null}render(t){return\"pickingFBO\"in t?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer({layers:t,layerFilter:r,views:i,viewports:n,onViewportActive:o,pickingFBO:s,deviceRect:{x:a,y:h,width:p,height:g},cullRect:w,effects:C,pass:R=\"picking\",pickZ:z,shaderModuleProps:W}){this.pickZ=z;let Y=this._resetColorEncoder(z),H=[a,h,p,g],Q=super.render({target:s,layers:t,layerFilter:r,views:i,viewports:n,onViewportActive:o,cullRect:w,effects:C?.filter(rt=>rt.useInPicking),pass:R,isPicking:!0,shaderModuleProps:W,clearColor:[0,0,0,0],colorMask:15,scissorRect:H});return this._colorEncoderState=null,{decodePickingColor:Y&&ujt.bind(null,Y),stats:Q}}shouldDrawLayer(t){let{pickable:r,operation:i}=t.props;return r&&i.includes(\"draw\")||i.includes(\"terrain\")||i.includes(\"mask\")}getShaderModuleProps(t,r,i){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(t,r,i){let n={...t.props.parameters},{pickable:o,operation:s}=t.props;return this._colorEncoderState?o&&s.includes(\"draw\")?(Object.assign(n,ljt),n.blend=!0,n.blendColor=cjt(this._colorEncoderState,t,i)):s.includes(\"terrain\")&&(n.blend=!1):n.blend=!1,n}_resetColorEncoder(t){return this._colorEncoderState=t?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}};function cjt(e,t,r){let{byLayer:i,byAlpha:n}=e,o,s=i.get(t);return s?(s.viewports.push(r),o=s.a):(o=i.size+1,o<=255?(s={a:o,layer:t,viewports:[r]},i.set(t,s),n[o]=s):(hr.warn(\"Too many pickable layers, only picking the first 255\")(),o=0)),[0,0,0,o/255]}function ujt(e,t){let r=e.byAlpha[t[3]];return r&&{pickedLayer:r.layer,pickedViewports:r.viewports,pickedObjectIndex:r.layer.decodePickingColor(t)}}var m1={NO_STATE:\"Awaiting state\",MATCHED:\"Matched. State transferred from previous layer\",INITIALIZED:\"Initialized\",AWAITING_GC:\"Discarded. Awaiting garbage collection\",AWAITING_FINALIZATION:\"No longer matched. Awaiting garbage collection\",FINALIZED:\"Finalized! Awaiting garbage collection\"},L3=Symbol.for(\"component\"),Ld=Symbol.for(\"propTypes\"),lL=Symbol.for(\"deprecatedProps\"),Bg=Symbol.for(\"asyncPropDefaults\"),x0=Symbol.for(\"asyncPropOriginal\"),Gf=Symbol.for(\"asyncPropResolved\");function Il(e,t=()=>!0){return Array.isArray(e)?bmt(e,t,[]):t(e)?[e]:[]}function bmt(e,t,r){let i=-1;for(;++i<e.length;){let n=e[i];Array.isArray(n)?bmt(n,t,r):t(n)&&r.push(n)}return r}function WY({target:e,source:t,start:r=0,count:i=1}){let n=t.length,o=i*n,s=0;for(let a=r;s<n;s++)e[a++]=t[s];for(;s<o;)s<o-s?(e.copyWithin(r+s,r,r+s),s*=2):(e.copyWithin(r+s,r,r+o-s),s=o);return e}Qw();var cP=class{constructor(t,r,i){this._loadCount=0,this._subscribers=new Set,this.id=t,this.context=i,this.setData(r)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(t,r){if(t===this._data&&!r)return;this._data=t;let i=++this._loadCount,n=t;typeof t==\"string\"&&(n=n1(t)),n instanceof Promise?(this.isLoaded=!1,this._loader=n.then(o=>{this._loadCount===i&&(this.isLoaded=!0,this._error=void 0,this._content=o)}).catch(o=>{this._loadCount===i&&(this.isLoaded=!0,this._error=o||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=t);for(let o of this._subscribers)o.onChange(this.getData())}};var uP=class{constructor(t){this.protocol=t.protocol||\"resource://\",this._context={device:t.device,gl:t.device?.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return t.startsWith(this.protocol)?!0:t in this._resources}add({resourceId:t,data:r,forceUpdate:i=!1,persistent:n=!0}){let o=this._resources[t];o?o.setData(r,i):(o=new cP(t,r,this._context),this._resources[t]=o),o.persistent=n}remove(t){let r=this._resources[t];r&&(r.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){let r=this._consumers[t];if(r){for(let i in r){let n=r[i],o=this._resources[n.resourceId];o&&o.unsubscribe(n)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:r,consumerId:i,requestId:n=\"default\"}){let{_resources:o,protocol:s}=this;t.startsWith(s)&&(t=t.replace(s,\"\"),o[t]||this.add({resourceId:t,data:null,persistent:!1}));let a=o[t];if(this._track(i,n,a,r),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(let t in this._resources)this._resources[t].delete()}_track(t,r,i,n){let o=this._consumers,s=o[t]=o[t]||{},a=s[r],h=a&&a.resourceId&&this._resources[a.resourceId];h&&(h.unsubscribe(a),this.prune()),i&&(a?(a.onChange=n,a.resourceId=i.id):a={onChange:n,resourceId:i.id},s[r]=a,i.subscribe(a))}_prune(){this._pruneRequest=null;for(let t of Object.keys(this._resources)){let r=this._resources[t];!r.persistent&&!r.inUse()&&(r.delete(),delete this._resources[t])}}};var hjt=\"layerManager.setLayers\",djt=\"layerManager.activateViewport\",hP=class{constructor(t,r){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=a=>{ys(djt,this,a),a&&(this.context.viewport=a)};let{deck:i,stats:n,viewport:o,timeline:s}=r||{};this.layers=[],this.resourceManager=new uP({device:t,protocol:\"deck://\"}),this.context={mousePosition:null,userData:{},layerManager:this,device:t,gl:t?.gl,deck:i,shaderAssembler:J0t(t?.info?.shadingLanguage||\"glsl\"),defaultShaderModules:[bY],renderPass:void 0,stats:n||new vu({id:\"deck.gl\"}),viewport:o||new Dd({id:\"DEFAULT-INITIAL-VIEWPORT\"}),timeline:s||new fb,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(let t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let r=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(let i of this.layers){let n=i.getNeedsRedraw(t);r=r||n}return r}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?\"layers changed\":this._defaultShaderModulesChanged?\"shader modules changed\":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t}={}){return t?this.layers.filter(r=>t.find(i=>r.id.indexOf(i)===0)):this.layers}setProps(t){\"debug\"in t&&(this._debug=t.debug),\"userData\"in t&&(this.context.userData=t.userData),\"layers\"in t&&(this._nextLayers=t.layers),\"onError\"in t&&(this.context.onError=t.onError)}setLayers(t,r){ys(hjt,this,r,t),this._lastRenderedLayers=t;let i=Il(t,Boolean);for(let n of i)n.context=this.context;this._updateLayers(this.layers,i)}updateLayers(){let t=this.needsUpdate();t&&(this.setNeedsRedraw(`updating layers: ${t}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}addDefaultShaderModule(t){let{defaultShaderModules:r}=this.context;r.find(i=>i.name===t.name)||(r.push(t),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(t){let{defaultShaderModules:r}=this.context,i=r.findIndex(n=>n.name===t.name);i>=0&&(r.splice(i,1),this._defaultShaderModulesChanged=!0)}_handleError(t,r,i){i.raiseError(r,`${t} of ${i}`)}_updateLayers(t,r){let i={};for(let s of t)i[s.id]?hr.warn(`Multiple old layers with same id ${s.id}`)():i[s.id]=s;if(this._defaultShaderModulesChanged){for(let s of t)s.setNeedsUpdate(),s.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}let n=[];this._updateSublayersRecursively(r,i,n),this._finalizeOldLayers(i);let o=!1;for(let s of n)if(s.hasUniformTransition()){o=`Uniform transition in ${s}`;break}this._needsUpdate=o,this.layers=n}_updateSublayersRecursively(t,r,i){for(let n of t){n.context=this.context;let o=r[n.id];o===null&&hr.warn(`Multiple new layers with same id ${n.id}`)(),r[n.id]=null;let s=null;try{this._debug&&o!==n&&n.validateProps(),o?(this._transferLayerState(o,n),this._updateLayer(n)):this._initializeLayer(n),i.push(n),s=n.isComposite?n.getSubLayers():null}catch(a){this._handleError(\"matching\",a,n)}s&&this._updateSublayersRecursively(s,r,i)}}_finalizeOldLayers(t){for(let r in t){let i=t[r];i&&this._finalizeLayer(i)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=m1.INITIALIZED}catch(r){this._handleError(\"initialization\",r,t)}}_transferLayerState(t,r){r._transferState(t),r.lifecycle=m1.MATCHED,r!==t&&(t.lifecycle=m1.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(r){this._handleError(\"update\",r,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||`finalized ${t}`,t.lifecycle=m1.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=m1.FINALIZED}catch(r){this._handleError(\"finalization\",r,t)}}};function to(e,t,r){if(e===t)return!0;if(!r||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!to(e[i],t[i],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(typeof e==\"object\"&&typeof t==\"object\"){let i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(let o of i)if(!t.hasOwnProperty(o)||!to(e[o],t[o],r-1))return!1;return!0}return!1}var dP=class{constructor(t){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw=\"First render\",this._needsUpdate=\"Initialize\",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(let t in this.controllers){let r=this.controllers[t];r&&r.finalize()}this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){let r=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),r}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(let t in this.controllers){let r=this.controllers[t];r&&r.updateTransition()}}getViewports(t){return t?this._viewports.filter(r=>r.containsPixel(t)):this._viewports}getViews(){let t={};return this.views.forEach(r=>{t[r.id]=r}),t}getView(t){return this.views.find(r=>r.id===t)}getViewState(t){let r=typeof t==\"string\"?this.getView(t):t,i=r&&this.viewState[r.getViewStateId()]||this.viewState;return r?r.filterViewState(i):i}getViewport(t){return this._viewportMap[t]}unproject(t,r){let i=this.getViewports(),n={x:t[0],y:t[1]};for(let o=i.length-1;o>=0;--o){let s=i[o];if(s.containsPixel(n)){let a=t.slice();return a[0]-=s.x,a[1]-=s.y,s.unproject(a,r)}}return null}setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),(\"width\"in t||\"height\"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,r){(t!==this.width||r!==this.height)&&(this.width=t,this.height=r,this.setNeedsUpdate(\"Size changed\"))}_setViews(t){t=Il(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate(\"views changed\"),this.views=t}_setViewState(t){t?(!to(t,this.viewState,3)&&this.setNeedsUpdate(\"viewState changed\"),this.viewState=t):hr.warn(\"missing `viewState` or `initialViewState`\")()}_createController(t,r){let i=r.type;return new i({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:o=>this.getView(t.id)?.makeViewport({viewState:o,width:this.width,height:this.height})})}_updateController(t,r,i,n){let o=t.controller;if(o&&i){let s={...r,...o,id:t.id,x:i.x,y:i.y,width:i.width,height:i.height};return(!n||n.constructor!==o.type)&&(n=this._createController(t,s)),n&&n.setProps(s),n}return null}_rebuildViewports(){let{views:t}=this,r=this.controllers;this._viewports=[],this.controllers={};let i=!1;for(let n=t.length;n--;){let o=t[n],s=this.getViewState(o),a=o.makeViewport({viewState:s,width:this.width,height:this.height}),h=r[o.id],p=!!o.controller;p&&!h&&(i=!0),(i||!p)&&h&&(h.finalize(),h=null),this.controllers[o.id]=this._updateController(o,s,a,h),a&&this._viewports.unshift(a)}for(let n in r){let o=r[n];o&&!this.controllers[n]&&o.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)})}_diffViews(t,r){return t.length!==r.length?!0:t.some((i,n)=>!t[n].equals(r[n]))}};var fjt=/^(?:\\d+\\.?\\d*|\\.\\d+)$/;function Fg(e){switch(typeof e){case\"number\":if(!Number.isFinite(e))throw new Error(`Could not parse position string ${e}`);return{type:\"literal\",value:e};case\"string\":try{let t=pjt(e);return new HY(t).parseExpression()}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`Could not parse position string ${e}: ${r}`)}default:throw new Error(`Could not parse position string ${e}`)}}function qY(e,t){switch(e.type){case\"literal\":return e.value;case\"percentage\":return Math.round(e.value*t);case\"binary\":let r=qY(e.left,t),i=qY(e.right,t);return e.operator===\"+\"?r+i:r-i;default:throw new Error(\"Unknown layout expression type\")}}function Ng(e,t){return qY(e,t)}function pjt(e){let t=[],r=0;for(;r<e.length;){let i=e[r];if(/\\s/.test(i)){r++;continue}if(i===\"+\"||i===\"-\"||i===\"(\"||i===\")\"||i===\"%\"){t.push({type:\"symbol\",value:i}),r++;continue}if(xmt(i)||i===\".\"){let n=r,o=i===\".\";for(r++;r<e.length;){let a=e[r];if(xmt(a)){r++;continue}if(a===\".\"&&!o){o=!0,r++;continue}break}let s=e.slice(n,r);if(!fjt.test(s))throw new Error(\"Invalid number token\");t.push({type:\"number\",value:parseFloat(s)});continue}if(wmt(i)){let n=r;for(;r<e.length&&wmt(e[r]);)r++;let o=e.slice(n,r).toLowerCase();t.push({type:\"word\",value:o});continue}throw new Error(\"Invalid token in position string\")}return t}var HY=class{constructor(t){this.index=0,this.tokens=t}parseExpression(){let t=this.parseBinaryExpression();if(this.index<this.tokens.length)throw new Error(\"Unexpected token at end of expression\");return t}parseBinaryExpression(){let t=this.parseFactor(),r=this.peek();for(;mjt(r);){this.index++;let i=this.parseFactor();t={type:\"binary\",operator:r.value,left:t,right:i},r=this.peek()}return t}parseFactor(){let t=this.peek();if(!t)throw new Error(\"Unexpected end of expression\");if(t.type===\"symbol\"&&t.value===\"+\")return this.index++,this.parseFactor();if(t.type===\"symbol\"&&t.value===\"-\"){this.index++;let r=this.parseFactor();return{type:\"binary\",operator:\"-\",left:{type:\"literal\",value:0},right:r}}if(t.type===\"symbol\"&&t.value===\"(\"){this.index++;let r=this.parseBinaryExpression();if(!this.consumeSymbol(\")\"))throw new Error(\"Missing closing parenthesis\");return r}if(t.type===\"word\"&&t.value===\"calc\"){if(this.index++,!this.consumeSymbol(\"(\"))throw new Error(\"Missing opening parenthesis after calc\");let r=this.parseBinaryExpression();if(!this.consumeSymbol(\")\"))throw new Error(\"Missing closing parenthesis\");return r}if(t.type===\"number\"){this.index++;let r=t.value,i=this.peek();return i&&i.type===\"symbol\"&&i.value===\"%\"?(this.index++,{type:\"percentage\",value:r/100}):i&&i.type===\"word\"&&i.value===\"px\"?(this.index++,{type:\"literal\",value:r}):{type:\"literal\",value:r}}throw new Error(\"Unexpected token in expression\")}consumeSymbol(t){let r=this.peek();return r&&r.type===\"symbol\"&&r.value===t?(this.index++,!0):!1}peek(){return this.tokens[this.index]||null}};function xmt(e){return e>=\"0\"&&e<=\"9\"}function wmt(e){return e>=\"a\"&&e<=\"z\"||e>=\"A\"&&e<=\"Z\"}function mjt(e){return!!(e&&e.type===\"symbol\"&&(e.value===\"+\"||e.value===\"-\"))}var Ws=class{constructor(t){let{id:r,x:i=0,y:n=0,width:o=\"100%\",height:s=\"100%\",padding:a=null}=t;this.id=r||this.constructor.displayName||\"view\",this.props={...t,id:this.id},this._x=Fg(i),this._y=Fg(n),this._width=Fg(o),this._height=Fg(s),this._padding=a&&{left:Fg(a.left||0),right:Fg(a.right||0),top:Fg(a.top||0),bottom:Fg(a.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t?!0:this.constructor===t.constructor&&to(this.props,t.props,2)}clone(t){let r=this.constructor;return new r({...this.props,...t})}makeViewport({width:t,height:r,viewState:i}){i=this.filterViewState(i);let n=this.getDimensions({width:t,height:r});if(!n.height||!n.width)return null;let o=this.getViewportType(i);return new o({...i,...this.props,...n})}getViewStateId(){let{viewState:t}=this.props;return typeof t==\"string\"?t:t?.id||this.id}filterViewState(t){if(this.props.viewState&&typeof this.props.viewState==\"object\"){if(!this.props.viewState.id)return this.props.viewState;let r={...t};for(let i in this.props.viewState)i!==\"id\"&&(r[i]=this.props.viewState[i]);return r}return t}getDimensions({width:t,height:r}){let i={x:Ng(this._x,t),y:Ng(this._y,r),width:Ng(this._width,t),height:Ng(this._height,r)};return this._padding&&(i.padding={left:Ng(this._padding.left,t),top:Ng(this._padding.top,r),right:Ng(this._padding.right,t),bottom:Ng(this._padding.bottom,r)}),i}get controller(){let t=this.props.controller;return t?t===!0?{type:this.ControllerType}:typeof t==\"function\"?{type:t}:{type:this.ControllerType,...t}:null}};var Wf=class{constructor(t){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=t}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=t,this._inProgress=!0,this.settings.onStart?.(this)}end(){this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd?.(this))}cancel(){this._inProgress&&(this.settings.onInterrupt?.(this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(this._handle===null){let{_timeline:t,settings:r}=this;this._handle=t.addChannel({delay:t.getTime(),duration:r.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate?.(this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}};var Tmt=()=>{},YY={BREAK:1,SNAP_TO_END:2,IGNORE:3},gjt=e=>e,Ajt=YY.BREAK,fP=class{constructor(t){this._onTransitionUpdate=r=>{let{time:i,settings:{interpolator:n,startProps:o,endProps:s,duration:a,easing:h}}=r,p=h(i/a),g=n.interpolateProps(o,s,p);this.propsInTransition=this.getControllerState({...this.props,...g}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new Wf(t.timeline),this.onViewStateChange=t.onViewStateChange||Tmt,this.onStateChange=t.onStateChange||Tmt}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let r=!1,i=this.props;if(this.props=t,!i||this._shouldIgnoreViewportChange(i,t))return!1;if(this._isTransitionEnabled(t)){let n=i;if(this.transition.inProgress){let{interruption:o,endProps:s}=this.transition.settings;n={...i,...o===YY.SNAP_TO_END?s:this.propsInTransition||i}}this._triggerTransition(n,t),r=!0}else this.transition.cancel();return r}updateTransition(){this.transition.update()}_isTransitionEnabled(t){let{transitionDuration:r,transitionInterpolator:i}=t;return(r>0||r===\"auto\")&&!!i}_isUpdateDueToCurrentTransition(t){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition):!1}_shouldIgnoreViewportChange(t,r){return this.transition.inProgress?this.transition.settings.interruption===YY.IGNORE||this._isUpdateDueToCurrentTransition(r):this._isTransitionEnabled(r)?r.transitionInterpolator.arePropsEqual(t,r):!0}_triggerTransition(t,r){let i=this.getControllerState(t),n=this.getControllerState(r).shortestPathFrom(i),o=r.transitionInterpolator,s=o.getDuration?o.getDuration(t,r):r.transitionDuration;if(s===0)return;let a=o.initializeProps(t,n);this.propsInTransition={};let h={duration:s,easing:r.transitionEasing||gjt,interpolator:o,interruption:r.transitionInterruption||Ajt,startProps:a.start,endProps:a.end,onStart:r.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(r.onTransitionInterrupt),onEnd:this._onTransitionEnd(r.onTransitionEnd)};this.transition.start(h),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return r=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t?.(r)}}};function _r(e,t){if(!e)throw new Error(t||\"deck.gl: assertion failed.\")}var gb=class{constructor(t){let{compare:r,extract:i,required:n}=t;this._propsToCompare=r,this._propsToExtract=i||r,this._requiredProps=n}arePropsEqual(t,r){for(let i of this._propsToCompare)if(!(i in t)||!(i in r)||!$s(t[i],r[i]))return!1;return!0}initializeProps(t,r){let i={},n={};for(let o of this._propsToExtract)(o in t||o in r)&&(i[o]=t[o],n[o]=r[o]);return this._checkRequiredProps(i),this._checkRequiredProps(n),{start:i,end:n}}getDuration(t,r){return r.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach(r=>{let i=t[r];_r(Number.isFinite(i)||Array.isArray(i),`${r} is required for transition`)})}};var cL=Math.PI/180,Smt=180/Math.PI,uL=6370972,B3=256;function yjt(){let e=B3/uL,t=Math.PI/180*B3;return{unitsPerMeter:[e,e,e],unitsPerMeter2:[0,0,0],metersPerUnit:[1/e,1/e,1/e],unitsPerDegree:[t,t,e],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,1/e]}}var hL=class extends Dd{constructor(t={}){let{longitude:r=0,zoom:i=0,nearZMultiplier:n=.5,farZMultiplier:o=1,resolution:s=10}=t,{latitude:a=0,height:h,altitude:p=1.5,fovy:g}=t;a=Math.max(Math.min(a,wu),-wu),h=h||1,g?p=Lg(g):g=Og(p);let w=Math.pow(2,i-Ab(a)),C=t.nearZ??n,R=t.farZ??(p+B3*2*w/h)*o,z=new Ji().lookAt({eye:[0,-p,0],up:[0,0,1]});z.rotateX(a*cL),z.rotateZ(-r*cL),z.scale(w/h),super({...t,height:h,viewMatrix:z,longitude:r,latitude:a,zoom:i,distanceScales:yjt(),fovy:g,focalDistance:p,near:C,far:R}),this.scale=w,this.latitude=a,this.longitude=r,this.fovy=g,this.resolution=s}get projectionMode(){return Pa.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(t={}){let r={targetZ:t.z||0},i=this.unproject([0,this.height/2],r),n=this.unproject([this.width/2,0],r),o=this.unproject([this.width,this.height/2],r),s=this.unproject([this.width/2,this.height],r);return o[0]<this.longitude&&(o[0]+=360),i[0]>this.longitude&&(i[0]-=360),[Math.min(i[0],o[0],n[0],s[0]),Math.min(i[1],o[1],n[1],s[1]),Math.max(i[0],o[0],n[0],s[0]),Math.max(i[1],o[1],n[1],s[1])]}unproject(t,{topLeft:r=!0,targetZ:i}={}){let[n,o,s]=t,a=r?o:this.height-o,{pixelUnprojectionMatrix:h}=this,p;if(Number.isFinite(s))p=XY(h,[n,a,s,1]);else{let R=XY(h,[n,a,-1,1]),z=XY(h,[n,a,1,1]),W=((i||0)/uL+1)*B3,Y=Cl.sqrLen(Cl.sub([],R,z)),H=Cl.sqrLen(R),Q=Cl.sqrLen(z),rt=4*((4*H*Q-(Y-H-Q)**2)/16)/Y,at=Math.sqrt(H-rt),et=Math.sqrt(Math.max(0,W*W-rt)),lt=(at-et)/Math.sqrt(Y);p=Cl.lerp([],R,z,lt)}let[g,w,C]=this.unprojectPosition(p);return Number.isFinite(s)?[g,w,C]:Number.isFinite(i)?[g,w,i]:[g,w]}projectPosition(t){let[r,i,n=0]=t,o=r*cL,s=i*cL,a=Math.cos(s),h=(n/uL+1)*B3;return[Math.sin(o)*a*h,-Math.cos(o)*a*h,Math.sin(s)*h]}unprojectPosition(t){let[r,i,n]=t,o=Cl.len(t),s=Math.asin(n/o),h=Math.atan2(r,-i)*Smt,p=s*Smt,g=(o/B3-1)*uL;return[h,p,g]}projectFlat(t){return t}unprojectFlat(t){return t}panByPosition([t,r,i],n,o){let a=.25/Math.pow(2,this.zoom-Ab(this.latitude)),h=t+a*(o[0]-n[0]),p=r-a*(o[1]-n[1]);p=Math.max(Math.min(p,wu),-wu);let g={longitude:h,latitude:p,zoom:i-Ab(r)};return g.zoom+=Ab(g.latitude),g}};hL.displayName=\"GlobeViewport\";var qf=hL;function Ab(e){let t=Math.PI*Math.cos(e*Math.PI/180);return Math.log2(t)}function XY(e,t){let r=xu.transformMat4([],t,e);return xu.scale(r,r,1/r[3]),r}var _jt=[\"longitude\",\"latitude\",\"zoom\",\"bearing\",\"pitch\"],vjt=[\"longitude\",\"latitude\",\"zoom\"],el=class extends gb{constructor(t={}){let r=Array.isArray(t)?t:t.transitionProps,i=Array.isArray(t)?{}:t;i.transitionProps=Array.isArray(r)?{compare:r,required:r}:r||{compare:_jt,required:vjt},super(i.transitionProps),this.opts=i}initializeProps(t,r){let i=super.initializeProps(t,r),{makeViewport:n,around:o}=this.opts;if(n&&o)if(n(t)instanceof qf)hr.warn(\"around not supported in GlobeView\")();else{let a=n(t),h=n(r),p=a.unproject(o);i.start.around=o,Object.assign(i.end,{around:h.project(p),aroundPosition:p,width:r.width,height:r.height})}return i}interpolateProps(t,r,i){let n={};for(let o of this._propsToExtract)n[o]=rc(t[o]||0,r[o]||0,i);if(r.aroundPosition&&this.opts.makeViewport){let o=this.opts.makeViewport({...r,...n});Object.assign(n,o.panByPosition(r.aroundPosition,rc(t.around,r.around,i)))}return n}};var zg={transitionDuration:0},bjt=300,dL=e=>1-(1-e)*(1-e),F3={WHEEL:[\"wheel\"],PAN:[\"panstart\",\"panmove\",\"panend\"],PINCH:[\"pinchstart\",\"pinchmove\",\"pinchend\"],MULTI_PAN:[\"multipanstart\",\"multipanmove\",\"multipanend\"],DOUBLE_CLICK:[\"dblclick\"],KEYBOARD:[\"keydown\"]},yb={},vh=class{constructor(t){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode=\"rotate\",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new fP({...t,getControllerState:r=>new this.ControllerState(r),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(let t in this._events)this._events[t]&&this.eventManager?.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;let r=this._eventStartBlocked;switch(t.type){case\"panstart\":return r?!1:this._onPanStart(t);case\"panmove\":return this._onPan(t);case\"panend\":return this._onPanEnd(t);case\"pinchstart\":return r?!1:this._onPinchStart(t);case\"pinchmove\":return this._onPinch(t);case\"pinchend\":return this._onPinchEnd(t);case\"multipanstart\":return r?!1:this._onMultiPanStart(t);case\"multipanmove\":return this._onMultiPan(t);case\"multipanend\":return this._onMultiPanEnd(t);case\"dblclick\":return this._onDoubleClick(t);case\"wheel\":return this._onWheel(t);case\"keydown\":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){let{x:r,y:i}=this.props,{offsetCenter:n}=t;return[n.x-r,n.y-i]}isPointInBounds(t,r){let{width:i,height:n}=this.props;if(r&&r.handled)return!1;let o=t[0]>=0&&t[0]<=i&&t[1]>=0&&t[1]<=n;return o&&r&&r.stopPropagation(),o}isFunctionKeyPressed(t){let{srcEvent:r}=t;return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){let r=setTimeout(()=>{this._eventStartBlocked===r&&(this._eventStartBlocked=null)},t);this._eventStartBlocked=r}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,\"transitionInterpolator\"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);let{inertia:r}=t;this.inertia=Number.isFinite(r)?r:r===!0?bjt:0;let{scrollZoom:i=!0,dragPan:n=!0,dragRotate:o=!0,doubleClickZoom:s=!0,touchZoom:a=!0,touchRotate:h=!1,keyboard:p=!0}=t,g=!!this.onViewStateChange;this.toggleEvents(F3.WHEEL,g&&i),this.toggleEvents(F3.PAN,g),this.toggleEvents(F3.PINCH,g&&(a||h)),this.toggleEvents(F3.MULTI_PAN,g&&h),this.toggleEvents(F3.DOUBLE_CLICK,g&&s),this.toggleEvents(F3.KEYBOARD,g&&p),this.scrollZoom=i,this.dragPan=n,this.dragRotate=o,this.doubleClickZoom=s,this.touchZoom=a,this.touchRotate=h,this.keyboard=p}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,r){this.eventManager&&t.forEach(i=>{this._events[i]!==r&&(this._events[i]=r,r?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(t,r=null,i={}){let n={...t.getViewportProps(),...r},o=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(i),o){let s=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:s,viewId:this.props.id})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){let r=this.getCenter(t);if(!this.isPointInBounds(r,t))return!1;let i=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||this.dragMode===\"pan\")&&(i=!i);let n=this.controllerState[i?\"panStart\":\"rotateStart\"]({pos:r});return this._panMove=i,this.updateViewport(n,zg,{isDragging:!0}),!0}_onPan(t){return this.isDragging()?this._panMove?this._onPanMove(t):this._onPanRotate(t):!1}_onPanEnd(t){return this.isDragging()?this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t):!1}_onPanMove(t){if(!this.dragPan)return!1;let r=this.getCenter(t),i=this.controllerState.pan({pos:r});return this.updateViewport(i,zg,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){let{inertia:r}=this;if(this.dragPan&&r&&t.velocity){let i=this.getCenter(t),n=[i[0]+t.velocityX*r/2,i[1]+t.velocityY*r/2],o=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(o,{...this._getTransitionProps(),transitionDuration:r,transitionEasing:dL},{isDragging:!1,isPanning:!0})}else{let i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;let r=this.getCenter(t),i=this.controllerState.rotate({pos:r});return this.updateViewport(i,zg,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){let{inertia:r}=this;if(this.dragRotate&&r&&t.velocity){let i=this.getCenter(t),n=[i[0]+t.velocityX*r/2,i[1]+t.velocityY*r/2],o=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(o,{...this._getTransitionProps(),transitionDuration:r,transitionEasing:dL},{isDragging:!1,isRotating:!0})}else{let i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;let r=this.getCenter(t);if(!this.isPointInBounds(r,t))return!1;t.srcEvent.preventDefault();let{speed:i=.01,smooth:n=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:o}=t,s=2/(1+Math.exp(-Math.abs(o*i)));o<0&&s!==0&&(s=1/s);let a=n?{...this._getTransitionProps({around:r}),transitionDuration:250}:zg,h=this.controllerState.zoom({pos:r,scale:s});return this.updateViewport(h,a,{isZooming:!0,isPanning:!0}),n||this._setInteractionState({isZooming:!1,isPanning:!1}),!0}_onMultiPanStart(t){let r=this.getCenter(t);if(!this.isPointInBounds(r,t))return!1;let i=this.controllerState.rotateStart({pos:r});return this.updateViewport(i,zg,{isDragging:!0}),!0}_onMultiPan(t){if(!this.touchRotate||!this.isDragging())return!1;let r=this.getCenter(t);r[0]-=t.deltaX;let i=this.controllerState.rotate({pos:r});return this.updateViewport(i,zg,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(t){if(!this.isDragging())return!1;let{inertia:r}=this;if(this.touchRotate&&r&&t.velocityY){let i=this.getCenter(t),n=[i[0],i[1]+=t.velocityY*r/2],o=this.controllerState.rotate({pos:n});this.updateViewport(o,{...this._getTransitionProps(),transitionDuration:r,transitionEasing:dL},{isDragging:!1,isRotating:!0}),this.blockEvents(r)}else{let i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){let r=this.getCenter(t);if(!this.isPointInBounds(r,t))return!1;let i=this.controllerState.zoomStart({pos:r}).rotateStart({pos:r});return yb._startPinchRotation=t.rotation,yb._lastPinchEvent=t,this.updateViewport(i,zg,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let r=this.controllerState;if(this.touchZoom){let{scale:i}=t,n=this.getCenter(t);r=r.zoom({pos:n,scale:i})}if(this.touchRotate){let{rotation:i}=t;r=r.rotate({deltaAngleX:yb._startPinchRotation-i})}return this.updateViewport(r,zg,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),yb._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;let{inertia:r}=this,{_lastPinchEvent:i}=yb;if(this.touchZoom&&r&&i&&t.scale!==i.scale){let n=this.getCenter(t),o=this.controllerState.rotateEnd(),s=Math.log2(t.scale),a=(s-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),h=Math.pow(2,s+a*r/2);o=o.zoom({pos:n,scale:h}).zoomEnd(),this.updateViewport(o,{...this._getTransitionProps({around:n}),transitionDuration:r,transitionEasing:dL},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(r)}else{let n=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(n,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return yb._startPinchRotation=null,yb._lastPinchEvent=null,!0}_onDoubleClick(t){if(!this.doubleClickZoom)return!1;let r=this.getCenter(t);if(!this.isPointInBounds(r,t))return!1;let i=this.isFunctionKeyPressed(t),n=this.controllerState.zoom({pos:r,scale:i?.5:2});return this.updateViewport(n,this._getTransitionProps({around:r}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;let r=this.isFunctionKeyPressed(t),{zoomSpeed:i,moveSpeed:n,rotateSpeedX:o,rotateSpeedY:s}=this.keyboard===!0?{}:this.keyboard,{controllerState:a}=this,h,p={};switch(t.srcEvent.code){case\"Minus\":h=r?a.zoomOut(i).zoomOut(i):a.zoomOut(i),p.isZooming=!0;break;case\"Equal\":h=r?a.zoomIn(i).zoomIn(i):a.zoomIn(i),p.isZooming=!0;break;case\"ArrowLeft\":r?(h=a.rotateLeft(o),p.isRotating=!0):(h=a.moveLeft(n),p.isPanning=!0);break;case\"ArrowRight\":r?(h=a.rotateRight(o),p.isRotating=!0):(h=a.moveRight(n),p.isPanning=!0);break;case\"ArrowUp\":r?(h=a.rotateUp(s),p.isRotating=!0):(h=a.moveUp(n),p.isPanning=!0);break;case\"ArrowDown\":r?(h=a.rotateDown(s),p.isRotating=!0):(h=a.moveDown(n),p.isPanning=!0);break;default:return!1}return this.updateViewport(h,this._getTransitionProps(),p),!0}_getTransitionProps(t){let{transition:r}=this;return!r||!r.transitionInterpolator?zg:t?{...r,transitionInterpolator:new el({...t,...r.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:r}};var Ug=class{constructor(t,r){this._viewportProps=this.applyConstraints(t),this._state=r}getViewportProps(){return this._viewportProps}getState(){return this._state}};var Mmt=5,xjt=1.2,pP=class extends Ug{constructor(t){let{width:r,height:i,latitude:n,longitude:o,zoom:s,bearing:a=0,pitch:h=0,altitude:p=1.5,position:g=[0,0,0],maxZoom:w=20,minZoom:C=0,maxPitch:R=60,minPitch:z=0,startPanLngLat:W,startZoomLngLat:Y,startRotatePos:H,startBearing:Q,startPitch:tt,startZoom:rt,normalize:at=!0}=t;_r(Number.isFinite(o)),_r(Number.isFinite(n)),_r(Number.isFinite(s)),super({width:r,height:i,latitude:n,longitude:o,zoom:s,bearing:a,pitch:h,altitude:p,maxZoom:w,minZoom:C,maxPitch:R,minPitch:z,normalize:at,position:g},{startPanLngLat:W,startZoomLngLat:Y,startRotatePos:H,startBearing:Q,startPitch:tt,startZoom:rt}),this.makeViewport=t.makeViewport}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:r}){let i=this.getState().startPanLngLat||this._unproject(r);if(!i)return this;let o=this.makeViewport(this.getViewportProps()).panByPosition(i,t);return this._getUpdatedState(o)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:t,deltaAngleX:r=0,deltaAngleY:i=0}){let{startRotatePos:n,startBearing:o,startPitch:s}=this.getState();if(!n||o===void 0||s===void 0)return this;let a;return t?a=this._getNewRotation(t,n,s,o):a={bearing:o+r,pitch:s+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this.getViewportProps().zoom})}zoom({pos:t,startPos:r,scale:i}){let{startZoom:n,startZoomLngLat:o}=this.getState();if(o||(n=this.getViewportProps().zoom,o=this._unproject(r)||this._unproject(t)),!o)return this;let{maxZoom:s,minZoom:a}=this.getViewportProps(),h=n+Math.log2(i);h=_n(h,a,s);let p=this.makeViewport({...this.getViewportProps(),zoom:h});return this._getUpdatedState({zoom:h,...p.panByPosition(o,t)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){let r=t.getViewportProps(),i={...this.getViewportProps()},{bearing:n,longitude:o}=i;return Math.abs(n-r.bearing)>180&&(i.bearing=n<0?n+360:n-360),Math.abs(o-r.longitude)>180&&(i.longitude=o<0?o+360:o-360),i}applyConstraints(t){let{maxZoom:r,minZoom:i,zoom:n}=t;t.zoom=_n(n,i,r);let{maxPitch:o,minPitch:s,pitch:a}=t;t.pitch=_n(a,s,o);let{normalize:h=!0}=t;return h&&Object.assign(t,BY(t)),t}_zoomFromCenter(t){let{width:r,height:i}=this.getViewportProps();return this.zoom({pos:[r/2,i/2],scale:t})}_panFromCenter(t){let{width:r,height:i}=this.getViewportProps();return this.pan({startPos:[r/2,i/2],pos:[r/2+t[0],i/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){let r=this.makeViewport(this.getViewportProps());return t&&r.unproject(t)}_getNewRotation(t,r,i,n){let o=t[0]-r[0],s=t[1]-r[1],a=t[1],h=r[1],{width:p,height:g}=this.getViewportProps(),w=o/p,C=0;s>0?Math.abs(g-h)>Mmt&&(C=s/(h-g)*xjt):s<0&&h>Mmt&&(C=1-a/h),C=_n(C,-1,1);let{minPitch:R,maxPitch:z}=this.getViewportProps(),W=n+180*w,Y=i;return C>0?Y=i+C*(z-i):C<0&&(Y=i-C*(R-i)),{pitch:Y,bearing:W}}},mP=class extends vh{constructor(){super(...arguments),this.ControllerState=pP,this.transition={transitionDuration:300,transitionInterpolator:new el({transitionProps:{compare:[\"longitude\",\"latitude\",\"zoom\",\"bearing\",\"pitch\",\"position\"],required:[\"longitude\",\"latitude\",\"zoom\"]}})},this.dragMode=\"pan\"}setProps(t){t.position=t.position||[0,0,0];let r=this.props;super.setProps(t),(!r||r.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}};var fL=class extends Ws{constructor(t={}){super(t)}getViewportType(){return _h}get ControllerType(){return mP}};fL.displayName=\"MapView\";var g1=fL;var wjt=new C3;function Tjt(e,t){let r=e.order??1/0,i=t.order??1/0;return r-i}var gP=class{constructor(t){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=t,this._needsRedraw=\"Initial render\",this._setEffects([])}addDefaultEffect(t){let r=this._defaultEffects;if(!r.find(i=>i.id===t.id)){let i=r.findIndex(n=>Tjt(n,t)>0);i<0?r.push(t):r.splice(i,0,t),t.setup(this._context),this._setEffects(this.effects)}}setProps(t){\"effects\"in t&&(to(t.effects,this.effects,1)||this._setEffects(t.effects))}needsRedraw(t={clearRedrawFlags:!1}){let r=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),r}getEffects(){return this._resolvedEffects}_setEffects(t){let r={};for(let n of this.effects)r[n.id]=n;let i=[];for(let n of t){let o=r[n.id],s=n;o&&o!==n?o.setProps?(o.setProps(n.props),s=o):o.cleanup(this._context):o||n.setup(this._context),i.push(s),delete r[n.id]}for(let n in r)r[n].cleanup(this._context);this.effects=i,this._resolvedEffects=i.concat(this._defaultEffects),t.some(n=>n instanceof C3)||this._resolvedEffects.push(wjt),this._needsRedraw=\"effects changed\"}finalize(){for(let t of this._resolvedEffects)t.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}};var AP=class extends Rd{shouldDrawLayer(t){let{operation:r}=t.props;return r.includes(\"draw\")||r.includes(\"terrain\")}};var Sjt=\"deckRenderer.renderLayers\",yP=class{constructor(t){this.device=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new AP(t),this.pickLayersPass=new mb(t),this.renderCount=0,this._needsRedraw=\"Initial render\",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw=\"layerFilter changed\"),this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw=\"drawPickingColors changed\")}renderLayers(t){if(!t.viewports.length)return;let r=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,i={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...t};i.effects&&this._preRender(i.effects,i);let n=this.lastPostProcessEffect?this.renderBuffers[0]:i.target;this.lastPostProcessEffect&&(i.clearColor=[0,0,0,0],i.clearCanvas=!0);let o=r.render({...i,target:n});i.effects&&(this.lastPostProcessEffect&&(i.clearCanvas=t.clearCanvas===void 0?!0:t.clearCanvas),this._postRender(i.effects,i)),this.renderCount++,ys(Sjt,this,o,t)}needsRedraw(t={clearRedrawFlags:!1}){let r=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),r}finalize(){let{renderBuffers:t}=this;for(let r of t)r.delete();t.length=0}_preRender(t,r){this.lastPostProcessEffect=null,r.preRenderStats=r.preRenderStats||{};for(let i of t)r.preRenderStats[i.id]=i.preRender(r),i.postRender&&(this.lastPostProcessEffect=i.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){let{renderBuffers:t}=this,r=this.device.canvasContext.getDrawingBufferSize(),[i,n]=r;t.length===0&&[0,1].map(o=>{let s=this.device.createTexture({sampler:{minFilter:\"linear\",magFilter:\"linear\"},width:i,height:n});t.push(this.device.createFramebuffer({id:`deck-renderbuffer-${o}`,colorAttachments:[s]}))});for(let o of t)o.resize(r)}_postRender(t,r){let{renderBuffers:i}=this,n={...r,inputBuffer:i[0],swapBuffer:i[1]};for(let o of t)if(o.postRender){n.target=o.id===this.lastPostProcessEffect?r.target:void 0;let s=o.postRender(n);n.inputBuffer=s,n.swapBuffer=s===i[0]?i[1]:i[0]}}};var Mjt={pickedColor:null,pickedObjectIndex:-1};function ZY({pickedColors:e,decodePickingColor:t,deviceX:r,deviceY:i,deviceRadius:n,deviceRect:o}){let{x:s,y:a,width:h,height:p}=o,g=n*n,w=-1,C=0;for(let R=0;R<p;R++){let z=R+a-i,W=z*z;if(W>g)C+=4*h;else for(let Y=0;Y<h;Y++){if(e[C+3]-1>=0){let Q=Y+s-r,tt=Q*Q+W;tt<=g&&(g=tt,w=C)}C+=4}}if(w>=0){let R=e.slice(w,w+4),z=t(R);if(z){let W=Math.floor(w/4/h),Y=w/4-W*h;return{...z,pickedColor:R,pickedX:s+Y,pickedY:a+W}}hr.error(\"Picked non-existent layer. Is picking buffer corrupt?\")()}return Mjt}function KY({pickedColors:e,decodePickingColor:t}){let r=new Map;if(e){for(let i=0;i<e.length;i+=4)if(e[i+3]-1>=0){let o=e.slice(i,i+4),s=o.join(\",\");if(!r.has(s)){let a=t(o);a?r.set(s,{...a,color:o}):hr.error(\"Picked non-existent layer. Is picking buffer corrupt?\")()}}}return Array.from(r.values())}function pL({pickInfo:e,viewports:t,pixelRatio:r,x:i,y:n,z:o}){let s=t[0];t.length>1&&(s=Ejt(e?.pickedViewports||t,{x:i,y:n}));let a;if(s){let h=[i-s.x,n-s.y];o!==void 0&&(h[2]=o),a=s.unproject(h)}return{color:null,layer:null,viewport:s,index:-1,picked:!1,x:i,y:n,pixel:[i,n],coordinate:a,devicePixel:e&&\"pickedX\"in e?[e.pickedX,e.pickedY]:void 0,pixelRatio:r}}function QY(e){let{pickInfo:t,lastPickedInfo:r,mode:i,layers:n}=e,{pickedColor:o,pickedLayer:s,pickedObjectIndex:a}=t,h=s?[s]:[];if(i===\"hover\"){let w=r.index,C=r.layerId,R=s?s.props.id:null;if(R!==C||a!==w){if(R!==C){let z=n.find(W=>W.props.id===C);z&&h.unshift(z)}r.layerId=R,r.index=a,r.info=null}}let p=pL(e),g=new Map;return g.set(null,p),h.forEach(w=>{let C={...p};w===s&&(C.color=o,C.index=a,C.picked=!0),C=mL({layer:w,info:C,mode:i});let R=C.layer;w===s&&i===\"hover\"&&(r.info=C),g.set(R.id,C),i===\"hover\"&&R.updateAutoHighlight(C)}),g}function mL({layer:e,info:t,mode:r}){for(;e&&t;){let i=t.layer||null;t.sourceLayer=i,t.layer=e,t=e.getPickingInfo({info:t,mode:r,sourceLayer:i}),e=e.parent}return t}function Ejt(e,t){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.containsPixel(t))return i}return e[0]}var _P=class{constructor(t){this._pickable=!0,this.device=t,this.pickLayersPass=new mb(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){\"layerFilter\"in t&&(this.layerFilter=t.layerFilter),\"_pickable\"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObjectAsync(t){return this._pickClosestObjectAsync(t)}pickObjectsAsync(t){return this._pickVisibleObjectsAsync(t)}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:r,layers:i,viewports:n},o=this.lastPickedInfo.info){let s=o&&o.layer&&o.layer.id,a=o&&o.viewport&&o.viewport.id,h=s?i.find(C=>C.id===s):null,p=a&&n.find(C=>C.id===a)||n[0],g=p&&p.unproject([t-p.x,r-p.y]);return{...o,...{x:t,y:r,viewport:p,coordinate:g,layer:h}}}_resizeBuffer(){if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:[\"rgba8unorm\"],depthStencilAttachment:\"depth16unorm\"}),this.device.isTextureFormatRenderable(\"rgba32float\"))){let r=this.device.createFramebuffer({colorAttachments:[\"rgba32float\"],depthStencilAttachment:\"depth16unorm\"});this.depthFBO=r}let{canvas:t}=this.device.getDefaultCanvasContext();this.pickingFBO?.resize({width:t.width,height:t.height}),this.depthFBO?.resize({width:t.width,height:t.height})}_getPickable(t){if(this._pickable===!1)return null;let r=t.filter(i=>this.pickLayersPass.shouldDrawLayer(i)&&!i.isComposite);return r.length?r:null}async _pickClosestObjectAsync({layers:t,views:r,viewports:i,x:n,y:o,radius:s=0,depth:a=1,mode:h=\"query\",unproject3D:p,onViewportActive:g,effects:w}){let C=this.device.canvasContext.cssToDeviceRatio(),R=this._getPickable(t);if(!R||i.length===0)return{result:[],emptyInfo:pL({viewports:i,x:n,y:o,pixelRatio:C})};this._resizeBuffer();let z=this.device.canvasContext.cssToDevicePixels([n,o],!0),W=[z.x+Math.floor(z.width/2),z.y+Math.floor(z.height/2)],Y=Math.round(s*C),{width:H,height:Q}=this.pickingFBO,tt=this._getPickingRect({deviceX:W[0],deviceY:W[1],deviceRadius:Y,deviceWidth:H,deviceHeight:Q}),rt={x:n-s,y:o-s,width:s*2+1,height:s*2+1},at,et=[],lt=new Set;for(let J=0;J<a;J++){let ft;if(tt){let Mt=this._drawAndSample({layers:R,views:r,viewports:i,onViewportActive:g,deviceRect:tt,cullRect:rt,effects:w,pass:`picking:${h}`});ft=ZY({...Mt,deviceX:W[0],deviceY:W[1],deviceRadius:Y,deviceRect:tt})}else ft={pickedColor:null,pickedObjectIndex:-1};let dt;if(ft.pickedLayer&&p&&this.depthFBO){let{pickedColors:Mt}=this._drawAndSample({layers:[ft.pickedLayer],views:r,viewports:i,onViewportActive:g,deviceRect:{x:ft.pickedX,y:ft.pickedY,width:1,height:1},cullRect:rt,effects:w,pass:`picking:${h}:z`},!0);Mt[3]&&(dt=Mt[0])}ft.pickedLayer&&J+1<a&&(lt.add(ft.pickedLayer),ft.pickedLayer.disablePickingIndex(ft.pickedObjectIndex)),at=QY({pickInfo:ft,lastPickedInfo:this.lastPickedInfo,mode:h,layers:R,viewports:i,x:n,y:o,z:dt,pixelRatio:C});for(let Mt of at.values())Mt.layer&&et.push(Mt);if(!ft.pickedColor)break}for(let J of lt)J.restorePickingColors();return{result:et,emptyInfo:at.get(null)}}_pickClosestObject({layers:t,views:r,viewports:i,x:n,y:o,radius:s=0,depth:a=1,mode:h=\"query\",unproject3D:p,onViewportActive:g,effects:w}){let C=this.device.canvasContext.cssToDeviceRatio(),R=this._getPickable(t);if(!R||i.length===0)return{result:[],emptyInfo:pL({viewports:i,x:n,y:o,pixelRatio:C})};this._resizeBuffer();let z=this.device.canvasContext.cssToDevicePixels([n,o],!0),W=[z.x+Math.floor(z.width/2),z.y+Math.floor(z.height/2)],Y=Math.round(s*C),{width:H,height:Q}=this.pickingFBO,tt=this._getPickingRect({deviceX:W[0],deviceY:W[1],deviceRadius:Y,deviceWidth:H,deviceHeight:Q}),rt={x:n-s,y:o-s,width:s*2+1,height:s*2+1},at,et=[],lt=new Set;for(let J=0;J<a;J++){let ft;if(tt){let Mt=this._drawAndSample({layers:R,views:r,viewports:i,onViewportActive:g,deviceRect:tt,cullRect:rt,effects:w,pass:`picking:${h}`});ft=ZY({...Mt,deviceX:W[0],deviceY:W[1],deviceRadius:Y,deviceRect:tt})}else ft={pickedColor:null,pickedObjectIndex:-1};let dt;if(ft.pickedLayer&&p&&this.depthFBO){let{pickedColors:Mt}=this._drawAndSample({layers:[ft.pickedLayer],views:r,viewports:i,onViewportActive:g,deviceRect:{x:ft.pickedX,y:ft.pickedY,width:1,height:1},cullRect:rt,effects:w,pass:`picking:${h}:z`},!0);Mt[3]&&(dt=Mt[0])}ft.pickedLayer&&J+1<a&&(lt.add(ft.pickedLayer),ft.pickedLayer.disablePickingIndex(ft.pickedObjectIndex)),at=QY({pickInfo:ft,lastPickedInfo:this.lastPickedInfo,mode:h,layers:R,viewports:i,x:n,y:o,z:dt,pixelRatio:C});for(let Mt of at.values())Mt.layer&&et.push(Mt);if(!ft.pickedColor)break}for(let J of lt)J.restorePickingColors();return{result:et,emptyInfo:at.get(null)}}async _pickVisibleObjectsAsync({layers:t,views:r,viewports:i,x:n,y:o,width:s=1,height:a=1,mode:h=\"query\",maxObjects:p=null,onViewportActive:g,effects:w}){let C=this._getPickable(t);if(!C||i.length===0)return[];this._resizeBuffer();let R=this.device.canvasContext.cssToDeviceRatio(),z=this.device.canvasContext.cssToDevicePixels([n,o],!0),W=z.x,Y=z.y+z.height,H=this.device.canvasContext.cssToDevicePixels([n+s,o+a],!0),Q=H.x+H.width,tt=H.y,rt={x:W,y:tt,width:Q-W,height:Y-tt},at=this._drawAndSample({layers:C,views:r,viewports:i,onViewportActive:g,deviceRect:rt,cullRect:{x:n,y:o,width:s,height:a},effects:w,pass:`picking:${h}`}),et=KY(at),lt=new Map,J=[],ft=Number.isFinite(p);for(let dt=0;dt<et.length&&!(ft&&J.length>=p);dt++){let Mt=et[dt],Ft={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:n,y:o,pixelRatio:R};Ft=mL({layer:Mt.pickedLayer,info:Ft,mode:h});let Nt=Ft.layer.id;lt.has(Nt)||lt.set(Nt,new Set);let $t=lt.get(Nt),Yt=Ft.object??Ft.index;$t.has(Yt)||($t.add(Yt),J.push(Ft))}return J}_pickVisibleObjects({layers:t,views:r,viewports:i,x:n,y:o,width:s=1,height:a=1,mode:h=\"query\",maxObjects:p=null,onViewportActive:g,effects:w}){let C=this._getPickable(t);if(!C||i.length===0)return[];this._resizeBuffer();let R=this.device.canvasContext.cssToDeviceRatio(),z=this.device.canvasContext.cssToDevicePixels([n,o],!0),W=z.x,Y=z.y+z.height,H=this.device.canvasContext.cssToDevicePixels([n+s,o+a],!0),Q=H.x+H.width,tt=H.y,rt={x:W,y:tt,width:Q-W,height:Y-tt},at=this._drawAndSample({layers:C,views:r,viewports:i,onViewportActive:g,deviceRect:rt,cullRect:{x:n,y:o,width:s,height:a},effects:w,pass:`picking:${h}`}),et=KY(at),lt=new Map,J=[],ft=Number.isFinite(p);for(let dt=0;dt<et.length&&!(ft&&J.length>=p);dt++){let Mt=et[dt],Ft={color:Mt.pickedColor,layer:null,index:Mt.pickedObjectIndex,picked:!0,x:n,y:o,pixelRatio:R};Ft=mL({layer:Mt.pickedLayer,info:Ft,mode:h});let Nt=Ft.layer.id;lt.has(Nt)||lt.set(Nt,new Set);let $t=lt.get(Nt),Yt=Ft.object??Ft.index;$t.has(Yt)||($t.add(Yt),J.push(Ft))}return J}async _drawAndSampleAsync({layers:t,views:r,viewports:i,onViewportActive:n,deviceRect:o,cullRect:s,effects:a,pass:h},p=!1){let g=p?this.depthFBO:this.pickingFBO,w={layers:t,layerFilter:this.layerFilter,views:r,viewports:i,onViewportActive:n,pickingFBO:g,deviceRect:o,cullRect:s,effects:a,pass:h,pickZ:p,preRenderStats:{},isPicking:!0};for(let Q of a)Q.useInPicking&&(w.preRenderStats[Q.id]=Q.preRender(w));let{decodePickingColor:C}=this.pickLayersPass.render(w),{x:R,y:z,width:W,height:Y}=o,H=new(p?Float32Array:Uint8Array)(W*Y*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:R,sourceY:z,sourceWidth:W,sourceHeight:Y,target:H}),{pickedColors:H,decodePickingColor:C}}_drawAndSample({layers:t,views:r,viewports:i,onViewportActive:n,deviceRect:o,cullRect:s,effects:a,pass:h},p=!1){let g=p?this.depthFBO:this.pickingFBO,w={layers:t,layerFilter:this.layerFilter,views:r,viewports:i,onViewportActive:n,pickingFBO:g,deviceRect:o,cullRect:s,effects:a,pass:h,pickZ:p,preRenderStats:{},isPicking:!0};for(let Q of a)Q.useInPicking&&(w.preRenderStats[Q.id]=Q.preRender(w));let{decodePickingColor:C}=this.pickLayersPass.render(w),{x:R,y:z,width:W,height:Y}=o,H=new(p?Float32Array:Uint8Array)(W*Y*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:R,sourceY:z,sourceWidth:W,sourceHeight:Y,target:H}),{pickedColors:H,decodePickingColor:C}}_getPickingRect({deviceX:t,deviceY:r,deviceRadius:i,deviceWidth:n,deviceHeight:o}){let s=Math.max(0,t-i),a=Math.max(0,r-i),h=Math.min(n,t+i+1)-s,p=Math.min(o,r+i+1)-a;return h<=0||p<=0?null:{x:s,y:a,width:h,height:p}}};var Pjt={\"top-left\":{top:0,left:0},\"top-right\":{top:0,right:0},\"bottom-left\":{bottom:0,left:0},\"bottom-right\":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},Cjt=\"top-left\",Emt=\"root\",gL=class{constructor({deck:t,parentElement:r}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=t,r?.classList.add(\"deck-widget-container\"),this.parentElement=r}getWidgets(){return this.resolvedWidgets}setProps(t){if(t.widgets&&!to(t.widgets,this.widgets,1)){let r=t.widgets.filter(Boolean);this._setWidgets(r)}}finalize(){for(let t of this.getWidgets())this._removeWidget(t);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(let t in this.containers)this.containers[t].remove()}addDefault(t){this.defaultWidgets.find(r=>r.id===t.id)||(this._addWidget(t),this.defaultWidgets.push(t),this._setWidgets(this.widgets))}onRedraw({viewports:t,layers:r}){let i=t.reduce((n,o)=>(n[o.id]=o,n),{});for(let n of this.getWidgets()){let{viewId:o}=n;if(o){let s=i[o];s&&(n.onViewportChange&&n.onViewportChange(s),n.onRedraw?.({viewports:[s],layers:r}))}else{if(n.onViewportChange)for(let s of t)n.onViewportChange(s);n.onRedraw?.({viewports:t,layers:r})}}this.lastViewports=i,this._updateContainers()}onHover(t,r){for(let i of this.getWidgets()){let{viewId:n}=i;(!n||n===t.viewport?.id)&&i.onHover?.(t,r)}}onEvent(t,r){let i=JE[r.type];if(i)for(let n of this.getWidgets()){let{viewId:o}=n;(!o||o===t.viewport?.id)&&n[i]?.(t,r)}}_setWidgets(t){let r={};for(let i of this.resolvedWidgets)r[i.id]=i;this.resolvedWidgets.length=0;for(let i of this.defaultWidgets)r[i.id]=null,this.resolvedWidgets.push(i);for(let i of t){let n=r[i.id];n?n.viewId!==i.viewId||n.placement!==i.placement?(this._removeWidget(n),this._addWidget(i)):i!==n&&(n.setProps(i.props),i=n):this._addWidget(i),r[i.id]=null,this.resolvedWidgets.push(i)}for(let i in r){let n=r[i];n&&this._removeWidget(n)}this.widgets=t}_addWidget(t){let{viewId:r=null,placement:i=Cjt}=t,n=t.props._container??r;t.widgetManager=this,t.deck=this.deck,t.rootElement=t._onAdd({deck:this.deck,viewId:r}),t.rootElement&&this._getContainer(n,i).append(t.rootElement),t.updateHTML()}_removeWidget(t){t.onRemove?.(),t.rootElement&&t.rootElement.remove(),t.rootElement=void 0,t.deck=void 0,t.widgetManager=void 0}_getContainer(t,r){if(t&&typeof t!=\"string\")return t;let i=t||Emt,n=this.containers[i];n||(n=document.createElement(\"div\"),n.style.pointerEvents=\"none\",n.style.position=\"absolute\",n.style.overflow=\"hidden\",this.parentElement?.append(n),this.containers[i]=n);let o=n.querySelector(`.${r}`);return o||(o=globalThis.document.createElement(\"div\"),o.className=r,o.style.position=\"absolute\",o.style.zIndex=\"2\",Object.assign(o.style,Pjt[r]),n.append(o)),o}_updateContainers(){let t=this.deck.width,r=this.deck.height;for(let i in this.containers){let n=this.lastViewports[i]||null,o=i===Emt||n,s=this.containers[i];o?(s.style.display=\"block\",s.style.left=`${n?n.x:0}px`,s.style.top=`${n?n.y:0}px`,s.style.width=`${n?n.width:t}px`,s.style.height=`${n?n.height:r}px`):s.style.display=\"none\"}}};function JY(e,t){t&&Object.entries(t).map(([r,i])=>{r.startsWith(\"--\")?e.style.setProperty(r,i):e.style[r]=i})}function Pmt(e,t){t&&Object.keys(t).map(r=>{r.startsWith(\"--\")?e.style.removeProperty(r):e.style[r]=\"\"})}var Ca=class{constructor(t){this.viewId=null,this.props={...this.constructor.defaultProps,...t},this.id=this.props.id}setProps(t){let r=this.props,i=this.rootElement;i&&r.className!==t.className&&(r.className&&i.classList.remove(r.className),t.className&&i.classList.add(t.className)),i&&!to(r.style,t.style,1)&&(Pmt(i,r.style),JY(i,t.style)),Object.assign(this.props,t),this.updateHTML()}updateHTML(){this.rootElement&&this.onRenderHTML(this.rootElement)}onCreateRootElement(){let t=[\"deck-widget\",this.className,this.props.className],r=document.createElement(\"div\");return t.filter(i=>typeof i==\"string\"&&i.length>0).forEach(i=>r.classList.add(i)),JY(r,this.props.style),r}_onAdd(t){return this.onAdd(t)??this.onCreateRootElement()}onAdd(t){}onRemove(){}onViewportChange(t){}onRedraw(t){}onHover(t,r){}onClick(t,r){}onDrag(t,r){}onDragStart(t,r){}onDragEnd(t,r){}};Ca.defaultProps={id:\"widget\",style:{},_container:null,className:\"\"};var Ijt={zIndex:\"1\",position:\"absolute\",pointerEvents:\"none\",color:\"#a0a7b4\",backgroundColor:\"#29323c\",padding:\"10px\",top:\"0\",left:\"0\",display:\"none\"},vP=class extends Ca{constructor(t={}){super(t),this.id=\"default-tooltip\",this.placement=\"fill\",this.className=\"deck-tooltip\",this.isVisible=!1,this.setProps(t)}onCreateRootElement(){let t=document.createElement(\"div\");return t.className=this.className,Object.assign(t.style,Ijt),t}onRenderHTML(t){}onViewportChange(t){this.isVisible&&t.id===this.lastViewport?.id&&!t.equals(this.lastViewport)&&this.setTooltip(null),this.lastViewport=t}onHover(t){let{deck:r}=this,i=r&&r.props.getTooltip;if(!i)return;let n=i(t);this.setTooltip(n,t.x,t.y)}setTooltip(t,r,i){let n=this.rootElement;if(n){if(typeof t==\"string\")n.innerText=t;else if(t)t.text&&(n.innerText=t.text),t.html&&(n.innerHTML=t.html),t.className&&(n.className=t.className);else{this.isVisible=!1,n.style.display=\"none\";return}this.isVisible=!0,n.style.display=\"block\",n.style.transform=`translate(${r}px, ${i}px)`,t&&typeof t==\"object\"&&\"style\"in t&&Object.assign(n.style,t.style)}}};vP.defaultProps={...Ca.defaultProps};Ci();VL();Qw();function _1(){}var L$t=({isDragging:e})=>e?\"grabbing\":\"grab\",Qgt={id:\"\",width:\"100%\",height:\"100%\",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:\"none\",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:_1,onWebGLInitialized:_1,onResize:_1,onViewStateChange:_1,onInteractionStateChange:_1,onBeforeRender:_1,onAfterRender:_1,onLoad:_1,onError:e=>hr.error(e.message,e.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:L$t,getTooltip:null,debug:!1,drawPickingColors:!1},PP=class{constructor(t){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new vu({id:\"deck.gl\"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw=\"Initial render\",this._pickRequest={mode:\"hover\",x:-1,y:-1,radius:0,event:null,unproject3D:!1},this._lastPointerDownInfo=null,this._onPointerMove=i=>{let{_pickRequest:n}=this;if(i.type===\"pointerleave\")n.x=-1,n.y=-1,n.radius=0;else{if(i.leftButton||i.rightButton)return;{let o=i.offsetCenter;if(!o)return;n.x=o.x,n.y=o.y,n.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:n.x,y:n.y}),n.event=i},this._onEvent=i=>{let n=JE[i.type],o=i.offsetCenter;if(!n||!o||!this.layerManager)return;let s,a=this.layerManager.getLayers(),h=a.some(R=>R.props.pickable===\"3d\");if(i.type===\"click\"&&h){let R=this._pick(\"pickObject\",\"pickObject Time\",{x:o.x,y:o.y,radius:this.props.pickingRadius,unproject3D:!0});s=R.result[0]||R.emptyInfo}else s=this.deckPicker.getLastPickedObject({x:o.x,y:o.y,layers:a,viewports:this.getViewports(o)},this._lastPointerDownInfo);let{layer:p}=s,g=p&&(p[n]||p.props[n]),w=this.props[n],C=!1;g&&(C=g.call(p,s,i)),C||(w?.(s,i),this.widgetManager.onEvent(s,i))},this._onPointerDown=i=>{if(this.device?.type===\"webgpu\")return;let n=i.offsetCenter,o=this._pick(\"pickObject\",\"pickObject Time\",{x:n.x,y:n.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=o.result[0]||o.emptyInfo},this.props={...Qgt,...t},t=this.props,t.viewState&&t.initialViewState&&hr.warn(\"View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.\")(),this.viewState=this.props.initialViewState,t.device&&(this.device=t.device);let r=this.device;if(!r&&t.gl){t.gl instanceof WebGLRenderingContext&&hr.error(\"WebGL1 context not supported.\")();let i=this.props.deviceProps?.onResize;r=EP.attach(t.gl,{_cacheShaders:!0,_cachePipelines:!0,...this.props.deviceProps,onResize:(n,o)=>{let{width:s,height:a}=n.canvas;n.drawingBufferWidth=s,n.drawingBufferHeight=a,this._needsRedraw=\"Canvas resized\",i?.(n,o)}})}r||(r=this._createDevice(t)),this.animationLoop=this._createAnimationLoop(r,t),this.setProps(t),t._typedArrayManagerProps&&$f.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop?.stop(),this.animationLoop?.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager?.finalize(),this.layerManager=null,this.viewManager?.finalize(),this.viewManager=null,this.effectManager?.finalize(),this.effectManager=null,this.deckRenderer?.finalize(),this.deckRenderer=null,this.deckPicker?.finalize(),this.deckPicker=null,this.eventManager?.destroy(),this.eventManager=null,this.widgetManager?.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&(this.canvas.parentElement?.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get(\"setProps Time\").timeStart(),\"onLayerHover\"in t&&hr.removed(\"onLayerHover\",\"onHover\")(),\"onLayerClick\"in t&&hr.removed(\"onLayerClick\",\"onClick\")(),t.initialViewState&&!to(this.props.initialViewState,t.initialViewState,3)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);let r=Object.create(this.props);Object.assign(r,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),t.device&&t.device.id!==this.device?.id&&(this.animationLoop?.stop(),this.canvas!==t.device.canvasContext?.canvas&&(this.canvas?.remove(),this.eventManager?.destroy(),this.canvas=null),hr.log(`recreating animation loop for new device! id=${t.device.id}`)(),this.animationLoop=this._createAnimationLoop(t.device,t),this.animationLoop.start()),this.animationLoop?.setProps(r),t.useDevicePixels!==void 0&&this.device?.canvasContext?.setProps&&this.device.canvasContext.setProps({useDevicePixels:t.useDevicePixels}),this.layerManager&&(this.viewManager.setProps(r),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(r),this.effectManager.setProps(r),this.deckRenderer.setProps(r),this.deckPicker.setProps(r),this.widgetManager.setProps(r)),this.stats.get(\"setProps Time\").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return\"Deck._animate\";let r=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);let i=this.viewManager.needsRedraw(t),n=this.layerManager.needsRedraw(t),o=this.effectManager.needsRedraw(t),s=this.deckRenderer.needsRedraw(t);return r=r||i||n||o||s,r}redraw(t){if(!this.layerManager)return;let r=this.needsRedraw({clearRedrawFlags:!0});r=t||r,r&&(this.stats.get(\"Redraw Count\").incrementCount(),this.props._customRender?this.props._customRender(r):this._drawLayers(r))}get isInitialized(){return this.viewManager!==null}getViews(){return _r(this.viewManager),this.viewManager.views}getView(t){return _r(this.viewManager),this.viewManager.getView(t)}getViewports(t){return _r(this.viewManager),this.viewManager.getViewports(t)}getCanvas(){return this.canvas}pickObject(t){let r=this._pick(\"pickObject\",\"pickObject Time\",t).result;return r.length?r[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick(\"pickObject\",\"pickMultipleObjects Time\",t).result}pickObjects(t){return this._pick(\"pickObjects\",\"pickObjects Time\",t)}_addResources(t,r=!1){for(let i in t)this.layerManager.resourceManager.add({resourceId:i,data:t[i],forceUpdate:r})}_removeResources(t){for(let r of t)this.layerManager.resourceManager.remove(r)}_addDefaultEffect(t){this.effectManager.addDefaultEffect(t)}_addDefaultShaderModule(t){this.layerManager.addDefaultShaderModule(t)}_removeDefaultShaderModule(t){this.layerManager?.removeDefaultShaderModule(t)}_pick(t,r,i){_r(this.deckPicker);let{stats:n}=this;n.get(\"Pick Count\").incrementCount(),n.get(r).timeStart();let o=this.deckPicker[t]({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...i});return n.get(r).timeEnd(),o}_createCanvas(t){let r=t.canvas;return typeof r==\"string\"&&(r=document.getElementById(r),_r(r)),r||(r=document.createElement(\"canvas\"),r.id=t.id||\"deckgl-overlay\",t.width&&typeof t.width==\"number\"&&(r.width=t.width),t.height&&typeof t.height==\"number\"&&(r.height=t.height),(t.parent||document.body).appendChild(r)),Object.assign(r.style,t.style),r}_setCanvasSize(t){if(!this.canvas)return;let{width:r,height:i}=t;if(r||r===0){let n=Number.isFinite(r)?`${r}px`:r;this.canvas.style.width=n}if(i||i===0){let n=Number.isFinite(i)?`${i}px`:i;this.canvas.style.position=t.style?.position||\"absolute\",this.canvas.style.height=n}}_updateCanvasSize(){let{canvas:t}=this;if(!t)return;let r=t.clientWidth??t.width,i=t.clientHeight??t.height;(r!==this.width||i!==this.height)&&(this.width=r,this.height=i,this.viewManager?.setProps({width:r,height:i}),this.layerManager?.activateViewport(this.getViewports()[0]),this.props.onResize({width:r,height:i}))}_createAnimationLoop(t,r){let{gl:i,onError:n}=r;return new lP({device:t,autoResizeDrawingBuffer:!i,autoResizeViewport:!1,onInitialize:o=>this._setDevice(o.device),onRender:this._onRenderFrame.bind(this),onError:n})}_createDevice(t){let r=this.props.deviceProps?.createCanvasContext,i=typeof r==\"object\"?r:void 0,n={adapters:[],_cacheShaders:!0,_cachePipelines:!0,...t.deviceProps};n.adapters.includes(EP)||n.adapters.push(EP);let o={alphaMode:this.props.deviceProps?.type===\"webgpu\"?\"premultiplied\":void 0},s=this.props.deviceProps?.onResize;return n3.createDevice({_reuseDevices:!0,type:\"webgl\",...n,createCanvasContext:{...o,...i,canvas:this._createCanvas(t),useDevicePixels:this.props.useDevicePixels,autoResize:!0},onResize:(a,h)=>{this._needsRedraw=\"Canvas resized\",s?.(a,h)}})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let{views:t}=this.props,r=Array.isArray(t)?t:t?[t]:[new g1({id:\"default-view\"})];return r.length&&this.props.controller&&(r[0].props.controller=this.props.controller),r}_onContextLost(){let{onError:t}=this.props;this.animationLoop&&t&&t(new Error(\"WebGL context is lost\"))}_pickAndCallback(){if(this.device?.type===\"webgpu\")return;let{_pickRequest:t}=this;if(t.event){let i=(this.layerManager?.getLayers()||[]).some(h=>h.props.pickable===\"3d\");t.unproject3D=i;let{result:n,emptyInfo:o}=this._pick(\"pickObject\",\"pickObject Time\",t);this.cursorState.isHovering=n.length>0;let s=o,a=!1;for(let h of n)s=h,a=h.layer?.onHover(h,t.event)||a;a||(this.props.onHover?.(s,t.event),this.widgetManager.onHover(s,t.event)),t.event=null}}_updateCursor(){let t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(t){if(this.device=t,!this.animationLoop)return;this.canvas||(this.canvas=this.device.canvasContext?.canvas,!this.canvas.isConnected&&this.props.parent&&this.props.parent.insertBefore(this.canvas,this.props.parent.firstChild)),this.device.type===\"webgl\"&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device.type===\"webgl\"&&this.props.onWebGLInitialized(this.device.gl);let r=new fb;r.play(),this.animationLoop.attachTimeline(r),this.eventManager=new QE(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizers:Object.keys(IY).map(n=>{let[o,s,a,h]=IY[n],p=this.props.eventRecognizerOptions?.[n],g={...s,...p,event:n};return{recognizer:new o(g),recognizeWith:a,requestFailure:h}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(let n in JE)this.eventManager.on(n,this._onEvent);this.viewManager=new dP({timeline:r,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});let i=this.viewManager.getViewports()[0];this.layerManager=new hP(this.device,{deck:this,stats:this.stats,viewport:i,timeline:r}),this.effectManager=new gP({deck:this,device:this.device}),this.deckRenderer=new yP(this.device),this.deckPicker=new _P(this.device),this.widgetManager=new gL({deck:this,parentElement:this.canvas?.parentElement}),this.widgetManager.addDefault(new vP),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,r){let{device:i,gl:n}=this.layerManager.context;this.props.onBeforeRender({device:i,gl:n});let o={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:\"screen\",effects:this.effectManager.getEffects(),...r};this.deckRenderer?.renderLayers(o),o.pass===\"screen\"&&this.widgetManager.onRedraw({viewports:o.viewports,layers:o.layers}),this.props.onAfterRender({device:i,gl:n})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),hr.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this.device?.type!==\"webgpu\"&&this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){let r=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:r},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}_getFrameStats(){let{stats:t}=this;t.get(\"frameRate\").timeEnd(),t.get(\"frameRate\").timeStart();let r=this.animationLoop.stats;t.get(\"GPU Time\").addTime(r.get(\"GPU Time\").lastTiming),t.get(\"CPU Time\").addTime(r.get(\"CPU Time\").lastTiming)}_getMetrics(){let{metrics:t,stats:r}=this;t.fps=r.get(\"frameRate\").getHz(),t.setPropsTime=r.get(\"setProps Time\").time,t.updateAttributesTime=r.get(\"Update Attributes\").time,t.framesRedrawn=r.get(\"Redraw Count\").count,t.pickTime=r.get(\"pickObject Time\").time+r.get(\"pickMultipleObjects Time\").time+r.get(\"pickObjects Time\").time,t.pickCount=r.get(\"Pick Count\").count,t.gpuTime=r.get(\"GPU Time\").time,t.cpuTime=r.get(\"CPU Time\").time,t.gpuTimePerFrame=r.get(\"GPU Time\").getAverageTime(),t.cpuTimePerFrame=r.get(\"CPU Time\").getAverageTime();let i=n3.stats.get(\"Memory Usage\");t.bufferMemory=i.get(\"Buffer Memory\").count,t.textureMemory=i.get(\"Texture Memory\").count,t.renderbufferMemory=i.get(\"Renderbuffer Memory\").count,t.gpuMemory=i.get(\"GPU Memory\").count}};PP.defaultProps=Qgt;PP.VERSION=Xdt;var j3=PP;Ci();Ci();function Jgt(e){switch(e){case\"float64\":return Float64Array;case\"uint8\":case\"unorm8\":return Uint8ClampedArray;default:return Zv(e)}}var tAt=Xv;function CP(e,t,r){let i=r===\"webgpu\"&&t.type===\"uint8\"?\"unorm8\":t.type;return{attribute:e,format:t.size>1?`${i}x${t.size}`:t.type,byteOffset:t.offset||0}}function v1(e){return e.stride||e.size*e.bytesPerElement}function eAt(e,t){return e.type===t.type&&e.size===t.size&&v1(e)===v1(t)&&(e.offset||0)===(t.offset||0)}function xX(e,t){t.offset&&hr.removed(\"shaderAttribute.offset\",\"vertexOffset, elementOffset\")();let r=v1(e),i=t.vertexOffset!==void 0?t.vertexOffset:e.vertexOffset||0,n=t.elementOffset||0,o=i*r+n*e.bytesPerElement+(e.offset||0);return{...t,offset:o,stride:r}}function B$t(e,t){let r=xX(e,t);return{high:r,low:{...r,offset:r.offset+e.size*4}}}var IP=class{constructor(t,r,i){this._buffer=null,this.device=t,this.id=r.id||\"\",this.size=r.size||1;let n=r.logicalType||r.type,o=n===\"float64\",{defaultValue:s}=r;s=Number.isFinite(s)?[s]:s||new Array(this.size).fill(0);let a;o?a=\"float32\":!n&&r.isIndexed?a=\"uint32\":a=n||\"float32\";let h=Jgt(n||a);this.doublePrecision=o,o&&r.fp64===!1&&(h=Float32Array),this.value=null,this.settings={...r,defaultType:h,defaultValue:s,logicalType:n,type:a,normalized:a.includes(\"norm\"),size:this.size,bytesPerElement:h.BYTES_PER_ELEMENT},this.state={...i,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){let t=this.getAccessor();return t.vertexOffset?t.vertexOffset*v1(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),$f.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(t=this.id,r=null){let i={};if(this.state.constant){let n=this.value;if(r){let o=xX(this.getAccessor(),r),s=o.offset/n.BYTES_PER_ELEMENT,a=o.size||this.size;i[t]=n.subarray(s,s+a)}else i[t]=n}else i[t]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?i[`${t}64Low`]=i[t]:i[`${t}64Low`]=new Float32Array(this.size)),i}_getBufferLayout(t=this.id,r=null){let i=this.getAccessor(),n=[],o={name:this.id,byteStride:v1(i),attributes:n};if(this.doublePrecision){let s=B$t(i,r||{});n.push(CP(t,{...i,...s.high},this.device.type),CP(`${t}64Low`,{...i,...s.low},this.device.type))}else if(r){let s=xX(i,r);n.push(CP(t,{...i,...s},this.device.type))}else n.push(CP(t,i,this.device.type));return o}setAccessor(t){this.state.bufferAccessor=t}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){let r=Array.from(this.value);t=[r,r]}else{let{value:r,numInstances:i,size:n}=this,o=i*n;if(r&&o&&r.length>=o){let s=new Array(n).fill(1/0),a=new Array(n).fill(-1/0);for(let h=0;h<o;)for(let p=0;p<n;p++){let g=r[h++];g<s[p]&&(s[p]=g),g>a[p]&&(a[p]=g)}t=[s,a]}}return this.state.bounds=t,t}setData(t){let{state:r}=this,i;ArrayBuffer.isView(t)?i={value:t}:t instanceof on?i={buffer:t}:i=t;let n={...this.settings,...i};if(ArrayBuffer.isView(i.value)){if(!i.type)if(this.doublePrecision&&i.value instanceof Float64Array)n.type=\"float32\";else{let s=tAt(i.value);n.type=n.normalized?s.replace(\"int\",\"norm\"):s}n.bytesPerElement=i.value.BYTES_PER_ELEMENT,n.stride=v1(n)}if(r.bounds=null,i.constant){let o=i.value;if(o=this._normalizeValue(o,[],0),this.settings.normalized&&(o=this.normalizeConstant(o)),!(!r.constant||!this._areValuesEqual(o,this.value)))return!1;r.externalBuffer=null,r.constant=!0,this.value=ArrayBuffer.isView(o)?o:new Float32Array(o)}else if(i.buffer){let o=i.buffer;r.externalBuffer=o,r.constant=!1,this.value=i.value||null}else if(i.value){this._checkExternalBuffer(i);let o=i.value;r.externalBuffer=null,r.constant=!1,this.value=o;let{buffer:s}=this,a=v1(n),h=(n.vertexOffset||0)*a;if(this.doublePrecision&&o instanceof Float64Array&&(o=tL(o,n)),this.settings.isIndexed){let g=this.settings.defaultType;o.constructor!==g&&(o=new g(o))}let p=o.byteLength+h+a*2;(!s||s.byteLength<p)&&(s=this._createBuffer(p)),s.write(o,h)}return this.setAccessor(n),!0}updateSubBuffer(t={}){this.state.bounds=null;let r=this.value,{startOffset:i=0,endOffset:n}=t;this.buffer.write(this.doublePrecision&&r instanceof Float64Array?tL(r,{size:this.size,startIndex:i,endIndex:n}):r.subarray(i,n),i*r.BYTES_PER_ELEMENT+this.byteOffset)}allocate(t,r=!1){let{state:i}=this,n=i.allocatedValue,o=$f.allocate(n,t+1,{size:this.size,type:this.settings.defaultType,copy:r});this.value=o;let{byteOffset:s}=this,{buffer:a}=this;return(!a||a.byteLength<o.byteLength+s)&&(a=this._createBuffer(o.byteLength+s),r&&n&&a.write(n instanceof Float64Array?tL(n,this):n,s)),i.allocatedValue=o,i.constant=!1,i.externalBuffer=null,this.setAccessor(this.settings),!0}_checkExternalBuffer(t){let{value:r}=t;if(!ArrayBuffer.isView(r))throw new Error(`Attribute ${this.id} value is not TypedArray`);let i=this.settings.defaultType,n=!1;if(this.doublePrecision&&(n=r.BYTES_PER_ELEMENT<4),n)throw new Error(`Attribute ${this.id} does not support ${r.constructor.name}`);!(r instanceof i)&&this.settings.normalized&&!(\"normalized\"in t)&&hr.warn(`Attribute ${this.id} is normalized`)()}normalizeConstant(t){switch(this.settings.type){case\"snorm8\":return new Float32Array(t).map(r=>(r+128)/255*2-1);case\"snorm16\":return new Float32Array(t).map(r=>(r+32768)/65535*2-1);case\"unorm8\":return new Float32Array(t).map(r=>r/255);case\"unorm16\":return new Float32Array(t).map(r=>r/65535);default:return t}}_normalizeValue(t,r,i){let{defaultValue:n,size:o}=this.settings;if(Number.isFinite(t))return r[i]=t,r;if(!t){let s=o;for(;--s>=0;)r[i+s]=n[s];return r}switch(o){case 4:r[i+3]=Number.isFinite(t[3])?t[3]:n[3];case 3:r[i+2]=Number.isFinite(t[2])?t[2]:n[2];case 2:r[i+1]=Number.isFinite(t[1])?t[1]:n[1];case 1:r[i+0]=Number.isFinite(t[0])?t[0]:n[0];break;default:let s=o;for(;--s>=0;)r[i+s]=Number.isFinite(t[s])?t[s]:n[s]}return r}_areValuesEqual(t,r){if(!t||!r)return!1;let{size:i}=this;for(let n=0;n<i;n++)if(t[n]!==r[n])return!1;return!0}_createBuffer(t){this._buffer&&this._buffer.destroy();let{isIndexed:r,type:i}=this.settings;return this._buffer=this.device.createBuffer({...this._buffer?.props,id:this.id,usage:(r?on.INDEX:on.VERTEX)|on.COPY_DST,indexType:r?i:void 0,byteLength:t}),this._buffer}};var rAt=[],iAt=[];function Lc(e,t=0,r=1/0){let i=rAt,n={index:-1,data:e,target:[]};return e?typeof e[Symbol.iterator]==\"function\"?i=e:e.length>0&&(iAt.length=e.length,i=iAt):i=rAt,(t>0||Number.isFinite(r))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(t,r),n.index=t-1),{iterable:i,objectInfo:n}}function WL(e){return e&&e[Symbol.asyncIterator]}function qL(e,t){let{size:r,stride:i,offset:n,startIndices:o,nested:s}=t,a=e.BYTES_PER_ELEMENT,h=i?i/a:r,p=n?n/a:0,g=Math.floor((e.length-p)/h);return(w,{index:C,target:R})=>{if(!o){let H=C*h+p;for(let Q=0;Q<r;Q++)R[Q]=e[H+Q];return R}let z=o[C],W=o[C+1]||g,Y;if(s){Y=new Array(W-z);for(let H=z;H<W;H++){let Q=H*h+p;R=new Array(r);for(let tt=0;tt<r;tt++)R[tt]=e[Q+tt];Y[H-z]=R}}else if(h===r)Y=e.subarray(z*r+p,W*r+p);else{Y=new e.constructor((W-z)*r);let H=0;for(let Q=z;Q<W;Q++){let tt=Q*h+p;for(let rt=0;rt<r;rt++)Y[H++]=e[tt+rt]}}return Y}}var nAt=[],kP=[[0,1/0]];function oAt(e,t){if(e===kP||(t[0]<0&&(t[0]=0),t[0]>=t[1]))return e;let r=[],i=e.length,n=0;for(let o=0;o<i;o++){let s=e[o];s[1]<t[0]?(r.push(s),n=o+1):s[0]>t[1]?r.push(s):t=[Math.min(s[0],t[0]),Math.max(s[1],t[1])]}return r.splice(n,0,t),r}var N$t={interpolation:{duration:0,easing:e=>e},spring:{stiffness:.05,damping:.5}};function HL(e,t){if(!e)return null;Number.isFinite(e)&&(e={type:\"interpolation\",duration:e});let r=e.type||\"interpolation\";return{...N$t[r],...t,...e,type:r}}var bb=class extends IP{constructor(t,r){super(t,r,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:kP}),this.constant=!1,this.settings.update=r.update||(r.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:t=!1}={}){let r=this.state.needsRedraw;return this.state.needsRedraw=r&&!t,r}layoutChanged(){return this.state.layoutChanged}setAccessor(t){var r;(r=this.state).layoutChanged||(r.layoutChanged=!eAt(t,this.getAccessor())),super.setAccessor(t)}getUpdateTriggers(){let{accessor:t}=this.settings;return[this.id].concat(typeof t!=\"function\"&&t||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;let{accessor:r}=this.settings,i=this.settings.transition,n=Array.isArray(r)?t[r.find(o=>t[o])]:t[r];return HL(n,i)}setNeedsUpdate(t=this.id,r){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),r){let{startRow:i=0,endRow:n=1/0}=r;this.state.updateRanges=oAt(this.state.updateRanges,[i,n])}else this.state.updateRanges=kP}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=nAt}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){let{state:r,settings:i}=this;return i.noAlloc?!1:i.update?(super.allocate(t,r.updateRanges!==kP),!0):!1}updateBuffer({numInstances:t,data:r,props:i,context:n}){if(!this.needsUpdate())return!1;let{state:{updateRanges:o},settings:{update:s,noAlloc:a}}=this,h=!0;if(s){for(let[p,g]of o)s.call(n,this,{data:r,startRow:p,endRow:g,props:i,numInstances:t});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(let[p,g]of o){let w=Number.isFinite(p)?this.getVertexOffset(p):0,C=Number.isFinite(g)?this.getVertexOffset(g):a||!Number.isFinite(t)?this.value.length:t*this.size;super.updateSubBuffer({startOffset:w,endOffset:C})}this._checkAttributeArray()}else h=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),h}setConstantValue(t,r){let i=this.device.type===\"webgpu\";if(i||r===void 0||typeof r==\"function\"){if(i&&typeof r!=\"function\"){let s=this._normalizeValue(r,[],0);this._areValuesEqual(s,this.value)||this.setNeedsUpdate(\"WebGPU constant updated\")}return!1}let n=this.settings.transform&&t?this.settings.transform.call(t,r):r;return this.setData({constant:!0,value:n})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){let{state:r}=this;return t?(this.clearNeedsUpdate(),r.lastExternalBuffer===t||(r.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(r.lastExternalBuffer=null,!1)}setBinaryValue(t,r=null){let{state:i,settings:n}=this;if(!t)return i.binaryValue=null,i.binaryAccessor=null,!1;if(n.noAlloc)return!1;if(i.binaryValue===t)return this.clearNeedsUpdate(),!0;if(i.binaryValue=t,this.setNeedsRedraw(),n.transform||r!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});let s=t;_r(ArrayBuffer.isView(s.value),`invalid ${n.accessor}`);let a=!!s.size&&s.size!==this.size;return i.binaryAccessor=qL(s.value,{size:s.size||this.size,stride:s.stride,offset:s.offset,startIndices:r,nested:a}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){let{startIndices:r}=this;return(r?t<r.length?r[t]:this.numInstances:t)*this.size}getValue(){let t=this.settings.shaderAttributes,r=super.getValue();if(!t)return r;for(let i in t)Object.assign(r,super.getValue(i,t[i]));return r}getBufferLayout(t){this.state.layoutChanged=!1;let r=this.settings.shaderAttributes,i=super._getBufferLayout(),{stepMode:n}=this.settings;if(n===\"dynamic\"?i.stepMode=t?t.isInstanced?\"instance\":\"vertex\":\"instance\":i.stepMode=n??\"vertex\",!r)return i;for(let o in r){let s=super._getBufferLayout(o,r[o]);i.attributes.push(...s.attributes)}return i}_autoUpdater(t,{data:r,startRow:i,endRow:n,props:o,numInstances:s}){if(t.constant&&this.context.device.type!==\"webgpu\")return;let{settings:a,state:h,value:p,size:g,startIndices:w}=t,{accessor:C,transform:R}=a,z=h.binaryAccessor||(typeof C==\"function\"?C:o[C]);typeof z!=\"function\"&&typeof C==\"string\"&&(z=()=>o[C]),_r(typeof z==\"function\",`accessor \"${C}\" is not a function`);let W=t.getVertexOffset(i),{iterable:Y,objectInfo:H}=Lc(r,i,n);for(let Q of Y){H.index++;let tt=z(Q,H);if(R&&(tt=R.call(this,tt)),w){let rt=(H.index<w.length-1?w[H.index+1]:s)-w[H.index];if(tt&&Array.isArray(tt[0])){let at=W;for(let et of tt)t._normalizeValue(et,p,at),at+=g}else tt&&tt.length>g?p.set(tt,W):(t._normalizeValue(tt,H.target,0),WY({target:p,source:H.target,start:W,count:rt}));W+=rt*g}else t._normalizeValue(tt,p,W),W+=g}}_validateAttributeUpdaters(){let{settings:t}=this;if(!(t.noAlloc||typeof t.update==\"function\"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){let{value:t}=this,r=Math.min(4,this.size);if(t&&t.length>=r){let i=!0;switch(r){case 4:i=i&&Number.isFinite(t[3]);case 3:i=i&&Number.isFinite(t[2]);case 2:i=i&&Number.isFinite(t[1]);case 1:i=i&&Number.isFinite(t[0]);break;default:i=!1}if(!i)throw new Error(`Illegal attribute generated for ${this.id}`)}}};function wX(e){let{source:t,target:r,start:i=0,size:n,getData:o}=e,s=e.end||r.length,a=t.length,h=s-i;if(a>h){r.set(t.subarray(0,h),i);return}if(r.set(t,i),!o)return;let p=a;for(;p<h;){let g=o(p,t);for(let w=0;w<n;w++)r[i+p]=g[w]||0,p++}}function sAt({source:e,target:t,size:r,getData:i,sourceStartIndices:n,targetStartIndices:o}){if(!n||!o)return wX({source:e,target:t,size:r,getData:i}),t;let s=0,a=0,h=i&&((g,w)=>i(g+a,w)),p=Math.min(n.length,o.length);for(let g=1;g<p;g++){let w=n[g]*r,C=o[g]*r;wX({source:e.subarray(s,w),target:t,start:a,end:C,size:r,getData:h}),s=w,a=C}return a<t.length&&wX({source:[],target:t,start:a,size:r,getData:h}),t}function aAt(e){let{device:t,settings:r,value:i}=e,n=new bb(t,r);return n.setData({value:i instanceof Float64Array?new Float64Array(0):new Float32Array(0),normalized:r.normalized}),n}function YL(e){switch(e){case 1:return\"float\";case 2:return\"vec2\";case 3:return\"vec3\";case 4:return\"vec4\";default:throw new Error(`No defined attribute type for size \"${e}\"`)}}function XL(e){switch(e){case 1:return\"float32\";case 2:return\"float32x2\";case 3:return\"float32x3\";case 4:return\"float32x4\";default:throw new Error(\"invalid type size\")}}function ZL(e){e.push(e.shift())}function lAt(e,t){let{doublePrecision:r,settings:i,value:n,size:o}=e,s=r&&n instanceof Float64Array?2:1,a=0,{shaderAttributes:h}=e.settings;if(h)for(let p of Object.values(h))a=Math.max(a,p.vertexOffset??0);return(i.noAlloc?n.length:(t+a)*o)*s}function KL({device:e,source:t,target:r}){return(!r||r.byteLength<t.byteLength)&&(r?.destroy(),r=e.createBuffer({byteLength:t.byteLength,usage:t.usage})),r}function QL({device:e,buffer:t,attribute:r,fromLength:i,toLength:n,fromStartIndices:o,getData:s=a=>a}){let a=r.doublePrecision&&r.value instanceof Float64Array?2:1,h=r.size*a,p=r.byteOffset,g=r.settings.bytesPerElement<4?p/r.settings.bytesPerElement*4:p,w=r.startIndices,C=o&&w,R=r.isConstant;if(!C&&t&&i>=n)return t;let z=r.value instanceof Float64Array?Float32Array:r.value.constructor,W=R?r.value:new z(r.getBuffer().readSyncWebGL(p,n*z.BYTES_PER_ELEMENT).buffer);if(r.settings.normalized&&!R){let tt=s;s=(rt,at)=>r.normalizeConstant(tt(rt,at))}let Y=R?(tt,rt)=>s(W,rt):(tt,rt)=>s(W.subarray(tt+p,tt+p+h),rt),H=t?new Float32Array(t.readSyncWebGL(g,i*4).buffer):new Float32Array(0),Q=new Float32Array(n);return sAt({source:H,target:Q,sourceStartIndices:o,targetStartIndices:w,size:h,getData:Y}),(!t||t.byteLength<Q.byteLength+g)&&(t?.destroy(),t=e.createBuffer({byteLength:Q.byteLength+g,usage:35050})),t.write(Q,g),t}var $3=class{constructor({device:t,attribute:r,timeline:i}){this.buffers=[],this.currentLength=0,this.device=t,this.transition=new Wf(i),this.attribute=r,this.attributeInTransition=aAt(r),this.currentStartIndices=r.startIndices}get inProgress(){return this.transition.inProgress}start(t,r,i=1/0){this.settings=t,this.currentStartIndices=this.attribute.startIndices,this.currentLength=lAt(this.attribute,r),this.transition.start({...t,duration:i})}update(){let t=this.transition.update();return t&&this.onUpdate(),t}setBuffer(t){this.attributeInTransition.setData({buffer:t,normalized:this.attribute.settings.normalized,value:this.attributeInTransition.value})}cancel(){this.transition.cancel()}delete(){this.cancel();for(let t of this.buffers)t.destroy();this.buffers.length=0}};var RP=class extends $3{constructor({device:t,attribute:r,timeline:i}){super({device:t,attribute:r,timeline:i}),this.type=\"interpolation\",this.transform=j$t(t,r)}start(t,r){let i=this.currentLength,n=this.currentStartIndices;if(super.start(t,r,t.duration),t.duration<=0){this.transition.cancel();return}let{buffers:o,attribute:s}=this;ZL(o),o[0]=QL({device:this.device,buffer:o[0],attribute:s,fromLength:i,toLength:this.currentLength,fromStartIndices:n,getData:t.enter}),o[1]=KL({device:this.device,source:o[0],target:o[1]}),this.setBuffer(o[1]);let{transform:a}=this,h=a.model,p=Math.floor(this.currentLength/s.size);uAt(s)&&(p/=2),h.setVertexCount(p),s.isConstant?(h.setAttributes({aFrom:o[0]}),h.setConstantAttributes({aTo:s.value})):h.setAttributes({aFrom:o[0],aTo:s.getBuffer()}),a.transformFeedback.setBuffers({vCurrent:o[1]})}onUpdate(){let{duration:t,easing:r}=this.settings,{time:i}=this.transition,n=i/t;r&&(n=r(n));let{model:o}=this.transform,s={time:n};o.shaderInputs.setProps({interpolation:s}),this.transform.run({discard:!0})}delete(){super.delete(),this.transform.destroy()}},z$t=`uniform interpolationUniforms {\n  float time;\n} interpolation;\n`,cAt={name:\"interpolation\",vs:z$t,uniformTypes:{time:\"f32\"}},U$t=`#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n  vCurrent = mix(aFrom, aTo, interpolation.time);\n  gl_Position = vec4(0.0);\n}\n`,V$t=`#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aFrom64Low;\nin ATTRIBUTE_TYPE aTo;\nin ATTRIBUTE_TYPE aTo64Low;\nout ATTRIBUTE_TYPE vCurrent;\nout ATTRIBUTE_TYPE vCurrent64Low;\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n  vec2 range = sub_fp64(b, a);\n  return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid main(void) {\n  for (int i=0; i<ATTRIBUTE_SIZE; i++) {\n    vec2 value = mix_fp64(vec2(aFrom[i], aFrom64Low[i]), vec2(aTo[i], aTo64Low[i]), interpolation.time);\n    vCurrent[i] = value.x;\n    vCurrent64Low[i] = value.y;\n  }\n  gl_Position = vec4(0.0);\n}\n`;function uAt(e){return e.doublePrecision&&e.value instanceof Float64Array}function j$t(e,t){let r=t.size,i=YL(r),n=XL(r),o=t.getBufferLayout();return uAt(t)?new p1(e,{vs:V$t,bufferLayout:[{name:\"aFrom\",byteStride:8*r,attributes:[{attribute:\"aFrom\",format:n,byteOffset:0},{attribute:\"aFrom64Low\",format:n,byteOffset:4*r}]},{name:\"aTo\",byteStride:8*r,attributes:[{attribute:\"aTo\",format:n,byteOffset:0},{attribute:\"aTo64Low\",format:n,byteOffset:4*r}]}],modules:[yY,cAt],defines:{ATTRIBUTE_TYPE:i,ATTRIBUTE_SIZE:r},moduleSettings:{},varyings:[\"vCurrent\",\"vCurrent64Low\"],bufferMode:35980,disableWarnings:!0}):new p1(e,{vs:U$t,bufferLayout:[{name:\"aFrom\",format:n},{name:\"aTo\",format:o.attributes[0].format}],modules:[cAt],defines:{ATTRIBUTE_TYPE:i},varyings:[\"vCurrent\"],disableWarnings:!0})}var DP=class extends $3{constructor({device:t,attribute:r,timeline:i}){super({device:t,attribute:r,timeline:i}),this.type=\"spring\",this.texture=Y$t(t),this.framebuffer=X$t(t,this.texture),this.transform=H$t(t,r)}start(t,r){let i=this.currentLength,n=this.currentStartIndices;super.start(t,r);let{buffers:o,attribute:s}=this;for(let h=0;h<2;h++)o[h]=QL({device:this.device,buffer:o[h],attribute:s,fromLength:i,toLength:this.currentLength,fromStartIndices:n,getData:t.enter});o[2]=KL({device:this.device,source:o[0],target:o[2]}),this.setBuffer(o[1]);let{model:a}=this.transform;a.setVertexCount(Math.floor(this.currentLength/s.size)),s.isConstant?a.setConstantAttributes({aTo:s.value}):a.setAttributes({aTo:s.getBuffer()})}onUpdate(){let{buffers:t,transform:r,framebuffer:i,transition:n}=this,o=this.settings;r.model.setAttributes({aPrev:t[0],aCur:t[1]}),r.transformFeedback.setBuffers({vNext:t[2]});let s={stiffness:o.stiffness,damping:o.damping};r.model.shaderInputs.setProps({spring:s}),r.run({framebuffer:i,discard:!1,parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]}),ZL(t),this.setBuffer(t[1]),this.device.readPixelsToArrayWebGL(i)[0]>0||n.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}},$$t=`uniform springUniforms {\n  float damping;\n  float stiffness;\n} spring;\n`,G$t={name:\"spring\",vs:$$t,uniformTypes:{damping:\"f32\",stiffness:\"f32\"}},W$t=`#version 300 es\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nin ATTRIBUTE_TYPE aPrev;\nin ATTRIBUTE_TYPE aCur;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vNext;\nout float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n  ATTRIBUTE_TYPE velocity = cur - prev;\n  ATTRIBUTE_TYPE delta = dest - cur;\n  ATTRIBUTE_TYPE force = delta * spring.stiffness;\n  ATTRIBUTE_TYPE resistance = velocity * spring.damping;\n  return force - resistance + velocity + cur;\n}\n\nvoid main(void) {\n  bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n  vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n  vNext = getNextValue(aCur, aPrev, aTo);\n  gl_Position = vec4(0, 0, 0, 1);\n  gl_PointSize = 100.0;\n}\n`,q$t=`#version 300 es\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nin float vIsTransitioningFlag;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  if (vIsTransitioningFlag == 0.0) {\n    discard;\n  }\n  fragColor = vec4(1.0);\n}`;function H$t(e,t){let r=YL(t.size),i=XL(t.size);return new p1(e,{vs:W$t,fs:q$t,bufferLayout:[{name:\"aPrev\",format:i},{name:\"aCur\",format:i},{name:\"aTo\",format:t.getBufferLayout().attributes[0].format}],varyings:[\"vNext\"],modules:[G$t],defines:{ATTRIBUTE_TYPE:r},parameters:{depthCompare:\"always\",blendColorOperation:\"max\",blendColorSrcFactor:\"one\",blendColorDstFactor:\"one\",blendAlphaOperation:\"max\",blendAlphaSrcFactor:\"one\",blendAlphaDstFactor:\"one\"}})}function Y$t(e){return e.createTexture({data:new Uint8Array(4),format:\"rgba8unorm\",width:1,height:1})}function X$t(e,t){return e.createFramebuffer({id:\"spring-transition-is-transitioning-framebuffer\",width:1,height:1,colorAttachments:[t]})}var Z$t={interpolation:RP,spring:DP},OP=class{constructor(t,{id:r,timeline:i}){if(!t)throw new Error(\"AttributeTransitionManager is constructed without device\");this.id=r,this.device=t,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(let t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:r,numInstances:i}){this.numInstances=i||1;for(let n in t){let o=t[n],s=o.getTransitionSetting(r);s&&this._updateAttribute(n,o,s)}for(let n in this.transitions){let o=t[n];(!o||!o.getTransitionSetting(r))&&this._removeTransition(n)}}hasAttribute(t){let r=this.transitions[t];return r&&r.inProgress}getAttributes(){let t={};for(let r in this.transitions){let i=this.transitions[r];i.inProgress&&(t[r]=i.attributeInTransition)}return t}run(){if(this.numInstances===0)return!1;for(let r in this.transitions)this.transitions[r].update()&&(this.needsRedraw=!0);let t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].delete(),delete this.transitions[t]}_updateAttribute(t,r,i){let n=this.transitions[t],o=!n||n.type!==i.type;if(o){n&&this._removeTransition(t);let s=Z$t[i.type];s?this.transitions[t]=new s({attribute:r,timeline:this.timeline,device:this.device}):(hr.error(`unsupported transition type '${i.type}'`)(),o=!1)}(o||r.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(i,this.numInstances))}};var hAt=\"attributeManager.invalidate\",K$t=\"attributeManager.updateStart\",Q$t=\"attributeManager.updateEnd\",J$t=\"attribute.updateStart\",tGt=\"attribute.allocate\",eGt=\"attribute.updateEnd\",P0=class{constructor(t,{id:r=\"attribute-manager\",stats:i,timeline:n}={}){this.mergeBoundsMemoized=b0(smt),this.id=r,this.device=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new OP(t,{id:`${r}-transitions`,timeline:n}),Object.seal(this)}finalize(){for(let t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){let r=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,r&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{stepMode:\"instance\"})}remove(t){for(let r of t)this.attributes[r]!==void 0&&(this.attributes[r].delete(),delete this.attributes[r])}invalidate(t,r){let i=this._invalidateTrigger(t,r);ys(hAt,this,t,i)}invalidateAll(t){for(let r in this.attributes)this.attributes[r].setNeedsUpdate(r,t);ys(hAt,this,\"all\")}update({data:t,numInstances:r,startIndices:i=null,transitions:n,props:o={},buffers:s={},context:a={}}){let h=!1;ys(K$t,this),this.stats&&this.stats.get(\"Update Attributes\").timeStart();for(let p in this.attributes){let g=this.attributes[p],w=g.settings.accessor;g.startIndices=i,g.numInstances=r,o[p]&&hr.removed(`props.${p}`,`data.attributes.${p}`)(),g.setExternalBuffer(s[p])||g.setBinaryValue(typeof w==\"string\"?s[w]:void 0,t.startIndices)||typeof w==\"string\"&&!s[w]&&g.setConstantValue(a,o[w])||g.needsUpdate()&&(h=!0,this._updateAttribute({attribute:g,numInstances:r,data:t,props:o,context:a})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}h&&ys(Q$t,this,r),this.stats&&this.stats.get(\"Update Attributes\").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:r,transitions:n})}updateTransition(){let{attributeTransitionManager:t}=this,r=t.run();return this.needsRedraw=this.needsRedraw||r,r}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(t){let r=t.map(i=>this.attributes[i]?.getBounds());return this.mergeBoundsMemoized(r)}getChangedAttributes(t={clearChangedFlags:!1}){let{attributes:r,attributeTransitionManager:i}=this,n={...i.getAttributes()};for(let o in r){let s=r[o];s.needsRedraw(t)&&!i.hasAttribute(o)&&(n[o]=s)}return n}getBufferLayouts(t){return Object.values(this.getAttributes()).map(r=>r.getBufferLayout(t))}_add(t,r){for(let i in t){let n=t[i],o={...n,id:i,size:n.isIndexed&&1||n.size||1,...r};this.attributes[i]=new bb(this.device,o)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){let t={};for(let r in this.attributes)this.attributes[r].getUpdateTriggers().forEach(n=>{t[n]||(t[n]=[]),t[n].push(r)});this.updateTriggers=t}_invalidateTrigger(t,r){let{attributes:i,updateTriggers:n}=this,o=n[t];return o&&o.forEach(s=>{let a=i[s];a&&a.setNeedsUpdate(a.id,r)}),o}_updateAttribute(t){let{attribute:r,numInstances:i}=t;if(ys(J$t,r),r.constant){r.setConstantValue(t.context,r.value);return}r.allocate(i)&&ys(tGt,r,i),r.updateBuffer(t)&&(this.needsRedraw=!0,ys(eGt,r,i))}};Ci();VL();var LP=class extends Wf{get value(){return this._value}_onUpdate(){let{time:t,settings:{fromValue:r,toValue:i,duration:n,easing:o}}=this,s=o(t/n);this._value=rc(r,i,s)}};var dAt=1e-5;function fAt(e,t,r,i,n){let o=t-e,a=(r-t)*n,h=-o*i;return a+h+o+t}function rGt(e,t,r,i,n){if(Array.isArray(r)){let o=[];for(let s=0;s<r.length;s++)o[s]=fAt(e[s],t[s],r[s],i,n);return o}return fAt(e,t,r,i,n)}function pAt(e,t){if(Array.isArray(e)){let r=0;for(let i=0;i<e.length;i++){let n=e[i]-t[i];r+=n*n}return Math.sqrt(r)}return Math.abs(e-t)}var BP=class extends Wf{get value(){return this._currValue}_onUpdate(){let{fromValue:t,toValue:r,damping:i,stiffness:n}=this.settings,{_prevValue:o=t,_currValue:s=t}=this,a=rGt(o,s,r,i,n),h=pAt(a,r),p=pAt(a,s);h<dAt&&p<dAt&&(a=r,this.end()),this._prevValue=s,this._currValue=a}};var iGt={interpolation:LP,spring:BP},FP=class{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,r,i,n){let{transitions:o}=this;if(o.has(t)){let h=o.get(t),{value:p=h.settings.fromValue}=h;r=p,this.remove(t)}if(n=HL(n),!n)return;let s=iGt[n.type];if(!s){hr.error(`unsupported transition type '${n.type}'`)();return}let a=new s(this.timeline);a.start({...n,fromValue:r,toValue:i}),o.set(t,a)}remove(t){let{transitions:r}=this;r.has(t)&&(r.get(t).cancel(),r.delete(t))}update(){let t={};for(let[r,i]of this.transitions)i.update(),t[r]=i.value,i.inProgress||this.remove(r);return t}clear(){for(let t of this.transitions.keys())this.remove(t)}};function gAt(e){let t=e[Ld];for(let r in t){let i=t[r],{validate:n}=i;if(n&&!n(e[r],i))throw new Error(`Invalid prop ${r}: ${e[r]}`)}}function AAt(e,t){let r=NP({newProps:e,oldProps:t,propTypes:e[Ld],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=oGt(e,t),n=!1;return i||(n=sGt(e,t)),{dataChanged:i,propsChanged:r,updateTriggersChanged:n,extensionsChanged:aGt(e,t),transitionsChanged:nGt(e,t)}}function nGt(e,t){if(!e.transitions)return!1;let r={},i=e[Ld],n=!1;for(let o in e.transitions){let s=i[o],a=s&&s.type;(a===\"number\"||a===\"color\"||a===\"array\")&&TX(e[o],t[o],s)&&(r[o]=!0,n=!0)}return n?r:!1}function NP({newProps:e,oldProps:t,ignoreProps:r={},propTypes:i={},triggerName:n=\"props\"}){if(t===e)return!1;if(typeof e!=\"object\"||e===null)return`${n} changed shallowly`;if(typeof t!=\"object\"||t===null)return`${n} changed shallowly`;for(let o of Object.keys(e))if(!(o in r)){if(!(o in t))return`${n}.${o} added`;let s=TX(e[o],t[o],i[o]);if(s)return`${n}.${o} ${s}`}for(let o of Object.keys(t))if(!(o in r)){if(!(o in e))return`${n}.${o} dropped`;if(!Object.hasOwnProperty.call(e,o)){let s=TX(e[o],t[o],i[o]);if(s)return`${n}.${o} ${s}`}}return!1}function TX(e,t,r){let i=r&&r.equal;return i&&!i(e,t,r)||!i&&(i=e&&t&&e.equals,i&&!i.call(e,t))?\"changed deeply\":!i&&t!==e?\"changed shallowly\":null}function oGt(e,t){if(t===null)return\"oldProps is null, initial diff\";let r=!1,{dataComparator:i,_dataDiff:n}=e;return i?i(e.data,t.data)||(r=\"Data comparator detected a change\"):e.data!==t.data&&(r=\"A new data container was supplied\"),r&&n&&(r=n(e.data,t.data)||r),r}function sGt(e,t){if(t===null)return{all:!0};if(\"all\"in e.updateTriggers&&mAt(e,t,\"all\"))return{all:!0};let r={},i=!1;for(let n in e.updateTriggers)n!==\"all\"&&mAt(e,t,n)&&(r[n]=!0,i=!0);return i?r:!1}function aGt(e,t){if(t===null)return!0;let r=t.extensions,{extensions:i}=e;if(i===r)return!1;if(!r||!i||i.length!==r.length)return!0;for(let n=0;n<i.length;n++)if(!i[n].equals(r[n]))return!0;return!1}function mAt(e,t,r){let i=e.updateTriggers[r];i=i??{};let n=t.updateTriggers[r];return n=n??{},NP({oldProps:n,newProps:i,triggerName:r})}var lGt=\"count(): argument not an object\",cGt=\"count(): argument not a container\";function yAt(e){if(!hGt(e))throw new Error(lGt);if(typeof e.count==\"function\")return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(uGt(e))return Object.keys(e).length;throw new Error(cGt)}function uGt(e){return e!==null&&typeof e==\"object\"&&e.constructor===Object}function hGt(e){return e!==null&&typeof e==\"object\"}function xb(e,t){if(!t)return e;let r={...e,...t};if(\"defines\"in t&&(r.defines={...e.defines,...t.defines}),\"modules\"in t&&(r.modules=(e.modules||[]).concat(t.modules),t.modules.some(i=>i.name===\"project64\"))){let i=r.modules.findIndex(n=>n.name===\"project32\");i>=0&&r.modules.splice(i,1)}if(\"inject\"in t)if(!e.inject)r.inject=t.inject;else{let i={...e.inject};for(let n in t.inject)i[n]=(i[n]||\"\")+t.inject[n];r.inject=i}return r}Ci();var dGt={minFilter:\"linear\",mipmapFilter:\"linear\",magFilter:\"linear\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\"},SX={};function _At(e,t,r,i){if(r instanceof Jo)return r;r.constructor&&r.constructor.name!==\"Object\"&&(r={data:r});let n=null;r.compressed&&(n={minFilter:\"linear\",mipmapFilter:r.data.length>1?\"nearest\":\"linear\"});let{width:o,height:s}=r.data,a=t.createTexture({...r,sampler:{...dGt,...n,...i},mipLevels:t.getMipLevelCount(o,s)});return a.generateMipmapsWebGL(),SX[a.id]=e,a}function vAt(e,t){!t||!(t instanceof Jo)||SX[t.id]===e&&(t.delete(),delete SX[t.id])}var fGt={boolean:{validate(e,t){return!0},equal(e,t,r){return!!e==!!t}},number:{validate(e,t){return Number.isFinite(e)&&(!(\"max\"in t)||e<=t.max)&&(!(\"min\"in t)||e>=t.min)}},color:{validate(e,t){return t.optional&&!e||MX(e)&&(e.length===3||e.length===4)},equal(e,t,r){return to(e,t,1)}},accessor:{validate(e,t){let r=JL(e);return r===\"function\"||r===JL(t.value)},equal(e,t,r){return typeof t==\"function\"?!0:to(e,t,1)}},array:{validate(e,t){return t.optional&&!e||MX(e)},equal(e,t,r){let{compare:i}=r,n=Number.isInteger(i)?i:i?1:0;return i?to(e,t,n):e===t}},object:{equal(e,t,r){if(r.ignore)return!0;let{compare:i}=r,n=Number.isInteger(i)?i:i?1:0;return i?to(e,t,n):e===t}},function:{validate(e,t){return t.optional&&!e||typeof e==\"function\"},equal(e,t,r){return!r.compare&&r.ignore!==!1||e===t}},data:{transform:(e,t,r)=>{if(!e)return e;let{dataTransform:i}=r.props;return i?i(e):typeof e.shape==\"string\"&&e.shape.endsWith(\"-table\")&&Array.isArray(e.data)?e.data:e}},image:{transform:(e,t,r)=>{let i=r.context;return!i||!i.device?null:_At(r.id,i.device,e,{...t.parameters,...r.props.textureParameters})},release:(e,t,r)=>{vAt(r.id,e)}}};function bAt(e){let t={},r={},i={};for(let[n,o]of Object.entries(e)){let s=o?.deprecatedFor;if(s)i[n]=Array.isArray(s)?s:[s];else{let a=pGt(n,o);t[n]=a,r[n]=a.value}}return{propTypes:t,defaultProps:r,deprecatedProps:i}}function pGt(e,t){switch(JL(t)){case\"object\":return zP(e,t);case\"array\":return zP(e,{type:\"array\",value:t,compare:!1});case\"boolean\":return zP(e,{type:\"boolean\",value:t});case\"number\":return zP(e,{type:\"number\",value:t});case\"function\":return zP(e,{type:\"function\",value:t,compare:!0});default:return{name:e,type:\"unknown\",value:t}}}function zP(e,t){return\"type\"in t?{name:e,...fGt[t.type],...t}:\"value\"in t?{name:e,type:JL(t.value),...t}:{name:e,type:\"object\",value:t}}function MX(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function JL(e){return MX(e)?\"array\":e===null?\"null\":typeof e}function xAt(e,t){let r;for(let o=t.length-1;o>=0;o--){let s=t[o];\"extensions\"in s&&(r=s.extensions)}let i=EX(e.constructor,r),n=Object.create(i);n[L3]=e,n[x0]={},n[Gf]={};for(let o=0;o<t.length;++o){let s=t[o];for(let a in s)n[a]=s[a]}return Object.freeze(n),n}var mGt=\"_mergedDefaultProps\";function EX(e,t){if(!(e instanceof t9.constructor))return{};let r=mGt;if(t)for(let n of t){let o=n.constructor;o&&(r+=`:${o.extensionName||o.name}`)}let i=wAt(e,r);return i||(e[r]=gGt(e,t||[]))}function gGt(e,t){if(!e.prototype)return null;let i=Object.getPrototypeOf(e),n=EX(i),o=wAt(e,\"defaultProps\")||{},s=bAt(o),a=Object.assign(Object.create(null),n,s.defaultProps),h=Object.assign(Object.create(null),n?.[Ld],s.propTypes),p=Object.assign(Object.create(null),n?.[lL],s.deprecatedProps);for(let g of t){let w=EX(g.constructor);w&&(Object.assign(a,w),Object.assign(h,w[Ld]),Object.assign(p,w[lL]))}return AGt(a,e),_Gt(a,h),yGt(a,p),a[Ld]=h,a[lL]=p,t.length===0&&!PX(e,\"_propTypes\")&&(e._propTypes=h),a}function AGt(e,t){let r=bGt(t);Object.defineProperties(e,{id:{writable:!0,value:r}})}function yGt(e,t){for(let r in t)Object.defineProperty(e,r,{enumerable:!1,set(i){let n=`${this.id}: ${r}`;for(let o of t[r])PX(this,o)||(this[o]=i);hr.deprecated(n,t[r].join(\"/\"))()}})}function _Gt(e,t){let r={},i={};for(let n in t){let o=t[n],{name:s,value:a}=o;o.async&&(r[s]=a,i[s]=vGt(s))}e[Bg]=r,e[x0]={},Object.defineProperties(e,i)}function vGt(e){return{enumerable:!0,set(t){typeof t==\"string\"||t instanceof Promise||WL(t)?this[x0][e]=t:this[Gf][e]=t},get(){if(this[Gf]){if(e in this[Gf])return this[Gf][e]||this[Bg][e];if(e in this[x0]){let t=this[L3]&&this[L3].internalState;if(t&&t.hasAsyncProp(e))return t.getAsyncProp(e)||this[Bg][e]}}return this[Bg][e]}}}function PX(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wAt(e,t){return PX(e,t)&&e[t]}function bGt(e){let t=e.componentName;return t||hr.warn(`${e.name}.componentName not specified`)(),t||e.name}var xGt=0,UP=class{constructor(...t){this.props=xAt(this,t),this.id=this.props.id,this.count=xGt++}clone(t){let{props:r}=this,i={};for(let n in r[Bg])n in r[Gf]?i[n]=r[Gf][n]:n in r[x0]&&(i[n]=r[x0][n]);return new this.constructor({...r,...i,...t})}};UP.componentName=\"Component\";UP.defaultProps={};var t9=UP;var wGt=Object.freeze({}),VP=class{constructor(t){this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(let t in this.asyncProps){let r=this.asyncProps[t];r&&r.type&&r.type.release&&r.type.release(r.resolvedValue,r.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||wGt}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){let r=this.asyncProps[t];return r&&r.resolvedValue}isAsyncPropLoading(t){if(t){let r=this.asyncProps[t];return!!(r&&r.pendingLoadCount>0&&r.pendingLoadCount!==r.resolvedLoadCount)}for(let r in this.asyncProps)if(this.isAsyncPropLoading(r))return!0;return!1}reloadAsyncProp(t,r){this._watchPromise(t,Promise.resolve(r))}setAsyncProps(t){this.component=t[L3]||this.component;let r=t[Gf]||{},i=t[x0]||t,n=t[Bg]||{};for(let o in r){let s=r[o];this._createAsyncPropData(o,n[o]),this._updateAsyncProp(o,s),r[o]=this.getAsyncProp(o)}for(let o in i){let s=i[o];this._createAsyncPropData(o,n[o]),this._updateAsyncProp(o,s)}}_fetch(t,r){return null}_onResolve(t,r){}_onError(t,r){}_updateAsyncProp(t,r){if(this._didAsyncInputValueChange(t,r)){if(typeof r==\"string\"&&(r=this._fetch(t,r)),r instanceof Promise){this._watchPromise(t,r);return}if(WL(r)){this._resolveAsyncIterable(t,r);return}this._setPropValue(t,r)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(let t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,r){let i=this.asyncProps[t];return r===i.resolvedValue||r===i.lastValue?!1:(i.lastValue=r,!0)}_setPropValue(t,r){this._freezeAsyncOldProps();let i=this.asyncProps[t];i&&(r=this._postProcessValue(i,r),i.resolvedValue=r,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount)}_setAsyncPropValue(t,r,i){let n=this.asyncProps[t];n&&i>=n.resolvedLoadCount&&r!==void 0&&(this._freezeAsyncOldProps(),n.resolvedValue=r,n.resolvedLoadCount=i,this.onAsyncPropUpdated(t,r))}_watchPromise(t,r){let i=this.asyncProps[t];if(i){i.pendingLoadCount++;let n=i.pendingLoadCount;r.then(o=>{this.component&&(o=this._postProcessValue(i,o),this._setAsyncPropValue(t,o,n),this._onResolve(t,o))}).catch(o=>{this._onError(t,o)})}}async _resolveAsyncIterable(t,r){if(t!==\"data\"){this._setPropValue(t,r);return}let i=this.asyncProps[t];if(!i)return;i.pendingLoadCount++;let n=i.pendingLoadCount,o=[],s=0;for await(let a of r){if(!this.component)return;let{dataTransform:h}=this.component.props;h?o=h(a,o):o=o.concat(a),Object.defineProperty(o,\"__diff\",{enumerable:!1,value:[{startRow:s,endRow:o.length}]}),s=o.length,this._setAsyncPropValue(t,o,n)}this._onResolve(t,o)}_postProcessValue(t,r){let i=t.type;return i&&this.component&&(i.release&&i.release(t.resolvedValue,i,this.component),i.transform)?i.transform(r,i,this.component):r}_createAsyncPropData(t,r){if(!this.asyncProps[t]){let n=this.component&&this.component.props[Ld];this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:r,pendingLoadCount:0,resolvedLoadCount:0}}}};var jP=class extends VP{constructor({attributeManager:t,layer:r}){super(r),this.attributeManager=t,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(t,r){let i=this.layer,n=i?.props.fetch;return n?n(r,{propName:t,layer:i}):super._fetch(t,r)}_onResolve(t,r){let i=this.layer;if(i){let n=i.props.onDataLoad;t===\"data\"&&n&&n(r,{propName:t,layer:i})}}_onError(t,r){let i=this.layer;i&&i.raiseError(r,`loading ${t} of ${this.layer}`)}};var TGt=\"layer.changeFlag\",SGt=\"layer.initialize\",MGt=\"layer.update\",EGt=\"layer.finalize\",PGt=\"layer.matched\",TAt=2**24-1,CGt=Object.freeze([]),IGt=b0(({oldViewport:e,viewport:t})=>e.equals(t)),Zf=new Uint8ClampedArray(0),kGt={data:{type:\"data\",value:CGt,async:!0},dataComparator:{type:\"function\",value:null,optional:!0},_dataDiff:{type:\"function\",value:e=>e&&e.__diff,optional:!0},dataTransform:{type:\"function\",value:null,optional:!0},onDataLoad:{type:\"function\",value:null,optional:!0},onError:{type:\"function\",value:null,optional:!0},fetch:{type:\"function\",value:(e,{propName:t,layer:r,loaders:i,loadOptions:n,signal:o})=>{let{resourceManager:s}=r.context;n=n||r.getLoadOptions(),i=i||r.props.loaders,o&&(n={...n,fetch:{...n?.fetch,signal:o}});let a=s.contains(e);return!a&&!n&&(s.add({resourceId:e,data:n1(e,i),persistent:!1}),a=!0),a?s.subscribe({resourceId:e,onChange:h=>r.internalState?.reloadAsyncProp(t,h),consumerId:r.id,requestId:t}):n1(e,i,n)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:\"number\",min:0,max:1,value:1},operation:\"draw\",onHover:{type:\"function\",value:null,optional:!0},onClick:{type:\"function\",value:null,optional:!0},onDragStart:{type:\"function\",value:null,optional:!0},onDrag:{type:\"function\",value:null,optional:!0},onDragEnd:{type:\"function\",value:null,optional:!0},coordinateSystem:Vr.DEFAULT,coordinateOrigin:{type:\"array\",value:[0,0,0],compare:!0},modelMatrix:{type:\"array\",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:\"XYZ\",colorFormat:\"RGBA\",parameters:{type:\"object\",value:{},optional:!0,compare:2},loadOptions:{type:\"object\",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:\"array\",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:\"function\",value:({layerIndex:e})=>[0,-e*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:\"accessor\",value:[0,0,128,128]}},$P=class extends t9{constructor(){super(...arguments),this.internalState=null,this.lifecycle=m1.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,\"layerName\")?this.layerName:\"\"}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(t){_r(this.internalState);let r=this.internalState.viewport||this.context.viewport,i=VY(t,{viewport:r,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,o,s]=P3(i,r.pixelProjectionMatrix);return t.length===2?[n,o]:[n,o,s]}unproject(t){return _r(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,r){_r(this.internalState);let i=this.internalState.viewport||this.context.viewport;return cmt(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...r})}get isComposite(){return!1}get isDrawable(){return!0}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){let t=this.state;return t&&(t.models||t.model&&[t.model])||[]}setShaderModuleProps(...t){for(let r of this.getModels())r.shaderInputs.setProps(...t)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){let{coordinateSystem:t}=this.props;return t===Vr.DEFAULT||t===Vr.LNGLAT||t===Vr.CARTESIAN}onHover(t,r){return this.props.onHover&&this.props.onHover(t,r)||!1}onClick(t,r){return this.props.onClick&&this.props.onClick(t,r)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t,r=[]){return r[0]=t+1&255,r[1]=t+1>>8&255,r[2]=t+1>>8>>8&255,r}decodePickingColor(t){_r(t instanceof Uint8Array);let[r,i,n]=t;return r+i*256+n*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:yAt(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){return this.getAttributeManager()?.getBounds([\"positions\",\"instancePositions\"])}getShaders(t){t=xb(t,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(let r of this.props.extensions)t=xb(t,r.getShaders.call(this,r));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){let r=this.getAttributeManager(),{dataChanged:i}=t.changeFlags;if(i&&r)if(Array.isArray(i))for(let n of i)r.invalidateAll(n);else r.invalidateAll();if(r){let{props:n}=t,o=this.internalState.hasPickingBuffer,s=Number.isInteger(n.highlightedObjectIndex)||!!n.pickable||n.extensions.some(a=>a.getNeedsPickingBuffer.call(this,a));if(o!==s){this.internalState.hasPickingBuffer=s;let{pickingColors:a,instancePickingColors:h}=r.attributes,p=a||h;p&&(s&&p.constant&&(p.constant=!1,r.invalidate(p.id)),!p.value&&!s&&(p.constant=!0,p.value=[0,0,0]))}}}finalizeState(t){for(let i of this.getModels())i.destroy();let r=this.getAttributeManager();r&&r.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(let r of this.getModels())r.draw(t.renderPass)}getPickingInfo({info:t,mode:r,sourceLayer:i}){let{index:n}=t;return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}raiseError(t,r){r&&(t=new Error(`${r}: ${t.message}`,{cause:t})),this.props.onError?.(t)||this.context?.onError?.(t,this)}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){return this.internalState?.uniformTransitions.active||!1}activateViewport(t){if(!this.internalState)return;let r=this.internalState.viewport;this.internalState.viewport=t,(!r||!IGt({oldViewport:r,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t=\"all\"){let r=this.getAttributeManager();r&&(t===\"all\"?r.invalidateAll():r.invalidate(t))}updateAttributes(t){let r=!1;for(let i in t)t[i].layoutChanged()&&(r=!0);for(let i of this.getModels())this._setModelAttributes(i,t,r)}_updateAttributes(){let t=this.getAttributeManager();if(!t)return;let r=this.props,i=this.getNumInstances(),n=this.getStartIndices();t.update({data:r.data,numInstances:i,startIndices:n,props:r,transitions:r.transitions,buffers:r.data.attributes,context:this});let o=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){let t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){let{uniformTransitions:t}=this.internalState;if(t.active){let r=t.update(),i=Object.create(this.props);for(let n in r)Object.defineProperty(i,n,{value:r[n]});return i}return this.props}calculateInstancePickingColors(t,{numInstances:r}){if(t.constant)return;let i=Math.floor(Zf.length/4);if(this.internalState.usesPickingColorCache=!0,i<r){r>TAt&&hr.warn(\"Layer has too many data objects. Picking might not be able to distinguish all objects.\")(),Zf=$f.allocate(Zf,r,{size:4,copy:!0,maxCount:Math.max(r,TAt)});let n=Math.floor(Zf.length/4),o=[0,0,0];for(let s=i;s<n;s++)this.encodePickingColor(s,o),Zf[s*4+0]=o[0],Zf[s*4+1]=o[1],Zf[s*4+2]=o[2],Zf[s*4+3]=0}t.value=Zf.subarray(0,r*4)}_setModelAttributes(t,r,i=!1){if(!Object.keys(r).length)return;if(i){let a=this.getAttributeManager();t.setBufferLayout(a.getBufferLayouts(t)),r=a.getAttributes()}let n=t.userData?.excludeAttributes||{},o={},s={};for(let a in r){if(n[a])continue;let h=r[a].getValue();for(let p in h){let g=h[p];g instanceof on?r[a].settings.isIndexed?t.setIndexBuffer(g):o[p]=g:g&&(s[p]=g)}}t.setAttributes(o),t.setConstantAttributes(s)}disablePickingIndex(t){let r=this.props.data;if(!(\"attributes\"in r)){this._disablePickingIndex(t);return}let{pickingColors:i,instancePickingColors:n}=this.getAttributeManager().attributes,o=i||n,s=o&&r.attributes&&r.attributes[o.id];if(s&&s.value){let a=s.value,h=this.encodePickingColor(t);for(let p=0;p<r.length;p++){let g=o.getVertexOffset(p);a[g]===h[0]&&a[g+1]===h[1]&&a[g+2]===h[2]&&this._disablePickingIndex(p)}}else this._disablePickingIndex(t)}_disablePickingIndex(t){let{pickingColors:r,instancePickingColors:i}=this.getAttributeManager().attributes,n=r||i;if(!n)return;let o=n.getVertexOffset(t),s=n.getVertexOffset(t+1);n.buffer.write(new Uint8Array(s-o),o)}restorePickingColors(){let{pickingColors:t,instancePickingColors:r}=this.getAttributeManager().attributes,i=t||r;i&&(this.internalState.usesPickingColorCache&&i.value.buffer!==Zf.buffer&&(i.value=Zf.subarray(0,i.value.length)),i.updateSubBuffer({startOffset:0}))}_initialize(){_r(!this.internalState),_r(Number.isFinite(this.props.coordinateSystem)),ys(SGt,this);let t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:\"uint8\",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new jP({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,\"attributeManager\",{get:()=>(hr.deprecated(\"layer.state.attributeManager\",\"layer.getAttributeManager()\")(),t)}),this.internalState.uniformTransitions=new FP(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(let r of this.props.extensions)r.initializeState.call(this,this.context,r);this.setChangeFlags({dataChanged:\"init\",propsChanged:\"init\",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){ys(PGt,this,this===t);let{state:r,internalState:i}=t;this!==t&&(this.internalState=i,this.state=r,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){let t=this.needsUpdate();if(ys(MGt,this,t),!t)return;let r=this.props,i=this.context,n=this.internalState,o=i.viewport,s=this._updateUniformTransition();n.propsInTransition=s,i.viewport=n.viewport||o,this.props=s;try{let a=this._getUpdateParams(),h=this.getModels();if(i.device)this.updateState(a);else try{this.updateState(a)}catch{}for(let g of this.props.extensions)g.updateState.call(this,a,g);this.setNeedsRedraw(),this._updateAttributes();let p=this.getModels()[0]!==h[0];this._postUpdate(a,p)}finally{i.viewport=o,this.props=r,this._clearChangeFlags(),n.needsUpdate=!1,n.resetOldProps()}}_finalize(){ys(EGt,this),this.finalizeState(this.context);for(let t of this.props.extensions)t.finalizeState.call(this,this.context,t)}_drawLayer({renderPass:t,shaderModuleProps:r=null,uniforms:i={},parameters:n={}}){this._updateAttributeTransition();let o=this.props,s=this.context;this.props=this.internalState.propsInTransition||o;try{r&&this.setShaderModuleProps(r);let{getPolygonOffset:a}=this.props,h=a&&a(i)||[0,0];s.device instanceof vb&&s.device.setParametersWebGL({polygonOffset:h});for(let p of this.getModels())p.device.type===\"webgpu\"?p.setParameters({...p.parameters,...n}):p.setParameters(n);if(s.device instanceof vb)s.device.withParametersWebGL(n,()=>{let p={renderPass:t,shaderModuleProps:r,uniforms:i,parameters:n,context:s};for(let g of this.props.extensions)g.draw.call(this,p,g);this.draw(p)});else{let p={renderPass:t,shaderModuleProps:r,uniforms:i,parameters:n,context:s};for(let g of this.props.extensions)g.draw.call(this,p,g);this.draw(p)}}finally{this.props=o}}getChangeFlags(){return this.internalState?.changeFlags}setChangeFlags(t){if(!this.internalState)return;let{changeFlags:r}=this.internalState;for(let n in t)if(t[n]){let o=!1;switch(n){case\"dataChanged\":let s=t[n],a=r[n];s&&Array.isArray(a)&&(r.dataChanged=Array.isArray(s)?a.concat(s):s,o=!0);default:r[n]||(r[n]=t[n],o=!0)}o&&ys(TGt,this,n,t)}let i=!!(r.dataChanged||r.updateTriggersChanged||r.propsChanged||r.extensionsChanged);r.propsOrDataChanged=i,r.somethingChanged=i||r.viewportChanged||r.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,r){let i=AAt(t,r);if(i.updateTriggersChanged)for(let n in i.updateTriggersChanged)i.updateTriggersChanged[n]&&this.invalidateAttribute(n);if(i.transitionsChanged)for(let n in i.transitionsChanged)this.internalState.uniformTransitions.add(n,r[n],t[n],t.transitions?.[n]);return this.setChangeFlags(i)}validateProps(){gAt(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){let r={highlightedObjectColor:t.picked?t.color:null},{highlightColor:i}=this.props;t.picked&&typeof i==\"function\"&&(r.highlightColor=i(t)),this.setShaderModuleProps({picking:r}),this.setNeedsRedraw()}_getAttributeManager(){let t=this.context;return new P0(t.device,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,r){let{props:i,oldProps:n}=t,o=this.state.model;o?.isInstanced&&o.setInstanceCount(this.getNumInstances());let{autoHighlight:s,highlightedObjectIndex:a,highlightColor:h}=i;if(r||n.autoHighlight!==s||n.highlightedObjectIndex!==a||n.highlightColor!==h){let p={};Array.isArray(h)&&(p.highlightColor=h),(r||n.autoHighlight!==s||a!==n.highlightedObjectIndex)&&(p.highlightedObjectColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setShaderModuleProps({picking:p})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let r=!1;r=r||this.internalState.needsRedraw&&this.id;let i=this.getAttributeManager(),n=i?i.getNeedsRedraw(t):!1;if(r=r||n,r)for(let o of this.props.extensions)o.onNeedsRedraw.call(this,o);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags,r}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}};$P.defaultProps=kGt;$P.layerName=\"Layer\";var ho=$P;var RGt=\"compositeLayer.renderLayers\",e9=class extends ho{get isComposite(){return!0}get isDrawable(){return!1}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){let{object:r}=t;return r&&r.__source&&r.__source.parent&&r.__source.parent.id===this.id&&(t.object=r.__source.object,t.index=r.__source.index),t}filterSubLayer(t){return!0}shouldRenderSubLayer(t,r){return r&&r.length}getSubLayerClass(t,r){let{_subLayerProps:i}=this.props;return i&&i[t]&&i[t].type||r}getSubLayerRow(t,r,i){return t.__source={parent:this,object:r,index:i},t}getSubLayerAccessor(t){if(typeof t==\"function\"){let r={index:-1,data:this.props.data,target:[]};return(i,n)=>i&&i.__source?(r.index=i.__source.index,t(i.__source.object,r)):t(i,n)}return t}getSubLayerProps(t={}){let{opacity:r,pickable:i,visible:n,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:h,highlightColor:p,coordinateSystem:g,coordinateOrigin:w,wrapLongitude:C,positionFormat:R,modelMatrix:z,extensions:W,fetch:Y,operation:H,_subLayerProps:Q}=this.props,tt={id:\"\",updateTriggers:{},opacity:r,pickable:i,visible:n,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:h,highlightColor:p,coordinateSystem:g,coordinateOrigin:w,wrapLongitude:C,positionFormat:R,modelMatrix:z,extensions:W,fetch:Y,operation:H},rt=Q&&t.id&&Q[t.id],at=rt&&rt.updateTriggers,et=t.id||\"sublayer\";if(rt){let lt=this.props[Ld],J=t.type?t.type._propTypes:{};for(let ft in rt){let dt=J[ft]||lt[ft];dt&&dt.type===\"accessor\"&&(rt[ft]=this.getSubLayerAccessor(rt[ft]))}}Object.assign(tt,t,rt),tt.id=`${this.props.id}-${et}`,tt.updateTriggers={all:this.props.updateTriggers?.all,...t.updateTriggers,...at};for(let lt of W){let J=lt.getSubLayerProps.call(this,lt);J&&Object.assign(tt,J,{updateTriggers:Object.assign(tt.updateTriggers,J.updateTriggers)})}return tt}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,r){let i=this.internalState.subLayers,n=!i||this.needsUpdate();if(n){let o=this.renderLayers();i=Il(o,Boolean),this.internalState.subLayers=i}ys(RGt,this,n,i);for(let o of i)o.parent=this}};e9.layerName=\"CompositeLayer\";var bi=e9;var CX=Math.PI/180;function DGt({height:e,focalDistance:t,orbitAxis:r,rotationX:i,rotationOrbit:n,zoom:o}){let s=r===\"Z\"?[0,0,1]:[0,1,0],a=r===\"Z\"?[0,-t,0]:[0,0,t],h=new Ji().lookAt({eye:a,up:s});h.rotateX(i*CX),r===\"Z\"?h.rotateZ(n*CX):h.rotateY(n*CX);let p=Math.pow(2,o)/e;return h.scale(p),h}var r9=class extends Dd{constructor(t){let{height:r,projectionMatrix:i,fovy:n=50,orbitAxis:o=\"Z\",target:s=[0,0,0],rotationX:a=0,rotationOrbit:h=0,zoom:p=0}=t,g=i?i[5]/2:Lg(n);super({...t,longitude:void 0,viewMatrix:DGt({height:r||1,focalDistance:g,orbitAxis:o,rotationX:a,rotationOrbit:h,zoom:p}),fovy:n,focalDistance:g,position:s,zoom:p}),this.target=s,this.orbitAxis=o,this.rotationX=a,this.rotationOrbit=h,this.fovy=n,this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:r=!0}={}){let[i,n,o=this.projectedCenter[2]]=t,s=r?n:this.height-n,[a,h,p]=kd([i,s,o],this.pixelUnprojectionMatrix);return[a,h,p]}panByPosition(t,r,i){let n=this.project(t),o=[this.width/2+n[0]-r[0],this.height/2+n[1]-r[1],this.projectedCenter[2]];return{target:this.unproject(o)}}};r9.displayName=\"OrbitViewport\";var SAt=r9;var OGt=new Ji().lookAt({eye:[0,0,1]});function LGt({width:e,height:t,near:r,far:i,padding:n}){let o=-e/2,s=e/2,a=-t/2,h=t/2;if(n){let{left:p=0,right:g=0,top:w=0,bottom:C=0}=n,R=_n((p+e-g)/2,0,e)-e/2,z=_n((w+t-C)/2,0,t)-t/2;o-=R,s-=R,a+=z,h+=z}return new Ji().ortho({left:o,right:s,bottom:a,top:h,near:r,far:i})}var i9=class extends Dd{constructor(t){let{width:r,height:i,near:n=.1,far:o=1e3,zoom:s=0,target:a=[0,0,0],padding:h=null,flipY:p=!0}=t,g=t.zoomX??(Array.isArray(s)?s[0]:s),w=t.zoomY??(Array.isArray(s)?s[1]:s),C=Math.min(g,w),R=Math.pow(2,C),z;if(g!==w){let W=Math.pow(2,g),Y=Math.pow(2,w);z={unitsPerMeter:[W/R,Y/R,1],metersPerUnit:[R/W,R/Y,1]}}super({...t,longitude:void 0,position:a,viewMatrix:OGt.clone().scale([R,R*(p?-1:1),R]),projectionMatrix:LGt({width:r||1,height:i||1,padding:h,near:n,far:o}),zoom:C,distanceScales:z}),this.target=a,this.zoomX=g,this.zoomY=w,this.flipY=p}projectFlat([t,r]){let{unitsPerMeter:i}=this.distanceScales;return[t*i[0],r*i[1]]}unprojectFlat([t,r]){let{metersPerUnit:i}=this.distanceScales;return[t*i[0],r*i[1]]}panByPosition(t,r,i){let n=kd(r,this.pixelUnprojectionMatrix),o=this.projectFlat(t),s=Ea.add([],o,Ea.negate([],n)),a=Ea.add([],this.center,s);return{target:this.unprojectFlat(a)}}};i9.displayName=\"OrthographicViewport\";var MAt=i9;var n9=class extends Dd{constructor(t){let{longitude:r,latitude:i,modelMatrix:n,bearing:o=0,pitch:s=0,up:a=[0,0,1]}=t,p=new Ig({bearing:o,pitch:s===-90?1e-4:90+s}).toVector3().normalize(),g=n?new Ji(n).transformAsVector(p):p,w=Number.isFinite(i)?rP({latitude:i}):0,C=Math.pow(2,w),R=new Ji().lookAt({eye:[0,0,0],center:g,up:a}).scale(C);super({...t,zoom:w,viewMatrix:R}),this.latitude=i,this.longitude=r,this.pitch=s,this.bearing=o,this.up=a}};n9.displayName=\"FirstPersonViewport\";var EAt=n9;var wb=20,PAt=500,IX=class e extends Ug{constructor(t){let{width:r,height:i,position:n=[0,0,0],bearing:o=0,pitch:s=0,longitude:a=null,latitude:h=null,maxPitch:p=90,minPitch:g=-90,startRotatePos:w,startBearing:C,startPitch:R,startZoomPosition:z,startPanPos:W,startPanPosition:Y}=t;super({width:r,height:i,position:n,bearing:o,pitch:s,longitude:a,latitude:h,maxPitch:p,minPitch:g},{startRotatePos:w,startBearing:C,startPitch:R,startZoomPosition:z,startPanPos:W,startPanPosition:Y}),this.makeViewport=t.makeViewport}panStart({pos:t}){let{position:r}=this.getViewportProps();return this._getUpdatedState({startPanPos:t,startPanPosition:r})}pan({pos:t}){if(!t)return this;let{startPanPos:r=[0,0],startPanPosition:i=[0,0]}=this.getState(),{width:n,height:o,bearing:s,pitch:a}=this.getViewportProps(),h=PAt*(t[0]-r[0])/n,p=PAt*(t[1]-r[1])/o,g=new Ig({bearing:s,pitch:a}),w=new Ig({bearing:s,pitch:-90}),C=g.toVector3().normalize(),R=w.toVector3().cross(C).normalize();return this._getUpdatedState({position:new rr(i).add(R.scale(h)).add(C.scale(p))})}panEnd(){return this._getUpdatedState({startPanPos:null,startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:t,deltaAngleX:r=0,deltaAngleY:i=0}){let{startRotatePos:n,startBearing:o,startPitch:s}=this.getState(),{width:a,height:h}=this.getViewportProps();if(!n||o===void 0||s===void 0)return this;let p;if(t){let g=(t[0]-n[0])/a,w=(t[1]-n[1])/h;p={bearing:o-g*180,pitch:s-w*90}}else p={bearing:o-r,pitch:s-i};return this._getUpdatedState(p)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}zoom({pos:t,scale:r}){let i=this.getViewportProps(),n=this.getState().startZoomPosition||i.position,o=this.makeViewport(i),{projectionMatrix:s,width:a}=o,p=2*Math.atan(1/s[0])*(t[0]/a-.5),g=this.getDirection(!0);return this._move(g.rotateZ({radians:-p}),Math.log2(r)*wb,n)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null})}moveLeft(t=wb){let r=this.getDirection(!0);return this._move(r.rotateZ({radians:Math.PI/2}),t)}moveRight(t=wb){let r=this.getDirection(!0);return this._move(r.rotateZ({radians:-Math.PI/2}),t)}moveUp(t=wb){let r=this.getDirection(!0);return this._move(r,t)}moveDown(t=wb){let r=this.getDirection(!0);return this._move(r.negate(),t)}rotateLeft(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}zoomIn(t=wb){return this._move(new rr(0,0,1),t)}zoomOut(t=wb){return this._move(new rr(0,0,-1),t)}shortestPathFrom(t){let r=t.getViewportProps(),i={...this.getViewportProps()},{bearing:n,longitude:o}=i;return Math.abs(n-r.bearing)>180&&(i.bearing=n<0?n+360:n-360),o!==null&&r.longitude!==null&&Math.abs(o-r.longitude)>180&&(i.longitude=o<0?o+360:o-360),i}_move(t,r,i=this.getViewportProps().position){let n=t.scale(r);return this._getUpdatedState({position:new rr(i).add(n)})}getDirection(t=!1){return new Ig({bearing:this.getViewportProps().bearing,pitch:t?90:90+this.getViewportProps().pitch}).toVector3().normalize()}_getUpdatedState(t){return new e({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){let{pitch:r,maxPitch:i,minPitch:n,longitude:o,bearing:s}=t;return t.pitch=_n(r,n,i),o!==null&&(o<-180||o>180)&&(t.longitude=db(o+180,360)-180),(s<-180||s>180)&&(t.bearing=db(s+180,360)-180),t}},GP=class extends vh{constructor(){super(...arguments),this.ControllerState=IX,this.transition={transitionDuration:300,transitionInterpolator:new el([\"position\",\"pitch\",\"bearing\"])}}};var o9=class extends Ws{constructor(t={}){super(t)}getViewportType(){return EAt}get ControllerType(){return GP}};o9.displayName=\"FirstPersonView\";var kX=o9;var WP=class extends Ug{constructor(t){let{width:r,height:i,rotationX:n=0,rotationOrbit:o=0,target:s=[0,0,0],zoom:a=0,minRotationX:h=-90,maxRotationX:p=90,minZoom:g=-1/0,maxZoom:w=1/0,startPanPosition:C,startRotatePos:R,startRotationX:z,startRotationOrbit:W,startZoomPosition:Y,startZoom:H}=t;super({width:r,height:i,rotationX:n,rotationOrbit:o,target:s,zoom:a,minRotationX:h,maxRotationX:p,minZoom:g,maxZoom:w},{startPanPosition:C,startRotatePos:R,startRotationX:z,startRotationOrbit:W,startZoomPosition:Y,startZoom:H}),this.makeViewport=t.makeViewport}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:r}){let i=this.getState().startPanPosition||r;if(!i)return this;let o=this.makeViewport(this.getViewportProps()).panByPosition(i,t);return this._getUpdatedState(o)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate({pos:t,deltaAngleX:r=0,deltaAngleY:i=0}){let{startRotatePos:n,startRotationX:o,startRotationOrbit:s}=this.getState(),{width:a,height:h}=this.getViewportProps();if(!n||o===void 0||s===void 0)return this;let p;if(t){let g=(t[0]-n[0])/a,w=(t[1]-n[1])/h;(o<-90||o>90)&&(g*=-1),p={rotationX:o+w*180,rotationOrbit:s+g*180}}else p={rotationX:o+i,rotationOrbit:s+r};return this._getUpdatedState(p)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){let r=t.getViewportProps(),i={...this.getViewportProps()},{rotationOrbit:n}=i;return Math.abs(n-r.rotationOrbit)>180&&(i.rotationOrbit=n<0?n+360:n-360),i}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this.getViewportProps().zoom})}zoom({pos:t,startPos:r,scale:i}){let{startZoom:n,startZoomPosition:o}=this.getState();if(o||(n=this.getViewportProps().zoom,o=this._unproject(r||t)),!o)return this;let s=this._calculateNewZoom({scale:i,startZoom:n}),a=this.makeViewport({...this.getViewportProps(),zoom:s});return this._getUpdatedState({zoom:s,...a.panByPosition(o,t)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+t})}_project(t){return this.makeViewport(this.getViewportProps()).project(t)}_unproject(t){return this.makeViewport(this.getViewportProps()).unproject(t)}_calculateNewZoom({scale:t,startZoom:r}){let{maxZoom:i,minZoom:n}=this.getViewportProps();r===void 0&&(r=this.getViewportProps().zoom);let o=r+Math.log2(t);return _n(o,n,i)}_panFromCenter(t){let{target:r}=this.getViewportProps(),i=this._project(r);return this.pan({startPosition:r,pos:[i[0]+t[0],i[1]+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){let{maxZoom:r,minZoom:i,zoom:n,maxRotationX:o,minRotationX:s,rotationOrbit:a}=t;return t.zoom=Array.isArray(n)?[_n(n[0],i,r),_n(n[1],i,r)]:_n(n,i,r),t.rotationX=_n(t.rotationX,s,o),(a<-180||a>180)&&(t.rotationOrbit=db(a+180,360)-180),t}},qP=class extends vh{constructor(){super(...arguments),this.ControllerState=WP,this.transition={transitionDuration:300,transitionInterpolator:new el({transitionProps:{compare:[\"target\",\"zoom\",\"rotationX\",\"rotationOrbit\"],required:[\"target\",\"zoom\"]}})}}};var s9=class extends Ws{constructor(t={}){super(t),this.props.orbitAxis=t.orbitAxis||\"Z\"}getViewportType(){return SAt}get ControllerType(){return qP}};s9.displayName=\"OrbitView\";var RX=s9;var DX=class extends WP{constructor(t){super(t),this.zoomAxis=t.zoomAxis||\"all\"}_calculateNewZoom({scale:t,startZoom:r}){let{maxZoom:i,minZoom:n}=this.getViewportProps();r===void 0&&(r=this.getViewportProps().zoom);let o=Math.log2(t);if(Array.isArray(r)){let[s,a]=r;switch(this.zoomAxis){case\"X\":s=_n(s+o,n,i);break;case\"Y\":a=_n(a+o,n,i);break;default:let h=Math.min(s+o,a+o);h<n&&(o+=n-h),h=Math.max(s+o,a+o),h>i&&(o+=i-h),s+=o,a+=o}return[s,a]}return _n(r+o,n,i)}},HP=class extends vh{constructor(){super(...arguments),this.ControllerState=DX,this.transition={transitionDuration:300,transitionInterpolator:new el([\"target\",\"zoom\"])},this.dragMode=\"pan\"}_onPanRotate(){return!1}};var a9=class extends Ws{constructor(t={}){super(t)}getViewportType(){return MAt}get ControllerType(){return HP}};a9.displayName=\"OrthographicView\";var OX=a9;var LX=class extends pP{constructor(t){let{startPanPos:r,...i}=t;super(i),r!==void 0&&(this._state.startPanPos=r)}panStart({pos:t}){let{latitude:r,longitude:i,zoom:n}=this.getViewportProps();return this._getUpdatedState({startPanLngLat:[i,r],startPanPos:t,startZoom:n})}pan({pos:t,startPos:r}){let i=this.getState(),n=i.startPanLngLat||this._unproject(r);if(!n)return this;let o=i.startZoom??this.getViewportProps().zoom,s=i.startPanPos||r,a=[n[0],n[1],o],p=this.makeViewport(this.getViewportProps()).panByPosition(a,t,s);return this._getUpdatedState(p)}panEnd(){return this._getUpdatedState({startPanLngLat:null,startPanPos:null,startZoom:null})}zoom({scale:t}){let i=(this.getState().startZoom||this.getViewportProps().zoom)+Math.log2(t);return this._getUpdatedState({zoom:i})}applyConstraints(t){let{longitude:r,latitude:i,maxZoom:n,minZoom:o,zoom:s}=t,a=Ab(0),h=Ab(i)-a;return t.zoom=_n(s,o+h,n+h),(r<-180||r>180)&&(t.longitude=db(r+180,360)-180),t.latitude=_n(i,-wu,wu),t}},YP=class extends vh{constructor(){super(...arguments),this.ControllerState=LX,this.transition={transitionDuration:300,transitionInterpolator:new el([\"longitude\",\"latitude\",\"zoom\"])},this.dragMode=\"pan\"}setProps(t){super.setProps(t),this.dragRotate=!1,this.touchRotate=!1}};var l9=class extends Ws{constructor(t={}){super(t)}getViewportType(t){return t.zoom>12?_h:qf}get ControllerType(){return YP}};l9.displayName=\"GlobeView\";var Tb=l9;var XP=class{static get componentName(){return Object.prototype.hasOwnProperty.call(this,\"extensionName\")?this.extensionName:\"\"}constructor(t){t&&(this.opts=t)}equals(t){return this===t?!0:this.constructor===t.constructor&&to(this.opts,t.opts,1)}getShaders(t){return null}getSubLayerProps(t){let{defaultProps:r}=t.constructor,i={updateTriggers:{}};for(let n in r)if(n in this.props){let o=r[n],s=this.props[n];i[n]=s,o&&o.type===\"accessor\"&&(i.updateTriggers[n]=this.props.updateTriggers[n],typeof s==\"function\"&&(i[n]=this.getSubLayerAccessor(s)))}return i}initializeState(t,r){}updateState(t,r){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,r){}finalizeState(t,r){}};XP.defaultProps={};XP.extensionName=\"LayerExtension\";var Vg=XP;var BX={bearing:0,pitch:0,position:[0,0,0]},BGt={speed:1.2,curve:1.414},C0=class extends gb{constructor(t={}){super({compare:[\"longitude\",\"latitude\",\"zoom\",\"bearing\",\"pitch\",\"position\"],extract:[\"width\",\"height\",\"longitude\",\"latitude\",\"zoom\",\"bearing\",\"pitch\",\"position\"],required:[\"width\",\"height\",\"latitude\",\"longitude\",\"zoom\"]}),this.opts={...BGt,...t}}interpolateProps(t,r,i){let n=FY(t,r,i,this.opts);for(let o in BX)n[o]=rc(t[o]||BX[o],r[o]||BX[o],i);return n}getDuration(t,r){let{transitionDuration:i}=r;return i===\"auto\"&&(i=NY(t,r,this.opts)),i}};Ci();var b1=class{constructor(t){this.indexStarts=[0],this.vertexStarts=[0],this.vertexCount=0,this.instanceCount=0;let{attributes:r={}}=t;this.typedArrayManager=$f,this.attributes={},this._attributeDefs=r,this.opts=t,this.updateGeometry(t)}updateGeometry(t){Object.assign(this.opts,t);let{data:r,buffers:i={},getGeometry:n,geometryBuffer:o,positionFormat:s,dataChanged:a,normalize:h=!0}=this.opts;if(this.data=r,this.getGeometry=n,this.positionSize=o&&o.size||(s===\"XY\"?2:3),this.buffers=i,this.normalize=h,o&&(_r(r.startIndices),this.getGeometry=this.getGeometryFromBuffer(o),h||(i.vertexPositions=o)),this.geometryBuffer=i.vertexPositions,Array.isArray(a))for(let p of a)this._rebuildGeometry(p);else this._rebuildGeometry()}updatePartialGeometry({startRow:t,endRow:r}){this._rebuildGeometry({startRow:t,endRow:r})}getGeometryFromBuffer(t){let r=t.value||t;return ArrayBuffer.isView(r)?qL(r,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices}):null}_allocate(t,r){let{attributes:i,buffers:n,_attributeDefs:o,typedArrayManager:s}=this;for(let a in o)if(a in n)s.release(i[a]),i[a]=null;else{let h=o[a];h.copy=r,i[a]=s.allocate(i[a],t,h)}}_forEachGeometry(t,r,i){let{data:n,getGeometry:o}=this,{iterable:s,objectInfo:a}=Lc(n,r,i);for(let h of s){a.index++;let p=o?o(h,a):null;t(p,a.index)}}_rebuildGeometry(t){if(!this.data)return;let{indexStarts:r,vertexStarts:i,instanceCount:n}=this,{data:o,geometryBuffer:s}=this,{startRow:a=0,endRow:h=1/0}=t||{},p={};if(t||(r=[0],i=[0]),this.normalize||!s)this._forEachGeometry((w,C)=>{let R=w&&this.normalizeGeometry(w);p[C]=R,i[C+1]=i[C]+(R?this.getGeometrySize(R):0)},a,h),n=i[i.length-1];else if(i=o.startIndices,n=i[o.length]||0,ArrayBuffer.isView(s))n=n||s.length/this.positionSize;else if(s instanceof on){let w=this.positionSize*4;n=n||s.byteLength/w}else if(s.buffer){let w=s.stride||this.positionSize*4;n=n||s.buffer.byteLength/w}else if(s.value){let w=s.value,C=s.stride/w.BYTES_PER_ELEMENT||this.positionSize;n=n||w.length/C}this._allocate(n,!!t),this.indexStarts=r,this.vertexStarts=i,this.instanceCount=n;let g={};this._forEachGeometry((w,C)=>{let R=p[C]||w;g.vertexStart=i[C],g.indexStart=r[C];let z=C<i.length-1?i[C+1]:n;g.geometrySize=z-i[C],g.geometryIndex=C,this.updateGeometryAttributes(R,g)},a,h),this.vertexCount=r[r.length-1]}};var CAt=`uniform arcUniforms {\n  bool greatCircle;\n  bool useShortestPath;\n  float numSegments;\n  float widthScale;\n  float widthMinPixels;\n  float widthMaxPixels;\n  highp int widthUnits;\n} arc;\n`,IAt={name:\"arc\",vs:CAt,fs:CAt,uniformTypes:{greatCircle:\"f32\",useShortestPath:\"f32\",numSegments:\"f32\",widthScale:\"f32\",widthMinPixels:\"f32\",widthMaxPixels:\"f32\",widthUnits:\"i32\"}};var kAt=`#version 300 es\n#define SHADER_NAME arc-layer-vertex-shader\nin vec4 instanceSourceColors;\nin vec4 instanceTargetColors;\nin vec3 instanceSourcePositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions;\nin vec3 instanceTargetPositions64Low;\nin vec3 instancePickingColors;\nin float instanceWidths;\nin float instanceHeights;\nin float instanceTilts;\nout vec4 vColor;\nout vec2 uv;\nout float isValid;\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\nfloat deltaZ = targetZ - sourceZ;\nfloat dh = distance * instanceHeights;\nif (dh == 0.0) {\nreturn sourceZ + deltaZ * ratio;\n}\nfloat unitZ = deltaZ / dh;\nfloat p2 = unitZ * unitZ + 1.0;\nfloat dir = step(deltaZ, 0.0);\nfloat z0 = mix(sourceZ, targetZ, dir);\nfloat r = mix(ratio, 1.0 - ratio, dir);\nreturn sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project.viewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (arc.numSegments - 1.0));\n}\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\nfloat distance = length(source.xy - target.xy);\nfloat z = paraboloid(distance, source.z, target.z, segmentRatio);\nfloat tiltAngle = radians(instanceTilts);\nvec2 tiltDirection = normalize(target.xy - source.xy);\nvec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\nreturn vec3(\nmix(source.xy, target.xy, segmentRatio) + tilt,\nz * cos(tiltAngle)\n);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 sourceRadians = radians(source);\nvec2 targetRadians = radians(target);\nvec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\nvec2 shd_sq = sin_half_delta * sin_half_delta;\nfloat a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\nreturn 2.0 * asin(sqrt(a));\n}\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\nvec2 lngLat;\nif(abs(angularDist - PI) < 0.001) {\nlngLat = (1.0 - t) * source.xy + t * target.xy;\n} else {\nfloat a = sin((1.0 - t) * angularDist);\nfloat b = sin(t * angularDist);\nvec3 p = source3D.yxz * a + target3D.yxz * b;\nlngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n}\nfloat z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\nreturn vec3(lngLat, z);\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nfloat segmentIndex = float(gl_VertexID / 2);\nfloat segmentSide = mod(float(gl_VertexID), 2.) == 0. ? -1. : 1.;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\nfloat nextSegmentRatio = getSegmentRatio(min(arc.numSegments - 1.0, segmentIndex + 1.0));\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nisValid = 1.0;\nuv = vec2(segmentRatio, segmentSide);\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nvec4 curr;\nvec4 next;\nvec3 source;\nvec3 target;\nif ((arc.greatCircle || project.projectionMode == PROJECTION_MODE_GLOBE) && project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nsource = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\ntarget = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\nfloat angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\nvec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\nvec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\nvec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\nif (abs(currPos.x - prevPos.x) > 180.0) {\nindexDir = -1.0;\nisValid = 0.0;\n} else if (abs(currPos.x - nextPos.x) > 180.0) {\nindexDir = 1.0;\nisValid = 0.0;\n}\nnextPos = indexDir < 0.0 ? prevPos : nextPos;\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nif (isValid == 0.0) {\nnextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\nfloat t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\ncurrPos = mix(currPos, nextPos, t);\nsegmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n}\nvec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\nvec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\ncurr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\nnext = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n} else {\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nif (arc.useShortestPath) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng > 180.) target_world.x -= 360.;\nif (deltaLng < -180.) source_world.x -= 360.;\n}\nsource = project_position(source_world, instanceSourcePositions64Low);\ntarget = project_position(target_world, instanceTargetPositions64Low);\nfloat antiMeridianX = 0.0;\nif (arc.useShortestPath) {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nantiMeridianX = -(project.coordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n}\nfloat thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\nif (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\nisValid = 0.0;\nindexDir = sign(segmentRatio - thresholdRatio);\nsegmentRatio = thresholdRatio;\n}\n}\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nvec3 currPos = interpolateFlat(source, target, segmentRatio);\nvec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\nif (arc.useShortestPath) {\nif (nextPos.x < antiMeridianX) {\ncurrPos.x += TILE_SIZE;\nnextPos.x += TILE_SIZE;\n}\n}\ncurr = project_common_position_to_clipspace(vec4(currPos, 1.0));\nnext = project_common_position_to_clipspace(vec4(nextPos, 1.0));\ngeometry.position = vec4(currPos, 1.0);\n}\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * arc.widthScale, arc.widthUnits),\narc.widthMinPixels, arc.widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset((next.xy - curr.xy) * indexDir, segmentSide, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(curr, geometry);\ngl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\nvColor = vec4(color.rgb, color.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var RAt=`#version 300 es\n#define SHADER_NAME arc-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nin float isValid;\nout vec4 fragColor;\nvoid main(void) {\nif (isValid == 0.0) {\ndiscard;\n}\nfragColor = vColor;\ngeometry.uv = uv;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var c9=[0,0,0,255],FGt={getSourcePosition:{type:\"accessor\",value:e=>e.sourcePosition},getTargetPosition:{type:\"accessor\",value:e=>e.targetPosition},getSourceColor:{type:\"accessor\",value:c9},getTargetColor:{type:\"accessor\",value:c9},getWidth:{type:\"accessor\",value:1},getHeight:{type:\"accessor\",value:1},getTilt:{type:\"accessor\",value:0},greatCircle:!1,numSegments:{type:\"number\",value:50,min:1},widthUnits:\"pixels\",widthScale:{type:\"number\",value:1,min:0},widthMinPixels:{type:\"number\",value:0,min:0},widthMaxPixels:{type:\"number\",value:Number.MAX_SAFE_INTEGER,min:0}},ZP=class extends ho{getBounds(){return this.getAttributeManager()?.getBounds([\"instanceSourcePositions\",\"instanceTargetPositions\"])}getShaders(){return super.getShaders({vs:kAt,fs:RAt,modules:[Mo,bs,IAt]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getSourcePosition\"},instanceTargetPositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getTargetPosition\"},instanceSourceColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getSourceColor\",defaultValue:c9},instanceTargetColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getTargetColor\",defaultValue:c9},instanceWidths:{size:1,transition:!0,accessor:\"getWidth\",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:\"getHeight\",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:\"getTilt\",defaultValue:0}})}updateState(t){super.updateState(t),t.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{widthUnits:r,widthScale:i,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,wrapLongitude:a,numSegments:h}=this.props,p={numSegments:h,widthUnits:rs[r],widthScale:i,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,useShortestPath:a},g=this.state.model;g.shaderInputs.setProps({arc:p}),g.setVertexCount(h*2),g.draw(this.context.renderPass)}_getModel(){return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:\"triangle-strip\",isInstanced:!0})}};ZP.layerName=\"ArcLayer\";ZP.defaultProps=FGt;var u9=ZP;var NGt=new Uint32Array([0,2,1,0,3,2]),zGt=new Float32Array([0,1,0,0,1,0,1,1]);function FX(e,t){if(!t)return UGt(e);let r=Math.max(Math.abs(e[0][0]-e[3][0]),Math.abs(e[1][0]-e[2][0])),i=Math.max(Math.abs(e[1][1]-e[0][1]),Math.abs(e[2][1]-e[3][1])),n=Math.ceil(r/t)+1,o=Math.ceil(i/t)+1,s=(n-1)*(o-1)*6,a=new Uint32Array(s),h=new Float32Array(n*o*2),p=new Float64Array(n*o*3),g=0,w=0;for(let C=0;C<n;C++){let R=C/(n-1);for(let z=0;z<o;z++){let W=z/(o-1),Y=VGt(e,R,W);p[g*3+0]=Y[0],p[g*3+1]=Y[1],p[g*3+2]=Y[2]||0,h[g*2+0]=R,h[g*2+1]=1-W,C>0&&z>0&&(a[w++]=g-o,a[w++]=g-o-1,a[w++]=g-1,a[w++]=g-o,a[w++]=g-1,a[w++]=g),g++}}return{vertexCount:s,positions:p,indices:a,texCoords:h}}function UGt(e){let t=new Float64Array(12);for(let r=0;r<e.length;r++)t[r*3+0]=e[r][0],t[r*3+1]=e[r][1],t[r*3+2]=e[r][2]||0;return{vertexCount:6,positions:t,indices:NGt,texCoords:zGt}}function VGt(e,t,r){return rc(rc(e[0],e[1],r),rc(e[3],e[2],r),t)}var DAt=`uniform bitmapUniforms {\n  vec4 bounds;\n  float coordinateConversion;\n  float desaturate;\n  vec3 tintColor;\n  vec4 transparentColor;\n} bitmap;\n`,OAt={name:\"bitmap\",vs:DAt,fs:DAt,uniformTypes:{bounds:\"vec4<f32>\",coordinateConversion:\"f32\",desaturate:\"f32\",tintColor:\"vec3<f32>\",transparentColor:\"vec4<f32>\"}};var LAt=`#version 300 es\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nin vec2 texCoords;\nin vec3 positions;\nin vec3 positions64Low;\n\nout vec2 vTexCoord;\nout vec2 vTexPos;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n  geometry.worldPosition = positions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = pickingColor;\n\n  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTexCoord = texCoords;\n\n  if (bitmap.coordinateConversion < -0.5) {\n    vTexPos = geometry.position.xy + project.commonOrigin.xy;\n  } else if (bitmap.coordinateConversion > 0.5) {\n    vTexPos = geometry.worldPosition.xy;\n  }\n\n  vec4 color = vec4(0.0);\n  DECKGL_FILTER_COLOR(color, geometry);\n}\n`;var jGt=`\nvec3 packUVsIntoRGB(vec2 uv) {\n  // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n  vec2 uv8bit = floor(uv * 256.);\n\n  // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n  // Scale and clamp to 0-1 range\n  vec2 uvFraction = fract(uv * 256.);\n  vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n  // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n  float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n  return vec3(uv8bit, fractions) / 255.;\n}\n`,BAt=`#version 300 es\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nin vec2 vTexCoord;\nin vec2 vTexPos;\n\nout vec4 fragColor;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n  float x = lnglat.x;\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n  xy /= WORLD_SCALE;\n  return degrees(vec2(\n    xy.x - PI,\n    atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n  ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n  float luminance = (color.r + color.g + color.b) * 0.333333333;\n  return mix(color, vec3(luminance), bitmap.desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n  return color * bitmap.tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n  if (bitmap.transparentColor.a == 0.0) {\n    return vec4(color, alpha);\n  }\n  float blendedAlpha = alpha + bitmap.transparentColor.a * (1.0 - alpha);\n  float highLightRatio = alpha / blendedAlpha;\n  vec3 blendedRGB = mix(bitmap.transparentColor.rgb, color, highLightRatio);\n  return vec4(blendedRGB, blendedAlpha);\n}\n\nvec2 getUV(vec2 pos) {\n  return vec2(\n    (pos.x - bitmap.bounds[0]) / (bitmap.bounds[2] - bitmap.bounds[0]),\n    (pos.y - bitmap.bounds[3]) / (bitmap.bounds[1] - bitmap.bounds[3])\n  );\n}\n\n${jGt}\n\nvoid main(void) {\n  vec2 uv = vTexCoord;\n  if (bitmap.coordinateConversion < -0.5) {\n    vec2 lnglat = mercator_to_lnglat(vTexPos);\n    uv = getUV(lnglat);\n  } else if (bitmap.coordinateConversion > 0.5) {\n    vec2 commonPos = lnglat_to_mercator(vTexPos);\n    uv = getUV(commonPos);\n  }\n  vec4 bitmapColor = texture(bitmapTexture, uv);\n\n  fragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * layer.opacity);\n\n  geometry.uv = uv;\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n\n  if (bool(picking.isActive) && !bool(picking.isAttribute)) {\n    // Since instance information is not used, we can use picking color for pixel index\n    fragColor.rgb = packUVsIntoRGB(uv);\n  }\n}\n`;var $Gt={image:{type:\"image\",value:null,async:!0},bounds:{type:\"array\",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:Vr.DEFAULT,desaturate:{type:\"number\",min:0,max:1,value:0},transparentColor:{type:\"color\",value:[0,0,0,0]},tintColor:{type:\"color\",value:[255,255,255]},textureParameters:{type:\"object\",ignore:!0,value:null}},KP=class extends ho{getShaders(){return super.getShaders({vs:LAt,fs:BAt,modules:[Mo,bs,OAt]})}initializeState(){let t=this.getAttributeManager();t.remove([\"instancePickingColors\"]);let r=!0;t.add({indices:{size:1,isIndexed:!0,update:i=>i.value=this.state.mesh.indices,noAlloc:r},positions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),update:i=>i.value=this.state.mesh.positions,noAlloc:r},texCoords:{size:2,update:i=>i.value=this.state.mesh.texCoords,noAlloc:r}})}updateState({props:t,oldProps:r,changeFlags:i}){let n=this.getAttributeManager();if(i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),n.invalidateAll()),t.bounds!==r.bounds){let o=this.state.mesh,s=this._createMesh();this.state.model.setVertexCount(s.vertexCount);for(let a in s)o&&o[a]!==s[a]&&n.invalidate(a);this.setState({mesh:s,...this._getCoordinateUniforms()})}else t._imageCoordinateSystem!==r._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(t){let{image:r}=this.props,i=t.info;if(!i.color||!r)return i.bitmap=null,i;let{width:n,height:o}=r;i.index=0;let s=GGt(i.color);return i.bitmap={size:{width:n,height:o},uv:s,pixel:[Math.floor(s[0]*n),Math.floor(s[1]*o)]},i}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(t){super._updateAutoHighlight({...t,color:this.encodePickingColor(0)})}_createMesh(){let{bounds:t}=this.props,r=t;return FAt(t)&&(r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),FX(r,this.context.viewport.resolution)}_getModel(){return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:\"triangle-list\",isInstanced:!1})}draw(t){let{shaderModuleProps:r}=t,{model:i,coordinateConversion:n,bounds:o,disablePicking:s}=this.state,{image:a,desaturate:h,transparentColor:p,tintColor:g}=this.props;if(!(r.picking.isActive&&s)&&a&&i){let w={bitmapTexture:a,bounds:o,coordinateConversion:n,desaturate:h,tintColor:g.slice(0,3).map(C=>C/255),transparentColor:p.map(C=>C/255)};i.shaderInputs.setProps({bitmap:w}),i.draw(this.context.renderPass)}}_getCoordinateUniforms(){let{LNGLAT:t,CARTESIAN:r,DEFAULT:i}=Vr,{_imageCoordinateSystem:n}=this.props;if(n!==i){let{bounds:o}=this.props;if(!FAt(o))throw new Error(\"_imageCoordinateSystem only supports rectangular bounds\");let s=this.context.viewport.resolution?t:r;if(n=n===t?t:r,n===t&&s===r)return{coordinateConversion:-1,bounds:o};if(n===r&&s===t){let a=vs([o[0],o[1]]),h=vs([o[2],o[3]]);return{coordinateConversion:1,bounds:[a[0],a[1],h[0],h[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}};KP.layerName=\"BitmapLayer\";KP.defaultProps=$Gt;var G3=KP;function GGt(e){let[t,r,i]=e,n=(i&240)/256,o=(i&15)/16;return[(t+o)/256,(r+n)/256]}function FAt(e){return Number.isFinite(e[0])}var NAt=`uniform iconUniforms {\n  float sizeScale;\n  vec2 iconsTextureDim;\n  float sizeBasis;\n  float sizeMinPixels;\n  float sizeMaxPixels;\n  bool billboard;\n  highp int sizeUnits;\n  float alphaCutoff;\n} icon;\n`,zAt={name:\"icon\",vs:NAt,fs:NAt,uniformTypes:{sizeScale:\"f32\",iconsTextureDim:\"vec2<f32>\",sizeBasis:\"f32\",sizeMinPixels:\"f32\",sizeMaxPixels:\"f32\",billboard:\"f32\",sizeUnits:\"i32\",alphaCutoff:\"f32\"}};var UAt=`#version 300 es\n#define SHADER_NAME icon-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceSizes;\nin float instanceAngles;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec4 instanceIconFrames;\nin float instanceColorModes;\nin vec2 instanceOffsets;\nin vec2 instancePixelOffset;\nout float vColorMode;\nout vec4 vColor;\nout vec2 vTextureCoords;\nout vec2 uv;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = angle * PI / 180.0;\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvec2 iconSize = instanceIconFrames.zw;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * icon.sizeScale, icon.sizeUnits),\nicon.sizeMinPixels, icon.sizeMaxPixels\n);\nfloat iconConstraint = icon.sizeBasis == 0.0 ? iconSize.x : iconSize.y;\nfloat instanceScale = iconConstraint == 0.0 ? 0.0 : sizePixels / iconConstraint;\nvec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\npixelOffset += instancePixelOffset;\npixelOffset.y *= -1.0;\nif (icon.billboard)  {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvTextureCoords = mix(\ninstanceIconFrames.xy,\ninstanceIconFrames.xy + iconSize,\n(positions.xy + 1.0) / 2.0\n) / icon.iconsTextureDim;\nvColor = instanceColors;\nDECKGL_FILTER_COLOR(vColor, geometry);\nvColorMode = instanceColorModes;\n}\n`;var VAt=`#version 300 es\n#define SHADER_NAME icon-layer-fragment-shader\nprecision highp float;\nuniform sampler2D iconsTexture;\nin float vColorMode;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nvec4 texColor = texture(iconsTexture, vTextureCoords);\nvec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\nfloat a = texColor.a * layer.opacity * vColor.a;\nif (a < icon.alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color, a);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var WGt=1024,qGt=4,jAt=()=>{},$At={minFilter:\"linear\",mipmapFilter:\"linear\",magFilter:\"linear\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\"},HGt={x:0,y:0,width:0,height:0};function YGt(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function XGt(e,t,r,i){let n=Math.min(r/t.width,i/t.height),o=Math.floor(t.width*n),s=Math.floor(t.height*n);return n===1?{image:t,width:o,height:s}:(e.canvas.height=s,e.canvas.width=o,e.clearRect(0,0,o,s),e.drawImage(t,0,0,t.width,t.height,0,0,o,s),{image:e.canvas,width:o,height:s})}function QP(e){return e&&(e.id||e.url)}function ZGt(e,t,r,i){let{width:n,height:o,device:s}=e,a=s.createTexture({format:\"rgba8unorm\",width:t,height:r,sampler:i,mipLevels:s.getMipLevelCount(t,r)}),h=s.createCommandEncoder();return h.copyTextureToTexture({sourceTexture:e,destinationTexture:a,width:n,height:o}),h.finish(),a.generateMipmapsWebGL(),e.destroy(),a}function GAt(e,t,r){for(let i=0;i<t.length;i++){let{icon:n,xOffset:o}=t[i],s=QP(n);e[s]={...n,x:o,y:r}}}function KGt({icons:e,buffer:t,mapping:r={},xOffset:i=0,yOffset:n=0,rowHeight:o=0,canvasWidth:s}){let a=[];for(let h=0;h<e.length;h++){let p=e[h],g=QP(p);if(!r[g]){let{height:w,width:C}=p;i+C+t>s&&(GAt(r,a,n),i=0,n=o+n+t,o=0,a=[]),a.push({icon:p,xOffset:i}),i=i+C+t,o=Math.max(o,w)}}return a.length>0&&GAt(r,a,n),{mapping:r,rowHeight:o,xOffset:i,yOffset:n,canvasWidth:s,canvasHeight:YGt(o+n+t)}}function QGt(e,t,r){if(!e||!t)return null;r=r||{};let i={},{iterable:n,objectInfo:o}=Lc(e);for(let s of n){o.index++;let a=t(s,o),h=QP(a);if(!a)throw new Error(\"Icon is missing.\");if(!a.url)throw new Error(\"Icon url is missing.\");!i[h]&&(!r[h]||a.url!==r[h].url)&&(i[h]={...a,source:s,sourceIndex:o.index})}return i}var JP=class{constructor(t,{onUpdate:r=jAt,onError:i=jAt}){this._loadOptions=null,this._texture=null,this._externalTexture=null,this._mapping={},this._samplerParameters=null,this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=qGt,this._canvasWidth=WGt,this._canvasHeight=0,this._canvas=null,this.device=t,this.onUpdate=r,this.onError=i}finalize(){this._texture?.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(t){let r=this._autoPacking?QP(t):t;return this._mapping[r]||HGt}setProps({loadOptions:t,autoPacking:r,iconAtlas:i,iconMapping:n,textureParameters:o}){t&&(this._loadOptions=t),r!==void 0&&(this._autoPacking=r),n&&(this._mapping=n),i&&(this._texture?.delete(),this._texture=null,this._externalTexture=i),o&&(this._samplerParameters=o)}get isLoaded(){return this._pendingCount===0}packIcons(t,r){if(!this._autoPacking||typeof document>\"u\")return;let i=Object.values(QGt(t,r,this._mapping)||{});if(i.length>0){let{mapping:n,xOffset:o,yOffset:s,rowHeight:a,canvasHeight:h}=KGt({icons:i,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=a,this._mapping=n,this._xOffset=o,this._yOffset=s,this._canvasHeight=h,this._texture||(this._texture=this.device.createTexture({format:\"rgba8unorm\",data:null,width:this._canvasWidth,height:this._canvasHeight,sampler:this._samplerParameters||$At,mipLevels:this.device.getMipLevelCount(this._canvasWidth,this._canvasHeight)})),this._texture.height!==this._canvasHeight&&(this._texture=ZGt(this._texture,this._canvasWidth,this._canvasHeight,this._samplerParameters||$At)),this.onUpdate(!0),this._canvas=this._canvas||document.createElement(\"canvas\"),this._loadIcons(i)}}_loadIcons(t){let r=this._canvas.getContext(\"2d\",{willReadFrequently:!0});for(let i of t)this._pendingCount++,n1(i.url,this._loadOptions).then(n=>{let o=QP(i),s=this._mapping[o],{x:a,y:h,width:p,height:g}=s,{image:w,width:C,height:R}=XGt(r,n,p,g),z=a+(p-C)/2,W=h+(g-R)/2;this._texture?.copyExternalImage({image:w,x:z,y:W,width:C,height:R}),s.x=z,s.y=W,s.width=C,s.height=R,this._texture?.generateMipmapsWebGL(),this.onUpdate(C!==p||R!==g)}).catch(n=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:n})}).finally(()=>{this._pendingCount--})}};var WAt=[0,0,0,255],JGt={iconAtlas:{type:\"image\",value:null,async:!0},iconMapping:{type:\"object\",value:{},async:!0},sizeScale:{type:\"number\",value:1,min:0},billboard:!0,sizeUnits:\"pixels\",sizeBasis:\"height\",sizeMinPixels:{type:\"number\",min:0,value:0},sizeMaxPixels:{type:\"number\",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:\"number\",value:.05,min:0,max:1},getPosition:{type:\"accessor\",value:e=>e.position},getIcon:{type:\"accessor\",value:e=>e.icon},getColor:{type:\"accessor\",value:WAt},getSize:{type:\"accessor\",value:1},getAngle:{type:\"accessor\",value:0},getPixelOffset:{type:\"accessor\",value:[0,0]},onIconError:{type:\"function\",value:null,optional:!0},textureParameters:{type:\"object\",ignore:!0,value:null}},tC=class extends ho{getShaders(){return super.getShaders({vs:UAt,fs:VAt,modules:[Mo,bs,zAt]})}initializeState(){this.state={iconManager:new JP(this.context.device,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getPosition\"},instanceSizes:{size:1,transition:!0,accessor:\"getSize\",defaultValue:1},instanceOffsets:{size:2,accessor:\"getIcon\",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:\"getIcon\",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:\"uint8\",accessor:\"getIcon\",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getColor\",defaultValue:WAt},instanceAngles:{size:1,transition:!0,accessor:\"getAngle\"},instancePixelOffset:{size:2,transition:!0,accessor:\"getPixelOffset\"}})}updateState(t){super.updateState(t);let{props:r,oldProps:i,changeFlags:n}=t,o=this.getAttributeManager(),{iconAtlas:s,iconMapping:a,data:h,getIcon:p,textureParameters:g}=r,{iconManager:w}=this.state;if(typeof s==\"string\")return;let C=s||this.internalState.isAsyncPropLoading(\"iconAtlas\");w.setProps({loadOptions:r.loadOptions,autoPacking:!C,iconAtlas:s,iconMapping:C?a:null,textureParameters:g}),C?i.iconMapping!==r.iconMapping&&o.invalidate(\"getIcon\"):(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&w.packIcons(h,p),n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),o.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(t){super.finalizeState(t),this.state.iconManager.finalize()}draw({uniforms:t}){let{sizeScale:r,sizeBasis:i,sizeMinPixels:n,sizeMaxPixels:o,sizeUnits:s,billboard:a,alphaCutoff:h}=this.props,{iconManager:p}=this.state,g=p.getTexture();if(g){let w=this.state.model,C={iconsTexture:g,iconsTextureDim:[g.width,g.height],sizeUnits:rs[s],sizeScale:r,sizeBasis:i===\"height\"?1:0,sizeMinPixels:n,sizeMaxPixels:o,billboard:a,alphaCutoff:h};w.shaderInputs.setProps({icon:C}),w.draw(this.context.renderPass)}}_getModel(){let t=[-1,-1,1,-1,-1,1,1,1];return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new xs({topology:\"triangle-strip\",attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}_onUpdate(t){t?(this.getAttributeManager()?.invalidate(\"getIcon\"),this.setNeedsUpdate()):this.setNeedsRedraw()}_onError(t){let r=this.getCurrentLayer()?.props.onIconError;r?r(t):hr.error(t.error.message)()}getInstanceOffset(t){let{width:r,height:i,anchorX:n=r/2,anchorY:o=i/2}=this.state.iconManager.getIconMapping(t);return[r/2-n,i/2-o]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){let{x:r,y:i,width:n,height:o}=this.state.iconManager.getIconMapping(t);return[r,i,n,o]}};tC.defaultProps=JGt;tC.layerName=\"IconLayer\";var h9=tC;var tWt=`struct PointCloudUniforms {\n  radiusPixels: f32,\n  sizeUnits: i32,\n};\n\n@group(0) @binding(3)\nvar<uniform> pointCloud: PointCloudUniforms;\n`,qAt=`uniform pointCloudUniforms {\n  float radiusPixels;\n  highp int sizeUnits;\n} pointCloud;\n`,HAt={name:\"pointCloud\",source:tWt,vs:qAt,fs:qAt,uniformTypes:{radiusPixels:\"f32\",sizeUnits:\"i32\"}};var YAt=`#version 300 es\n#define SHADER_NAME point-cloud-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceNormals;\nin vec4 instanceColors;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec3 instancePickingColors;\nout vec4 vColor;\nout vec2 unitPosition;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.normal = project_normal(instanceNormals);\nunitPosition = positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\nvec3 offset = vec3(positions.xy * project_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\nvec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, instanceColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var XAt=`#version 300 es\n#define SHADER_NAME point-cloud-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 unitPosition;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition.xy;\nfloat distToCenter = length(unitPosition);\nif (distToCenter > 1.0) {\ndiscard;\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var ZAt=`struct ConstantAttributes {\n  instanceNormals: vec3<f32>,\n  instanceColors: vec4<f32>,\n  instancePositions: vec3<f32>,\n  instancePositions64Low: vec3<f32>,\n  instancePickingColors: vec3<f32>\n};\n\nconst constants = ConstantAttributes(\n  vec3<f32>(1.0, 0.0, 0.0),\n  vec4<f32>(0.0, 0.0, 0.0, 1.0),\n  vec3<f32>(0.0),\n  vec3<f32>(0.0),\n  vec3<f32>(0.0)\n);\n\nstruct Attributes {\n  @builtin(instance_index) instanceIndex : u32,\n  @builtin(vertex_index) vertexIndex : u32,\n  @location(0) positions: vec3<f32>,\n  @location(1) instancePositions: vec3<f32>,\n  @location(2) instancePositions64Low: vec3<f32>,\n  @location(3) instanceNormals: vec3<f32>,\n  @location(4) instanceColors: vec4<f32>,\n  @location(5) instancePickingColors: vec3<f32>\n};\n\nstruct Varyings {\n  @builtin(position) position: vec4<f32>,\n  @location(0) vColor: vec4<f32>,\n  @location(1) unitPosition: vec2<f32>,\n};\n\n@vertex\nfn vertexMain(attributes: Attributes) -> Varyings {\n  var varyings: Varyings;\n  \n  // var geometry: Geometry;\n  // geometry.worldPosition = instancePositions;\n  // geometry.normal = project_normal(instanceNormals);\n\n  // position on the containing square in [-1, 1] space\n  varyings.unitPosition = attributes.positions.xy;\n  geometry.uv = varyings.unitPosition;\n  geometry.pickingColor = attributes.instancePickingColors;\n\n  // Find the center of the point and add the current vertex\n  let offset = vec3<f32>(attributes.positions.xy * project_unit_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\n  // DECKGL_FILTER_SIZE(offset, geometry);\n\n  varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, vec3<f32>(0.0)); // TODO , geometry.position);\n  // DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  let clipPixels = project_pixel_size_to_clipspace(offset.xy);\n  varyings.position.x += clipPixels.x;\n  varyings.position.y += clipPixels.y;\n\n  // Apply lighting\n  let lightColor = lighting_getLightColor2(attributes.instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\n\n  // Apply opacity to instance color, or return instance picking color\n  varyings.vColor = vec4(lightColor, attributes.instanceColors.a * color.opacity);\n  // DECKGL_FILTER_COLOR(vColor, geometry);\n\n  return varyings;\n}\n\n@fragment\nfn fragmentMain(varyings: Varyings) -> @location(0) vec4<f32> {\n  // var geometry: Geometry;\n  // geometry.uv = unitPosition.xy;\n\n  let distToCenter = length(varyings.unitPosition);\n  if (distToCenter > 1.0) {\n    discard;\n  }\n\n  var fragColor: vec4<f32>;\n\n  fragColor = varyings.vColor;\n  // DECKGL_FILTER_COLOR(fragColor, geometry);\n\n  // Apply premultiplied alpha as required by transparent canvas\n  fragColor = deckgl_premultiplied_alpha(fragColor);\n\n  return fragColor;\n}\n`;var KAt=[0,0,0,255],QAt=[0,0,1],eWt={sizeUnits:\"pixels\",pointSize:{type:\"number\",min:0,value:10},getPosition:{type:\"accessor\",value:e=>e.position},getNormal:{type:\"accessor\",value:QAt},getColor:{type:\"accessor\",value:KAt},material:!0,radiusPixels:{deprecatedFor:\"pointSize\"}};function rWt(e){let{header:t,attributes:r}=e;if(!(!t||!r)&&(e.length=t.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0)){let{size:i,value:n}=r.COLOR_0;r.instanceColors={size:i,type:\"unorm8\",value:n}}}var eC=class extends ho{getShaders(){return super.getShaders({vs:YAt,fs:XAt,source:ZAt,modules:[Mo,x3,kg,bs,HAt]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getPosition\"},instanceNormals:{size:3,transition:!0,accessor:\"getNormal\",defaultValue:QAt},instanceColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getColor\",defaultValue:KAt}})}updateState(t){let{changeFlags:r,props:i}=t;super.updateState(t),r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll()),r.dataChanged&&rWt(i.data)}draw({uniforms:t}){let{pointSize:r,sizeUnits:i}=this.props,n=this.state.model,o={sizeUnits:rs[i],radiusPixels:r};n.shaderInputs.setProps({pointCloud:o}),this.context.device.type===\"webgpu\"&&(n.instanceCount=this.props.data.length),n.draw(this.context.renderPass)}_getModel(){let t=this.context.device.type===\"webgpu\"?{depthWriteEnabled:!0,depthCompare:\"less-equal\"}:void 0,r=[];for(let i=0;i<3;i++){let n=i/3*Math.PI*2;r.push(Math.cos(n)*2,Math.sin(n)*2,0)}return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new xs({topology:\"triangle-list\",attributes:{positions:new Float32Array(r)}}),parameters:t,isInstanced:!0})}};eC.layerName=\"PointCloudLayer\";eC.defaultProps=eWt;var d9=eC;var JAt=`uniform scatterplotUniforms {\n  float radiusScale;\n  float radiusMinPixels;\n  float radiusMaxPixels;\n  float lineWidthScale;\n  float lineWidthMinPixels;\n  float lineWidthMaxPixels;\n  float stroked;\n  float filled;\n  bool antialiasing;\n  bool billboard;\n  highp int radiusUnits;\n  highp int lineWidthUnits;\n} scatterplot;\n`,tyt={name:\"scatterplot\",vs:JAt,fs:JAt,source:\"\",uniformTypes:{radiusScale:\"f32\",radiusMinPixels:\"f32\",radiusMaxPixels:\"f32\",lineWidthScale:\"f32\",lineWidthMinPixels:\"f32\",lineWidthMaxPixels:\"f32\",stroked:\"f32\",filled:\"f32\",antialiasing:\"f32\",billboard:\"f32\",radiusUnits:\"i32\",lineWidthUnits:\"i32\"}};var eyt=`#version 300 es\n#define SHADER_NAME scatterplot-layer-vertex-shader\nin vec3 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceRadius;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout vec2 unitPosition;\nout float innerUnitRadius;\nout float outerRadiusPixels;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nouterRadiusPixels = clamp(\nproject_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits),\nscatterplot.radiusMinPixels, scatterplot.radiusMaxPixels\n);\nfloat lineWidthPixels = clamp(\nproject_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits),\nscatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels\n);\nouterRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0;\nfloat edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\nunitPosition = edgePadding * positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\ninnerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels;\nif (scatterplot.billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = edgePadding * positions * outerRadiusPixels;\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n`;var ryt=`#version 300 es\n#define SHADER_NAME scatterplot-layer-fragment-shader\nprecision highp float;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin vec2 unitPosition;\nin float innerUnitRadius;\nin float outerRadiusPixels;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition;\nfloat distToCenter = length(unitPosition) * outerRadiusPixels;\nfloat inCircle = scatterplot.antialiasing ?\nsmoothedge(distToCenter, outerRadiusPixels) :\nstep(distToCenter, outerRadiusPixels);\nif (inCircle == 0.0) {\ndiscard;\n}\nif (scatterplot.stroked > 0.5) {\nfloat isLine = scatterplot.antialiasing ?\nsmoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\nstep(innerUnitRadius * outerRadiusPixels, distToCenter);\nif (scatterplot.filled > 0.5) {\nfragColor = mix(vFillColor, vLineColor, isLine);\n} else {\nif (isLine == 0.0) {\ndiscard;\n}\nfragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n}\n} else if (scatterplot.filled < 0.5) {\ndiscard;\n} else {\nfragColor = vFillColor;\n}\nfragColor.a *= inCircle;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var iyt=`// Main shaders\n\nstruct ScatterplotUniforms {\n  radiusScale: f32,\n  radiusMinPixels: f32,\n  radiusMaxPixels: f32,\n  lineWidthScale: f32,\n  lineWidthMinPixels: f32,\n  lineWidthMaxPixels: f32,\n  stroked: f32,\n  filled: i32,\n  antialiasing: i32,\n  billboard: i32,\n  radiusUnits: i32,\n  lineWidthUnits: i32,\n};\n\nstruct ConstantAttributeUniforms {\n instancePositions: vec3<f32>,\n instancePositions64Low: vec3<f32>,\n instanceRadius: f32,\n instanceLineWidths: f32,\n instanceFillColors: vec4<f32>,\n instanceLineColors: vec4<f32>,\n instancePickingColors: vec3<f32>,\n\n instancePositionsConstant: i32,\n instancePositions64LowConstant: i32,\n instanceRadiusConstant: i32,\n instanceLineWidthsConstant: i32,\n instanceFillColorsConstant: i32,\n instanceLineColorsConstant: i32,\n instancePickingColorsConstant: i32\n};\n\n@group(0) @binding(2) var<uniform> scatterplot: ScatterplotUniforms;\n\nstruct ConstantAttributes {\n  instancePositions: vec3<f32>,\n  instancePositions64Low: vec3<f32>,\n  instanceRadius: f32,\n  instanceLineWidths: f32,\n  instanceFillColors: vec4<f32>,\n  instanceLineColors: vec4<f32>,\n  instancePickingColors: vec3<f32>\n};\n\nconst constants = ConstantAttributes(\n  vec3<f32>(0.0),\n  vec3<f32>(0.0),\n  0.0,\n  0.0,\n  vec4<f32>(0.0, 0.0, 0.0, 1.0),\n  vec4<f32>(0.0, 0.0, 0.0, 1.0),\n  vec3<f32>(0.0)\n);\n\nstruct Attributes {\n  @builtin(instance_index) instanceIndex : u32,\n  @builtin(vertex_index) vertexIndex : u32,\n  @location(0) positions: vec3<f32>,\n  @location(1) instancePositions: vec3<f32>,\n  @location(2) instancePositions64Low: vec3<f32>,\n  @location(3) instanceRadius: f32,\n  @location(4) instanceLineWidths: f32,\n  @location(5) instanceFillColors: vec4<f32>,\n  @location(6) instanceLineColors: vec4<f32>,\n  @location(7) instancePickingColors: vec3<f32>\n};\n\nstruct Varyings {\n  @builtin(position) position: vec4<f32>,\n  @location(0) vFillColor: vec4<f32>,\n  @location(1) vLineColor: vec4<f32>,\n  @location(2) unitPosition: vec2<f32>,\n  @location(3) innerUnitRadius: f32,\n  @location(4) outerRadiusPixels: f32,\n};\n\n@vertex\nfn vertexMain(attributes: Attributes) -> Varyings {\n  var varyings: Varyings;\n\n  // Draw an inline geometry constant array clip space triangle to verify that rendering works.\n  // var positions = array<vec2<f32>, 3>(vec2(0.0, 0.5), vec2(-0.5, -0.5), vec2(0.5, -0.5));\n  // if (attributes.instanceIndex == 0) {\n  //   varyings.position = vec4<f32>(positions[attributes.vertexIndex], 0.0, 1.0);\n  //   return varyings;\n  // }\n\n  // var geometry: Geometry;\n  // geometry.worldPosition = instancePositions;\n\n  // Multiply out radius and clamp to limits\n  varyings.outerRadiusPixels = clamp(\n    project_unit_size_to_pixel(scatterplot.radiusScale * attributes.instanceRadius, scatterplot.radiusUnits),\n    scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels\n  );\n\n  // Multiply out line width and clamp to limits\n  let lineWidthPixels = clamp(\n    project_unit_size_to_pixel(scatterplot.lineWidthScale * attributes.instanceLineWidths, scatterplot.lineWidthUnits),\n    scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels\n  );\n\n  // outer radius needs to offset by half stroke width\n  varyings.outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0;\n  // Expand geometry to accommodate edge smoothing\n  let edgePadding = select(\n    (varyings.outerRadiusPixels + SMOOTH_EDGE_RADIUS) / varyings.outerRadiusPixels,\n    1.0,\n    scatterplot.antialiasing != 0\n  );\n\n  // position on the containing square in [-1, 1] space\n  varyings.unitPosition = edgePadding * attributes.positions.xy;\n  geometry.uv = varyings.unitPosition;\n  geometry.pickingColor = attributes.instancePickingColors;\n\n  varyings.innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / varyings.outerRadiusPixels;\n\n  if (scatterplot.billboard != 0) {\n    varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, vec3<f32>(0.0)); // TODO , geometry.position);\n    // DECKGL_FILTER_GL_POSITION(varyings.position, geometry);\n    let offset = attributes.positions; // * edgePadding * varyings.outerRadiusPixels;\n    // DECKGL_FILTER_SIZE(offset, geometry);\n    let clipPixels = project_pixel_size_to_clipspace(offset.xy);\n    varyings.position.x = clipPixels.x;\n    varyings.position.y = clipPixels.y;\n  } else {\n    let offset = edgePadding * attributes.positions * project_pixel_size_float(varyings.outerRadiusPixels);\n    // DECKGL_FILTER_SIZE(offset, geometry);\n    varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, offset); // TODO , geometry.position);\n    // DECKGL_FILTER_GL_POSITION(varyings.position, geometry);\n  }\n\n  // Apply opacity to instance color, or return instance picking color\n  varyings.vFillColor = vec4<f32>(attributes.instanceFillColors.rgb, attributes.instanceFillColors.a * color.opacity);\n  // DECKGL_FILTER_COLOR(varyings.vFillColor, geometry);\n  varyings.vLineColor = vec4<f32>(attributes.instanceLineColors.rgb, attributes.instanceLineColors.a * color.opacity);\n  // DECKGL_FILTER_COLOR(varyings.vLineColor, geometry);\n\n  return varyings;\n}\n\n@fragment\nfn fragmentMain(varyings: Varyings) -> @location(0) vec4<f32> {\n  // var geometry: Geometry;\n  // geometry.uv = unitPosition;\n\n  let distToCenter = length(varyings.unitPosition) * varyings.outerRadiusPixels;\n  let inCircle = select(\n    smoothedge(distToCenter, varyings.outerRadiusPixels),\n    step(distToCenter, varyings.outerRadiusPixels),\n    scatterplot.antialiasing != 0\n  );\n\n  if (inCircle == 0.0) {\n    discard;\n  }\n\n  var fragColor: vec4<f32>;\n\n  if (scatterplot.stroked != 0) {\n    let isLine = select(\n      smoothedge(varyings.innerUnitRadius * varyings.outerRadiusPixels, distToCenter),\n      step(varyings.innerUnitRadius * varyings.outerRadiusPixels, distToCenter),\n      scatterplot.antialiasing != 0\n    );\n\n    if (scatterplot.filled != 0) {\n      fragColor = mix(varyings.vFillColor, varyings.vLineColor, isLine);\n    } else {\n      if (isLine == 0.0) {\n        discard;\n      }\n      fragColor = vec4<f32>(varyings.vLineColor.rgb, varyings.vLineColor.a * isLine);\n    }\n  } else if (scatterplot.filled == 0) {\n    discard;\n  } else {\n    fragColor = varyings.vFillColor;\n  }\n\n  fragColor.a *= inCircle;\n  // DECKGL_FILTER_COLOR(fragColor, geometry);\n\n  // Apply premultiplied alpha as required by transparent canvas\n  fragColor = deckgl_premultiplied_alpha(fragColor);\n\n  return fragColor;\n  // return vec4<f32>(0, 0, 1, 1);\n}\n`;var nyt=[0,0,0,255],iWt={radiusUnits:\"meters\",radiusScale:{type:\"number\",min:0,value:1},radiusMinPixels:{type:\"number\",min:0,value:0},radiusMaxPixels:{type:\"number\",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:\"meters\",lineWidthScale:{type:\"number\",min:0,value:1},lineWidthMinPixels:{type:\"number\",min:0,value:0},lineWidthMaxPixels:{type:\"number\",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:\"accessor\",value:e=>e.position},getRadius:{type:\"accessor\",value:1},getFillColor:{type:\"accessor\",value:nyt},getLineColor:{type:\"accessor\",value:nyt},getLineWidth:{type:\"accessor\",value:1},strokeWidth:{deprecatedFor:\"getLineWidth\"},outline:{deprecatedFor:\"stroked\"},getColor:{deprecatedFor:[\"getFillColor\",\"getLineColor\"]}},rC=class extends ho{getShaders(){return super.getShaders({vs:eyt,fs:ryt,source:iyt,modules:[Mo,x3,bs,tyt]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getPosition\"},instanceRadius:{size:1,transition:!0,accessor:\"getRadius\",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:\"unorm8\",accessor:\"getFillColor\",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:\"unorm8\",accessor:\"getLineColor\",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:\"getLineWidth\",defaultValue:1}})}updateState(t){super.updateState(t),t.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{radiusUnits:r,radiusScale:i,radiusMinPixels:n,radiusMaxPixels:o,stroked:s,filled:a,billboard:h,antialiasing:p,lineWidthUnits:g,lineWidthScale:w,lineWidthMinPixels:C,lineWidthMaxPixels:R}=this.props,z={stroked:s,filled:a,billboard:h,antialiasing:p,radiusUnits:rs[r],radiusScale:i,radiusMinPixels:n,radiusMaxPixels:o,lineWidthUnits:rs[g],lineWidthScale:w,lineWidthMinPixels:C,lineWidthMaxPixels:R},W=this.state.model;W.shaderInputs.setProps({scatterplot:z}),this.context.device.type===\"webgpu\"&&(W.instanceCount=this.props.data.length),W.draw(this.context.renderPass)}_getModel(){let t=this.context.device.type===\"webgpu\"?{depthWriteEnabled:!0,depthCompare:\"less-equal\"}:void 0,r=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new xs({topology:\"triangle-strip\",attributes:{positions:{size:3,value:new Float32Array(r)}}}),isInstanced:!0,parameters:t})}};rC.defaultProps=iWt;rC.layerName=\"ScatterplotLayer\";var Sb=rC;var W3={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function Mb(e,t,r={}){return oyt(e,r)!==t?(nWt(e,r),!0):!1}function oyt(e,t={}){return Math.sign(f9(e,t))}var NX={x:0,y:1,z:2};function f9(e,t={}){let{start:r=0,end:i=e.length,plane:n=\"xy\"}=t,o=t.size||2,s=0,a=NX[n[0]],h=NX[n[1]];for(let p=r,g=i-o;p<i;p+=o)s+=(e[p+a]-e[g+a])*(e[p+h]+e[g+h]),g=p;return s/2}function nWt(e,t){let{start:r=0,end:i=e.length,size:n=2}=t,o=(i-r)/n,s=Math.floor(o/2);for(let a=0;a<s;++a){let h=r+a*n,p=r+(o-1-a)*n;for(let g=0;g<n;++g){let w=e[h+g];e[h+g]=e[p+g],e[p+g]=w}}}function Tu(e,t){let r=t.length,i=e.length;if(i>0){let n=!0;for(let o=0;o<r;o++)if(e[i-r+o]!==t[o]){n=!1;break}if(n)return!1}for(let n=0;n<r;n++)e[i+n]=t[n];return!0}function iC(e,t){let r=t.length;for(let i=0;i<r;i++)e[i]=t[i]}function x1(e,t,r,i,n=[]){let o=i+t*r;for(let s=0;s<r;s++)n[s]=e[o+s];return n}function p9(e,t,r,i,n=[]){let o,s;if(r&8)o=(i[3]-e[1])/(t[1]-e[1]),s=3;else if(r&4)o=(i[1]-e[1])/(t[1]-e[1]),s=1;else if(r&2)o=(i[2]-e[0])/(t[0]-e[0]),s=2;else if(r&1)o=(i[0]-e[0])/(t[0]-e[0]),s=0;else return null;for(let a=0;a<e.length;a++)n[a]=(s&1)===a?i[s]:o*(t[a]-e[a])+e[a];return n}function nC(e,t){let r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}function oC(e,t){let{size:r=2,broken:i=!1,gridResolution:n=10,gridOffset:o=[0,0],startIndex:s=0,endIndex:a=e.length}=t||{},h=(a-s)/r,p=[],g=[p],w=x1(e,0,r,s),C,R,z=lyt(w,n,o,[]),W=[];Tu(p,w);for(let Y=1;Y<h;Y++){for(C=x1(e,Y,r,s,C),R=nC(C,z);R;){p9(w,C,R,z,W);let H=nC(W,z);H&&(p9(w,W,H,z,W),R=H),Tu(p,W),iC(w,W),aWt(z,n,R),i&&p.length>r&&(p=[],g.push(p),Tu(p,w)),R=nC(C,z)}Tu(p,C),iC(w,C)}return i?g:g[0]}var syt=0,sWt=1;function sC(e,t=null,r){if(!e.length)return[];let{size:i=2,gridResolution:n=10,gridOffset:o=[0,0],edgeTypes:s=!1}=r||{},a=[],h=[{pos:e,types:s?new Array(e.length/i).fill(sWt):null,holes:t||[]}],p=[[],[]],g=[];for(;h.length;){let{pos:w,types:C,holes:R}=h.shift();lWt(w,i,R[0]||w.length,p),g=lyt(p[0],n,o,g);let z=nC(p[1],g);if(z){let W=ayt(w,C,i,0,R[0]||w.length,g,z),Y={pos:W[0].pos,types:W[0].types,holes:[]},H={pos:W[1].pos,types:W[1].types,holes:[]};h.push(Y,H);for(let Q=0;Q<R.length;Q++)W=ayt(w,C,i,R[Q],R[Q+1]||w.length,g,z),W[0]&&(Y.holes.push(Y.pos.length),Y.pos=m9(Y.pos,W[0].pos),s&&(Y.types=m9(Y.types,W[0].types))),W[1]&&(H.holes.push(H.pos.length),H.pos=m9(H.pos,W[1].pos),s&&(H.types=m9(H.types,W[1].types)))}else{let W={positions:w};s&&(W.edgeTypes=C),R.length&&(W.holeIndices=R),a.push(W)}}return a}function ayt(e,t,r,i,n,o,s){let a=(n-i)/r,h=[],p=[],g=[],w=[],C=[],R,z,W,Y=x1(e,a-1,r,i),H=Math.sign(s&8?Y[1]-o[3]:Y[0]-o[2]),Q=t&&t[a-1],tt=0,rt=0;for(let at=0;at<a;at++)R=x1(e,at,r,i,R),z=Math.sign(s&8?R[1]-o[3]:R[0]-o[2]),W=t&&t[i/r+at],z&&H&&H!==z&&(p9(Y,R,s,o,C),Tu(h,C)&&g.push(Q),Tu(p,C)&&w.push(Q)),z<=0?(Tu(h,R)&&g.push(W),tt-=z):g.length&&(g[g.length-1]=syt),z>=0?(Tu(p,R)&&w.push(W),rt+=z):w.length&&(w[w.length-1]=syt),iC(Y,R),H=z,Q=W;return[tt?{pos:h,types:t&&g}:null,rt?{pos:p,types:t&&w}:null]}function lyt(e,t,r,i){let n=Math.floor((e[0]-r[0])/t)*t+r[0],o=Math.floor((e[1]-r[1])/t)*t+r[1];return i[0]=n,i[1]=o,i[2]=n+t,i[3]=o+t,i}function aWt(e,t,r){r&8?(e[1]+=t,e[3]+=t):r&4?(e[1]-=t,e[3]-=t):r&2?(e[0]+=t,e[2]+=t):r&1&&(e[0]-=t,e[2]-=t)}function lWt(e,t,r,i){let n=1/0,o=-1/0,s=1/0,a=-1/0;for(let h=0;h<r;h+=t){let p=e[h],g=e[h+1];n=p<n?p:n,o=p>o?p:o,s=g<s?g:s,a=g>a?g:a}return i[0][0]=n,i[0][1]=s,i[1][0]=o,i[1][1]=a,i}function m9(e,t){for(let r=0;r<t.length;r++)e.push(t[r]);return e}var cWt=85.051129;function zX(e,t){let{size:r=2,startIndex:i=0,endIndex:n=e.length,normalize:o=!0}=t||{},s=e.slice(i,n);cyt(s,r,0,n-i);let a=oC(s,{size:r,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(let h of a)uyt(h,r);return a}function UX(e,t=null,r){let{size:i=2,normalize:n=!0,edgeTypes:o=!1}=r||{};t=t||[];let s=[],a=[],h=0,p=0;for(let w=0;w<=t.length;w++){let C=t[w]||e.length,R=p,z=uWt(e,i,h,C);for(let W=z;W<C;W++)s[p++]=e[W];for(let W=h;W<z;W++)s[p++]=e[W];cyt(s,i,R,p),hWt(s,i,R,p,r?.maxLatitude),h=C,a[w]=p}a.pop();let g=sC(s,a,{size:i,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(n)for(let w of g)uyt(w.positions,i);return g}function uWt(e,t,r,i){let n=-1,o=-1;for(let s=r+1;s<i;s+=t){let a=Math.abs(e[s]);a>n&&(n=a,o=s-1)}return o}function hWt(e,t,r,i,n=cWt){let o=e[r],s=e[i-t];if(Math.abs(o-s)>180){let a=x1(e,0,t,r);a[0]+=Math.round((s-o)/360)*360,Tu(e,a),a[1]=Math.sign(a[1])*n,Tu(e,a),a[0]=o,Tu(e,a)}}function cyt(e,t,r,i){let n=e[0],o;for(let s=r;s<i;s+=t){o=e[s];let a=o-n;(a>180||a<-180)&&(o-=Math.round(a/360)*360),e[s]=n=o}}function uyt(e,t){let r,i=e.length/t;for(let o=0;o<i&&(r=e[o*t],(r+180)%360===0);o++);let n=-Math.round(r/360)*360;if(n!==0)for(let o=0;o<i;o++)e[o*t]+=n}var aC=class extends xs{constructor(t){let{indices:r,attributes:i}=fWt(t);super({...t,indices:r,attributes:i})}};function fWt(e){let{radius:t,height:r=1,nradial:i=10}=e,{vertices:n}=e;n&&(hr.assert(n.length>=i),n=n.flatMap(R=>[R[0],R[1]]),Mb(n,W3.COUNTER_CLOCKWISE));let o=r>0,s=i+1,a=o?s*3+1:i,h=Math.PI*2/i,p=new Uint16Array(o?i*3*2:0),g=new Float32Array(a*3),w=new Float32Array(a*3),C=0;if(o){for(let R=0;R<s;R++){let z=R*h,W=R%i,Y=Math.sin(z),H=Math.cos(z);for(let Q=0;Q<2;Q++)g[C+0]=n?n[W*2]:H*t,g[C+1]=n?n[W*2+1]:Y*t,g[C+2]=(1/2-Q)*r,w[C+0]=n?n[W*2]:H,w[C+1]=n?n[W*2+1]:Y,C+=3}g[C+0]=g[C-3],g[C+1]=g[C-2],g[C+2]=g[C-1],C+=3}for(let R=o?0:1;R<s;R++){let z=Math.floor(R/2)*Math.sign(.5-R%2),W=z*h,Y=(z+i)%i,H=Math.sin(W),Q=Math.cos(W);g[C+0]=n?n[Y*2]:Q*t,g[C+1]=n?n[Y*2+1]:H*t,g[C+2]=r/2,w[C+2]=1,C+=3}if(o){let R=0;for(let z=0;z<i;z++)p[R++]=z*2+0,p[R++]=z*2+2,p[R++]=z*2+0,p[R++]=z*2+1,p[R++]=z*2+1,p[R++]=z*2+3}return{indices:p,attributes:{POSITION:{size:3,value:g},NORMAL:{size:3,value:w}}}}var hyt=`uniform columnUniforms {\n  float radius;\n  float angle;\n  vec2 offset;\n  bool extruded;\n  bool stroked;\n  bool isStroke;\n  float coverage;\n  float elevationScale;\n  float edgeDistance;\n  float widthScale;\n  float widthMinPixels;\n  float widthMaxPixels;\n  highp int radiusUnits;\n  highp int widthUnits;\n} column;\n`,dyt={name:\"column\",vs:hyt,fs:hyt,uniformTypes:{radius:\"f32\",angle:\"f32\",offset:\"vec2<f32>\",extruded:\"f32\",stroked:\"f32\",isStroke:\"f32\",coverage:\"f32\",elevationScale:\"f32\",edgeDistance:\"f32\",widthScale:\"f32\",widthMinPixels:\"f32\",widthMaxPixels:\"f32\",radiusUnits:\"i32\",widthUnits:\"i32\"}};var fyt=`#version 300 es\n#define SHADER_NAME column-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\nin vec3 instancePickingColors;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec3 cameraPosition;\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nvec4 color = column.isStroke ? instanceLineColors : instanceFillColors;\nmat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle));\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (column.extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale;\n} else if (column.stroked) {\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits),\ncolumn.widthMinPixels, column.widthMaxPixels) / 2.0;\nfloat halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius);\nif (column.isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat dotRadius = column.radius * column.coverage * shouldRender;\ngeometry.pickingColor = instancePickingColors;\nvec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\nvec3 centroidPosition64Low = instancePositions64Low;\nvec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius;\nif (column.radiusUnits == UNIT_METERS) {\noffset = project_size(offset);\n} else if (column.radiusUnits == UNIT_PIXELS) {\noffset = project_pixel_size(offset);\n}\nvec3 pos = vec3(offset, 0.);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\ngeometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (column.extruded && !column.isStroke) {\n#ifdef FLAT_SHADING\ncameraPosition = project.cameraPosition;\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * layer.opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * layer.opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * layer.opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var pyt=`#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\nprecision highp float;\nout vec4 fragColor;\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n#endif\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\n#ifdef FLAT_SHADING\nif (column.extruded && !column.isStroke && !bool(picking.isActive)) {\nvec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\nfragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n}\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var g9=[0,0,0,255],pWt={diskResolution:{type:\"number\",min:4,value:20},vertices:null,radius:{type:\"number\",min:0,value:1e3},angle:{type:\"number\",value:0},offset:{type:\"array\",value:[0,0]},coverage:{type:\"number\",min:0,max:1,value:1},elevationScale:{type:\"number\",min:0,value:1},radiusUnits:\"meters\",lineWidthUnits:\"meters\",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:\"accessor\",value:e=>e.position},getFillColor:{type:\"accessor\",value:g9},getLineColor:{type:\"accessor\",value:g9},getLineWidth:{type:\"accessor\",value:1},getElevation:{type:\"accessor\",value:1e3},material:!0,getColor:{deprecatedFor:[\"getFillColor\",\"getLineColor\"]}},lC=class extends ho{getShaders(){let t={},{flatShading:r}=this.props;return r&&(t.FLAT_SHADING=1),super.getShaders({vs:fyt,fs:pyt,defines:t,modules:[Mo,r?lb:kg,bs,dyt]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getPosition\"},instanceElevations:{size:1,transition:!0,accessor:\"getElevation\"},instanceFillColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getFillColor\",defaultValue:g9},instanceLineColors:{size:this.props.colorFormat.length,type:\"unorm8\",transition:!0,accessor:\"getLineColor\",defaultValue:g9},instanceStrokeWidths:{size:1,accessor:\"getLineWidth\",transition:!0}})}updateState(t){super.updateState(t);let{props:r,oldProps:i,changeFlags:n}=t,o=n.extensionsChanged||r.flatShading!==i.flatShading;o&&(this.state.models?.forEach(a=>a.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());let s=this.getNumInstances();this.state.fillModel.setInstanceCount(s),this.state.wireframeModel.setInstanceCount(s),(o||r.diskResolution!==i.diskResolution||r.vertices!==i.vertices||(r.extruded||r.stroked)!==(i.extruded||i.stroked))&&this._updateGeometry(r)}getGeometry(t,r,i){let n=new aC({radius:1,height:i?2:0,vertices:r,nradial:t}),o=0;if(r)for(let s=0;s<t;s++){let a=r[s],h=Math.sqrt(a[0]*a[0]+a[1]*a[1]);o+=h/t}else o=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*o}),n}_getModels(){let t=this.getShaders(),r=this.getAttributeManager().getBufferLayouts(),i=new sn(this.context.device,{...t,id:`${this.props.id}-fill`,bufferLayout:r,isInstanced:!0}),n=new sn(this.context.device,{...t,id:`${this.props.id}-wireframe`,bufferLayout:r,isInstanced:!0});return{fillModel:i,wireframeModel:n,models:[n,i]}}_updateGeometry({diskResolution:t,vertices:r,extruded:i,stroked:n}){let o=this.getGeometry(t,r,i||n);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3});let s=this.state.fillModel,a=this.state.wireframeModel;s.setGeometry(o),s.setTopology(\"triangle-strip\"),s.setIndexBuffer(null),a.setGeometry(o),a.setTopology(\"line-list\")}draw({uniforms:t}){let{lineWidthUnits:r,lineWidthScale:i,lineWidthMinPixels:n,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:a,extruded:h,filled:p,stroked:g,wireframe:w,offset:C,coverage:R,radius:z,angle:W}=this.props,Y=this.state.fillModel,H=this.state.wireframeModel,{fillVertexCount:Q,edgeDistance:tt}=this.state,rt={radius:z,angle:W/180*Math.PI,offset:C,extruded:h,stroked:g,coverage:R,elevationScale:a,edgeDistance:tt,radiusUnits:rs[s],widthUnits:rs[r],widthScale:i,widthMinPixels:n,widthMaxPixels:o};h&&w&&(H.shaderInputs.setProps({column:{...rt,isStroke:!0}}),H.draw(this.context.renderPass)),p&&(Y.setVertexCount(Q),Y.shaderInputs.setProps({column:{...rt,isStroke:!1}}),Y.draw(this.context.renderPass)),!h&&g&&(Y.setVertexCount(Q*2/3),Y.shaderInputs.setProps({column:{...rt,isStroke:!0}}),Y.draw(this.context.renderPass))}};lC.layerName=\"ColumnLayer\";lC.defaultProps=pWt;var q3=lC;function myt(e,t,r,i){let n;if(Array.isArray(e[0])){let o=e.length*t;n=new Array(o);for(let s=0;s<e.length;s++)for(let a=0;a<t;a++)n[s*t+a]=e[s][a]||0}else n=e;return r?oC(n,{size:t,gridResolution:r}):i?zX(n,{size:t}):n}var mWt=1,gWt=2,VX=4,cC=class extends b1{constructor(t){super({...t,attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}get(t){return this.attributes[t]}getGeometryFromBuffer(t){return this.normalize?super.getGeometryFromBuffer(t):null}normalizeGeometry(t){return this.normalize?myt(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}getGeometrySize(t){if(gyt(t)){let i=0;for(let n of t)i+=this.getGeometrySize(n);return i}let r=this.getPathLength(t);return r<2?0:this.isClosed(t)?r<3?0:r+2:r}updateGeometryAttributes(t,r){if(r.geometrySize!==0)if(t&&gyt(t))for(let i of t){let n=this.getGeometrySize(i);r.geometrySize=n,this.updateGeometryAttributes(i,r),r.vertexStart+=n}else this._updateSegmentTypes(t,r),this._updatePositions(t,r)}_updateSegmentTypes(t,r){let i=this.attributes.segmentTypes,n=t?this.isClosed(t):!1,{vertexStart:o,geometrySize:s}=r;i.fill(0,o,o+s),n?(i[o]=VX,i[o+s-2]=VX):(i[o]+=mWt,i[o+s-2]+=gWt),i[o+s-1]=VX}_updatePositions(t,r){let{positions:i}=this.attributes;if(!i||!t)return;let{vertexStart:n,geometrySize:o}=r,s=new Array(3);for(let a=n,h=0;h<o;a++,h++)this.getPointOnPath(t,h,s),i[a*3]=s[0],i[a*3+1]=s[1],i[a*3+2]=s[2]}getPathLength(t){return t.length/this.positionSize}getPointOnPath(t,r,i=[]){let{positionSize:n}=this;r*n>=t.length&&(r+=1-t.length/n);let o=r*n;return i[0]=t[o],i[1]=t[o+1],i[2]=n===3&&t[o+2]||0,i}isClosed(t){if(!this.normalize)return!!this.opts.loop;let{positionSize:r}=this,i=t.length-r;return t[0]===t[i]&&t[1]===t[i+1]&&(r===2||t[2]===t[i+2])}};function gyt(e){return Array.isArray(e[0])}var Ayt=`uniform pathUniforms {\n  float widthScale;\n  float widthMinPixels;\n  float widthMaxPixels;\n  float jointType;\n  float capType;\n  float miterLimit;\n  bool billboard;\n  highp int widthUnits;\n} path;\n`,yyt={name:\"path\",vs:Ayt,fs:Ayt,uniformTypes:{widthScale:\"f32\",widthMinPixels:\"f32\",widthMaxPixels:\"f32\",jointType:\"f32\",capType:\"f32\",miterLimit:\"f32\",billboard:\"f32\",widthUnits:\"i32\"}};var _yt=`#version 300 es\n#define SHADER_NAME path-layer-vertex-shader\nin vec2 positions;\nin float instanceTypes;\nin vec3 instanceStartPositions;\nin vec3 instanceEndPositions;\nin vec3 instanceLeftPositions;\nin vec3 instanceRightPositions;\nin vec3 instanceLeftPositions64Low;\nin vec3 instanceStartPositions64Low;\nin vec3 instanceEndPositions64Low;\nin vec3 instanceRightPositions64Low;\nin float instanceStrokeWidths;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nuniform float opacity;\nout vec4 vColor;\nout vec2 vCornerOffset;\nout float vMiterLength;\nout vec2 vPathPosition;\nout float vPathLength;\nout float vJointType;\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\nfloat flipIfTrue(bool flag) {\nreturn -(float(flag) * 2. - 1.);\n}\nvec3 getLineJoinOffset(\nvec3 prevPoint, vec3 currPoint, vec3 nextPoint,\nvec2 width\n) {\nbool isEnd = positions.x > 0.0;\nfloat sideOfPath = positions.y;\nfloat isJoint = float(sideOfPath == 0.0);\nvec3 deltaA3 = (currPoint - prevPoint);\nvec3 deltaB3 = (nextPoint - currPoint);\nmat3 rotationMatrix;\nbool needsRotation = !path.billboard && project_needs_rotation(currPoint, rotationMatrix);\nif (needsRotation) {\ndeltaA3 = deltaA3 * rotationMatrix;\ndeltaB3 = deltaB3 * rotationMatrix;\n}\nvec2 deltaA = deltaA3.xy / width;\nvec2 deltaB = deltaB3.xy / width;\nfloat lenA = length(deltaA);\nfloat lenB = length(deltaB);\nvec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\nvec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\nvec2 perpA = vec2(-dirA.y, dirA.x);\nvec2 perpB = vec2(-dirB.y, dirB.x);\nvec2 tangent = dirA + dirB;\ntangent = length(tangent) > 0. ? normalize(tangent) : perpA;\nvec2 miterVec = vec2(-tangent.y, tangent.x);\nvec2 dir = isEnd ? dirA : dirB;\nvec2 perp = isEnd ? perpA : perpB;\nfloat L = isEnd ? lenA : lenB;\nfloat sinHalfA = abs(dot(miterVec, perp));\nfloat cosHalfA = abs(dot(dirA, miterVec));\nfloat turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\nfloat cornerPosition = sideOfPath * turnDirection;\nfloat miterSize = 1.0 / max(sinHalfA, EPSILON);\nmiterSize = mix(\nmin(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\nmiterSize,\nstep(0.0, cornerPosition)\n);\nvec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n* (sideOfPath + isJoint * turnDirection);\nbool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\nbool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\nbool isCap = isStartCap || isEndCap;\nif (isCap) {\noffsetVec = mix(perp * sideOfPath, dir * path.capType * 4.0 * flipIfTrue(isStartCap), isJoint);\nvJointType = path.capType;\n} else {\nvJointType = path.jointType;\n}\nvPathLength = L;\nvCornerOffset = offsetVec;\nvMiterLength = dot(vCornerOffset, miterVec * turnDirection);\nvMiterLength = isCap ? isJoint : vMiterLength;\nvec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\nvPathPosition = vec2(\ndot(offsetFromStartOfPath, perp),\ndot(offsetFromStartOfPath, dir)\n);\ngeometry.uv = vPathPosition;\nfloat isValid = step(instanceTypes, 3.5);\nvec3 offset = vec3(offsetVec * width * isValid, 0.0);\nif (needsRotation) {\noffset = rotationMatrix * offset;\n}\nreturn offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\nif (position.w < EPSILON) {\nfloat r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\nposition = refPosition + (position - refPosition) * r;\n}\n}\nvoid main() {\ngeometry.pickingColor = instancePickingColors;\nvColor = vec4(instanceColors.rgb, instanceColors.a * layer.opacity);\nfloat isEnd = positions.x;\nvec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\nvec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\nvec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\nvec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\nvec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\nvec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\ngeometry.worldPosition = currPosition;\nvec2 widthPixels = vec2(clamp(\nproject_size_to_pixel(instanceStrokeWidths * path.widthScale, path.widthUnits),\npath.widthMinPixels, path.widthMaxPixels) / 2.0);\nvec3 width;\nif (path.billboard) {\nvec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\nvec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\nvec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\nclipLine(prevPositionScreen, currPositionScreen);\nclipLine(nextPositionScreen, currPositionScreen);\nclipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\nwidth = vec3(widthPixels, 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(\nprevPositionScreen.xyz / prevPositionScreen.w,\ncurrPositionScreen.xyz / currPositionScreen.w,\nnextPositionScreen.xyz / nextPositionScreen.w,\nproject_pixel_size_to_clipspace(width.xy)\n);\nDECKGL_FILTER_GL_POSITION(currPositionScreen, geometry);\ngl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w);\n} else {\nprevPosition = project_position(prevPosition, prevPosition64Low);\ncurrPosition = project_position(currPosition, currPosition64Low);\nnextPosition = project_position(nextPosition, nextPosition64Low);\nwidth = vec3(project_pixel_size(widthPixels), 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy);\ngeometry.position = vec4(currPosition + offset, 1.0);\ngl_Position = project_common_position_to_clipspace(geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var vyt=`#version 300 es\n#define SHADER_NAME path-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 vCornerOffset;\nin float vMiterLength;\nin vec2 vPathPosition;\nin float vPathLength;\nin float vJointType;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vPathPosition;\nif (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\nif (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\ndiscard;\n}\nif (vJointType < 0.5 && vMiterLength > path.miterLimit + 1.0) {\ndiscard;\n}\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var byt=[0,0,0,255],AWt={widthUnits:\"meters\",widthScale:{type:\"number\",min:0,value:1},widthMinPixels:{type:\"number\",min:0,value:0},widthMaxPixels:{type:\"number\",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:\"number\",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:\"accessor\",value:e=>e.path},getColor:{type:\"accessor\",value:byt},getWidth:{type:\"accessor\",value:1},rounded:{deprecatedFor:[\"jointRounded\",\"capRounded\"]}},jX={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e},uC=class extends ho{getShaders(){return super.getShaders({vs:_yt,fs:vyt,modules:[Mo,bs,yyt]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds([\"vertexPositions\"])}initializeState(){this.getAttributeManager().addInstanced({vertexPositions:{size:3,vertexOffset:1,type:\"float64\",fp64:this.use64bitPositions(),transition:jX,accessor:\"getPath\",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:\"uint8\",update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:\"getWidth\",transition:jX,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:\"unorm8\",accessor:\"getColor\",transition:jX,defaultValue:byt},instancePickingColors:{size:4,type:\"uint8\",accessor:(i,{index:n,target:o})=>this.encodePickingColor(i&&i.__source?i.__source.index:n,o)}}),this.setState({pathTesselator:new cC({fp64:this.use64bitPositions()})})}updateState(t){super.updateState(t);let{props:r,changeFlags:i}=t,n=this.getAttributeManager();if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPath)){let{pathTesselator:s}=this.state,a=r.data.attributes||{};s.updateGeometry({data:r.data,geometryBuffer:a.getPath,buffers:a,normalize:!r._pathType,loop:r._pathType===\"loop\",getGeometry:r.getPath,positionFormat:r.positionFormat,wrapLongitude:r.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:i.dataChanged}),this.setState({numInstances:s.instanceCount,startIndices:s.vertexStarts}),i.dataChanged||n.invalidateAll()}i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),n.invalidateAll())}getPickingInfo(t){let r=super.getPickingInfo(t),{index:i}=r,n=this.props.data;return n[0]&&n[0].__source&&(r.object=n.find(o=>o.__source.index===i)),r}disablePickingIndex(t){let r=this.props.data;if(r[0]&&r[0].__source)for(let i=0;i<r.length;i++)r[i].__source.index===t&&this._disablePickingIndex(i);else super.disablePickingIndex(t)}draw({uniforms:t}){let{jointRounded:r,capRounded:i,billboard:n,miterLimit:o,widthUnits:s,widthScale:a,widthMinPixels:h,widthMaxPixels:p}=this.props,g=this.state.model,w={jointType:Number(r),capType:Number(i),billboard:n,widthUnits:rs[s],widthScale:a,miterLimit:o,widthMinPixels:h,widthMaxPixels:p};g.shaderInputs.setProps({path:w}),g.draw(this.context.renderPass)}_getModel(){let t=[0,1,2,1,4,2,1,3,4,3,5,4],r=[0,0,0,-1,0,1,1,-1,1,1,1,0];return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new xs({topology:\"triangle-list\",attributes:{indices:new Uint16Array(t),positions:{value:new Float32Array(r),size:2}}}),isInstanced:!0})}calculatePositions(t){let{pathTesselator:r}=this.state;t.startIndices=r.vertexStarts,t.value=r.get(\"positions\")}calculateSegmentTypes(t){let{pathTesselator:r}=this.state;t.startIndices=r.vertexStarts,t.value=r.get(\"segmentTypes\")}};uC.defaultProps=AWt;uC.layerName=\"PathLayer\";var Kf=uC;var kyt=xe(Myt(),1);var b9=W3.CLOCKWISE,Eyt=W3.COUNTER_CLOCKWISE,w1={isClosed:!0};function DWt(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error(\"invalid polygon\")}function Y3(e){return\"positions\"in e?e.positions:e}function pC(e){return\"holeIndices\"in e?e.holeIndices:null}function OWt(e){return Array.isArray(e[0])}function LWt(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function BWt(e){let t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]}function FWt(e,t,r,i){for(let n=0;n<t;n++)if(e[r+n]!==e[i-t+n])return!1;return!0}function Pyt(e,t,r,i,n){let o=t,s=r.length;for(let a=0;a<s;a++)for(let h=0;h<i;h++)e[o++]=r[a][h]||0;if(!BWt(r))for(let a=0;a<i;a++)e[o++]=r[0][a]||0;return w1.start=t,w1.end=o,w1.size=i,Mb(e,n,w1),o}function Cyt(e,t,r,i,n=0,o,s){o=o||r.length;let a=o-n;if(a<=0)return t;let h=t;for(let p=0;p<a;p++)e[h++]=r[n+p];if(!FWt(r,i,n,o))for(let p=0;p<i;p++)e[h++]=r[n+p];return w1.start=t,w1.end=h,w1.size=i,Mb(e,s,w1),h}function x9(e,t){DWt(e);let r=[],i=[];if(\"positions\"in e){let{positions:n,holeIndices:o}=e;if(o){let s=0;for(let a=0;a<=o.length;a++)s=Cyt(r,s,n,t,o[a-1],o[a],a===0?b9:Eyt),i.push(s);return i.pop(),{positions:r,holeIndices:i}}e=n}if(!OWt(e))return Cyt(r,0,e,t,0,r.length,b9),r;if(!LWt(e)){let n=0;for(let[o,s]of e.entries())n=Pyt(r,n,s,t,o===0?b9:Eyt),i.push(n);return i.pop(),{positions:r,holeIndices:i}}return Pyt(r,0,e,t,b9),r}function HX(e,t,r){let i=e.length/3,n=0;for(let o=0;o<i;o++){let s=(o+1)%i;n+=e[o*3+t]*e[s*3+r],n-=e[s*3+t]*e[o*3+r]}return Math.abs(n/2)}function Iyt(e,t,r,i){let n=e.length/3;for(let o=0;o<n;o++){let s=o*3,a=e[s+0],h=e[s+1],p=e[s+2];e[s+t]=a,e[s+r]=h,e[s+i]=p}}function Ryt(e,t,r,i){let n=pC(e);n&&(n=n.map(a=>a/t));let o=Y3(e),s=i&&t===3;if(r){let a=o.length;o=o.slice();let h=[];for(let p=0;p<a;p+=t){h[0]=o[p],h[1]=o[p+1],s&&(h[2]=o[p+2]);let g=r(h);o[p]=g[0],o[p+1]=g[1],s&&(o[p+2]=g[2])}}if(s){let a=HX(o,0,1),h=HX(o,0,2),p=HX(o,1,2);if(!a&&!h&&!p)return[];a>h&&a>p||(h>p?(r||(o=o.slice()),Iyt(o,0,2,1)):(r||(o=o.slice()),Iyt(o,2,0,1)))}return(0,kyt.default)(o,n,t)}var mC=class extends b1{constructor(t){let{fp64:r,IndexType:i=Uint32Array}=t;super({...t,attributes:{positions:{size:3,type:r?Float64Array:Float32Array},vertexValid:{type:Uint16Array,size:1},indices:{type:i,size:1}}})}get(t){let{attributes:r}=this;return t===\"indices\"?r.indices&&r.indices.subarray(0,this.vertexCount):r[t]}updateGeometry(t){super.updateGeometry(t);let r=this.buffers.indices;if(r)this.vertexCount=(r.value||r).length;else if(this.data&&!this.getGeometry)throw new Error(\"missing indices buffer\")}normalizeGeometry(t){if(this.normalize){let r=x9(t,this.positionSize);return this.opts.resolution?sC(Y3(r),pC(r),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?UX(Y3(r),pC(r),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):r}return t}getGeometrySize(t){if(Oyt(t)){let r=0;for(let i of t)r+=this.getGeometrySize(i);return r}return Y3(t).length/this.positionSize}getGeometryFromBuffer(t){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(t):null}updateGeometryAttributes(t,r){if(t&&Oyt(t))for(let i of t){let n=this.getGeometrySize(i);r.geometrySize=n,this.updateGeometryAttributes(i,r),r.vertexStart+=n,r.indexStart=this.indexStarts[r.geometryIndex+1]}else{let i=t;this._updateIndices(i,r),this._updatePositions(i,r),this._updateVertexValid(i,r)}}_updateIndices(t,{geometryIndex:r,vertexStart:i,indexStart:n}){let{attributes:o,indexStarts:s,typedArrayManager:a}=this,h=o.indices;if(!h||!t)return;let p=n,g=Ryt(t,this.positionSize,this.opts.preproject,this.opts.full3d);h=a.allocate(h,n+g.length,{copy:!0});for(let w=0;w<g.length;w++)h[p++]=g[w]+i;s[r+1]=n+g.length,o.indices=h}_updatePositions(t,{vertexStart:r,geometrySize:i}){let{attributes:{positions:n},positionSize:o}=this;if(!n||!t)return;let s=Y3(t);for(let a=r,h=0;h<i;a++,h++){let p=s[h*o],g=s[h*o+1],w=o>2?s[h*o+2]:0;n[a*3]=p,n[a*3+1]=g,n[a*3+2]=w}}_updateVertexValid(t,{vertexStart:r,geometrySize:i}){let{positionSize:n}=this,o=this.attributes.vertexValid,s=t&&pC(t);if(t&&t.edgeTypes?o.set(t.edgeTypes,r):o.fill(1,r,r+i),s)for(let a=0;a<s.length;a++)o[r+s[a]/n-1]=0;o[r+i-1]=0}};function Oyt(e){return Array.isArray(e)&&e.length>0&&!Number.isFinite(e[0])}var Lyt=`uniform solidPolygonUniforms {\n  bool extruded;\n  bool isWireframe;\n  float elevationScale;\n} solidPolygon;\n`,Byt={name:\"solidPolygon\",vs:Lyt,fs:Lyt,uniformTypes:{extruded:\"f32\",isWireframe:\"f32\",elevationScale:\"f32\"}};var w9=`in vec4 fillColors;\nin vec4 lineColors;\nin vec3 pickingColors;\nout vec4 vColor;\nstruct PolygonProps {\nvec3 positions;\nvec3 positions64Low;\nvec3 normal;\nfloat elevations;\n};\nvec3 project_offset_normal(vec3 vector) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject.coordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\nreturn normalize(vector * project.commonUnitsPerWorldUnit);\n}\nreturn project_normal(vector);\n}\nvoid calculatePosition(PolygonProps props) {\nvec3 pos = props.positions;\nvec3 pos64Low = props.positions64Low;\nvec3 normal = props.normal;\nvec4 colors = solidPolygon.isWireframe ? lineColors : fillColors;\ngeometry.worldPosition = props.positions;\ngeometry.pickingColor = pickingColors;\nif (solidPolygon.extruded) {\npos.z += props.elevations * solidPolygon.elevationScale;\n}\ngl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (solidPolygon.extruded) {\n#ifdef IS_SIDE_VERTEX\nnormal = project_offset_normal(normal);\n#else\nnormal = project_normal(normal);\n#endif\ngeometry.normal = normal;\nvec3 lightColor = lighting_getLightColor(colors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, colors.a * layer.opacity);\n} else {\nvColor = vec4(colors.rgb, colors.a * layer.opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var Fyt=`#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader\nin vec3 vertexPositions;\nin vec3 vertexPositions64Low;\nin float elevations;\n${w9}\nvoid main(void) {\nPolygonProps props;\nprops.positions = vertexPositions;\nprops.positions64Low = vertexPositions64Low;\nprops.elevations = elevations;\nprops.normal = vec3(0.0, 0.0, 1.0);\ncalculatePosition(props);\n}\n`;var Nyt=`#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\nin vec2 positions;\nin vec3 vertexPositions;\nin vec3 nextVertexPositions;\nin vec3 vertexPositions64Low;\nin vec3 nextVertexPositions64Low;\nin float elevations;\nin float instanceVertexValid;\n${w9}\nvoid main(void) {\nif(instanceVertexValid < 0.5){\ngl_Position = vec4(0.);\nreturn;\n}\nPolygonProps props;\nvec3 pos;\nvec3 pos64Low;\nvec3 nextPos;\nvec3 nextPos64Low;\n#if RING_WINDING_ORDER_CW == 1\npos = vertexPositions;\npos64Low = vertexPositions64Low;\nnextPos = nextVertexPositions;\nnextPos64Low = nextVertexPositions64Low;\n#else\npos = nextVertexPositions;\npos64Low = nextVertexPositions64Low;\nnextPos = vertexPositions;\nnextPos64Low = vertexPositions64Low;\n#endif\nprops.positions = mix(pos, nextPos, positions.x);\nprops.positions64Low = mix(pos64Low, nextPos64Low, positions.x);\nprops.normal = vec3(\npos.y - nextPos.y + (pos64Low.y - nextPos64Low.y),\nnextPos.x - pos.x + (nextPos64Low.x - pos64Low.x),\n0.0);\nprops.elevations = elevations * positions.y;\ncalculatePosition(props);\n}\n`;var zyt=`#version 300 es\n#define SHADER_NAME solid-polygon-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var S9=[0,0,0,255],NWt={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:\"CW\",_full3d:!1,elevationScale:{type:\"number\",min:0,value:1},getPolygon:{type:\"accessor\",value:e=>e.polygon},getElevation:{type:\"accessor\",value:1e3},getFillColor:{type:\"accessor\",value:S9},getLineColor:{type:\"accessor\",value:S9},material:!0},T9={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e},gC=class extends ho{getShaders(t){return super.getShaders({vs:t===\"top\"?Fyt:Nyt,fs:zyt,defines:{RING_WINDING_ORDER_CW:!this.props._normalize&&this.props._windingOrder===\"CCW\"?0:1},modules:[Mo,kg,bs,Byt]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds([\"vertexPositions\"])}initializeState(){let{viewport:t}=this.context,{coordinateSystem:r}=this.props,{_full3d:i}=this.props;t.isGeospatial&&r===Vr.DEFAULT&&(r=Vr.LNGLAT);let n;r===Vr.LNGLAT&&(i?n=t.projectPosition.bind(t):n=t.projectFlat.bind(t)),this.setState({numInstances:0,polygonTesselator:new mC({preproject:n,fp64:this.use64bitPositions(),IndexType:Uint32Array})});let o=this.getAttributeManager(),s=!0;o.remove([\"instancePickingColors\"]),o.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:s},vertexPositions:{size:3,type:\"float64\",stepMode:\"dynamic\",fp64:this.use64bitPositions(),transition:T9,accessor:\"getPolygon\",update:this.calculatePositions,noAlloc:s,shaderAttributes:{nextVertexPositions:{vertexOffset:1}}},instanceVertexValid:{size:1,type:\"uint16\",stepMode:\"instance\",update:this.calculateVertexValid,noAlloc:s},elevations:{size:1,stepMode:\"dynamic\",transition:T9,accessor:\"getElevation\"},fillColors:{size:this.props.colorFormat.length,type:\"unorm8\",stepMode:\"dynamic\",transition:T9,accessor:\"getFillColor\",defaultValue:S9},lineColors:{size:this.props.colorFormat.length,type:\"unorm8\",stepMode:\"dynamic\",transition:T9,accessor:\"getLineColor\",defaultValue:S9},pickingColors:{size:4,type:\"uint8\",stepMode:\"dynamic\",accessor:(a,{index:h,target:p})=>this.encodePickingColor(a&&a.__source?a.__source.index:h,p)}})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:i}=r,n=this.props.data;return n[0]&&n[0].__source&&(r.object=n.find(o=>o.__source.index===i)),r}disablePickingIndex(t){let r=this.props.data;if(r[0]&&r[0].__source)for(let i=0;i<r.length;i++)r[i].__source.index===t&&this._disablePickingIndex(i);else super.disablePickingIndex(t)}draw({uniforms:t}){let{extruded:r,filled:i,wireframe:n,elevationScale:o}=this.props,{topModel:s,sideModel:a,wireframeModel:h,polygonTesselator:p}=this.state,g={extruded:!!r,elevationScale:o,isWireframe:!1};h&&n&&(h.setInstanceCount(p.instanceCount-1),h.shaderInputs.setProps({solidPolygon:{...g,isWireframe:!0}}),h.draw(this.context.renderPass)),a&&i&&(a.setInstanceCount(p.instanceCount-1),a.shaderInputs.setProps({solidPolygon:g}),a.draw(this.context.renderPass)),s&&i&&(s.setVertexCount(p.vertexCount),s.shaderInputs.setProps({solidPolygon:g}),s.draw(this.context.renderPass))}updateState(t){super.updateState(t),this.updateGeometry(t);let{props:r,oldProps:i,changeFlags:n}=t,o=this.getAttributeManager();(n.extensionsChanged||r.filled!==i.filled||r.extruded!==i.extruded)&&(this.state.models?.forEach(a=>a.destroy()),this.setState(this._getModels()),o.invalidateAll())}updateGeometry({props:t,oldProps:r,changeFlags:i}){if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPolygon)){let{polygonTesselator:o}=this.state,s=t.data.attributes||{};o.updateGeometry({data:t.data,normalize:t._normalize,geometryBuffer:s.getPolygon,buffers:s,getGeometry:t.getPolygon,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:i.dataChanged,full3d:t._full3d}),this.setState({numInstances:o.instanceCount,startIndices:o.vertexStarts}),i.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(){let{id:t,filled:r,extruded:i}=this.props,n,o,s;if(r){let a=this.getShaders(\"top\");a.defines.NON_INSTANCED_MODEL=1;let h=this.getAttributeManager().getBufferLayouts({isInstanced:!1});n=new sn(this.context.device,{...a,id:`${t}-top`,topology:\"triangle-list\",bufferLayout:h,isIndexed:!0,userData:{excludeAttributes:{instanceVertexValid:!0}}})}if(i){let a=this.getAttributeManager().getBufferLayouts({isInstanced:!0});o=new sn(this.context.device,{...this.getShaders(\"side\"),id:`${t}-side`,bufferLayout:a,geometry:new xs({topology:\"triangle-strip\",attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,1,1,0,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}}),s=new sn(this.context.device,{...this.getShaders(\"side\"),id:`${t}-wireframe`,bufferLayout:a,geometry:new xs({topology:\"line-strip\",attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}})}return{models:[o,s,n].filter(Boolean),topModel:n,sideModel:o,wireframeModel:s}}calculateIndices(t){let{polygonTesselator:r}=this.state;t.startIndices=r.indexStarts,t.value=r.get(\"indices\")}calculatePositions(t){let{polygonTesselator:r}=this.state;t.startIndices=r.vertexStarts,t.value=r.get(\"positions\")}calculateVertexValid(t){t.value=this.state.polygonTesselator.get(\"vertexValid\")}};gC.defaultProps=NWt;gC.layerName=\"SolidPolygonLayer\";var jg=gC;function M9({data:e,getIndex:t,dataRange:r,replace:i}){let{startRow:n=0,endRow:o=1/0}=r,s=e.length,a=s,h=s;for(let C=0;C<s;C++){let R=t(e[C]);if(a>C&&R>=n&&(a=C),R>=o){h=C;break}}let p=a,w=h-a!==i.length?e.slice(h):void 0;for(let C=0;C<i.length;C++)e[p++]=i[C];if(w){for(let C=0;C<w.length;C++)e[p++]=w[C];e.length=p}return{startRow:a,endRow:a+i.length}}var Uyt=[0,0,0,255],zWt=[0,0,0,255],UWt={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:\"CW\",lineWidthUnits:\"meters\",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:\"accessor\",value:e=>e.polygon},getFillColor:{type:\"accessor\",value:zWt},getLineColor:{type:\"accessor\",value:Uyt},getLineWidth:{type:\"accessor\",value:1},getElevation:{type:\"accessor\",value:1e3},material:!0},AC=class extends bi{initializeState(){this.state={paths:[],pathsDiff:null},this.props.getLineDashArray&&hr.removed(\"getLineDashArray\",\"PathStyleExtension\")()}updateState({changeFlags:t}){let r=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getPolygon);if(r&&Array.isArray(t.dataChanged)){let i=this.state.paths.slice(),n=t.dataChanged.map(o=>M9({data:i,getIndex:s=>s.__source.index,dataRange:o,replace:this._getPaths(o)}));this.setState({paths:i,pathsDiff:n})}else r&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(t={}){let{data:r,getPolygon:i,positionFormat:n,_normalize:o}=this.props,s=[],a=n===\"XY\"?2:3,{startRow:h,endRow:p}=t,{iterable:g,objectInfo:w}=Lc(r,h,p);for(let C of g){w.index++;let R=i(C,w);o&&(R=x9(R,a));let{holeIndices:z}=R,W=R.positions||R;if(z)for(let Y=0;Y<=z.length;Y++){let H=W.slice(z[Y-1]||0,z[Y]||W.length);s.push(this.getSubLayerRow({path:H},C,w.index))}else s.push(this.getSubLayerRow({path:W},C,w.index))}return s}renderLayers(){let{data:t,_dataDiff:r,stroked:i,filled:n,extruded:o,wireframe:s,_normalize:a,_windingOrder:h,elevationScale:p,transitions:g,positionFormat:w}=this.props,{lineWidthUnits:C,lineWidthScale:R,lineWidthMinPixels:z,lineWidthMaxPixels:W,lineJointRounded:Y,lineMiterLimit:H,lineDashJustified:Q}=this.props,{getFillColor:tt,getLineColor:rt,getLineWidth:at,getLineDashArray:et,getElevation:lt,getPolygon:J,updateTriggers:ft,material:dt}=this.props,{paths:Mt,pathsDiff:Ft}=this.state,Nt=this.getSubLayerClass(\"fill\",jg),$t=this.getSubLayerClass(\"stroke\",Kf),Yt=this.shouldRenderSubLayer(\"fill\",Mt)&&new Nt({_dataDiff:r,extruded:o,elevationScale:p,filled:n,wireframe:s,_normalize:a,_windingOrder:h,getElevation:lt,getFillColor:tt,getLineColor:o&&s?rt:Uyt,material:dt,transitions:g},this.getSubLayerProps({id:\"fill\",updateTriggers:ft&&{getPolygon:ft.getPolygon,getElevation:ft.getElevation,getFillColor:ft.getFillColor,lineColors:o&&s,getLineColor:ft.getLineColor}}),{data:t,positionFormat:w,getPolygon:J}),_e=!o&&i&&this.shouldRenderSubLayer(\"stroke\",Mt)&&new $t({_dataDiff:Ft&&(()=>Ft),widthUnits:C,widthScale:R,widthMinPixels:z,widthMaxPixels:W,jointRounded:Y,miterLimit:H,dashJustified:Q,_pathType:\"loop\",transitions:g&&{getWidth:g.getLineWidth,getColor:g.getLineColor,getPath:g.getPolygon},getColor:this.getSubLayerAccessor(rt),getWidth:this.getSubLayerAccessor(at),getDashArray:this.getSubLayerAccessor(et)},this.getSubLayerProps({id:\"stroke\",updateTriggers:ft&&{getWidth:ft.getLineWidth,getColor:ft.getLineColor,getDashArray:ft.getLineDashArray}}),{data:Mt,positionFormat:w,getPath:Pe=>Pe.path});return[!o&&Yt,_e,o&&Yt]}};AC.layerName=\"PolygonLayer\";AC.defaultProps=UWt;var wh=AC;function Vyt(e,t){if(!e)return null;let r=\"startIndices\"in e?e.startIndices[t]:t,i=e.featureIds.value[r];return r!==-1?VWt(e,i,r):null}function VWt(e,t,r){let i={properties:{...e.properties[t]}};for(let n in e.numericProps)i.properties[n]=e.numericProps[n].value[r];return i}function jyt(e,t){let r={points:null,lines:null,polygons:null};for(let i in r){let n=e[i].globalFeatureIds.value;r[i]=new Uint8ClampedArray(n.length*4);let o=[];for(let s=0;s<n.length;s++)t(n[s],o),r[i][s*4+0]=o[0],r[i][s*4+1]=o[1],r[i][s*4+2]=o[2],r[i][s*4+3]=255}return r}var $yt=`uniform sdfUniforms {\n  float gamma;\n  bool enabled;\n  float buffer;\n  float outlineBuffer;\n  vec4 outlineColor;\n} sdf;\n`,Gyt={name:\"sdf\",vs:$yt,fs:$yt,uniformTypes:{gamma:\"f32\",enabled:\"f32\",buffer:\"f32\",outlineBuffer:\"f32\",outlineColor:\"vec4<f32>\"}};var Wyt=`#version 300 es\n#define SHADER_NAME multi-icon-layer-fragment-shader\nprecision highp float;\nuniform sampler2D iconsTexture;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nif (!bool(picking.isActive)) {\nfloat alpha = texture(iconsTexture, vTextureCoords).a;\nvec4 color = vColor;\nif (sdf.enabled) {\nfloat distance = alpha;\nalpha = smoothstep(sdf.buffer - sdf.gamma, sdf.buffer + sdf.gamma, distance);\nif (sdf.outlineBuffer > 0.0) {\nfloat inFill = alpha;\nfloat inBorder = smoothstep(sdf.outlineBuffer - sdf.gamma, sdf.outlineBuffer + sdf.gamma, distance);\ncolor = mix(sdf.outlineColor, vColor, inFill);\nalpha = inBorder;\n}\n}\nfloat a = alpha * color.a;\nif (a < icon.alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color.rgb, a * layer.opacity);\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var YX=192/256,qyt=[],jWt={getIconOffsets:{type:\"accessor\",value:e=>e.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:\"color\",value:[0,0,0,255]}},yC=class extends h9{getShaders(){let t=super.getShaders();return{...t,modules:[...t.modules,Gyt],fs:Wyt}}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:\"getIconOffsets\"},instancePickingColors:{type:\"uint8\",size:3,accessor:(r,{index:i,target:n})=>this.encodePickingColor(i,n)}})}updateState(t){super.updateState(t);let{props:r,oldProps:i}=t,{outlineColor:n}=r;if(n!==i.outlineColor){let o=[n[0]/255,n[1]/255,n[2]/255,(n[3]??255)/255];this.setState({outlineColor:o})}!r.sdf&&r.outlineWidth&&hr.warn(`${this.id}: fontSettings.sdf is required to render outline`)()}draw(t){let{sdf:r,smoothing:i,outlineWidth:n}=this.props,{outlineColor:o}=this.state,s=n?Math.max(i,YX*(1-n)):-1,a=this.state.model,h={buffer:YX,outlineBuffer:s,gamma:i,enabled:!!r,outlineColor:o};if(a.shaderInputs.setProps({sdf:h}),super.draw(t),r&&n){let{iconManager:p}=this.state;p.getTexture()&&(a.shaderInputs.setProps({sdf:{...h,outlineBuffer:YX}}),a.draw(this.context.renderPass))}}getInstanceOffset(t){return t?Array.from(t).flatMap(r=>super.getInstanceOffset(r)):qyt}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).flatMap(r=>super.getInstanceIconFrame(r)):qyt}};yC.defaultProps=jWt;yC.layerName=\"MultiIconLayer\";var Hyt=yC;var _C=class{constructor({fontSize:t=24,buffer:r=3,radius:i=8,cutoff:n=.25,fontFamily:o=\"sans-serif\",fontWeight:s=\"normal\",fontStyle:a=\"normal\",lang:h=null}={}){this.buffer=r,this.cutoff=n,this.radius=i,this.lang=h;let p=this.size=t+r*4,g=this._createCanvas(p),w=this.ctx=g.getContext(\"2d\",{willReadFrequently:!0});w.font=`${a} ${s} ${t}px ${o}`,w.textBaseline=\"alphabetic\",w.textAlign=\"left\",w.fillStyle=\"black\",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){let r=document.createElement(\"canvas\");return r.width=r.height=t,r}draw(t){let{width:r,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:o,actualBoundingBoxRight:s}=this.ctx.measureText(t),a=Math.ceil(i),h=0,p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-o))),g=Math.min(this.size-this.buffer,a+Math.ceil(n)),w=p+2*this.buffer,C=g+2*this.buffer,R=Math.max(w*C,0),z=new Uint8ClampedArray(R),W={data:z,width:w,height:C,glyphWidth:p,glyphHeight:g,glyphTop:a,glyphLeft:h,glyphAdvance:r};if(p===0||g===0)return W;let{ctx:Y,buffer:H,gridInner:Q,gridOuter:tt}=this;this.lang&&(Y.lang=this.lang),Y.clearRect(H,H,p,g),Y.fillText(t,H,H+a);let rt=Y.getImageData(H,H,p,g);tt.fill(1e20,0,R),Q.fill(0,0,R);for(let at=0;at<g;at++)for(let et=0;et<p;et++){let lt=rt.data[4*(at*p+et)+3]/255;if(lt===0)continue;let J=(at+H)*w+et+H;if(lt===1)tt[J]=0,Q[J]=1e20;else{let ft=.5-lt;tt[J]=ft>0?ft*ft:0,Q[J]=ft<0?ft*ft:0}}Yyt(tt,0,0,w,C,w,this.f,this.v,this.z),Yyt(Q,H,H,p,g,w,this.f,this.v,this.z);for(let at=0;at<R;at++){let et=Math.sqrt(tt[at])-Math.sqrt(Q[at]);z[at]=Math.round(255-255*(et/this.radius+this.cutoff))}return W}};function Yyt(e,t,r,i,n,o,s,a,h){for(let p=t;p<t+i;p++)Xyt(e,r*o+p,o,n,s,a,h);for(let p=r;p<r+n;p++)Xyt(e,p*o+t,1,i,s,a,h)}function Xyt(e,t,r,i,n,o,s){o[0]=0,s[0]=-1e20,s[1]=1e20,n[0]=e[t];for(let a=1,h=0,p=0;a<i;a++){n[a]=e[t+a*r];let g=a*a;do{let w=o[h];p=(n[a]-n[w]+g-w*w)/(a-w)/2}while(p<=s[h]&&--h>-1);h++,o[h]=a,s[h]=p,s[h+1]=1e20}for(let a=0,h=0;a<i;a++){for(;s[h+1]<a;)h++;let p=o[h],g=a-p;e[t+a*r]=n[p]+g*g}}var $Wt=32,GWt=[];function WWt(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function Zyt({characterSet:e,getFontWidth:t,fontHeight:r,buffer:i,maxCanvasWidth:n,mapping:o={},xOffset:s=0,yOffset:a=0}){let h=0,p=s,g=r+i*2;for(let w of e)if(!o[w]){let C=t(w);p+C+i*2>n&&(p=0,h++),o[w]={x:p+i,y:a+h*g+i,width:C,height:g,layoutWidth:C,layoutHeight:r},p+=C+i*2}return{mapping:o,xOffset:p,yOffset:a+h*g,canvasHeight:WWt(a+(h+1)*g)}}function Kyt(e,t,r,i){let n=0;for(let o=t;o<r;o++){let s=e[o];n+=i[s]?.layoutWidth||0}return n}function Qyt(e,t,r,i,n,o){let s=t,a=0;for(let h=t;h<r;h++){let p=Kyt(e,h,h+1,n);a+p>i&&(s<h&&o.push(h),s=h,a=0),a+=p}return a}function qWt(e,t,r,i,n,o){let s=t,a=t,h=t,p=0;for(let g=t;g<r;g++)if((e[g]===\" \"||e[g+1]===\" \"||g+1===r)&&(h=g+1),h>a){let w=Kyt(e,a,h,n);p+w>i&&(s<a&&(o.push(a),s=a,p=0),w>i&&(w=Qyt(e,a,h,i,n,o),s=o[o.length-1])),a=h,p+=w}return p}function HWt(e,t,r,i,n=0,o){o===void 0&&(o=e.length);let s=[];return t===\"break-all\"?Qyt(e,n,o,r,i,s):qWt(e,n,o,r,i,s),s}function YWt(e,t,r,i,n,o){let s=0,a=0;for(let h=t;h<r;h++){let p=e[h],g=i[p];g?(a||(a=g.layoutHeight),n[h]=s+g.layoutWidth/2,s+=g.layoutWidth):(hr.warn(`Missing character: ${p} (${p.codePointAt(0)})`)(),n[h]=s,s+=$Wt)}o[0]=s,o[1]=a}function Jyt(e,t,r,i,n){let o=Array.from(e),s=o.length,a=new Array(s),h=new Array(s),p=new Array(s),g=(r===\"break-word\"||r===\"break-all\")&&isFinite(i)&&i>0,w=[0,0],C=[0,0],R=0,z=0,W=0;for(let Y=0;Y<=s;Y++){let H=o[Y];if((H===`\n`||Y===s)&&(W=Y),W>z){let Q=g?HWt(o,r,i,n,z,W):GWt;for(let tt=0;tt<=Q.length;tt++){let rt=tt===0?z:Q[tt-1],at=tt<Q.length?Q[tt]:W;YWt(o,rt,at,n,a,C);for(let et=rt;et<at;et++){let lt=o[et],J=n[lt]?.layoutOffsetY||0;h[et]=R+C[1]/2+J,p[et]=C[0]}R=R+C[1]*t,w[0]=Math.max(w[0],C[0])}z=W}H===`\n`&&(a[z]=0,h[z]=0,p[z]=0,z++)}return w[1]=R,{x:a,y:h,rowWidth:p,size:w}}function t1t({value:e,length:t,stride:r,offset:i,startIndices:n,characterSet:o}){let s=e.BYTES_PER_ELEMENT,a=r?r/s:1,h=i?i/s:0,p=n[t]||Math.ceil((e.length-h)/a),g=o&&new Set,w=new Array(t),C=e;if(a>1||h>0){let R=e.constructor;C=new R(p);for(let z=0;z<p;z++)C[z]=e[z*a+h]}for(let R=0;R<t;R++){let z=n[R],W=n[R+1]||p,Y=C.subarray(z,W);w[R]=String.fromCodePoint.apply(null,Y),g&&Y.forEach(g.add,g)}if(g)for(let R of g)o.add(String.fromCodePoint(R));return{texts:w,characterCount:p}}var X3=class{constructor(t=5){this._cache={},this._order=[],this.limit=t}get(t){let r=this._cache[t];return r&&(this._deleteOrder(t),this._appendOrder(t)),r}set(t,r){this._cache[t]?(this.delete(t),this._cache[t]=r,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=r,this._appendOrder(t))}delete(t){this._cache[t]&&(delete this._cache[t],this._deleteOrder(t))}_deleteOrder(t){let r=this._order.indexOf(t);r>=0&&this._order.splice(r,1)}_appendOrder(t){this._order.push(t)}};function XWt(){let e=[];for(let t=32;t<128;t++)e.push(String.fromCharCode(t));return e}var Pb={fontFamily:\"Monaco, monospace\",fontWeight:\"normal\",characterSet:XWt(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1},e1t=1024,r1t=.9,i1t=1.2,o1t=3,E9=new X3(o1t);function ZWt(e,t){let r;typeof t==\"string\"?r=new Set(Array.from(t)):r=new Set(t);let i=E9.get(e);if(!i)return r;for(let n in i.mapping)r.has(n)&&r.delete(n);return r}function KWt(e,t){for(let r=0;r<e.length;r++)t.data[4*r+3]=e[r]}function n1t(e,t,r,i){e.font=`${i} ${r}px ${t}`,e.fillStyle=\"#000\",e.textBaseline=\"alphabetic\",e.textAlign=\"left\"}function s1t(e){hr.assert(Number.isFinite(e)&&e>=o1t,\"Invalid cache limit\"),E9=new X3(e)}var vC=class{constructor(){this.props={...Pb}}get atlas(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){let{fontSize:t,buffer:r}=this.props;return(t*i1t+r*2)/t}setProps(t={}){Object.assign(this.props,t),this._key=this._getKey();let r=ZWt(this._key,this.props.characterSet),i=E9.get(this._key);if(i&&r.size===0){this._atlas!==i&&(this._atlas=i);return}let n=this._generateFontAtlas(r,i);this._atlas=n,E9.set(this._key,n)}_generateFontAtlas(t,r){let{fontFamily:i,fontWeight:n,fontSize:o,buffer:s,sdf:a,radius:h,cutoff:p}=this.props,g=r&&r.data;g||(g=document.createElement(\"canvas\"),g.width=e1t);let w=g.getContext(\"2d\",{willReadFrequently:!0});n1t(w,i,o,n);let{mapping:C,canvasHeight:R,xOffset:z,yOffset:W}=Zyt({getFontWidth:Y=>w.measureText(Y).width,fontHeight:o*i1t,buffer:s,characterSet:t,maxCanvasWidth:e1t,...r&&{mapping:r.mapping,xOffset:r.xOffset,yOffset:r.yOffset}});if(g.height!==R){let Y=w.getImageData(0,0,g.width,g.height);g.height=R,w.putImageData(Y,0,0)}if(n1t(w,i,o,n),a){let Y=new _C({fontSize:o,buffer:s,radius:h,cutoff:p,fontFamily:i,fontWeight:`${n}`});for(let H of t){let{data:Q,width:tt,height:rt,glyphTop:at}=Y.draw(H);C[H].width=tt,C[H].layoutOffsetY=o*r1t-at;let et=w.createImageData(tt,rt);KWt(Q,et),w.putImageData(et,C[H].x,C[H].y)}}else for(let Y of t)w.fillText(Y,C[Y].x,C[Y].y+s+o*r1t);return{xOffset:z,yOffset:W,mapping:C,data:g,width:g.width,height:g.height}}_getKey(){let{fontFamily:t,fontWeight:r,fontSize:i,buffer:n,sdf:o,radius:s,cutoff:a}=this.props;return o?`${t} ${r} ${i} ${n} ${s} ${a}`:`${t} ${r} ${i} ${n}`}};var a1t=`uniform textBackgroundUniforms {\n  bool billboard;\n  float sizeScale;\n  float sizeMinPixels;\n  float sizeMaxPixels;\n  vec4 borderRadius;\n  vec4 padding;\n  highp int sizeUnits;\n  bool stroked;\n} textBackground;\n`,l1t={name:\"textBackground\",vs:a1t,fs:a1t,uniformTypes:{billboard:\"f32\",sizeScale:\"f32\",sizeMinPixels:\"f32\",sizeMaxPixels:\"f32\",borderRadius:\"vec4<f32>\",padding:\"vec4<f32>\",sizeUnits:\"i32\",stroked:\"f32\"}};var c1t=`#version 300 es\n#define SHADER_NAME text-background-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceRects;\nin float instanceSizes;\nin float instanceAngles;\nin vec2 instancePixelOffsets;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout float vLineWidth;\nout vec2 uv;\nout vec2 dimensions;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = radians(angle);\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvLineWidth = instanceLineWidths;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * textBackground.sizeScale, textBackground.sizeUnits),\ntextBackground.sizeMinPixels, textBackground.sizeMaxPixels\n);\ndimensions = instanceRects.zw * sizePixels + textBackground.padding.xy + textBackground.padding.zw;\nvec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-textBackground.padding.xy, textBackground.padding.zw, positions);\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\npixelOffset += instancePixelOffsets;\npixelOffset.y *= -1.0;\nif (textBackground.billboard)  {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n`;var u1t=`#version 300 es\n#define SHADER_NAME text-background-layer-fragment-shader\nprecision highp float;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin float vLineWidth;\nin vec2 uv;\nin vec2 dimensions;\nout vec4 fragColor;\nfloat round_rect(vec2 p, vec2 size, vec4 radii) {\nvec2 pixelPositionCB = (p - 0.5) * size;\nvec2 sizeCB = size * 0.5;\nfloat maxBorderRadius = min(size.x, size.y) * 0.5;\nvec4 borderRadius = vec4(min(radii, maxBorderRadius));\nborderRadius.xy =\n(pixelPositionCB.x > 0.0) ? borderRadius.xy : borderRadius.zw;\nborderRadius.x = (pixelPositionCB.y > 0.0) ? borderRadius.x : borderRadius.y;\nvec2 q = abs(pixelPositionCB) - sizeCB + borderRadius.x;\nreturn -(min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - borderRadius.x);\n}\nfloat rect(vec2 p, vec2 size) {\nvec2 pixelPosition = p * size;\nreturn min(min(pixelPosition.x, size.x - pixelPosition.x),\nmin(pixelPosition.y, size.y - pixelPosition.y));\n}\nvec4 get_stroked_fragColor(float dist) {\nfloat isBorder = smoothedge(dist, vLineWidth);\nreturn mix(vFillColor, vLineColor, isBorder);\n}\nvoid main(void) {\ngeometry.uv = uv;\nif (textBackground.borderRadius != vec4(0.0)) {\nfloat distToEdge = round_rect(uv, dimensions, textBackground.borderRadius);\nif (textBackground.stroked) {\nfragColor = get_stroked_fragColor(distToEdge);\n} else {\nfragColor = vFillColor;\n}\nfloat shapeAlpha = smoothedge(-distToEdge, 0.0);\nfragColor.a *= shapeAlpha;\n} else {\nif (textBackground.stroked) {\nfloat distToEdge = rect(uv, dimensions);\nfragColor = get_stroked_fragColor(distToEdge);\n} else {\nfragColor = vFillColor;\n}\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var QWt={billboard:!0,sizeScale:1,sizeUnits:\"pixels\",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,borderRadius:{type:\"object\",value:0},padding:{type:\"array\",value:[0,0,0,0]},getPosition:{type:\"accessor\",value:e=>e.position},getSize:{type:\"accessor\",value:1},getAngle:{type:\"accessor\",value:0},getPixelOffset:{type:\"accessor\",value:[0,0]},getBoundingRect:{type:\"accessor\",value:[0,0,0,0]},getFillColor:{type:\"accessor\",value:[0,0,0,255]},getLineColor:{type:\"accessor\",value:[0,0,0,255]},getLineWidth:{type:\"accessor\",value:1}},bC=class extends ho{getShaders(){return super.getShaders({vs:c1t,fs:u1t,modules:[Mo,bs,l1t]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:\"float64\",fp64:this.use64bitPositions(),transition:!0,accessor:\"getPosition\"},instanceSizes:{size:1,transition:!0,accessor:\"getSize\",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:\"getAngle\"},instanceRects:{size:4,accessor:\"getBoundingRect\"},instancePixelOffsets:{size:2,transition:!0,accessor:\"getPixelOffset\"},instanceFillColors:{size:4,transition:!0,type:\"unorm8\",accessor:\"getFillColor\",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:\"unorm8\",accessor:\"getLineColor\",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:\"getLineWidth\",defaultValue:1}})}updateState(t){super.updateState(t);let{changeFlags:r}=t;r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{billboard:r,sizeScale:i,sizeUnits:n,sizeMinPixels:o,sizeMaxPixels:s,getLineWidth:a}=this.props,{padding:h,borderRadius:p}=this.props;h.length<4&&(h=[h[0],h[1],h[0],h[1]]),Array.isArray(p)||(p=[p,p,p,p]);let g=this.state.model,w={billboard:r,stroked:!!a,borderRadius:p,padding:h,sizeUnits:rs[n],sizeScale:i,sizeMinPixels:o,sizeMaxPixels:s};g.shaderInputs.setProps({textBackground:w}),g.draw(this.context.renderPass)}_getModel(){let t=[0,0,1,0,0,1,1,1];return new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new xs({topology:\"triangle-strip\",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}};bC.defaultProps=QWt;bC.layerName=\"TextBackgroundLayer\";var h1t=bC;var d1t={start:1,middle:0,end:-1},f1t={top:1,center:0,bottom:-1},XX=[0,0,0,255],JWt=1,tqt={billboard:!0,sizeScale:1,sizeUnits:\"pixels\",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:\"accessor\",value:[255,255,255,255]},getBorderColor:{type:\"accessor\",value:XX},getBorderWidth:{type:\"accessor\",value:0},backgroundBorderRadius:{type:\"object\",value:0},backgroundPadding:{type:\"array\",value:[0,0,0,0]},characterSet:{type:\"object\",value:Pb.characterSet},fontFamily:Pb.fontFamily,fontWeight:Pb.fontWeight,lineHeight:JWt,outlineWidth:{type:\"number\",value:0,min:0},outlineColor:{type:\"color\",value:XX},fontSettings:{type:\"object\",value:{},compare:1},wordBreak:\"break-word\",maxWidth:{type:\"number\",value:-1},getText:{type:\"accessor\",value:e=>e.text},getPosition:{type:\"accessor\",value:e=>e.position},getColor:{type:\"accessor\",value:XX},getSize:{type:\"accessor\",value:32},getAngle:{type:\"accessor\",value:0},getTextAnchor:{type:\"accessor\",value:\"middle\"},getAlignmentBaseline:{type:\"accessor\",value:\"center\"},getPixelOffset:{type:\"accessor\",value:[0,0]},backgroundColor:{deprecatedFor:[\"background\",\"getBackgroundColor\"]}},xC=class extends bi{constructor(){super(...arguments),this.getBoundingRect=(t,r)=>{let{size:[i,n]}=this.transformParagraph(t,r),{fontSize:o}=this.state.fontAtlasManager.props;i/=o,n/=o;let{getTextAnchor:s,getAlignmentBaseline:a}=this.props,h=d1t[typeof s==\"function\"?s(t,r):s],p=f1t[typeof a==\"function\"?a(t,r):a];return[(h-1)*i/2,(p-1)*n/2,i,n]},this.getIconOffsets=(t,r)=>{let{getTextAnchor:i,getAlignmentBaseline:n}=this.props,{x:o,y:s,rowWidth:a,size:[h,p]}=this.transformParagraph(t,r),g=d1t[typeof i==\"function\"?i(t,r):i],w=f1t[typeof n==\"function\"?n(t,r):n],C=o.length,R=new Array(C*2),z=0;for(let W=0;W<C;W++){let Y=(1-g)*(h-a[W])/2;R[z++]=(g-1)*h/2+Y+o[W],R[z++]=(w-1)*p/2+s[W]}return R}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new vC},this.props.maxWidth>0&&hr.once(1,\"v8.9 breaking change: TextLayer maxWidth is now relative to text size\")()}updateState(t){let{props:r,oldProps:i,changeFlags:n}=t;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||r.lineHeight!==i.lineHeight||r.wordBreak!==i.wordBreak||r.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(){let{fontSettings:t,fontFamily:r,fontWeight:i}=this.props,{fontAtlasManager:n,characterSet:o}=this.state,s={...t,characterSet:o,fontFamily:r,fontWeight:i};if(!n.mapping)return n.setProps(s),!0;for(let a in s)if(s[a]!==n.props[a])return n.setProps(s),!0;return!1}_updateText(){let{data:t,characterSet:r}=this.props,i=t.attributes?.getText,{getText:n}=this.props,o=t.startIndices,s,a=r===\"auto\"&&new Set;if(i&&o){let{texts:h,characterCount:p}=t1t({...ArrayBuffer.isView(i)?{value:i}:i,length:t.length,startIndices:o,characterSet:a});s=p,n=(g,{index:w})=>h[w]}else{let{iterable:h,objectInfo:p}=Lc(t);o=[0],s=0;for(let g of h){p.index++;let w=Array.from(n(g,p)||\"\");a&&w.forEach(a.add,a),s+=w.length,o.push(s)}}this.setState({getText:n,startIndices:o,numInstances:s,characterSet:a||r})}transformParagraph(t,r){let{fontAtlasManager:i}=this.state,n=i.mapping,o=this.state.getText,{wordBreak:s,lineHeight:a,maxWidth:h}=this.props,p=o(t,r)||\"\";return Jyt(p,a,s,h*i.props.fontSize,n)}renderLayers(){let{startIndices:t,numInstances:r,getText:i,fontAtlasManager:{scale:n,atlas:o,mapping:s},styleVersion:a}=this.state,{data:h,_dataDiff:p,getPosition:g,getColor:w,getSize:C,getAngle:R,getPixelOffset:z,getBackgroundColor:W,getBorderColor:Y,getBorderWidth:H,backgroundBorderRadius:Q,backgroundPadding:tt,background:rt,billboard:at,fontSettings:et,outlineWidth:lt,outlineColor:J,sizeScale:ft,sizeUnits:dt,sizeMinPixels:Mt,sizeMaxPixels:Ft,transitions:Nt,updateTriggers:$t}=this.props,Yt=this.getSubLayerClass(\"characters\",Hyt),_e=this.getSubLayerClass(\"background\",h1t);return[rt&&new _e({getFillColor:W,getLineColor:Y,getLineWidth:H,borderRadius:Q,padding:tt,getPosition:g,getSize:C,getAngle:R,getPixelOffset:z,billboard:at,sizeScale:ft,sizeUnits:dt,sizeMinPixels:Mt,sizeMaxPixels:Ft,transitions:Nt&&{getPosition:Nt.getPosition,getAngle:Nt.getAngle,getSize:Nt.getSize,getFillColor:Nt.getBackgroundColor,getLineColor:Nt.getBorderColor,getLineWidth:Nt.getBorderWidth,getPixelOffset:Nt.getPixelOffset}},this.getSubLayerProps({id:\"background\",updateTriggers:{getPosition:$t.getPosition,getAngle:$t.getAngle,getSize:$t.getSize,getFillColor:$t.getBackgroundColor,getLineColor:$t.getBorderColor,getLineWidth:$t.getBorderWidth,getPixelOffset:$t.getPixelOffset,getBoundingRect:{getText:$t.getText,getTextAnchor:$t.getTextAnchor,getAlignmentBaseline:$t.getAlignmentBaseline,styleVersion:a}}}),{data:h.attributes&&h.attributes.background?{length:h.length,attributes:h.attributes.background}:h,_dataDiff:p,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new Yt({sdf:et.sdf,smoothing:Number.isFinite(et.smoothing)?et.smoothing:Pb.smoothing,outlineWidth:lt/(et.radius||Pb.radius),outlineColor:J,iconAtlas:o,iconMapping:s,getPosition:g,getColor:w,getSize:C,getAngle:R,getPixelOffset:z,billboard:at,sizeScale:ft*n,sizeUnits:dt,sizeMinPixels:Mt*n,sizeMaxPixels:Ft*n,transitions:Nt&&{getPosition:Nt.getPosition,getAngle:Nt.getAngle,getColor:Nt.getColor,getSize:Nt.getSize,getPixelOffset:Nt.getPixelOffset}},this.getSubLayerProps({id:\"characters\",updateTriggers:{all:$t.getText,getPosition:$t.getPosition,getAngle:$t.getAngle,getColor:$t.getColor,getSize:$t.getSize,getPixelOffset:$t.getPixelOffset,getIconOffsets:{getTextAnchor:$t.getTextAnchor,getAlignmentBaseline:$t.getAlignmentBaseline,styleVersion:a}}}),{data:h,_dataDiff:p,startIndices:t,numInstances:r,getIconOffsets:this.getIconOffsets,getIcon:i})]}static set fontAtlasCacheLimit(t){s1t(t)}};xC.defaultProps=tqt;xC.layerName=\"TextLayer\";var Z3=xC;var wC={circle:{type:Sb,props:{filled:\"filled\",stroked:\"stroked\",lineWidthMaxPixels:\"lineWidthMaxPixels\",lineWidthMinPixels:\"lineWidthMinPixels\",lineWidthScale:\"lineWidthScale\",lineWidthUnits:\"lineWidthUnits\",pointRadiusMaxPixels:\"radiusMaxPixels\",pointRadiusMinPixels:\"radiusMinPixels\",pointRadiusScale:\"radiusScale\",pointRadiusUnits:\"radiusUnits\",pointAntialiasing:\"antialiasing\",pointBillboard:\"billboard\",getFillColor:\"getFillColor\",getLineColor:\"getLineColor\",getLineWidth:\"getLineWidth\",getPointRadius:\"getRadius\"}},icon:{type:h9,props:{iconAtlas:\"iconAtlas\",iconMapping:\"iconMapping\",iconSizeMaxPixels:\"sizeMaxPixels\",iconSizeMinPixels:\"sizeMinPixels\",iconSizeScale:\"sizeScale\",iconSizeUnits:\"sizeUnits\",iconAlphaCutoff:\"alphaCutoff\",iconBillboard:\"billboard\",getIcon:\"getIcon\",getIconAngle:\"getAngle\",getIconColor:\"getColor\",getIconPixelOffset:\"getPixelOffset\",getIconSize:\"getSize\"}},text:{type:Z3,props:{textSizeMaxPixels:\"sizeMaxPixels\",textSizeMinPixels:\"sizeMinPixels\",textSizeScale:\"sizeScale\",textSizeUnits:\"sizeUnits\",textBackground:\"background\",textBackgroundPadding:\"backgroundPadding\",textFontFamily:\"fontFamily\",textFontWeight:\"fontWeight\",textLineHeight:\"lineHeight\",textMaxWidth:\"maxWidth\",textOutlineColor:\"outlineColor\",textOutlineWidth:\"outlineWidth\",textWordBreak:\"wordBreak\",textCharacterSet:\"characterSet\",textBillboard:\"billboard\",textFontSettings:\"fontSettings\",getText:\"getText\",getTextAngle:\"getAngle\",getTextColor:\"getColor\",getTextPixelOffset:\"getPixelOffset\",getTextSize:\"getSize\",getTextAnchor:\"getTextAnchor\",getTextAlignmentBaseline:\"getAlignmentBaseline\",getTextBackgroundColor:\"getBackgroundColor\",getTextBorderColor:\"getBorderColor\",getTextBorderWidth:\"getBorderWidth\"}}},TC={type:Kf,props:{lineWidthUnits:\"widthUnits\",lineWidthScale:\"widthScale\",lineWidthMinPixels:\"widthMinPixels\",lineWidthMaxPixels:\"widthMaxPixels\",lineJointRounded:\"jointRounded\",lineCapRounded:\"capRounded\",lineMiterLimit:\"miterLimit\",lineBillboard:\"billboard\",getLineColor:\"getColor\",getLineWidth:\"getWidth\"}},P9={type:jg,props:{extruded:\"extruded\",filled:\"filled\",wireframe:\"wireframe\",elevationScale:\"elevationScale\",material:\"material\",_full3d:\"_full3d\",getElevation:\"getElevation\",getFillColor:\"getFillColor\",getLineColor:\"getLineColor\"}};function K3({type:e,props:t}){let r={};for(let i in t)r[i]=e.defaultProps[t[i]];return r}function C9(e,t){let{transitions:r,updateTriggers:i}=e.props,n={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(let o in t){let s=t[o],a=e.props[o];o.startsWith(\"get\")&&(a=e.getSubLayerAccessor(a),n.updateTriggers[s]=i[o],r&&(n.transitions[s]=r[o])),n[s]=a}return n}function m1t(e){if(Array.isArray(e))return e;switch(hr.assert(e.type,\"GeoJSON does not have type\"),e.type){case\"Feature\":return[e];case\"FeatureCollection\":return hr.assert(Array.isArray(e.features),\"GeoJSON does not have features array\"),e.features;default:return[{geometry:e}]}}function ZX(e,t,r={}){let i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:n=0,endRow:o=e.length}=r;for(let s=n;s<o;s++){let a=e[s],{geometry:h}=a;if(h)if(h.type===\"GeometryCollection\"){hr.assert(Array.isArray(h.geometries),\"GeoJSON does not have geometries array\");let{geometries:p}=h;for(let g=0;g<p.length;g++){let w=p[g];p1t(w,i,t,a,s)}}else p1t(h,i,t,a,s)}return i}function p1t(e,t,r,i,n){let{type:o,coordinates:s}=e,{pointFeatures:a,lineFeatures:h,polygonFeatures:p,polygonOutlineFeatures:g}=t;if(!rqt(o,s)){hr.warn(`${o} coordinates are malformed`)();return}switch(o){case\"Point\":a.push(r({geometry:e},i,n));break;case\"MultiPoint\":s.forEach(w=>{a.push(r({geometry:{type:\"Point\",coordinates:w}},i,n))});break;case\"LineString\":h.push(r({geometry:e},i,n));break;case\"MultiLineString\":s.forEach(w=>{h.push(r({geometry:{type:\"LineString\",coordinates:w}},i,n))});break;case\"Polygon\":p.push(r({geometry:e},i,n)),s.forEach(w=>{g.push(r({geometry:{type:\"LineString\",coordinates:w}},i,n))});break;case\"MultiPolygon\":s.forEach(w=>{p.push(r({geometry:{type:\"Polygon\",coordinates:w}},i,n)),w.forEach(C=>{g.push(r({geometry:{type:\"LineString\",coordinates:C}},i,n))})});break;default:}}var eqt={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function rqt(e,t){let r=eqt[e];for(hr.assert(r,`Unknown GeoJSON type ${e}`);t&&--r>0;)t=t[0];return t&&Number.isFinite(t[0])}function g1t(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function I9(e){return e.geometry.coordinates}function A1t(e,t){let r=g1t(),{pointFeatures:i,lineFeatures:n,polygonFeatures:o,polygonOutlineFeatures:s}=e;return r.points.data=i,r.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),r.points.getPosition=I9,r.lines.data=n,r.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),r.lines.getPath=I9,r.polygons.data=o,r.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),r.polygons.getPolygon=I9,r.polygonsOutline.data=s,r.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),r.polygonsOutline.getPath=I9,r}function y1t(e,t){let r=g1t(),{points:i,lines:n,polygons:o}=e,s=jyt(e,t);r.points.data={length:i.positions.value.length/i.positions.size,attributes:{...i.attributes,getPosition:i.positions,instancePickingColors:{size:4,value:s.points}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.lines.data={length:n.pathIndices.value.length-1,startIndices:n.pathIndices.value,attributes:{...n.attributes,getPath:n.positions,instancePickingColors:{size:4,value:s.lines}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines._pathType=\"open\";let a=o.positions.value.length/o.positions.size,h=Array(a).fill(1);for(let p of o.primitivePolygonIndices.value)h[p-1]=0;return r.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:{...o.attributes,getPolygon:o.positions,instanceVertexValid:{size:1,value:new Uint16Array(h)},pickingColors:{size:4,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},r.polygons._normalize=!1,o.triangles&&(r.polygons.data.attributes.indices=o.triangles.value),r.polygonsOutline.data={length:o.primitivePolygonIndices.value.length-1,startIndices:o.primitivePolygonIndices.value,attributes:{...o.attributes,getPath:o.positions,instancePickingColors:{size:4,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},r.polygonsOutline._pathType=\"open\",r}var iqt=[\"points\",\"linestrings\",\"polygons\"],nqt={...K3(wC.circle),...K3(wC.icon),...K3(wC.text),...K3(TC),...K3(P9),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:\"object\",value:null},iconMapping:{type:\"object\",value:{}},getIcon:{type:\"accessor\",value:e=>e.properties.icon},getText:{type:\"accessor\",value:e=>e.properties.text},pointType:\"circle\",getRadius:{deprecatedFor:\"getPointRadius\"}},SC=class extends bi{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:t,changeFlags:r}){if(!r.dataChanged)return;let{data:i}=this.props,n=i&&\"points\"in i&&\"polygons\"in i&&\"lines\"in i;this.setState({binary:n}),n?this._updateStateBinary({props:t,changeFlags:r}):this._updateStateJSON({props:t,changeFlags:r})}_updateStateBinary({props:t,changeFlags:r}){let i=y1t(t.data,this.encodePickingColor);this.setState({layerProps:i})}_updateStateJSON({props:t,changeFlags:r}){let i=m1t(t.data),n=this.getSubLayerRow.bind(this),o={},s={};if(Array.isArray(r.dataChanged)){let h=this.state.features;for(let p in h)o[p]=h[p].slice(),s[p]=[];for(let p of r.dataChanged){let g=ZX(i,n,p);for(let w in h)s[w].push(M9({data:o[w],getIndex:C=>C.__source.index,dataRange:p,replace:g[w]}))}}else o=ZX(i,n);let a=A1t(o,s);this.setState({features:o,featuresDiff:s,layerProps:a})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:i,sourceLayer:n}=r;return r.featureType=iqt.find(o=>n.id.startsWith(`${this.id}-${o}-`)),i>=0&&n.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[i]),r}_updateAutoHighlight(t){let r=`${this.id}-points-`,i=t.featureType===\"points\";for(let n of this.getSubLayers())n.id.startsWith(r)===i&&n.updateAutoHighlight(t)}_renderPolygonLayer(){let{extruded:t,wireframe:r}=this.props,{layerProps:i}=this.state,n=\"polygons-fill\",o=this.shouldRenderSubLayer(n,i.polygons?.data)&&this.getSubLayerClass(n,P9.type);if(o){let s=C9(this,P9.props),a=t&&r;return a||delete s.getLineColor,s.updateTriggers.lineColors=a,new o(s,this.getSubLayerProps({id:n,updateTriggers:s.updateTriggers}),i.polygons)}return null}_renderLineLayers(){let{extruded:t,stroked:r}=this.props,{layerProps:i}=this.state,n=\"polygons-stroke\",o=\"linestrings\",s=!t&&r&&this.shouldRenderSubLayer(n,i.polygonsOutline?.data)&&this.getSubLayerClass(n,TC.type),a=this.shouldRenderSubLayer(o,i.lines?.data)&&this.getSubLayerClass(o,TC.type);if(s||a){let h=C9(this,TC.props);return[s&&new s(h,this.getSubLayerProps({id:n,updateTriggers:h.updateTriggers}),i.polygonsOutline),a&&new a(h,this.getSubLayerProps({id:o,updateTriggers:h.updateTriggers}),i.lines)]}return null}_renderPointLayers(){let{pointType:t}=this.props,{layerProps:r,binary:i}=this.state,{highlightedObjectIndex:n}=this.props;!i&&Number.isFinite(n)&&(n=r.points.data.findIndex(a=>a.__source.index===n));let o=new Set(t.split(\"+\")),s=[];for(let a of o){let h=`points-${a}`,p=wC[a],g=p&&this.shouldRenderSubLayer(h,r.points?.data)&&this.getSubLayerClass(h,p.type);if(g){let w=C9(this,p.props),C=r.points;if(a===\"text\"&&i){let{instancePickingColors:R,...z}=C.data.attributes;C={...C,data:{...C.data,attributes:z}}}s.push(new g(w,this.getSubLayerProps({id:h,updateTriggers:w.updateTriggers,highlightedObjectIndex:n}),C))}}return s}renderLayers(){let{extruded:t}=this.props,r=this._renderPolygonLayer(),i=this._renderLineLayers(),n=this._renderPointLayers();return[!t&&r,i,n,t&&r]}getSubLayerAccessor(t){let{binary:r}=this.state;return!r||typeof t!=\"function\"?super.getSubLayerAccessor(t):(i,n)=>{let{data:o,index:s}=n,a=Vyt(o,s);return t(a,n)}}};SC.layerName=\"GeoJsonLayer\";SC.defaultProps=nqt;var KX=SC;var k9=xe(ze(),1);function MC(e={}){let{strict:t=!0,errorMessage:r=\"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider\",name:i}=e,n=k9.createContext(void 0);n.displayName=i;function o(){var s;let a=k9.useContext(n);if(!a&&t){let h=new Error(r);throw h.name=\"ContextError\",(s=Error.captureStackTrace)==null||s.call(Error,h,o),h}return a}return[n.Provider,o,n]}var EC=xe(ze(),1);function _1t(){return!!(typeof window<\"u\"&&window.document&&window.document.createElement)}var oqt=_1t();function QX(e){return{UNSAFE_getDOMNode(){return e.current}}}function PC(e){let t=(0,EC.useRef)(null);return(0,EC.useImperativeHandle)(e,()=>t.current),t}function JX(e){return typeof e==\"function\"}var Bc=e=>e?\"true\":void 0;function v1t(e){var t,r,i=\"\";if(typeof e==\"string\"||typeof e==\"number\")i+=e;else if(typeof e==\"object\")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=v1t(e[t]))&&(i&&(i+=\" \"),i+=r);else for(t in e)e[t]&&(i&&(i+=\" \"),i+=t);return i}function CC(...e){for(var t=0,r,i,n=\"\";t<e.length;)(r=e[t++])&&(i=v1t(r))&&(n&&(n+=\" \"),n+=i);return n}var b1t={};function IC(e,t,...r){let n=`[Next UI]${t?` [${t}]`:\" \"}: ${e}`;typeof console>\"u\"||b1t[n]||(b1t[n]=!0)}var sqt=Object.create,x1t=Object.defineProperty,aqt=Object.getOwnPropertyDescriptor,w1t=Object.getOwnPropertyNames,lqt=Object.getPrototypeOf,cqt=Object.prototype.hasOwnProperty,R9=(e,t)=>function(){return t||(0,e[w1t(e)[0]])((t={exports:{}}).exports,t),t.exports},uqt=(e,t,r,i)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of w1t(t))!cqt.call(e,n)&&n!==r&&x1t(e,n,{get:()=>t[n],enumerable:!(i=aqt(t,n))||i.enumerable});return e},T1t=(e,t,r)=>(r=e!=null?sqt(lqt(e)):{},uqt(t||!e||!e.__esModule?x1t(r,\"default\",{value:e,enumerable:!0}):r,e));var hqt=R9({\"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js\"(e){\"use strict\";var t=Symbol.for(\"react.element\"),r=Symbol.for(\"react.portal\"),i=Symbol.for(\"react.fragment\"),n=Symbol.for(\"react.strict_mode\"),o=Symbol.for(\"react.profiler\"),s=Symbol.for(\"react.provider\"),a=Symbol.for(\"react.context\"),h=Symbol.for(\"react.forward_ref\"),p=Symbol.for(\"react.suspense\"),g=Symbol.for(\"react.memo\"),w=Symbol.for(\"react.lazy\"),C=Symbol.iterator;function R(ee){return ee===null||typeof ee!=\"object\"?null:(ee=C&&ee[C]||ee[\"@@iterator\"],typeof ee==\"function\"?ee:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,Y={};function H(ee,Ce,mr){this.props=ee,this.context=Ce,this.refs=Y,this.updater=mr||z}H.prototype.isReactComponent={},H.prototype.setState=function(ee,Ce){if(typeof ee!=\"object\"&&typeof ee!=\"function\"&&ee!=null)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,ee,Ce,\"setState\")},H.prototype.forceUpdate=function(ee){this.updater.enqueueForceUpdate(this,ee,\"forceUpdate\")};function Q(){}Q.prototype=H.prototype;function tt(ee,Ce,mr){this.props=ee,this.context=Ce,this.refs=Y,this.updater=mr||z}var rt=tt.prototype=new Q;rt.constructor=tt,W(rt,H.prototype),rt.isPureReactComponent=!0;var at=Array.isArray,et=Object.prototype.hasOwnProperty,lt={current:null},J={key:!0,ref:!0,__self:!0,__source:!0};function ft(ee,Ce,mr){var gr,Br={},Cr=null,Rr=null;if(Ce!=null)for(gr in Ce.ref!==void 0&&(Rr=Ce.ref),Ce.key!==void 0&&(Cr=\"\"+Ce.key),Ce)et.call(Ce,gr)&&!J.hasOwnProperty(gr)&&(Br[gr]=Ce[gr]);var ti=arguments.length-2;if(ti===1)Br.children=mr;else if(1<ti){for(var wr=Array(ti),He=0;He<ti;He++)wr[He]=arguments[He+2];Br.children=wr}if(ee&&ee.defaultProps)for(gr in ti=ee.defaultProps,ti)Br[gr]===void 0&&(Br[gr]=ti[gr]);return{$$typeof:t,type:ee,key:Cr,ref:Rr,props:Br,_owner:lt.current}}function dt(ee,Ce){return{$$typeof:t,type:ee.type,key:Ce,ref:ee.ref,props:ee.props,_owner:ee._owner}}function Mt(ee){return typeof ee==\"object\"&&ee!==null&&ee.$$typeof===t}function Ft(ee){var Ce={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+ee.replace(/[=:]/g,function(mr){return Ce[mr]})}var Nt=/\\/+/g;function $t(ee,Ce){return typeof ee==\"object\"&&ee!==null&&ee.key!=null?Ft(\"\"+ee.key):Ce.toString(36)}function Yt(ee,Ce,mr,gr,Br){var Cr=typeof ee;(Cr===\"undefined\"||Cr===\"boolean\")&&(ee=null);var Rr=!1;if(ee===null)Rr=!0;else switch(Cr){case\"string\":case\"number\":Rr=!0;break;case\"object\":switch(ee.$$typeof){case t:case r:Rr=!0}}if(Rr)return Rr=ee,Br=Br(Rr),ee=gr===\"\"?\".\"+$t(Rr,0):gr,at(Br)?(mr=\"\",ee!=null&&(mr=ee.replace(Nt,\"$&/\")+\"/\"),Yt(Br,Ce,mr,\"\",function(He){return He})):Br!=null&&(Mt(Br)&&(Br=dt(Br,mr+(!Br.key||Rr&&Rr.key===Br.key?\"\":(\"\"+Br.key).replace(Nt,\"$&/\")+\"/\")+ee)),Ce.push(Br)),1;if(Rr=0,gr=gr===\"\"?\".\":gr+\":\",at(ee))for(var ti=0;ti<ee.length;ti++){Cr=ee[ti];var wr=gr+$t(Cr,ti);Rr+=Yt(Cr,Ce,mr,wr,Br)}else if(wr=R(ee),typeof wr==\"function\")for(ee=wr.call(ee),ti=0;!(Cr=ee.next()).done;)Cr=Cr.value,wr=gr+$t(Cr,ti++),Rr+=Yt(Cr,Ce,mr,wr,Br);else if(Cr===\"object\")throw Ce=String(ee),Error(\"Objects are not valid as a React child (found: \"+(Ce===\"[object Object]\"?\"object with keys {\"+Object.keys(ee).join(\", \")+\"}\":Ce)+\"). If you meant to render a collection of children, use an array instead.\");return Rr}function _e(ee,Ce,mr){if(ee==null)return ee;var gr=[],Br=0;return Yt(ee,gr,\"\",\"\",function(Cr){return Ce.call(mr,Cr,Br++)}),gr}function Pe(ee){if(ee._status===-1){var Ce=ee._result;Ce=Ce(),Ce.then(function(mr){(ee._status===0||ee._status===-1)&&(ee._status=1,ee._result=mr)},function(mr){(ee._status===0||ee._status===-1)&&(ee._status=2,ee._result=mr)}),ee._status===-1&&(ee._status=0,ee._result=Ce)}if(ee._status===1)return ee._result.default;throw ee._result}var we={current:null},Ue={transition:null},lr={ReactCurrentDispatcher:we,ReactCurrentBatchConfig:Ue,ReactCurrentOwner:lt};e.Children={map:_e,forEach:function(ee,Ce,mr){_e(ee,function(){Ce.apply(this,arguments)},mr)},count:function(ee){var Ce=0;return _e(ee,function(){Ce++}),Ce},toArray:function(ee){return _e(ee,function(Ce){return Ce})||[]},only:function(ee){if(!Mt(ee))throw Error(\"React.Children.only expected to receive a single React element child.\");return ee}},e.Component=H,e.Fragment=i,e.Profiler=o,e.PureComponent=tt,e.StrictMode=n,e.Suspense=p,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lr,e.cloneElement=function(ee,Ce,mr){if(ee==null)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+ee+\".\");var gr=W({},ee.props),Br=ee.key,Cr=ee.ref,Rr=ee._owner;if(Ce!=null){if(Ce.ref!==void 0&&(Cr=Ce.ref,Rr=lt.current),Ce.key!==void 0&&(Br=\"\"+Ce.key),ee.type&&ee.type.defaultProps)var ti=ee.type.defaultProps;for(wr in Ce)et.call(Ce,wr)&&!J.hasOwnProperty(wr)&&(gr[wr]=Ce[wr]===void 0&&ti!==void 0?ti[wr]:Ce[wr])}var wr=arguments.length-2;if(wr===1)gr.children=mr;else if(1<wr){ti=Array(wr);for(var He=0;He<wr;He++)ti[He]=arguments[He+2];gr.children=ti}return{$$typeof:t,type:ee.type,key:Br,ref:Cr,props:gr,_owner:Rr}},e.createContext=function(ee){return ee={$$typeof:a,_currentValue:ee,_currentValue2:ee,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ee.Provider={$$typeof:s,_context:ee},ee.Consumer=ee},e.createElement=ft,e.createFactory=function(ee){var Ce=ft.bind(null,ee);return Ce.type=ee,Ce},e.createRef=function(){return{current:null}},e.forwardRef=function(ee){return{$$typeof:h,render:ee}},e.isValidElement=Mt,e.lazy=function(ee){return{$$typeof:w,_payload:{_status:-1,_result:ee},_init:Pe}},e.memo=function(ee,Ce){return{$$typeof:g,type:ee,compare:Ce===void 0?null:Ce}},e.startTransition=function(ee){var Ce=Ue.transition;Ue.transition={};try{ee()}finally{Ue.transition=Ce}},e.unstable_act=function(){throw Error(\"act(...) is not supported in production builds of React.\")},e.useCallback=function(ee,Ce){return we.current.useCallback(ee,Ce)},e.useContext=function(ee){return we.current.useContext(ee)},e.useDebugValue=function(){},e.useDeferredValue=function(ee){return we.current.useDeferredValue(ee)},e.useEffect=function(ee,Ce){return we.current.useEffect(ee,Ce)},e.useId=function(){return we.current.useId()},e.useImperativeHandle=function(ee,Ce,mr){return we.current.useImperativeHandle(ee,Ce,mr)},e.useInsertionEffect=function(ee,Ce){return we.current.useInsertionEffect(ee,Ce)},e.useLayoutEffect=function(ee,Ce){return we.current.useLayoutEffect(ee,Ce)},e.useMemo=function(ee,Ce){return we.current.useMemo(ee,Ce)},e.useReducer=function(ee,Ce,mr){return we.current.useReducer(ee,Ce,mr)},e.useRef=function(ee){return we.current.useRef(ee)},e.useState=function(ee){return we.current.useState(ee)},e.useSyncExternalStore=function(ee,Ce,mr){return we.current.useSyncExternalStore(ee,Ce,mr)},e.useTransition=function(){return we.current.useTransition()},e.version=\"18.2.0\"}}),jFe=R9({\"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js\"(e,t){\"use strict\"}}),dqt=R9({\"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js\"(e,t){\"use strict\";t.exports=hqt()}}),$Fe=T1t(dqt());function tZ(e){return`${e}-${Math.floor(Math.random()*1e6)}`}function Cb(e){if(!e||typeof e!=\"object\")return\"\";try{return JSON.stringify(e)}catch{return\"\"}}function eZ(e,t,r){return Math.min(Math.max(e,t),r)}function S1t(e,t){if(e!=null){if(JX(e)){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function rZ(...e){return t=>{e.forEach(r=>S1t(r,t))}}var iZ=new Set([\"id\",\"type\",\"style\",\"title\",\"role\",\"tabIndex\",\"htmlFor\",\"width\",\"height\",\"abbr\",\"accept\",\"acceptCharset\",\"accessKey\",\"action\",\"allowFullScreen\",\"allowTransparency\",\"alt\",\"async\",\"autoComplete\",\"autoFocus\",\"autoPlay\",\"cellPadding\",\"cellSpacing\",\"challenge\",\"charset\",\"checked\",\"cite\",\"class\",\"className\",\"cols\",\"colSpan\",\"command\",\"content\",\"contentEditable\",\"contextMenu\",\"controls\",\"coords\",\"crossOrigin\",\"data\",\"dateTime\",\"default\",\"defer\",\"dir\",\"disabled\",\"download\",\"draggable\",\"dropzone\",\"encType\",\"enterKeyHint\",\"for\",\"form\",\"formAction\",\"formEncType\",\"formMethod\",\"formNoValidate\",\"formTarget\",\"frameBorder\",\"headers\",\"hidden\",\"high\",\"href\",\"hrefLang\",\"httpEquiv\",\"icon\",\"inputMode\",\"isMap\",\"itemId\",\"itemProp\",\"itemRef\",\"itemScope\",\"itemType\",\"kind\",\"label\",\"lang\",\"list\",\"loop\",\"manifest\",\"max\",\"maxLength\",\"media\",\"mediaGroup\",\"method\",\"min\",\"minLength\",\"multiple\",\"muted\",\"name\",\"noValidate\",\"open\",\"optimum\",\"pattern\",\"ping\",\"placeholder\",\"poster\",\"preload\",\"radioGroup\",\"referrerPolicy\",\"readOnly\",\"rel\",\"required\",\"rows\",\"rowSpan\",\"sandbox\",\"scope\",\"scoped\",\"scrolling\",\"seamless\",\"selected\",\"shape\",\"size\",\"sizes\",\"slot\",\"sortable\",\"span\",\"spellCheck\",\"src\",\"srcDoc\",\"srcSet\",\"start\",\"step\",\"target\",\"translate\",\"typeMustMatch\",\"useMap\",\"value\",\"wmode\",\"wrap\"]),nZ=new Set([\"onCopy\",\"onCut\",\"onPaste\",\"onLoad\",\"onError\",\"onWheel\",\"onScroll\",\"onCompositionEnd\",\"onCompositionStart\",\"onCompositionUpdate\",\"onKeyDown\",\"onKeyPress\",\"onKeyUp\",\"onFocus\",\"onBlur\",\"onChange\",\"onInput\",\"onSubmit\",\"onClick\",\"onContextMenu\",\"onDoubleClick\",\"onDrag\",\"onDragEnd\",\"onDragEnter\",\"onDragExit\",\"onDragLeave\",\"onDragOver\",\"onDragStart\",\"onDrop\",\"onMouseDown\",\"onMouseEnter\",\"onMouseLeave\",\"onMouseMove\",\"onMouseOut\",\"onMouseOver\",\"onMouseUp\",\"onPointerDown\",\"onPointerEnter\",\"onPointerLeave\",\"onPointerUp\",\"onSelect\",\"onTouchCancel\",\"onTouchEnd\",\"onTouchMove\",\"onTouchStart\",\"onAnimationStart\",\"onAnimationEnd\",\"onAnimationIteration\",\"onTransitionEnd\"]);var M1t=/^(data-.*)$/,fqt=/^(aria-.*)$/,D9=/^(on[A-Z].*)$/;function kC(e,t={}){let{labelable:r=!0,enabled:i=!0,propNames:n,omitPropNames:o,omitEventNames:s,omitDataProps:a,omitEventProps:h}=t,p={};if(!i)return e;for(let g in e)o?.has(g)||s?.has(g)&&D9.test(g)||D9.test(g)&&!nZ.has(g)||a&&M1t.test(g)||h&&D9.test(g)||(Object.prototype.hasOwnProperty.call(e,g)&&(iZ.has(g)||r&&fqt.test(g)||n?.has(g)||M1t.test(g))||D9.test(g))&&(p[g]=e[g]);return p}var[oZ,Ib]=MC({name:\"ProviderContext\",strict:!1});var pqt=new Set([\"Arab\",\"Syrc\",\"Samr\",\"Mand\",\"Thaa\",\"Mend\",\"Nkoo\",\"Adlm\",\"Rohg\",\"Hebr\"]),mqt=new Set([\"ae\",\"ar\",\"arc\",\"bcc\",\"bqi\",\"ckb\",\"dv\",\"fa\",\"glk\",\"he\",\"ku\",\"mzn\",\"nqo\",\"pnb\",\"ps\",\"sd\",\"ug\",\"ur\",\"yi\"]);function O9(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),i=typeof r.getTextInfo==\"function\"?r.getTextInfo():r.textInfo;if(i)return i.direction===\"rtl\";if(r.script)return pqt.has(r.script)}let t=e.split(\"-\")[0];return mqt.has(t)}var B9=xe(ze(),1);var rl=xe(ze(),1),L9={prefix:String(Math.round(Math.random()*1e10)),current:0},E1t=rl.default.createContext(L9),gqt=rl.default.createContext(!1);var Aqt=!!(typeof window<\"u\"&&window.document&&window.document.createElement),sZ=new WeakMap;function yqt(e=!1){let t=(0,rl.useContext)(E1t),r=(0,rl.useRef)(null);if(r.current===null&&!e){var i,n;let o=(n=rl.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(i=n.ReactCurrentOwner)===null||i===void 0?void 0:i.current;if(o){let s=sZ.get(o);s==null?sZ.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==s.state&&(t.current=s.id,sZ.delete(o))}r.current=++t.current}return r.current}function _qt(e){let t=(0,rl.useContext)(E1t);t===L9&&!Aqt&&console.warn(\"When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\");let r=yqt(!!e),i=`react-aria${t.prefix}`;return e||`${i}-${r}`}function vqt(e){let t=rl.default.useId(),[r]=(0,rl.useState)(Q3()),i=r?\"react-aria\":`react-aria${L9.prefix}`;return e||`${i}-${t}`}var aZ=typeof rl.default.useId==\"function\"?vqt:_qt;function bqt(){return!1}function xqt(){return!0}function wqt(e){return()=>{}}function Q3(){return typeof rl.default.useSyncExternalStore==\"function\"?rl.default.useSyncExternalStore(wqt,bqt,xqt):(0,rl.useContext)(gqt)}var Tqt=Symbol.for(\"react-aria.i18n.locale\");function C1t(){let e=typeof window<\"u\"&&window[Tqt]||typeof navigator<\"u\"&&(navigator.language||navigator.userLanguage)||\"en-US\";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=\"en-US\"}return{locale:e,direction:O9(e)?\"rtl\":\"ltr\"}}var lZ=C1t(),RC=new Set;function P1t(){lZ=C1t();for(let e of RC)e(lZ)}function cZ(){let e=Q3(),[t,r]=(0,B9.useState)(lZ);return(0,B9.useEffect)(()=>(RC.size===0&&window.addEventListener(\"languagechange\",P1t),RC.add(r),()=>{RC.delete(r),RC.size===0&&window.removeEventListener(\"languagechange\",P1t)}),[]),e?{locale:\"en-US\",direction:\"ltr\"}:t}var J3=xe(ze(),1),I1t=J3.default.createContext(null);function uZ(e){let{locale:t,children:r}=e,i=cZ(),n=J3.default.useMemo(()=>t?{locale:t,direction:O9(t)?\"rtl\":\"ltr\"}:i,[i,t]);return J3.default.createElement(I1t.Provider,{value:n},r)}function hZ(){let e=cZ();return(0,J3.useContext)(I1t)||e}function R1t(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function vr(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})}function k1t(e){var t=typeof Symbol==\"function\"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length==\"number\")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}function Ti(e){return this instanceof Ti?(this.v=e,this):new Ti(e)}function Th(e,t,r){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var i=r.apply(e,t||[]),n,o=[];return n=Object.create((typeof AsyncIterator==\"function\"?AsyncIterator:Object).prototype),a(\"next\"),a(\"throw\"),a(\"return\",s),n[Symbol.asyncIterator]=function(){return this},n;function s(R){return function(z){return Promise.resolve(z).then(R,w)}}function a(R,z){i[R]&&(n[R]=function(W){return new Promise(function(Y,H){o.push([R,W,Y,H])>1||h(R,W)})},z&&(n[R]=z(n[R])))}function h(R,z){try{p(i[R](z))}catch(W){C(o[0][3],W)}}function p(R){R.value instanceof Ti?Promise.resolve(R.value.v).then(g,w):C(o[0][2],R)}function g(R){h(\"next\",R)}function w(R){h(\"throw\",R)}function C(R,z){R(z),o.shift(),o.length&&h(o[0][0],o[0][1])}}function t4(e){var t,r;return t={},i(\"next\"),i(\"throw\",function(n){throw n}),i(\"return\"),t[Symbol.iterator]=function(){return this},t;function i(n,o){t[n]=e[n]?function(s){return(r=!r)?{value:Ti(e[n](s)),done:!1}:o?o(s):s}:o}}function Qf(e){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof k1t==\"function\"?k1t(e):e[Symbol.iterator](),r={},i(\"next\"),i(\"throw\"),i(\"return\"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(s){return new Promise(function(a,h){s=e[o](s),n(a,h,s.done,s.value)})}}function n(o,s,a,h){Promise.resolve(h).then(function(p){o({value:p,done:a})},s)}}function D1t(e,t){if(t.has(e))throw new TypeError(\"Cannot initialize the same private elements twice on an object\")}function O1t(e,t,r){D1t(e,t),t.set(e,r)}var L1t=xe(ze(),1),Sh=typeof document<\"u\"?L1t.default.useLayoutEffect:()=>{};var F9=xe(ze(),1);function Bd(e){let t=(0,F9.useRef)(null);return Sh(()=>{t.current=e},[e]),(0,F9.useCallback)((...r)=>{let i=t.current;return i?.(...r)},[])}var S1=xe(ze(),1);var Sqt=!!(typeof window<\"u\"&&window.document&&window.document.createElement),T1=new Map;function dZ(e){let[t,r]=(0,S1.useState)(e),i=(0,S1.useRef)(null),n=aZ(t),o=(0,S1.useCallback)(s=>{i.current=s},[]);return Sqt&&(T1.has(n)&&!T1.get(n).includes(o)?T1.set(n,[...T1.get(n),o]):T1.set(n,[o])),Sh(()=>{let s=n;return()=>{T1.delete(s)}},[n]),(0,S1.useEffect)(()=>{let s=i.current;s&&(i.current=null,r(s))}),n}function fZ(e,t){if(e===t)return e;let r=T1.get(e);if(r)return r.forEach(n=>n(t)),t;let i=T1.get(t);return i?(i.forEach(n=>n(e)),e):t}function kb(...e){return(...t)=>{for(let r of e)typeof r==\"function\"&&r(...t)}}var qs=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Mh=e=>e&&\"window\"in e&&e.window===e?e:qs(e).defaultView||window;function B1t(e){var t,r,i=\"\";if(typeof e==\"string\"||typeof e==\"number\")i+=e;else if(typeof e==\"object\")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=B1t(e[t]))&&(i&&(i+=\" \"),i+=r)}else for(r in e)e[r]&&(i&&(i+=\" \"),i+=r);return i}function Mqt(){for(var e,t,r=0,i=\"\",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=B1t(e))&&(i&&(i+=\" \"),i+=t);return i}var F1t=Mqt;function ns(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];for(let n in i){let o=t[n],s=i[n];typeof o==\"function\"&&typeof s==\"function\"&&n[0]===\"o\"&&n[1]===\"n\"&&n.charCodeAt(2)>=65&&n.charCodeAt(2)<=90?t[n]=kb(o,s):(n===\"className\"||n===\"UNSAFE_className\")&&typeof o==\"string\"&&typeof s==\"string\"?t[n]=F1t(o,s):n===\"id\"&&o&&s?t.id=fZ(o,s):t[n]=s!==void 0?s:o}}return t}var Eqt=new Set([\"id\"]),Pqt=new Set([\"aria-label\",\"aria-labelledby\",\"aria-describedby\",\"aria-details\"]),Cqt=new Set([\"href\",\"hrefLang\",\"target\",\"rel\",\"download\",\"ping\",\"referrerPolicy\"]),Iqt=/^(data-.*)$/;function DC(e,t={}){let{labelable:r,isLink:i,propNames:n}=t,o={};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(Eqt.has(s)||r&&Pqt.has(s)||i&&Cqt.has(s)||n?.has(s)||Iqt.test(s))&&(o[s]=e[s]);return o}function Jf(e){if(kqt())e.focus({preventScroll:!0});else{let t=Rqt(e);e.focus(),Dqt(t)}}var N9=null;function kqt(){if(N9==null){N9=!1;try{document.createElement(\"div\").focus({get preventScroll(){return N9=!0,!0}})}catch{}}return N9}function Rqt(e){let t=e.parentNode,r=[],i=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==i;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return i instanceof HTMLElement&&r.push({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}),r}function Dqt(e){for(let{element:t,scrollTop:r,scrollLeft:i}of e)t.scrollTop=r,t.scrollLeft=i}function z9(e){var t;return typeof window>\"u\"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function pZ(e){var t;return typeof window<\"u\"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function $g(e){let t=null;return()=>(t==null&&(t=e()),t)}var I0=$g(function(){return pZ(/^Mac/i)}),N1t=$g(function(){return pZ(/^iPhone/i)}),U9=$g(function(){return pZ(/^iPad/i)||I0()&&navigator.maxTouchPoints>1}),Rb=$g(function(){return N1t()||U9()}),Oqt=$g(function(){return I0()||Rb()}),OC=$g(function(){return z9(/AppleWebKit/i)&&!z1t()}),z1t=$g(function(){return z9(/Chrome/i)}),e4=$g(function(){return z9(/Android/i)}),mZ=$g(function(){return z9(/Firefox/i)});var Db=xe(ze(),1),Lqt=(0,Db.createContext)({isNative:!0,open:Bqt,useHref:e=>e});function gZ(e){let{children:t,navigate:r,useHref:i}=e,n=(0,Db.useMemo)(()=>({isNative:!1,open:(o,s,a,h)=>{V1t(o,p=>{U1t(p,s)?r(a,h):Gg(p,s)})},useHref:i||(o=>o)}),[r,i]);return Db.default.createElement(Lqt.Provider,{value:n},t)}function U1t(e,t){let r=e.getAttribute(\"target\");return(!r||r===\"_self\")&&e.origin===location.origin&&!e.hasAttribute(\"download\")&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function Gg(e,t,r=!0){var i,n;let{metaKey:o,ctrlKey:s,altKey:a,shiftKey:h}=t;mZ()&&(!((n=window.event)===null||n===void 0||(i=n.type)===null||i===void 0)&&i.startsWith(\"key\"))&&e.target===\"_blank\"&&(I0()?o=!0:s=!0);let p=OC()&&I0()&&!U9()?new KeyboardEvent(\"keydown\",{keyIdentifier:\"Enter\",metaKey:o,ctrlKey:s,altKey:a,shiftKey:h}):new MouseEvent(\"click\",{metaKey:o,ctrlKey:s,altKey:a,shiftKey:h,bubbles:!0,cancelable:!0});Gg.isOpening=r,Jf(e),e.dispatchEvent(p),Gg.isOpening=!1}Gg.isOpening=!1;function V1t(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute(\"data-href\")){let r=document.createElement(\"a\");r.href=e.getAttribute(\"data-href\"),e.hasAttribute(\"data-target\")&&(r.target=e.getAttribute(\"data-target\")),e.hasAttribute(\"data-rel\")&&(r.rel=e.getAttribute(\"data-rel\")),e.hasAttribute(\"data-download\")&&(r.download=e.getAttribute(\"data-download\")),e.hasAttribute(\"data-ping\")&&(r.ping=e.getAttribute(\"data-ping\")),e.hasAttribute(\"data-referrer-policy\")&&(r.referrerPolicy=e.getAttribute(\"data-referrer-policy\")),e.appendChild(r),t(r),e.removeChild(r)}}function Bqt(e,t){V1t(e,r=>Gg(r,t))}var r4=new Map,AZ=new Set;function j1t(){if(typeof window>\"u\")return;function e(i){return\"propertyName\"in i}let t=i=>{if(!e(i)||!i.target)return;let n=r4.get(i.target);n||(n=new Set,r4.set(i.target,n),i.target.addEventListener(\"transitioncancel\",r,{once:!0})),n.add(i.propertyName)},r=i=>{if(!e(i)||!i.target)return;let n=r4.get(i.target);if(n&&(n.delete(i.propertyName),n.size===0&&(i.target.removeEventListener(\"transitioncancel\",r),r4.delete(i.target)),r4.size===0)){for(let o of AZ)o();AZ.clear()}};document.body.addEventListener(\"transitionrun\",t),document.body.addEventListener(\"transitionend\",r)}typeof document<\"u\"&&(document.readyState!==\"loading\"?j1t():document.addEventListener(\"DOMContentLoaded\",j1t));function LC(e){requestAnimationFrame(()=>{r4.size===0?e():AZ.add(e)})}var M1=xe(ze(),1);function yZ(){let e=(0,M1.useRef)(new Map),t=(0,M1.useCallback)((n,o,s,a)=>{let h=a?.once?(...p)=>{e.current.delete(s),s(...p)}:s;e.current.set(s,{type:o,eventTarget:n,fn:h,options:a}),n.addEventListener(o,s,a)},[]),r=(0,M1.useCallback)((n,o,s,a)=>{var h;let p=((h=e.current.get(s))===null||h===void 0?void 0:h.fn)||s;n.removeEventListener(o,p,a),e.current.delete(s)},[]),i=(0,M1.useCallback)(()=>{e.current.forEach((n,o)=>{r(n.eventTarget,n.type,o,n.options)})},[r]);return(0,M1.useEffect)(()=>i,[i]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:i}}var $1t=xe(ze(),1);function Fqt(){return typeof window.ResizeObserver<\"u\"}function V9(e){let{ref:t,box:r,onResize:i}=e;(0,$1t.useEffect)(()=>{let n=t?.current;if(n)if(Fqt()){let o=new window.ResizeObserver(s=>{s.length&&i()});return o.observe(n,{box:r}),()=>{n&&o.unobserve(n)}}else return window.addEventListener(\"resize\",i,!1),()=>{window.removeEventListener(\"resize\",i,!1)}},[i,t,r])}function BC(e,t){Sh(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function i4(e){return e.mozInputSource===0&&e.isTrusted?!0:e4()&&e.pointerType?e.type===\"click\"&&e.buttons===1:e.detail===0&&!e.pointerType}function _Z(e){return!e4()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===\"mouse\"}var E1=xe(ze(),1);function vZ(e,t,r){let[i,n]=(0,E1.useState)(e||t),o=(0,E1.useRef)(e!==void 0),s=e!==void 0;(0,E1.useEffect)(()=>{let p=o.current;p!==s&&console.warn(`WARN: A component changed from ${p?\"controlled\":\"uncontrolled\"} to ${s?\"controlled\":\"uncontrolled\"}.`),o.current=s},[s]);let a=s?e:i,h=(0,E1.useCallback)((p,...g)=>{let w=(C,...R)=>{r&&(Object.is(a,C)||r(C,...R)),s||(a=C)};typeof p==\"function\"?(console.warn(\"We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320\"),n((R,...z)=>{let W=p(s?a:R,...z);return w(W,...g),s?R:W})):(s||n(p),w(p,...g))},[s,a,r]);return[a,h]}function n4(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}var k0={top:\"top\",bottom:\"top\",left:\"left\",right:\"left\"},$9={top:\"bottom\",bottom:\"top\",left:\"right\",right:\"left\"},zqt={top:\"left\",left:\"top\"},xZ={top:\"height\",left:\"width\"},Z1t={width:\"totalWidth\",height:\"totalHeight\"},j9={},il=typeof document<\"u\"?window.visualViewport:null;function G1t(e){let t=0,r=0,i=0,n=0,o=0,s=0,a={};var h;let p=((h=il?.scale)!==null&&h!==void 0?h:1)>1;if(e.tagName===\"BODY\"){let z=document.documentElement;i=z.clientWidth,n=z.clientHeight;var g;t=(g=il?.width)!==null&&g!==void 0?g:i;var w;r=(w=il?.height)!==null&&w!==void 0?w:n,a.top=z.scrollTop||e.scrollTop,a.left=z.scrollLeft||e.scrollLeft,il&&(o=il.offsetTop,s=il.offsetLeft)}else({width:t,height:r,top:o,left:s}=o4(e)),a.top=e.scrollTop,a.left=e.scrollLeft,i=t,n=r;if(OC()&&(e.tagName===\"BODY\"||e.tagName===\"HTML\")&&p){a.top=0,a.left=0;var C;o=(C=il?.pageTop)!==null&&C!==void 0?C:0;var R;s=(R=il?.pageLeft)!==null&&R!==void 0?R:0}return{width:t,height:r,totalWidth:i,totalHeight:n,scroll:a,top:o,left:s}}function Uqt(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function W1t(e,t,r,i,n,o,s){var a;let h=(a=n.scroll[e])!==null&&a!==void 0?a:0,p=i[xZ[e]],g=i.scroll[k0[e]]+o,w=p+i.scroll[k0[e]]-o,C=t-h+s[e]-i[k0[e]],R=t-h+r+s[e]-i[k0[e]];return C<g?g-C:R>w?Math.max(w-R,g-C):0}function Vqt(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function q1t(e){if(j9[e])return j9[e];let[t,r]=e.split(\" \"),i=k0[t]||\"right\",n=zqt[i];k0[r]||(r=\"center\");let o=xZ[i],s=xZ[n];return j9[e]={placement:t,crossPlacement:r,axis:i,crossAxis:n,size:o,crossSize:s},j9[e]}function bZ(e,t,r,i,n,o,s,a,h,p){let{placement:g,crossPlacement:w,axis:C,crossAxis:R,size:z,crossSize:W}=i,Y={};var H;Y[R]=(H=e[R])!==null&&H!==void 0?H:0;var Q,tt,rt,at;w===\"center\"?Y[R]+=(((Q=e[W])!==null&&Q!==void 0?Q:0)-((tt=r[W])!==null&&tt!==void 0?tt:0))/2:w!==R&&(Y[R]+=((rt=e[W])!==null&&rt!==void 0?rt:0)-((at=r[W])!==null&&at!==void 0?at:0)),Y[R]+=o;let et=e[R]-r[W]+h+p,lt=e[R]+e[W]-h-p;if(Y[R]=n4(Y[R],et,lt),g===C){let J=a?s[z]:t[Z1t[z]];Y[$9[C]]=Math.floor(J-e[C]+n)}else Y[C]=Math.floor(e[C]+e[z]+n);return Y}function jqt(e,t,r,i,n,o,s,a){let h=i?r.height:t[Z1t.height];var p;let g=e.top!=null?r.top+e.top:r.top+(h-((p=e.bottom)!==null&&p!==void 0?p:0)-s);var w,C,R,z,W,Y;let H=a!==\"top\"?Math.max(0,t.height+t.top+((w=t.scroll.top)!==null&&w!==void 0?w:0)-g-(((C=n.top)!==null&&C!==void 0?C:0)+((R=n.bottom)!==null&&R!==void 0?R:0)+o)):Math.max(0,g+s-(t.top+((z=t.scroll.top)!==null&&z!==void 0?z:0))-(((W=n.top)!==null&&W!==void 0?W:0)+((Y=n.bottom)!==null&&Y!==void 0?Y:0)+o));return Math.min(t.height-o*2,H)}function H1t(e,t,r,i,n,o){let{placement:s,axis:a,size:h}=o;var p,g;if(s===a)return Math.max(0,r[a]-e[a]-((p=e.scroll[a])!==null&&p!==void 0?p:0)+t[a]-((g=i[a])!==null&&g!==void 0?g:0)-i[$9[a]]-n);var w;return Math.max(0,e[h]+e[a]+e.scroll[a]-t[a]-r[a]-r[h]-((w=i[a])!==null&&w!==void 0?w:0)-i[$9[a]]-n)}function $qt(e,t,r,i,n,o,s,a,h,p,g,w,C,R,z,W){let Y=q1t(e),{size:H,crossAxis:Q,crossSize:tt,placement:rt,crossPlacement:at}=Y,et=bZ(t,a,r,Y,g,w,p,C,z,W),lt=g,J=H1t(a,p,t,n,o+g,Y);if(s&&i[H]>J){let gr=q1t(`${$9[rt]} ${at}`),Br=bZ(t,a,r,gr,g,w,p,C,z,W);H1t(a,p,t,n,o+g,gr)>J&&(Y=gr,et=Br,lt=g)}let ft=\"bottom\";Y.axis===\"top\"?Y.placement===\"top\"?ft=\"top\":Y.placement===\"bottom\"&&(ft=\"bottom\"):Y.crossAxis===\"top\"&&(Y.crossPlacement===\"top\"?ft=\"bottom\":Y.crossPlacement===\"bottom\"&&(ft=\"top\"));let dt=W1t(Q,et[Q],r[tt],a,h,o,p);et[Q]+=dt;let Mt=jqt(et,a,p,C,n,o,r.height,ft);R&&R<Mt&&(Mt=R),r.height=Math.min(r.height,Mt),et=bZ(t,a,r,Y,lt,w,p,C,z,W),dt=W1t(Q,et[Q],r[tt],a,h,o,p),et[Q]+=dt;let Ft={},Nt=t[Q]+.5*t[tt]-et[Q]-n[k0[Q]],$t=z/2+W;var Yt,_e,Pe,we;let Ue=k0[Q]===\"left\"?((Yt=n.left)!==null&&Yt!==void 0?Yt:0)+((_e=n.right)!==null&&_e!==void 0?_e:0):((Pe=n.top)!==null&&Pe!==void 0?Pe:0)+((we=n.bottom)!==null&&we!==void 0?we:0),lr=r[tt]-Ue-z/2-W,ee=t[Q]+z/2-(et[Q]+n[k0[Q]]),Ce=t[Q]+t[tt]-z/2-(et[Q]+n[k0[Q]]),mr=n4(Nt,ee,Ce);return Ft[Q]=n4(mr,$t,lr),{position:et,maxHeight:Mt,arrowOffsetLeft:Ft.left,arrowOffsetTop:Ft.top,placement:Y.placement}}function K1t(e){let{placement:t,targetNode:r,overlayNode:i,scrollNode:n,padding:o,shouldFlip:s,boundaryElement:a,offset:h,crossOffset:p,maxHeight:g,arrowSize:w=0,arrowBoundaryOffset:C=0}=e,R=i instanceof HTMLElement?Gqt(i):document.documentElement,z=R===document.documentElement,W=window.getComputedStyle(R).position,Y=!!W&&W!==\"static\",H=z?o4(r):Y1t(r,R);if(!z){let{marginTop:Ft,marginLeft:Nt}=window.getComputedStyle(r);H.top+=parseInt(Ft,10)||0,H.left+=parseInt(Nt,10)||0}let Q=o4(i),tt=Vqt(i);var rt,at;Q.width+=((rt=tt.left)!==null&&rt!==void 0?rt:0)+((at=tt.right)!==null&&at!==void 0?at:0);var et,lt;Q.height+=((et=tt.top)!==null&&et!==void 0?et:0)+((lt=tt.bottom)!==null&&lt!==void 0?lt:0);let J=Uqt(n),ft=G1t(a),dt=G1t(R),Mt=a.tagName===\"BODY\"?o4(R):Y1t(R,a);return R.tagName===\"HTML\"&&a.tagName===\"BODY\"&&(dt.scroll.top=0,dt.scroll.left=0),$qt(t,H,Q,J,tt,o,s,ft,dt,Mt,h,p,Y,g,w,C)}function o4(e){let{top:t,left:r,width:i,height:n}=e.getBoundingClientRect(),{scrollTop:o,scrollLeft:s,clientTop:a,clientLeft:h}=document.documentElement;return{top:t+o-a,left:r+s-h,width:i,height:n}}function Y1t(e,t){let r=window.getComputedStyle(e),i;if(r.position===\"fixed\"){let{top:n,left:o,width:s,height:a}=e.getBoundingClientRect();i={top:n,left:o,width:s,height:a}}else{i=o4(e);let n=o4(t),o=window.getComputedStyle(t);n.top+=(parseInt(o.borderTopWidth,10)||0)-t.scrollTop,n.left+=(parseInt(o.borderLeftWidth,10)||0)-t.scrollLeft,i.top-=n.top,i.left-=n.left}return i.top-=parseInt(r.marginTop,10)||0,i.left-=parseInt(r.marginLeft,10)||0,i}function Gqt(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position===\"static\"&&!X1t(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!X1t(t);)t=t.parentElement;return t||document.documentElement}function X1t(e){let t=window.getComputedStyle(e);return t.transform!==\"none\"||/transform|perspective/.test(t.willChange)||t.filter!==\"none\"||t.contain===\"paint\"||\"backdropFilter\"in t&&t.backdropFilter!==\"none\"||\"WebkitBackdropFilter\"in t&&t.WebkitBackdropFilter!==\"none\"}var Q1t=xe(ze(),1),Wqt=new WeakMap;function J1t(e){let{triggerRef:t,isOpen:r,onClose:i}=e;(0,Q1t.useEffect)(()=>{if(!r||i===null)return;let n=o=>{let s=o.target;if(!t.current||s instanceof Node&&!s.contains(t.current)||o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement)return;let a=i||Wqt.get(t.current);a&&a()};return window.addEventListener(\"scroll\",n,!0),()=>{window.removeEventListener(\"scroll\",n,!0)}},[r,i,t])}var R0=xe(ze(),1);var Hs=typeof document<\"u\"?window.visualViewport:null;function wZ(e){let{direction:t}=hZ(),{arrowSize:r=0,targetRef:i,overlayRef:n,scrollRef:o=n,placement:s=\"bottom\",containerPadding:a=12,shouldFlip:h=!0,boundaryElement:p=typeof document<\"u\"?document.body:null,offset:g=0,crossOffset:w=0,shouldUpdatePosition:C=!0,isOpen:R=!0,onClose:z,maxHeight:W,arrowBoundaryOffset:Y=0}=e,[H,Q]=(0,R0.useState)(null),tt=[C,s,n.current,i.current,o.current,a,h,p,g,w,R,t,W,Y,r],rt=(0,R0.useRef)(Hs?.scale);(0,R0.useEffect)(()=>{R&&(rt.current=Hs?.scale)},[R]);let at=(0,R0.useCallback)(()=>{if(C===!1||!R||!n.current||!i.current||!p||Hs?.scale!==rt.current)return;let dt=null;if(o.current&&o.current.contains(document.activeElement)){var Mt;let we=(Mt=document.activeElement)===null||Mt===void 0?void 0:Mt.getBoundingClientRect(),Ue=o.current.getBoundingClientRect();var Ft;if(dt={type:\"top\",offset:((Ft=we?.top)!==null&&Ft!==void 0?Ft:0)-Ue.top},dt.offset>Ue.height/2){dt.type=\"bottom\";var Nt;dt.offset=((Nt=we?.bottom)!==null&&Nt!==void 0?Nt:0)-Ue.bottom}}let $t=n.current;if(!W&&n.current){var Yt;$t.style.top=\"0px\",$t.style.bottom=\"\";var _e;$t.style.maxHeight=((_e=(Yt=window.visualViewport)===null||Yt===void 0?void 0:Yt.height)!==null&&_e!==void 0?_e:window.innerHeight)+\"px\"}let Pe=K1t({placement:Hqt(s,t),overlayNode:n.current,targetNode:i.current,scrollNode:o.current||n.current,padding:a,shouldFlip:h,boundaryElement:p,offset:g,crossOffset:w,maxHeight:W,arrowSize:r,arrowBoundaryOffset:Y});if(Pe.position){if($t.style.top=\"\",$t.style.bottom=\"\",$t.style.left=\"\",$t.style.right=\"\",Object.keys(Pe.position).forEach(we=>$t.style[we]=Pe.position[we]+\"px\"),$t.style.maxHeight=Pe.maxHeight!=null?Pe.maxHeight+\"px\":\"\",dt&&document.activeElement&&o.current){let we=document.activeElement.getBoundingClientRect(),Ue=o.current.getBoundingClientRect(),lr=we[dt.type]-Ue[dt.type];o.current.scrollTop+=lr-dt.offset}Q(Pe)}},tt);Sh(at,tt),qqt(at),V9({ref:n,onResize:at}),V9({ref:i,onResize:at});let et=(0,R0.useRef)(!1);Sh(()=>{let dt,Mt=()=>{et.current=!0,clearTimeout(dt),dt=setTimeout(()=>{et.current=!1},500),at()},Ft=()=>{et.current&&Mt()};return Hs?.addEventListener(\"resize\",Mt),Hs?.addEventListener(\"scroll\",Ft),()=>{Hs?.removeEventListener(\"resize\",Mt),Hs?.removeEventListener(\"scroll\",Ft)}},[at]);let lt=(0,R0.useCallback)(()=>{et.current||z?.()},[z,et]);J1t({triggerRef:i,isOpen:R,onClose:z&&lt});var J,ft;return{overlayProps:{style:{position:\"absolute\",zIndex:1e5,...H?.position,maxHeight:(J=H?.maxHeight)!==null&&J!==void 0?J:\"100vh\"}},placement:(ft=H?.placement)!==null&&ft!==void 0?ft:null,arrowProps:{\"aria-hidden\":\"true\",role:\"presentation\",style:{left:H?.arrowOffsetLeft,top:H?.arrowOffsetTop}},updatePosition:at}}function qqt(e){Sh(()=>(window.addEventListener(\"resize\",e,!1),()=>{window.removeEventListener(\"resize\",e,!1)}),[e])}function Hqt(e,t){return t===\"rtl\"?e.replace(\"start\",\"right\").replace(\"end\",\"left\"):e.replace(\"start\",\"left\").replace(\"end\",\"right\")}var s4=\"default\",TZ=\"\",G9=new WeakMap;function SZ(e){if(Rb()){if(s4===\"default\"){let t=qs(e);TZ=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=\"none\"}s4=\"disabled\"}else(e instanceof HTMLElement||e instanceof SVGElement)&&(G9.set(e,e.style.userSelect),e.style.userSelect=\"none\")}function FC(e){if(Rb()){if(s4!==\"disabled\")return;s4=\"restoring\",setTimeout(()=>{LC(()=>{if(s4===\"restoring\"){let t=qs(e);t.documentElement.style.webkitUserSelect===\"none\"&&(t.documentElement.style.webkitUserSelect=TZ||\"\"),TZ=\"\",s4=\"default\"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&G9.has(e)){let t=G9.get(e);e.style.userSelect===\"none\"&&(e.style.userSelect=t),e.getAttribute(\"style\")===\"\"&&e.removeAttribute(\"style\"),G9.delete(e)}}var t_t=xe(ze(),1),MZ=t_t.default.createContext({register:()=>{}});MZ.displayName=\"PressResponderContext\";function e_t(e,t){return t.get?t.get.call(e):t.value}function W9(e,t,r){if(!t.has(e))throw new TypeError(\"attempted to \"+r+\" private field on non-instance\");return t.get(e)}function r_t(e,t){var r=W9(e,t,\"get\");return e_t(e,r)}function i_t(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError(\"attempted to set read only private field\");t.value=r}}function EZ(e,t,r){var i=W9(e,t,\"set\");return i_t(e,i,r),r}var D0=xe(ze(),1);function Yqt(e){let t=(0,D0.useContext)(MZ);if(t){let{register:r,...i}=t;e=ns(i,e),r()}return BC(t,e.ref),e}var q9=new WeakMap,l4=class{continuePropagation(){EZ(this,q9,!1)}get shouldStopPropagation(){return r_t(this,q9)}constructor(t,r,i,n){O1t(this,q9,{writable:!0,value:void 0}),EZ(this,q9,!0);var o;let s=(o=n?.target)!==null&&o!==void 0?o:i.currentTarget,a=s?.getBoundingClientRect(),h,p=0,g,w=null;i.clientX!=null&&i.clientY!=null&&(g=i.clientX,w=i.clientY),a&&(g!=null&&w!=null?(h=g-a.left,p=w-a.top):(h=a.width/2,p=a.height/2)),this.type=t,this.pointerType=r,this.target=i.currentTarget,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.x=h,this.y=p}},n_t=Symbol(\"linkClicked\");function IZ(e){let{onPress:t,onPressChange:r,onPressStart:i,onPressEnd:n,onPressUp:o,isDisabled:s,isPressed:a,preventFocusOnPress:h,shouldCancelOnPointerExit:p,allowTextSelectionOnPress:g,ref:w,...C}=Yqt(e),[R,z]=(0,D0.useState)(!1),W=(0,D0.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:Y,removeAllGlobalListeners:H}=yZ(),Q=Bd((J,ft)=>{let dt=W.current;if(s||dt.didFirePressStart)return!1;let Mt=!0;if(dt.isTriggeringEvent=!0,i){let Ft=new l4(\"pressstart\",ft,J);i(Ft),Mt=Ft.shouldStopPropagation}return r&&r(!0),dt.isTriggeringEvent=!1,dt.didFirePressStart=!0,z(!0),Mt}),tt=Bd((J,ft,dt=!0)=>{let Mt=W.current;if(!Mt.didFirePressStart)return!1;Mt.ignoreClickAfterPress=!0,Mt.didFirePressStart=!1,Mt.isTriggeringEvent=!0;let Ft=!0;if(n){let Nt=new l4(\"pressend\",ft,J);n(Nt),Ft=Nt.shouldStopPropagation}if(r&&r(!1),z(!1),t&&dt&&!s){let Nt=new l4(\"press\",ft,J);t(Nt),Ft&&(Ft=Nt.shouldStopPropagation)}return Mt.isTriggeringEvent=!1,Ft}),rt=Bd((J,ft)=>{let dt=W.current;if(s)return!1;if(o){dt.isTriggeringEvent=!0;let Mt=new l4(\"pressup\",ft,J);return o(Mt),dt.isTriggeringEvent=!1,Mt.shouldStopPropagation}return!0}),at=Bd(J=>{let ft=W.current;ft.isPressed&&ft.target&&(ft.isOverTarget&&ft.pointerType!=null&&tt(Wg(ft.target,J),ft.pointerType,!1),ft.isPressed=!1,ft.isOverTarget=!1,ft.activePointerId=null,ft.pointerType=null,H(),g||FC(ft.target))}),et=Bd(J=>{p&&at(J)}),lt=(0,D0.useMemo)(()=>{let J=W.current,ft={onKeyDown(Mt){if(PZ(Mt.nativeEvent,Mt.currentTarget)&&Mt.currentTarget.contains(Mt.target)){var Ft;s_t(Mt.target,Mt.key)&&Mt.preventDefault();let Nt=!0;if(!J.isPressed&&!Mt.repeat){J.target=Mt.currentTarget,J.isPressed=!0,Nt=Q(Mt,\"keyboard\");let $t=Mt.currentTarget,Yt=_e=>{PZ(_e,$t)&&!_e.repeat&&$t.contains(_e.target)&&J.target&&rt(Wg(J.target,_e),\"keyboard\")};Y(qs(Mt.currentTarget),\"keyup\",kb(Yt,dt),!0)}Nt&&Mt.stopPropagation(),Mt.metaKey&&I0()&&((Ft=J.metaKeyEvents)===null||Ft===void 0||Ft.set(Mt.key,Mt.nativeEvent))}else Mt.key===\"Meta\"&&(J.metaKeyEvents=new Map)},onClick(Mt){if(!(Mt&&!Mt.currentTarget.contains(Mt.target))&&Mt&&Mt.button===0&&!J.isTriggeringEvent&&!Gg.isOpening){let Ft=!0;if(s&&Mt.preventDefault(),!J.ignoreClickAfterPress&&!J.ignoreEmulatedMouseEvents&&!J.isPressed&&(J.pointerType===\"virtual\"||i4(Mt.nativeEvent))){!s&&!h&&Jf(Mt.currentTarget);let Nt=Q(Mt,\"virtual\"),$t=rt(Mt,\"virtual\"),Yt=tt(Mt,\"virtual\");Ft=Nt&&$t&&Yt}J.ignoreEmulatedMouseEvents=!1,J.ignoreClickAfterPress=!1,Ft&&Mt.stopPropagation()}}},dt=Mt=>{var Ft;if(J.isPressed&&J.target&&PZ(Mt,J.target)){var Nt;s_t(Mt.target,Mt.key)&&Mt.preventDefault();let Yt=Mt.target;tt(Wg(J.target,Mt),\"keyboard\",J.target.contains(Yt)),H(),Mt.key!==\"Enter\"&&kZ(J.target)&&J.target.contains(Yt)&&!Mt[n_t]&&(Mt[n_t]=!0,Gg(J.target,Mt,!1)),J.isPressed=!1,(Nt=J.metaKeyEvents)===null||Nt===void 0||Nt.delete(Mt.key)}else if(Mt.key===\"Meta\"&&(!((Ft=J.metaKeyEvents)===null||Ft===void 0)&&Ft.size)){var $t;let Yt=J.metaKeyEvents;J.metaKeyEvents=void 0;for(let _e of Yt.values())($t=J.target)===null||$t===void 0||$t.dispatchEvent(new KeyboardEvent(\"keyup\",_e))}};if(typeof PointerEvent<\"u\"){ft.onPointerDown=Yt=>{if(Yt.button!==0||!Yt.currentTarget.contains(Yt.target))return;if(_Z(Yt.nativeEvent)){J.pointerType=\"virtual\";return}CZ(Yt.currentTarget)&&Yt.preventDefault(),J.pointerType=Yt.pointerType;let _e=!0;J.isPressed||(J.isPressed=!0,J.isOverTarget=!0,J.activePointerId=Yt.pointerId,J.target=Yt.currentTarget,!s&&!h&&Jf(Yt.currentTarget),g||SZ(J.target),_e=Q(Yt,J.pointerType),Y(qs(Yt.currentTarget),\"pointermove\",Mt,!1),Y(qs(Yt.currentTarget),\"pointerup\",Ft,!1),Y(qs(Yt.currentTarget),\"pointercancel\",$t,!1)),_e&&Yt.stopPropagation()},ft.onMouseDown=Yt=>{Yt.currentTarget.contains(Yt.target)&&Yt.button===0&&(CZ(Yt.currentTarget)&&Yt.preventDefault(),Yt.stopPropagation())},ft.onPointerUp=Yt=>{!Yt.currentTarget.contains(Yt.target)||J.pointerType===\"virtual\"||Yt.button===0&&a4(Yt,Yt.currentTarget)&&rt(Yt,J.pointerType||Yt.pointerType)};let Mt=Yt=>{Yt.pointerId===J.activePointerId&&(J.target&&a4(Yt,J.target)?!J.isOverTarget&&J.pointerType!=null&&(J.isOverTarget=!0,Q(Wg(J.target,Yt),J.pointerType)):J.target&&J.isOverTarget&&J.pointerType!=null&&(J.isOverTarget=!1,tt(Wg(J.target,Yt),J.pointerType,!1),et(Yt)))},Ft=Yt=>{Yt.pointerId===J.activePointerId&&J.isPressed&&Yt.button===0&&J.target&&(a4(Yt,J.target)&&J.pointerType!=null?tt(Wg(J.target,Yt),J.pointerType):J.isOverTarget&&J.pointerType!=null&&tt(Wg(J.target,Yt),J.pointerType,!1),J.isPressed=!1,J.isOverTarget=!1,J.activePointerId=null,J.pointerType=null,H(),g||FC(J.target),\"ontouchend\"in J.target&&Yt.pointerType!==\"mouse\"&&Y(J.target,\"touchend\",Nt,{once:!0}))},Nt=Yt=>{a_t(Yt.currentTarget)&&Yt.preventDefault()},$t=Yt=>{at(Yt)};ft.onDragStart=Yt=>{Yt.currentTarget.contains(Yt.target)&&at(Yt)}}else{ft.onMouseDown=Nt=>{if(Nt.button!==0||!Nt.currentTarget.contains(Nt.target))return;if(CZ(Nt.currentTarget)&&Nt.preventDefault(),J.ignoreEmulatedMouseEvents){Nt.stopPropagation();return}J.isPressed=!0,J.isOverTarget=!0,J.target=Nt.currentTarget,J.pointerType=i4(Nt.nativeEvent)?\"virtual\":\"mouse\",!s&&!h&&Jf(Nt.currentTarget),Q(Nt,J.pointerType)&&Nt.stopPropagation(),Y(qs(Nt.currentTarget),\"mouseup\",Mt,!1)},ft.onMouseEnter=Nt=>{if(!Nt.currentTarget.contains(Nt.target))return;let $t=!0;J.isPressed&&!J.ignoreEmulatedMouseEvents&&J.pointerType!=null&&(J.isOverTarget=!0,$t=Q(Nt,J.pointerType)),$t&&Nt.stopPropagation()},ft.onMouseLeave=Nt=>{if(!Nt.currentTarget.contains(Nt.target))return;let $t=!0;J.isPressed&&!J.ignoreEmulatedMouseEvents&&J.pointerType!=null&&(J.isOverTarget=!1,$t=tt(Nt,J.pointerType,!1),et(Nt)),$t&&Nt.stopPropagation()},ft.onMouseUp=Nt=>{Nt.currentTarget.contains(Nt.target)&&!J.ignoreEmulatedMouseEvents&&Nt.button===0&&rt(Nt,J.pointerType||\"mouse\")};let Mt=Nt=>{if(Nt.button===0){if(J.isPressed=!1,H(),J.ignoreEmulatedMouseEvents){J.ignoreEmulatedMouseEvents=!1;return}J.target&&a4(Nt,J.target)&&J.pointerType!=null?tt(Wg(J.target,Nt),J.pointerType):J.target&&J.isOverTarget&&J.pointerType!=null&&tt(Wg(J.target,Nt),J.pointerType,!1),J.isOverTarget=!1}};ft.onTouchStart=Nt=>{if(!Nt.currentTarget.contains(Nt.target))return;let $t=Xqt(Nt.nativeEvent);if(!$t)return;J.activePointerId=$t.identifier,J.ignoreEmulatedMouseEvents=!0,J.isOverTarget=!0,J.isPressed=!0,J.target=Nt.currentTarget,J.pointerType=\"touch\",!s&&!h&&Jf(Nt.currentTarget),g||SZ(J.target),Q(P1(J.target,Nt),J.pointerType)&&Nt.stopPropagation(),Y(Mh(Nt.currentTarget),\"scroll\",Ft,!0)},ft.onTouchMove=Nt=>{if(!Nt.currentTarget.contains(Nt.target))return;if(!J.isPressed){Nt.stopPropagation();return}let $t=o_t(Nt.nativeEvent,J.activePointerId),Yt=!0;$t&&a4($t,Nt.currentTarget)?!J.isOverTarget&&J.pointerType!=null&&(J.isOverTarget=!0,Yt=Q(P1(J.target,Nt),J.pointerType)):J.isOverTarget&&J.pointerType!=null&&(J.isOverTarget=!1,Yt=tt(P1(J.target,Nt),J.pointerType,!1),et(P1(J.target,Nt))),Yt&&Nt.stopPropagation()},ft.onTouchEnd=Nt=>{if(!Nt.currentTarget.contains(Nt.target))return;if(!J.isPressed){Nt.stopPropagation();return}let $t=o_t(Nt.nativeEvent,J.activePointerId),Yt=!0;$t&&a4($t,Nt.currentTarget)&&J.pointerType!=null?(rt(P1(J.target,Nt),J.pointerType),Yt=tt(P1(J.target,Nt),J.pointerType)):J.isOverTarget&&J.pointerType!=null&&(Yt=tt(P1(J.target,Nt),J.pointerType,!1)),Yt&&Nt.stopPropagation(),J.isPressed=!1,J.activePointerId=null,J.isOverTarget=!1,J.ignoreEmulatedMouseEvents=!0,J.target&&!g&&FC(J.target),H()},ft.onTouchCancel=Nt=>{Nt.currentTarget.contains(Nt.target)&&(Nt.stopPropagation(),J.isPressed&&at(P1(J.target,Nt)))};let Ft=Nt=>{J.isPressed&&Nt.target.contains(J.target)&&at({currentTarget:J.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};ft.onDragStart=Nt=>{Nt.currentTarget.contains(Nt.target)&&at(Nt)}}return ft},[Y,s,h,H,g,at,et,tt,Q,rt]);return(0,D0.useEffect)(()=>()=>{var J;g||FC((J=W.current.target)!==null&&J!==void 0?J:void 0)},[g]),{isPressed:a||R,pressProps:ns(C,lt)}}function kZ(e){return e.tagName===\"A\"&&e.hasAttribute(\"href\")}function PZ(e,t){let{key:r,code:i}=e,n=t,o=n.getAttribute(\"role\");return(r===\"Enter\"||r===\" \"||r===\"Spacebar\"||i===\"Space\")&&!(n instanceof Mh(n).HTMLInputElement&&!l_t(n,r)||n instanceof Mh(n).HTMLTextAreaElement||n.isContentEditable)&&!((o===\"link\"||!o&&kZ(n))&&r!==\"Enter\")}function Xqt(e){let{targetTouches:t}=e;return t.length>0?t[0]:null}function o_t(e,t){let r=e.changedTouches;for(let i=0;i<r.length;i++){let n=r[i];if(n.identifier===t)return n}return null}function P1(e,t){let r=0,i=0;return t.targetTouches&&t.targetTouches.length===1&&(r=t.targetTouches[0].clientX,i=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:i}}function Wg(e,t){let r=t.clientX,i=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:i}}function Zqt(e){let t=0,r=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?r=e.height/2:e.radiusY!==void 0&&(r=e.radiusY),{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function Kqt(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function a4(e,t){let r=t.getBoundingClientRect(),i=Zqt(e);return Kqt(r,i)}function CZ(e){return!(e instanceof HTMLElement)||!e.hasAttribute(\"draggable\")}function a_t(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==\"submit\"&&e.type!==\"reset\":!kZ(e)}function s_t(e,t){return e instanceof HTMLInputElement?!l_t(e,t):a_t(e)}var Qqt=new Set([\"checkbox\",\"radio\",\"range\",\"color\",\"file\",\"image\",\"button\",\"submit\",\"reset\"]);function l_t(e,t){return e.type===\"checkbox\"||e.type===\"radio\"?t===\" \":Qqt.has(e.type)}var H9=xe(ze(),1);var RZ=class{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,r){this.nativeEvent=r,this.target=r.target,this.currentTarget=r.currentTarget,this.relatedTarget=r.relatedTarget,this.bubbles=r.bubbles,this.cancelable=r.cancelable,this.defaultPrevented=r.defaultPrevented,this.eventPhase=r.eventPhase,this.isTrusted=r.isTrusted,this.timeStamp=r.timeStamp,this.type=t}};function Y9(e){let t=(0,H9.useRef)({isFocused:!1,observer:null});Sh(()=>{let i=t.current;return()=>{i.observer&&(i.observer.disconnect(),i.observer=null)}},[]);let r=Bd(i=>{e?.(i)});return(0,H9.useCallback)(i=>{if(i.target instanceof HTMLButtonElement||i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement||i.target instanceof HTMLSelectElement){t.current.isFocused=!0;let n=i.target,o=s=>{t.current.isFocused=!1,n.disabled&&r(new RZ(\"blur\",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};n.addEventListener(\"focusout\",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=n===document.activeElement?null:document.activeElement;n.dispatchEvent(new FocusEvent(\"blur\",{relatedTarget:a})),n.dispatchEvent(new FocusEvent(\"focusout\",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[\"disabled\"]})}},[r])}var DZ=xe(ze(),1);function NC(e){let{isDisabled:t,onFocus:r,onBlur:i,onFocusChange:n}=e,o=(0,DZ.useCallback)(h=>{if(h.target===h.currentTarget)return i&&i(h),n&&n(!1),!0},[i,n]),s=Y9(o),a=(0,DZ.useCallback)(h=>{let p=qs(h.target);h.target===h.currentTarget&&p.activeElement===h.target&&(r&&r(h),n&&n(!0),s(h))},[n,r,s]);return{focusProps:{onFocus:!t&&(r||n||i)?a:void 0,onBlur:!t&&(i||n)?o:void 0}}}var FZ=xe(ze(),1);var c4=null,OZ=new Set,zC=new Map,Ob=!1,LZ=!1,Jqt={Tab:!0,Escape:!0};function NZ(e,t){for(let r of OZ)r(e,t)}function tHt(e){return!(e.metaKey||!I0()&&e.altKey||e.ctrlKey||e.key===\"Control\"||e.key===\"Shift\"||e.key===\"Meta\")}function X9(e){Ob=!0,tHt(e)&&(c4=\"keyboard\",NZ(\"keyboard\",e))}function Fd(e){c4=\"pointer\",(e.type===\"mousedown\"||e.type===\"pointerdown\")&&(Ob=!0,NZ(\"pointer\",e))}function c_t(e){i4(e)&&(Ob=!0,c4=\"virtual\")}function u_t(e){e.target===window||e.target===document||(!Ob&&!LZ&&(c4=\"virtual\",NZ(\"virtual\",e)),Ob=!1,LZ=!1)}function h_t(){Ob=!1,LZ=!0}function BZ(e){if(typeof window>\"u\"||zC.get(Mh(e)))return;let t=Mh(e),r=qs(e),i=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ob=!0,i.apply(this,arguments)},r.addEventListener(\"keydown\",X9,!0),r.addEventListener(\"keyup\",X9,!0),r.addEventListener(\"click\",c_t,!0),t.addEventListener(\"focus\",u_t,!0),t.addEventListener(\"blur\",h_t,!1),typeof PointerEvent<\"u\"?(r.addEventListener(\"pointerdown\",Fd,!0),r.addEventListener(\"pointermove\",Fd,!0),r.addEventListener(\"pointerup\",Fd,!0)):(r.addEventListener(\"mousedown\",Fd,!0),r.addEventListener(\"mousemove\",Fd,!0),r.addEventListener(\"mouseup\",Fd,!0)),t.addEventListener(\"beforeunload\",()=>{d_t(e)},{once:!0}),zC.set(t,{focus:i})}var d_t=(e,t)=>{let r=Mh(e),i=qs(e);t&&i.removeEventListener(\"DOMContentLoaded\",t),zC.has(r)&&(r.HTMLElement.prototype.focus=zC.get(r).focus,i.removeEventListener(\"keydown\",X9,!0),i.removeEventListener(\"keyup\",X9,!0),i.removeEventListener(\"click\",c_t,!0),r.removeEventListener(\"focus\",u_t,!0),r.removeEventListener(\"blur\",h_t,!1),typeof PointerEvent<\"u\"?(i.removeEventListener(\"pointerdown\",Fd,!0),i.removeEventListener(\"pointermove\",Fd,!0),i.removeEventListener(\"pointerup\",Fd,!0)):(i.removeEventListener(\"mousedown\",Fd,!0),i.removeEventListener(\"mousemove\",Fd,!0),i.removeEventListener(\"mouseup\",Fd,!0)),zC.delete(r))};function f_t(e){let t=qs(e),r;return t.readyState!==\"loading\"?BZ(e):(r=()=>{BZ(e)},t.addEventListener(\"DOMContentLoaded\",r)),()=>d_t(e,r)}typeof document<\"u\"&&f_t();function u4(){return c4!==\"pointer\"}function UC(){return c4}var eHt=new Set([\"checkbox\",\"radio\",\"range\",\"color\",\"file\",\"image\",\"button\",\"submit\",\"reset\"]);function rHt(e,t,r){var i;let n=typeof window<\"u\"?Mh(r?.target).HTMLInputElement:HTMLInputElement,o=typeof window<\"u\"?Mh(r?.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<\"u\"?Mh(r?.target).HTMLElement:HTMLElement,a=typeof window<\"u\"?Mh(r?.target).KeyboardEvent:KeyboardEvent;return e=e||r?.target instanceof n&&!eHt.has(r==null||(i=r.target)===null||i===void 0?void 0:i.type)||r?.target instanceof o||r?.target instanceof s&&r?.target.isContentEditable,!(e&&t===\"keyboard\"&&r instanceof a&&!Jqt[r.key])}function zZ(e,t,r){BZ(),(0,FZ.useEffect)(()=>{let i=(n,o)=>{rHt(!!r?.isTextInput,n,o)&&e(u4())};return OZ.add(i),()=>{OZ.delete(i)}},t)}var VC=xe(ze(),1);function jC(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:i,onFocusWithinChange:n}=e,o=(0,VC.useRef)({isFocusWithin:!1}),s=(0,VC.useCallback)(p=>{o.current.isFocusWithin&&!p.currentTarget.contains(p.relatedTarget)&&(o.current.isFocusWithin=!1,r&&r(p),n&&n(!1))},[r,n,o]),a=Y9(s),h=(0,VC.useCallback)(p=>{!o.current.isFocusWithin&&document.activeElement===p.target&&(i&&i(p),n&&n(!0),o.current.isFocusWithin=!0,a(p))},[i,n,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:h,onBlur:s}}}var qg=xe(ze(),1),Z9=!1,UZ=0;function VZ(){Z9=!0,setTimeout(()=>{Z9=!1},50)}function p_t(e){e.pointerType===\"touch\"&&VZ()}function iHt(){if(!(typeof document>\"u\"))return typeof PointerEvent<\"u\"?document.addEventListener(\"pointerup\",p_t):document.addEventListener(\"touchend\",VZ),UZ++,()=>{UZ--,!(UZ>0)&&(typeof PointerEvent<\"u\"?document.removeEventListener(\"pointerup\",p_t):document.removeEventListener(\"touchend\",VZ))}}function Lb(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:i,isDisabled:n}=e,[o,s]=(0,qg.useState)(!1),a=(0,qg.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:\"\",target:null}).current;(0,qg.useEffect)(iHt,[]);let{hoverProps:h,triggerHoverEnd:p}=(0,qg.useMemo)(()=>{let g=(R,z)=>{if(a.pointerType=z,n||z===\"touch\"||a.isHovered||!R.currentTarget.contains(R.target))return;a.isHovered=!0;let W=R.currentTarget;a.target=W,t&&t({type:\"hoverstart\",target:W,pointerType:z}),r&&r(!0),s(!0)},w=(R,z)=>{if(a.pointerType=\"\",a.target=null,z===\"touch\"||!a.isHovered)return;a.isHovered=!1;let W=R.currentTarget;i&&i({type:\"hoverend\",target:W,pointerType:z}),r&&r(!1),s(!1)},C={};return typeof PointerEvent<\"u\"?(C.onPointerEnter=R=>{Z9&&R.pointerType===\"mouse\"||g(R,R.pointerType)},C.onPointerLeave=R=>{!n&&R.currentTarget.contains(R.target)&&w(R,R.pointerType)}):(C.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},C.onMouseEnter=R=>{!a.ignoreEmulatedMouseEvents&&!Z9&&g(R,\"mouse\"),a.ignoreEmulatedMouseEvents=!1},C.onMouseLeave=R=>{!n&&R.currentTarget.contains(R.target)&&w(R,\"mouse\")}),{hoverProps:C,triggerHoverEnd:w}},[t,r,i,n,a]);return(0,qg.useEffect)(()=>{n&&p({currentTarget:a.target},a.pointerType)},[n]),{hoverProps:h,isHovered:o}}var Q9=xe(ze(),1);function jZ(e){let{ref:t,onInteractOutside:r,isDisabled:i,onInteractOutsideStart:n}=e,o=(0,Q9.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),s=Bd(h=>{r&&K9(h,t)&&(n&&n(h),o.current.isPointerDown=!0)}),a=Bd(h=>{r&&r(h)});(0,Q9.useEffect)(()=>{let h=o.current;if(i)return;let p=t.current,g=qs(p);if(typeof PointerEvent<\"u\"){let w=C=>{h.isPointerDown&&K9(C,t)&&a(C),h.isPointerDown=!1};return g.addEventListener(\"pointerdown\",s,!0),g.addEventListener(\"pointerup\",w,!0),()=>{g.removeEventListener(\"pointerdown\",s,!0),g.removeEventListener(\"pointerup\",w,!0)}}else{let w=R=>{h.ignoreEmulatedMouseEvents?h.ignoreEmulatedMouseEvents=!1:h.isPointerDown&&K9(R,t)&&a(R),h.isPointerDown=!1},C=R=>{h.ignoreEmulatedMouseEvents=!0,h.isPointerDown&&K9(R,t)&&a(R),h.isPointerDown=!1};return g.addEventListener(\"mousedown\",s,!0),g.addEventListener(\"mouseup\",w,!0),g.addEventListener(\"touchstart\",s,!0),g.addEventListener(\"touchend\",C,!0),()=>{g.removeEventListener(\"mousedown\",s,!0),g.removeEventListener(\"mouseup\",w,!0),g.removeEventListener(\"touchstart\",s,!0),g.removeEventListener(\"touchend\",C,!0)}}},[t,i,s,a])}function K9(e,t){if(e.button>0)return!1;if(e.target){let r=e.target.ownerDocument;if(!r||!r.documentElement.contains(e.target)||e.target.closest(\"[data-react-aria-top-layer]\"))return!1}return t.current&&!t.current.contains(e.target)}function $Z(e){if(!e)return;let t=!0;return r=>{let i={...r,preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){console.error(\"stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.\")},continuePropagation(){t=!1}};e(i),t&&r.stopPropagation()}}function GZ(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:$Z(e.onKeyDown),onKeyUp:$Z(e.onKeyUp)}}}function m_t(e){let t=qs(e);if(UC()===\"virtual\"){let r=t.activeElement;LC(()=>{t.activeElement===r&&e.isConnected&&Jf(e)})}else Jf(e)}var $C=xe(ze(),1);var nHt=null;var qZ=[\"input:not([disabled]):not([type=hidden])\",\"select:not([disabled])\",\"textarea:not([disabled])\",\"button:not([disabled])\",\"a[href]\",\"area[href]\",\"summary\",\"iframe\",\"object\",\"embed\",\"audio[controls]\",\"video[controls]\",\"[contenteditable]\"],pVe=qZ.join(\":not([hidden]),\")+\",[tabindex]:not([disabled]):not([hidden])\";qZ.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');var mVe=qZ.join(':not([hidden]):not([tabindex=\"-1\"]),');function A_t(e,t){return!e||!t?!1:t.some(r=>r.contains(e))}function oHt(e,t=null){if(e instanceof Element&&e.closest(\"[data-react-aria-top-layer]\"))return!0;for(let{scopeRef:r}of g_t.traverse(g_t.getTreeNode(t)))if(r&&A_t(e,r.current))return!0;return!1}function HZ(e){return oHt(e,nHt)}var WZ=class e{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,i){let n=this.fastMap.get(r??null);if(!n)return;let o=new J9({scopeRef:t});n.addChild(o),o.parent=n,this.fastMap.set(t,o),i&&(o.nodeToRestore=i)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let i=r.parent;for(let o of this.traverse())o!==r&&r.nodeToRestore&&o.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&A_t(o.nodeToRestore,r.scopeRef.current)&&(o.nodeToRestore=r.nodeToRestore);let n=r.children;i&&(i.removeChild(r),n.size>0&&n.forEach(o=>i&&i.addChild(o))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var t;let r=new e;var i;for(let n of this.traverse())r.addTreeNode(n.scopeRef,(i=(t=n.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&i!==void 0?i:null,n.nodeToRestore);return r}constructor(){this.fastMap=new Map,this.root=new J9({scopeRef:null}),this.fastMap.set(null,this.root)}},J9=class{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}},g_t=new WZ;var C1=xe(ze(),1);function YZ(e={}){let{autoFocus:t=!1,isTextInput:r,within:i}=e,n=(0,C1.useRef)({isFocused:!1,isFocusVisible:t||u4()}),[o,s]=(0,C1.useState)(!1),[a,h]=(0,C1.useState)(()=>n.current.isFocused&&n.current.isFocusVisible),p=(0,C1.useCallback)(()=>h(n.current.isFocused&&n.current.isFocusVisible),[]),g=(0,C1.useCallback)(R=>{n.current.isFocused=R,s(R),p()},[p]);zZ(R=>{n.current.isFocusVisible=R,p()},[],{isTextInput:r});let{focusProps:w}=NC({isDisabled:i,onFocusChange:g}),{focusWithinProps:C}=jC({isDisabled:!i,onFocusWithinChange:g});return{isFocused:o,isFocusVisible:a,focusProps:i?C:w}}var I1=xe(ze(),1);var sHt=I1.default.createContext(null);function aHt(e){let t=(0,I1.useContext)(sHt)||{};BC(t,e);let{ref:r,...i}=t;return i}function GC(e,t){let{focusProps:r}=NC(e),{keyboardProps:i}=GZ(e),n=ns(r,i),o=aHt(t),s=e.isDisabled?{}:o,a=(0,I1.useRef)(e.autoFocus);return(0,I1.useEffect)(()=>{a.current&&t.current&&m_t(t.current),a.current=!1},[t]),{focusableProps:ns({...n,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},s)}}var y_t=xe(ze(),1);var Hg=[];function XZ(e,t){let{onClose:r,shouldCloseOnBlur:i,isOpen:n,isDismissable:o=!1,isKeyboardDismissDisabled:s=!1,shouldCloseOnInteractOutside:a}=e;(0,y_t.useEffect)(()=>(n&&Hg.push(t),()=>{let z=Hg.indexOf(t);z>=0&&Hg.splice(z,1)}),[n,t]);let h=()=>{Hg[Hg.length-1]===t&&r&&r()},p=z=>{(!a||a(z.target))&&Hg[Hg.length-1]===t&&(z.stopPropagation(),z.preventDefault())},g=z=>{(!a||a(z.target))&&(Hg[Hg.length-1]===t&&(z.stopPropagation(),z.preventDefault()),h())},w=z=>{z.key===\"Escape\"&&!s&&!z.nativeEvent.isComposing&&(z.stopPropagation(),z.preventDefault(),h())};jZ({ref:t,onInteractOutside:o&&n?g:void 0,onInteractOutsideStart:p});let{focusWithinProps:C}=jC({isDisabled:!i,onBlurWithin:z=>{!z.relatedTarget||HZ(z.relatedTarget)||(!a||a(z.relatedTarget))&&r?.()}}),R=z=>{z.target===z.currentTarget&&z.preventDefault()};return{overlayProps:{onKeyDown:w,...C},underlayProps:{onPointerDown:R}}}var nc=xe(ze(),1),__t=xe(t5(),1);var ZZ=nc.default.createContext(null);function v_t(e){let{children:t}=e,r=(0,nc.useContext)(ZZ),[i,n]=(0,nc.useState)(0),o=(0,nc.useMemo)(()=>({parent:r,modalCount:i,addModal(){n(s=>s+1),r&&r.addModal()},removeModal(){n(s=>s-1),r&&r.removeModal()}}),[r,i]);return nc.default.createElement(ZZ.Provider,{value:o},t)}function b_t(){let e=(0,nc.useContext)(ZZ);return{modalProviderProps:{\"aria-hidden\":e&&e.modalCount>0?!0:void 0}}}function lHt(e){let{modalProviderProps:t}=b_t();return nc.default.createElement(\"div\",{\"data-overlay-container\":!0,...e,...t})}function tB(e){return nc.default.createElement(v_t,null,nc.default.createElement(lHt,e))}function eB(e){let t=Q3(),{portalContainer:r=t?null:document.body,...i}=e;if(nc.default.useEffect(()=>{if(r?.closest(\"[data-overlay-container]\"))throw new Error(\"An OverlayContainer must not be inside another container. Please change the portalContainer prop.\")},[r]),!r)return null;let n=nc.default.createElement(tB,i);return __t.default.createPortal(n,r)}var fwt=xe(ze(),1);N6();var B4=xe(fo(),1),oJ=({children:e,navigate:t,disableAnimation:r,useHref:i,disableRipple:n=!1,skipFramerMotionAnimations:o=r,reducedMotion:s=\"never\",validationBehavior:a,locale:h=\"en-US\",defaultDates:p,createCalendar:g,...w})=>{let C=e;t&&(C=(0,B4.jsx)(gZ,{navigate:t,useHref:i,children:C}));let R=(0,fwt.useMemo)(()=>(r&&o&&(nl.skipAnimations=!0),{createCalendar:g,defaultDates:p,disableAnimation:r,disableRipple:n,validationBehavior:a}),[g,p?.maxDate,p?.minDate,r,n,a]);return(0,B4.jsx)(oZ,{value:R,children:(0,B4.jsx)(uZ,{locale:h,children:(0,B4.jsx)(XQ,{reducedMotion:s,children:(0,B4.jsx)(tB,{...w,children:C})})})})};var pwt=xe(ze(),1);function j0(e){return(0,pwt.forwardRef)(e)}var W1=(e,t,r=!0)=>{if(!t)return[e,{}];let i=t.reduce((n,o)=>o in e?{...n,[o]:e[o]}:n,{});return r?[Object.keys(e).filter(o=>!t.includes(o)).reduce((o,s)=>({...o,[s]:e[s]}),{}),i]:[e,i]};var DF=[\"small\",\"medium\",\"large\"],sJ={theme:{opacity:[\"disabled\"],spacing:[\"divider\"],borderWidth:DF,borderRadius:DF},classGroups:{shadow:[{shadow:DF}],\"font-size\":[{text:[\"tiny\",...DF]}],\"bg-image\":[\"bg-stripe-gradient-default\",\"bg-stripe-gradient-primary\",\"bg-stripe-gradient-secondary\",\"bg-stripe-gradient-success\",\"bg-stripe-gradient-warning\",\"bg-stripe-gradient-danger\"]}};var aJ=e=>typeof e==\"boolean\"?`${e}`:e===0?\"0\":e,Su=e=>!e||typeof e!=\"object\"||Object.keys(e).length===0,mwt=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function gwt(e,t){e.forEach(function(r){Array.isArray(r)?gwt(r,t):t.push(r)})}function lJ(e){let t=[];return gwt(e,t),t}var cJ=(...e)=>lJ(e).filter(Boolean),uJ=(e,t)=>{let r={},i=Object.keys(e),n=Object.keys(t);for(let o of i)if(n.includes(o)){let s=e[o],a=t[o];typeof s==\"object\"&&typeof a==\"object\"?r[o]=uJ(s,a):Array.isArray(s)||Array.isArray(a)?r[o]=cJ(a,s):r[o]=a+\" \"+s}else r[o]=e[o];for(let o of n)i.includes(o)||(r[o]=t[o]);return r},hJ=e=>!e||typeof e!=\"string\"?e:e.replace(/\\s+/g,\" \").trim();function Awt(){for(var e=0,t,r,i=\"\";e<arguments.length;)(t=arguments[e++])&&(r=ywt(t))&&(i&&(i+=\" \"),i+=r);return i}function ywt(e){if(typeof e==\"string\")return e;for(var t,r=\"\",i=0;i<e.length;i++)e[i]&&(t=ywt(e[i]))&&(r&&(r+=\" \"),r+=t);return r}var fJ=\"-\";function bwt(e){var t=oXt(e),r=e.conflictingClassGroups,i=e.conflictingClassGroupModifiers,n=i===void 0?{}:i;function o(a){var h=a.split(fJ);return h[0]===\"\"&&h.length!==1&&h.shift(),xwt(h,t)||nXt(a)}function s(a,h){var p=r[a]||[];return h&&n[a]?[].concat(p,n[a]):p}return{getClassGroupId:o,getConflictingClassGroupIds:s}}function xwt(e,t){if(e.length===0)return t.classGroupId;var r=e[0],i=t.nextPart.get(r),n=i?xwt(e.slice(1),i):void 0;if(n)return n;if(t.validators.length!==0){var o=e.join(fJ);return t.validators.find(function(s){var a=s.validator;return a(o)})?.classGroupId}}var _wt=/^\\[(.+)\\]$/;function nXt(e){if(_wt.test(e)){var t=_wt.exec(e)[1],r=t?.substring(0,t.indexOf(\":\"));if(r)return\"arbitrary..\"+r}}function oXt(e){var t=e.theme,r=e.prefix,i={nextPart:new Map,validators:[]},n=aXt(Object.entries(e.classGroups),r);return n.forEach(function(o){var s=o[0],a=o[1];dJ(a,i,s,t)}),i}function dJ(e,t,r,i){e.forEach(function(n){if(typeof n==\"string\"){var o=n===\"\"?t:vwt(t,n);o.classGroupId=r;return}if(typeof n==\"function\"){if(sXt(n)){dJ(n(i),t,r,i);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(function(s){var a=s[0],h=s[1];dJ(h,vwt(t,a),r,i)})})}function vwt(e,t){var r=e;return t.split(fJ).forEach(function(i){r.nextPart.has(i)||r.nextPart.set(i,{nextPart:new Map,validators:[]}),r=r.nextPart.get(i)}),r}function sXt(e){return e.isThemeGetter}function aXt(e,t){return t?e.map(function(r){var i=r[0],n=r[1],o=n.map(function(s){return typeof s==\"string\"?t+s:typeof s==\"object\"?Object.fromEntries(Object.entries(s).map(function(a){var h=a[0],p=a[1];return[t+h,p]})):s});return[i,o]}):e}function wwt(e){if(e<1)return{get:function(){},set:function(){}};var t=0,r=new Map,i=new Map;function n(o,s){r.set(o,s),t++,t>e&&(t=0,i=r,r=new Map)}return{get:function(s){var a=r.get(s);if(a!==void 0)return a;if((a=i.get(s))!==void 0)return n(s,a),a},set:function(s,a){r.has(s)?r.set(s,a):n(s,a)}}}var pJ=\"!\";function Twt(e){var t=e.separator||\":\",r=t.length===1,i=t[0],n=t.length;return function(s){for(var a=[],h=0,p=0,g,w=0;w<s.length;w++){var C=s[w];if(h===0){if(C===i&&(r||s.slice(w,w+n)===t)){a.push(s.slice(p,w)),p=w+n;continue}if(C===\"/\"){g=w;continue}}C===\"[\"?h++:C===\"]\"&&h--}var R=a.length===0?s:s.substring(p),z=R.startsWith(pJ),W=z?R.substring(1):R,Y=g&&g>p?g-p:void 0;return{modifiers:a,hasImportantModifier:z,baseClassName:W,maybePostfixModifierPosition:Y}}}function Swt(e){if(e.length<=1)return e;var t=[],r=[];return e.forEach(function(i){var n=i[0]===\"[\";n?(t.push.apply(t,r.sort().concat([i])),r=[]):r.push(i)}),t.push.apply(t,r.sort()),t}function Mwt(e){return{cache:wwt(e.cacheSize),splitModifiers:Twt(e),...bwt(e)}}var lXt=/\\s+/;function Ewt(e,t){var r=t.splitModifiers,i=t.getClassGroupId,n=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(lXt).map(function(s){var a=r(s),h=a.modifiers,p=a.hasImportantModifier,g=a.baseClassName,w=a.maybePostfixModifierPosition,C=i(w?g.substring(0,w):g),R=!!w;if(!C){if(!w)return{isTailwindClass:!1,originalClassName:s};if(C=i(g),!C)return{isTailwindClass:!1,originalClassName:s};R=!1}var z=Swt(h).join(\":\"),W=p?z+pJ:z;return{isTailwindClass:!0,modifierId:W,classGroupId:C,originalClassName:s,hasPostfixModifier:R}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var a=s.modifierId,h=s.classGroupId,p=s.hasPostfixModifier,g=a+h;return o.has(g)?!1:(o.add(g),n(h,p).forEach(function(w){return o.add(a+w)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(\" \")}function z6(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i,n,o,s=a;function a(p){var g=t[0],w=t.slice(1),C=w.reduce(function(R,z){return z(R)},g());return i=Mwt(C),n=i.cache.get,o=i.cache.set,s=h,h(p)}function h(p){var g=n(p);if(g)return g;var w=Ewt(p,i);return o(p,w),w}return function(){return s(Awt.apply(null,arguments))}}function Eo(e){var t=function(i){return i[e]||[]};return t.isThemeGetter=!0,t}var Cwt=/^\\[(?:([a-z-]+):)?(.+)\\]$/i,cXt=/^\\d+\\/\\d+$/,uXt=new Set([\"px\",\"full\",\"screen\"]),hXt=/^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/,dXt=/\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/,fXt=/^-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;function zd(e){return q1(e)||uXt.has(e)||cXt.test(e)||OF(e)}function OF(e){return Qb(e,\"length\",pXt)}function Iwt(e){return Qb(e,\"size\",Lwt)}function kwt(e){return Qb(e,\"position\",Lwt)}function Rwt(e){return Qb(e,\"url\",mXt)}function U6(e){return Qb(e,\"number\",q1)}function q1(e){return!Number.isNaN(Number(e))}function Dwt(e){return e.endsWith(\"%\")&&q1(e.slice(0,-1))}function F4(e){return Pwt(e)||Qb(e,\"number\",Pwt)}function qi(e){return Cwt.test(e)}function N4(){return!0}function nA(e){return hXt.test(e)}function Owt(e){return Qb(e,\"\",gXt)}function Qb(e,t,r){var i=Cwt.exec(e);return i?i[1]?i[1]===t:r(i[2]):!1}function pXt(e){return dXt.test(e)}function Lwt(){return!1}function mXt(e){return e.startsWith(\"url(\")}function Pwt(e){return Number.isInteger(Number(e))}function gXt(e){return fXt.test(e)}function V6(){var e=Eo(\"colors\"),t=Eo(\"spacing\"),r=Eo(\"blur\"),i=Eo(\"brightness\"),n=Eo(\"borderColor\"),o=Eo(\"borderRadius\"),s=Eo(\"borderSpacing\"),a=Eo(\"borderWidth\"),h=Eo(\"contrast\"),p=Eo(\"grayscale\"),g=Eo(\"hueRotate\"),w=Eo(\"invert\"),C=Eo(\"gap\"),R=Eo(\"gradientColorStops\"),z=Eo(\"gradientColorStopPositions\"),W=Eo(\"inset\"),Y=Eo(\"margin\"),H=Eo(\"opacity\"),Q=Eo(\"padding\"),tt=Eo(\"saturate\"),rt=Eo(\"scale\"),at=Eo(\"sepia\"),et=Eo(\"skew\"),lt=Eo(\"space\"),J=Eo(\"translate\"),ft=function(){return[\"auto\",\"contain\",\"none\"]},dt=function(){return[\"auto\",\"hidden\",\"clip\",\"visible\",\"scroll\"]},Mt=function(){return[\"auto\",qi,t]},Ft=function(){return[qi,t]},Nt=function(){return[\"\",zd]},$t=function(){return[\"auto\",q1,qi]},Yt=function(){return[\"bottom\",\"center\",\"left\",\"left-bottom\",\"left-top\",\"right\",\"right-bottom\",\"right-top\",\"top\"]},_e=function(){return[\"solid\",\"dashed\",\"dotted\",\"double\",\"none\"]},Pe=function(){return[\"normal\",\"multiply\",\"screen\",\"overlay\",\"darken\",\"lighten\",\"color-dodge\",\"color-burn\",\"hard-light\",\"soft-light\",\"difference\",\"exclusion\",\"hue\",\"saturation\",\"color\",\"luminosity\",\"plus-lighter\"]},we=function(){return[\"start\",\"end\",\"center\",\"between\",\"around\",\"evenly\",\"stretch\"]},Ue=function(){return[\"\",\"0\",qi]},lr=function(){return[\"auto\",\"avoid\",\"all\",\"avoid-page\",\"page\",\"left\",\"right\",\"column\"]},ee=function(){return[q1,U6]},Ce=function(){return[q1,qi]};return{cacheSize:500,theme:{colors:[N4],spacing:[zd],blur:[\"none\",\"\",nA,qi],brightness:ee(),borderColor:[e],borderRadius:[\"none\",\"\",\"full\",nA,qi],borderSpacing:Ft(),borderWidth:Nt(),contrast:ee(),grayscale:Ue(),hueRotate:Ce(),invert:Ue(),gap:Ft(),gradientColorStops:[e],gradientColorStopPositions:[Dwt,OF],inset:Mt(),margin:Mt(),opacity:ee(),padding:Ft(),saturate:ee(),scale:ee(),sepia:Ue(),skew:Ce(),space:Ft(),translate:Ft()},classGroups:{aspect:[{aspect:[\"auto\",\"square\",\"video\",qi]}],container:[\"container\"],columns:[{columns:[nA]}],\"break-after\":[{\"break-after\":lr()}],\"break-before\":[{\"break-before\":lr()}],\"break-inside\":[{\"break-inside\":[\"auto\",\"avoid\",\"avoid-page\",\"avoid-column\"]}],\"box-decoration\":[{\"box-decoration\":[\"slice\",\"clone\"]}],box:[{box:[\"border\",\"content\"]}],display:[\"block\",\"inline-block\",\"inline\",\"flex\",\"inline-flex\",\"table\",\"inline-table\",\"table-caption\",\"table-cell\",\"table-column\",\"table-column-group\",\"table-footer-group\",\"table-header-group\",\"table-row-group\",\"table-row\",\"flow-root\",\"grid\",\"inline-grid\",\"contents\",\"list-item\",\"hidden\"],float:[{float:[\"right\",\"left\",\"none\"]}],clear:[{clear:[\"left\",\"right\",\"both\",\"none\"]}],isolation:[\"isolate\",\"isolation-auto\"],\"object-fit\":[{object:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"]}],\"object-position\":[{object:[].concat(Yt(),[qi])}],overflow:[{overflow:dt()}],\"overflow-x\":[{\"overflow-x\":dt()}],\"overflow-y\":[{\"overflow-y\":dt()}],overscroll:[{overscroll:ft()}],\"overscroll-x\":[{\"overscroll-x\":ft()}],\"overscroll-y\":[{\"overscroll-y\":ft()}],position:[\"static\",\"fixed\",\"absolute\",\"relative\",\"sticky\"],inset:[{inset:[W]}],\"inset-x\":[{\"inset-x\":[W]}],\"inset-y\":[{\"inset-y\":[W]}],start:[{start:[W]}],end:[{end:[W]}],top:[{top:[W]}],right:[{right:[W]}],bottom:[{bottom:[W]}],left:[{left:[W]}],visibility:[\"visible\",\"invisible\",\"collapse\"],z:[{z:[\"auto\",F4]}],basis:[{basis:Mt()}],\"flex-direction\":[{flex:[\"row\",\"row-reverse\",\"col\",\"col-reverse\"]}],\"flex-wrap\":[{flex:[\"wrap\",\"wrap-reverse\",\"nowrap\"]}],flex:[{flex:[\"1\",\"auto\",\"initial\",\"none\",qi]}],grow:[{grow:Ue()}],shrink:[{shrink:Ue()}],order:[{order:[\"first\",\"last\",\"none\",F4]}],\"grid-cols\":[{\"grid-cols\":[N4]}],\"col-start-end\":[{col:[\"auto\",{span:[\"full\",F4]},qi]}],\"col-start\":[{\"col-start\":$t()}],\"col-end\":[{\"col-end\":$t()}],\"grid-rows\":[{\"grid-rows\":[N4]}],\"row-start-end\":[{row:[\"auto\",{span:[F4]},qi]}],\"row-start\":[{\"row-start\":$t()}],\"row-end\":[{\"row-end\":$t()}],\"grid-flow\":[{\"grid-flow\":[\"row\",\"col\",\"dense\",\"row-dense\",\"col-dense\"]}],\"auto-cols\":[{\"auto-cols\":[\"auto\",\"min\",\"max\",\"fr\",qi]}],\"auto-rows\":[{\"auto-rows\":[\"auto\",\"min\",\"max\",\"fr\",qi]}],gap:[{gap:[C]}],\"gap-x\":[{\"gap-x\":[C]}],\"gap-y\":[{\"gap-y\":[C]}],\"justify-content\":[{justify:[\"normal\"].concat(we())}],\"justify-items\":[{\"justify-items\":[\"start\",\"end\",\"center\",\"stretch\"]}],\"justify-self\":[{\"justify-self\":[\"auto\",\"start\",\"end\",\"center\",\"stretch\"]}],\"align-content\":[{content:[\"normal\"].concat(we(),[\"baseline\"])}],\"align-items\":[{items:[\"start\",\"end\",\"center\",\"baseline\",\"stretch\"]}],\"align-self\":[{self:[\"auto\",\"start\",\"end\",\"center\",\"stretch\",\"baseline\"]}],\"place-content\":[{\"place-content\":[].concat(we(),[\"baseline\"])}],\"place-items\":[{\"place-items\":[\"start\",\"end\",\"center\",\"baseline\",\"stretch\"]}],\"place-self\":[{\"place-self\":[\"auto\",\"start\",\"end\",\"center\",\"stretch\"]}],p:[{p:[Q]}],px:[{px:[Q]}],py:[{py:[Q]}],ps:[{ps:[Q]}],pe:[{pe:[Q]}],pt:[{pt:[Q]}],pr:[{pr:[Q]}],pb:[{pb:[Q]}],pl:[{pl:[Q]}],m:[{m:[Y]}],mx:[{mx:[Y]}],my:[{my:[Y]}],ms:[{ms:[Y]}],me:[{me:[Y]}],mt:[{mt:[Y]}],mr:[{mr:[Y]}],mb:[{mb:[Y]}],ml:[{ml:[Y]}],\"space-x\":[{\"space-x\":[lt]}],\"space-x-reverse\":[\"space-x-reverse\"],\"space-y\":[{\"space-y\":[lt]}],\"space-y-reverse\":[\"space-y-reverse\"],w:[{w:[\"auto\",\"min\",\"max\",\"fit\",qi,t]}],\"min-w\":[{\"min-w\":[\"min\",\"max\",\"fit\",qi,zd]}],\"max-w\":[{\"max-w\":[\"0\",\"none\",\"full\",\"min\",\"max\",\"fit\",\"prose\",{screen:[nA]},nA,qi]}],h:[{h:[qi,t,\"auto\",\"min\",\"max\",\"fit\"]}],\"min-h\":[{\"min-h\":[\"min\",\"max\",\"fit\",qi,zd]}],\"max-h\":[{\"max-h\":[qi,t,\"min\",\"max\",\"fit\"]}],\"font-size\":[{text:[\"base\",nA,OF]}],\"font-smoothing\":[\"antialiased\",\"subpixel-antialiased\"],\"font-style\":[\"italic\",\"not-italic\"],\"font-weight\":[{font:[\"thin\",\"extralight\",\"light\",\"normal\",\"medium\",\"semibold\",\"bold\",\"extrabold\",\"black\",U6]}],\"font-family\":[{font:[N4]}],\"fvn-normal\":[\"normal-nums\"],\"fvn-ordinal\":[\"ordinal\"],\"fvn-slashed-zero\":[\"slashed-zero\"],\"fvn-figure\":[\"lining-nums\",\"oldstyle-nums\"],\"fvn-spacing\":[\"proportional-nums\",\"tabular-nums\"],\"fvn-fraction\":[\"diagonal-fractions\",\"stacked-fractons\"],tracking:[{tracking:[\"tighter\",\"tight\",\"normal\",\"wide\",\"wider\",\"widest\",qi]}],\"line-clamp\":[{\"line-clamp\":[\"none\",q1,U6]}],leading:[{leading:[\"none\",\"tight\",\"snug\",\"normal\",\"relaxed\",\"loose\",qi,zd]}],\"list-image\":[{\"list-image\":[\"none\",qi]}],\"list-style-type\":[{list:[\"none\",\"disc\",\"decimal\",qi]}],\"list-style-position\":[{list:[\"inside\",\"outside\"]}],\"placeholder-color\":[{placeholder:[e]}],\"placeholder-opacity\":[{\"placeholder-opacity\":[H]}],\"text-alignment\":[{text:[\"left\",\"center\",\"right\",\"justify\",\"start\",\"end\"]}],\"text-color\":[{text:[e]}],\"text-opacity\":[{\"text-opacity\":[H]}],\"text-decoration\":[\"underline\",\"overline\",\"line-through\",\"no-underline\"],\"text-decoration-style\":[{decoration:[].concat(_e(),[\"wavy\"])}],\"text-decoration-thickness\":[{decoration:[\"auto\",\"from-font\",zd]}],\"underline-offset\":[{\"underline-offset\":[\"auto\",qi,zd]}],\"text-decoration-color\":[{decoration:[e]}],\"text-transform\":[\"uppercase\",\"lowercase\",\"capitalize\",\"normal-case\"],\"text-overflow\":[\"truncate\",\"text-ellipsis\",\"text-clip\"],indent:[{indent:Ft()}],\"vertical-align\":[{align:[\"baseline\",\"top\",\"middle\",\"bottom\",\"text-top\",\"text-bottom\",\"sub\",\"super\",qi]}],whitespace:[{whitespace:[\"normal\",\"nowrap\",\"pre\",\"pre-line\",\"pre-wrap\",\"break-spaces\"]}],break:[{break:[\"normal\",\"words\",\"all\",\"keep\"]}],hyphens:[{hyphens:[\"none\",\"manual\",\"auto\"]}],content:[{content:[\"none\",qi]}],\"bg-attachment\":[{bg:[\"fixed\",\"local\",\"scroll\"]}],\"bg-clip\":[{\"bg-clip\":[\"border\",\"padding\",\"content\",\"text\"]}],\"bg-opacity\":[{\"bg-opacity\":[H]}],\"bg-origin\":[{\"bg-origin\":[\"border\",\"padding\",\"content\"]}],\"bg-position\":[{bg:[].concat(Yt(),[kwt])}],\"bg-repeat\":[{bg:[\"no-repeat\",{repeat:[\"\",\"x\",\"y\",\"round\",\"space\"]}]}],\"bg-size\":[{bg:[\"auto\",\"cover\",\"contain\",Iwt]}],\"bg-image\":[{bg:[\"none\",{\"gradient-to\":[\"t\",\"tr\",\"r\",\"br\",\"b\",\"bl\",\"l\",\"tl\"]},Rwt]}],\"bg-color\":[{bg:[e]}],\"gradient-from-pos\":[{from:[z]}],\"gradient-via-pos\":[{via:[z]}],\"gradient-to-pos\":[{to:[z]}],\"gradient-from\":[{from:[R]}],\"gradient-via\":[{via:[R]}],\"gradient-to\":[{to:[R]}],rounded:[{rounded:[o]}],\"rounded-s\":[{\"rounded-s\":[o]}],\"rounded-e\":[{\"rounded-e\":[o]}],\"rounded-t\":[{\"rounded-t\":[o]}],\"rounded-r\":[{\"rounded-r\":[o]}],\"rounded-b\":[{\"rounded-b\":[o]}],\"rounded-l\":[{\"rounded-l\":[o]}],\"rounded-ss\":[{\"rounded-ss\":[o]}],\"rounded-se\":[{\"rounded-se\":[o]}],\"rounded-ee\":[{\"rounded-ee\":[o]}],\"rounded-es\":[{\"rounded-es\":[o]}],\"rounded-tl\":[{\"rounded-tl\":[o]}],\"rounded-tr\":[{\"rounded-tr\":[o]}],\"rounded-br\":[{\"rounded-br\":[o]}],\"rounded-bl\":[{\"rounded-bl\":[o]}],\"border-w\":[{border:[a]}],\"border-w-x\":[{\"border-x\":[a]}],\"border-w-y\":[{\"border-y\":[a]}],\"border-w-s\":[{\"border-s\":[a]}],\"border-w-e\":[{\"border-e\":[a]}],\"border-w-t\":[{\"border-t\":[a]}],\"border-w-r\":[{\"border-r\":[a]}],\"border-w-b\":[{\"border-b\":[a]}],\"border-w-l\":[{\"border-l\":[a]}],\"border-opacity\":[{\"border-opacity\":[H]}],\"border-style\":[{border:[].concat(_e(),[\"hidden\"])}],\"divide-x\":[{\"divide-x\":[a]}],\"divide-x-reverse\":[\"divide-x-reverse\"],\"divide-y\":[{\"divide-y\":[a]}],\"divide-y-reverse\":[\"divide-y-reverse\"],\"divide-opacity\":[{\"divide-opacity\":[H]}],\"divide-style\":[{divide:_e()}],\"border-color\":[{border:[n]}],\"border-color-x\":[{\"border-x\":[n]}],\"border-color-y\":[{\"border-y\":[n]}],\"border-color-t\":[{\"border-t\":[n]}],\"border-color-r\":[{\"border-r\":[n]}],\"border-color-b\":[{\"border-b\":[n]}],\"border-color-l\":[{\"border-l\":[n]}],\"divide-color\":[{divide:[n]}],\"outline-style\":[{outline:[\"\"].concat(_e())}],\"outline-offset\":[{\"outline-offset\":[qi,zd]}],\"outline-w\":[{outline:[zd]}],\"outline-color\":[{outline:[e]}],\"ring-w\":[{ring:Nt()}],\"ring-w-inset\":[\"ring-inset\"],\"ring-color\":[{ring:[e]}],\"ring-opacity\":[{\"ring-opacity\":[H]}],\"ring-offset-w\":[{\"ring-offset\":[zd]}],\"ring-offset-color\":[{\"ring-offset\":[e]}],shadow:[{shadow:[\"\",\"inner\",\"none\",nA,Owt]}],\"shadow-color\":[{shadow:[N4]}],opacity:[{opacity:[H]}],\"mix-blend\":[{\"mix-blend\":Pe()}],\"bg-blend\":[{\"bg-blend\":Pe()}],filter:[{filter:[\"\",\"none\"]}],blur:[{blur:[r]}],brightness:[{brightness:[i]}],contrast:[{contrast:[h]}],\"drop-shadow\":[{\"drop-shadow\":[\"\",\"none\",nA,qi]}],grayscale:[{grayscale:[p]}],\"hue-rotate\":[{\"hue-rotate\":[g]}],invert:[{invert:[w]}],saturate:[{saturate:[tt]}],sepia:[{sepia:[at]}],\"backdrop-filter\":[{\"backdrop-filter\":[\"\",\"none\"]}],\"backdrop-blur\":[{\"backdrop-blur\":[r]}],\"backdrop-brightness\":[{\"backdrop-brightness\":[i]}],\"backdrop-contrast\":[{\"backdrop-contrast\":[h]}],\"backdrop-grayscale\":[{\"backdrop-grayscale\":[p]}],\"backdrop-hue-rotate\":[{\"backdrop-hue-rotate\":[g]}],\"backdrop-invert\":[{\"backdrop-invert\":[w]}],\"backdrop-opacity\":[{\"backdrop-opacity\":[H]}],\"backdrop-saturate\":[{\"backdrop-saturate\":[tt]}],\"backdrop-sepia\":[{\"backdrop-sepia\":[at]}],\"border-collapse\":[{border:[\"collapse\",\"separate\"]}],\"border-spacing\":[{\"border-spacing\":[s]}],\"border-spacing-x\":[{\"border-spacing-x\":[s]}],\"border-spacing-y\":[{\"border-spacing-y\":[s]}],\"table-layout\":[{table:[\"auto\",\"fixed\"]}],caption:[{caption:[\"top\",\"bottom\"]}],transition:[{transition:[\"none\",\"all\",\"\",\"colors\",\"opacity\",\"shadow\",\"transform\",qi]}],duration:[{duration:Ce()}],ease:[{ease:[\"linear\",\"in\",\"out\",\"in-out\",qi]}],delay:[{delay:Ce()}],animate:[{animate:[\"none\",\"spin\",\"ping\",\"pulse\",\"bounce\",qi]}],transform:[{transform:[\"\",\"gpu\",\"none\"]}],scale:[{scale:[rt]}],\"scale-x\":[{\"scale-x\":[rt]}],\"scale-y\":[{\"scale-y\":[rt]}],rotate:[{rotate:[F4,qi]}],\"translate-x\":[{\"translate-x\":[J]}],\"translate-y\":[{\"translate-y\":[J]}],\"skew-x\":[{\"skew-x\":[et]}],\"skew-y\":[{\"skew-y\":[et]}],\"transform-origin\":[{origin:[\"center\",\"top\",\"top-right\",\"right\",\"bottom-right\",\"bottom\",\"bottom-left\",\"left\",\"top-left\",qi]}],accent:[{accent:[\"auto\",e]}],appearance:[\"appearance-none\"],cursor:[{cursor:[\"auto\",\"default\",\"pointer\",\"wait\",\"text\",\"move\",\"help\",\"not-allowed\",\"none\",\"context-menu\",\"progress\",\"cell\",\"crosshair\",\"vertical-text\",\"alias\",\"copy\",\"no-drop\",\"grab\",\"grabbing\",\"all-scroll\",\"col-resize\",\"row-resize\",\"n-resize\",\"e-resize\",\"s-resize\",\"w-resize\",\"ne-resize\",\"nw-resize\",\"se-resize\",\"sw-resize\",\"ew-resize\",\"ns-resize\",\"nesw-resize\",\"nwse-resize\",\"zoom-in\",\"zoom-out\",qi]}],\"caret-color\":[{caret:[e]}],\"pointer-events\":[{\"pointer-events\":[\"none\",\"auto\"]}],resize:[{resize:[\"none\",\"y\",\"x\",\"\"]}],\"scroll-behavior\":[{scroll:[\"auto\",\"smooth\"]}],\"scroll-m\":[{\"scroll-m\":Ft()}],\"scroll-mx\":[{\"scroll-mx\":Ft()}],\"scroll-my\":[{\"scroll-my\":Ft()}],\"scroll-ms\":[{\"scroll-ms\":Ft()}],\"scroll-me\":[{\"scroll-me\":Ft()}],\"scroll-mt\":[{\"scroll-mt\":Ft()}],\"scroll-mr\":[{\"scroll-mr\":Ft()}],\"scroll-mb\":[{\"scroll-mb\":Ft()}],\"scroll-ml\":[{\"scroll-ml\":Ft()}],\"scroll-p\":[{\"scroll-p\":Ft()}],\"scroll-px\":[{\"scroll-px\":Ft()}],\"scroll-py\":[{\"scroll-py\":Ft()}],\"scroll-ps\":[{\"scroll-ps\":Ft()}],\"scroll-pe\":[{\"scroll-pe\":Ft()}],\"scroll-pt\":[{\"scroll-pt\":Ft()}],\"scroll-pr\":[{\"scroll-pr\":Ft()}],\"scroll-pb\":[{\"scroll-pb\":Ft()}],\"scroll-pl\":[{\"scroll-pl\":Ft()}],\"snap-align\":[{snap:[\"start\",\"end\",\"center\",\"align-none\"]}],\"snap-stop\":[{snap:[\"normal\",\"always\"]}],\"snap-type\":[{snap:[\"none\",\"x\",\"y\",\"both\"]}],\"snap-strictness\":[{snap:[\"mandatory\",\"proximity\"]}],touch:[{touch:[\"auto\",\"none\",\"pinch-zoom\",\"manipulation\",{pan:[\"x\",\"left\",\"right\",\"y\",\"up\",\"down\"]}]}],select:[{select:[\"none\",\"text\",\"all\",\"auto\"]}],\"will-change\":[{\"will-change\":[\"auto\",\"scroll\",\"contents\",\"transform\",qi]}],fill:[{fill:[e,\"none\"]}],\"stroke-w\":[{stroke:[zd,U6]}],stroke:[{stroke:[e,\"none\"]}],sr:[\"sr-only\",\"not-sr-only\"]},conflictingClassGroups:{overflow:[\"overflow-x\",\"overflow-y\"],overscroll:[\"overscroll-x\",\"overscroll-y\"],inset:[\"inset-x\",\"inset-y\",\"start\",\"end\",\"top\",\"right\",\"bottom\",\"left\"],\"inset-x\":[\"right\",\"left\"],\"inset-y\":[\"top\",\"bottom\"],flex:[\"basis\",\"grow\",\"shrink\"],gap:[\"gap-x\",\"gap-y\"],p:[\"px\",\"py\",\"ps\",\"pe\",\"pt\",\"pr\",\"pb\",\"pl\"],px:[\"pr\",\"pl\"],py:[\"pt\",\"pb\"],m:[\"mx\",\"my\",\"ms\",\"me\",\"mt\",\"mr\",\"mb\",\"ml\"],mx:[\"mr\",\"ml\"],my:[\"mt\",\"mb\"],\"font-size\":[\"leading\"],\"fvn-normal\":[\"fvn-ordinal\",\"fvn-slashed-zero\",\"fvn-figure\",\"fvn-spacing\",\"fvn-fraction\"],\"fvn-ordinal\":[\"fvn-normal\"],\"fvn-slashed-zero\":[\"fvn-normal\"],\"fvn-figure\":[\"fvn-normal\"],\"fvn-spacing\":[\"fvn-normal\"],\"fvn-fraction\":[\"fvn-normal\"],rounded:[\"rounded-s\",\"rounded-e\",\"rounded-t\",\"rounded-r\",\"rounded-b\",\"rounded-l\",\"rounded-ss\",\"rounded-se\",\"rounded-ee\",\"rounded-es\",\"rounded-tl\",\"rounded-tr\",\"rounded-br\",\"rounded-bl\"],\"rounded-s\":[\"rounded-ss\",\"rounded-es\"],\"rounded-e\":[\"rounded-se\",\"rounded-ee\"],\"rounded-t\":[\"rounded-tl\",\"rounded-tr\"],\"rounded-r\":[\"rounded-tr\",\"rounded-br\"],\"rounded-b\":[\"rounded-br\",\"rounded-bl\"],\"rounded-l\":[\"rounded-tl\",\"rounded-bl\"],\"border-spacing\":[\"border-spacing-x\",\"border-spacing-y\"],\"border-w\":[\"border-w-s\",\"border-w-e\",\"border-w-t\",\"border-w-r\",\"border-w-b\",\"border-w-l\"],\"border-w-x\":[\"border-w-r\",\"border-w-l\"],\"border-w-y\":[\"border-w-t\",\"border-w-b\"],\"border-color\":[\"border-color-t\",\"border-color-r\",\"border-color-b\",\"border-color-l\"],\"border-color-x\":[\"border-color-r\",\"border-color-l\"],\"border-color-y\":[\"border-color-t\",\"border-color-b\"],\"scroll-m\":[\"scroll-mx\",\"scroll-my\",\"scroll-ms\",\"scroll-me\",\"scroll-mt\",\"scroll-mr\",\"scroll-mb\",\"scroll-ml\"],\"scroll-mx\":[\"scroll-mr\",\"scroll-ml\"],\"scroll-my\":[\"scroll-mt\",\"scroll-mb\"],\"scroll-p\":[\"scroll-px\",\"scroll-py\",\"scroll-ps\",\"scroll-pe\",\"scroll-pt\",\"scroll-pr\",\"scroll-pb\",\"scroll-pl\"],\"scroll-px\":[\"scroll-pr\",\"scroll-pl\"],\"scroll-py\":[\"scroll-pt\",\"scroll-pb\"]},conflictingClassGroupModifiers:{\"font-size\":[\"leading\"]}}}function Bwt(e,t){for(var r in t)Fwt(e,r,t[r]);return e}var AXt=Object.prototype.hasOwnProperty,yXt=new Set([\"string\",\"number\",\"boolean\"]);function Fwt(e,t,r){if(!AXt.call(e,t)||yXt.has(typeof r)||r===null){e[t]=r;return}if(Array.isArray(r)&&Array.isArray(e[t])){e[t]=e[t].concat(r);return}if(typeof r==\"object\"&&typeof e[t]==\"object\"){if(e[t]===null){e[t]=r;return}for(var i in r)Fwt(e[t],i,r[i])}}function mJ(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return typeof e==\"function\"?z6.apply(void 0,[V6,e].concat(r)):z6.apply(void 0,[function(){return Bwt(V6(),e)}].concat(r))}var gJ=z6(V6);var _Xt={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},zwt=e=>e||void 0,$6=(...e)=>zwt(lJ(e).filter(Boolean).join(\" \")),AJ=null,LF={},yJ=!1,j6=(...e)=>t=>t.twMerge?((!AJ||yJ)&&(yJ=!1,AJ=Su(LF)?gJ:mJ(LF)),zwt(AJ($6(e)))):$6(e),Nwt=(e,t)=>{for(let r in t)e.hasOwnProperty(r)?e[r]=$6(e[r],t[r]):e[r]=t[r];return e},Uwt=(e,t)=>{let{extend:r=null,slots:i={},variants:n={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:a={}}=e,h={..._Xt,...t},p=r!=null&&r.base?$6(r.base,e?.base):e?.base,g=r!=null&&r.variants&&!Su(r.variants)?uJ(n,r.variants):n,w=r!=null&&r.defaultVariants&&!Su(r.defaultVariants)?{...r.defaultVariants,...a}:a;!Su(h.twMergeConfig)&&!mwt(h.twMergeConfig,LF)&&(yJ=!0,LF=h.twMergeConfig);let C=Su(r?.slots),R=Su(i)?{}:{base:$6(e?.base,C&&r?.base),...i},z=C?R:Nwt({...r?.slots},Su(R)?{base:e?.base}:R),W=H=>{if(Su(g)&&Su(i)&&C)return j6(p,H?.class,H?.className)(h);if(o&&!Array.isArray(o))throw new TypeError(`The \"compoundVariants\" prop must be an array. Received: ${typeof o}`);if(s&&!Array.isArray(s))throw new TypeError(`The \"compoundSlots\" prop must be an array. Received: ${typeof s}`);let Q=(Ft,Nt,$t=[],Yt)=>{let _e=$t;if(typeof Nt==\"string\")_e=_e.concat(hJ(Nt).split(\" \").map(Pe=>`${Ft}:${Pe}`));else if(Array.isArray(Nt))_e=_e.concat(Nt.reduce((Pe,we)=>Pe.concat(`${Ft}:${we}`),[]));else if(typeof Nt==\"object\"&&typeof Yt==\"string\"){for(let Pe in Nt)if(Nt.hasOwnProperty(Pe)&&Pe===Yt){let we=Nt[Pe];if(we&&typeof we==\"string\"){let Ue=hJ(we);_e[Yt]?_e[Yt]=_e[Yt].concat(Ue.split(\" \").map(lr=>`${Ft}:${lr}`)):_e[Yt]=Ue.split(\" \").map(lr=>`${Ft}:${lr}`)}else Array.isArray(we)&&we.length>0&&(_e[Yt]=we.reduce((Ue,lr)=>Ue.concat(`${Ft}:${lr}`),[]))}}return _e},tt=(Ft,Nt=g,$t=null,Yt=null)=>{var _e;let Pe=Nt[Ft];if(!Pe||Su(Pe))return null;let we=(_e=Yt?.[Ft])!=null?_e:H?.[Ft];if(we===null)return null;let Ue=aJ(we),lr=Array.isArray(h.responsiveVariants)&&h.responsiveVariants.length>0||h.responsiveVariants===!0,ee=w?.[Ft],Ce=[];if(typeof Ue==\"object\"&&lr)for(let[gr,Br]of Object.entries(Ue)){let Cr=Pe[Br];if(gr===\"initial\"){ee=Br;continue}Array.isArray(h.responsiveVariants)&&!h.responsiveVariants.includes(gr)||(Ce=Q(gr,Cr,Ce,$t))}let mr=Pe[Ue]||Pe[aJ(ee)];return typeof Ce==\"object\"&&typeof $t==\"string\"&&Ce[$t]?Nwt(Ce,mr):Ce.length>0?(Ce.push(mr),Ce):mr},rt=()=>g?Object.keys(g).map(Ft=>tt(Ft,g)):null,at=(Ft,Nt)=>{if(!g||typeof g!=\"object\")return null;let $t=new Array;for(let Yt in g){let _e=tt(Yt,g,Ft,Nt),Pe=Ft===\"base\"&&typeof _e==\"string\"?_e:_e&&_e[Ft];Pe&&($t[$t.length]=Pe)}return $t},et={};for(let Ft in H)H[Ft]!==void 0&&(et[Ft]=H[Ft]);let lt=(Ft,Nt)=>{var $t;let Yt=typeof H?.[Ft]==\"object\"?{[Ft]:($t=H[Ft])==null?void 0:$t.initial}:{};return{...w,...et,...Yt,...Nt}},J=(Ft=[],Nt)=>{let $t=[];for(let{class:Yt,className:_e,...Pe}of Ft){let we=!0;for(let[Ue,lr]of Object.entries(Pe)){let ee=lt(Ue,Nt);if(Array.isArray(lr)){if(!lr.includes(ee[Ue])){we=!1;break}}else if(ee[Ue]!==lr){we=!1;break}}we&&(Yt&&$t.push(Yt),_e&&$t.push(_e))}return $t},ft=Ft=>{let Nt=J(o,Ft),$t=J(r?.compoundVariants,Ft);return cJ($t,Nt)},dt=Ft=>{let Nt=ft(Ft);if(!Array.isArray(Nt))return Nt;let $t={};for(let Yt of Nt)if(typeof Yt==\"string\"&&($t.base=j6($t.base,Yt)(h)),typeof Yt==\"object\")for(let[_e,Pe]of Object.entries(Yt))$t[_e]=j6($t[_e],Pe)(h);return $t},Mt=Ft=>{if(s.length<1)return null;let Nt={};for(let{slots:$t=[],class:Yt,className:_e,...Pe}of s){if(!Su(Pe)){let we=!0;for(let Ue of Object.keys(Pe)){let lr=lt(Ue,Ft)[Ue];if(lr===void 0||(Array.isArray(Pe[Ue])?!Pe[Ue].includes(lr):Pe[Ue]!==lr)){we=!1;break}}if(!we)continue}for(let we of $t)Nt[we]=Nt[we]||[],Nt[we].push([Yt,_e])}return Nt};if(!Su(i)||!C){let Ft={};if(typeof z==\"object\"&&!Su(z))for(let Nt of Object.keys(z))Ft[Nt]=$t=>{var Yt,_e;return j6(z[Nt],at(Nt,$t),((Yt=dt($t))!=null?Yt:[])[Nt],((_e=Mt($t))!=null?_e:[])[Nt],$t?.class,$t?.className)(h)};return Ft}return j6(p,rt(),ft(),H?.class,H?.className)(h)},Y=()=>{if(!(!g||typeof g!=\"object\"))return Object.keys(g)};return W.variantKeys=Y(),W.extend=r,W.base=p,W.slots=z,W.variants=g,W.defaultVariants=w,W.compoundSlots=s,W.compoundVariants=o,W};var Jb=(e,t)=>{var r,i,n;return Uwt(e,{...t,twMerge:(r=t?.twMerge)!=null?r:!0,twMergeConfig:{...t?.twMergeConfig,theme:{...(i=t?.twMergeConfig)==null?void 0:i.theme,...sJ.theme},classGroups:{...(n=t?.twMergeConfig)==null?void 0:n.classGroups,...sJ.classGroups}}})};var BF=Jb({slots:{base:\"relative inline-flex flex-col gap-2 items-center justify-center\",wrapper:\"relative flex\",circle1:[\"absolute\",\"w-full\",\"h-full\",\"rounded-full\",\"animate-spinner-ease-spin\",\"border-2\",\"border-solid\",\"border-t-transparent\",\"border-l-transparent\",\"border-r-transparent\"],circle2:[\"absolute\",\"w-full\",\"h-full\",\"rounded-full\",\"opacity-75\",\"animate-spinner-linear-spin\",\"border-2\",\"border-dotted\",\"border-t-transparent\",\"border-l-transparent\",\"border-r-transparent\"],label:\"text-foreground dark:text-foreground-dark font-regular\"},variants:{size:{sm:{wrapper:\"w-5 h-5\",circle1:\"border-2\",circle2:\"border-2\",label:\"text-small\"},md:{wrapper:\"w-8 h-8\",circle1:\"border-3\",circle2:\"border-3\",label:\"text-medium\"},lg:{wrapper:\"w-10 h-10\",circle1:\"border-3\",circle2:\"border-3\",label:\"text-large\"}},color:{current:{circle1:\"border-b-current\",circle2:\"border-b-current\"},white:{circle1:\"border-b-white\",circle2:\"border-b-white\"},default:{circle1:\"border-b-default\",circle2:\"border-b-default\"},primary:{circle1:\"border-b-primary\",circle2:\"border-b-primary\"},secondary:{circle1:\"border-b-secondary\",circle2:\"border-b-secondary\"},success:{circle1:\"border-b-success\",circle2:\"border-b-success\"},warning:{circle1:\"border-b-warning\",circle2:\"border-b-warning\"},danger:{circle1:\"border-b-danger\",circle2:\"border-b-danger\"}},labelColor:{foreground:{label:\"text-foreground\"},primary:{label:\"text-primary\"},secondary:{label:\"text-secondary\"},success:{label:\"text-success\"},warning:{label:\"text-warning\"},danger:{label:\"text-danger\"}}},defaultVariants:{size:\"md\",color:\"primary\",labelColor:\"foreground\"}});var FF=[\"outline-none\",\"data-[focus-visible=true]:z-10\",\"data-[focus-visible=true]:outline-2\",\"data-[focus-visible=true]:outline-focus\",\"data-[focus-visible=true]:outline-offset-2\"];var tx={default:[\"[&+.border-medium.border-default]:ms-[calc(theme(borderWidth.medium)*-1)]\"],primary:[\"[&+.border-medium.border-primary]:ms-[calc(theme(borderWidth.medium)*-1)]\"],secondary:[\"[&+.border-medium.border-secondary]:ms-[calc(theme(borderWidth.medium)*-1)]\"],success:[\"[&+.border-medium.border-success]:ms-[calc(theme(borderWidth.medium)*-1)]\"],warning:[\"[&+.border-medium.border-warning]:ms-[calc(theme(borderWidth.medium)*-1)]\"],danger:[\"[&+.border-medium.border-danger]:ms-[calc(theme(borderWidth.medium)*-1)]\"]};var vXt={default:\"bg-default text-default-foreground\",primary:\"bg-primary text-primary-foreground\",secondary:\"bg-secondary text-secondary-foreground\",success:\"bg-success text-success-foreground\",warning:\"bg-warning text-warning-foreground\",danger:\"bg-danger text-danger-foreground\",foreground:\"bg-foreground text-background\"},bXt={default:\"shadow-lg shadow-default/50 bg-default text-default-foreground\",primary:\"shadow-lg shadow-primary/40 bg-primary text-primary-foreground\",secondary:\"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground\",success:\"shadow-lg shadow-success/40 bg-success text-success-foreground\",warning:\"shadow-lg shadow-warning/40 bg-warning text-warning-foreground\",danger:\"shadow-lg shadow-danger/40 bg-danger text-danger-foreground\",foreground:\"shadow-lg shadow-foreground/40 bg-foreground text-background\"},xXt={default:\"bg-transparent border-default text-foreground\",primary:\"bg-transparent border-primary text-primary\",secondary:\"bg-transparent border-secondary text-secondary\",success:\"bg-transparent border-success text-success\",warning:\"bg-transparent border-warning text-warning\",danger:\"bg-transparent border-danger text-danger\",foreground:\"bg-transparent border-foreground text-foreground\"},wXt={default:\"bg-default/40 text-default-700\",primary:\"bg-primary/20 text-primary-600\",secondary:\"bg-secondary/20 text-secondary-600\",success:\"bg-success/20 text-success-700 dark:text-success\",warning:\"bg-warning/20 text-warning-700 dark:text-warning\",danger:\"bg-danger/20 text-danger-600 dark:text-danger-500\",foreground:\"bg-foreground/10 text-foreground\"},TXt={default:\"border-default bg-default-100 text-default-foreground\",primary:\"border-default bg-default-100 text-primary\",secondary:\"border-default bg-default-100 text-secondary\",success:\"border-default bg-default-100 text-success\",warning:\"border-default bg-default-100 text-warning\",danger:\"border-default bg-default-100 text-danger\",foreground:\"border-default bg-default-100 text-foreground\"},SXt={default:\"bg-transparent text-default-foreground\",primary:\"bg-transparent text-primary\",secondary:\"bg-transparent text-secondary\",success:\"bg-transparent text-success\",warning:\"bg-transparent text-warning\",danger:\"bg-transparent text-danger\",foreground:\"bg-transparent text-foreground\"},MXt={default:\"border-default text-default-foreground\",primary:\"border-primary text-primary\",secondary:\"border-secondary text-secondary\",success:\"border-success text-success\",warning:\"border-warning text-warning\",danger:\"border-danger text-danger\",foreground:\"border-foreground text-foreground hover:!bg-foreground\"},oi={solid:vXt,shadow:bXt,bordered:xXt,flat:wXt,faded:TXt,light:SXt,ghost:MXt};var NF=Jb({slots:{base:[\"z-0\",\"relative\",\"bg-transparent\",\"before:content-['']\",\"before:hidden\",\"before:z-[-1]\",\"before:absolute\",\"before:rotate-45\",\"before:w-2.5\",\"before:h-2.5\",\"before:rounded-sm\",\"data-[arrow=true]:before:block\",\"data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=top]:before:left-1/2\",\"data-[placement=top]:before:-translate-x-1/2\",\"data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=top-start]:before:left-3\",\"data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=top-end]:before:right-3\",\"data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=bottom]:before:left-1/2\",\"data-[placement=bottom]:before:-translate-x-1/2\",\"data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=bottom-start]:before:left-3\",\"data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]\",\"data-[placement=bottom-end]:before:right-3\",\"data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]\",\"data-[placement=left]:before:top-1/2\",\"data-[placement=left]:before:-translate-y-1/2\",\"data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]\",\"data-[placement=left-start]:before:top-1/4\",\"data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]\",\"data-[placement=left-end]:before:bottom-1/4\",\"data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]\",\"data-[placement=right]:before:top-1/2\",\"data-[placement=right]:before:-translate-y-1/2\",\"data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]\",\"data-[placement=right-start]:before:top-1/4\",\"data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]\",\"data-[placement=right-end]:before:bottom-1/4\",...FF],content:[\"z-10\",\"px-2.5\",\"py-1\",\"w-full\",\"inline-flex\",\"flex-col\",\"items-center\",\"justify-center\",\"box-border\",\"subpixel-antialiased\",\"outline-none\",\"box-border\"],trigger:[\"z-10\"],backdrop:[\"hidden\"],arrow:[]},variants:{size:{sm:{content:\"text-tiny\"},md:{content:\"text-small\"},lg:{content:\"text-medium\"}},color:{default:{base:\"before:bg-content1 before:shadow-small\",content:\"bg-content1\"},foreground:{base:\"before:bg-foreground\",content:oi.solid.foreground},primary:{base:\"before:bg-primary\",content:oi.solid.primary},secondary:{base:\"before:bg-secondary\",content:oi.solid.secondary},success:{base:\"before:bg-success\",content:oi.solid.success},warning:{base:\"before:bg-warning\",content:oi.solid.warning},danger:{base:\"before:bg-danger\",content:oi.solid.danger}},radius:{none:{content:\"rounded-none\"},sm:{content:\"rounded-small\"},md:{content:\"rounded-medium\"},lg:{content:\"rounded-large\"},full:{content:\"rounded-full\"}},shadow:{sm:{content:\"shadow-small\"},md:{content:\"shadow-medium\"},lg:{content:\"shadow-large\"}},backdrop:{transparent:{},opaque:{backdrop:\"bg-overlay/50 backdrop-opacity-disabled\"},blur:{backdrop:\"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30\"}},triggerScaleOnOpen:{true:{trigger:[\"aria-expanded:scale-[0.97]\",\"aria-expanded:opacity-70\",\"subpixel-antialiased\"]},false:{}},disableAnimation:{true:{base:\"animate-none\"}},isTriggerDisabled:{true:{trigger:\"opacity-disabled pointer-events-none\"},false:{}}},defaultVariants:{color:\"default\",radius:\"lg\",size:\"md\",shadow:\"md\",backdrop:\"transparent\",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:[\"opaque\",\"blur\"],class:{backdrop:\"block w-full h-full fixed inset-0 -z-30\"}}]});var _J=Jb({base:[\"z-0\",\"group\",\"relative\",\"inline-flex\",\"items-center\",\"justify-center\",\"box-border\",\"appearance-none\",\"outline-none\",\"select-none\",\"whitespace-nowrap\",\"min-w-max\",\"font-normal\",\"subpixel-antialiased\",\"overflow-hidden\",\"tap-highlight-transparent\",\"data-[pressed=true]:scale-[0.97]\",...FF],variants:{variant:{solid:\"\",bordered:\"border-medium bg-transparent\",light:\"bg-transparent\",flat:\"\",faded:\"border-medium\",shadow:\"\",ghost:\"border-medium bg-transparent\"},size:{sm:\"px-3 min-w-16 h-8 text-tiny gap-2 rounded-small\",md:\"px-4 min-w-20 h-10 text-small gap-2 rounded-medium\",lg:\"px-6 min-w-24 h-12 text-medium gap-3 rounded-large\"},color:{default:\"\",primary:\"\",secondary:\"\",success:\"\",warning:\"\",danger:\"\"},radius:{none:\"rounded-none\",sm:\"rounded-small\",md:\"rounded-medium\",lg:\"rounded-large\",full:\"rounded-full\"},fullWidth:{true:\"w-full\"},isDisabled:{true:\"opacity-disabled pointer-events-none\"},isInGroup:{true:\"[&:not(:first-child):not(:last-child)]:rounded-none\"},isIconOnly:{true:\"px-0 !gap-0\",false:\"[&>svg]:max-w-[theme(spacing.8)]\"},disableAnimation:{true:\"!transition-none data-[pressed=true]:scale-100\",false:\"transition-transform-colors-opacity motion-reduce:transition-none\"}},defaultVariants:{size:\"md\",variant:\"solid\",color:\"default\",fullWidth:!1,isDisabled:!1,isInGroup:!1},compoundVariants:[{variant:\"solid\",color:\"default\",class:oi.solid.default},{variant:\"solid\",color:\"primary\",class:oi.solid.primary},{variant:\"solid\",color:\"secondary\",class:oi.solid.secondary},{variant:\"solid\",color:\"success\",class:oi.solid.success},{variant:\"solid\",color:\"warning\",class:oi.solid.warning},{variant:\"solid\",color:\"danger\",class:oi.solid.danger},{variant:\"shadow\",color:\"default\",class:oi.shadow.default},{variant:\"shadow\",color:\"primary\",class:oi.shadow.primary},{variant:\"shadow\",color:\"secondary\",class:oi.shadow.secondary},{variant:\"shadow\",color:\"success\",class:oi.shadow.success},{variant:\"shadow\",color:\"warning\",class:oi.shadow.warning},{variant:\"shadow\",color:\"danger\",class:oi.shadow.danger},{variant:\"bordered\",color:\"default\",class:oi.bordered.default},{variant:\"bordered\",color:\"primary\",class:oi.bordered.primary},{variant:\"bordered\",color:\"secondary\",class:oi.bordered.secondary},{variant:\"bordered\",color:\"success\",class:oi.bordered.success},{variant:\"bordered\",color:\"warning\",class:oi.bordered.warning},{variant:\"bordered\",color:\"danger\",class:oi.bordered.danger},{variant:\"flat\",color:\"default\",class:oi.flat.default},{variant:\"flat\",color:\"primary\",class:oi.flat.primary},{variant:\"flat\",color:\"secondary\",class:oi.flat.secondary},{variant:\"flat\",color:\"success\",class:oi.flat.success},{variant:\"flat\",color:\"warning\",class:oi.flat.warning},{variant:\"flat\",color:\"danger\",class:oi.flat.danger},{variant:\"faded\",color:\"default\",class:oi.faded.default},{variant:\"faded\",color:\"primary\",class:oi.faded.primary},{variant:\"faded\",color:\"secondary\",class:oi.faded.secondary},{variant:\"faded\",color:\"success\",class:oi.faded.success},{variant:\"faded\",color:\"warning\",class:oi.faded.warning},{variant:\"faded\",color:\"danger\",class:oi.faded.danger},{variant:\"light\",color:\"default\",class:[oi.light.default,\"data-[hover=true]:bg-default/40\"]},{variant:\"light\",color:\"primary\",class:[oi.light.primary,\"data-[hover=true]:bg-primary/20\"]},{variant:\"light\",color:\"secondary\",class:[oi.light.secondary,\"data-[hover=true]:bg-secondary/20\"]},{variant:\"light\",color:\"success\",class:[oi.light.success,\"data-[hover=true]:bg-success/20\"]},{variant:\"light\",color:\"warning\",class:[oi.light.warning,\"data-[hover=true]:bg-warning/20\"]},{variant:\"light\",color:\"danger\",class:[oi.light.danger,\"data-[hover=true]:bg-danger/20\"]},{variant:\"ghost\",color:\"default\",class:[oi.ghost.default,\"data-[hover=true]:!bg-default\"]},{variant:\"ghost\",color:\"primary\",class:[oi.ghost.primary,\"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground\"]},{variant:\"ghost\",color:\"secondary\",class:[oi.ghost.secondary,\"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground\"]},{variant:\"ghost\",color:\"success\",class:[oi.ghost.success,\"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground\"]},{variant:\"ghost\",color:\"warning\",class:[oi.ghost.warning,\"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground\"]},{variant:\"ghost\",color:\"danger\",class:[oi.ghost.danger,\"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground\"]},{isInGroup:!0,class:\"rounded-none first:rounded-s-medium last:rounded-e-medium\"},{isInGroup:!0,size:\"sm\",class:\"rounded-none first:rounded-s-small last:rounded-e-small\"},{isInGroup:!0,size:\"md\",class:\"rounded-none first:rounded-s-medium last:rounded-e-medium\"},{isInGroup:!0,size:\"lg\",class:\"rounded-none first:rounded-s-large last:rounded-e-large\"},{isInGroup:!0,isRounded:!0,class:\"rounded-none first:rounded-s-full last:rounded-e-full\"},{isInGroup:!0,radius:\"none\",class:\"rounded-none first:rounded-s-none last:rounded-e-none\"},{isInGroup:!0,radius:\"sm\",class:\"rounded-none first:rounded-s-small last:rounded-e-small\"},{isInGroup:!0,radius:\"md\",class:\"rounded-none first:rounded-s-medium last:rounded-e-medium\"},{isInGroup:!0,radius:\"lg\",class:\"rounded-none first:rounded-s-large last:rounded-e-large\"},{isInGroup:!0,radius:\"full\",class:\"rounded-none first:rounded-s-full last:rounded-e-full\"},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"default\",className:tx.default},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"primary\",className:tx.primary},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"secondary\",className:tx.secondary},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"success\",className:tx.success},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"warning\",className:tx.warning},{isInGroup:!0,variant:[\"ghost\",\"bordered\"],color:\"danger\",className:tx.danger},{isIconOnly:!0,size:\"sm\",class:\"min-w-8 w-8 h-8\"},{isIconOnly:!0,size:\"md\",class:\"min-w-10 w-10 h-10\"},{isIconOnly:!0,size:\"lg\",class:\"min-w-12 w-12 h-12\"},{variant:[\"solid\",\"faded\",\"flat\",\"bordered\",\"shadow\"],class:\"data-[hover=true]:opacity-hover\"}]}),zF=Jb({base:\"inline-flex items-center justify-center h-auto\",variants:{fullWidth:{true:\"w-full\"}},defaultVariants:{fullWidth:!1}});var oA={ease:[.36,.66,.4,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],spring:[.155,1.105,.295,1.12],springOut:[.57,-.15,.62,.07],softSpring:[.16,1.11,.3,1.02]},IXt={enter:{duration:.2,ease:oA.easeOut},exit:{duration:.1,ease:oA.easeIn}},vJ={scaleSpring:{enter:{transform:\"scale(1)\",opacity:1,transition:{type:\"spring\",bounce:0,duration:.2}},exit:{transform:\"scale(0.85)\",opacity:0,transition:{type:\"easeOut\",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:\"scale(0.8)\"},enter:{opacity:1,transform:\"scale(1)\",transition:{type:\"spring\",bounce:0,duration:.3}},exit:{opacity:0,transform:\"scale(0.96)\",transition:{type:\"easeOut\",bounce:0,duration:.15}}},scale:{enter:{scale:1},exit:{scale:.95}},scaleFadeIn:{enter:{transform:\"scale(1)\",opacity:1,transition:{duration:.25,ease:oA.easeIn}},exit:{transform:\"scale(0.95)\",opacity:0,transition:{duration:.2,ease:oA.easeOut}}},scaleInOut:{enter:{transform:\"scale(1)\",opacity:1,transition:{duration:.4,ease:oA.ease}},exit:{transform:\"scale(1.03)\",opacity:0,transition:{duration:.3,ease:oA.ease}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:oA.ease}},exit:{opacity:0,transition:{duration:.3,ease:oA.ease}}},collapse:{enter:{opacity:1,height:\"auto\",transition:{height:{type:\"spring\",bounce:0,duration:.3},opacity:{easings:\"ease\",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:\"ease\",duration:.3}}}};var bJ=e=>{let t={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},\"top-start\":{originX:0,originY:1},\"top-end\":{originX:1,originY:1},\"bottom-start\":{originX:0,originY:0},\"bottom-end\":{originX:1,originY:0},\"right-start\":{originX:0,originY:0},\"right-end\":{originX:0,originY:1},\"left-start\":{originX:1,originY:0},\"left-end\":{originX:1,originY:1}};return t?.[e]||{}},xJ=e=>({top:\"top\",bottom:\"bottom\",left:\"left\",right:\"right\",\"top-start\":\"top start\",\"top-end\":\"top end\",\"bottom-start\":\"bottom start\",\"bottom-end\":\"bottom end\",\"left-start\":\"left top\",\"left-end\":\"left bottom\",\"right-start\":\"right top\",\"right-end\":\"right bottom\"})[e];var UF=(e,t)=>{if(t.includes(\"-\")){let[,r]=t.split(\"-\");return`${e}-${r}`}return e};var VF=xe(ze(),1),Vwt=globalThis?.document?VF.useLayoutEffect:VF.useEffect;var G6=xe(ze(),1);function jwt(e){var t,r;let i=Ib(),[n,o]=W1(e,zF.variantKeys),{ref:s,as:a,children:h,color:p=\"default\",size:g=\"md\",variant:w=\"solid\",radius:C,isDisabled:R=!1,isIconOnly:z=!1,disableRipple:W=(t=i?.disableRipple)!=null?t:!1,disableAnimation:Y=(r=i?.disableAnimation)!=null?r:!1,className:H,...Q}=n,tt=a||\"div\",rt=PC(s),at=(0,G6.useMemo)(()=>zF({...o,className:H}),[Cb(o),H]),et=(0,G6.useMemo)(()=>({size:g,color:p,variant:w,radius:C,isIconOnly:z,isDisabled:R,disableAnimation:Y,disableRipple:W,fullWidth:!!e?.fullWidth}),[g,p,w,C,R,z,Y,W,e?.fullWidth]),lt=(0,G6.useCallback)(()=>({role:\"group\",...Q}),[Q]);return{Component:tt,children:h,domRef:rt,context:et,classNames:at,getButtonGroupProps:lt}}var[$wt,Gwt]=MC({name:\"ButtonGroupContext\",strict:!1});var wJ=xe(fo(),1),Wwt=j0((e,t)=>{let{Component:r,domRef:i,context:n,children:o,classNames:s,getButtonGroupProps:a}=jwt({...e,ref:t});return(0,wJ.jsx)($wt,{value:n,children:(0,wJ.jsx)(r,{ref:i,className:s,...a(),children:o})})});Wwt.displayName=\"NextUI.ButtonGroup\";var TJ=Wwt;var jF=xe(ze(),1);var rx=xe(ze(),1);function qwt(e,t){let{elementType:r=\"button\",isDisabled:i,onPress:n,onPressStart:o,onPressEnd:s,onPressChange:a,preventFocusOnPress:h,allowFocusWhenDisabled:p,onClick:g,href:w,target:C,rel:R,type:z=\"button\",allowTextSelectionOnPress:W}=e,Y;r===\"button\"?Y={type:z,disabled:i}:Y={role:\"button\",tabIndex:i?void 0:0,href:r===\"a\"&&!i?w:void 0,target:r===\"a\"?C:void 0,type:r===\"input\"?z:void 0,disabled:r===\"input\"?i:void 0,\"aria-disabled\":!i||r===\"input\"?void 0:i,rel:r===\"a\"?R:void 0};let H=Rb()||e4();g&&typeof g==\"function\"&&IC(\"onClick is deprecated, please use onPress instead. See: https://github.com/nextui-org/nextui/issues/4292\",\"useButton\");let Q=lt=>{H&&g?.(lt),n?.(lt)},{pressProps:tt,isPressed:rt}=IZ({onPressStart:o,onPressEnd:s,onPressChange:a,onPress:Q,isDisabled:i,preventFocusOnPress:h,allowTextSelectionOnPress:W,ref:t}),{focusableProps:at}=GC(e,t);p&&(at.tabIndex=i?-1:at.tabIndex);let et=ns(at,tt,DC(e,{labelable:!0}));return{isPressed:rt,buttonProps:ns(Y,et,{\"aria-haspopup\":e[\"aria-haspopup\"],\"aria-expanded\":e[\"aria-expanded\"],\"aria-controls\":e[\"aria-controls\"],\"aria-pressed\":e[\"aria-pressed\"],onClick:lt=>{z===\"button\"&&H||g?.(lt)}})}}N6();var ex=xe(fo(),1),RXt=()=>Promise.resolve().then(()=>(MJ(),SJ)).then(e=>e.default),Hwt=e=>{let{ripples:t=[],motionProps:r,color:i=\"currentColor\",style:n,onClear:o}=e;return(0,ex.jsx)(ex.Fragment,{children:t.map(s=>{let a=eZ(.01*s.size,.2,s.size>100?.75:.5);return(0,ex.jsx)(O6,{features:RXt,children:(0,ex.jsx)(R6,{mode:\"popLayout\",children:(0,ex.jsx)(F6.span,{animate:{transform:\"scale(2)\",opacity:0},className:\"nextui-ripple\",exit:{opacity:0},initial:{transform:\"scale(0)\",opacity:.35},style:{position:\"absolute\",backgroundColor:i,borderRadius:\"100%\",transformOrigin:\"center\",pointerEvents:\"none\",overflow:\"hidden\",inset:0,zIndex:0,top:s.y,left:s.x,width:`${s.size}px`,height:`${s.size}px`,...n},transition:{duration:a},onAnimationComplete:()=>{o(s.key)},...r})})},s.key)})})};Hwt.displayName=\"NextUI.Ripple\";var EJ=Hwt;var W6=xe(ze(),1);function PJ(e={}){let[t,r]=(0,W6.useState)([]),i=(0,W6.useCallback)(o=>{let s=o.target,a=Math.max(s.clientWidth,s.clientHeight);r(h=>[...h,{key:tZ(h.length.toString()),size:a,x:o.x-a/2,y:o.y-a/2}])},[]),n=(0,W6.useCallback)(o=>{r(s=>s.filter(a=>a.key!==o))},[]);return{ripples:t,onClear:n,onPress:i,...e}}function Ywt(e){var t,r,i,n,o,s,a,h,p;let g=Gwt(),w=Ib(),C=!!g,{ref:R,as:z,children:W,startContent:Y,endContent:H,autoFocus:Q,className:tt,spinner:rt,isLoading:at=!1,disableRipple:et=!1,fullWidth:lt=(t=g?.fullWidth)!=null?t:!1,radius:J=g?.radius,size:ft=(r=g?.size)!=null?r:\"md\",color:dt=(i=g?.color)!=null?i:\"default\",variant:Mt=(n=g?.variant)!=null?n:\"solid\",disableAnimation:Ft=(s=(o=g?.disableAnimation)!=null?o:w?.disableAnimation)!=null?s:!1,isDisabled:Nt=(a=g?.isDisabled)!=null?a:!1,isIconOnly:$t=(h=g?.isIconOnly)!=null?h:!1,spinnerPlacement:Yt=\"start\",onPress:_e,onClick:Pe,...we}=e,Ue=z||\"button\",lr=typeof Ue==\"string\",ee=PC(R),Ce=(p=et||w?.disableRipple)!=null?p:Ft,{isFocusVisible:mr,isFocused:gr,focusProps:Br}=YZ({autoFocus:Q}),Cr=Nt||at,Rr=(0,rx.useMemo)(()=>_J({size:ft,color:dt,variant:Mt,radius:J,fullWidth:lt,isDisabled:Cr,isInGroup:C,disableAnimation:Ft,isIconOnly:$t,className:tt}),[ft,dt,Mt,J,lt,Cr,C,$t,Ft,tt]),{onPress:ti,onClear:wr,ripples:He}=PJ(),Ui=(0,jF.useCallback)(ba=>{Ce||Cr||Ft||ee.current&&ti(ba)},[Ce,Cr,Ft,ee,ti]),{buttonProps:ln,isPressed:Io}=qwt({elementType:z,isDisabled:Cr,onPress:kb(_e,Ui),onClick:Pe,...we},ee),{isHovered:qn,hoverProps:ds}=Lb({isDisabled:Cr}),Xo=(0,jF.useCallback)((ba={})=>({\"data-disabled\":Bc(Cr),\"data-focus\":Bc(gr),\"data-pressed\":Bc(Io),\"data-focus-visible\":Bc(mr),\"data-hover\":Bc(qn),\"data-loading\":Bc(at),...ns(ln,Br,ds,kC(we,{enabled:lr}),kC(ba))}),[at,Cr,gr,Io,lr,mr,qn,ln,Br,ds,we]),Ul=ba=>(0,rx.isValidElement)(ba)?(0,rx.cloneElement)(ba,{\"aria-hidden\":!0,focusable:!1,tabIndex:-1}):null,gc=Ul(Y),Wu=Ul(H),qu=(0,rx.useMemo)(()=>({sm:\"sm\",md:\"sm\",lg:\"md\"})[ft],[ft]),Rs=(0,jF.useCallback)(()=>({ripples:He,onClear:wr}),[He,wr]);return{Component:Ue,children:W,domRef:ee,spinner:rt,styles:Rr,startContent:gc,endContent:Wu,isLoading:at,spinnerPlacement:Yt,spinnerSize:qu,disableRipple:Ce,getButtonProps:Xo,getRippleProps:Rs,isIconOnly:$t}}var q6=xe(ze(),1);function Xwt(e){let[t,r]=W1(e,BF.variantKeys),{children:i,className:n,classNames:o,label:s,...a}=t,h=(0,q6.useMemo)(()=>BF({...r}),[Cb(r)]),p=CC(o?.base,n),g=s||i,w=(0,q6.useMemo)(()=>g&&typeof g==\"string\"?g:a[\"aria-label\"]?\"\":\"Loading\",[i,g,a[\"aria-label\"]]),C=(0,q6.useCallback)(()=>({\"aria-label\":w,className:h.base({class:p}),...a}),[w,h,p,a]);return{label:g,slots:h,classNames:o,getSpinnerProps:C}}var ix=xe(fo(),1),Zwt=j0((e,t)=>{let{slots:r,classNames:i,label:n,getSpinnerProps:o}=Xwt({...e});return(0,ix.jsxs)(\"div\",{ref:t,...o(),children:[(0,ix.jsxs)(\"div\",{className:r.wrapper({class:i?.wrapper}),children:[(0,ix.jsx)(\"i\",{className:r.circle1({class:i?.circle1})}),(0,ix.jsx)(\"i\",{className:r.circle2({class:i?.circle2})})]}),n&&(0,ix.jsx)(\"span\",{className:r.label({class:i?.label}),children:n})]})});Zwt.displayName=\"NextUI.Spinner\";var CJ=Zwt;var H6=xe(fo(),1),Kwt=j0((e,t)=>{let{Component:r,domRef:i,children:n,styles:o,spinnerSize:s,spinner:a=(0,H6.jsx)(CJ,{color:\"current\",size:s}),spinnerPlacement:h,startContent:p,endContent:g,isLoading:w,disableRipple:C,getButtonProps:R,getRippleProps:z,isIconOnly:W}=Ywt({...e,ref:t});return(0,H6.jsxs)(r,{ref:i,className:o,...R(),children:[p,w&&h===\"start\"&&a,w&&W?null:n,w&&h===\"end\"&&a,g,!C&&(0,H6.jsx)(EJ,{...z()})]})});Kwt.displayName=\"NextUI.Button\";var Y6=Kwt;var GF=xe(ze(),1);var H1=xe(ze(),1);var $F=xe(ze(),1);function IJ(e){let[t,r]=vZ(e.isOpen,e.defaultOpen||!1,e.onOpenChange),i=(0,$F.useCallback)(()=>{r(!0)},[r]),n=(0,$F.useCallback)(()=>{r(!1)},[r]),o=(0,$F.useCallback)(()=>{r(!t)},[r,t]);return{isOpen:t,setOpen:r,open:i,close:n,toggle:o}}var DXt=1500,Qwt=500,nx={},OXt=0,X6=!1,sA=null,ox=null;function kJ(e={}){let{delay:t=DXt,closeDelay:r=Qwt}=e,{isOpen:i,open:n,close:o}=IJ(e),s=(0,H1.useMemo)(()=>`${++OXt}`,[]),a=(0,H1.useRef)(null),h=(0,H1.useRef)(o),p=()=>{nx[s]=C},g=()=>{for(let z in nx)z!==s&&(nx[z](!0),delete nx[z])},w=()=>{a.current&&clearTimeout(a.current),a.current=null,g(),p(),X6=!0,n(),sA&&(clearTimeout(sA),sA=null),ox&&(clearTimeout(ox),ox=null)},C=z=>{z||r<=0?(a.current&&clearTimeout(a.current),a.current=null,h.current()):a.current||(a.current=setTimeout(()=>{a.current=null,h.current()},r)),sA&&(clearTimeout(sA),sA=null),X6&&(ox&&clearTimeout(ox),ox=setTimeout(()=>{delete nx[s],ox=null,X6=!1},Math.max(Qwt,r)))},R=()=>{g(),p(),!i&&!sA&&!X6?sA=setTimeout(()=>{sA=null,X6=!0,w()},t):i||w()};return(0,H1.useEffect)(()=>{h.current=o},[o]),(0,H1.useEffect)(()=>()=>{a.current&&clearTimeout(a.current),nx[s]&&delete nx[s]},[s]),{isOpen:i,open:z=>{!z&&t>0&&!a.current?R():w()},close:C}}function RJ(e,t){let r=DC(e,{labelable:!0}),{hoverProps:i}=Lb({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:ns(r,i,{role:\"tooltip\"})}}var Z6=xe(ze(),1);function DJ(e,t,r){let{isDisabled:i,trigger:n}=e,o=dZ(),s=(0,Z6.useRef)(!1),a=(0,Z6.useRef)(!1),h=()=>{(s.current||a.current)&&t.open(a.current)},p=H=>{!s.current&&!a.current&&t.close(H)};(0,Z6.useEffect)(()=>{let H=Q=>{r&&r.current&&Q.key===\"Escape\"&&(Q.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener(\"keydown\",H,!0),()=>{document.removeEventListener(\"keydown\",H,!0)}},[r,t]);let g=()=>{n!==\"focus\"&&(UC()===\"pointer\"?s.current=!0:s.current=!1,h())},w=()=>{n!==\"focus\"&&(a.current=!1,s.current=!1,p())},C=()=>{a.current=!1,s.current=!1,p(!0)},R=()=>{u4()&&(a.current=!0,h())},z=()=>{a.current=!1,s.current=!1,p(!0)},{hoverProps:W}=Lb({isDisabled:i,onHoverStart:g,onHoverEnd:w}),{focusableProps:Y}=GC({isDisabled:i,onFocus:R,onBlur:z},r);return{triggerProps:{\"aria-describedby\":t.isOpen?o:void 0,...ns(Y,W,{onPointerDown:C,onKeyDown:C})},tooltipProps:{id:o}}}var aA=xe(ze(),1);function Jwt(e){var t,r;let i=Ib(),[n,o]=W1(e,NF.variantKeys),{ref:s,as:a,isOpen:h,content:p,children:g,defaultOpen:w,onOpenChange:C,isDisabled:R,trigger:z,shouldFlip:W=!0,containerPadding:Y=12,placement:H=\"top\",delay:Q=0,closeDelay:tt=500,showArrow:rt=!1,offset:at=7,crossOffset:et=0,isDismissable:lt,shouldCloseOnBlur:J=!0,portalContainer:ft,isKeyboardDismissDisabled:dt=!1,updatePositionDeps:Mt=[],shouldCloseOnInteractOutside:Ft,className:Nt,onClose:$t,motionProps:Yt,classNames:_e,...Pe}=n,we=a||\"div\",Ue=(r=(t=e?.disableAnimation)!=null?t:i?.disableAnimation)!=null?r:!1,lr=kJ({delay:Q,closeDelay:tt,isDisabled:R,defaultOpen:w,isOpen:h,onOpenChange:Xo=>{C?.(Xo),Xo||$t?.()}}),ee=(0,aA.useRef)(null),Ce=(0,aA.useRef)(null),mr=(0,GF.useId)(),gr=lr.isOpen&&!R;(0,GF.useImperativeHandle)(s,()=>QX(Ce));let{triggerProps:Br,tooltipProps:Cr}=DJ({isDisabled:R,trigger:z},lr,ee),{tooltipProps:Rr}=RJ({isOpen:gr,...ns(n,Cr)},lr),{overlayProps:ti,placement:wr,updatePosition:He}=wZ({isOpen:gr,targetRef:ee,placement:xJ(H),overlayRef:Ce,offset:rt?at+3:at,crossOffset:et,shouldFlip:W,containerPadding:Y});Vwt(()=>{Mt.length&&He()},Mt);let{overlayProps:Ui}=XZ({isOpen:gr,onClose:lr.close,isDismissable:lt,shouldCloseOnBlur:J,isKeyboardDismissDisabled:dt,shouldCloseOnInteractOutside:Ft},Ce),ln=(0,aA.useMemo)(()=>{var Xo,Ul,gc;return NF({...o,disableAnimation:Ue,radius:(Xo=e?.radius)!=null?Xo:\"md\",size:(Ul=e?.size)!=null?Ul:\"md\",shadow:(gc=e?.shadow)!=null?gc:\"sm\"})},[Cb(o),Ue,e?.radius,e?.size,e?.shadow]),Io=(0,aA.useCallback)((Xo={},Ul=null)=>({...ns(Br,Xo),ref:rZ(Ul,ee),\"aria-describedby\":gr?mr:void 0}),[Br,gr,mr,lr]),qn=(0,aA.useCallback)(()=>({ref:Ce,\"data-slot\":\"base\",\"data-open\":Bc(gr),\"data-arrow\":Bc(rt),\"data-disabled\":Bc(R),\"data-placement\":UF(wr||\"top\",H),...ns(Rr,Ui,Pe),style:ns(ti.style,Pe.style,n.style),className:ln.base({class:_e?.base}),id:mr}),[ln,gr,rt,R,wr,H,Rr,Ui,Pe,ti,n,mr]),ds=(0,aA.useCallback)(()=>({\"data-slot\":\"content\",\"data-open\":Bc(gr),\"data-arrow\":Bc(rt),\"data-disabled\":Bc(R),\"data-placement\":UF(wr||\"top\",H),className:ln.content({class:CC(_e?.content,Nt)})}),[ln,gr,rt,R,wr,H,_e]);return{Component:we,content:p,children:g,isOpen:gr,triggerRef:ee,showArrow:rt,portalContainer:ft,placement:H,disableAnimation:Ue,isDisabled:R,motionProps:Yt,getTooltipContentProps:ds,getTriggerProps:Io,getTooltipProps:qn}}N6();var z4=xe(ze(),1);var sc=xe(fo(),1),LXt=()=>Promise.resolve().then(()=>(MJ(),SJ)).then(e=>e.default),t3t=j0((e,t)=>{let{Component:r,children:i,content:n,isOpen:o,portalContainer:s,placement:a,disableAnimation:h,motionProps:p,getTriggerProps:g,getTooltipProps:w,getTooltipContentProps:C}=Jwt({...e,ref:t}),R;try{if(z4.Children.count(i)!==1)throw new Error;if(!(0,z4.isValidElement)(i))R=(0,sc.jsx)(\"p\",{...g(),children:i});else{let rt=i;R=(0,z4.cloneElement)(rt,g(rt.props,rt.ref))}}catch{R=(0,sc.jsx)(\"span\",{}),IC(\"Tooltip must have only one child node. Please, check your code.\")}let{ref:z,id:W,style:Y,...H}=w(),Q=(0,sc.jsx)(\"div\",{ref:z,id:W,style:Y,children:(0,sc.jsx)(O6,{features:LXt,children:(0,sc.jsx)(F6.div,{animate:\"enter\",exit:\"exit\",initial:\"exit\",variants:vJ.scaleSpring,...ns(p,H),style:{...bJ(a)},children:(0,sc.jsx)(r,{...C(),children:n})})})});return(0,sc.jsxs)(sc.Fragment,{children:[R,h&&o?(0,sc.jsx)(eB,{portalContainer:s,children:(0,sc.jsx)(\"div\",{ref:z,id:W,style:Y,...H,children:(0,sc.jsx)(r,{...C(),children:n})})}):(0,sc.jsx)(R6,{children:o?(0,sc.jsx)(eB,{portalContainer:s,children:Q}):null})]})});t3t.displayName=\"NextUI.Tooltip\";var OJ=t3t;var L8t=xe(FJ(),1),B8t=xe(l3t(),1),Ua=xe(ze(),1);var kl=[];for(let e=0;e<256;++e)kl.push((e+256).toString(16).slice(1));function c3t(e,t=0){return(kl[e[t+0]]+kl[e[t+1]]+kl[e[t+2]]+kl[e[t+3]]+\"-\"+kl[e[t+4]]+kl[e[t+5]]+\"-\"+kl[e[t+6]]+kl[e[t+7]]+\"-\"+kl[e[t+8]]+kl[e[t+9]]+\"-\"+kl[e[t+10]]+kl[e[t+11]]+kl[e[t+12]]+kl[e[t+13]]+kl[e[t+14]]+kl[e[t+15]]).toLowerCase()}var zJ,gZt=new Uint8Array(16);function UJ(){if(!zJ){if(typeof crypto>\"u\"||!crypto.getRandomValues)throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");zJ=crypto.getRandomValues.bind(crypto)}return zJ(gZt)}var AZt=typeof crypto<\"u\"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),VJ={randomUUID:AZt};function yZt(e,t,r){e=e||{};let i=e.random??e.rng?.()??UJ();if(i.length<16)throw new Error(\"Random bytes length must be >= 16\");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let n=0;n<16;++n)t[r+n]=i[n];return t}return c3t(i)}function _Zt(e,t,r){return VJ.randomUUID&&!t&&!e?VJ.randomUUID():yZt(e,t,r)}var K6=_Zt;var tz=xe(ze(),1);var PTt=xe(ze(),1);var HJ={};Ql(HJ,{compareArrayLike:()=>qJ,joinUint8Arrays:()=>Ih,memcpy:()=>tI,rebaseValueOffsets:()=>JF,toArrayBufferView:()=>Oi,toArrayBufferViewAsyncIterator:()=>ip,toArrayBufferViewIterator:()=>G0,toBigInt64Array:()=>QF,toBigUint64Array:()=>PZt,toFloat32Array:()=>CZt,toFloat32ArrayAsyncIterator:()=>WZt,toFloat32ArrayIterator:()=>FZt,toFloat64Array:()=>IZt,toFloat64ArrayAsyncIterator:()=>qZt,toFloat64ArrayIterator:()=>NZt,toInt16Array:()=>SZt,toInt16ArrayAsyncIterator:()=>VZt,toInt16ArrayIterator:()=>DZt,toInt32Array:()=>sx,toInt32ArrayAsyncIterator:()=>jZt,toInt32ArrayIterator:()=>OZt,toInt8Array:()=>TZt,toInt8ArrayAsyncIterator:()=>UZt,toInt8ArrayIterator:()=>RZt,toUint16Array:()=>MZt,toUint16ArrayAsyncIterator:()=>$Zt,toUint16ArrayIterator:()=>LZt,toUint32Array:()=>EZt,toUint32ArrayAsyncIterator:()=>GZt,toUint32ArrayIterator:()=>BZt,toUint8Array:()=>Qr,toUint8ArrayAsyncIterator:()=>WJ,toUint8ArrayIterator:()=>GJ,toUint8ClampedArray:()=>kZt,toUint8ClampedArrayAsyncIterator:()=>HZt,toUint8ClampedArrayIterator:()=>zZt});var u3t=new TextDecoder(\"utf-8\"),Q6=u3t.decode.bind(u3t),bZt=new TextEncoder,$0=e=>bZt.encode(e);var xZt=e=>typeof e==\"number\",h3t=e=>typeof e==\"boolean\",Ra=e=>typeof e==\"function\",Uc=e=>e!=null&&Object(e)===e,Ch=e=>Uc(e)&&Ra(e.then);var rp=e=>Uc(e)&&Ra(e[Symbol.iterator]),Ud=e=>Uc(e)&&Ra(e[Symbol.asyncIterator]),qF=e=>Uc(e)&&Uc(e.schema);var HF=e=>Uc(e)&&\"done\"in e&&\"value\"in e;var YF=e=>Uc(e)&&Ra(e.stat)&&xZt(e.fd);var XF=e=>Uc(e)&&J6(e.body),ZF=e=>\"_getDOMStream\"in e&&\"_getNodeStream\"in e,d3t=e=>Uc(e)&&Ra(e.abort)&&Ra(e.getWriter)&&!ZF(e),J6=e=>Uc(e)&&Ra(e.cancel)&&Ra(e.getReader)&&!ZF(e),f3t=e=>Uc(e)&&Ra(e.end)&&Ra(e.write)&&h3t(e.writable)&&!ZF(e),KF=e=>Uc(e)&&Ra(e.read)&&Ra(e.pipe)&&h3t(e.readable)&&!ZF(e),p3t=e=>Uc(e)&&Ra(e.clear)&&Ra(e.bytes)&&Ra(e.position)&&Ra(e.setPosition)&&Ra(e.capacity)&&Ra(e.getBufferIdentifier)&&Ra(e.createLong);var $J=typeof SharedArrayBuffer<\"u\"?SharedArrayBuffer:ArrayBuffer;function wZt(e){let t=e[0]?[e[0]]:[],r,i,n,o;for(let s,a,h=0,p=0,g=e.length;++h<g;){if(s=t[p],a=e[h],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++p]=a);continue}if({byteOffset:r,byteLength:n}=s,{byteOffset:i,byteLength:o}=a,r+n<i||i+o<r){a&&(t[++p]=a);continue}t[p]=new Uint8Array(s.buffer,r,i-r+o)}return t}function tI(e,t,r=0,i=t.byteLength){let n=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,n),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(i,n));return o.set(s,r),e}function Ih(e,t){let r=wZt(e),i=r.reduce((g,w)=>g+w.byteLength,0),n,o,s,a=0,h=-1,p=Math.min(t||Number.POSITIVE_INFINITY,i);for(let g=r.length;++h<g;){if(n=r[h],o=n.subarray(0,Math.min(n.length,p-a)),p<=a+o.length){o.length<n.length?r[h]=n.subarray(o.length):o.length===n.length&&h++,s?tI(s,o,a):s=o;break}tI(s||(s=new Uint8Array(p)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(h),i-(s?s.byteLength:0)]}function Oi(e,t){let r=HF(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r==\"string\"&&(r=$0(r)),r instanceof ArrayBuffer?new e(r):r instanceof $J?new e(r):p3t(r)?Oi(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}var TZt=e=>Oi(Int8Array,e),SZt=e=>Oi(Int16Array,e),sx=e=>Oi(Int32Array,e),QF=e=>Oi(BigInt64Array,e),Qr=e=>Oi(Uint8Array,e),MZt=e=>Oi(Uint16Array,e),EZt=e=>Oi(Uint32Array,e),PZt=e=>Oi(BigUint64Array,e),CZt=e=>Oi(Float32Array,e),IZt=e=>Oi(Float64Array,e),kZt=e=>Oi(Uint8ClampedArray,e),jJ=e=>(e.next(),e);function*G0(e,t){let r=function*(n){yield n},i=typeof t==\"string\"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof $J?r(t):rp(t)?t:r(t);return yield*jJ((function*(n){let o=null;do o=n.next(yield Oi(e,o));while(!o.done)})(i[Symbol.iterator]())),new e}var RZt=e=>G0(Int8Array,e),DZt=e=>G0(Int16Array,e),OZt=e=>G0(Int32Array,e),GJ=e=>G0(Uint8Array,e),LZt=e=>G0(Uint16Array,e),BZt=e=>G0(Uint32Array,e),FZt=e=>G0(Float32Array,e),NZt=e=>G0(Float64Array,e),zZt=e=>G0(Uint8ClampedArray,e);function ip(e,t){return Th(this,arguments,function*(){if(Ch(t))return yield Ti(yield Ti(yield*t4(Qf(ip(e,yield Ti(t))))));let i=function(s){return Th(this,arguments,function*(){yield yield Ti(yield Ti(s))})},n=function(s){return Th(this,arguments,function*(){yield Ti(yield*t4(Qf(jJ((function*(a){let h=null;do h=a.next(yield h?.value);while(!h.done)})(s[Symbol.iterator]())))))})},o=typeof t==\"string\"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof $J?i(t):rp(t)?n(t):Ud(t)?t:i(t);return yield Ti(yield*t4(Qf(jJ((function(s){return Th(this,arguments,function*(){let a=null;do a=yield Ti(s.next(yield yield Ti(Oi(e,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Ti(new e)})}var UZt=e=>ip(Int8Array,e),VZt=e=>ip(Int16Array,e),jZt=e=>ip(Int32Array,e),WJ=e=>ip(Uint8Array,e),$Zt=e=>ip(Uint16Array,e),GZt=e=>ip(Uint32Array,e),WZt=e=>ip(Float32Array,e),qZt=e=>ip(Float64Array,e),HZt=e=>ip(Uint8ClampedArray,e);function JF(e,t,r){if(e!==0){r=r.slice(0,t);for(let i=-1,n=r.length;++i<n;)r[i]+=e}return r.subarray(0,t)}function qJ(e,t){let r=0,i=e.length;if(i!==t.length)return!1;if(i>0)do if(e[r]!==t[r])return!1;while(++r<i);return!0}var Rl={fromIterable(e){return tN(YZt(e))},fromAsyncIterable(e){return tN(XZt(e))},fromDOMStream(e){return tN(ZZt(e))},fromNodeStream(e){return tN(KZt(e))},toDOMStream(e,t){throw new Error('\"toDOMStream\" not available in this environment')},toNodeStream(e,t){throw new Error('\"toNodeStream\" not available in this environment')}},tN=e=>(e.next(),e);function*YZt(e){let t,r=!1,i=[],n,o,s,a=0;function h(){return o===\"peek\"?Ih(i,s)[0]:([n,i,a]=Ih(i,s),n)}({cmd:o,size:s}=(yield null)||{cmd:\"read\",size:0});let p=GJ(e)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(s-a)?p.next():p.next(s-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||s<=a)do({cmd:o,size:s}=yield h());while(s<a);while(!t)}catch(g){r=!0,typeof p.throw==\"function\"&&p.throw(g)}finally{r===!1&&typeof p.return==\"function\"&&p.return(null)}return null}function XZt(e){return Th(this,arguments,function*(){let r,i=!1,n=[],o,s,a,h=0;function p(){return s===\"peek\"?Ih(n,a)[0]:([o,n,h]=Ih(n,a),o)}({cmd:s,size:a}=(yield yield Ti(null))||{cmd:\"read\",size:0});let g=WJ(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-h)?yield Ti(g.next()):yield Ti(g.next(a-h)),!r&&o.byteLength>0&&(n.push(o),h+=o.byteLength),r||a<=h)do({cmd:s,size:a}=yield yield Ti(p()));while(a<h);while(!r)}catch(w){i=!0,typeof g.throw==\"function\"&&(yield Ti(g.throw(w)))}finally{i===!1&&typeof g.return==\"function\"&&(yield Ti(g.return(new Uint8Array(0))))}return yield Ti(null)})}function ZZt(e){return Th(this,arguments,function*(){let r=!1,i=!1,n=[],o,s,a,h=0;function p(){return s===\"peek\"?Ih(n,a)[0]:([o,n,h]=Ih(n,a),o)}({cmd:s,size:a}=(yield yield Ti(null))||{cmd:\"read\",size:0});let g=new XJ(e);try{do if({done:r,value:o}=Number.isNaN(a-h)?yield Ti(g.read()):yield Ti(g.read(a-h)),!r&&o.byteLength>0&&(n.push(Qr(o)),h+=o.byteLength),r||a<=h)do({cmd:s,size:a}=yield yield Ti(p()));while(a<h);while(!r)}catch(w){i=!0,yield Ti(g.cancel(w))}finally{i===!1?yield Ti(g.cancel()):e.locked&&g.releaseLock()}return yield Ti(null)})}var XJ=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return vr(this,void 0,void 0,function*(){let{reader:r,source:i}=this;r&&(yield r.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return vr(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=Qr(r)),r})}},YJ=(e,t)=>{let r=n=>i([t,n]),i;return[t,r,new Promise(n=>(i=n)&&e.once(t,r))]};function KZt(e){return Th(this,arguments,function*(){let r=[],i=\"error\",n=!1,o=null,s,a,h=0,p=[],g;function w(){return s===\"peek\"?Ih(p,a)[0]:([g,p,h]=Ih(p,a),g)}if({cmd:s,size:a}=(yield yield Ti(null))||{cmd:\"read\",size:0},e.isTTY)return yield yield Ti(new Uint8Array(0)),yield Ti(null);try{r[0]=YJ(e,\"end\"),r[1]=YJ(e,\"error\");do{if(r[2]=YJ(e,\"readable\"),[i,o]=yield Ti(Promise.race(r.map(R=>R[2]))),i===\"error\")break;if((n=i===\"end\")||(Number.isFinite(a-h)?(g=Qr(e.read(a-h)),g.byteLength<a-h&&(g=Qr(e.read()))):g=Qr(e.read()),g.byteLength>0&&(p.push(g),h+=g.byteLength)),n||a<=h)do({cmd:s,size:a}=yield yield Ti(w()));while(a<h)}while(!n)}finally{yield Ti(C(r,i===\"error\"?o:null))}return yield Ti(null);function C(R,z){return g=p=null,new Promise((W,Y)=>{for(let[H,Q]of R)e.off(H,Q);try{let H=e.destroy;H&&H.call(e,z),z=void 0}catch(H){z=H||z}finally{z!=null?Y(z):W()}})}})}var In;(function(e){e[e.V1=0]=\"V1\",e[e.V2=1]=\"V2\",e[e.V3=2]=\"V3\",e[e.V4=3]=\"V4\",e[e.V5=4]=\"V5\"})(In||(In={}));var eo;(function(e){e[e.Sparse=0]=\"Sparse\",e[e.Dense=1]=\"Dense\"})(eo||(eo={}));var bn;(function(e){e[e.HALF=0]=\"HALF\",e[e.SINGLE=1]=\"SINGLE\",e[e.DOUBLE=2]=\"DOUBLE\"})(bn||(bn={}));var Ss;(function(e){e[e.DAY=0]=\"DAY\",e[e.MILLISECOND=1]=\"MILLISECOND\"})(Ss||(Ss={}));var Ir;(function(e){e[e.SECOND=0]=\"SECOND\",e[e.MILLISECOND=1]=\"MILLISECOND\",e[e.MICROSECOND=2]=\"MICROSECOND\",e[e.NANOSECOND=3]=\"NANOSECOND\"})(Ir||(Ir={}));var mo;(function(e){e[e.YEAR_MONTH=0]=\"YEAR_MONTH\",e[e.DAY_TIME=1]=\"DAY_TIME\",e[e.MONTH_DAY_NANO=2]=\"MONTH_DAY_NANO\"})(mo||(mo={}));var W0=new Int32Array(2),eN=new Float32Array(W0.buffer),rN=new Float64Array(W0.buffer),U4=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var eI;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(eI||(eI={}));var Dl=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return W0[0]=this.readInt32(t),eN[0]}readFloat64(t){return W0[U4?0:1]=this.readInt32(t),W0[U4?1:0]=this.readInt32(t+4),rN[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){eN[0]=r,this.writeInt32(t,W0[0])}writeFloat64(t,r){rN[0]=r,this.writeInt32(t,W0[U4?0:1]),this.writeInt32(t+4,W0[U4?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let r=0;r<4;r++)t+=String.fromCharCode(this.readInt8(this.position_+4+r));return t}__offset(t,r){let i=t-this.readInt32(t);return r<this.readInt16(i)?this.readInt16(i+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let n=this.bytes_.subarray(t,t+i);return r===eI.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(t,r){return typeof t==\"string\"?this.__string(r):this.__union(t,r)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let r=0;r<4;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(t,r){let i=[];for(let n=0;n<r;++n){let o=t(n);o!==null&&i.push(o)}return i}createObjList(t,r){let i=[];for(let n=0;n<r;++n){let o=t(n);o!==null&&i.push(o.unpack())}return i}};var ax=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;t?r=t:r=1024,this.bb=Dl.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,r){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<i+t+r;){let n=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let r=0;r<t;r++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,r,i){(this.force_defaults||r!=i)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,i){(this.force_defaults||r!=i)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,i){(this.force_defaults||r!=i)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,i){(this.force_defaults||r!==i)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,i){(this.force_defaults||r!=i)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,i){(this.force_defaults||r!=i)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,i){(this.force_defaults||r!=i)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,i){r!=i&&(this.nested(r),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let r=t.capacity();if(r&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=r<<1,n=Dl.allocate(i);return n.setPosition(i-r),n.bytes().set(t.bytes(),i-r),n}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let i=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let n=2;this.addInt16(t-this.object_start);let o=(i+n)*2;this.addInt16(o);let s=0,a=this.space;t:for(r=0;r<this.vtables.length;r++){let h=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(h)){for(let p=2;p<o;p+=2)if(this.bb.readInt16(a+p)!=this.bb.readInt16(h+p))continue t;s=this.vtables[r];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,r,i){let n=i?4:0;if(r){let o=r;if(this.prep(this.minalign,8+n),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let s=3;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,4+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(r<this.bb.readInt16(n)&&this.bb.readInt16(n+r)!=0))throw new TypeError(\"FlatBuffers: field \"+r+\" must be set\")}startVector(t,r,i){this.notNested(),this.vector_num_elems=r,this.prep(4,t*r),this.prep(i,t*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;return t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let i=0;i<t.length;++i){let n=t[i];if(n!==null)r.push(this.createObjectOffset(n));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var lx;(function(e){e[e.BUFFER=0]=\"BUFFER\"})(lx||(lx={}));var Vc;(function(e){e[e.LZ4_FRAME=0]=\"LZ4_FRAME\",e[e.ZSTD=1]=\"ZSTD\"})(Vc||(Vc={}));var lA=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Vc.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):lx.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Vc.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,lx.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,i){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,i),e.endBodyCompression(t)}};var V4=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,r,i){return t.prep(8,16),t.writeInt64(BigInt(i??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var j4=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,r,i){return t.prep(8,16),t.writeInt64(BigInt(i??0)),t.writeInt64(BigInt(r??0)),t.offset()}};var Mu=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt(\"0\")}nodes(t,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new j4).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new V4).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new lA).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,r){t.addFieldInt64(0,r,BigInt(\"0\"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static endRecordBatch(t){return t.endObject()}};var cA=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt(\"0\")}data(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Mu).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,r){t.addFieldInt64(0,r,BigInt(\"0\"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}};var Y1;(function(e){e[e.Little=0]=\"Little\",e[e.Big=1]=\"Big\"})(Y1||(Y1={}));var rI;(function(e){e[e.DenseArray=0]=\"DenseArray\"})(rI||(rI={}));var op=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,i){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,i),e.endInt(t)}};var q0=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt(\"0\")}indexType(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new op).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):rI.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt(\"0\"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,rI.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Da=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,i){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,i),e.endKeyValue(t)}};var iI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}};var nI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}};var X1=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ss.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Ss.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}};var H0=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,i,n){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,i),e.addBitWidth(t,n),e.endDecimal(t)}};var Z1=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ir.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Ir.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}};var K1=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}};var Q1=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}};var J1=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):bn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,bn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}};var t_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):mo.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,mo.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}};var oI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}};var sI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}};var aI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}};var e_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}};var lI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}};var cI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}};var uA=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ir.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,Ir.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,i){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,i),e.endTime(t)}};var hA=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ir.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,Ir.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,i){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,i),e.endTimestamp(t)}};var sp=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):eo.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,r){t.addFieldInt16(0,r,eo.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addInt32(r[i]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,i){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,i),e.endUnion(t)}};var uI=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}};var ro;(function(e){e[e.NONE=0]=\"NONE\",e[e.Null=1]=\"Null\",e[e.Int=2]=\"Int\",e[e.FloatingPoint=3]=\"FloatingPoint\",e[e.Binary=4]=\"Binary\",e[e.Utf8=5]=\"Utf8\",e[e.Bool=6]=\"Bool\",e[e.Decimal=7]=\"Decimal\",e[e.Date=8]=\"Date\",e[e.Time=9]=\"Time\",e[e.Timestamp=10]=\"Timestamp\",e[e.Interval=11]=\"Interval\",e[e.List=12]=\"List\",e[e.Struct_=13]=\"Struct_\",e[e.Union=14]=\"Union\",e[e.FixedSizeBinary=15]=\"FixedSizeBinary\",e[e.FixedSizeList=16]=\"FixedSizeList\",e[e.Map=17]=\"Map\",e[e.Duration=18]=\"Duration\",e[e.LargeBinary=19]=\"LargeBinary\",e[e.LargeUtf8=20]=\"LargeUtf8\",e[e.LargeList=21]=\"LargeList\",e[e.RunEndEncoded=22]=\"RunEndEncoded\"})(ro||(ro={}));var ac=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):ro.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new q0).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let i=this.bb.__offset(this.bb_pos,14);return i?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let i=this.bb.__offset(this.bb_pos,16);return i?(r||new Da).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,ro.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}};var Eu=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y1.Little}fields(t,r){let i=this.bb.__offset(this.bb_pos,6);return i?(r||new ac).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new Da).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,Y1.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let i=r.length-1;i>=0;i--)t.addInt64(r[i]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,r){t.finish(r)}static finishSizePrefixedSchemaBuffer(t,r){t.finish(r,void 0,!0)}static createSchema(t,r,i,n,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,i),e.addCustomMetadata(t,n),e.addFeatures(t,o),e.endSchema(t)}};var zi;(function(e){e[e.NONE=0]=\"NONE\",e[e.Schema=1]=\"Schema\",e[e.DictionaryBatch=2]=\"DictionaryBatch\",e[e.RecordBatch=3]=\"RecordBatch\",e[e.Tensor=4]=\"Tensor\",e[e.SparseTensor=5]=\"SparseTensor\"})(zi||(zi={}));var Qt;(function(e){e[e.NONE=0]=\"NONE\",e[e.Null=1]=\"Null\",e[e.Int=2]=\"Int\",e[e.Float=3]=\"Float\",e[e.Binary=4]=\"Binary\",e[e.Utf8=5]=\"Utf8\",e[e.Bool=6]=\"Bool\",e[e.Decimal=7]=\"Decimal\",e[e.Date=8]=\"Date\",e[e.Time=9]=\"Time\",e[e.Timestamp=10]=\"Timestamp\",e[e.Interval=11]=\"Interval\",e[e.List=12]=\"List\",e[e.Struct=13]=\"Struct\",e[e.Union=14]=\"Union\",e[e.FixedSizeBinary=15]=\"FixedSizeBinary\",e[e.FixedSizeList=16]=\"FixedSizeList\",e[e.Map=17]=\"Map\",e[e.Duration=18]=\"Duration\",e[e.LargeBinary=19]=\"LargeBinary\",e[e.LargeUtf8=20]=\"LargeUtf8\",e[e.Dictionary=-1]=\"Dictionary\",e[e.Int8=-2]=\"Int8\",e[e.Int16=-3]=\"Int16\",e[e.Int32=-4]=\"Int32\",e[e.Int64=-5]=\"Int64\",e[e.Uint8=-6]=\"Uint8\",e[e.Uint16=-7]=\"Uint16\",e[e.Uint32=-8]=\"Uint32\",e[e.Uint64=-9]=\"Uint64\",e[e.Float16=-10]=\"Float16\",e[e.Float32=-11]=\"Float32\",e[e.Float64=-12]=\"Float64\",e[e.DateDay=-13]=\"DateDay\",e[e.DateMillisecond=-14]=\"DateMillisecond\",e[e.TimestampSecond=-15]=\"TimestampSecond\",e[e.TimestampMillisecond=-16]=\"TimestampMillisecond\",e[e.TimestampMicrosecond=-17]=\"TimestampMicrosecond\",e[e.TimestampNanosecond=-18]=\"TimestampNanosecond\",e[e.TimeSecond=-19]=\"TimeSecond\",e[e.TimeMillisecond=-20]=\"TimeMillisecond\",e[e.TimeMicrosecond=-21]=\"TimeMicrosecond\",e[e.TimeNanosecond=-22]=\"TimeNanosecond\",e[e.DenseUnion=-23]=\"DenseUnion\",e[e.SparseUnion=-24]=\"SparseUnion\",e[e.IntervalDayTime=-25]=\"IntervalDayTime\",e[e.IntervalYearMonth=-26]=\"IntervalYearMonth\",e[e.DurationSecond=-27]=\"DurationSecond\",e[e.DurationMillisecond=-28]=\"DurationMillisecond\",e[e.DurationMicrosecond=-29]=\"DurationMicrosecond\",e[e.DurationNanosecond=-30]=\"DurationNanosecond\",e[e.IntervalMonthDayNano=-31]=\"IntervalMonthDayNano\"})(Qt||(Qt={}));var Hi;(function(e){e[e.OFFSET=0]=\"OFFSET\",e[e.DATA=1]=\"DATA\",e[e.VALIDITY=2]=\"VALIDITY\",e[e.TYPE=3]=\"TYPE\"})(Hi||(Hi={}));var mtt={};Ql(mtt,{clampRange:()=>wI,createElementComparator:()=>o_,wrapIndex:()=>ux});var ZJ={};Ql(ZJ,{valueToString:()=>ap});function ap(e){if(e===null)return\"null\";if(e===void 0)return\"undefined\";switch(typeof e){case\"number\":return`${e}`;case\"bigint\":return`${e}`;case\"string\":return`\"${e}\"`}return typeof e[Symbol.toPrimitive]==\"function\"?e[Symbol.toPrimitive](\"string\"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>ap(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r==\"bigint\"?`${r}`:r)}var ttt={};Ql(ttt,{BN:()=>dI,bigNumToBigInt:()=>g3t,bigNumToNumber:()=>JJ,bigNumToString:()=>W4,isArrowBigNumSymbol:()=>m3t});function cn(e){if(typeof e==\"bigint\"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function KJ(e,t){return cn(e/t)+cn(e%t)/cn(t)}var m3t=Symbol.for(\"isArrowBigNum\");function lp(e,...t){return t.length===0?Object.setPrototypeOf(Oi(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}lp.prototype[m3t]=!0;lp.prototype.toJSON=function(){return`\"${W4(this)}\"`};lp.prototype.valueOf=function(e){return JJ(this,e)};lp.prototype.toString=function(){return W4(this)};lp.prototype[Symbol.toPrimitive]=function(e=\"default\"){switch(e){case\"number\":return JJ(this);case\"string\":return W4(this);case\"default\":return g3t(this)}return W4(this)};function $4(...e){return lp.apply(this,e)}function G4(...e){return lp.apply(this,e)}function hI(...e){return lp.apply(this,e)}Object.setPrototypeOf($4.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(G4.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(hI.prototype,Object.create(Uint32Array.prototype));Object.assign($4.prototype,lp.prototype,{constructor:$4,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(G4.prototype,lp.prototype,{constructor:G4,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(hI.prototype,lp.prototype,{constructor:hI,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var QZt=BigInt(4294967296)*BigInt(4294967296),JZt=QZt-BigInt(1);function JJ(e,t){let{buffer:r,byteOffset:i,byteLength:n,signed:o}=e,s=new BigUint64Array(r,i,n/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),h=BigInt(0),p=0;if(a){for(let g of s)h|=(g^JZt)*(BigInt(1)<<BigInt(64*p++));h*=BigInt(-1),h-=BigInt(1)}else for(let g of s)h|=g*(BigInt(1)<<BigInt(64*p++));if(typeof t==\"number\"&&t>0){let g=BigInt(\"1\".padEnd(t+1,\"0\")),w=h/g,C=a?-(h%g):h%g,R=cn(w),z=`${C}`.padStart(t,\"0\");return+`${a&&R===0?\"-\":\"\"}${R}.${z}`}return cn(h)}function W4(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return QJ(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return QJ(e);t=t.slice();let i=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+i;t[o]=a,i&=s===0?1:0}return`-${QJ(t)}`}function g3t(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:W4(e)}function QJ(e){let t=\"\",r=new Uint32Array(2),i=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Uint32Array((i=new Uint16Array(i).reverse()).buffer),o=-1,s=i.length-1;do{for(r[0]=i[o=0];o<s;)i[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+i[o];i[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(n[0]||n[1]||n[2]||n[3]);return t??\"0\"}var dI=class e{static new(t,r){switch(r){case!0:return new $4(t);case!1:return new G4(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new $4(t)}return t.byteLength===16?new hI(t):new G4(t)}static signed(t){return new $4(t)}static unsigned(t){return new G4(t)}static decimal(t){return new hI(t)}constructor(t,r){return e.new(t,r)}};var A3t,y3t,_3t,v3t,b3t,x3t,w3t,T3t,S3t,M3t,E3t,P3t,C3t,I3t,k3t,R3t,D3t,O3t,L3t,B3t,F3t,N3t,tr=class e{static isNull(t){return t?.typeId===Qt.Null}static isInt(t){return t?.typeId===Qt.Int}static isFloat(t){return t?.typeId===Qt.Float}static isBinary(t){return t?.typeId===Qt.Binary}static isLargeBinary(t){return t?.typeId===Qt.LargeBinary}static isUtf8(t){return t?.typeId===Qt.Utf8}static isLargeUtf8(t){return t?.typeId===Qt.LargeUtf8}static isBool(t){return t?.typeId===Qt.Bool}static isDecimal(t){return t?.typeId===Qt.Decimal}static isDate(t){return t?.typeId===Qt.Date}static isTime(t){return t?.typeId===Qt.Time}static isTimestamp(t){return t?.typeId===Qt.Timestamp}static isInterval(t){return t?.typeId===Qt.Interval}static isDuration(t){return t?.typeId===Qt.Duration}static isList(t){return t?.typeId===Qt.List}static isStruct(t){return t?.typeId===Qt.Struct}static isUnion(t){return t?.typeId===Qt.Union}static isFixedSizeBinary(t){return t?.typeId===Qt.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===Qt.FixedSizeList}static isMap(t){return t?.typeId===Qt.Map}static isDictionary(t){return t?.typeId===Qt.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===eo.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===eo.Sparse}constructor(t){this.typeId=t}};A3t=Symbol.toStringTag;tr[A3t]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=\"DataType\"))(tr.prototype);var sl=class extends tr{constructor(){super(Qt.Null)}toString(){return\"Null\"}};y3t=Symbol.toStringTag;sl[y3t]=(e=>e[Symbol.toStringTag]=\"Null\")(sl.prototype);var Ms=class extends tr{constructor(t,r){super(Qt.Int),this.isSigned=t,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?\"I\":\"Ui\"}nt${this.bitWidth}`}};_3t=Symbol.toStringTag;Ms[_3t]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=\"Int\"))(Ms.prototype);var fI=class extends Ms{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},pI=class extends Ms{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},cp=class extends Ms{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},mI=class extends Ms{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},gI=class extends Ms{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},AI=class extends Ms{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},yI=class extends Ms{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},_I=class extends Ms{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(fI.prototype,\"ArrayType\",{value:Int8Array});Object.defineProperty(pI.prototype,\"ArrayType\",{value:Int16Array});Object.defineProperty(cp.prototype,\"ArrayType\",{value:Int32Array});Object.defineProperty(mI.prototype,\"ArrayType\",{value:BigInt64Array});Object.defineProperty(gI.prototype,\"ArrayType\",{value:Uint8Array});Object.defineProperty(AI.prototype,\"ArrayType\",{value:Uint16Array});Object.defineProperty(yI.prototype,\"ArrayType\",{value:Uint32Array});Object.defineProperty(_I.prototype,\"ArrayType\",{value:BigUint64Array});var al=class extends tr{constructor(t){super(Qt.Float),this.precision=t}get ArrayType(){switch(this.precision){case bn.HALF:return Uint16Array;case bn.SINGLE:return Float32Array;case bn.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};v3t=Symbol.toStringTag;al[v3t]=(e=>(e.precision=null,e[Symbol.toStringTag]=\"Float\"))(al.prototype);var vI=class extends al{constructor(){super(bn.HALF)}},bI=class extends al{constructor(){super(bn.SINGLE)}},cx=class extends al{constructor(){super(bn.DOUBLE)}};Object.defineProperty(vI.prototype,\"ArrayType\",{value:Uint16Array});Object.defineProperty(bI.prototype,\"ArrayType\",{value:Float32Array});Object.defineProperty(cx.prototype,\"ArrayType\",{value:Float64Array});var jd=class extends tr{constructor(){super(Qt.Binary)}toString(){return\"Binary\"}};b3t=Symbol.toStringTag;jd[b3t]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=\"Binary\"))(jd.prototype);var Y0=class extends tr{constructor(){super(Qt.LargeBinary)}toString(){return\"LargeBinary\"}};x3t=Symbol.toStringTag;Y0[x3t]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=\"LargeBinary\"))(Y0.prototype);var $d=class extends tr{constructor(){super(Qt.Utf8)}toString(){return\"Utf8\"}};w3t=Symbol.toStringTag;$d[w3t]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=\"Utf8\"))($d.prototype);var X0=class extends tr{constructor(){super(Qt.LargeUtf8)}toString(){return\"LargeUtf8\"}};T3t=Symbol.toStringTag;X0[T3t]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=\"LargeUtf8\"))(X0.prototype);var Pu=class extends tr{constructor(){super(Qt.Bool)}toString(){return\"Bool\"}};S3t=Symbol.toStringTag;Pu[S3t]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=\"Bool\"))(Pu.prototype);var Gd=class extends tr{constructor(t,r,i=128){super(Qt.Decimal),this.scale=t,this.precision=r,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?\"+\":\"\"}${this.scale}]`}};M3t=Symbol.toStringTag;Gd[M3t]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=\"Decimal\"))(Gd.prototype);var Wd=class extends tr{constructor(t){super(Qt.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Ss[this.unit]}>`}get ArrayType(){return this.unit===Ss.DAY?Int32Array:BigInt64Array}};E3t=Symbol.toStringTag;Wd[E3t]=(e=>(e.unit=null,e[Symbol.toStringTag]=\"Date\"))(Wd.prototype);var qd=class extends tr{constructor(t,r){super(Qt.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${Ir[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};P3t=Symbol.toStringTag;qd[P3t]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=\"Time\"))(qd.prototype);var Hd=class extends tr{constructor(t,r){super(Qt.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${Ir[this.unit]}${this.timezone?`, ${this.timezone}`:\"\"}>`}};C3t=Symbol.toStringTag;Hd[C3t]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=\"Timestamp\"))(Hd.prototype);var Yd=class extends tr{constructor(t){super(Qt.Interval),this.unit=t}toString(){return`Interval<${mo[this.unit]}>`}};I3t=Symbol.toStringTag;Yd[I3t]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=\"Interval\"))(Yd.prototype);var Xd=class extends tr{constructor(t){super(Qt.Duration),this.unit=t}toString(){return`Duration<${Ir[this.unit]}>`}};k3t=Symbol.toStringTag;Xd[k3t]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=\"Duration\"))(Xd.prototype);var Oa=class extends tr{constructor(t){super(Qt.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};R3t=Symbol.toStringTag;Oa[R3t]=(e=>(e.children=null,e[Symbol.toStringTag]=\"List\"))(Oa.prototype);var jn=class extends tr{constructor(t){super(Qt.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(\", \")}}>`}};D3t=Symbol.toStringTag;jn[D3t]=(e=>(e.children=null,e[Symbol.toStringTag]=\"Struct\"))(jn.prototype);var Cu=class extends tr{constructor(t,r,i){super(Qt.Union),this.mode=t,this.children=i,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((n,o,s)=>(n[o]=s)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(\" | \")}>`}};O3t=Symbol.toStringTag;Cu[O3t]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=\"Union\"))(Cu.prototype);var Zd=class extends tr{constructor(t){super(Qt.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};L3t=Symbol.toStringTag;Zd[L3t]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=\"FixedSizeBinary\"))(Zd.prototype);var lc=class extends tr{constructor(t,r){super(Qt.FixedSizeList),this.listSize=t,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};B3t=Symbol.toStringTag;lc[B3t]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=\"FixedSizeList\"))(lc.prototype);var Iu=class extends tr{constructor(t,r=!1){var i,n,o;if(super(Qt.Map),this.children=[t],this.keysSorted=r,t&&(t.name=\"entries\",!((i=t?.type)===null||i===void 0)&&i.children)){let s=(n=t?.type)===null||n===void 0?void 0:n.children[0];s&&(s.name=\"key\");let a=(o=t?.type)===null||o===void 0?void 0:o.children[1];a&&(a.name=\"value\")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(\", \")}}>`}};F3t=Symbol.toStringTag;Iu[F3t]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=\"Map_\"))(Iu.prototype);var tKt=(e=>()=>++e)(-1),ku=class extends tr{constructor(t,r,i,n){super(Qt.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?tKt():cn(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};N3t=Symbol.toStringTag;ku[N3t]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=\"Dictionary\"))(ku.prototype);function kh(e){let t=e;switch(e.typeId){case Qt.Decimal:return e.bitWidth/32;case Qt.Interval:return t.unit===mo.MONTH_DAY_NANO?4:1+t.unit;case Qt.FixedSizeList:return t.listSize;case Qt.FixedSizeBinary:return t.byteWidth;default:return 1}}var jr=class{visitMany(t,...r){return t.map((i,n)=>this.visit(i,...r.map(o=>o[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return eKt(this,t,r)}getVisitFnByTypeId(t,r=!0){return q4(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};function eKt(e,t,r=!0){return typeof t==\"number\"?q4(e,t,r):typeof t==\"string\"&&t in Qt?q4(e,Qt[t],r):t&&t instanceof tr?q4(e,z3t(t),r):t?.type&&t.type instanceof tr?q4(e,z3t(t.type),r):q4(e,Qt.NONE,r)}function q4(e,t,r=!0){let i=null;switch(t){case Qt.Null:i=e.visitNull;break;case Qt.Bool:i=e.visitBool;break;case Qt.Int:i=e.visitInt;break;case Qt.Int8:i=e.visitInt8||e.visitInt;break;case Qt.Int16:i=e.visitInt16||e.visitInt;break;case Qt.Int32:i=e.visitInt32||e.visitInt;break;case Qt.Int64:i=e.visitInt64||e.visitInt;break;case Qt.Uint8:i=e.visitUint8||e.visitInt;break;case Qt.Uint16:i=e.visitUint16||e.visitInt;break;case Qt.Uint32:i=e.visitUint32||e.visitInt;break;case Qt.Uint64:i=e.visitUint64||e.visitInt;break;case Qt.Float:i=e.visitFloat;break;case Qt.Float16:i=e.visitFloat16||e.visitFloat;break;case Qt.Float32:i=e.visitFloat32||e.visitFloat;break;case Qt.Float64:i=e.visitFloat64||e.visitFloat;break;case Qt.Utf8:i=e.visitUtf8;break;case Qt.LargeUtf8:i=e.visitLargeUtf8;break;case Qt.Binary:i=e.visitBinary;break;case Qt.LargeBinary:i=e.visitLargeBinary;break;case Qt.FixedSizeBinary:i=e.visitFixedSizeBinary;break;case Qt.Date:i=e.visitDate;break;case Qt.DateDay:i=e.visitDateDay||e.visitDate;break;case Qt.DateMillisecond:i=e.visitDateMillisecond||e.visitDate;break;case Qt.Timestamp:i=e.visitTimestamp;break;case Qt.TimestampSecond:i=e.visitTimestampSecond||e.visitTimestamp;break;case Qt.TimestampMillisecond:i=e.visitTimestampMillisecond||e.visitTimestamp;break;case Qt.TimestampMicrosecond:i=e.visitTimestampMicrosecond||e.visitTimestamp;break;case Qt.TimestampNanosecond:i=e.visitTimestampNanosecond||e.visitTimestamp;break;case Qt.Time:i=e.visitTime;break;case Qt.TimeSecond:i=e.visitTimeSecond||e.visitTime;break;case Qt.TimeMillisecond:i=e.visitTimeMillisecond||e.visitTime;break;case Qt.TimeMicrosecond:i=e.visitTimeMicrosecond||e.visitTime;break;case Qt.TimeNanosecond:i=e.visitTimeNanosecond||e.visitTime;break;case Qt.Decimal:i=e.visitDecimal;break;case Qt.List:i=e.visitList;break;case Qt.Struct:i=e.visitStruct;break;case Qt.Union:i=e.visitUnion;break;case Qt.DenseUnion:i=e.visitDenseUnion||e.visitUnion;break;case Qt.SparseUnion:i=e.visitSparseUnion||e.visitUnion;break;case Qt.Dictionary:i=e.visitDictionary;break;case Qt.Interval:i=e.visitInterval;break;case Qt.IntervalDayTime:i=e.visitIntervalDayTime||e.visitInterval;break;case Qt.IntervalYearMonth:i=e.visitIntervalYearMonth||e.visitInterval;break;case Qt.IntervalMonthDayNano:i=e.visitIntervalMonthDayNano||e.visitInterval;break;case Qt.Duration:i=e.visitDuration;break;case Qt.DurationSecond:i=e.visitDurationSecond||e.visitDuration;break;case Qt.DurationMillisecond:i=e.visitDurationMillisecond||e.visitDuration;break;case Qt.DurationMicrosecond:i=e.visitDurationMicrosecond||e.visitDuration;break;case Qt.DurationNanosecond:i=e.visitDurationNanosecond||e.visitDuration;break;case Qt.FixedSizeList:i=e.visitFixedSizeList;break;case Qt.Map:i=e.visitMap;break}if(typeof i==\"function\")return i;if(!r)return()=>null;throw new Error(`Unrecognized type '${Qt[t]}'`)}function z3t(e){switch(e.typeId){case Qt.Null:return Qt.Null;case Qt.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?Qt.Int8:Qt.Uint8;case 16:return r?Qt.Int16:Qt.Uint16;case 32:return r?Qt.Int32:Qt.Uint32;case 64:return r?Qt.Int64:Qt.Uint64}return Qt.Int}case Qt.Float:switch(e.precision){case bn.HALF:return Qt.Float16;case bn.SINGLE:return Qt.Float32;case bn.DOUBLE:return Qt.Float64}return Qt.Float;case Qt.Binary:return Qt.Binary;case Qt.LargeBinary:return Qt.LargeBinary;case Qt.Utf8:return Qt.Utf8;case Qt.LargeUtf8:return Qt.LargeUtf8;case Qt.Bool:return Qt.Bool;case Qt.Decimal:return Qt.Decimal;case Qt.Time:switch(e.unit){case Ir.SECOND:return Qt.TimeSecond;case Ir.MILLISECOND:return Qt.TimeMillisecond;case Ir.MICROSECOND:return Qt.TimeMicrosecond;case Ir.NANOSECOND:return Qt.TimeNanosecond}return Qt.Time;case Qt.Timestamp:switch(e.unit){case Ir.SECOND:return Qt.TimestampSecond;case Ir.MILLISECOND:return Qt.TimestampMillisecond;case Ir.MICROSECOND:return Qt.TimestampMicrosecond;case Ir.NANOSECOND:return Qt.TimestampNanosecond}return Qt.Timestamp;case Qt.Date:switch(e.unit){case Ss.DAY:return Qt.DateDay;case Ss.MILLISECOND:return Qt.DateMillisecond}return Qt.Date;case Qt.Interval:switch(e.unit){case mo.DAY_TIME:return Qt.IntervalDayTime;case mo.YEAR_MONTH:return Qt.IntervalYearMonth;case mo.MONTH_DAY_NANO:return Qt.IntervalMonthDayNano}return Qt.Interval;case Qt.Duration:switch(e.unit){case Ir.SECOND:return Qt.DurationSecond;case Ir.MILLISECOND:return Qt.DurationMillisecond;case Ir.MICROSECOND:return Qt.DurationMicrosecond;case Ir.NANOSECOND:return Qt.DurationNanosecond}return Qt.Duration;case Qt.Map:return Qt.Map;case Qt.List:return Qt.List;case Qt.Struct:return Qt.Struct;case Qt.Union:switch(e.mode){case eo.Dense:return Qt.DenseUnion;case eo.Sparse:return Qt.SparseUnion}return Qt.Union;case Qt.FixedSizeBinary:return Qt.FixedSizeBinary;case Qt.FixedSizeList:return Qt.FixedSizeList;case Qt.Dictionary:return Qt.Dictionary}throw new Error(`Unrecognized type '${Qt[e.typeId]}'`)}jr.prototype.visitInt8=null;jr.prototype.visitInt16=null;jr.prototype.visitInt32=null;jr.prototype.visitInt64=null;jr.prototype.visitUint8=null;jr.prototype.visitUint16=null;jr.prototype.visitUint32=null;jr.prototype.visitUint64=null;jr.prototype.visitFloat16=null;jr.prototype.visitFloat32=null;jr.prototype.visitFloat64=null;jr.prototype.visitDateDay=null;jr.prototype.visitDateMillisecond=null;jr.prototype.visitTimestampSecond=null;jr.prototype.visitTimestampMillisecond=null;jr.prototype.visitTimestampMicrosecond=null;jr.prototype.visitTimestampNanosecond=null;jr.prototype.visitTimeSecond=null;jr.prototype.visitTimeMillisecond=null;jr.prototype.visitTimeMicrosecond=null;jr.prototype.visitTimeNanosecond=null;jr.prototype.visitDenseUnion=null;jr.prototype.visitSparseUnion=null;jr.prototype.visitIntervalDayTime=null;jr.prototype.visitIntervalYearMonth=null;jr.prototype.visitIntervalMonthDayNano=null;jr.prototype.visitDuration=null;jr.prototype.visitDurationSecond=null;jr.prototype.visitDurationMillisecond=null;jr.prototype.visitDurationMicrosecond=null;jr.prototype.visitDurationNanosecond=null;var ett={};Ql(ett,{float64ToUint16:()=>xI,uint16ToFloat64:()=>nN});var U3t=new Float64Array(1),H4=new Uint32Array(U3t.buffer);function nN(e){let t=(e&31744)>>10,r=(e&1023)/1024,i=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return i*(r?Number.NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*Math.pow(2,t-15)*(1+r)}function xI(e){if(e!==e)return 32256;U3t[0]=e;let t=(H4[1]&2147483648)>>16&65535,r=H4[1]&2146435072,i=0;return r>=1089470464?H4[0]>0?r=31744:(r=(r&2080374784)>>16,i=(H4[1]&1048575)>>10):r<=1056964608?(i=1048576+(H4[1]&1048575),i=1048576+(i<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,i=(H4[1]&1048575)+512>>10),t|r|i&65535}var Zr=class extends jr{};function si(e){return(t,r,i)=>{if(t.setValid(r,i!=null))return e(t,r,i)}}var rKt=(e,t,r)=>{e[t]=Math.floor(r/864e5)},V3t=(e,t,r,i)=>{if(r+1<t.length){let n=cn(t[r]),o=cn(t[r+1]);e.set(i.subarray(0,o-n),n)}},iKt=({offset:e,values:t},r,i)=>{let n=e+r;i?t[n>>3]|=1<<n%8:t[n>>3]&=~(1<<n%8)},dA=({values:e},t,r)=>{e[t]=r},rtt=({values:e},t,r)=>{e[t]=r},j3t=({values:e},t,r)=>{e[t]=xI(r)},nKt=(e,t,r)=>{switch(e.type.precision){case bn.HALF:return j3t(e,t,r);case bn.SINGLE:case bn.DOUBLE:return rtt(e,t,r)}},oN=({values:e},t,r)=>{rKt(e,t,r.valueOf())},sN=({values:e},t,r)=>{e[t]=BigInt(r)},itt=({stride:e,values:t},r,i)=>{t.set(i.subarray(0,e),e*r)},$3t=({values:e,valueOffsets:t},r,i)=>V3t(e,t,r,i),G3t=({values:e,valueOffsets:t},r,i)=>V3t(e,t,r,$0(i)),ntt=(e,t,r)=>{e.type.unit===Ss.DAY?oN(e,t,r):sN(e,t,r)},aN=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},lN=({values:e},t,r)=>{e[t]=BigInt(r)},cN=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},uN=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},ott=(e,t,r)=>{switch(e.type.unit){case Ir.SECOND:return aN(e,t,r);case Ir.MILLISECOND:return lN(e,t,r);case Ir.MICROSECOND:return cN(e,t,r);case Ir.NANOSECOND:return uN(e,t,r)}},hN=({values:e},t,r)=>{e[t]=r},dN=({values:e},t,r)=>{e[t]=r},fN=({values:e},t,r)=>{e[t]=r},pN=({values:e},t,r)=>{e[t]=r},stt=(e,t,r)=>{switch(e.type.unit){case Ir.SECOND:return hN(e,t,r);case Ir.MILLISECOND:return dN(e,t,r);case Ir.MICROSECOND:return fN(e,t,r);case Ir.NANOSECOND:return pN(e,t,r)}},att=({values:e,stride:t},r,i)=>{e.set(i.subarray(0,t),t*r)},oKt=(e,t,r)=>{let i=e.children[0],n=e.valueOffsets,o=Ol.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=n[t],h=n[t+1];a<h;)o(i,a++,r[++s]);else for(let s=-1,a=n[t],h=n[t+1];a<h;)o(i,a++,r.get(++s))},sKt=(e,t,r)=>{let i=e.children[0],{valueOffsets:n}=e,o=Ol.getVisitFn(i),{[t]:s,[t+1]:a}=n,h=r instanceof Map?r.entries():Object.entries(r);for(let p of h)if(o(i,s,p),++s>=a)break},aKt=(e,t)=>(r,i,n,o)=>i&&r(i,e,t[o]),lKt=(e,t)=>(r,i,n,o)=>i&&r(i,e,t.get(o)),cKt=(e,t)=>(r,i,n,o)=>i&&r(i,e,t.get(n.name)),uKt=(e,t)=>(r,i,n,o)=>i&&r(i,e,t[n.name]),hKt=(e,t,r)=>{let i=e.type.children.map(o=>Ol.getVisitFn(o.type)),n=r instanceof Map?cKt(t,r):r instanceof Er?lKt(t,r):Array.isArray(r)?aKt(t,r):uKt(t,r);e.type.children.forEach((o,s)=>n(i[s],e.children[s],o,s))},dKt=(e,t,r)=>{e.type.mode===eo.Dense?W3t(e,t,r):q3t(e,t,r)},W3t=(e,t,r)=>{let i=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[i];Ol.visit(n,e.valueOffsets[t],r)},q3t=(e,t,r)=>{let i=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[i];Ol.visit(n,t,r)},fKt=(e,t,r)=>{var i;(i=e.dictionary)===null||i===void 0||i.set(e.values[t],r)},ltt=(e,t,r)=>{switch(e.type.unit){case mo.YEAR_MONTH:return gN(e,t,r);case mo.DAY_TIME:return mN(e,t,r);case mo.MONTH_DAY_NANO:return AN(e,t,r)}},mN=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},gN=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},AN=({values:e,stride:t},r,i)=>{e.set(i.subarray(0,t),t*r)},yN=({values:e},t,r)=>{e[t]=r},_N=({values:e},t,r)=>{e[t]=r},vN=({values:e},t,r)=>{e[t]=r},bN=({values:e},t,r)=>{e[t]=r},ctt=(e,t,r)=>{switch(e.type.unit){case Ir.SECOND:return yN(e,t,r);case Ir.MILLISECOND:return _N(e,t,r);case Ir.MICROSECOND:return vN(e,t,r);case Ir.NANOSECOND:return bN(e,t,r)}},pKt=(e,t,r)=>{let{stride:i}=e,n=e.children[0],o=Ol.getVisitFn(n);if(Array.isArray(r))for(let s=-1,a=t*i;++s<i;)o(n,a+s,r[s]);else for(let s=-1,a=t*i;++s<i;)o(n,a+s,r.get(s))};Zr.prototype.visitBool=si(iKt);Zr.prototype.visitInt=si(dA);Zr.prototype.visitInt8=si(dA);Zr.prototype.visitInt16=si(dA);Zr.prototype.visitInt32=si(dA);Zr.prototype.visitInt64=si(dA);Zr.prototype.visitUint8=si(dA);Zr.prototype.visitUint16=si(dA);Zr.prototype.visitUint32=si(dA);Zr.prototype.visitUint64=si(dA);Zr.prototype.visitFloat=si(nKt);Zr.prototype.visitFloat16=si(j3t);Zr.prototype.visitFloat32=si(rtt);Zr.prototype.visitFloat64=si(rtt);Zr.prototype.visitUtf8=si(G3t);Zr.prototype.visitLargeUtf8=si(G3t);Zr.prototype.visitBinary=si($3t);Zr.prototype.visitLargeBinary=si($3t);Zr.prototype.visitFixedSizeBinary=si(itt);Zr.prototype.visitDate=si(ntt);Zr.prototype.visitDateDay=si(oN);Zr.prototype.visitDateMillisecond=si(sN);Zr.prototype.visitTimestamp=si(ott);Zr.prototype.visitTimestampSecond=si(aN);Zr.prototype.visitTimestampMillisecond=si(lN);Zr.prototype.visitTimestampMicrosecond=si(cN);Zr.prototype.visitTimestampNanosecond=si(uN);Zr.prototype.visitTime=si(stt);Zr.prototype.visitTimeSecond=si(hN);Zr.prototype.visitTimeMillisecond=si(dN);Zr.prototype.visitTimeMicrosecond=si(fN);Zr.prototype.visitTimeNanosecond=si(pN);Zr.prototype.visitDecimal=si(att);Zr.prototype.visitList=si(oKt);Zr.prototype.visitStruct=si(hKt);Zr.prototype.visitUnion=si(dKt);Zr.prototype.visitDenseUnion=si(W3t);Zr.prototype.visitSparseUnion=si(q3t);Zr.prototype.visitDictionary=si(fKt);Zr.prototype.visitInterval=si(ltt);Zr.prototype.visitIntervalDayTime=si(mN);Zr.prototype.visitIntervalYearMonth=si(gN);Zr.prototype.visitIntervalMonthDayNano=si(AN);Zr.prototype.visitDuration=si(ctt);Zr.prototype.visitDurationSecond=si(yN);Zr.prototype.visitDurationMillisecond=si(_N);Zr.prototype.visitDurationMicrosecond=si(vN);Zr.prototype.visitDurationNanosecond=si(bN);Zr.prototype.visitFixedSizeList=si(pKt);Zr.prototype.visitMap=si(sKt);var Ol=new Zr;var up=Symbol.for(\"parent\"),Y4=Symbol.for(\"rowIndex\"),r_=class{constructor(t,r){return this[up]=t,this[Y4]=r,new Proxy(this,mKt)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Y4],r=this[up],i=r.type.children,n={};for(let o=-1,s=i.length;++o<s;)n[i[o].name]=ga.visit(r.children[o],t);return n}toString(){return`{${[...this].map(([t,r])=>`${ap(t)}: ${ap(r)}`).join(\", \")}}`}[Symbol.for(\"nodejs.util.inspect.custom\")](){return this.toString()}[Symbol.iterator](){return new utt(this[up],this[Y4])}},utt=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,ga.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(r_.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:\"Row\"},[up]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Y4]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var htt=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[up].type.children.map(r=>r.name)}has(t,r){return t[up].type.children.some(i=>i.name===r)}getOwnPropertyDescriptor(t,r){if(t[up].type.children.some(i=>i.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let i=t[up].type.children.findIndex(n=>n.name===r);if(i!==-1){let n=ga.visit(t[up].children[i],t[Y4]);return Reflect.set(t,r,n),n}}set(t,r,i){let n=t[up].type.children.findIndex(o=>o.name===r);return n!==-1?(Ol.visit(t[up].children[n],t[Y4],i),Reflect.set(t,r,i)):Reflect.has(t,r)||typeof r==\"symbol\"?Reflect.set(t,r,i):!1}},mKt=new htt;var $r=class extends jr{};function ei(e){return(t,r)=>t.getValid(r)?e(t,r):null}var gKt=(e,t)=>864e5*e[t],AKt=(e,t)=>null,H3t=(e,t,r)=>{if(r+1>=t.length)return null;let i=cn(t[r]),n=cn(t[r+1]);return e.subarray(i,n)},yKt=({offset:e,values:t},r)=>{let i=e+r;return(t[i>>3]&1<<i%8)!==0},Y3t=({values:e},t)=>gKt(e,t),X3t=({values:e},t)=>cn(e[t]),i_=({stride:e,values:t},r)=>t[e*r],_Kt=({stride:e,values:t},r)=>nN(t[e*r]),Z3t=({values:e},t)=>e[t],vKt=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),K3t=({values:e,valueOffsets:t},r)=>H3t(e,t,r),Q3t=({values:e,valueOffsets:t},r)=>{let i=H3t(e,t,r);return i!==null?Q6(i):null},bKt=({values:e},t)=>e[t],xKt=({type:e,values:t},r)=>e.precision!==bn.HALF?t[r]:nN(t[r]),wKt=(e,t)=>e.type.unit===Ss.DAY?Y3t(e,t):X3t(e,t),J3t=({values:e},t)=>1e3*cn(e[t]),t4t=({values:e},t)=>cn(e[t]),e4t=({values:e},t)=>KJ(e[t],BigInt(1e3)),r4t=({values:e},t)=>KJ(e[t],BigInt(1e6)),TKt=(e,t)=>{switch(e.type.unit){case Ir.SECOND:return J3t(e,t);case Ir.MILLISECOND:return t4t(e,t);case Ir.MICROSECOND:return e4t(e,t);case Ir.NANOSECOND:return r4t(e,t)}},i4t=({values:e},t)=>e[t],n4t=({values:e},t)=>e[t],o4t=({values:e},t)=>e[t],s4t=({values:e},t)=>e[t],SKt=(e,t)=>{switch(e.type.unit){case Ir.SECOND:return i4t(e,t);case Ir.MILLISECOND:return n4t(e,t);case Ir.MICROSECOND:return o4t(e,t);case Ir.NANOSECOND:return s4t(e,t)}},MKt=({values:e,stride:t},r)=>dI.decimal(e.subarray(t*r,t*(r+1))),EKt=(e,t)=>{let{valueOffsets:r,stride:i,children:n}=e,{[t*i]:o,[t*i+1]:s}=r,h=n[0].slice(o,s-o);return new Er([h])},PKt=(e,t)=>{let{valueOffsets:r,children:i}=e,{[t]:n,[t+1]:o}=r,s=i[0];return new Z0(s.slice(n,o-n))},CKt=(e,t)=>new r_(e,t),IKt=(e,t)=>e.type.mode===eo.Dense?a4t(e,t):l4t(e,t),a4t=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];return ga.visit(i,e.valueOffsets[t])},l4t=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];return ga.visit(i,t)},kKt=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},RKt=(e,t)=>e.type.unit===mo.MONTH_DAY_NANO?h4t(e,t):e.type.unit===mo.DAY_TIME?c4t(e,t):u4t(e,t),c4t=({values:e},t)=>e.subarray(2*t,2*(t+1)),u4t=({values:e},t)=>{let r=e[t],i=new Int32Array(2);return i[0]=Math.trunc(r/12),i[1]=Math.trunc(r%12),i},h4t=({values:e},t)=>e.subarray(4*t,4*(t+1)),d4t=({values:e},t)=>e[t],f4t=({values:e},t)=>e[t],p4t=({values:e},t)=>e[t],m4t=({values:e},t)=>e[t],DKt=(e,t)=>{switch(e.type.unit){case Ir.SECOND:return d4t(e,t);case Ir.MILLISECOND:return f4t(e,t);case Ir.MICROSECOND:return p4t(e,t);case Ir.NANOSECOND:return m4t(e,t)}},OKt=(e,t)=>{let{stride:r,children:i}=e,o=i[0].slice(t*r,r);return new Er([o])};$r.prototype.visitNull=ei(AKt);$r.prototype.visitBool=ei(yKt);$r.prototype.visitInt=ei(bKt);$r.prototype.visitInt8=ei(i_);$r.prototype.visitInt16=ei(i_);$r.prototype.visitInt32=ei(i_);$r.prototype.visitInt64=ei(Z3t);$r.prototype.visitUint8=ei(i_);$r.prototype.visitUint16=ei(i_);$r.prototype.visitUint32=ei(i_);$r.prototype.visitUint64=ei(Z3t);$r.prototype.visitFloat=ei(xKt);$r.prototype.visitFloat16=ei(_Kt);$r.prototype.visitFloat32=ei(i_);$r.prototype.visitFloat64=ei(i_);$r.prototype.visitUtf8=ei(Q3t);$r.prototype.visitLargeUtf8=ei(Q3t);$r.prototype.visitBinary=ei(K3t);$r.prototype.visitLargeBinary=ei(K3t);$r.prototype.visitFixedSizeBinary=ei(vKt);$r.prototype.visitDate=ei(wKt);$r.prototype.visitDateDay=ei(Y3t);$r.prototype.visitDateMillisecond=ei(X3t);$r.prototype.visitTimestamp=ei(TKt);$r.prototype.visitTimestampSecond=ei(J3t);$r.prototype.visitTimestampMillisecond=ei(t4t);$r.prototype.visitTimestampMicrosecond=ei(e4t);$r.prototype.visitTimestampNanosecond=ei(r4t);$r.prototype.visitTime=ei(SKt);$r.prototype.visitTimeSecond=ei(i4t);$r.prototype.visitTimeMillisecond=ei(n4t);$r.prototype.visitTimeMicrosecond=ei(o4t);$r.prototype.visitTimeNanosecond=ei(s4t);$r.prototype.visitDecimal=ei(MKt);$r.prototype.visitList=ei(EKt);$r.prototype.visitStruct=ei(CKt);$r.prototype.visitUnion=ei(IKt);$r.prototype.visitDenseUnion=ei(a4t);$r.prototype.visitSparseUnion=ei(l4t);$r.prototype.visitDictionary=ei(kKt);$r.prototype.visitInterval=ei(RKt);$r.prototype.visitIntervalDayTime=ei(c4t);$r.prototype.visitIntervalYearMonth=ei(u4t);$r.prototype.visitIntervalMonthDayNano=ei(h4t);$r.prototype.visitDuration=ei(DKt);$r.prototype.visitDurationSecond=ei(d4t);$r.prototype.visitDurationMillisecond=ei(f4t);$r.prototype.visitDurationMicrosecond=ei(p4t);$r.prototype.visitDurationNanosecond=ei(m4t);$r.prototype.visitFixedSizeList=ei(OKt);$r.prototype.visitMap=ei(PKt);var ga=new $r;var n_=Symbol.for(\"keys\"),Z4=Symbol.for(\"vals\"),X4=Symbol.for(\"kKeysAsStrings\"),dtt=Symbol.for(\"_kKeysAsStrings\"),Z0=class{constructor(t){return this[n_]=new Er([t.children[0]]).memoize(),this[Z4]=t.children[1],new Proxy(this,new ptt)}get[X4](){return this[dtt]||(this[dtt]=Array.from(this[n_].toArray(),String))}[Symbol.iterator](){return new ftt(this[n_],this[Z4])}get size(){return this[n_].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[n_],r=this[Z4],i={};for(let n=-1,o=t.length;++n<o;)i[t.get(n)]=ga.visit(r,n);return i}toString(){return`{${[...this].map(([t,r])=>`${ap(t)}: ${ap(r)}`).join(\", \")}}`}[Symbol.for(\"nodejs.util.inspect.custom\")](){return this.toString()}},ftt=class{constructor(t,r){this.keys=t,this.vals=r,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),ga.visit(this.vals,t)]})}},ptt=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[X4]}has(t,r){return t[X4].includes(r)}getOwnPropertyDescriptor(t,r){if(t[X4].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let i=t[X4].indexOf(r);if(i!==-1){let n=ga.visit(Reflect.get(t,Z4),i);return Reflect.set(t,r,n),n}}set(t,r,i){let n=t[X4].indexOf(r);return n!==-1?(Ol.visit(Reflect.get(t,Z4),n,i),Reflect.set(t,r,i)):Reflect.has(t,r)?Reflect.set(t,r,i):!1}};Object.defineProperties(Z0.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:\"Row\"},[n_]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Z4]:{writable:!0,enumerable:!1,configurable:!1,value:null},[dtt]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var g4t;function wI(e,t,r,i){let{length:n=0}=e,o=typeof t!=\"number\"?0:t,s=typeof r!=\"number\"?n:r;return o<0&&(o=(o%n+n)%n),s<0&&(s=(s%n+n)%n),s<o&&(g4t=o,o=s,s=g4t),s>n&&(s=n),i?i(e,o,s):[o,s]}var ux=(e,t)=>e<0?t+e:e,A4t=e=>e!==e;function o_(e){if(typeof e!==\"object\"||e===null)return A4t(e)?A4t:r=>r===e;if(e instanceof Date){let r=e.valueOf();return i=>i instanceof Date?i.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?qJ(e,r):!1:e instanceof Map?BKt(e):Array.isArray(e)?LKt(e):e instanceof Er?FKt(e):NKt(e,!0)}function LKt(e){let t=[];for(let r=-1,i=e.length;++r<i;)t[r]=o_(e[r]);return xN(t)}function BKt(e){let t=-1,r=[];for(let i of e.values())r[++t]=o_(i);return xN(r)}function FKt(e){let t=[];for(let r=-1,i=e.length;++r<i;)t[r]=o_(e.get(r));return xN(t)}function NKt(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let i=[];for(let n=-1,o=r.length;++n<o;)i[n]=o_(e[r[n]]);return xN(i,r)}function xN(e,t){return r=>{if(!r||typeof r!=\"object\")return!1;switch(r.constructor){case Array:return zKt(e,r);case Map:return y4t(e,r,r.keys());case Z0:case r_:case Object:case void 0:return y4t(e,r,t||Object.keys(r))}return r instanceof Er?UKt(e,r):!1}}function zKt(e,t){let r=e.length;if(t.length!==r)return!1;for(let i=-1;++i<r;)if(!e[i](t[i]))return!1;return!0}function UKt(e,t){let r=e.length;if(t.length!==r)return!1;for(let i=-1;++i<r;)if(!e[i](t.get(i)))return!1;return!0}function y4t(e,t,r){let i=r[Symbol.iterator](),n=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,h=o.next(),p=i.next(),g=n.next();for(;s<a&&!p.done&&!g.done&&!h.done&&!(p.value!==g.value||!e[s](h.value));++s,p=i.next(),g=n.next(),h=o.next());return s===a&&p.done&&g.done&&h.done?!0:(i.return&&i.return(),n.return&&n.return(),o.return&&o.return(),!1)}var gtt={};Ql(gtt,{BitIterator:()=>hx,getBit:()=>_4t,getBool:()=>TN,packBools:()=>fx,popcnt_array:()=>v4t,popcnt_bit_range:()=>TI,popcnt_uint32:()=>wN,setBool:()=>VKt,truncateBitmap:()=>dx});function TN(e,t,r,i){return(r&1<<i)!==0}function _4t(e,t,r,i){return(r&1<<i)>>i}function VKt(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function dx(e,t,r){let i=r.byteLength+7&-8;if(e>0||r.byteLength<i){let n=new Uint8Array(i);return n.set(e%8===0?r.subarray(e>>3):fx(new hx(r,e,t,null,TN)).subarray(0,i)),n}return r}function fx(e){let t=[],r=0,i=0,n=0;for(let s of e)s&&(n|=1<<i),++i===8&&(t[r++]=n,n=i=0);(r===0||i>0)&&(t[r++]=n);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var hx=class{constructor(t,r,i,n,o){this.bytes=t,this.length=i,this.context=n,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function TI(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new hx(e,t,r-t,e,_4t))o+=s;return o}let i=r>>3<<3,n=t+(t%8===0?0:8-t%8);return TI(e,t,n)+TI(e,i,r)+v4t(e,n>>3,i-n>>3)}function v4t(e,t,r){let i=0,n=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:n+r;for(;s-n>=4;)i+=wN(o.getUint32(n)),n+=4;for(;s-n>=2;)i+=wN(o.getUint16(n)),n+=2;for(;s-n>=1;)i+=wN(o.getUint8(n)),n+=1;return i}function wN(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var jKt=-1,Fi=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return tr.isSparseUnion(t)?this.children.some(r=>r.nullable):tr.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:i,nullBitmap:n,typeIds:o}=this;return r&&(t+=r.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(tr.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,r;return t<=jKt&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-TI(r,this.offset,this.offset+this.length)),t}constructor(t,r,i,n,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let h;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=kh(t),o&&((h=o[0])&&(this.valueOffsets=h),(h=o[1])&&(this.values=h),(h=o[2])&&(this.nullBitmap=h),(h=o[3])&&(this.typeIds=h)))}getValid(t){let{type:r}=this;if(tr.isUnion(r)){let i=r,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],o=i.mode===eo.Dense?this.valueOffsets[t]:t;return n.getValid(o)}if(this.nullable&&this.nullCount>0){let i=this.offset+t;return(this.nullBitmap[i>>3]&1<<i%8)!==0}return!0}setValid(t,r){let i,{type:n}=this;if(tr.isUnion(n)){let o=n,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===eo.Dense?this.valueOffsets[t]:t;i=s.getValid(a),s.setValid(a,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,h=s+t,p=1<<h%8,g=h>>3;(!o||o.byteLength<=g)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(dx(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let w=o[g];i=(w&p)!==0,o[g]=r?w|p:w&~p}return i!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,i=this.length,n=this._nullCount,o=this,s=this.children){return new e(t,r,i,n,o,s,this.dictionary)}slice(t,r){let{stride:i,typeId:n,children:o}=this,s=+(this._nullCount===0)-1,a=n===16?i:1,h=this._sliceBuffers(t,r,i,n);return this.clone(this.type,this.offset+t,r,s,h,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===Qt.Null)return this.clone(this.type,0,t,0);let{length:r,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);n[r>>3]=(1<<r-(r&-8))-1,i>0&&n.set(dx(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Hi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-r),o)}_sliceBuffers(t,r,i,n){let o,{buffers:s}=this;return(o=s[Hi.TYPE])&&(s[Hi.TYPE]=o.subarray(t,t+r)),(o=s[Hi.OFFSET])&&(s[Hi.OFFSET]=o.subarray(t,t+r+1))||(o=s[Hi.DATA])&&(s[Hi.DATA]=n===6?o:o.subarray(i*t,i*(t+r))),s}_sliceChildren(t,r,i){return t.map(n=>n.slice(r,i))}};Fi.prototype.children=Object.freeze([]);var Att=class e extends jr{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"length\"]:n=0}=t;return new Fi(r,i,n,n)}visitBool(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length>>3,[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitInt(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length,[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitFloat(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length,[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitUtf8(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.data),o=Qr(t.nullBitmap),s=sx(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,n,o])}visitLargeUtf8(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.data),o=Qr(t.nullBitmap),s=QF(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,n,o])}visitBinary(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.data),o=Qr(t.nullBitmap),s=sx(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,n,o])}visitLargeBinary(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.data),o=Qr(t.nullBitmap),s=QF(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,n,o])}visitFixedSizeBinary(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitDate(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitTimestamp(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitTime(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitDecimal(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitList(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"child\"]:n}=t,o=Qr(t.nullBitmap),s=sx(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,void 0,o],[n])}visitStruct(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"children\"]:n=[]}=t,o=Qr(t.nullBitmap),{length:s=n.reduce((h,{length:p})=>Math.max(h,p),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,void 0,o],n)}visitUnion(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"children\"]:n=[]}=t,o=Oi(r.ArrayType,t.typeIds),{[\"length\"]:s=o.length,[\"nullCount\"]:a=-1}=t;if(tr.isSparseUnion(r))return new Fi(r,i,s,a,[void 0,void 0,void 0,o],n);let h=sx(t.valueOffsets);return new Fi(r,i,s,a,[h,void 0,void 0,o],n)}visitDictionary(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.indices.ArrayType,t.data),{[\"dictionary\"]:s=new Er([new e().visit({type:r.dictionary})])}=t,{[\"length\"]:a=o.length,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[void 0,o,n],[],s)}visitInterval(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitDuration(t){let{[\"type\"]:r,[\"offset\"]:i=0}=t,n=Qr(t.nullBitmap),o=Oi(r.ArrayType,t.data),{[\"length\"]:s=o.length,[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,o,n])}visitFixedSizeList(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"child\"]:n=new e().visit({type:r.valueType})}=t,o=Qr(t.nullBitmap),{[\"length\"]:s=n.length/kh(r),[\"nullCount\"]:a=t.nullBitmap?-1:0}=t;return new Fi(r,i,s,a,[void 0,void 0,o],[n])}visitMap(t){let{[\"type\"]:r,[\"offset\"]:i=0,[\"child\"]:n=new e().visit({type:r.childType})}=t,o=Qr(t.nullBitmap),s=sx(t.valueOffsets),{[\"length\"]:a=s.length-1,[\"nullCount\"]:h=t.nullBitmap?-1:0}=t;return new Fi(r,i,a,h,[s,void 0,o],[n])}},$Kt=new Att;function Pr(e){return $Kt.visit(e)}var SI=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function b4t(e){return e.some(t=>t.nullable)}function SN(e){return e.reduce((t,r)=>t+r.nullCount,0)}function MN(e){return e.reduce((t,r,i)=>(t[i+1]=t[i]+r.length,t),new Uint32Array(e.length+1))}function EN(e,t,r,i){let n=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],h=t[o],{length:p}=a;if(h>=i)break;if(r>=h+p)continue;if(h>=r&&h+p<=i){n.push(a);continue}let g=Math.max(0,r-h),w=Math.min(i-h,p);n.push(a.slice(g,w-g))}return n.length===0&&n.push(e[0].slice(0,0)),n}function ytt(e,t,r,i){let n=0,o=0,s=t.length-1;do{if(n>=s-1)return r<t[s]?i(e,n,r-t[n]):null;o=n+Math.trunc((s-n)*.5),r<t[o]?s=o:n=o}while(n<s)}function MI(e,t){return e.getValid(t)}function K4(e){function t(r,i,n){return e(r[i],n)}return function(r){let i=this.data;return ytt(i,this._offsets,r,t)}}function PN(e){let t;function r(i,n,o){return e(i[n],o,t)}return function(i,n){let o=this.data;t=n;let s=ytt(o,this._offsets,i,r);return t=void 0,s}}function CN(e){let t;function r(i,n,o){let s=o,a=0,h=0;for(let p=n-1,g=i.length;++p<g;){let w=i[p];if(~(a=e(w,t,s)))return h+a;s=0,h+=w.length}return-1}return function(i,n){t=i;let o=this.data,s=typeof n!=\"number\"?r(o,0,0):ytt(o,this._offsets,n,r);return t=void 0,s}}var Gr=class extends jr{};function GKt(e,t){return t===null&&e.length>0?0:-1}function WKt(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let i=0;for(let n of new hx(r,e.offset+(t||0),e.length,r,TN)){if(!n)return i;++i}return-1}function di(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case Qt.Union:break;case Qt.Dictionary:break;default:return WKt(e,r)}let i=ga.getVisitFn(e),n=o_(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(n(i(e,o)))return o;return-1}function x4t(e,t,r){let i=ga.getVisitFn(e),n=o_(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(n(i(e,o)))return o;return-1}Gr.prototype.visitNull=GKt;Gr.prototype.visitBool=di;Gr.prototype.visitInt=di;Gr.prototype.visitInt8=di;Gr.prototype.visitInt16=di;Gr.prototype.visitInt32=di;Gr.prototype.visitInt64=di;Gr.prototype.visitUint8=di;Gr.prototype.visitUint16=di;Gr.prototype.visitUint32=di;Gr.prototype.visitUint64=di;Gr.prototype.visitFloat=di;Gr.prototype.visitFloat16=di;Gr.prototype.visitFloat32=di;Gr.prototype.visitFloat64=di;Gr.prototype.visitUtf8=di;Gr.prototype.visitLargeUtf8=di;Gr.prototype.visitBinary=di;Gr.prototype.visitLargeBinary=di;Gr.prototype.visitFixedSizeBinary=di;Gr.prototype.visitDate=di;Gr.prototype.visitDateDay=di;Gr.prototype.visitDateMillisecond=di;Gr.prototype.visitTimestamp=di;Gr.prototype.visitTimestampSecond=di;Gr.prototype.visitTimestampMillisecond=di;Gr.prototype.visitTimestampMicrosecond=di;Gr.prototype.visitTimestampNanosecond=di;Gr.prototype.visitTime=di;Gr.prototype.visitTimeSecond=di;Gr.prototype.visitTimeMillisecond=di;Gr.prototype.visitTimeMicrosecond=di;Gr.prototype.visitTimeNanosecond=di;Gr.prototype.visitDecimal=di;Gr.prototype.visitList=di;Gr.prototype.visitStruct=di;Gr.prototype.visitUnion=di;Gr.prototype.visitDenseUnion=x4t;Gr.prototype.visitSparseUnion=x4t;Gr.prototype.visitDictionary=di;Gr.prototype.visitInterval=di;Gr.prototype.visitIntervalDayTime=di;Gr.prototype.visitIntervalYearMonth=di;Gr.prototype.visitIntervalMonthDayNano=di;Gr.prototype.visitDuration=di;Gr.prototype.visitDurationSecond=di;Gr.prototype.visitDurationMillisecond=di;Gr.prototype.visitDurationMicrosecond=di;Gr.prototype.visitDurationNanosecond=di;Gr.prototype.visitFixedSizeList=di;Gr.prototype.visitMap=di;var px=new Gr;var Wr=class extends jr{};function ri(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(tr.isInt(t)&&t.bitWidth!==64||tr.isTime(t)&&t.bitWidth!==64||tr.isFloat(t)&&t.precision!==bn.HALF))return new SI(e.data.length,i=>{let n=e.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let r=0;return new SI(e.data.length,i=>{let o=e.data[i].length,s=e.slice(r,r+o);return r+=o,new _tt(s)})}var _tt=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};Wr.prototype.visitNull=ri;Wr.prototype.visitBool=ri;Wr.prototype.visitInt=ri;Wr.prototype.visitInt8=ri;Wr.prototype.visitInt16=ri;Wr.prototype.visitInt32=ri;Wr.prototype.visitInt64=ri;Wr.prototype.visitUint8=ri;Wr.prototype.visitUint16=ri;Wr.prototype.visitUint32=ri;Wr.prototype.visitUint64=ri;Wr.prototype.visitFloat=ri;Wr.prototype.visitFloat16=ri;Wr.prototype.visitFloat32=ri;Wr.prototype.visitFloat64=ri;Wr.prototype.visitUtf8=ri;Wr.prototype.visitLargeUtf8=ri;Wr.prototype.visitBinary=ri;Wr.prototype.visitLargeBinary=ri;Wr.prototype.visitFixedSizeBinary=ri;Wr.prototype.visitDate=ri;Wr.prototype.visitDateDay=ri;Wr.prototype.visitDateMillisecond=ri;Wr.prototype.visitTimestamp=ri;Wr.prototype.visitTimestampSecond=ri;Wr.prototype.visitTimestampMillisecond=ri;Wr.prototype.visitTimestampMicrosecond=ri;Wr.prototype.visitTimestampNanosecond=ri;Wr.prototype.visitTime=ri;Wr.prototype.visitTimeSecond=ri;Wr.prototype.visitTimeMillisecond=ri;Wr.prototype.visitTimeMicrosecond=ri;Wr.prototype.visitTimeNanosecond=ri;Wr.prototype.visitDecimal=ri;Wr.prototype.visitList=ri;Wr.prototype.visitStruct=ri;Wr.prototype.visitUnion=ri;Wr.prototype.visitDenseUnion=ri;Wr.prototype.visitSparseUnion=ri;Wr.prototype.visitDictionary=ri;Wr.prototype.visitInterval=ri;Wr.prototype.visitIntervalDayTime=ri;Wr.prototype.visitIntervalYearMonth=ri;Wr.prototype.visitIntervalMonthDayNano=ri;Wr.prototype.visitDuration=ri;Wr.prototype.visitDurationSecond=ri;Wr.prototype.visitDurationMillisecond=ri;Wr.prototype.visitDurationMicrosecond=ri;Wr.prototype.visitDurationNanosecond=ri;Wr.prototype.visitFixedSizeList=ri;Wr.prototype.visitMap=ri;var Q4=new Wr;var w4t,T4t={},S4t={},Er=class e{constructor(t){var r,i,n;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof Fi)))throw new TypeError(\"Vector constructor expects an Array of Data instances.\");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:h,indexOf:p}=T4t[s.typeId],g=o[0];this.isValid=w=>MI(g,w),this.get=w=>a(g,w),this.set=(w,C)=>h(g,w,C),this.indexOf=w=>p(g,w),this._offsets=[0,g.length];break}default:Object.setPrototypeOf(this,S4t[s.typeId]),this._offsets=MN(o);break}this.data=o,this.type=s,this.stride=kh(s),this.numChildren=(n=(i=s.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return b4t(this.data)}get nullCount(){return SN(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${Qt[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(ux(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return Q4.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(wI(this,t,r,({data:i,_offsets:n},o,s)=>EN(i,n,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:i,stride:n,ArrayType:o}=this;switch(t.typeId){case Qt.Int:case Qt.Float:case Qt.Decimal:case Qt.Time:case Qt.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,i*n);default:return r.reduce((s,{values:a,length:h})=>(s.array.set(a.subarray(0,h*n),s.offset),s.offset+=h*n,s),{array:new o(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(\",\")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return tr.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(tr.isDictionary(this.type)){let t=new IN(this.data[0].dictionary),r=this.data.map(i=>{let n=i.clone();return n.dictionary=t,n});return new e(r)}return new IN(this)}unmemoize(){if(tr.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(i=>{let n=i.clone();return n.dictionary=t,n});return new e(r)}return this}};w4t=Symbol.toStringTag;Er[w4t]=(e=>{e.type=tr.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(Qt).map(r=>Qt[r]).filter(r=>typeof r==\"number\"&&r!==Qt.NONE);for(let r of t){let i=ga.getVisitFnByTypeId(r),n=Ol.getVisitFnByTypeId(r),o=px.getVisitFnByTypeId(r);T4t[r]={get:i,set:n,indexOf:o},S4t[r]=Object.create(e,{isValid:{value:K4(MI)},get:{value:K4(ga.getVisitFnByTypeId(r))},set:{value:PN(Ol.getVisitFnByTypeId(r))},indexOf:{value:CN(px.getVisitFnByTypeId(r))}})}return\"Vector\"})(Er.prototype);var IN=class e extends Er{constructor(t){super(t.data);let r=this.get,i=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,\"get\",{value(s){let a=o[s];if(a!==void 0)return a;let h=r.call(this,s);return o[s]=h,h}}),Object.defineProperty(this,\"set\",{value(s,a){i.call(this,s,a),o[s]=a}}),Object.defineProperty(this,\"slice\",{value:(s,a)=>new e(n.call(this,s,a))}),Object.defineProperty(this,\"isMemoized\",{value:!0}),Object.defineProperty(this,\"unmemoize\",{value:()=>new Er(this.data)}),Object.defineProperty(this,\"memoize\",{value:()=>this})}};function M4t(e){if(!e||e.length<=0)return function(n){return!0};let t=\"\",r=e.filter(i=>i===i);return r.length>0&&(t=`\n    switch (x) {${r.map(i=>`\n        case ${qKt(i)}:`).join(\"\")}\n            return false;\n    }`),e.length!==r.length&&(t=`if (x !== x) return false;\n${t}`),new Function(\"x\",`${t}\nreturn true;`)}function qKt(e){return typeof e!=\"bigint\"?ap(e):`${ap(e)}n`}function vtt(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function E4t(e,t=0){return e.length>=t?e.subarray(0,t):tI(new e.constructor(t),e,0)}var hp=class{constructor(t,r=0,i=1){this.length=Math.ceil(r/i),this.buffer=new t(this.length),this.stride=i,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,i=this.length*r,n=this.buffer.length;i>=n&&this._resize(n===0?vtt(i*1,this.BYTES_PER_ELEMENT):vtt(i*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=vtt(t*this.stride,this.BYTES_PER_ELEMENT);let r=E4t(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=E4t(this.buffer,t)}},fA=class extends hp{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},J4=class extends fA{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){let{buffer:i}=this.reserve(t-this.length+1),n=t>>3,o=t%8,s=i[n]>>o&1;return r?s===0&&(i[n]|=1<<o,++this.numValid):s===1&&(i[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},tT=class extends fA{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let i=this.length-1,n=this.reserve(t-i+1).buffer;return i<t++&&i>=0&&n.fill(n[i],i,t),n[t]=n[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var Vo=class{static throughNode(t){throw new Error('\"throughNode\" not available in this environment')}static throughDOM(t){throw new Error('\"throughDOM\" not available in this environment')}constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=kh(t),this._nulls=new J4,r&&r.length>0&&(this._isValid=M4t(r))}toVector(){return new Er([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:r,_values:i,_nulls:n,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),s.reduce((a,h)=>a+h.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,i)=>r+i.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type \"${this.type}\"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,i,n,{type:o,length:s,nullCount:a,_typeIds:h,_offsets:p,_values:g,_nulls:w}=this;(r=h?.flush(s))?n=p?.flush(s):(n=p?.flush(s))?t=g?.flush(p.last()):t=g?.flush(s),a>0&&(i=w?.flush(s));let C=this.children.map(R=>R.flush());return this.clear(),Pr({type:o,length:s,nullCount:a,children:C,child:C[0],data:t,typeIds:r,nullBitmap:i,valueOffsets:n})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,i,n;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(i=this._offsets)===null||i===void 0||i.clear(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};Vo.prototype.length=1;Vo.prototype.stride=1;Vo.prototype.children=null;Vo.prototype.finished=!1;Vo.prototype.nullValues=null;Vo.prototype._isValid=()=>!0;var Aa=class extends Vo{constructor(t){super(t),this._values=new fA(this.ArrayType,0,this.stride)}setValue(t,r){let i=this._values;return i.reserve(t-i.length+1),super.setValue(t,r)}},Ru=class extends Vo{constructor(t){super(t),this._pendingLength=0,this._offsets=new tT(t.type)}setValue(t,r){let i=this._pending||(this._pending=new Map),n=i.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=r instanceof Z0?r[n_].length:r.length,i.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}};var mx=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,r,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(r??0)),t.offset()}};var Rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):In.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Eu).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let i=this.bb.__offset(this.bb_pos,8);return i?(r||new mx).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let i=this.bb.__offset(this.bb_pos,10);return i?(r||new mx).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let i=this.bb.__offset(this.bb_pos,12);return i?(r||new Da).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,In.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}};var xn=class e{constructor(t=[],r,i,n=In.V5){this.fields=t||[],this.metadata=r||new Map,i||(i=btt(this.fields)),this.dictionaries=i,this.metadataVersion=n}get[Symbol.toStringTag](){return\"Schema\"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(\", \")} }>`}select(t){let r=new Set(t),i=this.fields.filter(n=>r.has(n.name));return new e(i,this.metadata)}selectAt(t){let r=t.map(i=>this.fields[i]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),i=[...this.fields],n=kN(kN(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let h=i.findIndex(p=>p.name===a.name);return~h?(i[h]=a.clone({metadata:kN(kN(new Map,i[h].metadata),a.metadata)}))&&!1:!0}),s=btt(o,new Map);return new e([...i,...o],n,new Map([...this.dictionaries,...s]))}};xn.prototype.fields=null;xn.prototype.metadata=null;xn.prototype.dictionaries=null;var mi=class e{static new(...t){let[r,i,n,o]=t;return t[0]&&typeof t[0]==\"object\"&&({name:r}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,i,n,o)}constructor(t,r,i=!1,n){this.name=t,this.type=r,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return\"Field\"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[r,i,n,o]=t;return!t[0]||typeof t[0]!=\"object\"?[r=this.name,i=this.type,n=this.nullable,o=this.metadata]=t:{name:r=this.name,type:i=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,i,n,o)}};mi.prototype.type=null;mi.prototype.name=null;mi.prototype.nullable=null;mi.prototype.metadata=null;function kN(e,t){return new Map([...e||new Map,...t||new Map])}function btt(e,t=new Map){for(let r=-1,i=e.length;++r<i;){let o=e[r].type;if(tr.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error(\"Cannot create Schema containing two different dictionaries with the same Id\")}o.children&&o.children.length>0&&btt(o.children,t)}return t}var HKt=ax,YKt=Dl,pA=class{static decode(t){t=new YKt(Qr(t));let r=Rh.getRootAsFooter(t),i=xn.decode(r.schema(),new Map,r.version());return new xtt(i,r)}static encode(t){let r=new HKt,i=xn.encode(r,t.schema);Rh.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())mA.encode(r,s);let n=r.endVector();Rh.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())mA.encode(r,s);let o=r.endVector();return Rh.startFooter(r),Rh.addSchema(r,i),Rh.addVersion(r,In.V5),Rh.addRecordBatches(r,n),Rh.addDictionaries(r,o),Rh.finishFooterBuffer(r,Rh.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=In.V5,i,n){this.schema=t,this.version=r,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,r=-1,i=this.numRecordBatches;++r<i;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,i=this.numDictionaries;++r<i;)(t=this.getDictionaryBatch(r))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var xtt=class extends pA{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return mA.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return mA.decode(r)}return null}},mA=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:i}=r,n=BigInt(r.offset),o=BigInt(r.bodyLength);return mx.createBlock(t,n,i,o)}constructor(t,r,i){this.metaDataLength=t,this.offset=cn(i),this.bodyLength=cn(r)}};var dp=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):In.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):zi.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt(\"0\")}customMetadata(t,r){let i=this.bb.__offset(this.bb_pos,12);return i?(r||new Da).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,In.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,zi.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt(\"0\"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let i=r.length-1;i>=0;i--)t.addOffset(r[i]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,i,n,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,i),e.addHeader(t,n),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var wtt=class extends jr{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return lI.startNull(r),lI.endNull(r)}visitInt(t,r){return op.startInt(r),op.addBitWidth(r,t.bitWidth),op.addIsSigned(r,t.isSigned),op.endInt(r)}visitFloat(t,r){return J1.startFloatingPoint(r),J1.addPrecision(r,t.precision),J1.endFloatingPoint(r)}visitBinary(t,r){return iI.startBinary(r),iI.endBinary(r)}visitLargeBinary(t,r){return oI.startLargeBinary(r),oI.endLargeBinary(r)}visitBool(t,r){return nI.startBool(r),nI.endBool(r)}visitUtf8(t,r){return uI.startUtf8(r),uI.endUtf8(r)}visitLargeUtf8(t,r){return sI.startLargeUtf8(r),sI.endLargeUtf8(r)}visitDecimal(t,r){return H0.startDecimal(r),H0.addScale(r,t.scale),H0.addPrecision(r,t.precision),H0.addBitWidth(r,t.bitWidth),H0.endDecimal(r)}visitDate(t,r){return X1.startDate(r),X1.addUnit(r,t.unit),X1.endDate(r)}visitTime(t,r){return uA.startTime(r),uA.addUnit(r,t.unit),uA.addBitWidth(r,t.bitWidth),uA.endTime(r)}visitTimestamp(t,r){let i=t.timezone&&r.createString(t.timezone)||void 0;return hA.startTimestamp(r),hA.addUnit(r,t.unit),i!==void 0&&hA.addTimezone(r,i),hA.endTimestamp(r)}visitInterval(t,r){return t_.startInterval(r),t_.addUnit(r,t.unit),t_.endInterval(r)}visitDuration(t,r){return Z1.startDuration(r),Z1.addUnit(r,t.unit),Z1.endDuration(r)}visitList(t,r){return aI.startList(r),aI.endList(r)}visitStruct(t,r){return cI.startStruct_(r),cI.endStruct_(r)}visitUnion(t,r){sp.startTypeIdsVector(r,t.typeIds.length);let i=sp.createTypeIdsVector(r,t.typeIds);return sp.startUnion(r),sp.addMode(r,t.mode),sp.addTypeIds(r,i),sp.endUnion(r)}visitDictionary(t,r){let i=this.visit(t.indices,r);return q0.startDictionaryEncoding(r),q0.addId(r,BigInt(t.id)),q0.addIsOrdered(r,t.isOrdered),i!==void 0&&q0.addIndexType(r,i),q0.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return K1.startFixedSizeBinary(r),K1.addByteWidth(r,t.byteWidth),K1.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Q1.startFixedSizeList(r),Q1.addListSize(r,t.listSize),Q1.endFixedSizeList(r)}visitMap(t,r){return e_.startMap(r),e_.addKeysSorted(r,t.keysSorted),e_.endMap(r)}},RN=new wtt;function k4t(e,t=new Map){return new xn(XKt(e,t),DN(e.metadata),t)}function Ttt(e){return new _a(e.count,D4t(e.columns),O4t(e.columns),null)}function R4t(e){return new cc(Ttt(e.data),e.id,e.isDelta)}function XKt(e,t){return(e.fields||[]).filter(Boolean).map(r=>mi.fromJSON(r,t))}function P4t(e,t){return(e.children||[]).filter(Boolean).map(r=>mi.fromJSON(r,t))}function D4t(e){return(e||[]).reduce((t,r)=>[...t,new Kd(r.count,ZKt(r.VALIDITY)),...D4t(r.children)],[])}function O4t(e,t=[]){for(let r=-1,i=(e||[]).length;++r<i;){let n=e[r];n.VALIDITY&&t.push(new ya(t.length,n.VALIDITY.length)),n.TYPE_ID&&t.push(new ya(t.length,n.TYPE_ID.length)),n.OFFSET&&t.push(new ya(t.length,n.OFFSET.length)),n.DATA&&t.push(new ya(t.length,n.DATA.length)),t=O4t(n.children,t)}return t}function ZKt(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function L4t(e,t){let r,i,n,o,s,a;return!t||!(o=e.dictionary)?(s=I4t(e,P4t(e,t)),n=new mi(e.name,s,e.nullable,DN(e.metadata))):t.has(r=o.id)?(i=(i=o.indexType)?C4t(i):new cp,a=new ku(t.get(r),i,r,o.isOrdered),n=new mi(e.name,a,e.nullable,DN(e.metadata))):(i=(i=o.indexType)?C4t(i):new cp,t.set(r,s=I4t(e,P4t(e,t))),a=new ku(s,i,r,o.isOrdered),n=new mi(e.name,a,e.nullable,DN(e.metadata))),n||null}function DN(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function C4t(e){return new Ms(e.isSigned,e.bitWidth)}function I4t(e,t){let r=e.type.name;switch(r){case\"NONE\":return new sl;case\"null\":return new sl;case\"binary\":return new jd;case\"largebinary\":return new Y0;case\"utf8\":return new $d;case\"largeutf8\":return new X0;case\"bool\":return new Pu;case\"list\":return new Oa((t||[])[0]);case\"struct\":return new jn(t||[]);case\"struct_\":return new jn(t||[])}switch(r){case\"int\":{let i=e.type;return new Ms(i.isSigned,i.bitWidth)}case\"floatingpoint\":{let i=e.type;return new al(bn[i.precision])}case\"decimal\":{let i=e.type;return new Gd(i.scale,i.precision,i.bitWidth)}case\"date\":{let i=e.type;return new Wd(Ss[i.unit])}case\"time\":{let i=e.type;return new qd(Ir[i.unit],i.bitWidth)}case\"timestamp\":{let i=e.type;return new Hd(Ir[i.unit],i.timezone)}case\"interval\":{let i=e.type;return new Yd(mo[i.unit])}case\"duration\":{let i=e.type;return new Xd(Ir[i.unit])}case\"union\":{let i=e.type,[n,...o]=(i.mode+\"\").toLowerCase(),s=n.toUpperCase()+o.join(\"\");return new Cu(eo[s],i.typeIds||[],t||[])}case\"fixedsizebinary\":{let i=e.type;return new Zd(i.byteWidth)}case\"fixedsizelist\":{let i=e.type;return new lc(i.listSize,(t||[])[0])}case\"map\":{let i=e.type;return new Iu((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: \"${r}\"`)}var KKt=ax,QKt=Dl,Du=class e{static fromJSON(t,r){let i=new e(0,In.V5,r);return i._createHeader=JKt(t,r),i}static decode(t){t=new QKt(Qr(t));let r=dp.getRootAsMessage(t),i=r.bodyLength(),n=r.version(),o=r.headerType(),s=new e(i,n,o);return s._createHeader=tQt(r,o),s}static encode(t){let r=new KKt,i=-1;return t.isSchema()?i=xn.encode(r,t.header()):t.isRecordBatch()?i=_a.encode(r,t.header()):t.isDictionaryBatch()&&(i=cc.encode(r,t.header())),dp.startMessage(r),dp.addVersion(r,In.V5),dp.addHeader(r,i),dp.addHeaderType(r,t.headerType),dp.addBodyLength(r,BigInt(t.bodyLength)),dp.finishMessageBuffer(r,dp.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof xn)return new e(0,In.V5,zi.Schema,t);if(t instanceof _a)return new e(r,In.V5,zi.RecordBatch,t);if(t instanceof cc)return new e(r,In.V5,zi.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===zi.Schema}isRecordBatch(){return this.headerType===zi.RecordBatch}isDictionaryBatch(){return this.headerType===zi.DictionaryBatch}constructor(t,r,i,n){this._version=r,this._headerType=i,this.body=new Uint8Array(0),this._compression=n?.compression,n&&(this._createHeader=()=>n),this._bodyLength=cn(t)}},_a=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}constructor(t,r,i,n){this._nodes=r,this._buffers=i,this._length=cn(t),this._compression=n}},cc=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,r,i=!1){this._data=t,this._isDelta=i,this._id=cn(r)}},ya=class{constructor(t,r){this.offset=cn(t),this.length=cn(r)}},Kd=class{constructor(t,r){this.length=cn(t),this.nullCount=cn(r)}},gx=class{constructor(t,r=lx.BUFFER){this.type=t,this.method=r}};function JKt(e,t){return(()=>{switch(t){case zi.Schema:return xn.fromJSON(e);case zi.RecordBatch:return _a.fromJSON(e);case zi.DictionaryBatch:return cc.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${zi[t]}, type: ${t} }`)})}function tQt(e,t){return(()=>{switch(t){case zi.Schema:return xn.decode(e.header(new Eu),new Map,e.version());case zi.RecordBatch:return _a.decode(e.header(new Mu),e.version());case zi.DictionaryBatch:return cc.decode(e.header(new cA),e.version())}throw new Error(`Unrecognized Message type: { name: ${zi[t]}, type: ${t} }`)})}mi.encode=hQt;mi.decode=cQt;mi.fromJSON=L4t;xn.encode=uQt;xn.decode=eQt;xn.fromJSON=k4t;_a.encode=dQt;_a.decode=rQt;_a.fromJSON=Ttt;cc.encode=fQt;cc.decode=iQt;cc.fromJSON=R4t;Kd.encode=pQt;Kd.decode=oQt;ya.encode=mQt;ya.decode=nQt;gx.encode=U4t;gx.decode=z4t;function eQt(e,t=new Map,r=In.V5){let i=lQt(e,t);return new xn(i,ON(e),t,r)}function rQt(e,t=In.V5){return new _a(e.length(),sQt(e),aQt(e,t),z4t(e.compression()))}function iQt(e,t=In.V5){return new cc(_a.decode(e.data(),t),e.id(),e.isDelta())}function nQt(e){return new ya(e.offset(),e.length())}function oQt(e){return new Kd(e.length(),e.nullCount())}function sQt(e){let t=[];for(let r,i=-1,n=-1,o=e.nodesLength();++i<o;)(r=e.nodes(i))&&(t[++n]=Kd.decode(r));return t}function aQt(e,t){let r=[];for(let i,n=-1,o=-1,s=e.buffersLength();++n<s;)(i=e.buffers(n))&&(t<In.V4&&(i.bb_pos+=8*(n+1)),r[++o]=ya.decode(i));return r}function lQt(e,t){let r=[];for(let i,n=-1,o=-1,s=e.fieldsLength();++n<s;)(i=e.fields(n))&&(r[++o]=mi.decode(i,t));return r}function B4t(e,t){let r=[];for(let i,n=-1,o=-1,s=e.childrenLength();++n<s;)(i=e.children(n))&&(r[++o]=mi.decode(i,t));return r}function cQt(e,t){let r,i,n,o,s,a;return!t||!(a=e.dictionary())?(n=N4t(e,B4t(e,t)),i=new mi(e.name(),n,e.nullable(),ON(e))):t.has(r=cn(a.id()))?(o=(o=a.indexType())?F4t(o):new cp,s=new ku(t.get(r),o,r,a.isOrdered()),i=new mi(e.name(),s,e.nullable(),ON(e))):(o=(o=a.indexType())?F4t(o):new cp,t.set(r,n=N4t(e,B4t(e,t))),s=new ku(n,o,r,a.isOrdered()),i=new mi(e.name(),s,e.nullable(),ON(e))),i||null}function ON(e){let t=new Map;if(e)for(let r,i,n=-1,o=Math.trunc(e.customMetadataLength());++n<o;)(r=e.customMetadata(n))&&(i=r.key())!=null&&t.set(i,r.value());return t}function F4t(e){return new Ms(e.isSigned(),e.bitWidth())}function N4t(e,t){let r=e.typeType();switch(r){case ro.NONE:return new sl;case ro.Null:return new sl;case ro.Binary:return new jd;case ro.LargeBinary:return new Y0;case ro.Utf8:return new $d;case ro.LargeUtf8:return new X0;case ro.Bool:return new Pu;case ro.List:return new Oa((t||[])[0]);case ro.Struct_:return new jn(t||[])}switch(r){case ro.Int:{let i=e.type(new op);return new Ms(i.isSigned(),i.bitWidth())}case ro.FloatingPoint:{let i=e.type(new J1);return new al(i.precision())}case ro.Decimal:{let i=e.type(new H0);return new Gd(i.scale(),i.precision(),i.bitWidth())}case ro.Date:{let i=e.type(new X1);return new Wd(i.unit())}case ro.Time:{let i=e.type(new uA);return new qd(i.unit(),i.bitWidth())}case ro.Timestamp:{let i=e.type(new hA);return new Hd(i.unit(),i.timezone())}case ro.Interval:{let i=e.type(new t_);return new Yd(i.unit())}case ro.Duration:{let i=e.type(new Z1);return new Xd(i.unit())}case ro.Union:{let i=e.type(new sp);return new Cu(i.mode(),i.typeIdsArray()||[],t||[])}case ro.FixedSizeBinary:{let i=e.type(new K1);return new Zd(i.byteWidth())}case ro.FixedSizeList:{let i=e.type(new Q1);return new lc(i.listSize(),(t||[])[0])}case ro.Map:{let i=e.type(new e_);return new Iu((t||[])[0],i.keysSorted())}}throw new Error(`Unrecognized type: \"${ro[r]}\" (${r})`)}function z4t(e){return e?new gx(e.codec(),e.method()):null}function uQt(e,t){let r=t.fields.map(o=>mi.encode(e,o));Eu.startFieldsVector(e,r.length);let i=Eu.createFieldsVector(e,r),n=t.metadata&&t.metadata.size>0?Eu.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),h=e.createString(`${s}`);return Da.startKeyValue(e),Da.addKey(e,a),Da.addValue(e,h),Da.endKeyValue(e)})):-1;return Eu.startSchema(e),Eu.addFields(e,i),Eu.addEndianness(e,gQt?Y1.Little:Y1.Big),n!==-1&&Eu.addCustomMetadata(e,n),Eu.endSchema(e)}function hQt(e,t){let r=-1,i=-1,n=-1,o=t.type,s=t.typeId;tr.isDictionary(o)?(s=o.dictionary.typeId,n=RN.visit(o,e),i=RN.visit(o.dictionary,e)):i=RN.visit(o,e);let a=(o.children||[]).map(g=>mi.encode(e,g)),h=ac.createChildrenVector(e,a),p=t.metadata&&t.metadata.size>0?ac.createCustomMetadataVector(e,[...t.metadata].map(([g,w])=>{let C=e.createString(`${g}`),R=e.createString(`${w}`);return Da.startKeyValue(e),Da.addKey(e,C),Da.addValue(e,R),Da.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),ac.startField(e),ac.addType(e,i),ac.addTypeType(e,s),ac.addChildren(e,h),ac.addNullable(e,!!t.nullable),r!==-1&&ac.addName(e,r),n!==-1&&ac.addDictionary(e,n),p!==-1&&ac.addCustomMetadata(e,p),ac.endField(e)}function dQt(e,t){let r=t.nodes||[],i=t.buffers||[];Mu.startNodesVector(e,r.length);for(let a of r.slice().reverse())Kd.encode(e,a);let n=e.endVector();Mu.startBuffersVector(e,i.length);for(let a of i.slice().reverse())ya.encode(e,a);let o=e.endVector(),s=null;return t.compression!==null&&(s=U4t(e,t.compression)),Mu.startRecordBatch(e),Mu.addLength(e,BigInt(t.length)),Mu.addNodes(e,n),Mu.addBuffers(e,o),t.compression!==null&&s&&Mu.addCompression(e,s),Mu.endRecordBatch(e)}function U4t(e,t){return lA.startBodyCompression(e),lA.addCodec(e,t.type),lA.addMethod(e,t.method),lA.endBodyCompression(e)}function fQt(e,t){let r=_a.encode(e,t.data);return cA.startDictionaryBatch(e),cA.addId(e,BigInt(t.id)),cA.addIsDelta(e,t.isDelta),cA.addData(e,r),cA.endDictionaryBatch(e)}function pQt(e,t){return j4.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function mQt(e,t){return V4.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var gQt=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var Po=Object.freeze({done:!0,value:void 0}),EI=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ax=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},LN=class extends Ax{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return vr(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(Po);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Rl.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Rl.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return vr(this,void 0,void 0,function*(){return yield this.abort(t),Po})}return(t){return vr(this,void 0,void 0,function*(){return yield this.close(),Po})}read(t){return vr(this,void 0,void 0,function*(){return(yield this.next(t,\"read\")).value})}peek(t){return vr(this,void 0,void 0,function*(){return(yield this.next(t,\"peek\")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,i)=>{this.resolvers.push({resolve:r,reject:i})}):Promise.resolve(Po)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(\"AsyncQueue is closed\")}};var K0=class extends LN{write(t){if((t=Qr(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Q6(this.toUint8Array(!0)):this.toUint8Array(!1).then(Q6)}toUint8Array(t=!1){return t?Ih(this._values)[0]:vr(this,void 0,void 0,function*(){var r,i,n,o;let s=[],a=0;try{for(var h=!0,p=Qf(this),g;g=yield p.next(),r=g.done,!r;h=!0){o=g.value,h=!1;let w=o;s.push(w),a+=w.byteLength}}catch(w){i={error:w}}finally{try{!h&&!r&&(n=p.return)&&(yield n.call(p))}finally{if(i)throw i.error}}return Ih(s,a)[0]})}},Q0=class{constructor(t){t&&(this.source=new Stt(Rl.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Qd=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof K0?this.source=new gA(Rl.fromAsyncIterable(t)):KF(t)?this.source=new gA(Rl.fromNodeStream(t)):J6(t)?this.source=new gA(Rl.fromDOMStream(t)):XF(t)?this.source=new gA(Rl.fromDOMStream(t.body)):rp(t)?this.source=new gA(Rl.fromIterable(t)):Ch(t)?this.source=new gA(Rl.fromAsyncIterable(t)):Ud(t)&&(this.source=new gA(Rl.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Stt=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,\"peek\").value}read(t){return this.next(t,\"read\").value}next(t,r=\"read\"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Po)}return(t){return Object.create(this.source.return&&this.source.return(t)||Po)}},gA=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return vr(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return vr(this,void 0,void 0,function*(){return(yield this.next(t,\"read\")).value})}peek(t){return vr(this,void 0,void 0,function*(){return(yield this.next(t,\"peek\")).value})}next(t){return vr(this,arguments,void 0,function*(r,i=\"read\"){return yield this.source.next({cmd:i,size:r})})}throw(t){return vr(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||Po;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return vr(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||Po;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}};var PI=class extends Q0{constructor(t,r){super(),this.position=0,this.buffer=Qr(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:i}=this.readAt(t,4);return new DataView(r,i).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:i,position:n}=this;return r&&n<i?(typeof t!=\"number\"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(i,n+Math.min(i-n,t)),r.subarray(n,this.position)):null}readAt(t,r){let i=this.buffer,n=Math.min(this.size,t+r);return i?i.subarray(t,n):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},s_=class extends Qd{constructor(t,r){super(),this.position=0,this._handle=t,typeof r==\"number\"?this.size=r:this._pending=vr(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return vr(this,void 0,void 0,function*(){let{buffer:r,byteOffset:i}=yield this.readAt(t,4);return new DataView(r,i).getInt32(0,!0)})}seek(t){return vr(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return vr(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:i,position:n}=this;if(r&&n<i){typeof t!=\"number\"&&(t=Number.POSITIVE_INFINITY);let o=n,s=0,a=0,h=Math.min(i,o+Math.min(i-o,t)),p=new Uint8Array(Math.max(0,(this.position=h)-o));for(;(o+=a)<h&&(s+=a)<p.byteLength;)({bytesRead:a}=yield r.read(p,s,p.byteLength-s,o));return p}return null})}readAt(t,r){return vr(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:i,size:n}=this;if(i&&t+r<n){let o=Math.min(n,t+r),s=new Uint8Array(o-t);return(yield i.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return vr(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return vr(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return vr(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Ett={};Ql(Ett,{BaseInt64:()=>CI,Int128:()=>II,Int64:()=>AA,Uint64:()=>ss});function eT(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var rT=8,Mtt=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],CI=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),n=r[3]*i[3];this.buffer[0]=n&65535;let o=n>>>16;return n=r[2]*i[3],o+=n,n=r[3]*i[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*i[3]+r[2]*i[2]+r[3]*i[1],this.buffer[1]+=r[0]*i[3]+r[1]*i[2]+r[2]*i[1]+r[3]*i[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${eT(this.buffer[1])} ${eT(this.buffer[0])}`}},ss=class e extends CI{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t==\"string\"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let i=t.length,n=new e(r);for(let o=0;o<i;){let s=rT<i-o?rT:i-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),h=new e(new Uint32Array([Mtt[s],0]));n.times(h),n.plus(a),o+=s}return n}static convertArray(t){let r=new Uint32Array(t.length*2);for(let i=-1,n=t.length;++i<n;)e.from(t[i],new Uint32Array(r.buffer,r.byteOffset+2*i*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},AA=class e extends CI{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let r=this.buffer[1]<<0,i=t.buffer[1]<<0;return r<i||r===i&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t==\"string\"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let i=t.startsWith(\"-\"),n=t.length,o=new e(r);for(let s=i?1:0;s<n;){let a=rT<n-s?rT:n-s,h=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),p=new e(new Uint32Array([Mtt[a],0]));o.times(p),o.plus(h),s+=a}return i?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let i=-1,n=t.length;++i<n;)e.from(t[i],new Uint32Array(r.buffer,r.byteOffset+2*i*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},II=class e{constructor(t){this.buffer=t}high(){return new AA(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new AA(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let r=new ss(new Uint32Array([this.buffer[3],0])),i=new ss(new Uint32Array([this.buffer[2],0])),n=new ss(new Uint32Array([this.buffer[1],0])),o=new ss(new Uint32Array([this.buffer[0],0])),s=new ss(new Uint32Array([t.buffer[3],0])),a=new ss(new Uint32Array([t.buffer[2],0])),h=new ss(new Uint32Array([t.buffer[1],0])),p=new ss(new Uint32Array([t.buffer[0],0])),g=ss.multiply(o,p);this.buffer[0]=g.low();let w=new ss(new Uint32Array([g.high(),0]));return g=ss.multiply(n,p),w.plus(g),g=ss.multiply(o,h),w.plus(g),this.buffer[1]=w.low(),this.buffer[3]=w.lessThan(g)?1:0,this.buffer[2]=w.high(),new ss(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ss.multiply(i,p)).plus(ss.multiply(n,h)).plus(ss.multiply(o,a)),this.buffer[3]+=ss.multiply(r,p).plus(ss.multiply(i,h)).plus(ss.multiply(n,a)).plus(ss.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${eT(this.buffer[3])} ${eT(this.buffer[2])} ${eT(this.buffer[1])} ${eT(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t==\"string\"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let i=t.startsWith(\"-\"),n=t.length,o=new e(r);for(let s=i?1:0;s<n;){let a=rT<n-s?rT:n-s,h=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),p=new e(new Uint32Array([Mtt[a],0,0,0]));o.times(p),o.plus(h),s+=a}return i?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let i=-1,n=t.length;++i<n;)e.from(t[i],new Uint32Array(r.buffer,r.byteOffset+16*i,4));return r}};var Itt={};Ql(Itt,{toIntervalDayTimeInt32Array:()=>Ptt,toIntervalDayTimeObjects:()=>AQt,toIntervalMonthDayNanoInt32Array:()=>Ctt,toIntervalMonthDayNanoObjects:()=>yQt});function Ptt(e){var t,r;let i=e.length,n=new Int32Array(i*2);for(let o=0,s=0;o<i;o++){let a=e[o];n[s++]=(t=a.days)!==null&&t!==void 0?t:0,n[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return n}function Ctt(e){var t,r;let i=e.length,n=new Int32Array(i*4);for(let o=0,s=0;o<i;o++){let a=e[o];n[s++]=(t=a.months)!==null&&t!==void 0?t:0,n[s++]=(r=a.days)!==null&&r!==void 0?r:0;let h=a.nanoseconds;h?(n[s++]=Number(BigInt(h)&BigInt(4294967295)),n[s++]=Number(BigInt(h)>>BigInt(32))):s+=2}return n}function AQt(e){let t=e.length,r=new Array(t/2);for(let i=0,n=0;i<t;i+=2)r[n++]={days:e[i],milliseconds:e[i+1]};return r}function yQt(e,t){let r=e.length,i=new Array(r/4);for(let n=0,o=0;n<r;n+=4){let s=BigInt(e[n+3])<<BigInt(32)|BigInt(e[n+2]>>>0);i[o++]={months:e[n],days:e[n+1],nanoseconds:t?`${s}`:s}}return i}var iT=class extends jr{constructor(t,r,i,n,o=In.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=r,this.buffers=i,this.dictionaries=n,this.metadataVersion=o}visit(t){return super.visit(t instanceof mi?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return Pr({type:t,length:r})}visitBool(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitInt(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDate(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTime(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitList(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:i}=this.nextFieldNode()){return this.metadataVersion<In.V5&&this.readNullBitmap(t,i),t.mode===eo.Sparse?this.visitSparseUnion(t,{length:r,nullCount:i}):this.visitDenseUnion(t,{length:r,nullCount:i})}visitDenseUnion(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:i}=this.nextFieldNode()){return Pr({type:t,length:r,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,i=this.nextBufferRange()){return r>0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+r)}readDictionary(t){return this.dictionaries.get(t.id)}},BN=class extends iT{constructor(t,r,i,n,o){super(new Uint8Array(0),r,i,n,o),this.sources=t}readNullBitmap(t,r,{offset:i}=this.nextBufferRange()){return r<=0?new Uint8Array(0):fx(this.sources[i])}readOffsets(t,{offset:r}=this.nextBufferRange()){return Oi(Uint8Array,Oi(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return Oi(Uint8Array,Oi(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:i}=this;if(tr.isTimestamp(t))return Oi(Uint8Array,AA.convertArray(i[r]));if((tr.isInt(t)||tr.isTime(t))&&t.bitWidth===64||tr.isDuration(t))return Oi(Uint8Array,AA.convertArray(i[r]));if(tr.isDate(t)&&t.unit===Ss.MILLISECOND)return Oi(Uint8Array,AA.convertArray(i[r]));if(tr.isDecimal(t))return Oi(Uint8Array,II.convertArray(i[r]));if(tr.isBinary(t)||tr.isLargeBinary(t)||tr.isFixedSizeBinary(t))return _Qt(i[r]);if(tr.isBool(t))return fx(i[r]);if(tr.isUtf8(t)||tr.isLargeUtf8(t))return $0(i[r].join(\"\"));if(tr.isInterval(t))switch(t.unit){case mo.DAY_TIME:return Ptt(i[r]);case mo.MONTH_DAY_NANO:return Ctt(i[r]);default:break}return Oi(Uint8Array,Oi(t.ArrayType,i[r].map(n=>+n)))}};function _Qt(e){let t=e.join(\"\"),r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i>>1]=Number.parseInt(t.slice(i,i+2),16);return r}var FN=class extends iT{constructor(t,r,i,n,o){super(new Uint8Array(0),r,i,n,o),this.bodyChunks=t}readData(t,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}};var yx=class extends Ru{constructor(t){super(t),this._values=new hp(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,Qr(r))}_flushPending(t,r){let i=this._offsets,n=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)i.set(s,0);else{let h=a.length;n.set(a,o),i.set(s,h),o+=h}}};var _x=class extends Ru{constructor(t){super(t),this._values=new hp(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,Qr(r))}_flushPending(t,r){let i=this._offsets,n=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)i.set(s,BigInt(0));else{let h=a.length;n.set(a,o),i.set(s,BigInt(h)),o+=h}}};var a_=class extends Vo{constructor(t){super(t),this._values=new J4}setValue(t,r){this._values.set(t,+r)}};var l_=class extends Aa{};l_.prototype._setValue=ntt;var nT=class extends l_{};nT.prototype._setValue=oN;var oT=class extends l_{};oT.prototype._setValue=sN;var sT=class extends Aa{};sT.prototype._setValue=att;var kI=class extends Vo{constructor({type:t,nullValues:r,dictionaryHashFunction:i}){super({type:new ku(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=vx({type:this.type.indices,nullValues:r}),this.dictionary=vx({type:this.type.dictionary,nullValues:null}),typeof i==\"function\"&&(this.valueToKey=i)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,r){let i=this.indices;return r=i.setValid(t,r),this.length=i.length,r}setValue(t,r){let i=this._keysToIndices,n=this.valueToKey(r),o=i[n];return o===void 0&&(i[n]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,i=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=r?r.concat(i):i,this.finished||(this._dictionaryOffset+=i.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t==\"string\"?t:`${t}`}};var aT=class extends Aa{};aT.prototype._setValue=itt;var RI=class extends Vo{setValue(t,r){let[i]=this.children,n=t*this.stride;for(let o=-1,s=this.stride;++o<s;)i.set(n+o,r[o])}setValid(t,r){return super.setValid(t,r)||this.children[0].setValid((t+1)*this.stride-1,!1),r}addChild(t,r=\"0\"){if(this.numChildren>0)throw new Error(\"FixedSizeListBuilder can only have one child.\");let i=this.children.push(t);return this.type=new lc(this.type.listSize,new mi(r,t.type,!0)),i}};var c_=class extends Aa{setValue(t,r){this._values.set(t,r)}},DI=class extends c_{setValue(t,r){super.setValue(t,xI(r))}},OI=class extends c_{},LI=class extends c_{};var yA=class extends Aa{};yA.prototype._setValue=ltt;var lT=class extends yA{};lT.prototype._setValue=mN;var cT=class extends yA{};cT.prototype._setValue=gN;var uT=class extends yA{};uT.prototype._setValue=AN;var J0=class extends Aa{};J0.prototype._setValue=ctt;var hT=class extends J0{};hT.prototype._setValue=yN;var dT=class extends J0{};dT.prototype._setValue=_N;var fT=class extends J0{};fT.prototype._setValue=vN;var pT=class extends J0{};pT.prototype._setValue=bN;var Dh=class extends Aa{setValue(t,r){this._values.set(t,r)}},BI=class extends Dh{},FI=class extends Dh{},NI=class extends Dh{},zI=class extends Dh{},UI=class extends Dh{},VI=class extends Dh{},jI=class extends Dh{},$I=class extends Dh{};var GI=class extends Ru{constructor(t){super(t),this._offsets=new tT(t.type)}addChild(t,r=\"0\"){if(this.numChildren>0)throw new Error(\"ListBuilder can only have one child.\");return this.children[this.numChildren]=t,this.type=new Oa(new mi(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[i]=this.children;for(let[n,o]of t)if(typeof o>\"u\")r.set(n,0);else{let s=o,a=s.length,h=r.set(n,a).buffer[n];for(let p=-1;++p<a;)i.set(h+p,s[p])}}};var WI=class extends Ru{set(t,r){return super.set(t,r)}setValue(t,r){let i=r instanceof Map?r:new Map(Object.entries(r)),n=this._pending||(this._pending=new Map),o=n.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=i.size,n.set(t,i)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error(\"ListBuilder can only have one child.\");return this.children[this.numChildren]=t,this.type=new Iu(new mi(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[i]=this.children;for(let[n,o]of t)if(o===void 0)r.set(n,0);else{let{[n]:s,[n+1]:a}=r.set(n,o.size).buffer;for(let h of o.entries())if(i.set(s,h),++s>=a)break}}};var qI=class extends Vo{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}};var HI=class extends Vo{setValue(t,r){let{children:i,type:n}=this;switch(Array.isArray(r)||r.constructor){case!0:return n.children.forEach((o,s)=>i[s].set(t,r[s]));case Map:return n.children.forEach((o,s)=>i[s].set(t,r.get(o.name)));default:return n.children.forEach((o,s)=>i[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(i=>i.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let i=this.children.push(t);return this.type=new jn([...this.type.children,new mi(r,t.type,!0)]),i}};var tm=class extends Aa{};tm.prototype._setValue=ott;var mT=class extends tm{};mT.prototype._setValue=aN;var gT=class extends tm{};gT.prototype._setValue=lN;var AT=class extends tm{};AT.prototype._setValue=cN;var yT=class extends tm{};yT.prototype._setValue=uN;var em=class extends Aa{};em.prototype._setValue=stt;var _T=class extends em{};_T.prototype._setValue=hN;var vT=class extends em{};vT.prototype._setValue=dN;var bT=class extends em{};bT.prototype._setValue=fN;var xT=class extends em{};xT.prototype._setValue=pN;var bx=class extends Vo{constructor(t){super(t),this._typeIds=new fA(Int8Array,0,1),typeof t.valueToChildTypeId==\"function\"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,i){return i===void 0&&(i=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,i),this}setValue(t,r,i){this._typeIds.set(t,i);let n=this.type.typeIdToChildIndex[i],o=this.children[n];o?.set(t,r),this.length=Math.max(t+1,this.length)}addChild(t,r=`${this.children.length}`){let i=this.children.push(t),{type:{children:n,mode:o,typeIds:s}}=this,a=[...n,new mi(r,t.type)];return this.type=new Cu(o,[...s,i],a),i}_valueToChildTypeId(t,r,i){throw new Error(\"Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.\")}},YI=class extends bx{},XI=class extends bx{constructor(t){super(t),this._offsets=new fA(Int32Array)}setValue(t,r,i){let n=this._typeIds.set(t,i).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[n]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,r),this.length=Math.max(t+1,this.length)}};var wT=class extends Ru{constructor(t){super(t),this._values=new hp(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,$0(r))}_flushPending(t,r){}};wT.prototype._flushPending=yx.prototype._flushPending;var TT=class extends Ru{constructor(t){super(t),this._values=new hp(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,$0(r))}_flushPending(t,r){}};TT.prototype._flushPending=_x.prototype._flushPending;var ktt=class extends jr{visitNull(){return qI}visitBool(){return a_}visitInt(){return Dh}visitInt8(){return BI}visitInt16(){return FI}visitInt32(){return NI}visitInt64(){return zI}visitUint8(){return UI}visitUint16(){return VI}visitUint32(){return jI}visitUint64(){return $I}visitFloat(){return c_}visitFloat16(){return DI}visitFloat32(){return OI}visitFloat64(){return LI}visitUtf8(){return wT}visitLargeUtf8(){return TT}visitBinary(){return yx}visitLargeBinary(){return _x}visitFixedSizeBinary(){return aT}visitDate(){return l_}visitDateDay(){return nT}visitDateMillisecond(){return oT}visitTimestamp(){return tm}visitTimestampSecond(){return mT}visitTimestampMillisecond(){return gT}visitTimestampMicrosecond(){return AT}visitTimestampNanosecond(){return yT}visitTime(){return em}visitTimeSecond(){return _T}visitTimeMillisecond(){return vT}visitTimeMicrosecond(){return bT}visitTimeNanosecond(){return xT}visitDecimal(){return sT}visitList(){return GI}visitStruct(){return HI}visitUnion(){return bx}visitDenseUnion(){return XI}visitSparseUnion(){return YI}visitDictionary(){return kI}visitInterval(){return yA}visitIntervalDayTime(){return lT}visitIntervalYearMonth(){return cT}visitIntervalMonthDayNano(){return uT}visitDuration(){return J0}visitDurationSecond(){return hT}visitDurationMillisecond(){return dT}visitDurationMicrosecond(){return fT}visitDurationNanosecond(){return pT}visitFixedSizeList(){return RI}visitMap(){return WI}},j4t=new ktt;var qr=class extends jr{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((i,n)=>this.compareFields(i,r[n]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};function jc(e,t){return t instanceof e.constructor}function xx(e,t){return e===t||jc(e,t)}function _A(e,t){return e===t||jc(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function NN(e,t){return e===t||jc(e,t)&&e.precision===t.precision}function vQt(e,t){return e===t||jc(e,t)&&e.byteWidth===t.byteWidth}function Rtt(e,t){return e===t||jc(e,t)&&e.unit===t.unit}function ZI(e,t){return e===t||jc(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function KI(e,t){return e===t||jc(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function bQt(e,t){return e===t||jc(e,t)&&e.children.length===t.children.length&&rm.compareManyFields(e.children,t.children)}function xQt(e,t){return e===t||jc(e,t)&&e.children.length===t.children.length&&rm.compareManyFields(e.children,t.children)}function Dtt(e,t){return e===t||jc(e,t)&&e.mode===t.mode&&e.typeIds.every((r,i)=>r===t.typeIds[i])&&rm.compareManyFields(e.children,t.children)}function wQt(e,t){return e===t||jc(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&rm.visit(e.indices,t.indices)&&rm.visit(e.dictionary,t.dictionary)}function zN(e,t){return e===t||jc(e,t)&&e.unit===t.unit}function QI(e,t){return e===t||jc(e,t)&&e.unit===t.unit}function TQt(e,t){return e===t||jc(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&rm.compareManyFields(e.children,t.children)}function SQt(e,t){return e===t||jc(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&rm.compareManyFields(e.children,t.children)}qr.prototype.visitNull=xx;qr.prototype.visitBool=xx;qr.prototype.visitInt=_A;qr.prototype.visitInt8=_A;qr.prototype.visitInt16=_A;qr.prototype.visitInt32=_A;qr.prototype.visitInt64=_A;qr.prototype.visitUint8=_A;qr.prototype.visitUint16=_A;qr.prototype.visitUint32=_A;qr.prototype.visitUint64=_A;qr.prototype.visitFloat=NN;qr.prototype.visitFloat16=NN;qr.prototype.visitFloat32=NN;qr.prototype.visitFloat64=NN;qr.prototype.visitUtf8=xx;qr.prototype.visitLargeUtf8=xx;qr.prototype.visitBinary=xx;qr.prototype.visitLargeBinary=xx;qr.prototype.visitFixedSizeBinary=vQt;qr.prototype.visitDate=Rtt;qr.prototype.visitDateDay=Rtt;qr.prototype.visitDateMillisecond=Rtt;qr.prototype.visitTimestamp=ZI;qr.prototype.visitTimestampSecond=ZI;qr.prototype.visitTimestampMillisecond=ZI;qr.prototype.visitTimestampMicrosecond=ZI;qr.prototype.visitTimestampNanosecond=ZI;qr.prototype.visitTime=KI;qr.prototype.visitTimeSecond=KI;qr.prototype.visitTimeMillisecond=KI;qr.prototype.visitTimeMicrosecond=KI;qr.prototype.visitTimeNanosecond=KI;qr.prototype.visitDecimal=xx;qr.prototype.visitList=bQt;qr.prototype.visitStruct=xQt;qr.prototype.visitUnion=Dtt;qr.prototype.visitDenseUnion=Dtt;qr.prototype.visitSparseUnion=Dtt;qr.prototype.visitDictionary=wQt;qr.prototype.visitInterval=zN;qr.prototype.visitIntervalDayTime=zN;qr.prototype.visitIntervalYearMonth=zN;qr.prototype.visitIntervalMonthDayNano=zN;qr.prototype.visitDuration=QI;qr.prototype.visitDurationSecond=QI;qr.prototype.visitDurationMillisecond=QI;qr.prototype.visitDurationMicrosecond=QI;qr.prototype.visitDurationNanosecond=QI;qr.prototype.visitFixedSizeList=TQt;qr.prototype.visitMap=SQt;var rm=new qr;function wx(e,t){return rm.compareSchemas(e,t)}function $4t(e,t){return rm.compareFields(e,t)}function G4t(e,t){return rm.visit(e,t)}function vx(e){let t=e.type,r=new(j4t.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let i=e.children||[],n={nullValues:e.nullValues},o=Array.isArray(i)?((s,a)=>i[a]||n):(({name:s})=>i[s]||n);for(let[s,a]of t.children.entries()){let{type:h}=a,p=o(a,s);r.children.push(vx(Object.assign(Object.assign({},p),{type:h})))}}return r}function UN(e,t){return MQt(e,t.map(r=>r.data.concat()))}function MQt(e,t){let r=[...e.fields],i=[],n={numBatches:t.reduce((w,C)=>Math.max(w,C.length),0)},o=0,s=0,a=-1,h=t.length,p,g=[];for(;n.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<h;)g[a]=p=t[a].shift(),s=Math.min(s,p?p.length:s);Number.isFinite(s)&&(g=EQt(r,s,g,t,n),s>0&&(i[o++]=Pr({type:new jn(r),length:s,nullCount:0,children:g.slice()})))}return[e=e.assign(r),i.map(w=>new Es(e,w))]}function EQt(e,t,r,i,n){var o;let s=(t+63&-64)>>3;for(let a=-1,h=i.length;++a<h;){let p=r[a],g=p?.length;if(g>=t)g===t?r[a]=p:(r[a]=p.slice(0,t),n.numBatches=Math.max(n.numBatches,i[a].unshift(p.slice(t,g-t))));else{let w=e[a];e[a]=w.clone({nullable:!0}),r[a]=(o=p?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:Pr({type:w.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var q4t,Ll=class e{constructor(...t){var r,i;if(t.length===0)return this.batches=[],this.schema=new xn([]),this._offsets=[0],this;let n,o;t[0]instanceof xn&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=h=>{if(h){if(h instanceof Es)return[h];if(h instanceof e)return h.batches;if(h instanceof Fi){if(h.type instanceof jn)return[new Es(new xn(h.type.children),h)]}else{if(Array.isArray(h))return h.flatMap(p=>s(p));if(typeof h[Symbol.iterator]==\"function\")return[...h].flatMap(p=>s(p));if(typeof h==\"object\"){let p=Object.keys(h),g=p.map(R=>new Er([h[R]])),w=n??new xn(p.map((R,z)=>new mi(String(R),g[z].type,g[z].nullable))),[,C]=UN(w,g);return C.length===0?[new Es(h)]:C}}}return[]},a=t.flatMap(h=>s(h));if(n=(i=n??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&i!==void 0?i:new xn([]),!(n instanceof xn))throw new TypeError(\"Table constructor expects a [Schema, RecordBatch[]] pair.\");for(let h of a){if(!(h instanceof Es))throw new TypeError(\"Table constructor expects a [Schema, RecordBatch[]] pair.\");if(!wx(n,h.schema))throw new TypeError(\"Table and inner RecordBatch schemas must be equivalent.\")}this.schema=n,this.batches=a,this._offsets=o??MN(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=SN(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(ux(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?Q4.visit(new Er(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n  ${this.toArray().join(`,\n  `)}\n]`}concat(...t){let r=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new e(r,i.map(n=>new Es(r,n)))}slice(t,r){let i=this.schema;[t,r]=wI({length:this.numRows},t,r);let n=EN(this.data,this._offsets,t,r);return new e(i,n.map(o=>new Es(i,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(i=>i.children[t]);if(r.length===0){let{type:i}=this.schema.fields[t],n=Pr({type:i,length:0,nullCount:0});r.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Er(r)}return null}setChild(t,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),r)}setChildAt(t,r){let i=this.schema,n=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new Er([Pr({type:new sl,length:this.numRows})]));let o=i.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((h,p)=>this.getChildAt(p));[o[t],a[t]]=[s,r],[i,n]=UN(i,a)}return new e(i,n)}select(t){let r=this.schema.fields.reduce((i,n,o)=>i.set(n.name,o),new Map);return this.selectAt(t.map(i=>r.get(i)).filter(i=>i>-1))}selectAt(t){let r=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new e(r,i)}assign(t){let r=this.schema.fields,[i,n]=t.schema.fields.reduce((a,h,p)=>{let[g,w]=a,C=r.findIndex(R=>R.name===h.name);return~C?w[C]=p:g.push(p),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,h)=>[h,n[h]]).map(([a,h])=>h===void 0?this.getChildAt(a):t.getChildAt(h)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...UN(o,s))}};q4t=Symbol.toStringTag;Ll[q4t]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=K4(MI),e.get=K4(ga.getVisitFn(Qt.Struct)),e.set=PN(Ol.getVisitFn(Qt.Struct)),e.indexOf=CN(px.getVisitFn(Qt.Struct)),\"Table\"))(Ll.prototype);var Y4t,Es=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof xn))throw new TypeError(\"RecordBatch constructor expects a [Schema, Data] pair.\");if([,this.data=Pr({nullCount:0,type:new jn(this.schema.fields),children:this.schema.fields.map(r=>Pr({type:r.type,nullCount:0}))})]=t,!(this.data instanceof Fi))throw new TypeError(\"RecordBatch constructor expects a [Schema, Data] pair.\");[this.schema,this.data]=H4t(this.schema,this.data.children);break}case 1:{let[r]=t,{fields:i,children:n,length:o}=Object.keys(r).reduce((h,p,g)=>(h.children[g]=r[p],h.length=Math.max(h.length,r[p].length),h.fields[g]=mi.new({name:p,type:r[p].type,nullable:!0}),h),{length:0,fields:new Array,children:new Array}),s=new xn(i),a=Pr({type:new jn(i),length:o,children:n,nullCount:0});[this.schema,this.data]=H4t(s,a.children,o);break}default:throw new TypeError(\"RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.\")}}get dictionaries(){return this._dictionaries||(this._dictionaries=X4t(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return ga.visit(this.data,t)}at(t){return this.get(ux(t,this.numRows))}set(t,r){return Ol.visit(this.data,t,r)}indexOf(t,r){return px.visit(this.data,t,r)}[Symbol.iterator](){return Q4.visit(new Er([this.data]))}toArray(){return[...this]}concat(...t){return new Ll(this.schema,[this,...t])}slice(t,r){let[i]=new Er([this.data]).slice(t,r).data;return new e(this.schema,i)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new Er([this.data.children[t]]):null}setChild(t,r){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),r)}setChildAt(t,r){let i=this.schema,n=this.data;if(t>-1&&t<this.numCols){r||(r=new Er([Pr({type:new sl,length:this.numRows})]));let o=i.fields.slice(),s=n.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],i=new xn(o,new Map(this.schema.metadata)),n=Pr({type:new jn(o),children:s})}return new e(i,n)}select(t){let r=this.schema.select(t),i=new jn(r.fields),n=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(n[s]=this.data.children[s])}return new e(r,Pr({type:i,length:this.numRows,children:n}))}selectAt(t){let r=this.schema.selectAt(t),i=t.map(o=>this.data.children[o]).filter(Boolean),n=Pr({type:new jn(r.fields),length:this.numRows,children:i});return new e(r,n)}};Y4t=Symbol.toStringTag;Es[Y4t]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,\"RecordBatch\"))(Es.prototype);function H4t(e,t,r=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;let n=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,h]of e.fields.entries()){let p=t[a];(!p||p.length!==r)&&(n[a]=h.clone({nullable:!0}),o[a]=(i=p?._changeLengthAndBackfillNullBitmap(r))!==null&&i!==void 0?i:Pr({type:h.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(n),Pr({type:new jn(n),length:r,children:o})]}function X4t(e,t,r=new Map){var i,n;if(((i=e?.length)!==null&&i!==void 0?i:0)>0&&e?.length===t?.length)for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],h=t[o];for(let p of[h,...((n=h?.dictionary)===null||n===void 0?void 0:n.data)||[]])X4t(a.children,p?.children,r);if(tr.isDictionary(a)){let{id:p}=a;if(!r.has(p))h?.dictionary&&r.set(p,h.dictionary);else if(r.get(p)!==h.dictionary)throw new Error(\"Cannot create Schema containing two different dictionaries with the same Id\")}}return r}var Tx=class extends Es{constructor(t){let r=t.fields.map(n=>Pr({type:n.type})),i=Pr({type:new jn(t.fields),nullCount:0,children:r});super(t,i)}};var Ltt=e=>`Expected ${zi[e]} Message in stream, but was null or length 0.`,Btt=e=>`Header pointer of flatbuffer-encoded ${zi[e]} Message is null or length 0.`,Z4t=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,K4t=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,ST=class{constructor(t){this.source=t instanceof Q0?t:new Q0(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Po:t.value===-1&&(t=this.readMetadataLength()).done?Po:(t=this.readMetadata(t.value)).done?Po:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Ltt(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=Qr(this.source.read(t));if(r.byteLength<t)throw new Error(K4t(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=zi.Schema,i=this.readMessage(r),n=i?.header();if(t&&!n)throw new Error(Btt(r));return n}readMetadataLength(){let t=this.source.read(VN),r=t&&new Dl(t),i=r?.readInt32(0)||0;return{done:i===0,value:i}}readMetadata(t){let r=this.source.read(t);if(!r)return Po;if(r.byteLength<t)throw new Error(Z4t(t,r.byteLength));return{done:!1,value:Du.decode(r)}}},JI=class{constructor(t,r){this.source=t instanceof Qd?t:YF(t)?new s_(t,r):new Qd(t)}[Symbol.asyncIterator](){return this}next(){return vr(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Po:t.value===-1&&(t=yield this.readMetadataLength()).done?Po:(t=yield this.readMetadata(t.value)).done?Po:t})}throw(t){return vr(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return vr(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return vr(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Ltt(t));return r.value})}readMessageBody(t){return vr(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=Qr(yield this.source.read(t));if(r.byteLength<t)throw new Error(K4t(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return vr(this,arguments,void 0,function*(t=!1){let r=zi.Schema,i=yield this.readMessage(r),n=i?.header();if(t&&!n)throw new Error(Btt(r));return n})}readMetadataLength(){return vr(this,void 0,void 0,function*(){let t=yield this.source.read(VN),r=t&&new Dl(t),i=r?.readInt32(0)||0;return{done:i===0,value:i}})}readMetadata(t){return vr(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return Po;if(r.byteLength<t)throw new Error(Z4t(t,r.byteLength));return{done:!1,value:Du.decode(r)}})}},t8=class extends ST{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof EI?t:new EI(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Du.fromJSON(t.schema,zi.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Du.fromJSON(r,zi.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Du.fromJSON(r,zi.RecordBatch)}}return this._body=[],Po}readMessageBody(t){return r(this._body);function r(i){return(i||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Ltt(t));return r.value}readSchema(){let t=zi.Schema,r=this.readMessage(t),i=r?.header();if(!r||!i)throw new Error(Btt(t));return i}},VN=4,Ott=\"ARROW1\",MT=new Uint8Array(Ott.length);for(let e=0;e<Ott.length;e+=1)MT[e]=Ott.codePointAt(e);function jN(e,t=0){for(let r=-1,i=MT.length;++r<i;)if(MT[r]!==e[t+r])return!1;return!0}var ET=MT.length,Ftt=ET+VN,Q4t=ET*2+VN;var Ntt=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=t.encode(r);return this._isValidCompressed(i)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((r,i)=>t[i]===r)}_hasValidVersion(t){return(t[4]&192)>>6===1}},ztt=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),i=t.encode(r);return this._isValidCompressed(i)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((r,i)=>t[i]===r)}},J4t={[Vc.LZ4_FRAME]:new Ntt,[Vc.ZSTD]:new ztt};var Utt=class{constructor(){this.registry={}}set(t,r){if(r?.encode&&typeof r.encode==\"function\"&&!J4t[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Vc[t]} is not valid.`);this.registry[t]=r}get(t){var r;return((r=this.registry)===null||r===void 0?void 0:r[t])||null}},PT=new Utt;var Oh=class e extends Ax{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let r=this._impl.open(t);return Ch(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Rl.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Rl.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('\"throughNode\" not available in this environment')}static throughDOM(t,r){throw new Error('\"throughDOM\" not available in this environment')}static from(t){return t instanceof e?t:qF(t)?CQt(t):YF(t)?RQt(t):Ch(t)?vr(this,void 0,void 0,function*(){return yield e.from(yield t)}):XF(t)||J6(t)||KF(t)||Ud(t)?kQt(new Qd(t)):IQt(new Q0(t))}static readAll(t){return t instanceof e?t.isSync()?tTt(t):eTt(t):qF(t)||ArrayBuffer.isView(t)||rp(t)||HF(t)?tTt(t):eTt(t)}},vA=class extends Oh{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Th(this,arguments,function*(){yield Ti(yield*t4(Qf(this[Symbol.iterator]())))})}},Sx=class extends Oh{constructor(t){super(t),this._impl=t}readAll(){return vr(this,void 0,void 0,function*(){var t,r,i,n;let o=new Array;try{for(var s=!0,a=Qf(this),h;h=yield a.next(),t=h.done,!t;s=!0){n=h.value,s=!1;let p=n;o.push(p)}}catch(p){r={error:p}}finally{try{!s&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error(\"AsyncRecordBatchStreamReader is not Iterable\")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Mx=class extends vA{constructor(t){super(t),this._impl=t}},$N=class extends Sx{constructor(t){super(t),this._impl=t}},GN=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r){let i;if(t.compression!=null){let o=PT.get(t.compression.type);if(o?.decode&&typeof o.decode==\"function\"){let{decommpressedBody:s,buffers:a}=this._decompressBuffers(t,r,o);i=this._loadCompressedVectors(t,s,this.schema.fields),t=new _a(t.length,t.nodes,a,null)}else throw new Error(\"Record batch is compressed but codec not found\")}else i=this._loadVectors(t,r,this.schema.fields);let n=Pr({type:new jn(this.schema.fields),length:t.length,children:i});return new Es(this.schema,n)}_loadDictionaryBatch(t,r){let{id:i,isDelta:n}=t,{dictionaries:o,schema:s}=this,a=o.get(i),h=s.dictionaries.get(i),p;if(t.data.compression!=null){let g=PT.get(t.data.compression.type);if(g?.decode&&typeof g.decode==\"function\"){let{decommpressedBody:w,buffers:C}=this._decompressBuffers(t.data,r,g);p=this._loadCompressedVectors(t.data,w,[h]),t=new cc(new _a(t.data.length,t.data.nodes,C,null),i,n)}else throw new Error(\"Dictionary batch is compressed but codec not found\")}else p=this._loadVectors(t.data,r,[h]);return(a&&n?a.concat(new Er(p)):new Er(p)).memoize()}_loadVectors(t,r,i){return new iT(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}_loadCompressedVectors(t,r,i){return new FN(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}_decompressBuffers(t,r,i){let n=[],o=[],s=0;for(let{offset:a,length:h}of t.buffers){if(h===0){n.push(new Uint8Array(0)),o.push(new ya(s,0));continue}let p=new Dl(r.subarray(a,a+h)),g=cn(p.readInt64(0)),w=p.bytes().subarray(8),C=g===-1?w:i.decode(w);n.push(C);let R=(s+7&-8)-s;s+=R,o.push(new ya(s,C.length)),s+=C.length}return{decommpressedBody:n,buffers:o}}},CT=class extends GN{constructor(t,r){super(r),this._reader=qF(t)?new t8(this._handle=t):new ST(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=iTt(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Po}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Po}next(){if(this.closed)return Po;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let i=t.header(),n=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let i=t.header(),n=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Tx(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},IT=class extends GN{constructor(t,r){super(r),this._reader=new JI(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return vr(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return vr(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=iTt(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return vr(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Po})}return(t){return vr(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Po})}next(){return vr(this,void 0,void 0,function*(){if(this.closed)return Po;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let i=t.header(),n=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let i=t.header(),n=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Tx(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return vr(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},WN=class extends CT{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,r){super(t instanceof PI?t:new PI(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(zi.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),s=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){let n=this._reader.readMessage(zi.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),s=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,r=t.size-Ftt,i=t.readInt32(r),n=t.readAt(r-i,i);return pA.decode(n)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(t)}return null}},Vtt=class extends IT{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...r){let i=typeof r[0]!=\"number\"?r.shift():void 0,n=r[0]instanceof Map?r.shift():void 0;super(t instanceof s_?t:new s_(t,i),n)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return vr(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){return vr(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let i=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(zi.RecordBatch);if(n?.isRecordBatch()){let o=n.header(),s=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,s)}}return null})}_readDictionaryBatch(t){return vr(this,void 0,void 0,function*(){var r;let i=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){let n=yield this._reader.readMessage(zi.DictionaryBatch);if(n?.isDictionaryBatch()){let o=n.header(),s=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return vr(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-Ftt,i=yield t.readInt32(r),n=yield t.readAt(r-i,i);return pA.decode(n)})}_readNextMessageAndValidate(t){return vr(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},jtt=class extends CT{constructor(t,r){super(t,r)}_loadVectors(t,r,i){return new BN(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}};function iTt(e,t){return t&&typeof t.autoDestroy==\"boolean\"?t.autoDestroy:e.autoDestroy}function*tTt(e){let t=Oh.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function eTt(e){return Th(this,arguments,function*(){let r=yield Ti(Oh.from(e));try{if(!(yield Ti(r.open({autoDestroy:!1}))).closed)do yield yield Ti(r);while(!(yield Ti(r.reset().open())).closed)}finally{yield Ti(r.cancel())}})}function CQt(e){return new vA(new jtt(e))}function IQt(e){let t=e.peek(ET+7&-8);return t&&t.byteLength>=4?jN(t)?new Mx(new WN(e.read())):new vA(new CT(e)):new vA(new CT((function*(){})()))}function kQt(e){return vr(this,void 0,void 0,function*(){let t=yield e.peek(ET+7&-8);return t&&t.byteLength>=4?jN(t)?new Mx(new WN(yield e.read())):new Sx(new IT(e)):new Sx(new IT((function(){return Th(this,arguments,function*(){})})()))})}function RQt(e){return vr(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new s_(e,t);return t>=Q4t&&jN(yield r.readAt(0,ET+7&-8))?new $N(new Vtt(r)):new Sx(new IT(r))})}var as=class e extends jr{static assemble(...t){let r=n=>n.flatMap(o=>Array.isArray(o)?r(o):o instanceof Es?o.data.children:o.data),i=new e;return i.visitMany(r(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Er)return this.visitMany(t.data),this;let{type:r}=t;if(!tr.isDictionary(r)){let{length:i}=t;if(i>2147483647)throw new RangeError(\"Cannot write arrays larger than 2^31 - 1 in length\");if(tr.isUnion(r))this.nodes.push(new Kd(i,0));else{let{nullCount:n}=t;tr.isNull(r)||fp.call(this,n<=0?new Uint8Array(0):dx(t.offset,i,t.nullBitmap)),this.nodes.push(new Kd(i,n))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function fp(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new ya(this._byteLength,t)),this._byteLength+=t,this}function DQt(e){var t;let{type:r,length:i,typeIds:n,valueOffsets:o}=e;if(fp.call(this,n),r.mode===eo.Sparse)return $tt.call(this,e);if(r.mode===eo.Dense){if(e.offset<=0)return fp.call(this,o),$tt.call(this,e);{let s=new Int32Array(i),a=Object.create(null),h=Object.create(null);for(let p,g,w=-1;++w<i;)(p=n[w])!==void 0&&((g=a[p])===void 0&&(g=a[p]=o[w]),s[w]=o[w]-g,h[p]=((t=h[p])!==null&&t!==void 0?t:0)+1);fp.call(this,s),this.visitMany(e.children.map((p,g)=>{let w=r.typeIds[g],C=a[w],R=h[w];return p.slice(C,Math.min(i,R))}))}}return this}function OQt(e){let t;return e.nullCount>=e.length?fp.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?fp.call(this,dx(e.offset,e.length,t)):fp.call(this,fx(e.values))}function bA(e){return fp.call(this,e.values.subarray(0,e.length*e.stride))}function qN(e){let{length:t,values:r,valueOffsets:i}=e,n=cn(i[0]),o=cn(i[t]),s=Math.min(o-n,r.byteLength-n);return fp.call(this,JF(-n,t+1,i)),fp.call(this,r.subarray(n,n+s)),this}function Gtt(e){let{length:t,valueOffsets:r}=e;if(r){let{[0]:i,[t]:n}=r;return fp.call(this,JF(-i,t+1,r)),this.visit(e.children[0].slice(i,n-i))}return this.visit(e.children[0])}function $tt(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}as.prototype.visitBool=OQt;as.prototype.visitInt=bA;as.prototype.visitFloat=bA;as.prototype.visitUtf8=qN;as.prototype.visitLargeUtf8=qN;as.prototype.visitBinary=qN;as.prototype.visitLargeBinary=qN;as.prototype.visitFixedSizeBinary=bA;as.prototype.visitDate=bA;as.prototype.visitTimestamp=bA;as.prototype.visitTime=bA;as.prototype.visitDecimal=bA;as.prototype.visitList=Gtt;as.prototype.visitStruct=$tt;as.prototype.visitUnion=DQt;as.prototype.visitInterval=bA;as.prototype.visitDuration=bA;as.prototype.visitFixedSizeList=Gtt;as.prototype.visitMap=Gtt;var Ex=class extends Ax{static throughNode(t){throw new Error('\"throughNode\" not available in this environment')}static throughDOM(t,r){throw new Error('\"throughDOM\" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new K0,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Uc(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy==\"boolean\"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat==\"boolean\"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error(\"Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).\");if(Object.values(Vc).includes(t.compressionType))this._compression=new gx(t.compressionType);else{let r=Object.values(Vc).filter(i=>typeof i==\"string\");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${r.join(\", \")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Ch(t)?t.then(r=>this.writeAll(r)):Ud(t)?qtt(this,t):Wtt(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof K0?this._sink=t:(this._sink=new K0,t&&d3t(t)?this.toDOMStream({type:\"bytes\"}).pipeTo(t):t&&f3t(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!wx(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Ll&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof Es&&!(r=t.schema))return this.finish()&&void 0}else throw new Error(\"RecordBatchWriter is closed\");if(r&&!wx(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof Es?t instanceof Tx||this._writeRecordBatch(t):t instanceof Ll?this.writeAll(t.batches):rp(t)&&this.writeAll(t)}_writeMessage(t,r=8){let i=r-1,n=Du.encode(t),o=n.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+i&~i,h=a-o-s;return t.headerType===zi.RecordBatch?this._recordBatchBlocks.push(new mA(a,t.bodyLength,this._position)):t.headerType===zi.DictionaryBatch&&this._dictionaryBlocks.push(new mA(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(n),this._writePadding(h)}_write(t){if(this._started){let r=Qr(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Du.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(MT)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o}=this._assembleRecordBatch(t),s=new _a(t.numRows,i,n,this._compression),a=Du.from(s,r);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:i,bufferRegions:n,buffers:o}=as.assemble(t);return this._compression!=null&&({byteLength:r,bufferRegions:n,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:i,bufferRegions:n,buffers:o}}_compressBodyBuffers(t){let r=PT.get(this._compression.type);if(!r?.encode||typeof r.encode!=\"function\")throw new Error(`Codec for compression type \"${Vc[this._compression.type]}\" has invalid encode method`);let i=0,n=[],o=[];for(let a of t){let h=Qr(a);if(h.length===0){n.push(new Uint8Array(0),new Uint8Array(0)),o.push(new ya(i,0));continue}let p=r.encode(h),g=p.length<h.length,w=g?p:h,C=g?w.length:-1,R=new Dl(new Uint8Array(8));R.writeInt64(0,BigInt(C)),n.push(R.bytes(),new Uint8Array(w));let z=(i+7&-8)-i;i+=z;let W=8+w.length;o.push(new ya(i,W)),i+=W}let s=(i+7&-8)-i;return i+=s,{byteLength:i,bufferRegions:o,buffers:n}}_writeDictionaryBatch(t,r,i=!1){let{byteLength:n,nodes:o,bufferRegions:s,buffers:a}=this._assembleRecordBatch(new Er([t])),h=new _a(t.length,o,s,this._compression),p=new cc(h,r,i),g=Du.from(p,n);return this._writeMessage(g)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r=this._compression!=null?2:1,i=new Array(r);for(let n=0;n<t.length;n+=r){let o=0;for(let a=-1;++a<r;)i[a]=t[n+a],o+=i[a].byteLength;if(o===0)continue;for(let a of i)this._write(a);let s=(o+7&-8)-o;s>0&&this._writePadding(s)}return this}_writeDictionaries(t){var r,i;for(let[n,o]of t.dictionaries){let s=(r=o?.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(n),h=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==s[0])for(let[p,g]of s.entries())this._writeDictionaryBatch(g,n,p>0);else if(h<s.length)for(let p of s.slice(h))this._writeDictionaryBatch(p,n,!0);this._seenDictionaries.set(n,o),this._dictionaryDeltaOffsets.set(n,s.length)}return this}},e8=class e extends Ex{static writeAll(t,r){let i=new e(r);return Ch(t)?t.then(n=>i.writeAll(n)):Ud(t)?qtt(i,t):Wtt(i,t)}},r8=class e extends Ex{static writeAll(t,r){let i=new e(r);return Ch(t)?t.then(n=>i.writeAll(n)):Ud(t)?qtt(i,t):Wtt(i,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,i=!1){if(!i&&this._seenDictionaries.has(r))throw new Error(\"The Arrow File format does not support replacement dictionaries. \");return super._writeDictionaryBatch(t,r,i)}_writeFooter(t){let r=pA.encode(new pA(t,In.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}};function Wtt(e,t){let r=t;t instanceof Ll&&(r=t.batches,e.reset(void 0,t.schema));for(let i of r)e.write(i);return e.finish()}function qtt(e,t){return vr(this,void 0,void 0,function*(){var r,i,n,o,s,a,h;try{for(r=!0,i=Qf(t);n=yield i.next(),o=n.done,!o;r=!0){h=n.value,r=!1;let p=h;e.write(p)}}catch(p){s={error:p}}finally{try{!r&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(s)throw s.error}}return e.finish()})}function nTt(e,t){if(Ud(e))return BQt(e,t);if(rp(e))return LQt(e,t);throw new Error(\"toDOMStream() must be called with an Iterable or AsyncIterable\")}function LQt(e,t){let r=null,i=t?.type===\"bytes\"||!1,n=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){r?.return&&r.return(),r=null}}),Object.assign({highWaterMark:i?n:void 0},t));function o(s,a){let h,p=null,g=s.desiredSize||null;for(;!(p=a.next(i?g:null)).done;)if(ArrayBuffer.isView(p.value)&&(h=Qr(p.value))&&(g!=null&&i&&(g=g-h.byteLength+1),p.value=h),s.enqueue(p.value),g!=null&&--g<=0)return;s.close()}}function BQt(e,t){let r=null,i=t?.type===\"bytes\"||!1,n=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return vr(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return vr(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return vr(this,void 0,void 0,function*(){r?.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:i?n:void 0},t));function o(s,a){return vr(this,void 0,void 0,function*(){let h,p=null,g=s.desiredSize||null;for(;!(p=yield a.next(i?g:null)).done;)if(ArrayBuffer.isView(p.value)&&(h=Qr(p.value))&&(g!=null&&i&&(g=g-h.byteLength+1),p.value=h),s.enqueue(p.value),g!=null&&--g<=0)return;s.close()})}}function aTt(e){return new Htt(e)}var Htt=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{[\"readableStrategy\"]:r,[\"writableStrategy\"]:i,[\"queueingStrategy\"]:n=\"count\"}=t,o=R1t(t,[\"readableStrategy\",\"writableStrategy\",\"queueingStrategy\"]);this._controller=null,this._builder=vx(o),this._getSize=n!==\"bytes\"?oTt:sTt;let{[\"highWaterMark\"]:s=n===\"bytes\"?Math.pow(2,14):1e3}=Object.assign({},r),{[\"highWaterMark\"]:a=n===\"bytes\"?Math.pow(2,14):1e3}=Object.assign({},i);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:h=>{this._maybeFlush(this._builder,this._controller=h)},start:h=>{this._maybeFlush(this._builder,this._controller=h)}},{highWaterMark:s,size:n!==\"bytes\"?oTt:sTt}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:h=>this._writeValueAndReturnChunkSize(h)})}_writeValueAndReturnChunkSize(t){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},oTt=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},sTt=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function HN(e,t){let r=new K0,i=null,n=new ReadableStream({cancel(){return vr(this,void 0,void 0,function*(){yield r.close()})},start(a){return vr(this,void 0,void 0,function*(){yield s(a,i||(i=yield o()))})},pull(a){return vr(this,void 0,void 0,function*(){i?yield s(a,i):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:n};function o(){return vr(this,void 0,void 0,function*(){return yield(yield Oh.from(r)).open(t)})}function s(a,h){return vr(this,void 0,void 0,function*(){let p=a.desiredSize,g=null;for(;!(g=yield h.next()).done;)if(a.enqueue(g.value),p!=null&&--p<=0)return;a.close()})}}function YN(e,t){let r=new this(e),i=new Qd(r),n=new ReadableStream({cancel(){return vr(this,void 0,void 0,function*(){yield i.cancel()})},pull(s){return vr(this,void 0,void 0,function*(){yield o(s)})},start(s){return vr(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:n};function o(s){return vr(this,void 0,void 0,function*(){let a=null,h=s.desiredSize;for(;a=yield i.read(h||null);)if(s.enqueue(a),h!=null&&(h-=a.byteLength)<=0)return;s.close()})}}function i8(e){let t=Oh.from(e);return Ch(t)?t.then(r=>i8(r)):t.isAsync()?t.readAll().then(r=>new Ll(r)):new Ll(t.readAll())}var oJt=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ttt),Ett),gtt),ett),HJ),mtt),ZJ),Itt),{compareSchemas:wx,compareFields:$4t,compareTypes:G4t});Rl.toDOMStream=nTt;Vo.throughDOM=aTt;Oh.throughDOM=HN;Mx.throughDOM=HN;vA.throughDOM=HN;Ex.throughDOM=YN;r8.throughDOM=YN;e8.throughDOM=YN;var ue,n8=null;function kT(){return(n8===null||n8.byteLength===0)&&(n8=new Uint8Array(ue.memory.buffer)),n8}var XN=new TextDecoder(\"utf-8\",{ignoreBOM:!0,fatal:!0});XN.decode();var sJt=2146435072,Ytt=0;function aJt(e,t){return Ytt+=t,Ytt>=sJt&&(XN=new TextDecoder(\"utf-8\",{ignoreBOM:!0,fatal:!0}),XN.decode(),Ytt=t),XN.decode(kT().subarray(e,e+t))}function pp(e,t){return e=e>>>0,aJt(e,t)}var hc=0,s8=new TextEncoder;\"encodeInto\"in s8||(s8.encodeInto=function(e,t){let r=s8.encode(e);return t.set(r),{read:e.length,written:r.length}});function mp(e,t,r){if(r===void 0){let a=s8.encode(e),h=t(a.length,1)>>>0;return kT().subarray(h,h+a.length).set(a),hc=a.length,h}let i=e.length,n=t(i,1)>>>0,o=kT(),s=0;for(;s<i;s++){let a=e.charCodeAt(s);if(a>127)break;o[n+s]=a}if(s!==i){s!==0&&(e=e.slice(s)),n=r(n,i,i=s+e.length*3,1)>>>0;let a=kT().subarray(n+s,n+i),h=s8.encodeInto(e,a);s+=h.written,n=r(n,i,s,1)>>>0}return hc=s,n}var Px=null;function Lh(){return(Px===null||Px.buffer.detached===!0||Px.buffer.detached===void 0&&Px.buffer!==ue.memory.buffer)&&(Px=new DataView(ue.memory.buffer)),Px}function im(e){let t=ue.__externref_table_alloc();return ue.__wbindgen_export_4.set(t,e),t}function La(e,t){try{return e.apply(this,t)}catch(r){let i=im(r);ue.__wbindgen_exn_store(i)}}function uc(e){return e==null}function RT(e,t){return e=e>>>0,kT().subarray(e/1,e/1+t)}function Ztt(e){let t=typeof e;if(t==\"number\"||t==\"boolean\"||e==null)return`${e}`;if(t==\"string\")return`\"${e}\"`;if(t==\"symbol\"){let n=e.description;return n==null?\"Symbol\":`Symbol(${n})`}if(t==\"function\"){let n=e.name;return typeof n==\"string\"&&n.length>0?`Function(${n})`:\"Function\"}if(Array.isArray(e)){let n=e.length,o=\"[\";n>0&&(o+=Ztt(e[0]));for(let s=1;s<n;s++)o+=\", \"+Ztt(e[s]);return o+=\"]\",o}let r=/\\[object ([^\\]]+)\\]/.exec(toString.call(e)),i;if(r&&r.length>1)i=r[1];else return toString.call(e);if(i==\"Object\")try{return\"Object(\"+JSON.stringify(e)+\")\"}catch{return\"Object\"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:i}var lTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{ue.__wbindgen_export_5.get(e.dtor)(e.a,e.b)});function cTt(e,t,r,i){let n={a:e,b:t,cnt:1,dtor:r},o=(...s)=>{n.cnt++;let a=n.a;n.a=0;try{return i(a,n.b,...s)}finally{--n.cnt===0?(ue.__wbindgen_export_5.get(n.dtor)(a,n.b),lTt.unregister(n)):n.a=a}};return o.original=n,lTt.register(o,n,n),o}function Xs(e){let t=ue.__wbindgen_export_4.get(e);return ue.__externref_table_dealloc(e),t}function a8(e,t){e=e>>>0;let r=Lh(),i=[];for(let n=e;n<e+4*t;n+=4)i.push(ue.__wbindgen_export_4.get(r.getUint32(n,!0)));return ue.__externref_drop_slice(e,t),i}function wTt(e,t){let r=t(e.length*1,1)>>>0;return kT().set(e,r/1),hc=e.length,r}function TTt(e,t){let r=wTt(e,ue.__wbindgen_malloc),i=hc,n=ue.readParquet(r,i,uc(t)?0:im(t));if(n[2])throw Xs(n[1]);return NT.__wrap(n[0])}function lJt(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}var o8=null;function cJt(){return(o8===null||o8.byteLength===0)&&(o8=new Uint32Array(ue.memory.buffer)),o8}function uJt(e,t){return e=e>>>0,cJt().subarray(e/4,e/4+t)}function hJt(e,t){ue.wasm_bindgen__convert__closures_____invoke__hfec9c6c02f6046ed(e,t)}function dJt(e,t,r){ue.closure3789_externref_shim(e,t,r)}function fJt(e,t,r,i){ue.closure3803_externref_shim(e,t,r,i)}var Kfr=Object.freeze({UNCOMPRESSED:0,0:\"UNCOMPRESSED\",SNAPPY:1,1:\"SNAPPY\",GZIP:2,2:\"GZIP\",BROTLI:3,3:\"BROTLI\",LZ4:4,4:\"LZ4\",ZSTD:5,5:\"ZSTD\",LZ4_RAW:6,6:\"LZ4_RAW\",LZO:7,7:\"LZO\"}),Qfr=Object.freeze({None:0,0:\"None\",Chunk:1,1:\"Chunk\",Page:2,2:\"Page\"}),Jfr=Object.freeze({PLAIN:0,0:\"PLAIN\",PLAIN_DICTIONARY:1,1:\"PLAIN_DICTIONARY\",RLE:2,2:\"RLE\",BIT_PACKED:3,3:\"BIT_PACKED\",DELTA_BINARY_PACKED:4,4:\"DELTA_BINARY_PACKED\",DELTA_LENGTH_BYTE_ARRAY:5,5:\"DELTA_LENGTH_BYTE_ARRAY\",DELTA_BYTE_ARRAY:6,6:\"DELTA_BYTE_ARRAY\",RLE_DICTIONARY:7,7:\"RLE_DICTIONARY\",BYTE_STREAM_SPLIT:8,8:\"BYTE_STREAM_SPLIT\"}),tpr=Object.freeze({V1:0,0:\"V1\",V2:1,1:\"V2\"}),pJt=[\"bytes\"],mJt=[\"default\",\"no-store\",\"reload\",\"no-cache\",\"force-cache\",\"only-if-cached\"],gJt=[\"omit\",\"same-origin\",\"include\"],AJt=[\"same-origin\",\"no-cors\",\"cors\",\"navigate\"],uTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_columnchunkmetadata_free(e>>>0,1)),DT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,uTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,uTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_columnchunkmetadata_free(t,0)}filePath(){let t=ue.columnchunkmetadata_filePath(this.__wbg_ptr),r;return t[0]!==0&&(r=pp(t[0],t[1]).slice(),ue.__wbindgen_free(t[0],t[1]*1,1)),r}fileOffset(){return ue.columnchunkmetadata_fileOffset(this.__wbg_ptr)}columnPath(){let t=ue.columnchunkmetadata_columnPath(this.__wbg_ptr);var r=a8(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}encodings(){let t=ue.columnchunkmetadata_encodings(this.__wbg_ptr);var r=a8(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}numValues(){return ue.columnchunkmetadata_numValues(this.__wbg_ptr)}compression(){return ue.columnchunkmetadata_compression(this.__wbg_ptr)}compressedSize(){return ue.columnchunkmetadata_compressedSize(this.__wbg_ptr)}uncompressedSize(){return ue.columnchunkmetadata_uncompressedSize(this.__wbg_ptr)}};Symbol.dispose&&(DT.prototype[Symbol.dispose]=DT.prototype.free);var hTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_ffidata_free(e>>>0,1)),OT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,hTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,hTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_ffidata_free(t,0)}arrayAddr(){return ue.ffidata_arrayAddr(this.__wbg_ptr)>>>0}schemaAddr(){return ue.ffidata_schemaAddr(this.__wbg_ptr)>>>0}};Symbol.dispose&&(OT.prototype[Symbol.dispose]=OT.prototype.free);var dTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_ffischema_free(e>>>0,1)),LT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,dTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,dTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_ffischema_free(t,0)}addr(){return ue.ffischema_addr(this.__wbg_ptr)>>>0}};Symbol.dispose&&(LT.prototype[Symbol.dispose]=LT.prototype.free);var fTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_ffistream_free(e>>>0,1)),BT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,fTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,fTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_ffistream_free(t,0)}numArrays(){return ue.ffistream_numArrays(this.__wbg_ptr)>>>0}schemaAddr(){return ue.ffistream_schemaAddr(this.__wbg_ptr)>>>0}arrayAddr(t){return ue.ffistream_arrayAddr(this.__wbg_ptr,t)>>>0}arrayAddrs(){let t=ue.ffistream_arrayAddrs(this.__wbg_ptr);var r=uJt(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}drop(){let t=this.__destroy_into_raw();ue.ffistream_drop(t)}};Symbol.dispose&&(BT.prototype[Symbol.dispose]=BT.prototype.free);var pTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_filemetadata_free(e>>>0,1)),l8=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,pTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,pTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_filemetadata_free(t,0)}version(){return ue.filemetadata_version(this.__wbg_ptr)}numRows(){return ue.filemetadata_numRows(this.__wbg_ptr)}createdBy(){let t=ue.filemetadata_createdBy(this.__wbg_ptr),r;return t[0]!==0&&(r=pp(t[0],t[1]).slice(),ue.__wbindgen_free(t[0],t[1]*1,1)),r}keyValueMetadata(){let t=ue.filemetadata_keyValueMetadata(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return Xs(t[0])}};Symbol.dispose&&(l8.prototype[Symbol.dispose]=l8.prototype.free);var yJt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_intounderlyingbytesource_free(e>>>0,1)),ZN=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,yJt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_intounderlyingbytesource_free(t,0)}get type(){let t=ue.intounderlyingbytesource_type(this.__wbg_ptr);return pJt[t]}get autoAllocateChunkSize(){return ue.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr)>>>0}start(t){ue.intounderlyingbytesource_start(this.__wbg_ptr,t)}pull(t){return ue.intounderlyingbytesource_pull(this.__wbg_ptr,t)}cancel(){let t=this.__destroy_into_raw();ue.intounderlyingbytesource_cancel(t)}};Symbol.dispose&&(ZN.prototype[Symbol.dispose]=ZN.prototype.free);var _Jt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_intounderlyingsink_free(e>>>0,1)),KN=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_Jt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_intounderlyingsink_free(t,0)}write(t){return ue.intounderlyingsink_write(this.__wbg_ptr,t)}close(){let t=this.__destroy_into_raw();return ue.intounderlyingsink_close(t)}abort(t){let r=this.__destroy_into_raw();return ue.intounderlyingsink_abort(r,t)}};Symbol.dispose&&(KN.prototype[Symbol.dispose]=KN.prototype.free);var mTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_intounderlyingsource_free(e>>>0,1)),c8=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,mTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,mTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_intounderlyingsource_free(t,0)}pull(t){return ue.intounderlyingsource_pull(this.__wbg_ptr,t)}cancel(){let t=this.__destroy_into_raw();ue.intounderlyingsource_cancel(t)}};Symbol.dispose&&(c8.prototype[Symbol.dispose]=c8.prototype.free);var gTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_parquetfile_free(e>>>0,1)),u8=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,gTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,gTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_parquetfile_free(t,0)}static fromUrl(t){let r=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),i=hc;return ue.parquetfile_fromUrl(r,i)}static fromFile(t){return ue.parquetfile_fromFile(t)}metadata(){let t=ue.parquetfile_metadata(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return h8.__wrap(t[0])}schema(){let t=ue.parquetfile_schema(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return u_.__wrap(t[0])}read(t){return ue.parquetfile_read(this.__wbg_ptr,uc(t)?0:im(t))}stream(t){return ue.parquetfile_stream(this.__wbg_ptr,uc(t)?0:im(t))}};Symbol.dispose&&(u8.prototype[Symbol.dispose]=u8.prototype.free);var ATt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_parquetmetadata_free(e>>>0,1)),h8=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,ATt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ATt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_parquetmetadata_free(t,0)}fileMetadata(){let t=ue.parquetmetadata_fileMetadata(this.__wbg_ptr);return l8.__wrap(t)}numRowGroups(){return ue.parquetmetadata_numRowGroups(this.__wbg_ptr)>>>0}rowGroup(t){let r=ue.parquetmetadata_rowGroup(this.__wbg_ptr,t);return FT.__wrap(r)}rowGroups(){let t=ue.parquetmetadata_rowGroups(this.__wbg_ptr);var r=a8(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}};Symbol.dispose&&(h8.prototype[Symbol.dispose]=h8.prototype.free);var yTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_recordbatch_free(e>>>0,1)),Cx=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,yTt.register(r,r.__wbg_ptr,r),r}static __unwrap(t){return t instanceof e?t.__destroy_into_raw():0}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,yTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_recordbatch_free(t,0)}get numRows(){return ue.recordbatch_numRows(this.__wbg_ptr)>>>0}get numColumns(){return ue.recordbatch_numColumns(this.__wbg_ptr)>>>0}get schema(){let t=ue.recordbatch_schema(this.__wbg_ptr);return u_.__wrap(t)}toFFI(){let t=ue.recordbatch_toFFI(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return OT.__wrap(t[0])}intoFFI(){let t=this.__destroy_into_raw(),r=ue.recordbatch_intoFFI(t);if(r[2])throw Xs(r[1]);return OT.__wrap(r[0])}intoIPCStream(){let t=this.__destroy_into_raw(),r=ue.recordbatch_intoIPCStream(t);if(r[3])throw Xs(r[2]);var i=RT(r[0],r[1]).slice();return ue.__wbindgen_free(r[0],r[1]*1,1),i}withSchema(t){lJt(t,u_);var r=t.__destroy_into_raw();let i=ue.recordbatch_withSchema(this.__wbg_ptr,r);if(i[2])throw Xs(i[1]);return e.__wrap(i[0])}slice(t,r){let i=ue.recordbatch_slice(this.__wbg_ptr,t,r);return e.__wrap(i)}getArrayMemorySize(){return ue.recordbatch_getArrayMemorySize(this.__wbg_ptr)>>>0}};Symbol.dispose&&(Cx.prototype[Symbol.dispose]=Cx.prototype.free);var _Tt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_rowgroupmetadata_free(e>>>0,1)),FT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,_Tt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_Tt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_rowgroupmetadata_free(t,0)}numColumns(){return ue.rowgroupmetadata_numColumns(this.__wbg_ptr)>>>0}column(t){let r=ue.rowgroupmetadata_column(this.__wbg_ptr,t);return DT.__wrap(r)}columns(){let t=ue.rowgroupmetadata_columns(this.__wbg_ptr);var r=a8(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}numRows(){return ue.rowgroupmetadata_numRows(this.__wbg_ptr)}totalByteSize(){return ue.rowgroupmetadata_totalByteSize(this.__wbg_ptr)}compressedSize(){return ue.rowgroupmetadata_compressedSize(this.__wbg_ptr)}};Symbol.dispose&&(FT.prototype[Symbol.dispose]=FT.prototype.free);var vTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_schema_free(e>>>0,1)),u_=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,vTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,vTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_schema_free(t,0)}toFFI(){let t=ue.schema_toFFI(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return LT.__wrap(t[0])}intoFFI(){let t=this.__destroy_into_raw(),r=ue.schema_intoFFI(t);if(r[2])throw Xs(r[1]);return LT.__wrap(r[0])}intoIPCStream(){let t=this.__destroy_into_raw(),r=ue.schema_intoIPCStream(t);if(r[3])throw Xs(r[2]);var i=RT(r[0],r[1]).slice();return ue.__wbindgen_free(r[0],r[1]*1,1),i}withMetadata(t){let r=ue.schema_withMetadata(this.__wbg_ptr,t);if(r[2])throw Xs(r[1]);return e.__wrap(r[0])}indexOf(t){let r=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),i=hc,n=ue.schema_indexOf(this.__wbg_ptr,r,i);if(n[2])throw Xs(n[1]);return n[0]>>>0}metadata(){let t=ue.schema_metadata(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return Xs(t[0])}};Symbol.dispose&&(u_.prototype[Symbol.dispose]=u_.prototype.free);var bTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_table_free(e>>>0,1)),NT=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,bTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,bTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_table_free(t,0)}get schema(){let t=ue.table_schema(this.__wbg_ptr);return u_.__wrap(t)}recordBatch(t){let r=ue.table_recordBatch(this.__wbg_ptr,t);return r===0?void 0:Cx.__wrap(r)}recordBatches(){let t=ue.table_recordBatches(this.__wbg_ptr);var r=a8(t[0],t[1]).slice();return ue.__wbindgen_free(t[0],t[1]*4,4),r}get numBatches(){return ue.table_numBatches(this.__wbg_ptr)>>>0}toFFI(){let t=ue.table_toFFI(this.__wbg_ptr);if(t[2])throw Xs(t[1]);return BT.__wrap(t[0])}intoFFI(){let t=this.__destroy_into_raw(),r=ue.table_intoFFI(t);if(r[2])throw Xs(r[1]);return BT.__wrap(r[0])}intoIPCStream(){let t=this.__destroy_into_raw(),r=ue.table_intoIPCStream(t);if(r[3])throw Xs(r[2]);var i=RT(r[0],r[1]).slice();return ue.__wbindgen_free(r[0],r[1]*1,1),i}static fromIPCStream(t){let r=wTt(t,ue.__wbindgen_malloc),i=hc,n=ue.table_fromIPCStream(r,i);if(n[2])throw Xs(n[1]);return e.__wrap(n[0])}getArrayMemorySize(){return ue.table_getArrayMemorySize(this.__wbg_ptr)>>>0}};Symbol.dispose&&(NT.prototype[Symbol.dispose]=NT.prototype.free);var xTt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_writerproperties_free(e>>>0,1)),d8=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,xTt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,xTt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_writerproperties_free(t,0)}};Symbol.dispose&&(d8.prototype[Symbol.dispose]=d8.prototype.free);var Xtt=typeof FinalizationRegistry>\"u\"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ue.__wbg_writerpropertiesbuilder_free(e>>>0,1)),QN=class e{static __wrap(t){t=t>>>0;let r=Object.create(e.prototype);return r.__wbg_ptr=t,Xtt.register(r,r.__wbg_ptr,r),r}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Xtt.unregister(this),t}free(){let t=this.__destroy_into_raw();ue.__wbg_writerpropertiesbuilder_free(t,0)}constructor(){let t=ue.writerpropertiesbuilder_new();return this.__wbg_ptr=t>>>0,Xtt.register(this,this.__wbg_ptr,this),this}build(){let t=this.__destroy_into_raw(),r=ue.writerpropertiesbuilder_build(t);return d8.__wrap(r)}setWriterVersion(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setWriterVersion(r,t);return e.__wrap(i)}setDataPageSizeLimit(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setDataPageSizeLimit(r,t);return e.__wrap(i)}setDictionaryPageSizeLimit(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setDictionaryPageSizeLimit(r,t);return e.__wrap(i)}setWriteBatchSize(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setWriteBatchSize(r,t);return e.__wrap(i)}setMaxRowGroupSize(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setMaxRowGroupSize(r,t);return e.__wrap(i)}setCreatedBy(t){let r=this.__destroy_into_raw(),i=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),n=hc,o=ue.writerpropertiesbuilder_setCreatedBy(r,i,n);return e.__wrap(o)}setKeyValueMetadata(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setKeyValueMetadata(r,t);if(i[2])throw Xs(i[1]);return e.__wrap(i[0])}setEncoding(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setEncoding(r,t);return e.__wrap(i)}setCompression(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setCompression(r,t);return e.__wrap(i)}setDictionaryEnabled(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setDictionaryEnabled(r,t);return e.__wrap(i)}setStatisticsEnabled(t){let r=this.__destroy_into_raw(),i=ue.writerpropertiesbuilder_setStatisticsEnabled(r,t);return e.__wrap(i)}setColumnEncoding(t,r){let i=this.__destroy_into_raw(),n=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc,s=ue.writerpropertiesbuilder_setColumnEncoding(i,n,o,r);return e.__wrap(s)}setColumnCompression(t,r){let i=this.__destroy_into_raw(),n=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc,s=ue.writerpropertiesbuilder_setColumnCompression(i,n,o,r);return e.__wrap(s)}setColumnDictionaryEnabled(t,r){let i=this.__destroy_into_raw(),n=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc,s=ue.writerpropertiesbuilder_setColumnDictionaryEnabled(i,n,o,r);return e.__wrap(s)}setColumnStatisticsEnabled(t,r){let i=this.__destroy_into_raw(),n=mp(t,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc,s=ue.writerpropertiesbuilder_setColumnStatisticsEnabled(i,n,o,r);return e.__wrap(s)}};Symbol.dispose&&(QN.prototype[Symbol.dispose]=QN.prototype.free);var vJt=new Set([\"basic\",\"cors\",\"default\"]);async function bJt(e,t){if(typeof Response==\"function\"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==\"function\")try{return await WebAssembly.instantiateStreaming(e,t)}catch(i){if(e.ok&&vJt.has(e.type)&&e.headers.get(\"Content-Type\")!==\"application/wasm\")console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",i);else throw i}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function xJt(){let e={};return e.wbg={},e.wbg.__wbg_Error_e17e777aac105295=function(t,r){return Error(pp(t,r))},e.wbg.__wbg_Number_998bea33bd87c3e0=function(t){return Number(t)},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,r){let i=String(r),n=mp(i,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc;Lh().setInt32(t+4,o,!0),Lh().setInt32(t+0,n,!0)},e.wbg.__wbg_abort_67e1b49bf6614565=function(t){t.abort()},e.wbg.__wbg_abort_d830bf2e9aa6ec5b=function(t,r){t.abort(r)},e.wbg.__wbg_append_72a3c0addd2bce38=function(){return La(function(t,r,i,n,o){t.append(pp(r,i),pp(n,o))},arguments)},e.wbg.__wbg_arrayBuffer_2c907ed8e8ef4e35=function(t){return t.arrayBuffer()},e.wbg.__wbg_arrayBuffer_9c99b8e2809e8cbb=function(){return La(function(t){return t.arrayBuffer()},arguments)},e.wbg.__wbg_buffer_8d40b1d762fb3c66=function(t){return t.buffer},e.wbg.__wbg_byobRequest_2c036bceca1e6037=function(t){let r=t.byobRequest;return uc(r)?0:im(r)},e.wbg.__wbg_byteLength_331a6b5545834024=function(t){return t.byteLength},e.wbg.__wbg_byteOffset_49a5b5608000358b=function(t){return t.byteOffset},e.wbg.__wbg_call_13410aac570ffff7=function(){return La(function(t,r){return t.call(r)},arguments)},e.wbg.__wbg_call_a5400b25a865cfd8=function(){return La(function(t,r,i){return t.call(r,i)},arguments)},e.wbg.__wbg_cancel_8bb5b8f4906b658a=function(t){return t.cancel()},e.wbg.__wbg_catch_c80ecae90cb8ed4e=function(t,r){return t.catch(r)},e.wbg.__wbg_clearTimeout_6222fede17abcb1a=function(t){return clearTimeout(t)},e.wbg.__wbg_close_a1918cff3cac355b=function(t){return t.close()},e.wbg.__wbg_close_cccada6053ee3a65=function(){return La(function(t){t.close()},arguments)},e.wbg.__wbg_close_d71a78219dc23e91=function(){return La(function(t){t.close()},arguments)},e.wbg.__wbg_columnchunkmetadata_new=function(t){return DT.__wrap(t)},e.wbg.__wbg_done_75ed0ee6dd243d9d=function(t){return t.done},e.wbg.__wbg_enqueue_452bc2343d1c2ff9=function(){return La(function(t,r){t.enqueue(r)},arguments)},e.wbg.__wbg_entries_2be2f15bd5554996=function(t){return Object.entries(t)},e.wbg.__wbg_fetch_87aed7f306ec6d63=function(t,r){return t.fetch(r)},e.wbg.__wbg_fetch_f156d10be9a5c88a=function(t){return fetch(t)},e.wbg.__wbg_getReader_48e00749fe3f6089=function(){return La(function(t){return t.getReader()},arguments)},e.wbg.__wbg_getWriter_03d7689e275ac6a4=function(){return La(function(t){return t.getWriter()},arguments)},e.wbg.__wbg_get_0da715ceaecea5c8=function(t,r){return t[r>>>0]},e.wbg.__wbg_get_458e874b43b18b25=function(){return La(function(t,r){return Reflect.get(t,r)},arguments)},e.wbg.__wbg_getdone_f026246f6bbe58d3=function(t){let r=t.done;return uc(r)?16777215:r?1:0},e.wbg.__wbg_getvalue_31e5a08f61e5aa42=function(t){return t.value},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,r){return t[r]},e.wbg.__wbg_has_b89e451f638123e3=function(){return La(function(t,r){return Reflect.has(t,r)},arguments)},e.wbg.__wbg_headers_29fec3c72865cd75=function(t){return t.headers},e.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd=function(t){let r;try{r=t instanceof ArrayBuffer}catch{r=!1}return r},e.wbg.__wbg_instanceof_Response_50fde2cd696850bf=function(t){let r;try{r=t instanceof Response}catch{r=!1}return r},e.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7=function(t){let r;try{r=t instanceof Uint8Array}catch{r=!1}return r},e.wbg.__wbg_isArray_030cce220591fb41=function(t){return Array.isArray(t)},e.wbg.__wbg_isSafeInteger_1c0d1af5542e102a=function(t){return Number.isSafeInteger(t)},e.wbg.__wbg_iterator_f370b34483c71a1c=function(){return Symbol.iterator},e.wbg.__wbg_length_186546c51cd61acd=function(t){return t.length},e.wbg.__wbg_length_6bb7e81f9d7713e4=function(t){return t.length},e.wbg.__wbg_new_19c25a3f2fa63a02=function(){return new Object},e.wbg.__wbg_new_2e3c58a15f39f5f9=function(t,r){try{var i={a:t,b:r},n=(s,a)=>{let h=i.a;i.a=0;try{return fJt(h,i.b,s,a)}finally{i.a=h}};return new Promise(n)}finally{i.a=i.b=0}},e.wbg.__wbg_new_2ff1f68f3676ea53=function(){return new Map},e.wbg.__wbg_new_638ebfaedbf32a5e=function(t){return new Uint8Array(t)},e.wbg.__wbg_new_66b9434b4e59b63e=function(){return La(function(){return new AbortController},arguments)},e.wbg.__wbg_new_99a6a948d5b3f607=function(){return La(function(){return new TransformStream},arguments)},e.wbg.__wbg_new_da9dc54c5db29dfa=function(t,r){return new Error(pp(t,r))},e.wbg.__wbg_new_f6e53210afea8e45=function(){return La(function(){return new Headers},arguments)},e.wbg.__wbg_newfromslice_074c56947bd43469=function(t,r){return new Uint8Array(RT(t,r))},e.wbg.__wbg_newnoargs_254190557c45b4ec=function(t,r){return new Function(pp(t,r))},e.wbg.__wbg_newwithbyteoffset_6bd4b2a4ca518883=function(t,r){return new Uint8Array(t,r>>>0)},e.wbg.__wbg_newwithbyteoffsetandlength_e8f53910b4d42b45=function(t,r,i){return new Uint8Array(t,r>>>0,i>>>0)},e.wbg.__wbg_newwithintounderlyingsource_b47f6a6a596a7f24=function(t,r){return new ReadableStream(c8.__wrap(t),r)},e.wbg.__wbg_newwithstrandinit_b5d168a29a3fd85f=function(){return La(function(t,r,i){return new Request(pp(t,r),i)},arguments)},e.wbg.__wbg_next_5b3530e612fde77d=function(t){return t.next},e.wbg.__wbg_next_692e82279131b03c=function(){return La(function(t){return t.next()},arguments)},e.wbg.__wbg_parquetfile_new=function(t){return u8.__wrap(t)},e.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(t,r,i){Uint8Array.prototype.set.call(RT(t,r),i)},e.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(t){queueMicrotask(t)},e.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(t){return t.queueMicrotask},e.wbg.__wbg_read_bc925c758aa4d897=function(t){return t.read()},e.wbg.__wbg_readable_e82cff27b968ed1c=function(t){return t.readable},e.wbg.__wbg_ready_4186da3cb500ae7d=function(t){return t.ready},e.wbg.__wbg_recordbatch_new=function(t){return Cx.__wrap(t)},e.wbg.__wbg_recordbatch_unwrap=function(t){return Cx.__unwrap(t)},e.wbg.__wbg_releaseLock_62151472ae632176=function(t){t.releaseLock()},e.wbg.__wbg_releaseLock_ff29b586502a8221=function(t){t.releaseLock()},e.wbg.__wbg_resolve_4055c623acdd6a1b=function(t){return Promise.resolve(t)},e.wbg.__wbg_respond_6c2c4e20ef85138e=function(){return La(function(t,r){t.respond(r>>>0)},arguments)},e.wbg.__wbg_rowgroupmetadata_new=function(t){return FT.__wrap(t)},e.wbg.__wbg_setTimeout_2b339866a2aa3789=function(t,r){return setTimeout(t,r)},e.wbg.__wbg_set_1353b2a5e96bc48c=function(t,r,i){t.set(RT(r,i))},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,r,i){t[r]=i},e.wbg.__wbg_set_b7f1cf4fae26fe2a=function(t,r,i){return t.set(r,i)},e.wbg.__wbg_setbody_c8460bdf44147df8=function(t,r){t.body=r},e.wbg.__wbg_setcache_90ca4ad8a8ad40d3=function(t,r){t.cache=mJt[r]},e.wbg.__wbg_setcredentials_9cd60d632c9d5dfc=function(t,r){t.credentials=gJt[r]},e.wbg.__wbg_setheaders_0052283e2f3503d1=function(t,r){t.headers=r},e.wbg.__wbg_sethighwatermark_3d5961f834647d41=function(t,r){t.highWaterMark=r},e.wbg.__wbg_setmethod_9b504d5b855b329c=function(t,r,i){t.method=pp(r,i)},e.wbg.__wbg_setmode_a23e1a2ad8b512f8=function(t,r){t.mode=AJt[r]},e.wbg.__wbg_setsignal_8c45ad1247a74809=function(t,r){t.signal=r},e.wbg.__wbg_signal_da4d466ce86118b5=function(t){return t.signal},e.wbg.__wbg_size_8f84e7768fba0589=function(t){return t.size},e.wbg.__wbg_slice_224856d46230c13c=function(){return La(function(t,r,i){return t.slice(r,i)},arguments)},e.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){let t=typeof global>\"u\"?null:global;return uc(t)?0:im(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){let t=typeof globalThis>\"u\"?null:globalThis;return uc(t)?0:im(t)},e.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){let t=typeof self>\"u\"?null:self;return uc(t)?0:im(t)},e.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){let t=typeof window>\"u\"?null:window;return uc(t)?0:im(t)},e.wbg.__wbg_status_3fea3036088621d6=function(t){return t.status},e.wbg.__wbg_stringify_b98c93d0a190446a=function(){return La(function(t){return JSON.stringify(t)},arguments)},e.wbg.__wbg_table_new=function(t){return NT.__wrap(t)},e.wbg.__wbg_then_b33a773d723afa3e=function(t,r,i){return t.then(r,i)},e.wbg.__wbg_then_e22500defe16819f=function(t,r){return t.then(r)},e.wbg.__wbg_toString_78df35411a4fd40c=function(t){return t.toString()},e.wbg.__wbg_url_e5720dfacf77b05e=function(t,r){let i=r.url,n=mp(i,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc;Lh().setInt32(t+4,o,!0),Lh().setInt32(t+0,n,!0)},e.wbg.__wbg_value_dd9372230531eade=function(t){return t.value},e.wbg.__wbg_view_91cc97d57ab30530=function(t){let r=t.view;return uc(r)?0:im(r)},e.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(t,r){let i=r,n=typeof i==\"bigint\"?i:void 0;Lh().setBigInt64(t+8,uc(n)?BigInt(0):n,!0),Lh().setInt32(t+0,!uc(n),!0)},e.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746=function(t){let r=t,i=typeof r==\"boolean\"?r:void 0;return uc(i)?16777215:i?1:0},e.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(t){let r=t.original;return r.cnt--==1?(r.a=0,!0):!1},e.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(t,r){let i=Ztt(r),n=mp(i,ue.__wbindgen_malloc,ue.__wbindgen_realloc),o=hc;Lh().setInt32(t+4,o,!0),Lh().setInt32(t+0,n,!0)},e.wbg.__wbg_wbindgenfunctiontable_aa1084b2969a9cbe=function(){return ue.__wbindgen_export_5},e.wbg.__wbg_wbindgenin_d7a1ee10933d2d55=function(t,r){return t in r},e.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154=function(t){return typeof t==\"bigint\"},e.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(t){return typeof t==\"function\"},e.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(t){let r=t;return typeof r==\"object\"&&r!==null},e.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(t){return typeof t==\"string\"},e.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(t){return t===void 0},e.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(t,r){return t===r},e.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1=function(t,r){return t==r},e.wbg.__wbg_wbindgenmemory_d84da70f7c42d172=function(){return ue.memory},e.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(t,r){let i=r,n=typeof i==\"number\"?i:void 0;Lh().setFloat64(t+8,uc(n)?0:n,!0),Lh().setInt32(t+0,!uc(n),!0)},e.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(t,r){let i=r,n=typeof i==\"string\"?i:void 0;var o=uc(n)?0:mp(n,ue.__wbindgen_malloc,ue.__wbindgen_realloc),s=hc;Lh().setInt32(t+4,s,!0),Lh().setInt32(t+0,o,!0)},e.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(t,r){throw new Error(pp(t,r))},e.wbg.__wbg_writable_e5202c9fd57615db=function(t){return t.writable},e.wbg.__wbg_write_2e39e04a4c8c9e9d=function(t,r){return t.write(r)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,r){return pp(t,r)},e.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(t){return BigInt.asUintN(64,t)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return t},e.wbg.__wbindgen_cast_e9d4edd5d697755b=function(t,r){return cTt(t,r,317,hJt)},e.wbg.__wbindgen_cast_eb8544ce08914b2c=function(t,r){return cTt(t,r,3778,dJt)},e.wbg.__wbindgen_init_externref_table=function(){let t=ue.__wbindgen_export_4,r=t.grow(4);t.set(0,void 0),t.set(r+0,void 0),t.set(r+1,null),t.set(r+2,!0),t.set(r+3,!1)},e}function wJt(e,t){return ue=e.exports,STt.__wbindgen_wasm_module=t,Px=null,o8=null,n8=null,ue.__wbindgen_start(),ue}async function STt(e){if(ue!==void 0)return ue;typeof e<\"u\"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(\"using deprecated parameters for the initialization function; pass a single object instead\")),typeof e>\"u\"&&(e=new URL(\"parquet_wasm_bg.wasm\",import.meta.url));let t=xJt();(typeof e==\"string\"||typeof Request==\"function\"&&e instanceof Request||typeof URL==\"function\"&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await bJt(await e,t);return wJt(r,i)}var MTt=STt;var TJt=\"0.7.1\",SJt=`https://cdn.jsdelivr.net/npm/parquet-wasm@${TJt}/esm/parquet_wasm_bg.wasm`,Ktt=!1;async function ETt(){Ktt||(await MTt(SJt),Ktt=!0)}function MJt(e){if(!Ktt)throw new Error(\"wasm not ready\");console.time(\"readParquet\");let t=TTt(new Uint8Array(e.buffer),{batchSize:2**31}).intoIPCStream(),r=i8(t);return console.timeEnd(\"readParquet\"),r}function f8(e){let t=[];for(let r of e){let i=MJt(r);i.batches.length!==1&&console.warn(\"Expected one batch\"),t.push(...i.batches)}return new Ll(t)}function Qtt(e){return Array.isArray(e)&&e?.[0]instanceof DataView?e?.[0].byteLength>0?f8(e).getChildAt(0):null:e}var Bh=class{model;callbacks;updateStateCallback;constructor(t,r){this.model=t,this.model.on(\"change\",r),this.updateStateCallback=r,this.callbacks=new Map,this.callbacks.set(\"change\",r)}initRegularAttribute(t,r){this[r]=this.model.get(t),this.model.off(`change:${t}`);let i=()=>{this[r]=this.model.get(t)};this.model.on(`change:${t}`,i),this.callbacks.set(`change:${t}`,i)}initVectorizedAccessor(t,r){this[r]=Qtt(this.model.get(t)),this.model.off(`change:${t}`);let i=()=>{this[r]=Qtt(this.model.get(t))};this.model.on(`change:${t}`,i),this.callbacks.set(`change:${t}`,i)}finalize(){for(let[t,r]of Object.entries(this.callbacks))this.model.off(t,r)}};var CTt=\"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json\",JN=class extends Bh{mode;style;constructor(t,r){super(t,r),this.initRegularAttribute(\"mode\",\"mode\"),this.initRegularAttribute(\"style\",\"style\")}};var EJt=\"IPY_MODEL_\",PJt=EJt.length;async function wA(e,t,r,i){let n=await CJt(e,t),o={};for(let[s,a]of Object.entries(n))s in r?(o[s]=r[s],delete r[s]):o[s]=await i(a);for(let s of Object.values(r))s.finalize();return o}async function Jtt(e,t){let r=t.slice(PJt);return e.get_model(r)}async function CJt(e,t){let r=t.map(o=>Jtt(e,o)),i=await Promise.all(r),n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n}function tet(e,t,r){let[i,n]=(0,tz.useState)(null);return(0,tz.useEffect)(()=>{(async()=>{try{if(!e){n(null);return}let s=await Jtt(t,e),a=new JN(s,r);n(a)}catch(s){console.error(\"Error loading basemap model:\",s)}})()},[e,r,t]),i}var fM=xe(ze(),1);var ITt=`uniform brushingUniforms {\n  bool enabled;\n  highp int target;\n  vec2 mousePos;\n  float radius;\n} brushing;\n`,IJt=`\n  in vec2 brushingTargets;\n\n  out float brushing_isVisible;\n\n  bool brushing_isPointInRange(vec2 position) {\n    if (!brushing.enabled) {\n      return true;\n    }\n    vec2 source_commonspace = project_position(position);\n    vec2 target_commonspace = project_position(brushing.mousePos);\n    float distance = length((target_commonspace - source_commonspace) / project.commonUnitsPerMeter.xy);\n\n    return distance <= brushing.radius;\n  }\n\n  bool brushing_arePointsInRange(vec2 sourcePos, vec2 targetPos) {\n    return brushing_isPointInRange(sourcePos) || brushing_isPointInRange(targetPos);\n  }\n\n  void brushing_setVisible(bool visible) {\n    brushing_isVisible = float(visible);\n  }\n`,kJt=`\n${ITt}\n${IJt}\n`,RJt=`\n  in float brushing_isVisible;\n`,DJt=`\n${ITt}\n${RJt}\n`,OJt={source:0,target:1,custom:2,source_target:3},LJt={\"vs:DECKGL_FILTER_GL_POSITION\":`\n    vec2 brushingTarget;\n    vec2 brushingSource;\n    if (brushing.target == 3) {\n      brushingTarget = geometry.worldPositionAlt.xy;\n      brushingSource = geometry.worldPosition.xy;\n    } else if (brushing.target == 0) {\n      brushingTarget = geometry.worldPosition.xy;\n    } else if (brushing.target == 1) {\n      brushingTarget = geometry.worldPositionAlt.xy;\n    } else {\n      brushingTarget = brushingTargets;\n    }\n    bool visible;\n    if (brushing.target == 3) {\n      visible = brushing_arePointsInRange(brushingSource, brushingTarget);\n    } else {\n      visible = brushing_isPointInRange(brushingTarget);\n    }\n    brushing_setVisible(visible);\n  `,\"fs:DECKGL_FILTER_COLOR\":`\n    if (brushing.enabled && brushing_isVisible < 0.5) {\n      discard;\n    }\n  `},kTt={name:\"brushing\",dependencies:[Uf],vs:kJt,fs:DJt,inject:LJt,getUniforms:e=>{if(!e||!(\"viewport\"in e))return{};let{brushingEnabled:t=!0,brushingRadius:r=1e4,brushingTarget:i=\"source\",mousePosition:n,viewport:o}=e;return{enabled:!!(t&&n&&o.containsPixel(n)),radius:r,target:OJt[i]||0,mousePos:n?o.unproject([n.x-o.x,n.y-o.y]):[0,0]}},uniformTypes:{enabled:\"i32\",target:\"i32\",mousePos:\"vec2<f32>\",radius:\"f32\"}};var BJt={getBrushingTarget:{type:\"accessor\",value:[0,0]},brushingTarget:\"source\",brushingEnabled:!0,brushingRadius:1e4},p8=class extends Vg{getShaders(){return{modules:[kTt]}}initializeState(t,r){let i=this.getAttributeManager();i&&i.add({brushingTargets:{size:2,stepMode:\"dynamic\",accessor:\"getBrushingTarget\"}});let n=()=>{this.getCurrentLayer()?.setNeedsRedraw()};this.state.onMouseMove=n,t.deck&&t.deck.eventManager.on({pointermove:n,pointerleave:n})}finalizeState(t,r){if(t.deck){let i=this.state.onMouseMove;t.deck.eventManager.off({pointermove:i,pointerleave:i})}}draw(t,r){let{viewport:i,mousePosition:n}=t.context,{brushingEnabled:o,brushingRadius:s,brushingTarget:a}=this.props,h={viewport:i,mousePosition:n,brushingEnabled:o,brushingRadius:s,brushingTarget:a};this.setShaderModuleProps({brushing:h})}};p8.defaultProps=BJt;p8.extensionName=\"BrushingExtension\";var eet=p8;var RTt=`uniform dataFilterUniforms {\n  bool useSoftMargin;\n  bool enabled;\n  bool transformSize;\n  bool transformColor;\n#ifdef DATAFILTER_TYPE\n  DATAFILTER_TYPE min;\n  DATAFILTER_TYPE softMin;\n  DATAFILTER_TYPE softMax;\n  DATAFILTER_TYPE max;\n#ifdef DATAFILTER_DOUBLE\n  DATAFILTER_TYPE min64High;\n  DATAFILTER_TYPE max64High;\n#endif\n#endif\n#ifdef DATACATEGORY_TYPE\n  highp uvec4 categoryBitMask;\n#endif\n} dataFilter;\n`,FJt=`\n#ifdef DATAFILTER_TYPE\n  in DATAFILTER_TYPE filterValues;\n#ifdef DATAFILTER_DOUBLE\n  in DATAFILTER_TYPE filterValues64Low;\n#endif\n#endif\n\n#ifdef DATACATEGORY_TYPE\n  in DATACATEGORY_TYPE filterCategoryValues;\n#endif\n\nout float dataFilter_value;\n\nfloat dataFilter_reduceValue(float value) {\n  return value;\n}\nfloat dataFilter_reduceValue(vec2 value) {\n  return min(value.x, value.y);\n}\nfloat dataFilter_reduceValue(vec3 value) {\n  return min(min(value.x, value.y), value.z);\n}\nfloat dataFilter_reduceValue(vec4 value) {\n  return min(min(value.x, value.y), min(value.z, value.w));\n}\n\n#ifdef DATAFILTER_TYPE\n  void dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFromMax) {\n    if (dataFilter.useSoftMargin) {\n      // smoothstep results are undefined if edge0 \\u2265 edge1\n      // Fallback to ignore filterSoftRange if it is truncated by filterRange\n      DATAFILTER_TYPE leftInRange = mix(\n        smoothstep(dataFilter.min, dataFilter.softMin, valueFromMin),\n        step(dataFilter.min, valueFromMin),\n        step(dataFilter.softMin, dataFilter.min)\n      );\n      DATAFILTER_TYPE rightInRange = mix(\n        1.0 - smoothstep(dataFilter.softMax, dataFilter.max, valueFromMax),\n        step(valueFromMax, dataFilter.max),\n        step(dataFilter.max, dataFilter.softMax)\n      );\n      dataFilter_value = dataFilter_reduceValue(leftInRange * rightInRange);\n    } else {\n      dataFilter_value = dataFilter_reduceValue(\n        step(dataFilter.min, valueFromMin) * step(valueFromMax, dataFilter.max)\n      );\n    }\n  }\n#endif\n\n#ifdef DATACATEGORY_TYPE\n  void dataFilter_setCategoryValue(DATACATEGORY_TYPE category) {\n    #if DATACATEGORY_CHANNELS == 1 // One 128-bit mask\n    uint dataFilter_masks = dataFilter.categoryBitMask[category / 32u];\n    #elif DATACATEGORY_CHANNELS == 2 // Two 64-bit masks\n    uvec2 dataFilter_masks = uvec2(\n      dataFilter.categoryBitMask[category.x / 32u],\n      dataFilter.categoryBitMask[category.y / 32u + 2u]\n    );\n    #elif DATACATEGORY_CHANNELS == 3 // Three 32-bit masks\n    uvec3 dataFilter_masks = dataFilter.categoryBitMask.xyz;\n    #else // Four 32-bit masks\n    uvec4 dataFilter_masks = dataFilter.categoryBitMask;\n    #endif\n\n    // Shift mask and extract relevant bits\n    DATACATEGORY_TYPE dataFilter_bits = DATACATEGORY_TYPE(dataFilter_masks) >> (category & 31u);\n    dataFilter_bits &= 1u;\n\n    #if DATACATEGORY_CHANNELS == 1\n    if(dataFilter_bits == 0u) dataFilter_value = 0.0;\n    #else\n    if(any(equal(dataFilter_bits, DATACATEGORY_TYPE(0u)))) dataFilter_value = 0.0;\n    #endif\n  }\n#endif\n`,DTt=`\n${RTt}\n${FJt}\n`,NJt=`\nin float dataFilter_value;\n`,OTt=`\n${RTt}\n${NJt}\n`;function LTt(e){if(!e||!(\"extensions\"in e))return{};let{filterRange:t=[-1,1],filterEnabled:r=!0,filterTransformSize:i=!0,filterTransformColor:n=!0,categoryBitMask:o}=e,s=e.filterSoftRange||t;return{...Number.isFinite(t[0])?{min:t[0],softMin:s[0],softMax:s[1],max:t[1]}:{min:t.map(a=>a[0]),softMin:s.map(a=>a[0]),softMax:s.map(a=>a[1]),max:t.map(a=>a[1])},enabled:r,useSoftMargin:!!e.filterSoftRange,transformSize:r&&i,transformColor:r&&n,...o&&{categoryBitMask:o}}}function zJt(e){if(!e||!(\"extensions\"in e))return{};let t=LTt(e);if(Number.isFinite(t.min)){let r=Math.fround(t.min);t.min-=r,t.softMin-=r,t.min64High=r;let i=Math.fround(t.max);t.max-=i,t.softMax-=i,t.max64High=i}else{let r=t.min.map(Math.fround);t.min=t.min.map((n,o)=>n-r[o]),t.softMin=t.softMin.map((n,o)=>n-r[o]),t.min64High=r;let i=t.max.map(Math.fround);t.max=t.max.map((n,o)=>n-i[o]),t.softMax=t.softMax.map((n,o)=>n-i[o]),t.max64High=i}return t}var BTt={\"vs:#main-start\":`\n    dataFilter_value = 1.0;\n    if (dataFilter.enabled) {\n      #ifdef DATAFILTER_TYPE\n        #ifdef DATAFILTER_DOUBLE\n          dataFilter_setValue(\n            filterValues - dataFilter.min64High + filterValues64Low,\n            filterValues - dataFilter.max64High + filterValues64Low\n          );\n        #else\n          dataFilter_setValue(filterValues, filterValues);\n        #endif\n      #endif\n\n      #ifdef DATACATEGORY_TYPE\n        dataFilter_setCategoryValue(filterCategoryValues);\n      #endif\n    }\n  `,\"vs:#main-end\":`\n    if (dataFilter_value == 0.0) {\n      gl_Position = vec4(0.);\n    }\n  `,\"vs:DECKGL_FILTER_SIZE\":`\n    if (dataFilter.transformSize) {\n      size = size * dataFilter_value;\n    }\n  `,\"fs:DECKGL_FILTER_COLOR\":`\n    if (dataFilter_value == 0.0) discard;\n    if (dataFilter.transformColor) {\n      color.a *= dataFilter_value;\n    }\n  `};function FTt(e){let{categorySize:t,filterSize:r,fp64:i}=e,n={useSoftMargin:\"i32\",enabled:\"i32\",transformSize:\"i32\",transformColor:\"i32\"};if(r){let o=r===1?\"f32\":`vec${r}<f32>`;n.min=o,n.softMin=o,n.softMax=o,n.max=o,i&&(n.min64High=o,n.max64High=o)}return t&&(n.categoryBitMask=\"vec4<i32>\"),n}var NTt={name:\"dataFilter\",vs:DTt,fs:OTt,inject:BTt,getUniforms:LTt,uniformTypesFromOptions:FTt},zTt={name:\"dataFilter\",vs:DTt,fs:OTt,inject:BTt,getUniforms:zJt,uniformTypesFromOptions:FTt};var UJt=`#version 300 es\n#define SHADER_NAME data-filter-vertex-shader\n\n#ifdef FLOAT_TARGET\n  in float filterIndices;\n  in float filterPrevIndices;\n#else\n  in vec2 filterIndices;\n  in vec2 filterPrevIndices;\n#endif\n\nout vec4 vColor;\nconst float component = 1.0 / 255.0;\n\nvoid main() {\n  #ifdef FLOAT_TARGET\n    dataFilter_value *= float(filterIndices != filterPrevIndices);\n    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n    vColor = vec4(0.0, 0.0, 0.0, 1.0);\n  #else\n    // Float texture is not supported: pack result into 4 channels x 256 px x 64px\n    dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);\n    float col = filterIndices.x;\n    float row = filterIndices.y * 4.0;\n    float channel = floor(row);\n    row = fract(row);\n    vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));\n    gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);\n  #endif\n  gl_PointSize = 1.0;\n}\n`,VJt=`#version 300 es\n#define SHADER_NAME data-filter-fragment-shader\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main() {\n  if (dataFilter_value < 0.5) {\n    discard;\n  }\n  fragColor = vColor;\n}\n`,jJt=[\"float32-renderable-webgl\",\"texture-blend-float-webgl\"];function UTt(e){return jJt.every(t=>e.features.has(t))}function VTt(e,t){return t?e.createFramebuffer({width:1,height:1,colorAttachments:[e.createTexture({format:\"rgba32float\",dimension:\"2d\",width:1,height:1})]}):e.createFramebuffer({width:256,height:64,colorAttachments:[e.createTexture({format:\"rgba8unorm\",dimension:\"2d\",width:256,height:64})]})}function jTt(e,t,r,i){return r.defines.NON_INSTANCED_MODEL=1,i&&(r.defines.FLOAT_TARGET=1),new sn(e,{id:\"data-filter-aggregation-model\",vertexCount:1,isInstanced:!1,topology:\"point-list\",disableWarnings:!0,vs:UJt,fs:VJt,bufferLayout:t,...r})}var $Tt={blend:!0,blendColorSrcFactor:\"one\",blendColorDstFactor:\"one\",blendAlphaSrcFactor:\"one\",blendAlphaDstFactor:\"one\",blendColorOperation:\"add\",blendAlphaOperation:\"add\",depthCompare:\"never\"};var GJt={getFilterValue:{type:\"accessor\",value:0},getFilterCategory:{type:\"accessor\",value:0},onFilteredItemsChange:{type:\"function\",value:null,optional:!0},filterEnabled:!0,filterRange:[-1,1],filterSoftRange:null,filterCategories:[0],filterTransformSize:!0,filterTransformColor:!0},WJt={categorySize:0,filterSize:1,fp64:!1,countItems:!1},qJt={1:\"uint\",2:\"uvec2\",3:\"uvec3\",4:\"uvec4\"},HJt={1:\"float\",2:\"vec2\",3:\"vec3\",4:\"vec4\"},m8=class extends Vg{constructor(t={}){super({...WJt,...t})}getShaders(t){let{categorySize:r,filterSize:i,fp64:n}=t.opts,o={};r&&(o.DATACATEGORY_TYPE=qJt[r],o.DATACATEGORY_CHANNELS=r),i&&(o.DATAFILTER_TYPE=HJt[i],o.DATAFILTER_DOUBLE=!!n);let s=n?zTt:NTt;return s.uniformTypes=s.uniformTypesFromOptions(t.opts),{modules:[s],defines:o}}initializeState(t,r){let i=this.getAttributeManager(),{categorySize:n,filterSize:o,fp64:s}=r.opts;i&&(o&&i.add({filterValues:{size:o,type:s?\"float64\":\"float32\",stepMode:\"dynamic\",accessor:\"getFilterValue\"}}),n&&i.add({filterCategoryValues:{size:n,stepMode:\"dynamic\",accessor:\"getFilterCategory\",type:\"uint32\",transform:n===1?h=>r._getCategoryKey.call(this,h,0):h=>h.map((p,g)=>r._getCategoryKey.call(this,p,g))}}));let{device:a}=this.context;if(i&&r.opts.countItems){let h=UTt(a);i.add({filterVertexIndices:{size:h?1:2,vertexOffset:1,type:\"unorm8\",accessor:(w,{index:C})=>{let R=w&&w.__source?w.__source.index:C;return h?(R+1)%255:[(R+1)%255,Math.floor(R/255)%255]},shaderAttributes:{filterPrevIndices:{vertexOffset:0},filterIndices:{vertexOffset:1}}}});let p=VTt(a,h),g=jTt(a,i.getBufferLayouts({isInstanced:!1}),r.getShaders.call(this,r),h);this.setState({filterFBO:p,filterModel:g})}}updateState({props:t,oldProps:r,changeFlags:i},n){let o=this.getAttributeManager(),{categorySize:s}=n.opts;if(this.state.filterModel){let a=o.attributes.filterValues?.needsUpdate()||o.attributes.filterCategoryValues?.needsUpdate()||t.filterEnabled!==r.filterEnabled||t.filterRange!==r.filterRange||t.filterSoftRange!==r.filterSoftRange||t.filterCategories!==r.filterCategories;a&&this.setState({filterNeedsUpdate:a})}o?.attributes.filterCategoryValues&&((o.attributes.filterCategoryValues.needsUpdate()||!to(t.filterCategories,r.filterCategories,2))&&this.setState({categoryBitMask:null}),i.dataChanged&&(this.setState({categoryMap:Array(s).fill(0).map(()=>({}))}),o.attributes.filterCategoryValues.setNeedsUpdate(\"categoryMap\")))}draw(t,r){let i=this.state.filterFBO,n=this.state.filterModel,o=this.state.filterNeedsUpdate;this.state.categoryBitMask||r._updateCategoryBitMask.call(this,t,r);let{onFilteredItemsChange:s,extensions:a,filterEnabled:h,filterRange:p,filterSoftRange:g,filterTransformSize:w,filterTransformColor:C,filterCategories:R}=this.props,z={extensions:a,filterEnabled:h,filterRange:p,filterSoftRange:g,filterTransformSize:w,filterTransformColor:C,filterCategories:R};if(this.state.categoryBitMask&&(z.categoryBitMask=this.state.categoryBitMask),this.setShaderModuleProps({dataFilter:z}),o&&s&&n){let W=this.getAttributeManager(),{attributes:{filterValues:Y,filterCategoryValues:H,filterVertexIndices:Q}}=W;n.setVertexCount(this.getNumInstances());let tt={...Y?.getValue(),...H?.getValue(),...Q?.getValue()};n.setAttributes(tt),n.shaderInputs.setProps({dataFilter:z});let rt=[0,0,i.width,i.height],at=n.device.beginRenderPass({id:\"data-filter-aggregation\",framebuffer:i,parameters:{viewport:rt},clearColor:[0,0,0,0]});n.setParameters($Tt),n.draw(at),at.end();let et=n.device.readPixelsToArrayWebGL(i),lt=0;for(let J=0;J<et.length;J++)lt+=et[J];s({id:this.id,count:lt}),this.state.filterNeedsUpdate=!1}}finalizeState(){let t=this.state.filterFBO,r=this.state.filterModel;t?.destroy(),r?.destroy()}_updateCategoryBitMask(t,r){let{categorySize:i}=r.opts;if(!i)return;let{filterCategories:n}=this.props,o=new Uint32Array([0,0,0,0]),s=i===1?[n]:n,a=i===1?128:i===2?64:32;for(let h=0;h<s.length;h++){let p=s[h];for(let g of p){let w=r._getCategoryKey.call(this,g,h);if(w<a){let C=h*(a/32)+Math.floor(w/32);o[C]+=Math.pow(2,w%32)}else hr.warn(`Exceeded maximum number of categories (${a})`)()}}this.state.categoryBitMask=o}_getCategoryKey(t,r){let i=this.state.categoryMap[r];return t in i||(i[t]=Object.keys(i).length),i[t]}};m8.defaultProps=GJt;m8.extensionName=\"DataFilterExtension\";var ret=m8;var GTt={inject:{\"vs:#decl\":`\nin vec2 instanceDashArrays;\n#ifdef HIGH_PRECISION_DASH\nin float instanceDashOffsets;\n#endif\nout vec2 vDashArray;\nout float vDashOffset;\n`,\"vs:#main-end\":`\nvDashArray = instanceDashArrays;\n#ifdef HIGH_PRECISION_DASH\nvDashOffset = instanceDashOffsets / width.x;\n#else\nvDashOffset = 0.0;\n#endif\n`,\"fs:#decl\":`\nuniform pathStyleUniforms {\nfloat dashAlignMode;\nbool dashGapPickable;\n} pathStyle;\nin vec2 vDashArray;\nin float vDashOffset;\n`,\"fs:#main-start\":`\nfloat solidLength = vDashArray.x;\nfloat gapLength = vDashArray.y;\nfloat unitLength = solidLength + gapLength;\nfloat offset;\nif (unitLength > 0.0) {\nif (pathStyle.dashAlignMode == 0.0) {\noffset = vDashOffset;\n} else {\nunitLength = vPathLength / round(vPathLength / unitLength);\noffset = solidLength / 2.0;\n}\nfloat unitOffset = mod(vPathPosition.y + offset, unitLength);\nif (gapLength > 0.0 && unitOffset > solidLength) {\nif (path.capType <= 0.5) {\nif (!(pathStyle.dashGapPickable && bool(picking.isActive))) {\ndiscard;\n}\n} else {\nfloat distToEnd = length(vec2(\nmin(unitOffset - solidLength, unitLength - unitOffset),\nvPathPosition.x\n));\nif (distToEnd > 1.0) {\nif (!(pathStyle.dashGapPickable && bool(picking.isActive))) {\ndiscard;\n}\n}\n}\n}\n}\n`}},WTt={inject:{\"vs:#decl\":`\nin float instanceOffsets;\n`,\"vs:DECKGL_FILTER_SIZE\":`\nfloat offsetWidth = abs(instanceOffsets * 2.0) + 1.0;\nsize *= offsetWidth;\n`,\"vs:#main-end\":`\nfloat offsetWidth = abs(instanceOffsets * 2.0) + 1.0;\nfloat offsetDir = sign(instanceOffsets);\nvPathPosition.x = (vPathPosition.x + offsetDir) * offsetWidth - offsetDir;\nvPathPosition.y *= offsetWidth;\nvPathLength *= offsetWidth;\n`,\"fs:#main-start\":`\nfloat isInside;\nisInside = step(-1.0, vPathPosition.x) * step(vPathPosition.x, 1.0);\nif (isInside == 0.0) {\ndiscard;\n}\n`}};var YJt={getDashArray:{type:\"accessor\",value:[0,0]},getOffset:{type:\"accessor\",value:0},dashJustified:!1,dashGapPickable:!1},g8=class extends Vg{constructor({dash:t=!1,offset:r=!1,highPrecisionDash:i=!1}={}){super({dash:t||i,offset:r,highPrecisionDash:i})}isEnabled(t){return\"pathTesselator\"in t.state}getShaders(t){if(!t.isEnabled(this))return null;let r={},i={};t.opts.dash&&(r=xb(r,GTt),t.opts.highPrecisionDash&&(i.HIGH_PRECISION_DASH=!0)),t.opts.offset&&(r=xb(r,WTt));let{inject:n}=r;return{modules:[{name:\"pathStyle\",inject:n,uniformTypes:{dashAlignMode:\"f32\",dashGapPickable:\"i32\"}}],defines:i}}initializeState(t,r){let i=this.getAttributeManager();!i||!r.isEnabled(this)||(r.opts.dash&&i.addInstanced({instanceDashArrays:{size:2,accessor:\"getDashArray\"},...r.opts.highPrecisionDash?{instanceDashOffsets:{size:1,accessor:\"getPath\",transform:r.getDashOffsets.bind(this)}}:{}}),r.opts.offset&&i.addInstanced({instanceOffsets:{size:1,accessor:\"getOffset\"}}))}updateState(t,r){if(r.isEnabled(this)&&r.opts.dash){let i={dashAlignMode:this.props.dashJustified?1:0,dashGapPickable:!!this.props.dashGapPickable};this.setShaderModuleProps({pathStyle:i})}}getDashOffsets(t){let r=[0],i=this.props.positionFormat===\"XY\"?2:3,n=Array.isArray(t[0]),o=n?t.length:t.length/i,s,a;for(let h=0;h<o-1;h++)s=n?t[h]:t.slice(h*i,h*i+i),s=this.projectPosition(s),h>0&&(r[h]=r[h-1]+Cl.dist(a,s)),a=s;return r[o-1]=0,r}};g8.defaultProps=YJt;g8.extensionName=\"PathStyleExtension\";var iet=g8;var XJt=`\nin float collisionPriorities;\n\nuniform sampler2D collision_texture;\n\nuniform collisionUniforms {\n  bool sort;\n  bool enabled;\n} collision;\n\nvec2 collision_getCoords(vec4 position) {\n  vec4 collision_clipspace = project_common_position_to_clipspace(position);\n  return (1.0 + collision_clipspace.xy / collision_clipspace.w) / 2.0;\n}\n\nfloat collision_match(vec2 tex, vec3 pickingColor) {\n  vec4 collision_pickingColor = texture(collision_texture, tex);\n  float delta = dot(abs(collision_pickingColor.rgb - pickingColor), vec3(1.0));\n  float e = 0.001;\n  return step(delta, e);\n}\n\nfloat collision_isVisible(vec2 texCoords, vec3 pickingColor) {\n  if (!collision.enabled) {\n    return 1.0;\n  }\n\n  // Visibility test, sample area of 5x5 pixels in order to fade in/out.\n  // Due to the locality, the lookups will be cached\n  // This reduces the flicker present when objects are shown/hidden\n  const int N = 2;\n  float accumulator = 0.0;\n  vec2 step = vec2(1.0 / project.viewportSize);\n\n  const float floatN = float(N);\n  vec2 delta = -floatN * step;\n  for(int i = -N; i <= N; i++) {\n    delta.x = -step.x * floatN;\n    for(int j = -N; j <= N; j++) {\n      accumulator += collision_match(texCoords + delta, pickingColor);\n      delta.x += step.x;\n    }\n    delta.y += step.y;\n  }\n\n  float W = 2.0 * floatN + 1.0;\n  return pow(accumulator / (W * W), 2.2);\n}\n`,ZJt={\"vs:#decl\":`\n  float collision_fade = 1.0;\n`,\"vs:DECKGL_FILTER_GL_POSITION\":`\n  if (collision.sort) {\n    float collisionPriority = collisionPriorities;\n    position.z = -0.001 * collisionPriority * position.w; // Support range -1000 -> 1000\n  }\n\n  if (collision.enabled) {\n    vec4 collision_common_position = project_position(vec4(geometry.worldPosition, 1.0));\n    vec2 collision_texCoords = collision_getCoords(collision_common_position);\n    collision_fade = collision_isVisible(collision_texCoords, geometry.pickingColor / 255.0);\n    if (collision_fade < 0.0001) {\n      // Position outside clip space bounds to discard\n      position = vec4(0.0, 0.0, 2.0, 1.0);\n    }\n  }\n  `,\"vs:DECKGL_FILTER_COLOR\":`\n  color.a *= collision_fade;\n  `},KJt=e=>{if(!e||!(\"dummyCollisionMap\"in e))return{};let{enabled:t,collisionFBO:r,drawToCollisionMap:i,dummyCollisionMap:n}=e;return{enabled:t&&!i,sort:!!i,collision_texture:!i&&r?r.colorAttachments[0]:n}},qTt={name:\"collision\",dependencies:[Uf],vs:XJt,inject:ZJt,getUniforms:KJt,uniformTypes:{sort:\"i32\",enabled:\"i32\"}};var A8=class extends Rd{renderCollisionMap(t,r){let n=[0,0,0,0],o=[1,1,t.width-2,t.height-2];this.render({...r,clearColor:n,scissorRect:o,target:t,pass:\"collision\"})}getLayerParameters(t,r,i){return{...t.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:\"less-equal\"}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}};var net=2,y8=class{constructor(){this.id=\"collision-filter-effect\",this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(t){this.context=t;let{device:r}=t;this.dummyCollisionMap=r.createTexture({width:1,height:1}),this.collisionFilterPass=new A8(r,{id:\"default-collision-filter\"})}preRender({effects:t,layers:r,layerFilter:i,viewports:n,onViewportActive:o,views:s,isPicking:a,preRenderStats:h={}}){let{device:p}=this.context;if(a)return;let g=r.filter(({props:{visible:Y,collisionEnabled:H}})=>Y&&H);if(g.length===0){this.channels={};return}let w=t?.filter(Y=>Y.useInPicking&&h[Y.id]),C=h[\"mask-effect\"]?.didRender,R=this._groupByCollisionGroup(p,g),z=n[0],W=!this.lastViewport||!this.lastViewport.equals(z)||C;for(let Y in R){let H=this.collisionFBOs[Y],Q=R[Y],[tt,rt]=p.canvasContext.getPixelSize();H.resize({width:tt/net,height:rt/net}),this._render(Q,{effects:w,layerFilter:i,onViewportActive:o,views:s,viewport:z,viewportChanged:W})}}_render(t,{effects:r,layerFilter:i,onViewportActive:n,views:o,viewport:s,viewportChanged:a}){let{collisionGroup:h}=t,p=this.channels[h];if(!p)return;let g=a||t===p||!to(p.layers,t.layers,1)||t.layerBounds.some((w,C)=>!$s(w,p.layerBounds[C]))||t.allLayersLoaded!==p.allLayersLoaded||t.layers.some(w=>w.props.transitions);if(this.channels[h]=t,g){this.lastViewport=s;let w=this.collisionFBOs[h];this.collisionFilterPass.renderCollisionMap(w,{pass:\"collision-filter\",isPicking:!0,layers:t.layers,effects:r,layerFilter:i,viewports:s?[s]:[],onViewportActive:n,views:o,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:w.device.canvasContext.getDevicePixelRatio()/net}}})}}_groupByCollisionGroup(t,r){let i={};for(let n of r){let o=n.props.collisionGroup,s=i[o];s||(s={collisionGroup:o,layers:[],layerBounds:[],allLayersLoaded:!0},i[o]=s),s.layers.push(n),s.layerBounds.push(n.getBounds()),n.isLoaded||(s.allLayersLoaded=!1)}for(let n of Object.keys(i))this.collisionFBOs[n]||this.createFBO(t,n),this.channels[n]||(this.channels[n]=i[n]);for(let n of Object.keys(this.collisionFBOs))i[n]||this.destroyFBO(n);return i}getShaderModuleProps(t){let{collisionGroup:r,collisionEnabled:i}=t.props,{collisionFBOs:n,dummyCollisionMap:o}=this,s=n[r];return{collision:{enabled:i&&!!s,collisionFBO:s,dummyCollisionMap:o}}}cleanup(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(let t of Object.keys(this.collisionFBOs))this.destroyFBO(t);this.collisionFBOs={},this.lastViewport=void 0}createFBO(t,r){let{width:i,height:n}=t.getDefaultCanvasContext().canvas,o=t.createTexture({format:\"rgba8unorm\",width:i,height:n,sampler:{minFilter:\"nearest\",magFilter:\"nearest\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\"}}),s=t.createTexture({format:\"depth16unorm\",width:i,height:n});this.collisionFBOs[r]=t.createFramebuffer({id:`collision-${r}`,width:i,height:n,colorAttachments:[o],depthStencilAttachment:s})}destroyFBO(t){let r=this.collisionFBOs[t];r.colorAttachments[0]?.destroy(),r.depthStencilAttachment?.destroy(),r.destroy(),delete this.collisionFBOs[t]}};var QJt={getCollisionPriority:{type:\"accessor\",value:0},collisionEnabled:!0,collisionGroup:{type:\"string\",value:\"default\"},collisionTestProps:{}},_8=class extends Vg{getShaders(){return{modules:[qTt]}}draw({shaderModuleProps:t}){t.collision?.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(t,r){if(this.getAttributeManager()===null)return;this.context.deck?._addDefaultEffect(new y8),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:\"dynamic\",accessor:\"getCollisionPriority\"}})}getNeedsPickingBuffer(){return this.props.collisionEnabled}};_8.defaultProps=QJt;_8.extensionName=\"CollisionFilterExtension\";var oet=_8;function Ht(e){return e!=null}function ez(e){return(Array.isArray(e)?e[0]:e)instanceof Tb}function HTt(e,t){return{longitude:Number.isFinite(t.longitude)?t.longitude:0,latitude:Number.isFinite(t.latitude)?t.latitude:0,zoom:Number.isFinite(t.zoom)?t.zoom:0,...Number.isFinite(t.minZoom)?{minZoom:t.minZoom}:0,...Number.isFinite(t.maxZoom)?{maxZoom:t.maxZoom}:0,...Number.isFinite(t.pitch)?{pitch:t.pitch}:0,...Number.isFinite(t.bearing)?{bearing:t.bearing}:0}}var Ix=class extends Bh{static extensionType},v8=class extends Ix{static extensionType=\"brushing\";constructor(t,r,i){super(t,i),r.initRegularAttribute(\"brushing_enabled\",\"brushingEnabled\"),r.initRegularAttribute(\"brushing_target\",\"brushingTarget\"),r.initRegularAttribute(\"brushing_radius\",\"brushingRadius\"),r.initVectorizedAccessor(\"get_brushing_target\",\"getBrushingTarget\"),r.extensionLayerPropertyNames=[...r.extensionLayerPropertyNames,\"brushingEnabled\",\"brushingTarget\",\"brushingRadius\",\"getBrushingTarget\"]}extensionInstance(){return new eet}},b8=class extends Ix{static extensionType=\"collision-filter\";constructor(t,r,i){super(t,i),r.initRegularAttribute(\"collision_enabled\",\"collisionEnabled\"),r.initRegularAttribute(\"collision_group\",\"collisionGroup\"),r.initRegularAttribute(\"collision_test_props\",\"collisionTestProps\"),r.initVectorizedAccessor(\"get_collision_priority\",\"getCollisionPriority\"),r.extensionLayerPropertyNames=[...r.extensionLayerPropertyNames,\"collisionEnabled\",\"collisionGroup\",\"collisionTestProps\",\"getCollisionPriority\"]}extensionInstance(){return new oet}},rz=class extends Ix{static extensionType=\"data-filter\";categorySize;filterSize;constructor(t,r,i){super(t,i),this.initRegularAttribute(\"filter_size\",\"filterSize\"),this.initRegularAttribute(\"category_size\",\"categorySize\"),r.initRegularAttribute(\"filter_categories\",\"filterCategories\"),r.initRegularAttribute(\"filter_enabled\",\"filterEnabled\"),r.initRegularAttribute(\"filter_range\",\"filterRange\"),r.initRegularAttribute(\"filter_soft_range\",\"filterSoftRange\"),r.initRegularAttribute(\"filter_transform_size\",\"filterTransformSize\"),r.initRegularAttribute(\"filter_transform_color\",\"filterTransformColor\"),r.initVectorizedAccessor(\"get_filter_category\",\"getFilterCategory\"),r.initVectorizedAccessor(\"get_filter_value\",\"getFilterValue\"),r.extensionLayerPropertyNames=[...r.extensionLayerPropertyNames,\"filterCategories\",\"filterEnabled\",\"filterRange\",\"filterSoftRange\",\"filterTransformSize\",\"filterTransformColor\",\"getFilterCategory\",\"getFilterValue\"]}extensionInstance(){if(Ht(this.filterSize)||Ht(this.categorySize)){let t={...Ht(this.filterSize)?{filterSize:this.filterSize!==null?this.filterSize:0}:{},...Ht(this.categorySize)?{categorySize:this.categorySize!==null?this.categorySize:0}:{}};return new ret(t)}else return null}},x8=class extends Ix{static extensionType=\"path-style\";dash;offset;highPrecisionDash;constructor(t,r,i){super(t,i),this.initRegularAttribute(\"dash\",\"dash\"),this.initRegularAttribute(\"high_precision_dash\",\"highPrecisionDash\"),this.initRegularAttribute(\"offset\",\"offset\"),r.initRegularAttribute(\"dash_gap_pickable\",\"dashGapPickable\"),r.initRegularAttribute(\"dash_justified\",\"dashJustified\"),r.initVectorizedAccessor(\"get_dash_array\",\"getDashArray\"),r.initVectorizedAccessor(\"get_offset\",\"getOffset\"),r.extensionLayerPropertyNames=[...r.extensionLayerPropertyNames,\"dashGapPickable\",\"dashJustified\",\"getDashArray\",\"getOffset\"]}extensionInstance(){return new iet({...Ht(this.dash)?{dash:this.dash}:{},...Ht(this.highPrecisionDash)?{highPrecisionDash:this.highPrecisionDash}:{},...Ht(this.offset)?{offset:this.offset}:{}})}};async function set(e,t,r){let i=e.get(\"_extension_type\"),n;switch(i){case v8.extensionType:n=new v8(e,t,r);break;case b8.extensionType:n=new b8(e,t,r);break;case rz.extensionType:n=new rz(e,t,r);break;case x8.extensionType:n=new x8(e,t,r);break;default:throw new Error(`no known model for extension type ${i}`)}return n}var gp=class extends Bh{pickable;visible;opacity;autoHighlight;highlightColor;beforeId;extensions;extensionLayerPropertyNames=[];constructor(t,r){super(t,r),this.initRegularAttribute(\"pickable\",\"pickable\"),this.initRegularAttribute(\"visible\",\"visible\"),this.initRegularAttribute(\"opacity\",\"opacity\"),this.initRegularAttribute(\"auto_highlight\",\"autoHighlight\"),this.initRegularAttribute(\"highlight_color\",\"highlightColor\"),this.initRegularAttribute(\"before_id\",\"beforeId\"),this.initRegularAttribute(\"selected_bounds\",\"selectedBounds\"),this.extensions={}}async loadSubModels(){await this.initLayerExtensions()}extensionInstances(){return Object.values(this.extensions).map(t=>t.extensionInstance()).filter(t=>t!==null)}extensionProps(t){let r={};for(let i of this.extensionLayerPropertyNames){let n=this[i];Ht(n)&&(n instanceof Er?r[i]=n.data[t??0]:r[i]=n)}return r}onClick(t){t.index&&(this.model.set(\"selected_index\",t.index),this.model.save_changes())}baseLayerProps(t){return{extensions:this.extensionInstances(),...this.extensionProps(t),pickable:this.pickable,visible:this.visible,opacity:this.opacity,autoHighlight:this.autoHighlight,...Ht(this.highlightColor)&&{highlightColor:this.highlightColor},onClick:this.onClick.bind(this),...Ht(this.beforeId)&&{beforeId:this.beforeId}}}async initLayerExtensions(){let t=async()=>{let r=this.model.get(\"extensions\"),i=await wA(this.model.widget_manager,r,this.extensions,async n=>set(n,this,this.updateStateCallback));this.extensions=i};await t(),this.model.off(\"change:extensions\"),this.model.on(\"change:extensions\",t),this.callbacks.set(\"change:extensions\",t)}},Zs=class extends gp{table;constructor(t,r){super(t,r),this.initTable(\"table\")}initTable(t){this.table=f8(this.model.get(t)),this.model.off(`change:${t}`);let r=()=>{this.table=f8(this.model.get(t))};this.model.on(`change:${t}`,r),this.callbacks.set(`change:${t}`,r)}};var JJt={...wh.defaultProps},w8=class extends bi{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:i,filled:n,stroked:o,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:h,lineWidthMaxPixels:p,lineJointRounded:g,lineMiterLimit:w,lineDashJustified:C,getElevation:R,getFillColor:z,getLineColor:W,getLineWidth:Y}=this.props,{updateTriggers:H,material:Q,transitions:tt}=this.props,rt=this.getSubLayerClass(\"cell\",wh),{updateTriggers:at,...et}=this.indexToBounds()||{};return new rt({filled:n,wireframe:i,extruded:r,elevationScale:t,stroked:o,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:h,lineWidthMaxPixels:p,lineJointRounded:g,lineMiterLimit:w,lineDashJustified:C,material:Q,transitions:tt,getElevation:R,getFillColor:z,getLineColor:W,getLineWidth:Y},this.getSubLayerProps({id:\"cell\",updateTriggers:H&&{...at,getElevation:H.getElevation,getFillColor:H.getFillColor,getLineColor:H.getLineColor,getLineWidth:H.getLineWidth}}),et)}};w8.layerName=\"GeoCellLayer\";w8.defaultProps=JJt;var zT=w8;var tte=Object.defineProperty,E8=(e,t)=>{for(var r in t)tte(e,r,{get:t[r],enumerable:!0})},Gc={};E8(Gc,{ARRAY_TYPE:()=>Ps,EPSILON:()=>Bl,RANDOM:()=>kx,equals:()=>nte,setMatrixArrayType:()=>ete,toRadian:()=>ite});var Bl=1e-6,Ps=typeof Float32Array<\"u\"?Float32Array:Array,kx=Math.random;function ete(e){Ps=e}var rte=Math.PI/180;function ite(e){return e*rte}function nte(e,t){return Math.abs(e-t)<=Bl*Math.max(1,Math.abs(e),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Rx={};E8(Rx,{LDU:()=>bte,add:()=>xte,adjoint:()=>fte,clone:()=>ste,copy:()=>ate,create:()=>ote,determinant:()=>pte,equals:()=>Tte,exactEquals:()=>wte,frob:()=>vte,fromRotation:()=>Ate,fromScaling:()=>yte,fromValues:()=>cte,identity:()=>lte,invert:()=>dte,mul:()=>Ete,multiply:()=>mSt,multiplyScalar:()=>Ste,multiplyScalarAndAdd:()=>Mte,rotate:()=>mte,scale:()=>gte,set:()=>ute,str:()=>_te,sub:()=>Pte,subtract:()=>gSt,transpose:()=>hte});function ote(){var e=new Ps(4);return Ps!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function ste(e){var t=new Ps(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ate(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function lte(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function cte(e,t,r,i){var n=new Ps(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function ute(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function hte(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function dte(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*o-n*i;return s?(s=1/s,e[0]=o*s,e[1]=-i*s,e[2]=-n*s,e[3]=r*s,e):null}function fte(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e}function pte(e){return e[0]*e[3]-e[2]*e[1]}function mSt(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],h=r[1],p=r[2],g=r[3];return e[0]=i*a+o*h,e[1]=n*a+s*h,e[2]=i*p+o*g,e[3]=n*p+s*g,e}function mte(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h+o*a,e[1]=n*h+s*a,e[2]=i*-a+o*h,e[3]=n*-a+s*h,e}function gte(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],h=r[1];return e[0]=i*a,e[1]=n*a,e[2]=o*h,e[3]=s*h,e}function Ate(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e}function yte(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function _te(e){return\"mat2(\"+e[0]+\", \"+e[1]+\", \"+e[2]+\", \"+e[3]+\")\"}function vte(e){return Math.hypot(e[0],e[1],e[2],e[3])}function bte(e,t,r,i){return e[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-e[2]*r[1],[e,t,r]}function xte(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function gSt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function wte(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function Tte(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],h=t[2],p=t[3];return Math.abs(r-s)<=Bl*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=Bl*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-h)<=Bl*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-p)<=Bl*Math.max(1,Math.abs(o),Math.abs(p))}function Ste(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Mte(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e}var Ete=mSt,Pte=gSt;function Cte(){var e=new Ps(9);return Ps!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}var het={};E8(het,{add:()=>jee,calculateW:()=>kee,clone:()=>Nee,conjugate:()=>Lee,copy:()=>Uee,create:()=>fet,dot:()=>RSt,equals:()=>Yee,exactEquals:()=>Hee,exp:()=>PSt,fromEuler:()=>Bee,fromMat3:()=>ISt,fromValues:()=>zee,getAngle:()=>Eee,getAxisAngle:()=>Mee,identity:()=>See,invert:()=>Oee,len:()=>Wee,length:()=>DSt,lerp:()=>Gee,ln:()=>CSt,mul:()=>$ee,multiply:()=>ESt,normalize:()=>xet,pow:()=>Ree,random:()=>Dee,rotateX:()=>Pee,rotateY:()=>Cee,rotateZ:()=>Iee,rotationTo:()=>Xee,scale:()=>kSt,set:()=>Vee,setAxes:()=>Kee,setAxisAngle:()=>MSt,slerp:()=>dz,sqlerp:()=>Zee,sqrLen:()=>qee,squaredLength:()=>OSt,str:()=>Fee});var ar={};E8(ar,{add:()=>Dte,angle:()=>Jte,bezier:()=>Wte,ceil:()=>Ote,clone:()=>Ite,copy:()=>kte,create:()=>vet,cross:()=>hz,dist:()=>aee,distance:()=>bSt,div:()=>see,divide:()=>vSt,dot:()=>bet,equals:()=>iee,exactEquals:()=>ree,floor:()=>Lte,forEach:()=>uee,fromValues:()=>det,hermite:()=>Gte,inverse:()=>jte,len:()=>SSt,length:()=>ASt,lerp:()=>$te,max:()=>Fte,min:()=>Bte,mul:()=>oee,multiply:()=>_St,negate:()=>Vte,normalize:()=>TSt,random:()=>qte,rotateX:()=>Zte,rotateY:()=>Kte,rotateZ:()=>Qte,round:()=>Nte,scale:()=>zte,scaleAndAdd:()=>Ute,set:()=>Rte,sqrDist:()=>lee,sqrLen:()=>cee,squaredDistance:()=>xSt,squaredLength:()=>wSt,str:()=>eee,sub:()=>nee,subtract:()=>ySt,transformMat3:()=>Yte,transformMat4:()=>Hte,transformQuat:()=>Xte,zero:()=>tee});function vet(){var e=new Ps(3);return Ps!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ite(e){var t=new Ps(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ASt(e){var t=e[0],r=e[1],i=e[2];return Math.hypot(t,r,i)}function det(e,t,r){var i=new Ps(3);return i[0]=e,i[1]=t,i[2]=r,i}function kte(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Rte(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e}function Dte(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function ySt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function _St(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function vSt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function Ote(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Lte(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function Bte(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function Fte(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function Nte(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function zte(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Ute(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function bSt(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.hypot(r,i,n)}function xSt(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}function wSt(e){var t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}function Vte(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function jte(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function TSt(e,t){var r=t[0],i=t[1],n=t[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function bet(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function hz(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],h=r[2];return e[0]=n*h-o*a,e[1]=o*s-i*h,e[2]=i*a-n*s,e}function $te(e,t,r,i){var n=t[0],o=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e}function Gte(e,t,r,i,n,o){var s=o*o,a=s*(2*o-3)+1,h=s*(o-2)+o,p=s*(o-1),g=s*(3-2*o);return e[0]=t[0]*a+r[0]*h+i[0]*p+n[0]*g,e[1]=t[1]*a+r[1]*h+i[1]*p+n[1]*g,e[2]=t[2]*a+r[2]*h+i[2]*p+n[2]*g,e}function Wte(e,t,r,i,n,o){var s=1-o,a=s*s,h=o*o,p=a*s,g=3*o*a,w=3*h*s,C=h*o;return e[0]=t[0]*p+r[0]*g+i[0]*w+n[0]*C,e[1]=t[1]*p+r[1]*g+i[1]*w+n[1]*C,e[2]=t[2]*p+r[2]*g+i[2]*w+n[2]*C,e}function qte(e,t){t=t||1;var r=kx()*2*Math.PI,i=kx()*2-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e}function Hte(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[3]*i+r[7]*n+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/s,e[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/s,e}function Yte(e,t,r){var i=t[0],n=t[1],o=t[2];return e[0]=i*r[0]+n*r[3]+o*r[6],e[1]=i*r[1]+n*r[4]+o*r[7],e[2]=i*r[2]+n*r[5]+o*r[8],e}function Xte(e,t,r){var i=r[0],n=r[1],o=r[2],s=r[3],a=t[0],h=t[1],p=t[2],g=n*p-o*h,w=o*a-i*p,C=i*h-n*a,R=n*C-o*w,z=o*g-i*C,W=i*w-n*g,Y=s*2;return g*=Y,w*=Y,C*=Y,R*=2,z*=2,W*=2,e[0]=a+g+R,e[1]=h+w+z,e[2]=p+C+W,e}function Zte(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Kte(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Qte(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Jte(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2],h=Math.sqrt(r*r+i*i+n*n),p=Math.sqrt(o*o+s*s+a*a),g=h*p,w=g&&bet(e,t)/g;return Math.acos(Math.min(Math.max(w,-1),1))}function tee(e){return e[0]=0,e[1]=0,e[2]=0,e}function eee(e){return\"vec3(\"+e[0]+\", \"+e[1]+\", \"+e[2]+\")\"}function ree(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function iee(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=Bl*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=Bl*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-a)<=Bl*Math.max(1,Math.abs(n),Math.abs(a))}var nee=ySt,oee=_St,see=vSt,aee=bSt,lee=xSt,SSt=ASt,cee=wSt,uee=(function(){var e=vet();return function(t,r,i,n,o,s){var a,h;for(r||(r=3),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}})();function hee(){var e=new Ps(4);return Ps!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function dee(e){var t=new Ps(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function fee(e,t,r,i){var n=new Ps(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function pee(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function mee(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function gee(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Aee(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function yee(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.hypot(t,r,i,n)}function _ee(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function vee(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=o*s,e}function bee(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function xee(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e[3]=a+i*(r[3]-a),e}function wee(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function Tee(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],h=t[2],p=t[3];return Math.abs(r-s)<=Bl*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=Bl*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-h)<=Bl*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-p)<=Bl*Math.max(1,Math.abs(o),Math.abs(p))}var l0r=(function(){var e=hee();return function(t,r,i,n,o,s){var a,h;for(r||(r=4),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}})();function fet(){var e=new Ps(4);return Ps!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function See(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function MSt(e,t,r){r=r*.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function Mee(e,t){var r=Math.acos(t[3])*2,i=Math.sin(r/2);return i>Bl?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function Eee(e,t){var r=RSt(e,t);return Math.acos(2*r*r-1)}function ESt(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],h=r[1],p=r[2],g=r[3];return e[0]=i*g+s*a+n*p-o*h,e[1]=n*g+s*h+o*a-i*p,e[2]=o*g+s*p+i*h-n*a,e[3]=s*g-i*a-n*h-o*p,e}function Pee(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*a,e[1]=n*h+o*a,e[2]=o*h-n*a,e[3]=s*h-i*a,e}function Cee(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h-o*a,e[1]=n*h+s*a,e[2]=o*h+i*a,e[3]=s*h-n*a,e}function Iee(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),h=Math.cos(r);return e[0]=i*h+n*a,e[1]=n*h-i*a,e[2]=o*h+s*a,e[3]=s*h-o*a,e}function kee(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e}function PSt(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=Math.exp(o),h=s>0?a*Math.sin(s)/s:0;return e[0]=r*h,e[1]=i*h,e[2]=n*h,e[3]=a*Math.cos(s),e}function CSt(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=s>0?Math.atan2(s,o)/s:0;return e[0]=r*a,e[1]=i*a,e[2]=n*a,e[3]=.5*Math.log(r*r+i*i+n*n+o*o),e}function Ree(e,t,r){return CSt(e,t),kSt(e,e,r),PSt(e,e),e}function dz(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3],h=r[0],p=r[1],g=r[2],w=r[3],C,R,z,W,Y;return R=n*h+o*p+s*g+a*w,R<0&&(R=-R,h=-h,p=-p,g=-g,w=-w),1-R>Bl?(C=Math.acos(R),z=Math.sin(C),W=Math.sin((1-i)*C)/z,Y=Math.sin(i*C)/z):(W=1-i,Y=i),e[0]=W*n+Y*h,e[1]=W*o+Y*p,e[2]=W*s+Y*g,e[3]=W*a+Y*w,e}function Dee(e){var t=kx(),r=kx(),i=kx(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e}function Oee(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-n*a,e[3]=o*a,e}function Lee(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function ISt(e,t){var r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);var o=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[o*3+o]-t[s*3+s]+1),e[n]=.5*i,i=.5/i,e[3]=(t[o*3+s]-t[s*3+o])*i,e[o]=(t[o*3+n]+t[n*3+o])*i,e[s]=(t[s*3+n]+t[n*3+s])*i}return e}function Bee(e,t,r,i){var n=.5*Math.PI/180;t*=n,r*=n,i*=n;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(r),h=Math.cos(r),p=Math.sin(i),g=Math.cos(i);return e[0]=o*h*g-s*a*p,e[1]=s*a*g+o*h*p,e[2]=s*h*p-o*a*g,e[3]=s*h*g+o*a*p,e}function Fee(e){return\"quat(\"+e[0]+\", \"+e[1]+\", \"+e[2]+\", \"+e[3]+\")\"}var Nee=dee,zee=fee,Uee=pee,Vee=mee,jee=gee,$ee=ESt,kSt=Aee,RSt=bee,Gee=xee,DSt=yee,Wee=DSt,OSt=_ee,qee=OSt,xet=vee,Hee=wee,Yee=Tee,Xee=(function(){var e=vet(),t=det(1,0,0),r=det(0,1,0);return function(i,n,o){var s=bet(n,o);return s<-.999999?(hz(e,t,n),SSt(e)<1e-6&&hz(e,r,n),TSt(e,e),MSt(i,e,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(hz(e,n,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,xet(i,i))}})(),Zee=(function(){var e=fet(),t=fet();return function(r,i,n,o,s,a){return dz(e,i,s,a),dz(t,n,o,a),dz(r,e,t,2*a*(1-a)),r}})(),Kee=(function(){var e=Cte();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],xet(t,ISt(t,e))}})(),yi={};E8(yi,{add:()=>rre,angle:()=>xre,ceil:()=>ire,clone:()=>Qee,copy:()=>tre,create:()=>LSt,cross:()=>pre,dist:()=>kre,distance:()=>zSt,div:()=>Ire,divide:()=>NSt,dot:()=>fre,equals:()=>Mre,exactEquals:()=>Sre,floor:()=>nre,forEach:()=>Ore,fromValues:()=>Jee,inverse:()=>hre,len:()=>Ere,length:()=>VSt,lerp:()=>mre,max:()=>sre,min:()=>ore,mul:()=>Cre,multiply:()=>FSt,negate:()=>ure,normalize:()=>dre,random:()=>gre,rotate:()=>bre,round:()=>are,scale:()=>lre,scaleAndAdd:()=>cre,set:()=>ere,sqrDist:()=>Rre,sqrLen:()=>Dre,squaredDistance:()=>USt,squaredLength:()=>jSt,str:()=>Tre,sub:()=>Pre,subtract:()=>BSt,transformMat2:()=>Are,transformMat2d:()=>yre,transformMat3:()=>_re,transformMat4:()=>vre,zero:()=>wre});function LSt(){var e=new Ps(2);return Ps!=Float32Array&&(e[0]=0,e[1]=0),e}function Qee(e){var t=new Ps(2);return t[0]=e[0],t[1]=e[1],t}function Jee(e,t){var r=new Ps(2);return r[0]=e,r[1]=t,r}function tre(e,t){return e[0]=t[0],e[1]=t[1],e}function ere(e,t,r){return e[0]=t,e[1]=r,e}function rre(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function BSt(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function FSt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function NSt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function ire(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function nre(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function ore(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}function sre(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}function are(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function lre(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function cre(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}function zSt(e,t){var r=t[0]-e[0],i=t[1]-e[1];return Math.hypot(r,i)}function USt(e,t){var r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function VSt(e){var t=e[0],r=e[1];return Math.hypot(t,r)}function jSt(e){var t=e[0],r=e[1];return t*t+r*r}function ure(e,t){return e[0]=-t[0],e[1]=-t[1],e}function hre(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function dre(e,t){var r=t[0],i=t[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e}function fre(e,t){return e[0]*t[0]+e[1]*t[1]}function pre(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e}function mre(e,t,r,i){var n=t[0],o=t[1];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e}function gre(e,t){t=t||1;var r=kx()*2*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e}function Are(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e}function yre(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e}function _re(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e}function vre(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e}function bre(e,t,r,i){var n=t[0]-r[0],o=t[1]-r[1],s=Math.sin(i),a=Math.cos(i);return e[0]=n*a-o*s+r[0],e[1]=n*s+o*a+r[1],e}function xre(e,t){var r=e[0],i=e[1],n=t[0],o=t[1],s=Math.sqrt(r*r+i*i)*Math.sqrt(n*n+o*o),a=s&&(r*n+i*o)/s;return Math.acos(Math.min(Math.max(a,-1),1))}function wre(e){return e[0]=0,e[1]=0,e}function Tre(e){return\"vec2(\"+e[0]+\", \"+e[1]+\")\"}function Sre(e,t){return e[0]===t[0]&&e[1]===t[1]}function Mre(e,t){var r=e[0],i=e[1],n=t[0],o=t[1];return Math.abs(r-n)<=Bl*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-o)<=Bl*Math.max(1,Math.abs(i),Math.abs(o))}var Ere=VSt,Pre=BSt,Cre=FSt,Ire=NSt,kre=zSt,Rre=USt,Dre=jSt,Ore=(function(){var e=LSt();return function(t,r,i,n,o,s){var a,h;for(r||(r=2),i||(i=0),n?h=Math.min(n*r+i,t.length):h=t.length,a=i;a<h;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}})(),gz=(1+Math.sqrt(5))/2,c0r=2*Math.PI,fz=2*Math.PI/5,nm=Math.PI/5,YTt=Math.PI/10,Lre=2*Math.atan(gz),pet=Math.PI-Lre,u0r=-.5*Math.PI+Math.acos(-1/Math.sqrt(3-gz)),Az=(Math.sqrt(5)-1)/2,Bre=3-Math.sqrt(5),Fre=Math.sqrt(3-gz),h0r=Math.sqrt(3)*Fre/gz;Gc.setMatrixArrayType(Float64Array);var wet=class met{constructor(t){this.vertices=t,this.isWindingCorrect()||this.vertices.reverse()}getArea(){let t=0,r=this.vertices.length;for(let i=0;i<r;i++){let n=(i+1)%r;t+=(this.vertices[n][0]-this.vertices[i][0])*(this.vertices[n][1]+this.vertices[i][1])}return t}isWindingCorrect(){return this.getArea()>=0}getVertices(){return this.vertices}scale(t){for(let r of this.vertices)yi.scale(r,r,t);return this}rotate180(){for(let t of this.vertices)yi.negate(t,t);return this}reflectY(){for(let t of this.vertices)t[1]=-t[1];return this.vertices.reverse(),this}translate(t){for(let r of this.vertices)yi.add(r,r,t);return this}transform(t){for(let r of this.vertices)yi.transformMat2(r,r,t);return this}transform2d(t){for(let r of this.vertices)yi.transformMat2d(r,r,t);return this}clone(){return new met(this.vertices.map(r=>yi.clone(r)))}getCenter(){let t=this.vertices.length;return this.vertices.reduce((i,n)=>[i[0]+n[0]/t,i[1]+n[1]/t],[0,0])}containsPoint(t){if(!this.isWindingCorrect())throw new Error(\"Pentagon is not counter-clockwise\");let r=this.vertices.length,i=1;for(let n=0;n<r;n++){let o=this.vertices[n],s=this.vertices[(n+1)%r],a=o[0]-s[0],h=o[1]-s[1],p=t[0]-o[0],g=t[1]-o[1],w=a*g-h*p;if(w<0){let C=Math.sqrt(p*p+g*g);i=Math.min(i,w/C)}}return i}splitEdges(t){if(t<=1)return this;let r=[],i=this.vertices.length;for(let n=0;n<i;n++){let o=this.vertices[n],s=this.vertices[(n+1)%i];r.push(yi.clone(o));for(let a=1;a<t;a++){let h=a/t,p=yi.create();yi.lerp(p,o,s,h),r.push(p)}}return new met(r)}};Gc.setMatrixArrayType(Float64Array);var $St=[0,0],GSt=[0,1],Dx=[.7885966681787006,1.6149108024237764],WSt=[1.6171013659387945,1.054928690397459],qSt=[Math.cos(YTt),Math.sin(YTt)],Nre=2*yi.length(Dx)*Math.cos(nm),zre=nm-Math.atan2(Dx[1],Dx[0]),Ure=2*Az/Nre;[$St,GSt,Dx,WSt,qSt].forEach(e=>{yi.scale(e,e,Ure),yi.rotate(e,e,[0,0],zre)});var Vre=new wet([$St,GSt,Dx,WSt,qSt]),HSt=Math.atan2(Dx[1],Dx[0])-nm,jre=[0,0],pz=Az/Math.cos(nm),XTt=HSt+nm,mz=[pz*Math.cos(XTt),pz*Math.sin(XTt)],ZTt=HSt-nm,M8=[pz*Math.cos(ZTt),pz*Math.sin(ZTt)],YSt=new wet([jre,mz,M8]),XSt=Rx.fromValues(mz[0],mz[1],M8[0],M8[1]),d0r=Rx.invert(Rx.create(),XSt),$re=new Float64Array([-.0022392098386786394,21308606513250217e-22,-2559257686421274e-24,33701965267802837e-28,-4667545312611249e-30,667492870384816e-32]),Gre=new Float64Array([.0022392089963541657,28831978048607556e-22,508622073997266e-23,102018123778161e-25,21912872306767718e-30,49284235482523806e-33]),Wre=class{applyCoefficients(e,t){let r=Math.sin(e),i=Math.cos(e),n=2*(i-r)*(i+r),o,s;return o=n*t[5]+t[4],s=n*o+t[3],o=n*s-o+t[2],s=n*o-s+t[1],o=n*s-o+t[0],e+2*r*i*o}forward(e){return this.applyCoefficients(e,$re)}inverse(e){return this.applyCoefficients(e,Gre)}};Gc.setMatrixArrayType(Float64Array);var ZSt=new Wre;function KTt(e){return e*(Math.PI/180)}function QTt(e){return e*(180/Math.PI)}function JTt(e){let t=yi.length(e),r=Math.atan2(e[1],e[0]);return[t,r]}function qre([e,t]){let r=e*Math.cos(t),i=e*Math.sin(t);return[r,i]}function Hre(e,[t,r,i]){let n=[t[0]-i[0],t[1]-i[1]],o=[i[0]-r[0],i[1]-r[1]],s=[e[0]-i[0],e[1]-i[1]],a=o[0]*n[1]-o[1]*n[0],h=(o[0]*s[1]-o[1]*s[0])/a,p=(n[0]*s[1]-n[1]*s[0])/a,g=1-(h+p);return[h,p,g]}function Yre(e,[t,r,i]){return[e[0]*t[0]+e[1]*r[0]+e[2]*i[0],e[0]*t[1]+e[1]*r[1]+e[2]*i[1]]}function get(e){let t=Math.atan2(e[1],e[0]),r=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),i=Math.acos(e[2]/r);return[t,i]}function $T([e,t]){let r=Math.sin(t),i=r*Math.cos(e),n=r*Math.sin(e),o=Math.cos(t);return[i,n,o]}var KSt=93;function Xre([e,t]){let r=KTt(e+KSt),i=KTt(t),n=ZSt.forward(i),o=Math.PI/2-n;return[r,o]}function QSt([e,t]){let r=QTt(e)-KSt,i=Math.PI/2-t,n=ZSt.inverse(i),o=QTt(n);return[r,o]}function Zre(e){let t=e.map(o=>$T(Xre(o))),r=ar.create();for(let o of t)ar.add(r,r,o);ar.normalize(r,r);let[i,n]=QSt(get(r));return(n>89.99||n<-89.99)&&(i=e[0][0]),i=((i+180)%360+360)%360-180,e.map(o=>{let[s,a]=o;for(;s-i>180;)s=s-360;for(;s-i<-180;)s=s+360;return[s,a]})}Gc.setMatrixArrayType(Float64Array);var yz=Math.sqrt(5),_z=Math.sqrt(.2),JSt=Math.sqrt((1-_z)/2),tMt=Math.sqrt((1+_z)/2),iz=.5,tSt=Math.sqrt((2.5-yz)/10),eSt=Math.sqrt((2.5+yz)/10),rSt=Math.sqrt((1+_z)/8),iSt=Math.sqrt((1-_z)/8),nSt=Math.sqrt((3-yz)/8),oSt=Math.sqrt((3+yz)/8),Kre=[[0,0],[JSt,0],[tSt,iz],[-rSt,nSt],[-rSt,-nSt],[tSt,-iz],[-tMt,0],[-iSt,-oSt],[eSt,-iz],[eSt,iz],[-iSt,oSt],[0,0]],Qre=Kre.map(([e,t])=>[-t,e]),nz=Qre.map((e,t)=>t===0?[0,0,0,1]:t===11?[0,-1,0,0]:[...e,0,t<6?tMt:JSt]);Gc.setMatrixArrayType(Float64Array);var eMt=[\"vu\",\"uw\",\"vw\",\"vw\",\"vw\"],T8=[\"wu\",\"uw\",\"vw\",\"vu\",\"uw\"],aet=[\"wu\",\"uv\",\"wv\",\"wu\",\"uw\"],oz=[\"vu\",\"uv\",\"wv\",\"wu\",\"uw\"],Jre=[eMt,oz,aet,T8,aet,oz,aet,T8,T8,T8,oz,oz],tie=[4,2,3,2,0,4,3,2,2,0,3,0],sSt=[0,1,2,4,3,5,7,8,6,11,10,9],Ap=[];function eie(){sz([0,0],0,nz[0]);for(let e=0;e<5;e++){let t=e*fz,r=t+nm;sz([t,pet],nm,nz[e+1]),sz([r,Math.PI-pet],nm,nz[(e+3)%5+6])}sz([0,Math.PI],0,nz[11])}var UT=0;function sz(e,t,r){if(UT>11)throw new Error(`Too many origins: ${UT}`);let i=het.create();het.conjugate(i,r);let n={id:UT,axis:e,quat:r,inverseQuat:i,angle:t,orientation:Jre[UT],firstQuintant:tie[UT]};Ap.push(n),UT++}eie();Ap.sort((e,t)=>sSt.indexOf(e.id)-sSt.indexOf(t.id));Ap.forEach((e,t)=>e.id=t);function rie(e,t){let r=t.orientation,i=r===eMt||r===T8?-1:1,n=(e-t.firstQuintant+5)%5,o=r[n];return{quintant:(t.firstQuintant+i*n+5)%5,orientation:o}}var iie=class{forward([e,t]){return[Math.tan(t),e]}inverse([e,t]){return[t,Math.atan(e)]}},VT=ar.create(),S8=ar.create(),aSt=ar.create(),lSt=ar.create();function cet(e,t){ar.lerp(VT,e,t,.5),ar.normalize(VT,VT),ar.cross(VT,e,VT);let r=ar.length(VT);if(r<1e-8){let i=ar.subtract(ar.create(),e,t);return .5*ar.length(i)}return r}function nie(e,t,r){return ar.cross(S8,t,r),ar.dot(e,S8)}function oie(e,t,r,i,n){ar.cross(S8,i,n);let o=ar.dot(t,S8),s=ar.dot(r,S8);return ar.scale(aSt,t,s),ar.scale(lSt,r,o),ar.sub(e,lSt,aSt)}function Aet(e,t,r,i){let n=ar.angle(t,r);if(n<1e-12)return ar.lerp(e,t,r,i);let o=Math.sin((1-i)*n)/Math.sin(n),s=Math.sin(i*n)/Math.sin(n),a=ar.scale(ar.create(),t,o),h=ar.scale(ar.create(),r,s);return ar.add(e,a,h)}Gc.setMatrixArrayType(Float64Array);var az=ar.create(),lz=ar.create(),cz=ar.create(),jT=ar.create(),sie=class{constructor(e){this._area=null,this.vertices=e,Object.freeze(this.vertices)}getBoundary(e=1,t=!0){let r=[],i=this.vertices.length;for(let n=0;n<i*e;n++){let o=n/e;r.push(this.slerp(o))}return t&&r.push(r[0]),r}slerp(e){let t=this.vertices.length,r=e%1,i=Math.floor(e%t),n=(i+1)%t;return Aet(ar.create(),this.vertices[i],this.vertices[n],r)}getTransformedVertices(e){let t=this.vertices.length,r=Math.floor(e%t),i=(r+1)%t,n=(r+t-1)%t,o=ar.clone(this.vertices[r]),s=ar.clone(this.vertices[i]),a=ar.clone(this.vertices[n]);return ar.sub(s,s,o),ar.sub(a,a,o),[o,s,a]}containsPoint(e){let t=this.vertices.length,r=1/0;for(let i=0;i<t;i++){let[n,o,s]=this.getTransformedVertices(i),a=ar.sub(ar.create(),e,n);ar.normalize(a,a),ar.normalize(o,o),ar.normalize(s,s);let h=ar.cross(ar.create(),o,a),p=ar.cross(ar.create(),a,s),g=ar.dot(n,h),w=ar.dot(n,p);r=Math.min(r,g,w)}return r}getTriangleArea(e,t,r){ar.lerp(az,t,r,.5),ar.lerp(lz,r,e,.5),ar.lerp(cz,e,t,.5),ar.normalize(az,az),ar.normalize(lz,lz),ar.normalize(cz,cz);let i=nie(az,lz,cz),n=Math.max(-1,Math.min(1,i));return Math.abs(n)<1e-8?2*n:Math.asin(n)*2}getArea(){return this._area===null&&(this._area=this._getArea()),this._area}_getArea(){if(this.vertices.length<3)return 0;if(this.vertices.length===3)return this._area=this.getTriangleArea(this.vertices[0],this.vertices[1],this.vertices[2]),this._area;ar.set(jT,0,0,0);for(let t of this.vertices)ar.add(jT,jT,t);ar.normalize(jT,jT);let e=0;for(let t=0;t<this.vertices.length;t++){let r=this.vertices[t],i=this.vertices[(t+1)%this.vertices.length],n=this.getTriangleArea(jT,r,i);isNaN(n)||(e+=n)}return this._area=e,this._area}isWindingCorrect(){if(!(this.getArea()>0))debugger}};Gc.setMatrixArrayType(Float64Array);var uz=class extends sie{constructor(e){if(e.length!==3)throw new Error(\"SphericalTriangleShape requires exactly 3 vertices\");super(e)}};Gc.setMatrixArrayType(Float64Array);var aie=class{forward(e,t,r){let[i,n,o]=t,s=new uz([i,n,o]),a=ar.subtract(ar.create(),e,i);ar.normalize(a,a);let h=oie(ar.create(),i,a,n,o);ar.normalize(h,h);let p=cet(i,e)/cet(i,h),g=s.getArea(),w=p/g,C=[1-p,w*new uz([i,h,o]).getArea(),w*new uz([i,n,h]).getArea()];return Yre(C,r)}inverse(e,t,r){let[i,n,o]=r,s=new uz([i,n,o]),a=Hre(e,t),h=1-1e-14;if(a[0]>h)return i;if(a[1]>h)return n;if(a[2]>h)return o;let p=ar.create();ar.cross(p,n,o);let g=s.getArea(),w=1-a[0],R=a[2]/w*g,z=Math.sin(R),W=Math.sin(R/2),Y=2*W*W,H=ar.dot(i,n),Q=ar.dot(n,o),tt=ar.dot(o,i),rt=ar.length(p),at=ar.dot(i,p),et=z*at+Y*(H*Q-tt),lt=Y*rt*(1+H),J=2/Math.acos(Q)*Math.atan2(lt,et),ft=Aet(ar.create(),n,o,J),dt=cet(i,ft),Mt=this.safeAcos(w*dt)/this.safeAcos(dt);return Aet([0,0,0],i,ft,Mt)}safeAcos(e){return e<.001?2*e+e*e*e/3:Math.acos(1-2*e*e)}};Gc.setMatrixArrayType(Float64Array);var Fh=-1,$c=1,lie=([e,t])=>yi.fromValues(e-t,t),yet=yi.fromValues(1,0),_et=yi.fromValues(0,1),cSt=yi.negate(yi.create(),yet),uSt=yi.negate(yi.create(),_et),uet=yi.fromValues(0,0),cie=(e,[t,r])=>{let i=uet,n=uet;switch(t===$c&&r===$c?(i=yet,n=_et):t===Fh&&r===$c?(i=uSt,n=cSt):t===$c&&r===Fh?(i=_et,n=yet):t===Fh&&r===Fh&&(i=cSt,n=uSt),e){case 0:return uet;case 1:return i;case 2:return yi.add(yi.create(),n,i);case 3:return yi.scaleAndAdd(yi.create(),n,i,2);default:throw new Error(`Invalid Quaternary value: ${e}`)}},hSt=e=>[[$c,$c],[$c,Fh],[$c,$c],[Fh,$c]][e],dSt=yi.fromValues(-1,1);function rMt(e){return Array.from({length:e.length},(t,r)=>e.indexOf(r))}var iMt=[0,1,3,4,5,6,7,2],nMt=[0,1,2,7,3,4,5,6],f0r=rMt(iMt),p0r=rMt(nMt),uie=(e,t,r,i,n)=>{if(t<=0)return;let o=e[t]||0,s=e[t-1],a=r[0]+r[1],h=!0,p=!0;if(i!==(a===0)?(h=o===1||o===2,p=o===1):(h=o<2,p=o===0),!h)return;let g=p?s:s+4,w=n[g];e[t-1]=w%4,e[t]=(o+4+Math.floor(w/4)-Math.floor(g/4))%4},hie=(e,t,r)=>{let i=BigInt(e),n=r===\"vu\"||r===\"wu\"||r===\"vw\",o=r===\"wv\"||r===\"vw\",s=r===\"wu\"||r===\"uw\";n&&(i=(1n<<BigInt(2*t))-i-1n);let a=die(i,t,o,s);if(s){let{offset:[h,p],flips:[g,w]}=a;a.offset=[p,h],g===Fh&&yi.add(a.offset,a.offset,dSt),w===Fh&&yi.subtract(a.offset,a.offset,dSt)}if(o){let{offset:[h,p],flips:g}=a,w=(1<<t)-(h+p);g[0]=-g[0],a.offset[1]=w,a.flips=g}return a},die=(e,t,r,i)=>{let n=yi.create(),o=[$c,$c],s=BigInt(e),a=[];for(;s>0n||a.length<t;)a.push(Number(s%4n)),s=s>>2n;let h=i?nMt:iMt;for(let g=a.length-1;g>=0;g--)uie(a,g,o,r,h),yi.multiply(o,o,hSt(a[g]));o[0]=$c,o[1]=$c;for(let g=a.length-1;g>=0;g--){yi.scale(n,n,2);let w=cie(a[g],o);yi.add(n,n,w),yi.multiply(o,o,hSt(a[g]))}let p=a[0]||0;return{flips:o,k:p,offset:lie(n)}};Gc.setMatrixArrayType(Float64Array);var fie=!1,pie=yi.clone(M8),mie=yi.negate(yi.create(),M8),Tet=[0,1,2,3,4].map(e=>{let t=Rx.create();return Rx.fromRotation(t,fz*e),t}),fSt=yi.create();function gie(e,t,r){let i=(fie?YSt:Vre).clone();yi.transformMat2(fSt,r.offset,XSt),r.flips[0]===$c&&r.flips[1]===Fh&&i.rotate180();let{k:n}=r,o=r.flips[0]+r.flips[1];return((o===-2||o===2)&&n>1||o===0&&(n===0||n===3))&&i.reflectY(),r.flips[0]===Fh&&r.flips[1]===Fh?i.rotate180():r.flips[0]===Fh?i.translate(mie):r.flips[1]===Fh&&i.translate(pie),i.translate(fSt),i.scale(1/2**e),i.transform(Tet[t]),i}function oMt(e){let t=YSt.clone();return t.transform(Tet[e]),t}function Aie(){let e=[];for(let t of Tet)e.push(yi.transformMat2(yi.create(),mz,t));return e.reverse(),new wet(e)}Gc.setMatrixArrayType(Float64Array);var yie=class{constructor(){if(this.vertices=[],this.invocations=0,this.addFaceCenters(),this.addVertices(),this.addMidpoints(),this.vertices.length!==62)throw new Error(\"Failed to construct CRS: vertices length is not 62\");Object.freeze(this.vertices)}getVertex(e){this.invocations++,this.invocations===1e4&&console.warn(\"Too many CRS invocations, results should be cached\");for(let t of this.vertices)if(ar.distance(e,t)<1e-5)return t;throw new Error(\"Failed to find vertex in CRS\")}addFaceCenters(){Ap.forEach(e=>this.add($T(e.axis)))}addVertices(){let e=Math.atan(Bre);for(let t of Ap)for(let r=0;r<5;r++){let i=(2*r+1)*Math.PI/5,n=$T([i+t.angle,e]);ar.transformQuat(n,n,t.quat),this.add(n)}}addMidpoints(){let e=Math.atan(Az);for(let t of Ap)for(let r=0;r<5;r++){let i=2*r*Math.PI/5,n=$T([i+t.angle,e]);ar.transformQuat(n,n,t.quat),this.add(n)}}add(e){let t=ar.normalize(ar.create(),e);return this.vertices.find(i=>ar.distance(t,i)<1e-5)?!1:(this.vertices.push(t),!0)}};Gc.setMatrixArrayType(Float64Array);var _ie=new yie,vie=class{constructor(){this.faceTriangles=[],this.sphericalTriangles=[],this.polyhedral=new aie,this.gnomonic=new iie}forward(e,t){let r=Ap[t],i=$T(e),n=ar.create();ar.transformQuat(n,i,r.inverseQuat);let o=get(n),s=this.gnomonic.forward(o);s[1]=s[1]-r.angle;let a=this.getFaceTriangleIndex(s),h=this.shouldReflect(s),p=this.getFaceTriangle(a,h,!1),g=this.getSphericalTriangle(a,t,h);return this.polyhedral.forward(i,g,p)}inverse(e,t){let r=JTt(e),i=this.getFaceTriangleIndex(r),n=this.shouldReflect(r),o=this.getFaceTriangle(i,n,!1),s=this.getSphericalTriangle(i,t,n),a=this.polyhedral.inverse(e,o,s);return get(a)}shouldReflect(e){let[t,r]=e;return qre([t,this.normalizeGamma(r)])[0]>Az}getFaceTriangleIndex([e,t]){return(Math.floor(t/nm)+10)%10}getFaceTriangle(e,t=!1,r=!1){let i=e;return t&&(i+=r?20:10),this.faceTriangles[i]?this.faceTriangles[i]:(this.faceTriangles[i]=t?this._getReflectedFaceTriangle(e,r):this._getFaceTriangle(e),Object.freeze(this.faceTriangles[i]),this.faceTriangles[i])}_getFaceTriangle(e){let t=Math.floor((e+1)/2)%5,[r,i,n]=oMt(t).getVertices(),o=yi.create();return yi.lerp(o,i,n,.5),e%2===0?[r,o,i]:[r,n,o]}_getReflectedFaceTriangle(e,t=!1){let[r,i,n]=this._getFaceTriangle(e).map(a=>yi.clone(a)),o=e%2===0;yi.negate(r,r);let s=o?i:n;return yi.scaleAndAdd(r,r,s,t?1+1/Math.cos(pet):2),[r,n,i]}getSphericalTriangle(e,t,r=!1){let i=10*t+e;return r&&(i+=120),this.sphericalTriangles[i]?this.sphericalTriangles[i]:(this.sphericalTriangles[i]=this._getSphericalTriangle(e,t,r),Object.freeze(this.sphericalTriangles[i]),this.sphericalTriangles[i])}_getSphericalTriangle(e,t,r=!1){let i=Ap[t];return this.getFaceTriangle(e,r,!0).map(s=>{let[a,h]=JTt(s),p=[a,h+i.angle],g=$T(this.gnomonic.inverse(p));return ar.transformQuat(g,g,i.quat),_ie.getVertex(g)})}normalizeGamma(e){let t=e/fz,r=Math.round(t);return(t-r)*fz}},GT=2,bie=30,xie=58n,wie=0x3ffffffffffffffn;function Tie(e){let t=bie-1,r=e>>1n;for(;t>-1&&(r&0b1n)===0n;)t-=1,r=r>>(t<GT?1n:2n);return t}function Sie(e){let t=Tie(e);if(t===-1)return{origin:Ap[0],segment:0,S:0n,resolution:t};let r=Number(e>>58n),i,n;if(t===0)i=Ap[r],n=0;else{let p=Math.floor(r/5);i=Ap[p],n=(r+i.firstQuintant)%5}if(!i)throw new Error(`Could not parse origin: ${r}`);if(t<GT)return{origin:i,segment:n,S:0n,resolution:t};let o=t-GT+1,s=BigInt(2*o),a=xie-s,h=(e&wie)>>a;return{origin:i,segment:n,S:h,resolution:t}}Gc.setMatrixArrayType(Float64Array);var m0r=Rx.create(),Mie=new vie;function Eie({S:e,segment:t,origin:r,resolution:i}){let{quintant:n,orientation:o}=rie(t,r);if(i===GT-1)return oMt(n);if(i===GT-2)return Aie();let s=i-GT+1,a=hie(e,s,o);return gie(s,n,a)}function sMt(e,{closedRing:t=!0,segments:r=\"auto\"}={closedRing:!0,segments:\"auto\"}){let{S:i,segment:n,origin:o,resolution:s}=Sie(e);r===\"auto\"&&(r=Math.max(1,Math.pow(2,6-s)));let w=Eie({S:i,segment:n,origin:o,resolution:s}).splitEdges(r).getVertices().map(R=>Mie.inverse(R,o.id)).map(R=>QSt(R)),C=Zre(w);return t&&C.push(C[0]),C.reverse(),C}function aMt(e){return BigInt(`0x${e}`)}var pSt=63710072e-1,g0r=4*Math.PI*pSt*pSt;Gc.setMatrixArrayType(Float64Array);var Cs=(function(e){e=e||{};var t=typeof e<\"u\"?e:{},r={},i;for(i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);var n=[],o=\"\";function s(pe){return t.locateFile?t.locateFile(pe,o):o+pe}var a;typeof document<\"u\"&&document.currentScript&&(o=document.currentScript.src),o.indexOf(\"blob:\")!==0?o=o.substr(0,o.lastIndexOf(\"/\")+1):o=\"\",a=function(De,Ke,Be){var v=new XMLHttpRequest;v.open(\"GET\",De,!0),v.responseType=\"arraybuffer\",v.onload=function(){if(v.status==200||v.status==0&&v.response){Ke(v.response);return}var Ni=Ds(De);if(Ni){Ke(Ni.buffer);return}Be()},v.onerror=Be,v.send(null)};var h=t.print||console.log.bind(console),p=t.printErr||console.warn.bind(console);for(i in r)r.hasOwnProperty(i)&&(t[i]=r[i]);r=null,t.arguments&&(n=t.arguments);var g=0,w=function(pe){g=pe},C=function(){return g},R=8;function z(pe,De,Ke,Be){switch(Ke=Ke||\"i8\",Ke.charAt(Ke.length-1)===\"*\"&&(Ke=\"i32\"),Ke){case\"i1\":$t[pe>>0]=De;break;case\"i8\":$t[pe>>0]=De;break;case\"i16\":_e[pe>>1]=De;break;case\"i32\":we[pe>>2]=De;break;case\"i64\":jl=[De>>>0,(ja=De,+Ul(ja)>=1?ja>0?(qu(+Wu(ja/4294967296),4294967295)|0)>>>0:~~+gc((ja-+(~~ja>>>0))/4294967296)>>>0:0)],we[pe>>2]=jl[0],we[pe+4>>2]=jl[1];break;case\"float\":lr[pe>>2]=De;break;case\"double\":ee[pe>>3]=De;break;default:Ac(\"invalid type for setValue: \"+Ke)}}function W(pe,De,Ke){switch(De=De||\"i8\",De.charAt(De.length-1)===\"*\"&&(De=\"i32\"),De){case\"i1\":return $t[pe>>0];case\"i8\":return $t[pe>>0];case\"i16\":return _e[pe>>1];case\"i32\":return we[pe>>2];case\"i64\":return we[pe>>2];case\"float\":return lr[pe>>2];case\"double\":return ee[pe>>3];default:Ac(\"invalid type for getValue: \"+De)}return null}var Y=!1;function H(pe,De){pe||Ac(\"Assertion failed: \"+De)}function Q(pe){var De=t[\"_\"+pe];return H(De,\"Cannot call unknown function \"+pe+\", make sure it is exported\"),De}function tt(pe,De,Ke,Be,v){var An={string:function(Ko){var Di=0;if(Ko!=null&&Ko!==0){var Zi=(Ko.length<<2)+1;Di=ko(Zi),ft(Ko,Di,Zi)}return Di},array:function(Ko){var Di=ko(Ko.length);return Mt(Ko,Di),Di}};function Ni(Ko){return De===\"string\"?lt(Ko):De===\"boolean\"?!!Ko:Ko}var _t=Q(pe),_o=[],$a=0;if(Be)for(var Ro=0;Ro<Be.length;Ro++){var Bi=An[Ke[Ro]];Bi?($a===0&&($a=Qu()),_o[Ro]=Bi(Be[Ro])):_o[Ro]=Be[Ro]}var un=_t.apply(null,_o);return un=Ni(un),$a!==0&&YA($a),un}function rt(pe,De,Ke,Be){Ke=Ke||[];var v=Ke.every(function(Ni){return Ni===\"number\"}),An=De!==\"string\";return An&&v&&!Be?Q(pe):function(){return tt(pe,De,Ke,arguments,Be)}}var at=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0;function et(pe,De,Ke){for(var Be=De+Ke,v=De;pe[v]&&!(v>=Be);)++v;if(v-De>16&&pe.subarray&&at)return at.decode(pe.subarray(De,v));for(var An=\"\";De<v;){var Ni=pe[De++];if(!(Ni&128)){An+=String.fromCharCode(Ni);continue}var _t=pe[De++]&63;if((Ni&224)==192){An+=String.fromCharCode((Ni&31)<<6|_t);continue}var _o=pe[De++]&63;if((Ni&240)==224?Ni=(Ni&15)<<12|_t<<6|_o:Ni=(Ni&7)<<18|_t<<12|_o<<6|pe[De++]&63,Ni<65536)An+=String.fromCharCode(Ni);else{var $a=Ni-65536;An+=String.fromCharCode(55296|$a>>10,56320|$a&1023)}}return An}function lt(pe,De){return pe?et(Yt,pe,De):\"\"}function J(pe,De,Ke,Be){if(!(Be>0))return 0;for(var v=Ke,An=Ke+Be-1,Ni=0;Ni<pe.length;++Ni){var _t=pe.charCodeAt(Ni);if(_t>=55296&&_t<=57343){var _o=pe.charCodeAt(++Ni);_t=65536+((_t&1023)<<10)|_o&1023}if(_t<=127){if(Ke>=An)break;De[Ke++]=_t}else if(_t<=2047){if(Ke+1>=An)break;De[Ke++]=192|_t>>6,De[Ke++]=128|_t&63}else if(_t<=65535){if(Ke+2>=An)break;De[Ke++]=224|_t>>12,De[Ke++]=128|_t>>6&63,De[Ke++]=128|_t&63}else{if(Ke+3>=An)break;De[Ke++]=240|_t>>18,De[Ke++]=128|_t>>12&63,De[Ke++]=128|_t>>6&63,De[Ke++]=128|_t&63}}return De[Ke]=0,Ke-v}function ft(pe,De,Ke){return J(pe,Yt,De,Ke)}var dt=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0;function Mt(pe,De){$t.set(pe,De)}function Ft(pe,De){return pe%De>0&&(pe+=De-pe%De),pe}var Nt,$t,Yt,_e,Pe,we,Ue,lr,ee;function Ce(pe){Nt=pe,t.HEAP8=$t=new Int8Array(pe),t.HEAP16=_e=new Int16Array(pe),t.HEAP32=we=new Int32Array(pe),t.HEAPU8=Yt=new Uint8Array(pe),t.HEAPU16=Pe=new Uint16Array(pe),t.HEAPU32=Ue=new Uint32Array(pe),t.HEAPF32=lr=new Float32Array(pe),t.HEAPF64=ee=new Float64Array(pe)}var mr=5271536,gr=28624,Br=t.TOTAL_MEMORY||33554432;t.buffer?Nt=t.buffer:Nt=new ArrayBuffer(Br),Br=Nt.byteLength,Ce(Nt),we[gr>>2]=mr;function Cr(pe){for(;pe.length>0;){var De=pe.shift();if(typeof De==\"function\"){De();continue}var Ke=De.func;typeof Ke==\"number\"?De.arg===void 0?t.dynCall_v(Ke):t.dynCall_vi(Ke,De.arg):Ke(De.arg===void 0?null:De.arg)}}var Rr=[],ti=[],wr=[],He=[];function Ui(){if(t.preRun)for(typeof t.preRun==\"function\"&&(t.preRun=[t.preRun]);t.preRun.length;)ds(t.preRun.shift());Cr(Rr)}function ln(){Cr(ti)}function Io(){Cr(wr)}function qn(){if(t.postRun)for(typeof t.postRun==\"function\"&&(t.postRun=[t.postRun]);t.postRun.length;)Xo(t.postRun.shift());Cr(He)}function ds(pe){Rr.unshift(pe)}function Xo(pe){He.unshift(pe)}var Ul=Math.abs,gc=Math.ceil,Wu=Math.floor,qu=Math.min,Rs=0,ba=null,Vl=null;function FA(pe){Rs++,t.monitorRunDependencies&&t.monitorRunDependencies(Rs)}function NA(pe){if(Rs--,t.monitorRunDependencies&&t.monitorRunDependencies(Rs),Rs==0&&(ba!==null&&(clearInterval(ba),ba=null),Vl)){var De=Vl;Vl=null,De()}}t.preloadedImages={},t.preloadedAudios={};var Va=null,mm=\"data:application/octet-stream;base64,\";function Cp(pe){return String.prototype.startsWith?pe.startsWith(mm):pe.indexOf(mm)===0}var ja,jl;Va=\"data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl\";var dl=28640;function af(pe){return pe}function gm(pe){var De=/\\b__Z[\\w\\d_]+/g;return pe.replace(De,function(Ke){var Be=Ke;return Ke===Be?Ke:Be+\" [\"+Ke+\"]\"})}function Hu(){var pe=new Error;if(!pe.stack){try{throw new Error(0)}catch(De){pe=De}if(!pe.stack)return\"(no stack trace available)\"}return pe.stack.toString()}function $l(){var pe=Hu();return t.extraStackTrace&&(pe+=`\n`+t.extraStackTrace()),gm(pe)}function lf(pe,De,Ke,Be){Ac(\"Assertion failed: \"+lt(pe)+\", at: \"+[De?lt(De):\"unknown filename\",Ke,Be?lt(Be):\"unknown function\"])}function Yu(){return $t.length}function Ip(pe,De,Ke){Yt.set(Yt.subarray(De,De+Ke),pe)}function Am(pe){return t.___errno_location&&(we[t.___errno_location()>>2]=pe),pe}function ym(pe){Ac(\"OOM\")}function Te(pe){try{var De=new ArrayBuffer(pe);return De.byteLength!=pe?void 0:(new Int8Array(De).set($t),Wh(De),Ce(De),1)}catch{}}function zA(pe){var De=Yu(),Ke=16777216,Be=2147483648-Ke;if(pe>Be)return!1;for(var v=16777216,An=Math.max(De,v);An<pe;)An<=536870912?An=Ft(2*An,Ke):An=Math.min(Ft((3*An+2147483648)/4,Ke),Be);var Ni=Te(An);return!!Ni}var UA=typeof atob==\"function\"?atob:function(pe){var De=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",Ke=\"\",Be,v,An,Ni,_t,_o,$a,Ro=0;pe=pe.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");do Ni=De.indexOf(pe.charAt(Ro++)),_t=De.indexOf(pe.charAt(Ro++)),_o=De.indexOf(pe.charAt(Ro++)),$a=De.indexOf(pe.charAt(Ro++)),Be=Ni<<2|_t>>4,v=(_t&15)<<4|_o>>2,An=(_o&3)<<6|$a,Ke=Ke+String.fromCharCode(Be),_o!==64&&(Ke=Ke+String.fromCharCode(v)),$a!==64&&(Ke=Ke+String.fromCharCode(An));while(Ro<pe.length);return Ke};function Yi(pe){try{for(var De=UA(pe),Ke=new Uint8Array(De.length),Be=0;Be<De.length;++Be)Ke[Be]=De.charCodeAt(Be);return Ke}catch{throw new Error(\"Converting base64 string to bytes failed.\")}}function Ds(pe){if(Cp(pe))return Yi(pe.slice(mm.length))}var jh={Math,Int8Array,Int32Array,Uint8Array,Float32Array,Float64Array},k_={a:Ac,b:w,c:C,d:lf,e:Am,f:Yu,g:Ip,h:zA,i:ym,j:af,k:gm,l:Te,m:Hu,n:$l,o:dl,p:gr},je=(function(pe,De,Ke){\"almost asm\";var Be=new pe.Int8Array(Ke),v=new pe.Int32Array(Ke),An=new pe.Uint8Array(Ke),Ni=new pe.Float32Array(Ke),_t=new pe.Float64Array(Ke),_o=De.o|0,$a=De.p|0,Ro=pe.Math.floor,Bi=pe.Math.abs,un=pe.Math.sqrt,Ko=pe.Math.pow,Di=pe.Math.cos,Zi=pe.Math.sin,pf=pe.Math.tan,W_=pe.Math.acos,u2=pe.Math.asin,XA=pe.Math.atan,ml=pe.Math.atan2,mf=pe.Math.ceil,Bs=pe.Math.imul,Mm=pe.Math.min,q_=pe.Math.max,gl=pe.Math.clz32,ni=De.b,Tt=De.c,Ur=De.d,Em=De.e,h2=De.f,d2=De.g,f2=De.h,H_=De.i,bt=28656;function Pm(y){return Be=new Int8Array(y),An=new Uint8Array(y),v=new Int32Array(y),Ni=new Float32Array(y),_t=new Float64Array(y),Ke=y,!0}function Ju(y){y=y|0;var _=0;return _=bt,bt=bt+y|0,bt=bt+15&-16,_|0}function Y_(){return bt|0}function ZA(y){y=y|0,bt=y}function KA(y,_){y=y|0,_=_|0,bt=y}function p2(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;return(y|0)<0?(_=2,_|0):(y|0)>13780509?(_=Hm(15,_)|0,_|0):(x=((y|0)<0)<<31>>31,k=Ee(y|0,x|0,3,0)|0,E=Tt()|0,x=Kt(y|0,x|0,1,0)|0,x=Ee(k|0,E|0,x|0,Tt()|0)|0,x=Kt(x|0,Tt()|0,1,0)|0,y=Tt()|0,v[_>>2]=x,v[_+4>>2]=y,_=0,_|0)}function QA(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,Yh(y,_,x,E,0)|0}function Yh(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0;if(Z=bt,bt=bt+16|0,U=Z,!(Cm(y,_,x,E,k)|0))return E=0,bt=Z,E|0;do if((x|0)>=0){if((x|0)>13780509){if(B=Hm(15,U)|0,B|0)break;$=U,U=v[$>>2]|0,$=v[$+4>>2]|0}else B=((x|0)<0)<<31>>31,ot=Ee(x|0,B|0,3,0)|0,$=Tt()|0,B=Kt(x|0,B|0,1,0)|0,B=Ee(ot|0,$|0,B|0,Tt()|0)|0,B=Kt(B|0,Tt()|0,1,0)|0,$=Tt()|0,v[U>>2]=B,v[U+4>>2]=$,U=B;if(pn(E|0,0,U<<3|0)|0,k|0){pn(k|0,0,U<<2|0)|0,B=nu(y,_,x,E,k,U,$,0)|0;break}B=Xt(U,4)|0,B?(ot=nu(y,_,x,E,B,U,$,0)|0,It(B),B=ot):B=13}else B=2;while(!1);return ot=B,bt=Z,ot|0}function Cm(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0;if(Zt=bt,bt=bt+16|0,Ot=Zt,Dt=Zt+8|0,kt=Ot,v[kt>>2]=y,v[kt+4>>2]=_,(x|0)<0)return Dt=2,bt=Zt,Dt|0;if(B=E,v[B>>2]=y,v[B+4>>2]=_,B=(k|0)!=0,B&&(v[k>>2]=0),Ei(y,_)|0)return Dt=9,bt=Zt,Dt|0;v[Dt>>2]=0;t:do if((x|0)>=1)if(B)for(ht=1,ot=0,xt=0,kt=1,B=y;;){if(!(ot|xt)){if(B=ps(B,_,4,Dt,Ot)|0,B|0)break t;if(_=Ot,B=v[_>>2]|0,_=v[_+4>>2]|0,Ei(B,_)|0){B=9;break t}}if(B=ps(B,_,v[26800+(xt<<2)>>2]|0,Dt,Ot)|0,B|0)break t;if(_=Ot,B=v[_>>2]|0,_=v[_+4>>2]|0,y=E+(ht<<3)|0,v[y>>2]=B,v[y+4>>2]=_,v[k+(ht<<2)>>2]=kt,y=ot+1|0,U=(y|0)==(kt|0),$=xt+1|0,Z=($|0)==6,Ei(B,_)|0){B=9;break t}if(kt=kt+(Z&U&1)|0,(kt|0)>(x|0)){B=0;break}else ht=ht+1|0,ot=U?0:y,xt=U?Z?0:$:xt}else for(ht=1,ot=0,xt=0,kt=1,B=y;;){if(!(ot|xt)){if(B=ps(B,_,4,Dt,Ot)|0,B|0)break t;if(_=Ot,B=v[_>>2]|0,_=v[_+4>>2]|0,Ei(B,_)|0){B=9;break t}}if(B=ps(B,_,v[26800+(xt<<2)>>2]|0,Dt,Ot)|0,B|0)break t;if(_=Ot,B=v[_>>2]|0,_=v[_+4>>2]|0,y=E+(ht<<3)|0,v[y>>2]=B,v[y+4>>2]=_,y=ot+1|0,U=(y|0)==(kt|0),$=xt+1|0,Z=($|0)==6,Ei(B,_)|0){B=9;break t}if(kt=kt+(Z&U&1)|0,(kt|0)>(x|0)){B=0;break}else ht=ht+1|0,ot=U?0:y,xt=U?Z?0:$:xt}else B=0;while(!1);return Dt=B,bt=Zt,Dt|0}function nu(y,_,x,E,k,B,U,$){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0,U=U|0,$=$|0;var Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0;if(Zt=bt,bt=bt+16|0,Ot=Zt+8|0,Dt=Zt,Z=ur(y|0,_|0,B|0,U|0)|0,ht=Tt()|0,xt=E+(Z<<3)|0,re=xt,ye=v[re>>2]|0,re=v[re+4>>2]|0,ot=(ye|0)==(y|0)&(re|0)==(_|0),!((ye|0)==0&(re|0)==0|ot))do Z=Kt(Z|0,ht|0,1,0)|0,Z=sr(Z|0,Tt()|0,B|0,U|0)|0,ht=Tt()|0,xt=E+(Z<<3)|0,ye=xt,re=v[ye>>2]|0,ye=v[ye+4>>2]|0,ot=(re|0)==(y|0)&(ye|0)==(_|0);while(!((re|0)==0&(ye|0)==0|ot));if(Z=k+(Z<<2)|0,ot&&(v[Z>>2]|0)<=($|0)||(ye=xt,v[ye>>2]=y,v[ye+4>>2]=_,v[Z>>2]=$,($|0)>=(x|0)))return ye=0,bt=Zt,ye|0;switch(ot=$+1|0,v[Ot>>2]=0,Z=ps(y,_,2,Ot,Dt)|0,Z|0){case 9:{kt=9;break}case 0:{Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z||(kt=9);break}default:}t:do if((kt|0)==9){switch(v[Ot>>2]=0,Z=ps(y,_,3,Ot,Dt)|0,Z|0){case 9:break;case 0:{if(Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z|0)break t;break}default:break t}switch(v[Ot>>2]=0,Z=ps(y,_,1,Ot,Dt)|0,Z|0){case 9:break;case 0:{if(Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z|0)break t;break}default:break t}switch(v[Ot>>2]=0,Z=ps(y,_,5,Ot,Dt)|0,Z|0){case 9:break;case 0:{if(Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z|0)break t;break}default:break t}switch(v[Ot>>2]=0,Z=ps(y,_,4,Ot,Dt)|0,Z|0){case 9:break;case 0:{if(Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z|0)break t;break}default:break t}switch(v[Ot>>2]=0,Z=ps(y,_,6,Ot,Dt)|0,Z|0){case 9:break;case 0:{if(Z=Dt,Z=nu(v[Z>>2]|0,v[Z+4>>2]|0,x,E,k,B,U,ot)|0,Z|0)break t;break}default:break t}return ye=0,bt=Zt,ye|0}while(!1);return ye=Z,bt=Zt,ye|0}function ps(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0;if(x>>>0>6)return k=1,k|0;if(xt=(v[E>>2]|0)%6|0,v[E>>2]=xt,(xt|0)>0){B=0;do x=Jh(x)|0,B=B+1|0;while((B|0)<(v[E>>2]|0))}if(xt=Me(y|0,_|0,45)|0,Tt()|0,ht=xt&127,ht>>>0>121)return k=5,k|0;Z=Wa(y,_)|0,B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15;t:do if(!B)ot=8;else{for(;;){if(U=(15-B|0)*3|0,$=Me(y|0,_|0,U|0)|0,Tt()|0,$=$&7,($|0)==7){_=5;break}if(Dt=(bo(B)|0)==0,B=B+-1|0,kt=Re(7,0,U|0)|0,_=_&~(Tt()|0),Ot=Re(v[(Dt?432:16)+($*28|0)+(x<<2)>>2]|0,0,U|0)|0,U=Tt()|0,x=v[(Dt?640:224)+($*28|0)+(x<<2)>>2]|0,y=Ot|y&~kt,_=U|_,!x){x=0;break t}if(!B){ot=8;break t}}return _|0}while(!1);(ot|0)==8&&(Dt=v[848+(ht*28|0)+(x<<2)>>2]|0,Ot=Re(Dt|0,0,45)|0,y=Ot|y,_=Tt()|0|_&-1040385,x=v[4272+(ht*28|0)+(x<<2)>>2]|0,(Dt&127|0)==127&&(Dt=Re(v[848+(ht*28|0)+20>>2]|0,0,45)|0,_=Tt()|0|_&-1040385,x=v[4272+(ht*28|0)+20>>2]|0,y=vc(Dt|y,_)|0,_=Tt()|0,v[E>>2]=(v[E>>2]|0)+1)),$=Me(y|0,_|0,45)|0,Tt()|0,$=$&127;t:do if(tn($)|0){e:do if((Wa(y,_)|0)==1){if((ht|0)!=($|0))if(ey($,v[7696+(ht*28|0)>>2]|0)|0){y=Jp(y,_)|0,U=1,_=Tt()|0;break}else Ur(27795,26864,533,26872);switch(Z|0){case 3:{y=vc(y,_)|0,_=Tt()|0,v[E>>2]=(v[E>>2]|0)+1,U=0;break e}case 5:{y=Jp(y,_)|0,_=Tt()|0,v[E>>2]=(v[E>>2]|0)+5,U=0;break e}case 0:return Dt=9,Dt|0;default:return Dt=1,Dt|0}}else U=0;while(!1);if((x|0)>0){B=0;do y=av(y,_)|0,_=Tt()|0,B=B+1|0;while((B|0)!=(x|0))}if((ht|0)!=($|0)){if(!(gf($)|0)){if((U|0)!=0|(Wa(y,_)|0)!=5)break;v[E>>2]=(v[E>>2]|0)+1;break}switch(xt&127){case 8:case 118:break t;default:}(Wa(y,_)|0)!=3&&(v[E>>2]=(v[E>>2]|0)+1)}}else if((x|0)>0){B=0;do y=vc(y,_)|0,_=Tt()|0,B=B+1|0;while((B|0)!=(x|0))}while(!1);return v[E>>2]=((v[E>>2]|0)+x|0)%6|0,Dt=k,v[Dt>>2]=y,v[Dt+4>>2]=_,Dt=0,Dt|0}function TM(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,m2(y,_,x,E)|0?(pn(E|0,0,x*48|0)|0,E=Vi(y,_,x,E)|0,E|0):(E=0,E|0)}function m2(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0;if(Dt=bt,bt=bt+16|0,kt=Dt,Ot=Dt+8|0,xt=kt,v[xt>>2]=y,v[xt+4>>2]=_,(x|0)<0)return Ot=2,bt=Dt,Ot|0;if(!x)return Ot=E,v[Ot>>2]=y,v[Ot+4>>2]=_,Ot=0,bt=Dt,Ot|0;v[Ot>>2]=0;t:do if(Ei(y,_)|0)y=9;else{k=0,xt=y;do{if(y=ps(xt,_,4,Ot,kt)|0,y|0)break t;if(_=kt,xt=v[_>>2]|0,_=v[_+4>>2]|0,k=k+1|0,Ei(xt,_)|0){y=9;break t}}while((k|0)<(x|0));ht=E,v[ht>>2]=xt,v[ht+4>>2]=_,ht=x+-1|0,ot=0,y=1;do{if(k=26800+(ot<<2)|0,(ot|0)==5)for(U=v[k>>2]|0,B=0,k=y;;){if(y=kt,y=ps(v[y>>2]|0,v[y+4>>2]|0,U,Ot,kt)|0,y|0)break t;if((B|0)!=(ht|0))if(Z=kt,$=v[Z>>2]|0,Z=v[Z+4>>2]|0,y=E+(k<<3)|0,v[y>>2]=$,v[y+4>>2]=Z,!(Ei($,Z)|0))y=k+1|0;else{y=9;break t}else y=k;if(B=B+1|0,(B|0)>=(x|0))break;k=y}else for(U=kt,Z=v[k>>2]|0,$=0,k=y,B=v[U>>2]|0,U=v[U+4>>2]|0;;){if(y=ps(B,U,Z,Ot,kt)|0,y|0)break t;if(U=kt,B=v[U>>2]|0,U=v[U+4>>2]|0,y=E+(k<<3)|0,v[y>>2]=B,v[y+4>>2]=U,y=k+1|0,Ei(B,U)|0){y=9;break t}if($=$+1|0,($|0)>=(x|0))break;k=y}ot=ot+1|0}while(ot>>>0<6);y=kt,y=(xt|0)==(v[y>>2]|0)&&(_|0)==(v[y+4>>2]|0)?0:9}while(!1);return Ot=y,bt=Dt,Ot|0}function Vi(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;if(xt=bt,bt=bt+16|0,U=xt,!x)return v[E>>2]=y,v[E+4>>2]=_,E=0,bt=xt,E|0;do if((x|0)>=0){if((x|0)>13780509){if(k=Hm(15,U)|0,k|0)break;B=U,k=v[B>>2]|0,B=v[B+4>>2]|0}else k=((x|0)<0)<<31>>31,ht=Ee(x|0,k|0,3,0)|0,B=Tt()|0,k=Kt(x|0,k|0,1,0)|0,k=Ee(ht|0,B|0,k|0,Tt()|0)|0,k=Kt(k|0,Tt()|0,1,0)|0,B=Tt()|0,ht=U,v[ht>>2]=k,v[ht+4>>2]=B;if(ot=Xt(k,8)|0,!ot)k=13;else{if(ht=Xt(k,4)|0,!ht){It(ot),k=13;break}if(k=nu(y,_,x,ot,ht,k,B,0)|0,k|0){It(ot),It(ht);break}if(_=v[U>>2]|0,U=v[U+4>>2]|0,(U|0)>0|(U|0)==0&_>>>0>0){k=0,$=0,Z=0;do y=ot+($<<3)|0,B=v[y>>2]|0,y=v[y+4>>2]|0,!((B|0)==0&(y|0)==0)&&(v[ht+($<<2)>>2]|0)==(x|0)&&(kt=E+(k<<3)|0,v[kt>>2]=B,v[kt+4>>2]=y,k=k+1|0),$=Kt($|0,Z|0,1,0)|0,Z=Tt()|0;while((Z|0)<(U|0)|(Z|0)==(U|0)&$>>>0<_>>>0)}It(ot),It(ht),k=0}}else k=2;while(!1);return kt=k,bt=xt,kt|0}function X_(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0;for($=bt,bt=bt+16|0,B=$,U=$+8|0,k=(Ei(y,_)|0)==0,k=k?1:2;;){if(v[U>>2]=0,ot=(ps(y,_,k,U,B)|0)==0,Z=B,ot&((v[Z>>2]|0)==(x|0)?(v[Z+4>>2]|0)==(E|0):0)){y=4;break}if(k=k+1|0,k>>>0>=7){k=7,y=4;break}}return(y|0)==4?(bt=$,k|0):0}function g2(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0;if($=bt,bt=bt+48|0,k=$+16|0,B=$+8|0,U=$,x=cd(x)|0,x|0)return U=x,bt=$,U|0;if(ot=y,Z=v[ot+4>>2]|0,x=B,v[x>>2]=v[ot>>2],v[x+4>>2]=Z,i0(B,k),x=_2(k,_,U)|0,!x){if(_=v[B>>2]|0,B=v[y+8>>2]|0,(B|0)>0){k=v[y+12>>2]|0,x=0;do _=(v[k+(x<<3)>>2]|0)+_|0,x=x+1|0;while((x|0)<(B|0))}x=U,k=v[x>>2]|0,x=v[x+4>>2]|0,B=((_|0)<0)<<31>>31,(x|0)<(B|0)|(x|0)==(B|0)&k>>>0<_>>>0?(x=U,v[x>>2]=_,v[x+4>>2]=B,x=B):_=k,Z=Kt(_|0,x|0,12,0)|0,ot=Tt()|0,x=U,v[x>>2]=Z,v[x+4>>2]=ot,x=E,v[x>>2]=Z,v[x+4>>2]=ot,x=0}return ot=x,bt=$,ot|0}function Im(y,_,x,E,k,B,U){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0,U=U|0;var $=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0,Sr=0,We=0,Ai=0,Tn=0,ci=0,Sn=0,wa=0,kM=0;if(Tn=bt,bt=bt+64|0,Dr=Tn+48|0,Sr=Tn+32|0,We=Tn+24|0,Ve=Tn+8|0,br=Tn,Z=v[y>>2]|0,(Z|0)<=0)return Ai=0,bt=Tn,Ai|0;for(cr=y+4|0,Or=Dr+8|0,Yr=Sr+8|0,vi=Ve+8|0,$=0,ae=0;;){ot=v[cr>>2]|0,se=ot+(ae<<4)|0,v[Dr>>2]=v[se>>2],v[Dr+4>>2]=v[se+4>>2],v[Dr+8>>2]=v[se+8>>2],v[Dr+12>>2]=v[se+12>>2],(ae|0)==(Z+-1|0)?(v[Sr>>2]=v[ot>>2],v[Sr+4>>2]=v[ot+4>>2],v[Sr+8>>2]=v[ot+8>>2],v[Sr+12>>2]=v[ot+12>>2]):(se=ot+(ae+1<<4)|0,v[Sr>>2]=v[se>>2],v[Sr+4>>2]=v[se+4>>2],v[Sr+8>>2]=v[se+8>>2],v[Sr+12>>2]=v[se+12>>2]),Z=v2(Dr,Sr,E,We)|0;t:do if(Z)ot=0,$=Z;else if(Z=We,ot=v[Z>>2]|0,Z=v[Z+4>>2]|0,(Z|0)>0|(Z|0)==0&ot>>>0>0){ye=0,se=0;e:for(;;){if(Sn=1/(+(ot>>>0)+4294967296*+(Z|0)),kM=+_t[Dr>>3],Z=de(ot|0,Z|0,ye|0,se|0)|0,wa=+(Z>>>0)+4294967296*+(Tt()|0),ci=+(ye>>>0)+4294967296*+(se|0),_t[Ve>>3]=Sn*(kM*wa)+Sn*(+_t[Sr>>3]*ci),_t[vi>>3]=Sn*(+_t[Or>>3]*wa)+Sn*(+_t[Yr>>3]*ci),Z=ir(Ve,E,br)|0,Z|0){$=Z;break}re=br,Zt=v[re>>2]|0,re=v[re+4>>2]|0,kt=ur(Zt|0,re|0,_|0,x|0)|0,ht=Tt()|0,Z=U+(kt<<3)|0,xt=Z,ot=v[xt>>2]|0,xt=v[xt+4>>2]|0;r:do if((ot|0)==0&(xt|0)==0)Jt=Z,Ai=16;else for(Ot=0,Dt=0;;){if((Ot|0)>(x|0)|(Ot|0)==(x|0)&Dt>>>0>_>>>0){$=1;break e}if((ot|0)==(Zt|0)&(xt|0)==(re|0))break r;if(Z=Kt(kt|0,ht|0,1,0)|0,kt=sr(Z|0,Tt()|0,_|0,x|0)|0,ht=Tt()|0,Dt=Kt(Dt|0,Ot|0,1,0)|0,Ot=Tt()|0,Z=U+(kt<<3)|0,xt=Z,ot=v[xt>>2]|0,xt=v[xt+4>>2]|0,(ot|0)==0&(xt|0)==0){Jt=Z,Ai=16;break}}while(!1);if((Ai|0)==16&&(Ai=0,!((Zt|0)==0&(re|0)==0))&&(Dt=Jt,v[Dt>>2]=Zt,v[Dt+4>>2]=re,Dt=B+(v[k>>2]<<3)|0,v[Dt>>2]=Zt,v[Dt+4>>2]=re,Dt=k,Dt=Kt(v[Dt>>2]|0,v[Dt+4>>2]|0,1,0)|0,Zt=Tt()|0,re=k,v[re>>2]=Dt,v[re+4>>2]=Zt),ye=Kt(ye|0,se|0,1,0)|0,se=Tt()|0,Z=We,ot=v[Z>>2]|0,Z=v[Z+4>>2]|0,!((Z|0)>(se|0)|(Z|0)==(se|0)&ot>>>0>ye>>>0)){ot=1;break t}}ot=0}else ot=1;while(!1);if(ae=ae+1|0,!ot){Ai=21;break}if(Z=v[y>>2]|0,(ae|0)>=(Z|0)){$=0,Ai=21;break}}return(Ai|0)==21?(bt=Tn,$|0):0}function JA(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0,Sr=0,We=0,Ai=0,Tn=0,ci=0,Sn=0,wa=0;if(wa=bt,bt=bt+112|0,Ai=wa+80|0,Z=wa+72|0,Tn=wa,ci=wa+56|0,k=cd(x)|0,k|0)return Sn=k,bt=wa,Sn|0;if(ot=y+8|0,Sn=Wt((v[ot>>2]<<5)+32|0)|0,!Sn)return Sn=13,bt=wa,Sn|0;if(Tf(y,Sn),k=cd(x)|0,!k){if(Sr=y,We=v[Sr+4>>2]|0,k=Z,v[k>>2]=v[Sr>>2],v[k+4>>2]=We,i0(Z,Ai),k=_2(Ai,_,Tn)|0,k)Sr=0,We=0;else{if(k=v[Z>>2]|0,B=v[ot>>2]|0,(B|0)>0){U=v[y+12>>2]|0,x=0;do k=(v[U+(x<<3)>>2]|0)+k|0,x=x+1|0;while((x|0)!=(B|0));x=k}else x=k;k=Tn,B=v[k>>2]|0,k=v[k+4>>2]|0,U=((x|0)<0)<<31>>31,(k|0)<(U|0)|(k|0)==(U|0)&B>>>0<x>>>0?(k=Tn,v[k>>2]=x,v[k+4>>2]=U,k=U):x=B,Sr=Kt(x|0,k|0,12,0)|0,We=Tt()|0,k=Tn,v[k>>2]=Sr,v[k+4>>2]=We,k=0}if(!k){if(x=Xt(Sr,8)|0,!x)return It(Sn),Sn=13,bt=wa,Sn|0;if($=Xt(Sr,8)|0,!$)return It(Sn),It(x),Sn=13,bt=wa,Sn|0;vi=Ai,v[vi>>2]=0,v[vi+4>>2]=0,vi=y,Dr=v[vi+4>>2]|0,k=Z,v[k>>2]=v[vi>>2],v[k+4>>2]=Dr,k=Im(Z,Sr,We,_,Ai,x,$)|0;t:do if(k)It(x),It($),It(Sn);else{e:do if((v[ot>>2]|0)>0){for(U=y+12|0,B=0;k=Im((v[U>>2]|0)+(B<<3)|0,Sr,We,_,Ai,x,$)|0,B=B+1|0,!(k|0);)if((B|0)>=(v[ot>>2]|0))break e;It(x),It($),It(Sn);break t}while(!1);(We|0)>0|(We|0)==0&Sr>>>0>0&&pn($|0,0,Sr<<3|0)|0,Dr=Ai,vi=v[Dr+4>>2]|0;e:do if((vi|0)>0|(vi|0)==0&(v[Dr>>2]|0)>>>0>0){cr=x,Or=$,Yr=x,vi=$,Dr=x,k=x,Jt=x,Ve=$,br=$,x=$;r:for(;;){for(re=0,ye=0,se=0,ae=0,B=0,U=0;;){$=Tn,Z=$+56|0;do v[$>>2]=0,$=$+4|0;while(($|0)<(Z|0));if(_=cr+(re<<3)|0,ot=v[_>>2]|0,_=v[_+4>>2]|0,Cm(ot,_,1,Tn,0)|0){$=Tn,Z=$+56|0;do v[$>>2]=0,$=$+4|0;while(($|0)<(Z|0));$=Xt(7,4)|0,$|0&&(nu(ot,_,1,Tn,$,7,0,0)|0,It($))}for(Zt=0;;){Dt=Tn+(Zt<<3)|0,Ot=v[Dt>>2]|0,Dt=v[Dt+4>>2]|0;i:do if((Ot|0)==0&(Dt|0)==0)$=B,Z=U;else{if(ht=ur(Ot|0,Dt|0,Sr|0,We|0)|0,ot=Tt()|0,$=E+(ht<<3)|0,_=$,Z=v[_>>2]|0,_=v[_+4>>2]|0,!((Z|0)==0&(_|0)==0)){xt=0,kt=0;do{if((xt|0)>(We|0)|(xt|0)==(We|0)&kt>>>0>Sr>>>0)break r;if((Z|0)==(Ot|0)&(_|0)==(Dt|0)){$=B,Z=U;break i}$=Kt(ht|0,ot|0,1,0)|0,ht=sr($|0,Tt()|0,Sr|0,We|0)|0,ot=Tt()|0,kt=Kt(kt|0,xt|0,1,0)|0,xt=Tt()|0,$=E+(ht<<3)|0,_=$,Z=v[_>>2]|0,_=v[_+4>>2]|0}while(!((Z|0)==0&(_|0)==0))}if((Ot|0)==0&(Dt|0)==0){$=B,Z=U;break}nd(Ot,Dt,ci)|0,Qm(y,Sn,ci)|0&&(kt=Kt(B|0,U|0,1,0)|0,U=Tt()|0,xt=$,v[xt>>2]=Ot,v[xt+4>>2]=Dt,B=Or+(B<<3)|0,v[B>>2]=Ot,v[B+4>>2]=Dt,B=kt),$=B,Z=U}while(!1);if(Zt=Zt+1|0,Zt>>>0>=7)break;B=$,U=Z}if(re=Kt(re|0,ye|0,1,0)|0,ye=Tt()|0,se=Kt(se|0,ae|0,1,0)|0,ae=Tt()|0,U=Ai,B=v[U>>2]|0,U=v[U+4>>2]|0,(ae|0)<(U|0)|(ae|0)==(U|0)&se>>>0<B>>>0)B=$,U=Z;else break}if((U|0)>0|(U|0)==0&B>>>0>0){B=0,U=0;do ae=cr+(B<<3)|0,v[ae>>2]=0,v[ae+4>>2]=0,B=Kt(B|0,U|0,1,0)|0,U=Tt()|0,ae=Ai,se=v[ae+4>>2]|0;while((U|0)<(se|0)|((U|0)==(se|0)?B>>>0<(v[ae>>2]|0)>>>0:0))}if(ae=Ai,v[ae>>2]=$,v[ae+4>>2]=Z,(Z|0)>0|(Z|0)==0&$>>>0>0)Zt=x,re=br,ye=Dr,se=Ve,ae=Or,x=Jt,br=k,Ve=Yr,Jt=Zt,k=re,Dr=vi,vi=ye,Yr=se,Or=cr,cr=ae;else break e}It(Yr),It(vi),It(Sn),k=1;break t}else k=$;while(!1);It(Sn),It(x),It(k),k=0}while(!1);return Sn=k,bt=wa,Sn|0}}return It(Sn),Sn=k,bt=wa,Sn|0}function ty(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(ht=bt,bt=bt+176|0,Z=ht,(_|0)<1)return gt(x,0,0),ot=0,bt=ht,ot|0;for($=y,$=Me(v[$>>2]|0,v[$+4>>2]|0,52)|0,Tt()|0,gt(x,(_|0)>6?_:6,$&15),$=0;E=y+($<<3)|0,E=su(v[E>>2]|0,v[E+4>>2]|0,Z)|0,!(E|0);){if(E=v[Z>>2]|0,(E|0)>0){U=0;do B=Z+8+(U<<4)|0,U=U+1|0,E=Z+8+(((U|0)%(E|0)|0)<<4)|0,k=Ut(x,E,B)|0,k?Ct(x,k)|0:Rt(x,B,E)|0,E=v[Z>>2]|0;while((U|0)<(E|0))}if($=$+1|0,($|0)>=(_|0)){E=0,ot=13;break}}return(ot|0)==13?(bt=ht,E|0):(yt(x),ot=E,bt=ht,ot|0)}function Z_(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;if(B=bt,bt=bt+32|0,E=B,k=B+16|0,y=ty(y,_,k)|0,y|0)return x=y,bt=B,x|0;if(v[x>>2]=0,v[x+4>>2]=0,v[x+8>>2]=0,y=Pt(k)|0,y|0)do{_=Xm(x)|0;do I2(_,y)|0,U=y+16|0,v[E>>2]=v[U>>2],v[E+4>>2]=v[U+4>>2],v[E+8>>2]=v[U+8>>2],v[E+12>>2]=v[U+12>>2],Ct(k,y)|0,y=Gt(k,E)|0;while((y|0)!=0);y=Pt(k)|0}while((y|0)!=0);return yt(k),y=na(x)|0,y?(r0(x),U=y,bt=B,U|0):(U=0,bt=B,U|0)}function tn(y){return y=y|0,y>>>0>121?(y=0,y|0):(y=v[7696+(y*28|0)+16>>2]|0,y|0)}function gf(y){return y=y|0,(y|0)==4|(y|0)==117|0}function Af(y){return y=y|0,v[11120+((v[y>>2]|0)*216|0)+((v[y+4>>2]|0)*72|0)+((v[y+8>>2]|0)*24|0)+(v[y+12>>2]<<3)>>2]|0}function Yl(y){return y=y|0,v[11120+((v[y>>2]|0)*216|0)+((v[y+4>>2]|0)*72|0)+((v[y+8>>2]|0)*24|0)+(v[y+12>>2]<<3)+4>>2]|0}function A2(y,_){y=y|0,_=_|0,y=7696+(y*28|0)|0,v[_>>2]=v[y>>2],v[_+4>>2]=v[y+4>>2],v[_+8>>2]=v[y+8>>2],v[_+12>>2]=v[y+12>>2]}function y2(y,_){y=y|0,_=_|0;var x=0,E=0;if(_>>>0>20)return _=-1,_|0;do if((v[11120+(_*216|0)>>2]|0)!=(y|0))if((v[11120+(_*216|0)+8>>2]|0)!=(y|0))if((v[11120+(_*216|0)+16>>2]|0)!=(y|0))if((v[11120+(_*216|0)+24>>2]|0)!=(y|0))if((v[11120+(_*216|0)+32>>2]|0)!=(y|0))if((v[11120+(_*216|0)+40>>2]|0)!=(y|0))if((v[11120+(_*216|0)+48>>2]|0)!=(y|0))if((v[11120+(_*216|0)+56>>2]|0)!=(y|0))if((v[11120+(_*216|0)+64>>2]|0)!=(y|0))if((v[11120+(_*216|0)+72>>2]|0)!=(y|0))if((v[11120+(_*216|0)+80>>2]|0)!=(y|0))if((v[11120+(_*216|0)+88>>2]|0)!=(y|0))if((v[11120+(_*216|0)+96>>2]|0)!=(y|0))if((v[11120+(_*216|0)+104>>2]|0)!=(y|0))if((v[11120+(_*216|0)+112>>2]|0)!=(y|0))if((v[11120+(_*216|0)+120>>2]|0)!=(y|0))if((v[11120+(_*216|0)+128>>2]|0)!=(y|0))if((v[11120+(_*216|0)+136>>2]|0)==(y|0))y=2,x=1,E=2;else{if((v[11120+(_*216|0)+144>>2]|0)==(y|0)){y=0,x=2,E=0;break}if((v[11120+(_*216|0)+152>>2]|0)==(y|0)){y=0,x=2,E=1;break}if((v[11120+(_*216|0)+160>>2]|0)==(y|0)){y=0,x=2,E=2;break}if((v[11120+(_*216|0)+168>>2]|0)==(y|0)){y=1,x=2,E=0;break}if((v[11120+(_*216|0)+176>>2]|0)==(y|0)){y=1,x=2,E=1;break}if((v[11120+(_*216|0)+184>>2]|0)==(y|0)){y=1,x=2,E=2;break}if((v[11120+(_*216|0)+192>>2]|0)==(y|0)){y=2,x=2,E=0;break}if((v[11120+(_*216|0)+200>>2]|0)==(y|0)){y=2,x=2,E=1;break}if((v[11120+(_*216|0)+208>>2]|0)==(y|0)){y=2,x=2,E=2;break}else y=-1;return y|0}else y=2,x=1,E=1;else y=2,x=1,E=0;else y=1,x=1,E=2;else y=1,x=1,E=1;else y=1,x=1,E=0;else y=0,x=1,E=2;else y=0,x=1,E=1;else y=0,x=1,E=0;else y=2,x=0,E=2;else y=2,x=0,E=1;else y=2,x=0,E=0;else y=1,x=0,E=2;else y=1,x=0,E=1;else y=1,x=0,E=0;else y=0,x=0,E=2;else y=0,x=0,E=1;else y=0,x=0,E=0;while(!1);return _=v[11120+(_*216|0)+(x*72|0)+(y*24|0)+(E<<3)+4>>2]|0,_|0}function ey(y,_){return y=y|0,_=_|0,(v[7696+(y*28|0)+20>>2]|0)==(_|0)?(_=1,_|0):(_=(v[7696+(y*28|0)+24>>2]|0)==(_|0),_|0)}function th(y,_){return y=y|0,_=_|0,v[848+(y*28|0)+(_<<2)>>2]|0}function Vp(y,_){return y=y|0,_=_|0,(v[848+(y*28|0)>>2]|0)==(_|0)?(_=0,_|0):(v[848+(y*28|0)+4>>2]|0)==(_|0)?(_=1,_|0):(v[848+(y*28|0)+8>>2]|0)==(_|0)?(_=2,_|0):(v[848+(y*28|0)+12>>2]|0)==(_|0)?(_=3,_|0):(v[848+(y*28|0)+16>>2]|0)==(_|0)?(_=4,_|0):(v[848+(y*28|0)+20>>2]|0)==(_|0)?(_=5,_|0):((v[848+(y*28|0)+24>>2]|0)==(_|0)?6:7)|0}function ry(){return 122}function km(y){y=y|0;var _=0,x=0,E=0;_=0;do Re(_|0,0,45)|0,E=Tt()|0|134225919,x=y+(_<<3)|0,v[x>>2]=-1,v[x+4>>2]=E,_=_+1|0;while((_|0)!=122);return 0}function iy(y){y=y|0;var _=0,x=0,E=0;return E=+_t[y+16>>3],x=+_t[y+24>>3],_=E-x,+(E<x?_+6.283185307179586:_)}function K_(y){return y=y|0,+_t[y+16>>3]<+_t[y+24>>3]|0}function jp(y){return y=y|0,+(+_t[y>>3]-+_t[y+8>>3])}function Xh(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;return x=+_t[_>>3],!(x>=+_t[y+8>>3])||!(x<=+_t[y>>3])?(_=0,_|0):(E=+_t[y+16>>3],x=+_t[y+24>>3],k=+_t[_+8>>3],_=k>=x,y=k<=E&1,E<x?_&&(y=1):_||(y=0),_=(y|0)!=0,_|0)}function ny(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;return+_t[y>>3]<+_t[_+8>>3]||+_t[y+8>>3]>+_t[_>>3]?(E=0,E|0):(B=+_t[y+16>>3],x=y+24|0,ht=+_t[x>>3],U=B<ht,E=_+16|0,ot=+_t[E>>3],k=_+24|0,Z=+_t[k>>3],$=ot<Z,_=ht-ot<Z-B,y=U?$|_?1:2:0,_=$?U?1:_?2:1:0,B=+xa(B,y),B<+xa(+_t[k>>3],_)||(ht=+xa(+_t[x>>3],y),ht>+xa(+_t[E>>3],_))?($=0,$|0):($=1,$|0))}function Q_(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0;B=+_t[y+16>>3],Z=+_t[y+24>>3],y=B<Z,$=+_t[_+16>>3],U=+_t[_+24>>3],k=$<U,_=Z-$<U-B,v[x>>2]=y?k|_?1:2:0,v[E>>2]=k?y?1:_?2:1:0}function pi(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;return+_t[y>>3]<+_t[_>>3]||+_t[y+8>>3]>+_t[_+8>>3]?(E=0,E|0):(E=y+16|0,Z=+_t[E>>3],B=+_t[y+24>>3],U=Z<B,x=_+16|0,ht=+_t[x>>3],k=_+24|0,ot=+_t[k>>3],$=ht<ot,_=B-ht<ot-Z,y=U?$|_?1:2:0,_=$?U?1:_?2:1:0,B=+xa(B,y),B<=+xa(+_t[k>>3],_)?(ht=+xa(+_t[E>>3],y),$=ht>=+xa(+_t[x>>3],_),$|0):($=0,$|0))}function Rm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0;k=bt,bt=bt+176|0,E=k,v[E>>2]=4,$=+_t[_>>3],_t[E+8>>3]=$,B=+_t[_+16>>3],_t[E+16>>3]=B,_t[E+24>>3]=$,$=+_t[_+24>>3],_t[E+32>>3]=$,U=+_t[_+8>>3],_t[E+40>>3]=U,_t[E+48>>3]=$,_t[E+56>>3]=U,_t[E+64>>3]=B,_=E+72|0,x=_+96|0;do v[_>>2]=0,_=_+4|0;while((_|0)<(x|0));so(y|0,E|0,168)|0,bt=k}function _2(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0;Dt=bt,bt=bt+288|0,ht=Dt+264|0,xt=Dt+96|0,ot=Dt,$=ot,Z=$+96|0;do v[$>>2]=0,$=$+4|0;while(($|0)<(Z|0));return _=od(_,ot)|0,_|0?(Ot=_,bt=Dt,Ot|0):(Z=ot,ot=v[Z>>2]|0,Z=v[Z+4>>2]|0,nd(ot,Z,ht)|0,su(ot,Z,xt)|0,U=+Gm(ht,xt+8|0),_t[ht>>3]=+_t[y>>3],Z=ht+8|0,_t[Z>>3]=+_t[y+16>>3],_t[xt>>3]=+_t[y+8>>3],ot=xt+8|0,_t[ot>>3]=+_t[y+24>>3],k=+Gm(ht,xt),re=+_t[Z>>3]-+_t[ot>>3],B=+Bi(+re),Zt=+_t[ht>>3]-+_t[xt>>3],E=+Bi(+Zt),!(re==0|Zt==0)&&(re=+fn(+B,+E),re=+mf(+(k*k/+oo(+(re/+oo(+B,+E)),3)/(U*(U*2.59807621135)*.8))),_t[_o>>3]=re,kt=~~re>>>0,Ot=+Bi(re)>=1?re>0?~~+Mm(+Ro(re/4294967296),4294967295)>>>0:~~+mf((re-+(~~re>>>0))/4294967296)>>>0:0,(v[_o+4>>2]&2146435072|0)!=2146435072)?(xt=(kt|0)==0&(Ot|0)==0,_=x,v[_>>2]=xt?1:kt,v[_+4>>2]=xt?0:Ot,_=0):_=1,Ot=_,bt=Dt,Ot|0)}function v2(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;ot=bt,bt=bt+288|0,U=ot+264|0,$=ot+96|0,Z=ot,k=Z,B=k+96|0;do v[k>>2]=0,k=k+4|0;while((k|0)<(B|0));return x=od(x,Z)|0,x|0?(E=x,bt=ot,E|0):(x=Z,k=v[x>>2]|0,x=v[x+4>>2]|0,nd(k,x,U)|0,su(k,x,$)|0,ht=+Gm(U,$+8|0),ht=+mf(+(+Gm(y,_)/(ht*2))),_t[_o>>3]=ht,x=~~ht>>>0,k=+Bi(ht)>=1?ht>0?~~+Mm(+Ro(ht/4294967296),4294967295)>>>0:~~+mf((ht-+(~~ht>>>0))/4294967296)>>>0:0,(v[_o+4>>2]&2146435072|0)==2146435072?(E=1,bt=ot,E|0):(Z=(x|0)==0&(k|0)==0,v[E>>2]=Z?1:x,v[E+4>>2]=Z?0:k,E=0,bt=ot,E|0))}function Dm(y,_){y=y|0,_=+_;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;B=y+16|0,U=+_t[B>>3],x=y+24|0,k=+_t[x>>3],E=U-k,E=U<k?E+6.283185307179586:E,ot=+_t[y>>3],$=y+8|0,Z=+_t[$>>3],ht=ot-Z,E=(E*_-E)*.5,_=(ht*_-ht)*.5,ot=ot+_,_t[y>>3]=ot>1.5707963267948966?1.5707963267948966:ot,_=Z-_,_t[$>>3]=_<-1.5707963267948966?-1.5707963267948966:_,_=U+E,_=_>3.141592653589793?_+-6.283185307179586:_,_t[B>>3]=_<-3.141592653589793?_+6.283185307179586:_,_=k-E,_=_>3.141592653589793?_+-6.283185307179586:_,_t[x>>3]=_<-3.141592653589793?_+6.283185307179586:_}function SM(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0,v[y>>2]=_,v[y+4>>2]=x,v[y+8>>2]=E}function MM(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;xt=_+8|0,v[xt>>2]=0,Z=+_t[y>>3],U=+Bi(+Z),ot=+_t[y+8>>3],$=+Bi(+ot)*1.1547005383792515,U=U+$*.5,x=~~U,y=~~$,U=U-+(x|0),$=$-+(y|0);do if(U<.5)if(U<.3333333333333333)if(v[_>>2]=x,$<(U+1)*.5){v[_+4>>2]=y;break}else{y=y+1|0,v[_+4>>2]=y;break}else if(kt=1-U,y=(!($<kt)&1)+y|0,v[_+4>>2]=y,kt<=$&$<U*2){x=x+1|0,v[_>>2]=x;break}else{v[_>>2]=x;break}else{if(!(U<.6666666666666666))if(x=x+1|0,v[_>>2]=x,$<U*.5){v[_+4>>2]=y;break}else{y=y+1|0,v[_+4>>2]=y;break}if($<1-U){if(v[_+4>>2]=y,U*2+-1<$){v[_>>2]=x;break}}else y=y+1|0,v[_+4>>2]=y;x=x+1|0,v[_>>2]=x}while(!1);do if(Z<0)if(y&1){ht=(y+1|0)/2|0,ht=de(x|0,((x|0)<0)<<31>>31|0,ht|0,((ht|0)<0)<<31>>31|0)|0,x=~~(+(x|0)-((+(ht>>>0)+4294967296*+(Tt()|0))*2+1)),v[_>>2]=x;break}else{ht=(y|0)/2|0,ht=de(x|0,((x|0)<0)<<31>>31|0,ht|0,((ht|0)<0)<<31>>31|0)|0,x=~~(+(x|0)-(+(ht>>>0)+4294967296*+(Tt()|0))*2),v[_>>2]=x;break}while(!1);ht=_+4|0,ot<0&&(x=x-((y<<1|1|0)/2|0)|0,v[_>>2]=x,y=0-y|0,v[ht>>2]=y),E=y-x|0,(x|0)<0?(k=0-x|0,v[ht>>2]=E,v[xt>>2]=k,v[_>>2]=0,y=E,x=0):k=0,(y|0)<0&&(x=x-y|0,v[_>>2]=x,k=k-y|0,v[xt>>2]=k,v[ht>>2]=0,y=0),B=x-k|0,E=y-k|0,(k|0)<0&&(v[_>>2]=B,v[ht>>2]=E,v[xt>>2]=0,y=E,x=B,k=0),E=(y|0)<(x|0)?y:x,E=(k|0)<(E|0)?k:E,!((E|0)<=0)&&(v[_>>2]=x-E,v[ht>>2]=y-E,v[xt>>2]=k-E)}function Fs(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0;_=v[y>>2]|0,U=y+4|0,x=v[U>>2]|0,(_|0)<0&&(x=x-_|0,v[U>>2]=x,B=y+8|0,v[B>>2]=(v[B>>2]|0)-_,v[y>>2]=0,_=0),(x|0)<0?(_=_-x|0,v[y>>2]=_,B=y+8|0,k=(v[B>>2]|0)-x|0,v[B>>2]=k,v[U>>2]=0,x=0):(k=y+8|0,B=k,k=v[k>>2]|0),(k|0)<0&&(_=_-k|0,v[y>>2]=_,x=x-k|0,v[U>>2]=x,v[B>>2]=0,k=0),E=(x|0)<(_|0)?x:_,E=(k|0)<(E|0)?k:E,!((E|0)<=0)&&(v[y>>2]=_-E,v[U>>2]=x-E,v[B>>2]=k-E)}function eh(y,_){y=y|0,_=_|0;var x=0,E=0;E=v[y+8>>2]|0,x=+((v[y+4>>2]|0)-E|0),_t[_>>3]=+((v[y>>2]|0)-E|0)-x*.5,_t[_+8>>3]=x*.8660254037844386}function Ns(y,_,x){y=y|0,_=_|0,x=x|0,v[x>>2]=(v[_>>2]|0)+(v[y>>2]|0),v[x+4>>2]=(v[_+4>>2]|0)+(v[y+4>>2]|0),v[x+8>>2]=(v[_+8>>2]|0)+(v[y+8>>2]|0)}function $p(y,_,x){y=y|0,_=_|0,x=x|0,v[x>>2]=(v[y>>2]|0)-(v[_>>2]|0),v[x+4>>2]=(v[y+4>>2]|0)-(v[_+4>>2]|0),v[x+8>>2]=(v[y+8>>2]|0)-(v[_+8>>2]|0)}function Gp(y,_){y=y|0,_=_|0;var x=0,E=0;x=Bs(v[y>>2]|0,_)|0,v[y>>2]=x,x=y+4|0,E=Bs(v[x>>2]|0,_)|0,v[x>>2]=E,y=y+8|0,_=Bs(v[y>>2]|0,_)|0,v[y>>2]=_}function Zh(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;U=v[y>>2]|0,$=(U|0)<0,E=(v[y+4>>2]|0)-($?U:0)|0,B=(E|0)<0,k=(B?0-E|0:0)+((v[y+8>>2]|0)-($?U:0))|0,x=(k|0)<0,y=x?0:k,_=(B?0:E)-(x?k:0)|0,k=($?0:U)-(B?E:0)-(x?k:0)|0,x=(_|0)<(k|0)?_:k,x=(y|0)<(x|0)?y:x,E=(x|0)>0,y=y-(E?x:0)|0,_=_-(E?x:0)|0;t:do switch(k-(E?x:0)|0){case 0:switch(_|0){case 0:return $=(y|0)==0?0:(y|0)==1?1:7,$|0;case 1:return $=(y|0)==0?2:(y|0)==1?3:7,$|0;default:break t}case 1:switch(_|0){case 0:return $=(y|0)==0?4:(y|0)==1?5:7,$|0;case 1:{if(!y)y=6;else break t;return y|0}default:break t}default:}while(!1);return $=7,$|0}function J_(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0;if(Z=y+8|0,U=v[Z>>2]|0,$=(v[y>>2]|0)-U|0,ot=y+4|0,U=(v[ot>>2]|0)-U|0,$>>>0>715827881|U>>>0>715827881){if(E=($|0)>0,k=2147483647-$|0,B=-2147483648-$|0,(E?(k|0)<($|0):(B|0)>($|0))||(x=$<<1,E?(2147483647-x|0)<($|0):(-2147483648-x|0)>($|0))||((U|0)>0?(2147483647-U|0)<(U|0):(-2147483648-U|0)>(U|0))||(_=$*3|0,x=U<<1,(E?(k|0)<(x|0):(B|0)>(x|0))||(($|0)>-1?(_|-2147483648|0)>=(U|0):(_^-2147483648|0)<(U|0))))return ot=1,ot|0}else x=U<<1,_=$*3|0;return E=jt(+(_-U|0)*.14285714285714285)|0,v[y>>2]=E,k=jt(+(x+$|0)*.14285714285714285)|0,v[ot>>2]=k,v[Z>>2]=0,x=(k|0)<(E|0),_=x?E:k,x=x?k:E,(x|0)<0&&(((x|0)==-2147483648||((_|0)>0?(2147483647-_|0)<(x|0):(-2147483648-_|0)>(x|0)))&&Ur(27795,26892,354,26903),((_|0)>-1?(_|-2147483648|0)>=(x|0):(_^-2147483648|0)<(x|0))&&Ur(27795,26892,354,26903)),_=k-E|0,(E|0)<0?(x=0-E|0,v[ot>>2]=_,v[Z>>2]=x,v[y>>2]=0,E=0):(_=k,x=0),(_|0)<0&&(E=E-_|0,v[y>>2]=E,x=x-_|0,v[Z>>2]=x,v[ot>>2]=0,_=0),B=E-x|0,k=_-x|0,(x|0)<0?(v[y>>2]=B,v[ot>>2]=k,v[Z>>2]=0,_=k,k=B,x=0):k=E,E=(_|0)<(k|0)?_:k,E=(x|0)<(E|0)?x:E,(E|0)<=0?(ot=0,ot|0):(v[y>>2]=k-E,v[ot>>2]=_-E,v[Z>>2]=x-E,ot=0,ot|0)}function b2(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0;if(U=y+8|0,k=v[U>>2]|0,B=(v[y>>2]|0)-k|0,$=y+4|0,k=(v[$>>2]|0)-k|0,B>>>0>715827881|k>>>0>715827881){if(x=(B|0)>0,(x?(2147483647-B|0)<(B|0):(-2147483648-B|0)>(B|0))||(_=B<<1,E=(k|0)>0,E?(2147483647-k|0)<(k|0):(-2147483648-k|0)>(k|0)))return $=1,$|0;if(Z=k<<1,(E?(2147483647-Z|0)<(k|0):(-2147483648-Z|0)>(k|0))||(x?(2147483647-_|0)<(k|0):(-2147483648-_|0)>(k|0))||(x=k*3|0,(k|0)>-1?(x|-2147483648|0)>=(B|0):(x^-2147483648|0)<(B|0)))return Z=1,Z|0}else x=k*3|0,_=B<<1;return E=jt(+(_+k|0)*.14285714285714285)|0,v[y>>2]=E,k=jt(+(x-B|0)*.14285714285714285)|0,v[$>>2]=k,v[U>>2]=0,x=(k|0)<(E|0),_=x?E:k,x=x?k:E,(x|0)<0&&(((x|0)==-2147483648||((_|0)>0?(2147483647-_|0)<(x|0):(-2147483648-_|0)>(x|0)))&&Ur(27795,26892,402,26917),((_|0)>-1?(_|-2147483648|0)>=(x|0):(_^-2147483648|0)<(x|0))&&Ur(27795,26892,402,26917)),_=k-E|0,(E|0)<0?(x=0-E|0,v[$>>2]=_,v[U>>2]=x,v[y>>2]=0,E=0):(_=k,x=0),(_|0)<0&&(E=E-_|0,v[y>>2]=E,x=x-_|0,v[U>>2]=x,v[$>>2]=0,_=0),B=E-x|0,k=_-x|0,(x|0)<0?(v[y>>2]=B,v[$>>2]=k,v[U>>2]=0,_=k,k=B,x=0):k=E,E=(_|0)<(k|0)?_:k,E=(x|0)<(E|0)?x:E,(E|0)<=0?(Z=0,Z|0):(v[y>>2]=k-E,v[$>>2]=_-E,v[U>>2]=x-E,Z=0,Z|0)}function yf(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;U=y+8|0,x=v[U>>2]|0,_=(v[y>>2]|0)-x|0,$=y+4|0,x=(v[$>>2]|0)-x|0,E=jt(+((_*3|0)-x|0)*.14285714285714285)|0,v[y>>2]=E,_=jt(+((x<<1)+_|0)*.14285714285714285)|0,v[$>>2]=_,v[U>>2]=0,x=_-E|0,(E|0)<0?(B=0-E|0,v[$>>2]=x,v[U>>2]=B,v[y>>2]=0,_=x,E=0,x=B):x=0,(_|0)<0&&(E=E-_|0,v[y>>2]=E,x=x-_|0,v[U>>2]=x,v[$>>2]=0,_=0),B=E-x|0,k=_-x|0,(x|0)<0?(v[y>>2]=B,v[$>>2]=k,v[U>>2]=0,_=k,k=B,x=0):k=E,E=(_|0)<(k|0)?_:k,E=(x|0)<(E|0)?x:E,!((E|0)<=0)&&(v[y>>2]=k-E,v[$>>2]=_-E,v[U>>2]=x-E)}function Wp(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;U=y+8|0,x=v[U>>2]|0,_=(v[y>>2]|0)-x|0,$=y+4|0,x=(v[$>>2]|0)-x|0,E=jt(+((_<<1)+x|0)*.14285714285714285)|0,v[y>>2]=E,_=jt(+((x*3|0)-_|0)*.14285714285714285)|0,v[$>>2]=_,v[U>>2]=0,x=_-E|0,(E|0)<0?(B=0-E|0,v[$>>2]=x,v[U>>2]=B,v[y>>2]=0,_=x,E=0,x=B):x=0,(_|0)<0&&(E=E-_|0,v[y>>2]=E,x=x-_|0,v[U>>2]=x,v[$>>2]=0,_=0),B=E-x|0,k=_-x|0,(x|0)<0?(v[y>>2]=B,v[$>>2]=k,v[U>>2]=0,_=k,k=B,x=0):k=E,E=(_|0)<(k|0)?_:k,E=(x|0)<(E|0)?x:E,!((E|0)<=0)&&(v[y>>2]=k-E,v[$>>2]=_-E,v[U>>2]=x-E)}function Kh(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;_=v[y>>2]|0,U=y+4|0,x=v[U>>2]|0,$=y+8|0,E=v[$>>2]|0,k=x+(_*3|0)|0,v[y>>2]=k,x=E+(x*3|0)|0,v[U>>2]=x,_=(E*3|0)+_|0,v[$>>2]=_,E=x-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=E,v[$>>2]=_,v[y>>2]=0,x=E,E=0):E=k,(x|0)<0&&(E=E-x|0,v[y>>2]=E,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=E-_|0,k=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=k,v[$>>2]=0,E=B,_=0):k=x,x=(k|0)<(E|0)?k:E,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=E-x,v[U>>2]=k-x,v[$>>2]=_-x)}function Xl(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;k=v[y>>2]|0,U=y+4|0,_=v[U>>2]|0,$=y+8|0,x=v[$>>2]|0,E=(_*3|0)+k|0,k=x+(k*3|0)|0,v[y>>2]=k,v[U>>2]=E,_=(x*3|0)+_|0,v[$>>2]=_,x=E-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=x,v[$>>2]=_,v[y>>2]=0,k=0):x=E,(x|0)<0&&(k=k-x|0,v[y>>2]=k,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=k-_|0,E=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=E,v[$>>2]=0,k=B,_=0):E=x,x=(E|0)<(k|0)?E:k,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=k-x,v[U>>2]=E-x,v[$>>2]=_-x)}function oy(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0;(_+-1|0)>>>0>=6||(k=(v[15440+(_*12|0)>>2]|0)+(v[y>>2]|0)|0,v[y>>2]=k,$=y+4|0,E=(v[15440+(_*12|0)+4>>2]|0)+(v[$>>2]|0)|0,v[$>>2]=E,U=y+8|0,_=(v[15440+(_*12|0)+8>>2]|0)+(v[U>>2]|0)|0,v[U>>2]=_,x=E-k|0,(k|0)<0?(_=_-k|0,v[$>>2]=x,v[U>>2]=_,v[y>>2]=0,E=0):(x=E,E=k),(x|0)<0&&(E=E-x|0,v[y>>2]=E,_=_-x|0,v[U>>2]=_,v[$>>2]=0,x=0),B=E-_|0,k=x-_|0,(_|0)<0?(v[y>>2]=B,v[$>>2]=k,v[U>>2]=0,E=B,_=0):k=x,x=(k|0)<(E|0)?k:E,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=E-x,v[$>>2]=k-x,v[U>>2]=_-x))}function x2(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;k=v[y>>2]|0,U=y+4|0,_=v[U>>2]|0,$=y+8|0,x=v[$>>2]|0,E=_+k|0,k=x+k|0,v[y>>2]=k,v[U>>2]=E,_=x+_|0,v[$>>2]=_,x=E-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=x,v[$>>2]=_,v[y>>2]=0,E=0):(x=E,E=k),(x|0)<0&&(E=E-x|0,v[y>>2]=E,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=E-_|0,k=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=k,v[$>>2]=0,E=B,_=0):k=x,x=(k|0)<(E|0)?k:E,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=E-x,v[U>>2]=k-x,v[$>>2]=_-x)}function Qh(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;_=v[y>>2]|0,U=y+4|0,E=v[U>>2]|0,$=y+8|0,x=v[$>>2]|0,k=E+_|0,v[y>>2]=k,E=x+E|0,v[U>>2]=E,_=x+_|0,v[$>>2]=_,x=E-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=x,v[$>>2]=_,v[y>>2]=0,E=0):(x=E,E=k),(x|0)<0&&(E=E-x|0,v[y>>2]=E,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=E-_|0,k=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=k,v[$>>2]=0,E=B,_=0):k=x,x=(k|0)<(E|0)?k:E,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=E-x,v[U>>2]=k-x,v[$>>2]=_-x)}function Jh(y){switch(y=y|0,y|0){case 1:{y=5;break}case 5:{y=4;break}case 4:{y=6;break}case 6:{y=2;break}case 2:{y=3;break}case 3:{y=1;break}default:}return y|0}function ou(y){switch(y=y|0,y|0){case 1:{y=3;break}case 3:{y=2;break}case 2:{y=6;break}case 6:{y=4;break}case 4:{y=5;break}case 5:{y=1;break}default:}return y|0}function Om(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;_=v[y>>2]|0,U=y+4|0,x=v[U>>2]|0,$=y+8|0,E=v[$>>2]|0,k=x+(_<<1)|0,v[y>>2]=k,x=E+(x<<1)|0,v[U>>2]=x,_=(E<<1)+_|0,v[$>>2]=_,E=x-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=E,v[$>>2]=_,v[y>>2]=0,x=E,E=0):E=k,(x|0)<0&&(E=E-x|0,v[y>>2]=E,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=E-_|0,k=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=k,v[$>>2]=0,E=B,_=0):k=x,x=(k|0)<(E|0)?k:E,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=E-x,v[U>>2]=k-x,v[$>>2]=_-x)}function sy(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;k=v[y>>2]|0,U=y+4|0,_=v[U>>2]|0,$=y+8|0,x=v[$>>2]|0,E=(_<<1)+k|0,k=x+(k<<1)|0,v[y>>2]=k,v[U>>2]=E,_=(x<<1)+_|0,v[$>>2]=_,x=E-k|0,(k|0)<0?(_=_-k|0,v[U>>2]=x,v[$>>2]=_,v[y>>2]=0,k=0):x=E,(x|0)<0&&(k=k-x|0,v[y>>2]=k,_=_-x|0,v[$>>2]=_,v[U>>2]=0,x=0),B=k-_|0,E=x-_|0,(_|0)<0?(v[y>>2]=B,v[U>>2]=E,v[$>>2]=0,k=B,_=0):E=x,x=(E|0)<(k|0)?E:k,x=(_|0)<(x|0)?_:x,!((x|0)<=0)&&(v[y>>2]=k-x,v[U>>2]=E-x,v[$>>2]=_-x)}function Lm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0;return U=(v[y>>2]|0)-(v[_>>2]|0)|0,$=(U|0)<0,E=(v[y+4>>2]|0)-(v[_+4>>2]|0)-($?U:0)|0,B=(E|0)<0,k=($?0-U|0:0)+(v[y+8>>2]|0)-(v[_+8>>2]|0)+(B?0-E|0:0)|0,y=(k|0)<0,_=y?0:k,x=(B?0:E)-(y?k:0)|0,k=($?0:U)-(B?E:0)-(y?k:0)|0,y=(x|0)<(k|0)?x:k,y=(_|0)<(y|0)?_:y,E=(y|0)>0,_=_-(E?y:0)|0,x=x-(E?y:0)|0,y=k-(E?y:0)|0,y=(y|0)>-1?y:0-y|0,x=(x|0)>-1?x:0-x|0,_=(_|0)>-1?_:0-_|0,_=(x|0)>(_|0)?x:_,((y|0)>(_|0)?y:_)|0}function tv(y,_){y=y|0,_=_|0;var x=0;x=v[y+8>>2]|0,v[_>>2]=(v[y>>2]|0)-x,v[_+4>>2]=(v[y+4>>2]|0)-x}function Bm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0;return E=v[y>>2]|0,v[_>>2]=E,k=v[y+4>>2]|0,U=_+4|0,v[U>>2]=k,$=_+8|0,v[$>>2]=0,x=(k|0)<(E|0),y=x?E:k,x=x?k:E,(x|0)<0&&((x|0)==-2147483648||((y|0)>0?(2147483647-y|0)<(x|0):(-2147483648-y|0)>(x|0))||((y|0)>-1?(y|-2147483648|0)>=(x|0):(y^-2147483648|0)<(x|0)))?(_=1,_|0):(y=k-E|0,(E|0)<0?(x=0-E|0,v[U>>2]=y,v[$>>2]=x,v[_>>2]=0,E=0):(y=k,x=0),(y|0)<0&&(E=E-y|0,v[_>>2]=E,x=x-y|0,v[$>>2]=x,v[U>>2]=0,y=0),B=E-x|0,k=y-x|0,(x|0)<0?(v[_>>2]=B,v[U>>2]=k,v[$>>2]=0,y=k,k=B,x=0):k=E,E=(y|0)<(k|0)?y:k,E=(x|0)<(E|0)?x:E,(E|0)<=0?(_=0,_|0):(v[_>>2]=k-E,v[U>>2]=y-E,v[$>>2]=x-E,_=0,_|0))}function ay(y){y=y|0;var _=0,x=0,E=0,k=0;_=y+8|0,k=v[_>>2]|0,x=k-(v[y>>2]|0)|0,v[y>>2]=x,E=y+4|0,y=(v[E>>2]|0)-k|0,v[E>>2]=y,v[_>>2]=0-(y+x)}function EM(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;x=v[y>>2]|0,_=0-x|0,v[y>>2]=_,U=y+8|0,v[U>>2]=0,$=y+4|0,E=v[$>>2]|0,k=E+x|0,(x|0)>0?(v[$>>2]=k,v[U>>2]=x,v[y>>2]=0,_=0,E=k):x=0,(E|0)<0?(B=_-E|0,v[y>>2]=B,x=x-E|0,v[U>>2]=x,v[$>>2]=0,k=B-x|0,_=0-x|0,(x|0)<0?(v[y>>2]=k,v[$>>2]=_,v[U>>2]=0,E=_,x=0):(E=0,k=B)):k=_,_=(E|0)<(k|0)?E:k,_=(x|0)<(_|0)?x:_,!((_|0)<=0)&&(v[y>>2]=k-_,v[$>>2]=E-_,v[U>>2]=x-_)}function w2(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0;if(xt=bt,bt=bt+64|0,ht=xt,$=xt+56|0,!(!0&(_&2013265920|0)==134217728&(!0&(E&2013265920|0)==134217728)))return k=5,bt=xt,k|0;if((y|0)==(x|0)&(_|0)==(E|0))return v[k>>2]=0,k=0,bt=xt,k|0;if(U=Me(y|0,_|0,52)|0,Tt()|0,U=U&15,ot=Me(x|0,E|0,52)|0,Tt()|0,(U|0)!=(ot&15|0))return k=12,bt=xt,k|0;if(B=U+-1|0,U>>>0>1){Kp(y,_,B,ht)|0,Kp(x,E,B,$)|0,ot=ht,Z=v[ot>>2]|0,ot=v[ot+4>>2]|0;t:do if((Z|0)==(v[$>>2]|0)&&(ot|0)==(v[$+4>>2]|0)){U=(U^15)*3|0,B=Me(y|0,_|0,U|0)|0,Tt()|0,B=B&7,U=Me(x|0,E|0,U|0)|0,Tt()|0,U=U&7;do if((B|0)==0|(U|0)==0)v[k>>2]=1,B=0;else if((B|0)==7)B=5;else{if((B|0)==1|(U|0)==1&&Ei(Z,ot)|0){B=5;break}if((v[15536+(B<<2)>>2]|0)!=(U|0)&&(v[15568+(B<<2)>>2]|0)!=(U|0))break t;v[k>>2]=1,B=0}while(!1);return k=B,bt=xt,k|0}while(!1)}B=ht,U=B+56|0;do v[B>>2]=0,B=B+4|0;while((B|0)<(U|0));return QA(y,_,1,ht)|0,_=ht,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0))&&(_=ht+8|0,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0)))&&(_=ht+16|0,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0)))&&(_=ht+24|0,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0)))&&(_=ht+32|0,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0)))&&(_=ht+40|0,!((v[_>>2]|0)==(x|0)&&(v[_+4>>2]|0)==(E|0)))?(B=ht+48|0,B=((v[B>>2]|0)==(x|0)?(v[B+4>>2]|0)==(E|0):0)&1):B=1,v[k>>2]=B,k=0,bt=xt,k|0}function vo(y,_,x,E,k){return y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,x=X_(y,_,x,E)|0,(x|0)==7?(k=11,k|0):(E=Re(x|0,0,56)|0,_=_&-2130706433|(Tt()|0)|268435456,v[k>>2]=y|E,v[k+4>>2]=_,k=0,k|0)}function td(y,_,x){return y=y|0,_=_|0,x=x|0,!0&(_&2013265920|0)==268435456?(v[x>>2]=y,v[x+4>>2]=_&-2130706433|134217728,x=0,x|0):(x=6,x|0)}function Ga(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;return k=bt,bt=bt+16|0,E=k,v[E>>2]=0,!0&(_&2013265920|0)==268435456?(B=Me(y|0,_|0,56)|0,Tt()|0,E=ps(y,_&-2130706433|134217728,B&7,E,x)|0,bt=k,E|0):(E=6,bt=k,E|0)}function qp(y,_){y=y|0,_=_|0;var x=0;switch(x=Me(y|0,_|0,56)|0,Tt()|0,x&7){case 0:case 7:return x=0,x|0;default:}return x=_&-2130706433|134217728,!(!0&(_&2013265920|0)==268435456)||!0&(_&117440512|0)==16777216&(Ei(y,x)|0)!=0?(x=0,x|0):(x=zm(y,x)|0,x|0)}function Hp(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;return k=bt,bt=bt+16|0,E=k,!0&(_&2013265920|0)==268435456?(B=_&-2130706433|134217728,U=x,v[U>>2]=y,v[U+4>>2]=B,v[E>>2]=0,_=Me(y|0,_|0,56)|0,Tt()|0,E=ps(y,B,_&7,E,x+8|0)|0,bt=k,E|0):(E=6,bt=k,E|0)}function ly(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0;return k=(Ei(y,_)|0)==0,_=_&-2130706433,E=x,v[E>>2]=k?y:0,v[E+4>>2]=k?_|285212672:0,E=x+8|0,v[E>>2]=y,v[E+4>>2]=_|301989888,E=x+16|0,v[E>>2]=y,v[E+4>>2]=_|318767104,E=x+24|0,v[E>>2]=y,v[E+4>>2]=_|335544320,E=x+32|0,v[E>>2]=y,v[E+4>>2]=_|352321536,x=x+40|0,v[x>>2]=y,v[x+4>>2]=_|369098752,0}function yc(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;return U=bt,bt=bt+16|0,k=U,B=_&-2130706433|134217728,!0&(_&2013265920|0)==268435456?(E=Me(y|0,_|0,56)|0,Tt()|0,E=G(y,B,E&7)|0,(E|0)==-1?(v[x>>2]=0,B=6,bt=U,B|0):(id(y,B,k)|0&&Ur(27795,26932,282,26947),_=Me(y|0,_|0,52)|0,Tt()|0,_=_&15,Ei(y,B)|0?cy(k,_,E,2,x):_f(k,_,E,2,x),B=0,bt=U,B|0)):(B=6,bt=U,B|0)}function Yp(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0;E=bt,bt=bt+16|0,k=E,Fm(y,_,x,k),MM(k,x+4|0),bt=E}function Fm(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0;if($=bt,bt=bt+16|0,Z=$,ev(y,x,Z),B=+W_(+(1-+_t[Z>>3]*.5)),B<1e-16){v[E>>2]=0,v[E+4>>2]=0,v[E+8>>2]=0,v[E+12>>2]=0,bt=$;return}if(Z=v[x>>2]|0,k=+_t[15920+(Z*24|0)>>3],k=+e0(k-+e0(+ad(15600+(Z<<4)|0,y))),bo(_)|0?U=+e0(k+-.3334731722518321):U=k,k=+pf(+B)*2.618033988749896,(_|0)>0){y=0;do k=k*2.6457513110645907,y=y+1|0;while((y|0)!=(_|0))}B=+Di(+U)*k,_t[E>>3]=B,U=+Zi(+U)*k,_t[E+8>>3]=U,bt=$}function ev(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;if(B=bt,bt=bt+32|0,k=B,N(y,k),v[_>>2]=0,_t[x>>3]=5,E=+D(16400,k),E<+_t[x>>3]&&(v[_>>2]=0,_t[x>>3]=E),E=+D(16424,k),E<+_t[x>>3]&&(v[_>>2]=1,_t[x>>3]=E),E=+D(16448,k),E<+_t[x>>3]&&(v[_>>2]=2,_t[x>>3]=E),E=+D(16472,k),E<+_t[x>>3]&&(v[_>>2]=3,_t[x>>3]=E),E=+D(16496,k),E<+_t[x>>3]&&(v[_>>2]=4,_t[x>>3]=E),E=+D(16520,k),E<+_t[x>>3]&&(v[_>>2]=5,_t[x>>3]=E),E=+D(16544,k),E<+_t[x>>3]&&(v[_>>2]=6,_t[x>>3]=E),E=+D(16568,k),E<+_t[x>>3]&&(v[_>>2]=7,_t[x>>3]=E),E=+D(16592,k),E<+_t[x>>3]&&(v[_>>2]=8,_t[x>>3]=E),E=+D(16616,k),E<+_t[x>>3]&&(v[_>>2]=9,_t[x>>3]=E),E=+D(16640,k),E<+_t[x>>3]&&(v[_>>2]=10,_t[x>>3]=E),E=+D(16664,k),E<+_t[x>>3]&&(v[_>>2]=11,_t[x>>3]=E),E=+D(16688,k),E<+_t[x>>3]&&(v[_>>2]=12,_t[x>>3]=E),E=+D(16712,k),E<+_t[x>>3]&&(v[_>>2]=13,_t[x>>3]=E),E=+D(16736,k),E<+_t[x>>3]&&(v[_>>2]=14,_t[x>>3]=E),E=+D(16760,k),E<+_t[x>>3]&&(v[_>>2]=15,_t[x>>3]=E),E=+D(16784,k),E<+_t[x>>3]&&(v[_>>2]=16,_t[x>>3]=E),E=+D(16808,k),E<+_t[x>>3]&&(v[_>>2]=17,_t[x>>3]=E),E=+D(16832,k),E<+_t[x>>3]&&(v[_>>2]=18,_t[x>>3]=E),E=+D(16856,k),!(E<+_t[x>>3])){bt=B;return}v[_>>2]=19,_t[x>>3]=E,bt=B}function Xp(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0;if(B=+f(y),B<1e-16){_=15600+(_<<4)|0,v[k>>2]=v[_>>2],v[k+4>>2]=v[_+4>>2],v[k+8>>2]=v[_+8>>2],v[k+12>>2]=v[_+12>>2];return}if(U=+ml(+ +_t[y+8>>3],+ +_t[y>>3]),(x|0)>0){y=0;do B=B*.37796447300922725,y=y+1|0;while((y|0)!=(x|0))}$=B*.3333333333333333,E?(x=(bo(x)|0)==0,B=+XA(+((x?$:$*.37796447300922725)*.381966011250105))):(B=+XA(+(B*.381966011250105)),bo(x)|0&&(U=+e0(U+.3334731722518321))),hn(15600+(_<<4)|0,+e0(+_t[15920+(_*24|0)>>3]-U),B,k)}function T2(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0;E=bt,bt=bt+16|0,k=E,eh(y+4|0,k),Xp(k,v[y>>2]|0,_,0,x),bt=E}function cy(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0,Sr=0,We=0,Ai=0,Tn=0,ci=0;if(Ai=bt,bt=bt+272|0,B=Ai+256|0,se=Ai+240|0,Dr=Ai,Sr=Ai+224|0,We=Ai+208|0,ae=Ai+176|0,Jt=Ai+160|0,Ve=Ai+192|0,br=Ai+144|0,cr=Ai+128|0,Or=Ai+112|0,Yr=Ai+96|0,vi=Ai+80|0,v[B>>2]=_,v[se>>2]=v[y>>2],v[se+4>>2]=v[y+4>>2],v[se+8>>2]=v[y+8>>2],v[se+12>>2]=v[y+12>>2],rv(se,B,Dr),v[k>>2]=0,se=E+x+((E|0)==5&1)|0,(se|0)<=(x|0)){bt=Ai;return}Z=v[B>>2]|0,ot=Sr+4|0,ht=ae+4|0,xt=x+5|0,kt=16880+(Z<<2)|0,Ot=16960+(Z<<2)|0,Dt=cr+8|0,Zt=Or+8|0,re=Yr+8|0,ye=We+4|0,$=x;t:for(;;){U=Dr+((($|0)%5|0)<<4)|0,v[We>>2]=v[U>>2],v[We+4>>2]=v[U+4>>2],v[We+8>>2]=v[U+8>>2],v[We+12>>2]=v[U+12>>2];do;while((ed(We,Z,0,1)|0)==2);if(($|0)>(x|0)&(bo(_)|0)!=0){if(v[ae>>2]=v[We>>2],v[ae+4>>2]=v[We+4>>2],v[ae+8>>2]=v[We+8>>2],v[ae+12>>2]=v[We+12>>2],eh(ot,Jt),E=v[ae>>2]|0,B=v[17040+(E*80|0)+(v[Sr>>2]<<2)>>2]|0,v[ae>>2]=v[18640+(E*80|0)+(B*20|0)>>2],U=v[18640+(E*80|0)+(B*20|0)+16>>2]|0,(U|0)>0){y=0;do x2(ht),y=y+1|0;while((y|0)<(U|0))}switch(U=18640+(E*80|0)+(B*20|0)+4|0,v[Ve>>2]=v[U>>2],v[Ve+4>>2]=v[U+4>>2],v[Ve+8>>2]=v[U+8>>2],Gp(Ve,(v[kt>>2]|0)*3|0),Ns(ht,Ve,ht),Fs(ht),eh(ht,br),Tn=+(v[Ot>>2]|0),_t[cr>>3]=Tn*3,_t[Dt>>3]=0,ci=Tn*-1.5,_t[Or>>3]=ci,_t[Zt>>3]=Tn*2.598076211353316,_t[Yr>>3]=ci,_t[re>>3]=Tn*-2.598076211353316,v[17040+((v[ae>>2]|0)*80|0)+(v[We>>2]<<2)>>2]|0){case 1:{y=Or,E=cr;break}case 3:{y=Yr,E=Or;break}case 2:{y=cr,E=Yr;break}default:{y=12;break t}}b(Jt,br,E,y,vi),Xp(vi,v[ae>>2]|0,Z,1,k+8+(v[k>>2]<<4)|0),v[k>>2]=(v[k>>2]|0)+1}if(($|0)<(xt|0)&&(eh(ye,ae),Xp(ae,v[We>>2]|0,Z,1,k+8+(v[k>>2]<<4)|0),v[k>>2]=(v[k>>2]|0)+1),v[Sr>>2]=v[We>>2],v[Sr+4>>2]=v[We+4>>2],v[Sr+8>>2]=v[We+8>>2],v[Sr+12>>2]=v[We+12>>2],$=$+1|0,($|0)>=(se|0)){y=3;break}}if((y|0)==3){bt=Ai;return}else(y|0)==12&&Ur(26970,27017,572,27027)}function rv(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0;Z=bt,bt=bt+128|0,E=Z+64|0,k=Z,B=E,U=20240,$=B+60|0;do v[B>>2]=v[U>>2],B=B+4|0,U=U+4|0;while((B|0)<($|0));B=k,U=20304,$=B+60|0;do v[B>>2]=v[U>>2],B=B+4|0,U=U+4|0;while((B|0)<($|0));$=(bo(v[_>>2]|0)|0)==0,E=$?E:k,k=y+4|0,Om(k),sy(k),bo(v[_>>2]|0)|0&&(Xl(k),v[_>>2]=(v[_>>2]|0)+1),v[x>>2]=v[y>>2],_=x+4|0,Ns(k,E,_),Fs(_),v[x+16>>2]=v[y>>2],_=x+20|0,Ns(k,E+12|0,_),Fs(_),v[x+32>>2]=v[y>>2],_=x+36|0,Ns(k,E+24|0,_),Fs(_),v[x+48>>2]=v[y>>2],_=x+52|0,Ns(k,E+36|0,_),Fs(_),v[x+64>>2]=v[y>>2],x=x+68|0,Ns(k,E+48|0,x),Fs(x),bt=Z}function ed(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0;if(Dt=bt,bt=bt+32|0,kt=Dt+12|0,$=Dt,Ot=y+4|0,xt=v[16960+(_<<2)>>2]|0,ht=(E|0)!=0,xt=ht?xt*3|0:xt,k=v[Ot>>2]|0,ot=y+8|0,U=v[ot>>2]|0,ht){if(B=y+12|0,E=v[B>>2]|0,k=U+k+E|0,(k|0)==(xt|0))return Ot=1,bt=Dt,Ot|0;Z=B}else Z=y+12|0,E=v[Z>>2]|0,k=U+k+E|0;if((k|0)<=(xt|0))return Ot=0,bt=Dt,Ot|0;do if((E|0)>0){if(E=v[y>>2]|0,(U|0)>0){B=18640+(E*80|0)+60|0,E=y;break}E=18640+(E*80|0)+40|0,x?(SM(kt,xt,0,0),$p(Ot,kt,$),Qh($),Ns($,kt,Ot),B=E,E=y):(B=E,E=y)}else B=18640+((v[y>>2]|0)*80|0)+20|0,E=y;while(!1);if(v[E>>2]=v[B>>2],k=B+16|0,(v[k>>2]|0)>0){E=0;do x2(Ot),E=E+1|0;while((E|0)<(v[k>>2]|0))}return y=B+4|0,v[kt>>2]=v[y>>2],v[kt+4>>2]=v[y+4>>2],v[kt+8>>2]=v[y+8>>2],_=v[16880+(_<<2)>>2]|0,Gp(kt,ht?_*3|0:_),Ns(Ot,kt,Ot),Fs(Ot),ht?E=((v[ot>>2]|0)+(v[Ot>>2]|0)+(v[Z>>2]|0)|0)==(xt|0)?1:2:E=2,Ot=E,bt=Dt,Ot|0}function rh(y,_){y=y|0,_=_|0;var x=0;do x=ed(y,_,0,1)|0;while((x|0)==2);return x|0}function _f(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0;if(Yr=bt,bt=bt+240|0,B=Yr+224|0,Ve=Yr+208|0,br=Yr,cr=Yr+192|0,Or=Yr+176|0,re=Yr+160|0,ye=Yr+144|0,se=Yr+128|0,ae=Yr+112|0,Jt=Yr+96|0,v[B>>2]=_,v[Ve>>2]=v[y>>2],v[Ve+4>>2]=v[y+4>>2],v[Ve+8>>2]=v[y+8>>2],v[Ve+12>>2]=v[y+12>>2],iv(Ve,B,br),v[k>>2]=0,Zt=E+x+((E|0)==6&1)|0,(Zt|0)<=(x|0)){bt=Yr;return}Z=v[B>>2]|0,ot=x+6|0,ht=16960+(Z<<2)|0,xt=ye+8|0,kt=se+8|0,Ot=ae+8|0,Dt=cr+4|0,U=0,$=x,E=-1;t:for(;;){if(B=($|0)%6|0,y=br+(B<<4)|0,v[cr>>2]=v[y>>2],v[cr+4>>2]=v[y+4>>2],v[cr+8>>2]=v[y+8>>2],v[cr+12>>2]=v[y+12>>2],y=U,U=ed(cr,Z,0,1)|0,($|0)>(x|0)&(bo(_)|0)!=0&&(y|0)!=1&&(v[cr>>2]|0)!=(E|0)){switch(eh(br+(((B+5|0)%6|0)<<4)+4|0,Or),eh(br+(B<<4)+4|0,re),vi=+(v[ht>>2]|0),_t[ye>>3]=vi*3,_t[xt>>3]=0,Dr=vi*-1.5,_t[se>>3]=Dr,_t[kt>>3]=vi*2.598076211353316,_t[ae>>3]=Dr,_t[Ot>>3]=vi*-2.598076211353316,B=v[Ve>>2]|0,v[17040+(B*80|0)+(((E|0)==(B|0)?v[cr>>2]|0:E)<<2)>>2]|0){case 1:{y=se,E=ye;break}case 3:{y=ae,E=se;break}case 2:{y=ye,E=ae;break}default:{y=8;break t}}b(Or,re,E,y,Jt),!(S(Or,Jt)|0)&&!(S(re,Jt)|0)&&(Xp(Jt,v[Ve>>2]|0,Z,1,k+8+(v[k>>2]<<4)|0),v[k>>2]=(v[k>>2]|0)+1)}if(($|0)<(ot|0)&&(eh(Dt,Or),Xp(Or,v[cr>>2]|0,Z,1,k+8+(v[k>>2]<<4)|0),v[k>>2]=(v[k>>2]|0)+1),$=$+1|0,($|0)>=(Zt|0)){y=3;break}else E=v[cr>>2]|0}if((y|0)==3){bt=Yr;return}else(y|0)==8&&Ur(27054,27017,737,27099)}function iv(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0;Z=bt,bt=bt+160|0,E=Z+80|0,k=Z,B=E,U=20368,$=B+72|0;do v[B>>2]=v[U>>2],B=B+4|0,U=U+4|0;while((B|0)<($|0));B=k,U=20448,$=B+72|0;do v[B>>2]=v[U>>2],B=B+4|0,U=U+4|0;while((B|0)<($|0));$=(bo(v[_>>2]|0)|0)==0,E=$?E:k,k=y+4|0,Om(k),sy(k),bo(v[_>>2]|0)|0&&(Xl(k),v[_>>2]=(v[_>>2]|0)+1),v[x>>2]=v[y>>2],_=x+4|0,Ns(k,E,_),Fs(_),v[x+16>>2]=v[y>>2],_=x+20|0,Ns(k,E+12|0,_),Fs(_),v[x+32>>2]=v[y>>2],_=x+36|0,Ns(k,E+24|0,_),Fs(_),v[x+48>>2]=v[y>>2],_=x+52|0,Ns(k,E+36|0,_),Fs(_),v[x+64>>2]=v[y>>2],_=x+68|0,Ns(k,E+48|0,_),Fs(_),v[x+80>>2]=v[y>>2],x=x+84|0,Ns(k,E+60|0,x),Fs(x),bt=Z}function nv(y,_){return y=y|0,_=_|0,_=Me(y|0,_|0,52)|0,Tt()|0,_&15|0}function uy(y,_){return y=y|0,_=_|0,_=Me(y|0,_|0,45)|0,Tt()|0,_&127|0}function Nm(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,(x+-1|0)>>>0>14?(E=4,E|0):(x=Me(y|0,_|0,(15-x|0)*3|0)|0,Tt()|0,v[E>>2]=x&7,E=0,E|0)}function ov(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0;if(y>>>0>15)return E=4,E|0;if(_>>>0>121)return E=17,E|0;U=Re(y|0,0,52)|0,k=Tt()|0,$=Re(_|0,0,45)|0,k=k|(Tt()|0)|134225919;t:do if((y|0)>=1){for($=1,U=(Be[20528+_>>0]|0)!=0,B=-1;;){if(_=v[x+($+-1<<2)>>2]|0,_>>>0>6){k=18,_=10;break}if(!((_|0)==0|U^1))if((_|0)==1){k=19,_=10;break}else U=0;if(ot=(15-$|0)*3|0,Z=Re(7,0,ot|0)|0,k=k&~(Tt()|0),_=Re(_|0,((_|0)<0)<<31>>31|0,ot|0)|0,B=_|B&~Z,k=Tt()|0|k,($|0)<(y|0))$=$+1|0;else break t}if((_|0)==10)return k|0}else B=-1;while(!1);return ot=E,v[ot>>2]=B,v[ot+4>>2]=k,ot=0,ot|0}function zm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0;return!(!0&(_&-16777216|0)==134217728)||(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,x=Me(y|0,_|0,45)|0,Tt()|0,x=x&127,x>>>0>121)?(y=0,y|0):(U=(E^15)*3|0,k=Me(y|0,_|0,U|0)|0,U=Re(k|0,Tt()|0,U|0)|0,k=Tt()|0,B=de(-1227133514,-1171,U|0,k|0)|0,!((U&613566756&B|0)==0&(k&4681&(Tt()|0)|0)==0)||(U=(E*3|0)+19|0,B=Re(~y|0,~_|0,U|0)|0,U=Me(B|0,Tt()|0,U|0)|0,!((E|0)==15|(U|0)==0&(Tt()|0)==0))?(U=0,U|0):!(Be[20528+x>>0]|0)||(_=_&8191,(y|0)==0&(_|0)==0)?(U=1,U|0):(U=wn(y|0,_|0,0)|0,Tt()|0,((63-U|0)%3|0|0)!=0|0))}function Zp(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0;return!0&(_&-16777216|0)==134217728&&(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,x=Me(y|0,_|0,45)|0,Tt()|0,x=x&127,x>>>0<=121)&&(U=(E^15)*3|0,k=Me(y|0,_|0,U|0)|0,U=Re(k|0,Tt()|0,U|0)|0,k=Tt()|0,B=de(-1227133514,-1171,U|0,k|0)|0,(U&613566756&B|0)==0&(k&4681&(Tt()|0)|0)==0)&&(U=(E*3|0)+19|0,B=Re(~y|0,~_|0,U|0)|0,U=Me(B|0,Tt()|0,U|0)|0,(E|0)==15|(U|0)==0&(Tt()|0)==0)&&(!(Be[20528+x>>0]|0)||(x=_&8191,(y|0)==0&(x|0)==0)||(U=wn(y|0,x|0,0)|0,Tt()|0,(63-U|0)%3|0|0))||qp(y,_)|0?(U=1,U|0):(U=(ut(y,_)|0)!=0&1,U|0)}function hy(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0;if(k=Re(_|0,0,52)|0,B=Tt()|0,x=Re(x|0,0,45)|0,x=B|(Tt()|0)|134225919,(_|0)<1){B=-1,E=x,_=y,v[_>>2]=B,y=y+4|0,v[y>>2]=E;return}for(B=1,k=-1;U=(15-B|0)*3|0,$=Re(7,0,U|0)|0,x=x&~(Tt()|0),U=Re(E|0,0,U|0)|0,k=k&~$|U,x=x|(Tt()|0),(B|0)!=(_|0);)B=B+1|0;$=y,U=$,v[U>>2]=k,$=$+4|0,v[$>>2]=x}function Kp(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0;if(B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15,x>>>0>15)return E=4,E|0;if((B|0)<(x|0))return E=12,E|0;if((B|0)==(x|0))return v[E>>2]=y,v[E+4>>2]=_,E=0,E|0;if(k=Re(x|0,0,52)|0,k=k|y,y=Tt()|0|_&-15728641,(B|0)>(x|0))do _=Re(7,0,(14-x|0)*3|0)|0,x=x+1|0,k=_|k,y=Tt()|0|y;while((x|0)<(B|0));return v[E>>2]=k,v[E+4>>2]=y,E=0,E|0}function Qp(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0;if(B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15,!((x|0)<16&(B|0)<=(x|0)))return E=4,E|0;k=x-B|0,x=Me(y|0,_|0,45)|0,Tt()|0;t:do if(!(tn(x&127)|0))x=nh(7,0,k,((k|0)<0)<<31>>31)|0,k=Tt()|0;else{e:do if(B|0){for(x=1;U=Re(7,0,(15-x|0)*3|0)|0,!!((U&y|0)==0&((Tt()|0)&_|0)==0);)if(x>>>0<B>>>0)x=x+1|0;else break e;x=nh(7,0,k,((k|0)<0)<<31>>31)|0,k=Tt()|0;break t}while(!1);x=nh(7,0,k,((k|0)<0)<<31>>31)|0,x=Ee(x|0,Tt()|0,5,0)|0,x=Kt(x|0,Tt()|0,-5,-1)|0,x=Le(x|0,Tt()|0,6,0)|0,x=Kt(x|0,Tt()|0,1,0)|0,k=Tt()|0}while(!1);return U=E,v[U>>2]=x,v[U+4>>2]=k,U=0,U|0}function Ei(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;if(k=Me(y|0,_|0,45)|0,Tt()|0,!(tn(k&127)|0))return k=0,k|0;k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15;t:do if(!k)x=0;else for(E=1;;){if(x=Me(y|0,_|0,(15-E|0)*3|0)|0,Tt()|0,x=x&7,x|0)break t;if(E>>>0<k>>>0)E=E+1|0;else{x=0;break}}while(!1);return k=(x|0)==0&1,k|0}function _c(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0;if(U=bt,bt=bt+16|0,B=U,t0(B,y,_,x),_=B,y=v[_>>2]|0,_=v[_+4>>2]|0,(y|0)==0&(_|0)==0)return bt=U,0;k=0,x=0;do $=E+(k<<3)|0,v[$>>2]=y,v[$+4>>2]=_,k=Kt(k|0,x|0,1,0)|0,x=Tt()|0,py(B),$=B,y=v[$>>2]|0,_=v[$+4>>2]|0;while(!((y|0)==0&(_|0)==0));return bt=U,0}function sv(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,(E|0)<(x|0)?(x=_,E=y,ni(x|0),E|0):(x=Re(-1,-1,((E-x|0)*3|0)+3|0)|0,E=Re(~x|0,~(Tt()|0)|0,(15-E|0)*3|0)|0,x=~(Tt()|0)&_,E=~E&y,ni(x|0),E|0)}function ia(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0;return k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15,(x|0)<16&(k|0)<=(x|0)?((k|0)<(x|0)&&(k=Re(-1,-1,((x+-1-k|0)*3|0)+3|0)|0,k=Re(~k|0,~(Tt()|0)|0,(15-x|0)*3|0)|0,_=~(Tt()|0)&_,y=~k&y),k=Re(x|0,0,52)|0,x=_&-15728641|(Tt()|0),v[E>>2]=y|k,v[E+4>>2]=x,E=0,E|0):(E=4,E|0)}function Um(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0,Sr=0,We=0;if((x|0)==0&(E|0)==0)return We=0,We|0;if(k=y,B=v[k>>2]|0,k=v[k+4>>2]|0,!0&(k&15728640|0)==0){if(!((E|0)>0|(E|0)==0&x>>>0>0)||(We=_,v[We>>2]=B,v[We+4>>2]=k,(x|0)==1&(E|0)==0))return We=0,We|0;k=1,B=0;do Dr=y+(k<<3)|0,Sr=v[Dr+4>>2]|0,We=_+(k<<3)|0,v[We>>2]=v[Dr>>2],v[We+4>>2]=Sr,k=Kt(k|0,B|0,1,0)|0,B=Tt()|0;while((B|0)<(E|0)|(B|0)==(E|0)&k>>>0<x>>>0);return k=0,k|0}if(vi=x<<3,Sr=Wt(vi)|0,!Sr)return We=13,We|0;if(so(Sr|0,y|0,vi|0)|0,Dr=Xt(x,8)|0,!Dr)return It(Sr),We=13,We|0;t:for(;;){k=Sr,ot=v[k>>2]|0,k=v[k+4>>2]|0,Or=Me(ot|0,k|0,52)|0,Tt()|0,Or=Or&15,Yr=Or+-1|0,cr=(Or|0)!=0,br=(E|0)>0|(E|0)==0&x>>>0>0;e:do if(cr&br){if(se=Re(Yr|0,0,52)|0,ae=Tt()|0,Yr>>>0>15){if(!((ot|0)==0&(k|0)==0)){We=16;break t}for(B=0,y=0;;){if(B=Kt(B|0,y|0,1,0)|0,y=Tt()|0,!((y|0)<(E|0)|(y|0)==(E|0)&B>>>0<x>>>0))break e;if(U=Sr+(B<<3)|0,Ve=v[U>>2]|0,U=v[U+4>>2]|0,!((Ve|0)==0&(U|0)==0)){k=U,We=16;break t}}}for($=ot,y=k,B=0,U=0;;){if(!(($|0)==0&(y|0)==0)){if(!(!0&(y&117440512|0)==0)){We=21;break t}if(ht=Me($|0,y|0,52)|0,Tt()|0,ht=ht&15,(ht|0)<(Yr|0)){k=12,We=27;break t}if((ht|0)!=(Yr|0)&&($=$|se,y=y&-15728641|ae,ht>>>0>=Or>>>0)){Z=Yr;do Ve=Re(7,0,(14-Z|0)*3|0)|0,Z=Z+1|0,$=Ve|$,y=Tt()|0|y;while(Z>>>0<ht>>>0)}if(kt=ur($|0,y|0,x|0,E|0)|0,Ot=Tt()|0,Z=Dr+(kt<<3)|0,ht=Z,xt=v[ht>>2]|0,ht=v[ht+4>>2]|0,!((xt|0)==0&(ht|0)==0)){re=0,ye=0;do{if((re|0)>(E|0)|(re|0)==(E|0)&ye>>>0>x>>>0){We=31;break t}if((xt|0)==($|0)&(ht&-117440513|0)==(y|0)){Dt=Me(xt|0,ht|0,56)|0,Tt()|0,Dt=Dt&7,Zt=Dt+1|0,Ve=Me(xt|0,ht|0,45)|0,Tt()|0;r:do if(!(tn(Ve&127)|0))ht=7;else{if(xt=Me(xt|0,ht|0,52)|0,Tt()|0,xt=xt&15,!xt){ht=6;break}for(ht=1;;){if(Ve=Re(7,0,(15-ht|0)*3|0)|0,!((Ve&$|0)==0&((Tt()|0)&y|0)==0)){ht=7;break r}if(ht>>>0<xt>>>0)ht=ht+1|0;else{ht=6;break}}}while(!1);if((Dt+2|0)>>>0>ht>>>0){We=41;break t}Ve=Re(Zt|0,0,56)|0,y=Tt()|0|y&-117440513,Jt=Z,v[Jt>>2]=0,v[Jt+4>>2]=0,$=Ve|$}else kt=Kt(kt|0,Ot|0,1,0)|0,kt=sr(kt|0,Tt()|0,x|0,E|0)|0,Ot=Tt()|0;ye=Kt(ye|0,re|0,1,0)|0,re=Tt()|0,Z=Dr+(kt<<3)|0,ht=Z,xt=v[ht>>2]|0,ht=v[ht+4>>2]|0}while(!((xt|0)==0&(ht|0)==0))}Ve=Z,v[Ve>>2]=$,v[Ve+4>>2]=y}if(B=Kt(B|0,U|0,1,0)|0,U=Tt()|0,!((U|0)<(E|0)|(U|0)==(E|0)&B>>>0<x>>>0))break e;y=Sr+(B<<3)|0,$=v[y>>2]|0,y=v[y+4>>2]|0}}while(!1);if(Ve=Kt(x|0,E|0,5,0)|0,Jt=Tt()|0,Jt>>>0<0|(Jt|0)==0&Ve>>>0<11){We=85;break}if(Ve=Le(x|0,E|0,6,0)|0,Tt()|0,Ve=Xt(Ve,8)|0,!Ve){We=48;break}do if(br){for(Zt=0,y=0,Dt=0,re=0;;){if(ht=Dr+(Zt<<3)|0,U=ht,B=v[U>>2]|0,U=v[U+4>>2]|0,(B|0)==0&(U|0)==0)Jt=Dt;else{xt=Me(B|0,U|0,56)|0,Tt()|0,xt=xt&7,$=xt+1|0,kt=U&-117440513,Jt=Me(B|0,U|0,45)|0,Tt()|0;e:do if(tn(Jt&127)|0){if(Ot=Me(B|0,U|0,52)|0,Tt()|0,Ot=Ot&15,Ot|0)for(Z=1;;){if(Jt=Re(7,0,(15-Z|0)*3|0)|0,!((B&Jt|0)==0&(kt&(Tt()|0)|0)==0))break e;if(Z>>>0<Ot>>>0)Z=Z+1|0;else break}U=Re($|0,0,56)|0,B=U|B,U=Tt()|0|kt,$=ht,v[$>>2]=B,v[$+4>>2]=U,$=xt+2|0}while(!1);($|0)==7?(Jt=Ve+(y<<3)|0,v[Jt>>2]=B,v[Jt+4>>2]=U&-117440513,y=Kt(y|0,Dt|0,1,0)|0,Jt=Tt()|0):Jt=Dt}if(Zt=Kt(Zt|0,re|0,1,0)|0,re=Tt()|0,(re|0)<(E|0)|(re|0)==(E|0)&Zt>>>0<x>>>0)Dt=Jt;else break}if(br){if(ye=Yr>>>0>15,se=Re(Yr|0,0,52)|0,ae=Tt()|0,!cr){for(B=0,Z=0,$=0,U=0;(ot|0)==0&(k|0)==0||(Yr=_+(B<<3)|0,v[Yr>>2]=ot,v[Yr+4>>2]=k,B=Kt(B|0,Z|0,1,0)|0,Z=Tt()|0),$=Kt($|0,U|0,1,0)|0,U=Tt()|0,!!((U|0)<(E|0)|(U|0)==(E|0)&$>>>0<x>>>0);)k=Sr+($<<3)|0,ot=v[k>>2]|0,k=v[k+4>>2]|0;k=Jt;break}for(B=0,Z=0,U=0,$=0;;){do if(!((ot|0)==0&(k|0)==0)){if(Ot=Me(ot|0,k|0,52)|0,Tt()|0,Ot=Ot&15,ye|(Ot|0)<(Yr|0)){We=80;break t}if((Ot|0)!=(Yr|0)){if(ht=ot|se,xt=k&-15728641|ae,Ot>>>0>=Or>>>0){kt=Yr;do cr=Re(7,0,(14-kt|0)*3|0)|0,kt=kt+1|0,ht=cr|ht,xt=Tt()|0|xt;while(kt>>>0<Ot>>>0)}}else ht=ot,xt=k;Dt=ur(ht|0,xt|0,x|0,E|0)|0,kt=0,Ot=0,re=Tt()|0;do{if((kt|0)>(E|0)|(kt|0)==(E|0)&Ot>>>0>x>>>0){We=81;break t}if(cr=Dr+(Dt<<3)|0,Zt=v[cr+4>>2]|0,(Zt&-117440513|0)==(xt|0)&&(v[cr>>2]|0)==(ht|0)){We=65;break}cr=Kt(Dt|0,re|0,1,0)|0,Dt=sr(cr|0,Tt()|0,x|0,E|0)|0,re=Tt()|0,Ot=Kt(Ot|0,kt|0,1,0)|0,kt=Tt()|0,cr=Dr+(Dt<<3)|0}while(!((v[cr>>2]|0)==(ht|0)&&(v[cr+4>>2]|0)==(xt|0)));if((We|0)==65&&(We=0,!0&(Zt&117440512|0)==100663296))break;cr=_+(B<<3)|0,v[cr>>2]=ot,v[cr+4>>2]=k,B=Kt(B|0,Z|0,1,0)|0,Z=Tt()|0}while(!1);if(U=Kt(U|0,$|0,1,0)|0,$=Tt()|0,!(($|0)<(E|0)|($|0)==(E|0)&U>>>0<x>>>0))break;k=Sr+(U<<3)|0,ot=v[k>>2]|0,k=v[k+4>>2]|0}k=Jt}else B=0,k=Jt}else B=0,y=0,k=0;while(!1);if(pn(Dr|0,0,vi|0)|0,so(Sr|0,Ve|0,y<<3|0)|0,It(Ve),(y|0)==0&(k|0)==0){We=89;break}else _=_+(B<<3)|0,E=k,x=y}if((We|0)==16)!0&(k&117440512|0)==0?(k=4,We=27):We=21;else if((We|0)==31)Ur(27795,27122,620,27132);else{if((We|0)==41)return It(Sr),It(Dr),We=10,We|0;if((We|0)==48)return It(Sr),It(Dr),We=13,We|0;(We|0)==80?Ur(27795,27122,711,27132):(We|0)==81?Ur(27795,27122,723,27132):(We|0)==85&&(so(_|0,Sr|0,x<<3|0)|0,We=89)}return(We|0)==21?(It(Sr),It(Dr),We=5,We|0):(We|0)==27?(It(Sr),It(Dr),We=k,We|0):(We|0)==89?(It(Sr),It(Dr),We=0,We|0):0}function Al(y,_,x,E,k,B,U){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0,U=U|0;var $=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0;if(Zt=bt,bt=bt+16|0,Dt=Zt,!((x|0)>0|(x|0)==0&_>>>0>0))return Dt=0,bt=Zt,Dt|0;if((U|0)>=16)return Dt=12,bt=Zt,Dt|0;kt=0,Ot=0,xt=0,$=0;t:for(;;){if(ot=y+(kt<<3)|0,Z=v[ot>>2]|0,ot=v[ot+4>>2]|0,ht=Me(Z|0,ot|0,52)|0,Tt()|0,(ht&15|0)>(U|0)){$=12,Z=11;break}if(t0(Dt,Z,ot,U),ht=Dt,ot=v[ht>>2]|0,ht=v[ht+4>>2]|0,(ot|0)==0&(ht|0)==0)Z=xt;else{Z=xt;do{if(!(($|0)<(B|0)|($|0)==(B|0)&Z>>>0<k>>>0)){Z=10;break t}xt=E+(Z<<3)|0,v[xt>>2]=ot,v[xt+4>>2]=ht,Z=Kt(Z|0,$|0,1,0)|0,$=Tt()|0,py(Dt),xt=Dt,ot=v[xt>>2]|0,ht=v[xt+4>>2]|0}while(!((ot|0)==0&(ht|0)==0))}if(kt=Kt(kt|0,Ot|0,1,0)|0,Ot=Tt()|0,(Ot|0)<(x|0)|(Ot|0)==(x|0)&kt>>>0<_>>>0)xt=Z;else{$=0,Z=11;break}}return(Z|0)==10?(Dt=14,bt=Zt,Dt|0):(Z|0)==11?(bt=Zt,$|0):0}function Vm(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;kt=bt,bt=bt+16|0,xt=kt;t:do if((x|0)>0|(x|0)==0&_>>>0>0){for(ot=0,U=0,B=0,ht=0;;){if(Z=y+(ot<<3)|0,$=v[Z>>2]|0,Z=v[Z+4>>2]|0,!(($|0)==0&(Z|0)==0)&&(Z=(Qp($,Z,E,xt)|0)==0,$=xt,U=Kt(v[$>>2]|0,v[$+4>>2]|0,U|0,B|0)|0,B=Tt()|0,!Z)){B=12;break}if(ot=Kt(ot|0,ht|0,1,0)|0,ht=Tt()|0,!((ht|0)<(x|0)|(ht|0)==(x|0)&ot>>>0<_>>>0))break t}return bt=kt,B|0}else U=0,B=0;while(!1);return v[k>>2]=U,v[k+4>>2]=B,k=0,bt=kt,k|0}function vf(y,_){return y=y|0,_=_|0,_=Me(y|0,_|0,52)|0,Tt()|0,_&1|0}function Wa(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;if(k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15,!k)return k=0,k|0;for(E=1;;){if(x=Me(y|0,_|0,(15-E|0)*3|0)|0,Tt()|0,x=x&7,x|0){E=5;break}if(E>>>0<k>>>0)E=E+1|0;else{x=0,E=5;break}}return(E|0)==5?x|0:0}function av(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0;if(Z=Me(y|0,_|0,52)|0,Tt()|0,Z=Z&15,!Z)return $=_,Z=y,ni($|0),Z|0;for($=1,x=0;;){B=(15-$|0)*3|0,E=Re(7,0,B|0)|0,k=Tt()|0,U=Me(y|0,_|0,B|0)|0,Tt()|0,B=Re(Jh(U&7)|0,0,B|0)|0,U=Tt()|0,y=B|y&~E,_=U|_&~k;t:do if(!x)if((B&E|0)==0&(U&k|0)==0)x=0;else if(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,!E)x=1;else{x=1;e:for(;;){switch(U=Me(y|0,_|0,(15-x|0)*3|0)|0,Tt()|0,U&7){case 1:break e;case 0:break;default:{x=1;break t}}if(x>>>0<E>>>0)x=x+1|0;else{x=1;break t}}for(x=1;;)if(U=(15-x|0)*3|0,k=Me(y|0,_|0,U|0)|0,Tt()|0,B=Re(7,0,U|0)|0,_=_&~(Tt()|0),U=Re(Jh(k&7)|0,0,U|0)|0,y=y&~B|U,_=_|(Tt()|0),x>>>0<E>>>0)x=x+1|0;else{x=1;break}}while(!1);if($>>>0<Z>>>0)$=$+1|0;else break}return ni(_|0),y|0}function vc(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0;if(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,!E)return x=_,E=y,ni(x|0),E|0;for(x=1;B=(15-x|0)*3|0,U=Me(y|0,_|0,B|0)|0,Tt()|0,k=Re(7,0,B|0)|0,_=_&~(Tt()|0),B=Re(Jh(U&7)|0,0,B|0)|0,y=B|y&~k,_=Tt()|0|_,x>>>0<E>>>0;)x=x+1|0;return ni(_|0),y|0}function S2(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0;if(Z=Me(y|0,_|0,52)|0,Tt()|0,Z=Z&15,!Z)return $=_,Z=y,ni($|0),Z|0;for($=1,x=0;;){B=(15-$|0)*3|0,E=Re(7,0,B|0)|0,k=Tt()|0,U=Me(y|0,_|0,B|0)|0,Tt()|0,B=Re(ou(U&7)|0,0,B|0)|0,U=Tt()|0,y=B|y&~E,_=U|_&~k;t:do if(!x)if((B&E|0)==0&(U&k|0)==0)x=0;else if(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,!E)x=1;else{x=1;e:for(;;){switch(U=Me(y|0,_|0,(15-x|0)*3|0)|0,Tt()|0,U&7){case 1:break e;case 0:break;default:{x=1;break t}}if(x>>>0<E>>>0)x=x+1|0;else{x=1;break t}}for(x=1;;)if(k=(15-x|0)*3|0,B=Re(7,0,k|0)|0,U=_&~(Tt()|0),_=Me(y|0,_|0,k|0)|0,Tt()|0,_=Re(ou(_&7)|0,0,k|0)|0,y=y&~B|_,_=U|(Tt()|0),x>>>0<E>>>0)x=x+1|0;else{x=1;break}}while(!1);if($>>>0<Z>>>0)$=$+1|0;else break}return ni(_|0),y|0}function Jp(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0;if(E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,!E)return x=_,E=y,ni(x|0),E|0;for(x=1;U=(15-x|0)*3|0,B=Re(7,0,U|0)|0,k=_&~(Tt()|0),_=Me(y|0,_|0,U|0)|0,Tt()|0,_=Re(ou(_&7)|0,0,U|0)|0,y=_|y&~B,_=Tt()|0|k,x>>>0<E>>>0;)x=x+1|0;return ni(_|0),y|0}function jm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(Z=bt,bt=bt+64|0,$=Z+40|0,E=Z+24|0,k=Z+12|0,B=Z,Re(_|0,0,52)|0,x=Tt()|0|134225919,!_)return(v[y+4>>2]|0)>2||(v[y+8>>2]|0)>2||(v[y+12>>2]|0)>2?(U=0,$=0,ni(U|0),bt=Z,$|0):(Re(Af(y)|0,0,45)|0,U=Tt()|0|x,$=-1,ni(U|0),bt=Z,$|0);if(v[$>>2]=v[y>>2],v[$+4>>2]=v[y+4>>2],v[$+8>>2]=v[y+8>>2],v[$+12>>2]=v[y+12>>2],U=$+4|0,(_|0)>0)for(y=-1;v[E>>2]=v[U>>2],v[E+4>>2]=v[U+4>>2],v[E+8>>2]=v[U+8>>2],_&1?(yf(U),v[k>>2]=v[U>>2],v[k+4>>2]=v[U+4>>2],v[k+8>>2]=v[U+8>>2],Kh(k)):(Wp(U),v[k>>2]=v[U>>2],v[k+4>>2]=v[U+4>>2],v[k+8>>2]=v[U+8>>2],Xl(k)),$p(E,k,B),Fs(B),ht=(15-_|0)*3|0,ot=Re(7,0,ht|0)|0,x=x&~(Tt()|0),ht=Re(Zh(B)|0,0,ht|0)|0,y=ht|y&~ot,x=Tt()|0|x,(_|0)>1;)_=_+-1|0;else y=-1;t:do if((v[U>>2]|0)<=2&&(v[$+8>>2]|0)<=2&&(v[$+12>>2]|0)<=2){if(E=Af($)|0,_=Re(E|0,0,45)|0,_=_|y,y=Tt()|0|x&-1040385,B=Yl($)|0,!(tn(E)|0)){if((B|0)<=0)break;for(k=0;;){if(E=Me(_|0,y|0,52)|0,Tt()|0,E=E&15,E)for(x=1;ht=(15-x|0)*3|0,$=Me(_|0,y|0,ht|0)|0,Tt()|0,ot=Re(7,0,ht|0)|0,y=y&~(Tt()|0),ht=Re(Jh($&7)|0,0,ht|0)|0,_=_&~ot|ht,y=y|(Tt()|0),x>>>0<E>>>0;)x=x+1|0;if(k=k+1|0,(k|0)==(B|0))break t}}k=Me(_|0,y|0,52)|0,Tt()|0,k=k&15;e:do if(k){x=1;r:for(;;){switch(ht=Me(_|0,y|0,(15-x|0)*3|0)|0,Tt()|0,ht&7){case 1:break r;case 0:break;default:break e}if(x>>>0<k>>>0)x=x+1|0;else break e}if(ey(E,v[$>>2]|0)|0)for(x=1;$=(15-x|0)*3|0,ot=Re(7,0,$|0)|0,ht=y&~(Tt()|0),y=Me(_|0,y|0,$|0)|0,Tt()|0,y=Re(ou(y&7)|0,0,$|0)|0,_=_&~ot|y,y=ht|(Tt()|0),x>>>0<k>>>0;)x=x+1|0;else for(x=1;ht=(15-x|0)*3|0,$=Me(_|0,y|0,ht|0)|0,Tt()|0,ot=Re(7,0,ht|0)|0,y=y&~(Tt()|0),ht=Re(Jh($&7)|0,0,ht|0)|0,_=_&~ot|ht,y=y|(Tt()|0),x>>>0<k>>>0;)x=x+1|0}while(!1);if((B|0)>0){x=0;do _=av(_,y)|0,y=Tt()|0,x=x+1|0;while((x|0)!=(B|0))}}else _=0,y=0;while(!1);return ot=y,ht=_,ni(ot|0),bt=Z,ht|0}function bo(y){return y=y|0,(y|0)%2|0|0}function ir(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0;return k=bt,bt=bt+16|0,E=k,_>>>0>15?(E=4,bt=k,E|0):(v[y+4>>2]&2146435072|0)==2146435072||(v[y+8+4>>2]&2146435072|0)==2146435072?(E=3,bt=k,E|0):(Yp(y,_,E),_=jm(E,_)|0,E=Tt()|0,v[x>>2]=_,v[x+4>>2]=E,(_|0)==0&(E|0)==0&&Ur(27795,27122,1050,27145),E=0,bt=k,E|0)}function rd(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;if(k=x+4|0,B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15,U=Me(y|0,_|0,45)|0,Tt()|0,E=(B|0)==0,tn(U&127)|0){if(E)return U=1,U|0;E=1}else{if(E)return U=0,U|0;(v[k>>2]|0)==0&&(v[x+8>>2]|0)==0?E=(v[x+12>>2]|0)!=0&1:E=1}for(x=1;x&1?Kh(k):Xl(k),U=Me(y|0,_|0,(15-x|0)*3|0)|0,Tt()|0,oy(k,U&7),x>>>0<B>>>0;)x=x+1|0;return E|0}function id(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(ht=bt,bt=bt+16|0,Z=ht,ot=Me(y|0,_|0,45)|0,Tt()|0,ot=ot&127,ot>>>0>121)return v[x>>2]=0,v[x+4>>2]=0,v[x+8>>2]=0,v[x+12>>2]=0,ot=5,bt=ht,ot|0;t:do if((tn(ot)|0)!=0&&(B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15,(B|0)!=0)){E=1;e:for(;;){switch($=Me(y|0,_|0,(15-E|0)*3|0)|0,Tt()|0,$&7){case 5:break e;case 0:break;default:{E=_;break t}}if(E>>>0<B>>>0)E=E+1|0;else{E=_;break t}}for(k=1,E=_;_=(15-k|0)*3|0,U=Re(7,0,_|0)|0,$=E&~(Tt()|0),E=Me(y|0,E|0,_|0)|0,Tt()|0,E=Re(ou(E&7)|0,0,_|0)|0,y=y&~U|E,E=$|(Tt()|0),k>>>0<B>>>0;)k=k+1|0}else E=_;while(!1);if($=7696+(ot*28|0)|0,v[x>>2]=v[$>>2],v[x+4>>2]=v[$+4>>2],v[x+8>>2]=v[$+8>>2],v[x+12>>2]=v[$+12>>2],!(rd(y,E,x)|0))return ot=0,bt=ht,ot|0;if(U=x+4|0,v[Z>>2]=v[U>>2],v[Z+4>>2]=v[U+4>>2],v[Z+8>>2]=v[U+8>>2],B=Me(y|0,E|0,52)|0,Tt()|0,$=B&15,B&1?(Xl(U),B=$+1|0):B=$,!(tn(ot)|0))E=0;else{t:do if(!$)E=0;else for(_=1;;){if(k=Me(y|0,E|0,(15-_|0)*3|0)|0,Tt()|0,k=k&7,k|0){E=k;break t}if(_>>>0<$>>>0)_=_+1|0;else{E=0;break}}while(!1);E=(E|0)==4&1}if(!(ed(x,B,E,0)|0))(B|0)!=($|0)&&(v[U>>2]=v[Z>>2],v[U+4>>2]=v[Z+4>>2],v[U+8>>2]=v[Z+8>>2]);else{if(tn(ot)|0)do;while((ed(x,B,0,0)|0)!=0);(B|0)!=($|0)&&Wp(U)}return ot=0,bt=ht,ot|0}function nd(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;return B=bt,bt=bt+16|0,E=B,k=id(y,_,E)|0,k|0?(bt=B,k|0):(k=Me(y|0,_|0,52)|0,Tt()|0,T2(E,k&15,x),k=0,bt=B,k|0)}function su(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0;if(U=bt,bt=bt+16|0,B=U,E=id(y,_,B)|0,E|0)return B=E,bt=U,B|0;E=Me(y|0,_|0,45)|0,Tt()|0,E=(tn(E&127)|0)==0,k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15;t:do if(!E){if(k|0)for(E=1;;){if($=Re(7,0,(15-E|0)*3|0)|0,!(($&y|0)==0&((Tt()|0)&_|0)==0))break t;if(E>>>0<k>>>0)E=E+1|0;else break}return cy(B,k,0,5,x),$=0,bt=U,$|0}while(!1);return _f(B,k,0,6,x),$=0,bt=U,$|0}function ih(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;if(k=Me(y|0,_|0,45)|0,Tt()|0,!(tn(k&127)|0))return k=2,v[x>>2]=k,0;if(k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15,!k)return k=5,v[x>>2]=k,0;for(E=1;;){if(B=Re(7,0,(15-E|0)*3|0)|0,!((B&y|0)==0&((Tt()|0)&_|0)==0)){E=2,y=6;break}if(E>>>0<k>>>0)E=E+1|0;else{E=5,y=6;break}}return(y|0)==6&&(v[x>>2]=E),0}function dy(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0;xt=bt,bt=bt+128|0,ot=xt+112|0,B=xt+96|0,ht=xt,k=Me(y|0,_|0,52)|0,Tt()|0,$=k&15,v[ot>>2]=$,U=Me(y|0,_|0,45)|0,Tt()|0,U=U&127;t:do if(tn(U)|0){if($|0)for(E=1;;){if(Z=Re(7,0,(15-E|0)*3|0)|0,!((Z&y|0)==0&((Tt()|0)&_|0)==0)){k=0;break t}if(E>>>0<$>>>0)E=E+1|0;else break}if(k&1)k=1;else return Z=Re($+1|0,0,52)|0,ht=Tt()|0|_&-15728641,ot=Re(7,0,(14-$|0)*3|0)|0,ht=dy((Z|y)&~ot,ht&~(Tt()|0),x)|0,bt=xt,ht|0}else k=0;while(!1);if(E=id(y,_,B)|0,!E){k?(rv(B,ot,ht),Z=5):(iv(B,ot,ht),Z=6);t:do if(tn(U)|0)if(!$)y=5;else for(E=1;;){if(U=Re(7,0,(15-E|0)*3|0)|0,!((U&y|0)==0&((Tt()|0)&_|0)==0)){y=2;break t}if(E>>>0<$>>>0)E=E+1|0;else{y=5;break}}else y=2;while(!1);pn(x|0,-1,y<<2|0)|0;t:do if(k)for(B=0;;){if(U=ht+(B<<4)|0,rh(U,v[ot>>2]|0)|0,U=v[U>>2]|0,$=v[x>>2]|0,($|0)==-1|($|0)==(U|0))E=x;else{k=0;do{if(k=k+1|0,k>>>0>=y>>>0){E=1;break t}E=x+(k<<2)|0,$=v[E>>2]|0}while(!(($|0)==-1|($|0)==(U|0)))}if(v[E>>2]=U,B=B+1|0,B>>>0>=Z>>>0){E=0;break}}else for(B=0;;){if(U=ht+(B<<4)|0,ed(U,v[ot>>2]|0,0,1)|0,U=v[U>>2]|0,$=v[x>>2]|0,($|0)==-1|($|0)==(U|0))E=x;else{k=0;do{if(k=k+1|0,k>>>0>=y>>>0){E=1;break t}E=x+(k<<2)|0,$=v[E>>2]|0}while(!(($|0)==-1|($|0)==(U|0)))}if(v[E>>2]=U,B=B+1|0,B>>>0>=Z>>>0){E=0;break}}while(!1)}return ht=E,bt=xt,ht|0}function PM(){return 12}function od(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0;if(y>>>0>15)return $=4,$|0;if(Re(y|0,0,52)|0,$=Tt()|0|134225919,!y){x=0,E=0;do tn(E)|0&&(Re(E|0,0,45)|0,U=$|(Tt()|0),y=_+(x<<3)|0,v[y>>2]=-1,v[y+4>>2]=U,x=x+1|0),E=E+1|0;while((E|0)!=122);return x=0,x|0}x=0,U=0;do{if(tn(U)|0){for(Re(U|0,0,45)|0,E=1,k=-1,B=$|(Tt()|0);Z=Re(7,0,(15-E|0)*3|0)|0,k=k&~Z,B=B&~(Tt()|0),(E|0)!=(y|0);)E=E+1|0;Z=_+(x<<3)|0,v[Z>>2]=k,v[Z+4>>2]=B,x=x+1|0}U=U+1|0}while((U|0)!=122);return x=0,x|0}function M2(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0;if(se=bt,bt=bt+16|0,re=se,ye=Me(y|0,_|0,52)|0,Tt()|0,ye=ye&15,x>>>0>15)return ye=4,bt=se,ye|0;if((ye|0)<(x|0))return ye=12,bt=se,ye|0;if((ye|0)!=(x|0))if(B=Re(x|0,0,52)|0,B=B|y,$=Tt()|0|_&-15728641,(ye|0)>(x|0)){Z=x;do Zt=Re(7,0,(14-Z|0)*3|0)|0,Z=Z+1|0,B=Zt|B,$=Tt()|0|$;while((Z|0)<(ye|0));Zt=B}else Zt=B;else Zt=y,$=_;Dt=Me(Zt|0,$|0,45)|0,Tt()|0;t:do if(tn(Dt&127)|0){if(Z=Me(Zt|0,$|0,52)|0,Tt()|0,Z=Z&15,Z|0)for(B=1;;){if(Dt=Re(7,0,(15-B|0)*3|0)|0,!((Dt&Zt|0)==0&((Tt()|0)&$|0)==0)){ot=33;break t}if(B>>>0<Z>>>0)B=B+1|0;else break}if(Dt=E,v[Dt>>2]=0,v[Dt+4>>2]=0,(ye|0)>(x|0)){for(Dt=_&-15728641,Ot=ye;;){if(kt=Ot,Ot=Ot+-1|0,Ot>>>0>15|(ye|0)<(Ot|0)){ot=19;break}if((ye|0)!=(Ot|0))if(B=Re(Ot|0,0,52)|0,B=B|y,Z=Tt()|0|Dt,(ye|0)<(kt|0))xt=B;else{ot=Ot;do xt=Re(7,0,(14-ot|0)*3|0)|0,ot=ot+1|0,B=xt|B,Z=Tt()|0|Z;while((ot|0)<(ye|0));xt=B}else xt=y,Z=_;if(ht=Me(xt|0,Z|0,45)|0,Tt()|0,!(tn(ht&127)|0))B=0;else{ht=Me(xt|0,Z|0,52)|0,Tt()|0,ht=ht&15;e:do if(!ht)B=0;else for(ot=1;;){if(B=Me(xt|0,Z|0,(15-ot|0)*3|0)|0,Tt()|0,B=B&7,B|0)break e;if(ot>>>0<ht>>>0)ot=ot+1|0;else{B=0;break}}while(!1);B=(B|0)==0&1}if(Z=Me(y|0,_|0,(15-kt|0)*3|0)|0,Tt()|0,Z=Z&7,(Z|0)==7){k=5,ot=42;break}if(B=(B|0)!=0,(Z|0)==1&B){k=5,ot=42;break}if(xt=Z+(((Z|0)!=0&B)<<31>>31)|0,xt|0&&(ot=ye-kt|0,ot=nh(7,0,ot,((ot|0)<0)<<31>>31)|0,ht=Tt()|0,B?(B=Ee(ot|0,ht|0,5,0)|0,B=Kt(B|0,Tt()|0,-5,-1)|0,B=Le(B|0,Tt()|0,6,0)|0,B=Kt(B|0,Tt()|0,1,0)|0,Z=Tt()|0):(B=ot,Z=ht),kt=xt+-1|0,kt=Ee(ot|0,ht|0,kt|0,((kt|0)<0)<<31>>31|0)|0,kt=Kt(B|0,Z|0,kt|0,Tt()|0)|0,xt=Tt()|0,ht=E,ht=Kt(kt|0,xt|0,v[ht>>2]|0,v[ht+4>>2]|0)|0,xt=Tt()|0,kt=E,v[kt>>2]=ht,v[kt+4>>2]=xt),(Ot|0)<=(x|0)){ot=37;break}}if((ot|0)==19)Ur(27795,27122,1367,27158);else if((ot|0)==37){U=E,k=v[U+4>>2]|0,U=v[U>>2]|0;break}else if((ot|0)==42)return bt=se,k|0}else k=0,U=0}else ot=33;while(!1);t:do if((ot|0)==33)if(Dt=E,v[Dt>>2]=0,v[Dt+4>>2]=0,(ye|0)>(x|0)){for(B=ye;;){if(k=Me(y|0,_|0,(15-B|0)*3|0)|0,Tt()|0,k=k&7,(k|0)==7){k=5;break}if(U=ye-B|0,U=nh(7,0,U,((U|0)<0)<<31>>31)|0,k=Ee(U|0,Tt()|0,k|0,0)|0,U=Tt()|0,Dt=E,U=Kt(v[Dt>>2]|0,v[Dt+4>>2]|0,k|0,U|0)|0,k=Tt()|0,Dt=E,v[Dt>>2]=U,v[Dt+4>>2]=k,B=B+-1|0,(B|0)<=(x|0))break t}return bt=se,k|0}else k=0,U=0;while(!1);return Qp(Zt,$,ye,re)|0&&Ur(27795,27122,1327,27173),ye=re,re=v[ye+4>>2]|0,((k|0)>-1|(k|0)==-1&U>>>0>4294967295)&((re|0)>(k|0)|((re|0)==(k|0)?(v[ye>>2]|0)>>>0>U>>>0:0))?(ye=0,bt=se,ye|0):(Ur(27795,27122,1407,27158),0)}function $m(y,_,x,E,k,B){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0;var U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0;if(xt=bt,bt=bt+16|0,U=xt,k>>>0>15)return B=4,bt=xt,B|0;if($=Me(x|0,E|0,52)|0,Tt()|0,$=$&15,($|0)>(k|0))return B=12,bt=xt,B|0;if(Qp(x,E,k,U)|0&&Ur(27795,27122,1327,27173),ht=U,ot=v[ht+4>>2]|0,!(((_|0)>-1|(_|0)==-1&y>>>0>4294967295)&((ot|0)>(_|0)|((ot|0)==(_|0)?(v[ht>>2]|0)>>>0>y>>>0:0))))return B=2,bt=xt,B|0;ht=k-$|0,k=Re(k|0,0,52)|0,Z=Tt()|0|E&-15728641,ot=B,v[ot>>2]=k|x,v[ot+4>>2]=Z,ot=Me(x|0,E|0,45)|0,Tt()|0;t:do if(tn(ot&127)|0){if($|0)for(U=1;;){if(ot=Re(7,0,(15-U|0)*3|0)|0,!((ot&x|0)==0&((Tt()|0)&E|0)==0))break t;if(U>>>0<$>>>0)U=U+1|0;else break}if((ht|0)<1)return B=0,bt=xt,B|0;for(ot=$^15,E=-1,Z=1,U=1;;){$=ht-Z|0,$=nh(7,0,$,(($|0)<0)<<31>>31)|0,x=Tt()|0;do if(U)if(U=Ee($|0,x|0,5,0)|0,U=Kt(U|0,Tt()|0,-5,-1)|0,U=Le(U|0,Tt()|0,6,0)|0,k=Tt()|0,(_|0)>(k|0)|(_|0)==(k|0)&y>>>0>U>>>0){_=Kt(y|0,_|0,-1,-1)|0,_=de(_|0,Tt()|0,U|0,k|0)|0,U=Tt()|0,kt=B,Dt=v[kt>>2]|0,kt=v[kt+4>>2]|0,Zt=(ot+E|0)*3|0,Ot=Re(7,0,Zt|0)|0,kt=kt&~(Tt()|0),E=Le(_|0,U|0,$|0,x|0)|0,y=Tt()|0,k=Kt(E|0,y|0,2,0)|0,Zt=Re(k|0,Tt()|0,Zt|0)|0,kt=Tt()|0|kt,k=B,v[k>>2]=Zt|Dt&~Ot,v[k+4>>2]=kt,y=Ee(E|0,y|0,$|0,x|0)|0,y=de(_|0,U|0,y|0,Tt()|0)|0,U=0,_=Tt()|0;break}else{Zt=B,Ot=v[Zt>>2]|0,Zt=v[Zt+4>>2]|0,Dt=Re(7,0,(ot+E|0)*3|0)|0,Zt=Zt&~(Tt()|0),U=B,v[U>>2]=Ot&~Dt,v[U+4>>2]=Zt,U=1;break}else Ot=B,k=v[Ot>>2]|0,Ot=v[Ot+4>>2]|0,E=(ot+E|0)*3|0,kt=Re(7,0,E|0)|0,Ot=Ot&~(Tt()|0),Zt=Le(y|0,_|0,$|0,x|0)|0,U=Tt()|0,E=Re(Zt|0,U|0,E|0)|0,Ot=Tt()|0|Ot,Dt=B,v[Dt>>2]=E|k&~kt,v[Dt+4>>2]=Ot,U=Ee(Zt|0,U|0,$|0,x|0)|0,y=de(y|0,_|0,U|0,Tt()|0)|0,U=0,_=Tt()|0;while(!1);if((ht|0)>(Z|0))E=~Z,Z=Z+1|0;else{_=0;break}}return bt=xt,_|0}while(!1);if((ht|0)<1)return Zt=0,bt=xt,Zt|0;for(k=$^15,U=1;;)if(Dt=ht-U|0,Dt=nh(7,0,Dt,((Dt|0)<0)<<31>>31)|0,Zt=Tt()|0,Z=B,x=v[Z>>2]|0,Z=v[Z+4>>2]|0,$=(k-U|0)*3|0,E=Re(7,0,$|0)|0,Z=Z&~(Tt()|0),kt=Le(y|0,_|0,Dt|0,Zt|0)|0,Ot=Tt()|0,$=Re(kt|0,Ot|0,$|0)|0,Z=Tt()|0|Z,ot=B,v[ot>>2]=$|x&~E,v[ot+4>>2]=Z,Zt=Ee(kt|0,Ot|0,Dt|0,Zt|0)|0,y=de(y|0,_|0,Zt|0,Tt()|0)|0,_=Tt()|0,(ht|0)<=(U|0)){_=0;break}else U=U+1|0;return bt=xt,_|0}function t0(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0;k=Me(_|0,x|0,52)|0,Tt()|0,k=k&15,(_|0)==0&(x|0)==0|((E|0)>15|(k|0)>(E|0))?(B=-1,_=-1,x=0,k=0):(_=sv(_,x,k+1|0,E)|0,U=(Tt()|0)&-15728641,x=Re(E|0,0,52)|0,x=_|x,U=U|(Tt()|0),_=(Ei(x,U)|0)==0,B=k,_=_?-1:E,k=U),U=y,v[U>>2]=x,v[U+4>>2]=k,v[y+8>>2]=B,v[y+12>>2]=_}function fy(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0;if(k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15,B=E+8|0,v[B>>2]=k,(y|0)==0&(_|0)==0|((x|0)>15|(k|0)>(x|0))){x=E,v[x>>2]=0,v[x+4>>2]=0,v[B>>2]=-1,v[E+12>>2]=-1;return}if(y=sv(y,_,k+1|0,x)|0,B=(Tt()|0)&-15728641,k=Re(x|0,0,52)|0,k=y|k,B=B|(Tt()|0),y=E,v[y>>2]=k,v[y+4>>2]=B,y=E+12|0,Ei(k,B)|0){v[y>>2]=x;return}else{v[y>>2]=-1;return}}function py(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0;if(x=y,_=v[x>>2]|0,x=v[x+4>>2]|0,!((_|0)==0&(x|0)==0)&&(E=Me(_|0,x|0,52)|0,Tt()|0,E=E&15,$=Re(1,0,(E^15)*3|0)|0,_=Kt($|0,Tt()|0,_|0,x|0)|0,x=Tt()|0,$=y,v[$>>2]=_,v[$+4>>2]=x,$=y+8|0,U=v[$>>2]|0,!((E|0)<(U|0)))){for(Z=y+12|0,B=E;;){if((B|0)==(U|0)){E=5;break}if(ot=(B|0)==(v[Z>>2]|0),k=(15-B|0)*3|0,E=Me(_|0,x|0,k|0)|0,Tt()|0,E=E&7,ot&((E|0)==1&!0)){E=7;break}if(!((E|0)==7&!0)){E=10;break}if(ot=Re(1,0,k|0)|0,_=Kt(_|0,x|0,ot|0,Tt()|0)|0,x=Tt()|0,ot=y,v[ot>>2]=_,v[ot+4>>2]=x,(B|0)>(U|0))B=B+-1|0;else{E=10;break}}if((E|0)==5){ot=y,v[ot>>2]=0,v[ot+4>>2]=0,v[$>>2]=-1,v[Z>>2]=-1;return}else if((E|0)==7){U=Re(1,0,k|0)|0,U=Kt(_|0,x|0,U|0,Tt()|0)|0,$=Tt()|0,ot=y,v[ot>>2]=U,v[ot+4>>2]=$,v[Z>>2]=B+-1;return}else if((E|0)==10)return}}function e0(y){y=+y;var _=0;return _=y<0?y+6.283185307179586:y,+(y>=6.283185307179586?_+-6.283185307179586:_)}function sd(y,_){return y=y|0,_=_|0,+Bi(+(+_t[y>>3]-+_t[_>>3]))<17453292519943298e-27?(_=+Bi(+(+_t[y+8>>3]-+_t[_+8>>3]))<17453292519943298e-27,_|0):(_=0,_|0)}function xa(y,_){switch(y=+y,_=_|0,_|0){case 1:{y=y<0?y+6.283185307179586:y;break}case 2:{y=y>0?y+-6.283185307179586:y;break}default:}return+y}function lv(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;return k=+_t[_>>3],E=+_t[y>>3],B=+Zi(+((k-E)*.5)),x=+Zi(+((+_t[_+8>>3]-+_t[y+8>>3])*.5)),x=B*B+x*(+Di(+k)*+Di(+E)*x),+(+ml(+ +un(+x),+ +un(+(1-x)))*2)}function Gm(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;return k=+_t[_>>3],E=+_t[y>>3],B=+Zi(+((k-E)*.5)),x=+Zi(+((+_t[_+8>>3]-+_t[y+8>>3])*.5)),x=B*B+x*(+Di(+k)*+Di(+E)*x),+(+ml(+ +un(+x),+ +un(+(1-x)))*2*6371.007180918475)}function E2(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;return k=+_t[_>>3],E=+_t[y>>3],B=+Zi(+((k-E)*.5)),x=+Zi(+((+_t[_+8>>3]-+_t[y+8>>3])*.5)),x=B*B+x*(+Di(+k)*+Di(+E)*x),+(+ml(+ +un(+x),+ +un(+(1-x)))*2*6371.007180918475*1e3)}function ad(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0;return B=+_t[_>>3],E=+Di(+B),k=+_t[_+8>>3]-+_t[y+8>>3],U=E*+Zi(+k),x=+_t[y>>3],+ +ml(+U,+(+Zi(+B)*+Di(+x)-+Di(+k)*(E*+Zi(+x))))}function hn(y,_,x,E){y=y|0,_=+_,x=+x,E=E|0;var k=0,B=0,U=0,$=0;if(x<1e-16){v[E>>2]=v[y>>2],v[E+4>>2]=v[y+4>>2],v[E+8>>2]=v[y+8>>2],v[E+12>>2]=v[y+12>>2];return}B=_<0?_+6.283185307179586:_,B=_>=6.283185307179586?B+-6.283185307179586:B;do if(B<1e-16)_=+_t[y>>3]+x,_t[E>>3]=_,k=E;else{if(k=+Bi(+(B+-3.141592653589793))<1e-16,_=+_t[y>>3],k){_=_-x,_t[E>>3]=_,k=E;break}if(U=+Di(+x),x=+Zi(+x),_=U*+Zi(+_)+ +Di(+B)*(x*+Di(+_)),_=_>1?1:_,_=+u2(+(_<-1?-1:_)),_t[E>>3]=_,+Bi(+(_+-1.5707963267948966))<1e-16){_t[E>>3]=1.5707963267948966,_t[E+8>>3]=0;return}if(+Bi(+(_+1.5707963267948966))<1e-16){_t[E>>3]=-1.5707963267948966,_t[E+8>>3]=0;return}if($=1/+Di(+_),B=x*+Zi(+B)*$,x=+_t[y>>3],_=$*((U-+Zi(+_)*+Zi(+x))/+Di(+x)),U=B>1?1:B,_=_>1?1:_,_=+_t[y+8>>3]+ +ml(+(U<-1?-1:U),+(_<-1?-1:_)),_>3.141592653589793)do _=_+-6.283185307179586;while(_>3.141592653589793);if(_<-3.141592653589793)do _=_+6.283185307179586;while(_<-3.141592653589793);_t[E+8>>3]=_;return}while(!1);if(+Bi(+(_+-1.5707963267948966))<1e-16){_t[k>>3]=1.5707963267948966,_t[E+8>>3]=0;return}if(+Bi(+(_+1.5707963267948966))<1e-16){_t[k>>3]=-1.5707963267948966,_t[E+8>>3]=0;return}if(_=+_t[y+8>>3],_>3.141592653589793)do _=_+-6.283185307179586;while(_>3.141592653589793);if(_<-3.141592653589793)do _=_+6.283185307179586;while(_<-3.141592653589793);_t[E+8>>3]=_}function P2(y,_){return y=y|0,_=_|0,y>>>0>15?(_=4,_|0):(_t[_>>3]=+_t[20656+(y<<3)>>3],_=0,_|0)}function Wm(y,_){return y=y|0,_=_|0,y>>>0>15?(_=4,_|0):(_t[_>>3]=+_t[20784+(y<<3)>>3],_=0,_|0)}function qm(y,_){return y=y|0,_=_|0,y>>>0>15?(_=4,_|0):(_t[_>>3]=+_t[20912+(y<<3)>>3],_=0,_|0)}function cv(y,_){return y=y|0,_=_|0,y>>>0>15?(_=4,_|0):(_t[_>>3]=+_t[21040+(y<<3)>>3],_=0,_|0)}function Hm(y,_){y=y|0,_=_|0;var x=0;return y>>>0>15?(_=4,_|0):(x=nh(7,0,y,((y|0)<0)<<31>>31)|0,x=Ee(x|0,Tt()|0,120,0)|0,y=Tt()|0,v[_>>2]=x|2,v[_+4>>2]=y,_=0,_|0)}function my(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;return kt=+_t[_>>3],ht=+_t[y>>3],Z=+Zi(+((kt-ht)*.5)),B=+_t[_+8>>3],ot=+_t[y+8>>3],U=+Zi(+((B-ot)*.5)),$=+Di(+ht),xt=+Di(+kt),U=Z*Z+U*(xt*$*U),U=+ml(+ +un(+U),+ +un(+(1-U)))*2,Z=+_t[x>>3],kt=+Zi(+((Z-kt)*.5)),E=+_t[x+8>>3],B=+Zi(+((E-B)*.5)),k=+Di(+Z),B=kt*kt+B*(xt*k*B),B=+ml(+ +un(+B),+ +un(+(1-B)))*2,Z=+Zi(+((ht-Z)*.5)),E=+Zi(+((ot-E)*.5)),E=Z*Z+E*($*k*E),E=+ml(+ +un(+E),+ +un(+(1-E)))*2,k=(U+B+E)*.5,+(+XA(+ +un(+(+pf(+(k*.5))*+pf(+((k-U)*.5))*+pf(+((k-B)*.5))*+pf(+((k-E)*.5)))))*4)}function Ym(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0;if($=bt,bt=bt+192|0,B=$+168|0,U=$,k=nd(y,_,B)|0,k|0)return x=k,bt=$,x|0;if(su(y,_,U)|0&&Ur(27795,27190,415,27199),_=v[U>>2]|0,(_|0)>0){if(E=+my(U+8|0,U+8+(((_|0)!=1&1)<<4)|0,B)+0,(_|0)!=1){y=1;do k=y,y=y+1|0,E=E+ +my(U+8+(k<<4)|0,U+8+(((y|0)%(_|0)|0)<<4)|0,B);while((y|0)<(_|0))}}else E=0;return _t[x>>3]=E,x=0,bt=$,x|0}function C2(y,_,x){return y=y|0,_=_|0,x=x|0,y=Ym(y,_,x)|0,y|0||(_t[x>>3]=+_t[x>>3]*6371.007180918475*6371.007180918475),y|0}function bc(y,_,x){return y=y|0,_=_|0,x=x|0,y=Ym(y,_,x)|0,y|0||(_t[x>>3]=+_t[x>>3]*6371.007180918475*6371.007180918475*1e3*1e3),y|0}function bf(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if($=bt,bt=bt+176|0,U=$,y=yc(y,_,U)|0,y|0)return U=y,bt=$,U|0;if(_t[x>>3]=0,y=v[U>>2]|0,(y|0)<=1)return U=0,bt=$,U|0;_=y+-1|0,y=0,E=+_t[U+8>>3],k=+_t[U+16>>3],B=0;do y=y+1|0,ot=E,E=+_t[U+8+(y<<4)>>3],ht=+Zi(+((E-ot)*.5)),Z=k,k=+_t[U+8+(y<<4)+8>>3],Z=+Zi(+((k-Z)*.5)),Z=ht*ht+Z*(+Di(+E)*+Di(+ot)*Z),B=B+ +ml(+ +un(+Z),+ +un(+(1-Z)))*2;while((y|0)<(_|0));return _t[x>>3]=B,U=0,bt=$,U|0}function fr(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if($=bt,bt=bt+176|0,U=$,y=yc(y,_,U)|0,y|0)return U=y,B=+_t[x>>3],B=B*6371.007180918475,_t[x>>3]=B,bt=$,U|0;if(_t[x>>3]=0,y=v[U>>2]|0,(y|0)<=1)return U=0,B=0,B=B*6371.007180918475,_t[x>>3]=B,bt=$,U|0;_=y+-1|0,y=0,E=+_t[U+8>>3],k=+_t[U+16>>3],B=0;do y=y+1|0,ot=E,E=+_t[U+8+(y<<4)>>3],ht=+Zi(+((E-ot)*.5)),Z=k,k=+_t[U+8+(y<<4)+8>>3],Z=+Zi(+((k-Z)*.5)),Z=ht*ht+Z*(+Di(+ot)*+Di(+E)*Z),B=B+ +ml(+ +un(+Z),+ +un(+(1-Z)))*2;while((y|0)!=(_|0));return _t[x>>3]=B,U=0,ht=B,ht=ht*6371.007180918475,_t[x>>3]=ht,bt=$,U|0}function Mr(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if($=bt,bt=bt+176|0,U=$,y=yc(y,_,U)|0,y|0)return U=y,B=+_t[x>>3],B=B*6371.007180918475,B=B*1e3,_t[x>>3]=B,bt=$,U|0;if(_t[x>>3]=0,y=v[U>>2]|0,(y|0)<=1)return U=0,B=0,B=B*6371.007180918475,B=B*1e3,_t[x>>3]=B,bt=$,U|0;_=y+-1|0,y=0,E=+_t[U+8>>3],k=+_t[U+16>>3],B=0;do y=y+1|0,ot=E,E=+_t[U+8+(y<<4)>>3],ht=+Zi(+((E-ot)*.5)),Z=k,k=+_t[U+8+(y<<4)+8>>3],Z=+Zi(+((k-Z)*.5)),Z=ht*ht+Z*(+Di(+ot)*+Di(+E)*Z),B=B+ +ml(+ +un(+Z),+ +un(+(1-Z)))*2;while((y|0)!=(_|0));return _t[x>>3]=B,U=0,ht=B,ht=ht*6371.007180918475,ht=ht*1e3,_t[x>>3]=ht,bt=$,U|0}function Xm(y){y=y|0;var _=0,x=0,E=0;return _=Xt(1,12)|0,_||Ur(27280,27235,49,27293),x=y+4|0,E=v[x>>2]|0,E|0?(E=E+8|0,v[E>>2]=_,v[x>>2]=_,_|0):(v[y>>2]|0&&Ur(27310,27235,61,27333),E=y,v[E>>2]=_,v[x>>2]=_,_|0)}function I2(y,_){y=y|0,_=_|0;var x=0,E=0;return E=Wt(24)|0,E||Ur(27347,27235,78,27361),v[E>>2]=v[_>>2],v[E+4>>2]=v[_+4>>2],v[E+8>>2]=v[_+8>>2],v[E+12>>2]=v[_+12>>2],v[E+16>>2]=0,_=y+4|0,x=v[_>>2]|0,x|0?(v[x+16>>2]=E,v[_>>2]=E,E|0):(v[y>>2]|0&&Ur(27376,27235,82,27361),v[y>>2]=E,v[_>>2]=E,E|0)}function r0(y){y=y|0;var _=0,x=0,E=0,k=0;if(y)for(E=1;;){if(_=v[y>>2]|0,_|0)do{if(x=v[_>>2]|0,x|0)do k=x,x=v[x+16>>2]|0,It(k);while((x|0)!=0);k=_,_=v[_+8>>2]|0,It(k)}while((_|0)!=0);if(_=y,y=v[y+8>>2]|0,E||It(_),y)E=0;else break}}function na(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0,Yr=0,vi=0,Dr=0,Sr=0,We=0,Ai=0,Tn=0,ci=0;if(k=y+8|0,v[k>>2]|0)return ci=1,ci|0;if(E=v[y>>2]|0,!E)return ci=0,ci|0;_=E,x=0;do x=x+1|0,_=v[_+8>>2]|0;while((_|0)!=0);if(x>>>0<2)return ci=0,ci|0;Ai=Wt(x<<2)|0,Ai||Ur(27396,27235,317,27415),We=Wt(x<<5)|0,We||Ur(27437,27235,321,27415),v[y>>2]=0,br=y+4|0,v[br>>2]=0,v[k>>2]=0,x=0,Sr=0,Ve=0,xt=0;t:for(;;){if(ht=v[E>>2]|0,ht){B=0,U=ht;do{if(Z=+_t[U+8>>3],_=U,U=v[U+16>>2]|0,ot=(U|0)==0,k=ot?ht:U,$=+_t[k+8>>3],+Bi(+(Z-$))>3.141592653589793){ci=14;break}B=B+($-Z)*(+_t[_>>3]+ +_t[k>>3])}while(!ot);if((ci|0)==14){ci=0,B=0,_=ht;do Jt=+_t[_+8>>3],Dr=_+16|0,vi=v[Dr>>2]|0,vi=(vi|0)==0?ht:vi,ae=+_t[vi+8>>3],B=B+(+_t[_>>3]+ +_t[vi>>3])*((ae<0?ae+6.283185307179586:ae)-(Jt<0?Jt+6.283185307179586:Jt)),_=v[((_|0)==0?E:Dr)>>2]|0;while((_|0)!=0)}B>0?(v[Ai+(Sr<<2)>>2]=E,Sr=Sr+1|0,k=Ve,_=xt):ci=19}else ci=19;if((ci|0)==19){ci=0;do if(x){if(_=x+8|0,v[_>>2]|0){ci=21;break t}if(x=Xt(1,12)|0,!x){ci=23;break t}v[_>>2]=x,k=x+4|0,U=x,_=xt}else if(xt){k=br,U=xt+8|0,_=E,x=y;break}else if(v[y>>2]|0){ci=27;break t}else{k=br,U=y,_=E,x=y;break}while(!1);if(v[U>>2]=E,v[k>>2]=E,U=We+(Ve<<5)|0,ot=v[E>>2]|0,ot){for(ht=We+(Ve<<5)+8|0,_t[ht>>3]=17976931348623157e292,xt=We+(Ve<<5)+24|0,_t[xt>>3]=17976931348623157e292,_t[U>>3]=-17976931348623157e292,kt=We+(Ve<<5)+16|0,_t[kt>>3]=-17976931348623157e292,ye=17976931348623157e292,se=-17976931348623157e292,k=0,Ot=ot,Z=17976931348623157e292,Zt=17976931348623157e292,re=-17976931348623157e292,$=-17976931348623157e292;B=+_t[Ot>>3],Jt=+_t[Ot+8>>3],Ot=v[Ot+16>>2]|0,Dt=(Ot|0)==0,ae=+_t[(Dt?ot:Ot)+8>>3],B<Z&&(_t[ht>>3]=B,Z=B),Jt<Zt&&(_t[xt>>3]=Jt,Zt=Jt),B>re?_t[U>>3]=B:B=re,Jt>$&&(_t[kt>>3]=Jt,$=Jt),ye=Jt>0&Jt<ye?Jt:ye,se=Jt<0&Jt>se?Jt:se,k=k|+Bi(+(Jt-ae))>3.141592653589793,!Dt;)re=B;k&&(_t[kt>>3]=se,_t[xt>>3]=ye)}else v[U>>2]=0,v[U+4>>2]=0,v[U+8>>2]=0,v[U+12>>2]=0,v[U+16>>2]=0,v[U+20>>2]=0,v[U+24>>2]=0,v[U+28>>2]=0;k=Ve+1|0}if(Dr=E+8|0,E=v[Dr>>2]|0,v[Dr>>2]=0,E)Ve=k,xt=_;else{ci=45;break}}if((ci|0)==21)Ur(27213,27235,35,27247);else if((ci|0)==23)Ur(27267,27235,37,27247);else if((ci|0)==27)Ur(27310,27235,61,27333);else if((ci|0)==45){t:do if((Sr|0)>0){for(Dr=(k|0)==0,Yr=k<<2,vi=(y|0)==0,Or=0,_=0;;){if(cr=v[Ai+(Or<<2)>>2]|0,Dr)ci=73;else{if(Ve=Wt(Yr)|0,!Ve){ci=50;break}if(br=Wt(Yr)|0,!br){ci=52;break}e:do if(vi)x=0;else{for(k=0,x=0,U=y;E=We+(k<<5)|0,yl(v[U>>2]|0,E,v[cr>>2]|0)|0?(v[Ve+(x<<2)>>2]=U,v[br+(x<<2)>>2]=E,Dt=x+1|0):Dt=x,U=v[U+8>>2]|0,U;)k=k+1|0,x=Dt;if((Dt|0)>0)if(E=v[Ve>>2]|0,(Dt|0)==1)x=E;else for(kt=0,Ot=-1,x=E,xt=E;;){for(ot=v[xt>>2]|0,E=0,U=0;k=v[v[Ve+(U<<2)>>2]>>2]|0,(k|0)==(ot|0)?ht=E:ht=E+((yl(k,v[br+(U<<2)>>2]|0,v[ot>>2]|0)|0)&1)|0,U=U+1|0,(U|0)!=(Dt|0);)E=ht;if(k=(ht|0)>(Ot|0),x=k?xt:x,E=kt+1|0,(E|0)==(Dt|0))break e;kt=E,Ot=k?ht:Ot,xt=v[Ve+(E<<2)>>2]|0}else x=0}while(!1);if(It(Ve),It(br),x){if(k=x+4|0,E=v[k>>2]|0,E)x=E+8|0;else if(v[x>>2]|0){ci=70;break}v[x>>2]=cr,v[k>>2]=cr}else ci=73}if((ci|0)==73){if(ci=0,_=v[cr>>2]|0,_|0)do br=_,_=v[_+16>>2]|0,It(br);while((_|0)!=0);It(cr),_=1}if(Or=Or+1|0,(Or|0)>=(Sr|0)){Tn=_;break t}}(ci|0)==50?Ur(27452,27235,249,27471):(ci|0)==52?Ur(27490,27235,252,27471):(ci|0)==70&&Ur(27310,27235,61,27333)}else Tn=0;while(!1);return It(Ai),It(We),ci=Tn,ci|0}return 0}function yl(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(!(Xh(_,x)|0)||(_=K_(_)|0,E=+_t[x>>3],k=+_t[x+8>>3],k=_&k<0?k+6.283185307179586:k,y=v[y>>2]|0,!y))return y=0,y|0;if(_){_=0,ot=k,x=y;t:for(;;){for(;U=+_t[x>>3],k=+_t[x+8>>3],x=x+16|0,ht=v[x>>2]|0,ht=(ht|0)==0?y:ht,B=+_t[ht>>3],$=+_t[ht+8>>3],U>B?(Z=U,U=$):(Z=B,B=U,U=k,k=$),E=E==B|E==Z?E+2220446049250313e-31:E,!!(E<B|E>Z);)if(x=v[x>>2]|0,!x){x=22;break t}if($=U<0?U+6.283185307179586:U,U=k<0?k+6.283185307179586:k,ot=$==ot|U==ot?ot+-2220446049250313e-31:ot,Z=$+(U-$)*((E-B)/(Z-B)),(Z<0?Z+6.283185307179586:Z)>ot&&(_=_^1),x=v[x>>2]|0,!x){x=22;break}}if((x|0)==22)return _|0}else{_=0,ot=k,x=y;t:for(;;){for(;U=+_t[x>>3],k=+_t[x+8>>3],x=x+16|0,ht=v[x>>2]|0,ht=(ht|0)==0?y:ht,B=+_t[ht>>3],$=+_t[ht+8>>3],U>B?(Z=U,U=$):(Z=B,B=U,U=k,k=$),E=E==B|E==Z?E+2220446049250313e-31:E,!!(E<B|E>Z);)if(x=v[x>>2]|0,!x){x=22;break t}if(ot=U==ot|k==ot?ot+-2220446049250313e-31:ot,U+(k-U)*((E-B)/(Z-B))>ot&&(_=_^1),x=v[x>>2]|0,!x){x=22;break}}if((x|0)==22)return _|0}return 0}function au(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0;if(se=bt,bt=bt+32|0,ye=se+16|0,re=se,B=Me(y|0,_|0,52)|0,Tt()|0,B=B&15,Ot=Me(x|0,E|0,52)|0,Tt()|0,(B|0)!=(Ot&15|0))return ye=12,bt=se,ye|0;if(ot=Me(y|0,_|0,45)|0,Tt()|0,ot=ot&127,ht=Me(x|0,E|0,45)|0,Tt()|0,ht=ht&127,ot>>>0>121|ht>>>0>121)return ye=5,bt=se,ye|0;if(Ot=(ot|0)!=(ht|0),Ot){if($=Vp(ot,ht)|0,($|0)==7)return ye=1,bt=se,ye|0;Z=Vp(ht,ot)|0,(Z|0)==7?Ur(27514,27538,161,27548):(Dt=$,U=Z)}else Dt=0,U=0;xt=tn(ot)|0,kt=tn(ht)|0,v[ye>>2]=0,v[ye+4>>2]=0,v[ye+8>>2]=0,v[ye+12>>2]=0;do if(Dt){if(ht=v[4272+(ot*28|0)+(Dt<<2)>>2]|0,$=(ht|0)>0,kt)if($){ot=0,Z=x,$=E;do Z=S2(Z,$)|0,$=Tt()|0,U=ou(U)|0,(U|0)==1&&(U=ou(1)|0),ot=ot+1|0;while((ot|0)!=(ht|0));ht=U,ot=Z,Z=$}else ht=U,ot=x,Z=E;else if($){ot=0,Z=x,$=E;do Z=Jp(Z,$)|0,$=Tt()|0,U=ou(U)|0,ot=ot+1|0;while((ot|0)!=(ht|0));ht=U,ot=Z,Z=$}else ht=U,ot=x,Z=E;if(rd(ot,Z,ye)|0,Ot||Ur(27563,27538,191,27548),$=(xt|0)!=0,U=(kt|0)!=0,$&U&&Ur(27590,27538,192,27548),$){if(U=Wa(y,_)|0,(U|0)==7){B=5;break}if(Be[22e3+(U*7|0)+Dt>>0]|0){B=1;break}Z=v[21168+(U*28|0)+(Dt<<2)>>2]|0,ot=Z}else if(U){if(U=Wa(ot,Z)|0,(U|0)==7){B=5;break}if(Be[22e3+(U*7|0)+ht>>0]|0){B=1;break}ot=0,Z=v[21168+(ht*28|0)+(U<<2)>>2]|0}else ot=0,Z=0;if((ot|Z|0)<0)B=5;else{if((Z|0)>0){$=ye+4|0,U=0;do Qh($),U=U+1|0;while((U|0)!=(Z|0))}if(v[re>>2]=0,v[re+4>>2]=0,v[re+8>>2]=0,oy(re,Dt),B|0)for(;bo(B)|0?Kh(re):Xl(re),(B|0)>1;)B=B+-1|0;if((ot|0)>0){B=0;do Qh(re),B=B+1|0;while((B|0)!=(ot|0))}Zt=ye+4|0,Ns(Zt,re,Zt),Fs(Zt),Zt=51}}else if(rd(x,E,ye)|0,(xt|0)!=0&(kt|0)!=0)if((ht|0)!=(ot|0)&&Ur(27621,27538,261,27548),U=Wa(y,_)|0,B=Wa(x,E)|0,(U|0)==7|(B|0)==7)B=5;else if(Be[22e3+(U*7|0)+B>>0]|0)B=1;else if(U=v[21168+(U*28|0)+(B<<2)>>2]|0,(U|0)>0){$=ye+4|0,B=0;do Qh($),B=B+1|0;while((B|0)!=(U|0));Zt=51}else Zt=51;else Zt=51;while(!1);return(Zt|0)==51&&(B=ye+4|0,v[k>>2]=v[B>>2],v[k+4>>2]=v[B+4>>2],v[k+8>>2]=v[B+8>>2],B=0),ye=B,bt=se,ye|0}function k2(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0;if(Zt=bt,bt=bt+48|0,ot=Zt+36|0,U=Zt+24|0,$=Zt+12|0,Z=Zt,k=Me(y|0,_|0,52)|0,Tt()|0,k=k&15,kt=Me(y|0,_|0,45)|0,Tt()|0,kt=kt&127,kt>>>0>121)return E=5,bt=Zt,E|0;if(ht=tn(kt)|0,Re(k|0,0,52)|0,re=Tt()|0|134225919,B=E,v[B>>2]=-1,v[B+4>>2]=re,!k)return k=Zh(x)|0,(k|0)==7||(k=th(kt,k)|0,(k|0)==127)?(re=1,bt=Zt,re|0):(Ot=Re(k|0,0,45)|0,Dt=Tt()|0,kt=E,Dt=v[kt+4>>2]&-1040385|Dt,re=E,v[re>>2]=v[kt>>2]|Ot,v[re+4>>2]=Dt,re=0,bt=Zt,re|0);for(v[ot>>2]=v[x>>2],v[ot+4>>2]=v[x+4>>2],v[ot+8>>2]=v[x+8>>2],x=k;;){if(B=x,x=x+-1|0,v[U>>2]=v[ot>>2],v[U+4>>2]=v[ot+4>>2],v[U+8>>2]=v[ot+8>>2],bo(B)|0){if(k=J_(ot)|0,k|0){x=13;break}v[$>>2]=v[ot>>2],v[$+4>>2]=v[ot+4>>2],v[$+8>>2]=v[ot+8>>2],Kh($)}else{if(k=b2(ot)|0,k|0){x=13;break}v[$>>2]=v[ot>>2],v[$+4>>2]=v[ot+4>>2],v[$+8>>2]=v[ot+8>>2],Xl($)}if($p(U,$,Z),Fs(Z),k=E,se=v[k>>2]|0,k=v[k+4>>2]|0,ae=(15-B|0)*3|0,ye=Re(7,0,ae|0)|0,k=k&~(Tt()|0),ae=Re(Zh(Z)|0,0,ae|0)|0,k=Tt()|0|k,re=E,v[re>>2]=ae|se&~ye,v[re+4>>2]=k,(B|0)<=1){x=14;break}}t:do if((x|0)!=13&&(x|0)==14)if((v[ot>>2]|0)<=1&&(v[ot+4>>2]|0)<=1&&(v[ot+8>>2]|0)<=1){x=Zh(ot)|0,k=th(kt,x)|0,(k|0)==127?Z=0:Z=tn(k)|0;e:do if(x){if(ht){if(k=Wa(y,_)|0,(k|0)==7){k=5;break t}if(B=v[21376+(k*28|0)+(x<<2)>>2]|0,(B|0)>0){k=x,x=0;do k=Jh(k)|0,x=x+1|0;while((x|0)!=(B|0))}else k=x;if((k|0)==1){k=9;break t}x=th(kt,k)|0,(x|0)==127&&Ur(27648,27538,411,27678),tn(x)|0?Ur(27693,27538,412,27678):(Dt=x,Ot=B,xt=k)}else Dt=k,Ot=0,xt=x;if($=v[4272+(kt*28|0)+(xt<<2)>>2]|0,($|0)<=-1&&Ur(27724,27538,419,27678),!Z){if((Ot|0)<0){k=5;break t}if(Ot|0){B=E,k=0,x=v[B>>2]|0,B=v[B+4>>2]|0;do x=vc(x,B)|0,B=Tt()|0,ae=E,v[ae>>2]=x,v[ae+4>>2]=B,k=k+1|0;while((k|0)<(Ot|0))}if(($|0)<=0){k=Dt,x=58;break}for(B=E,k=0,x=v[B>>2]|0,B=v[B+4>>2]|0;;)if(x=vc(x,B)|0,B=Tt()|0,ae=E,v[ae>>2]=x,v[ae+4>>2]=B,k=k+1|0,(k|0)==($|0)){k=Dt,x=58;break e}}if(U=Vp(Dt,kt)|0,(U|0)==7&&Ur(27514,27538,428,27678),k=E,x=v[k>>2]|0,k=v[k+4>>2]|0,($|0)>0){B=0;do x=vc(x,k)|0,k=Tt()|0,ae=E,v[ae>>2]=x,v[ae+4>>2]=k,B=B+1|0;while((B|0)!=($|0))}if(k=Wa(x,k)|0,(k|0)==7&&Ur(27795,27538,440,27678),x=gf(Dt)|0,x=v[(x?21792:21584)+(U*28|0)+(k<<2)>>2]|0,(x|0)<0&&Ur(27795,27538,454,27678),!x)k=Dt,x=58;else{U=E,k=0,B=v[U>>2]|0,U=v[U+4>>2]|0;do B=av(B,U)|0,U=Tt()|0,ae=E,v[ae>>2]=B,v[ae+4>>2]=U,k=k+1|0;while((k|0)<(x|0));k=Dt,x=58}}else if((ht|0)!=0&(Z|0)!=0){if(x=Wa(y,_)|0,B=E,B=Wa(v[B>>2]|0,v[B+4>>2]|0)|0,(x|0)==7|(B|0)==7){k=5;break t}if(B=v[21376+(x*28|0)+(B<<2)>>2]|0,(B|0)<0){k=5;break t}if(!B)x=59;else{$=E,x=0,U=v[$>>2]|0,$=v[$+4>>2]|0;do U=vc(U,$)|0,$=Tt()|0,ae=E,v[ae>>2]=U,v[ae+4>>2]=$,x=x+1|0;while((x|0)<(B|0));x=58}}else x=58;while(!1);if((x|0)==58&&Z&&(x=59),(x|0)==59&&(ae=E,(Wa(v[ae>>2]|0,v[ae+4>>2]|0)|0)==1)){k=9;break}ae=E,ye=v[ae>>2]|0,ae=v[ae+4>>2]&-1040385,se=Re(k|0,0,45)|0,ae=ae|(Tt()|0),k=E,v[k>>2]=ye|se,v[k+4>>2]=ae,k=0}else k=1;while(!1);return ae=k,bt=Zt,ae|0}function CM(y,_,x,E,k,B){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0;var U=0,$=0;return $=bt,bt=bt+16|0,U=$,k?y=15:(y=au(y,_,x,E,U)|0,y||(tv(U,B),y=0)),bt=$,y|0}function IM(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0;return U=bt,bt=bt+16|0,B=U,E?x=15:(x=Bm(x,B)|0,x||(x=k2(y,_,B,k)|0)),bt=U,x|0}function Zm(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0;return Z=bt,bt=bt+32|0,U=Z+12|0,$=Z,B=au(y,_,y,_,U)|0,B|0?($=B,bt=Z,$|0):(y=au(y,_,x,E,$)|0,y|0?($=y,bt=Z,$|0):(U=Lm(U,$)|0,$=k,v[$>>2]=U,v[$+4>>2]=((U|0)<0)<<31>>31,$=0,bt=Z,$|0))}function dn(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0;return Z=bt,bt=bt+32|0,U=Z+12|0,$=Z,B=au(y,_,y,_,U)|0,!B&&(B=au(y,_,x,E,$)|0,!B)?(E=Lm(U,$)|0,E=Kt(E|0,((E|0)<0)<<31>>31|0,1,0)|0,U=Tt()|0,$=k,v[$>>2]=E,v[$+4>>2]=U,$=0,bt=Z,$|0):($=B,bt=Z,$|0)}function xo(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0;if(cr=bt,bt=bt+48|0,Ve=cr+24|0,U=cr+12|0,br=cr,B=au(y,_,y,_,Ve)|0,!B&&(B=au(y,_,x,E,U)|0,!B)){ae=Lm(Ve,U)|0,Jt=((ae|0)<0)<<31>>31,v[Ve>>2]=0,v[Ve+4>>2]=0,v[Ve+8>>2]=0,v[U>>2]=0,v[U+4>>2]=0,v[U+8>>2]=0,au(y,_,y,_,Ve)|0&&Ur(27795,27538,692,27747),au(y,_,x,E,U)|0&&Ur(27795,27538,697,27747),ay(Ve),ay(U),ht=(ae|0)==0?0:1/+(ae|0),x=v[Ve>>2]|0,Zt=ht*+((v[U>>2]|0)-x|0),re=Ve+4|0,E=v[re>>2]|0,ye=ht*+((v[U+4>>2]|0)-E|0),se=Ve+8|0,B=v[se>>2]|0,ht=ht*+((v[U+8>>2]|0)-B|0),v[br>>2]=x,xt=br+4|0,v[xt>>2]=E,kt=br+8|0,v[kt>>2]=B;t:do if((ae|0)<0)B=0;else for(Ot=0,Dt=0;;){Z=+(Dt>>>0)+4294967296*+(Ot|0),Or=Zt*Z+ +(x|0),$=ye*Z+ +(E|0),Z=ht*Z+ +(B|0),x=~~+en(+Or),U=~~+en(+$),B=~~+en(+Z),Or=+Bi(+(+(x|0)-Or)),$=+Bi(+(+(U|0)-$)),Z=+Bi(+(+(B|0)-Z));do if(Or>$&Or>Z)x=0-(U+B)|0,E=U;else if(ot=0-x|0,$>Z){E=ot-B|0;break}else{E=U,B=ot-U|0;break}while(!1);if(v[br>>2]=x,v[xt>>2]=E,v[kt>>2]=B,EM(br),B=k2(y,_,br,k+(Dt<<3)|0)|0,B|0)break t;if(!((Ot|0)<(Jt|0)|(Ot|0)==(Jt|0)&Dt>>>0<ae>>>0)){B=0;break t}x=Kt(Dt|0,Ot|0,1,0)|0,E=Tt()|0,Ot=E,Dt=x,x=v[Ve>>2]|0,E=v[re>>2]|0,B=v[se>>2]|0}while(!1);return br=B,bt=cr,br|0}return br=B,bt=cr,br|0}function nh(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0;if((x|0)==0&(E|0)==0)return k=0,B=1,ni(k|0),B|0;B=y,k=_,y=1,_=0;do U=(x&1|0)==0&!0,y=Ee((U?1:B)|0,(U?0:k)|0,y|0,_|0)|0,_=Tt()|0,x=ji(x|0,E|0,1)|0,E=Tt()|0,B=Ee(B|0,k|0,B|0,k|0)|0,k=Tt()|0;while(!((x|0)==0&(E|0)==0));return ni(_|0),y|0}function xf(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;$=bt,bt=bt+16|0,B=$,U=Me(y|0,_|0,52)|0,Tt()|0,U=U&15;do if(U){if(k=nd(y,_,B)|0,!k){ot=+_t[B>>3],Z=1/+Di(+ot),ht=+_t[25968+(U<<3)>>3],_t[x>>3]=ot+ht,_t[x+8>>3]=ot-ht,ot=+_t[B+8>>3],Z=ht*Z,_t[x+16>>3]=Z+ot,_t[x+24>>3]=ot-Z;break}return U=k,bt=$,U|0}else{if(k=Me(y|0,_|0,45)|0,Tt()|0,k=k&127,k>>>0>121)return U=5,bt=$,U|0;B=22064+(k<<5)|0,v[x>>2]=v[B>>2],v[x+4>>2]=v[B+4>>2],v[x+8>>2]=v[B+8>>2],v[x+12>>2]=v[B+12>>2],v[x+16>>2]=v[B+16>>2],v[x+20>>2]=v[B+20>>2],v[x+24>>2]=v[B+24>>2],v[x+28>>2]=v[B+28>>2];break}while(!1);return Dm(x,E?1.4:1.1),E=26096+(U<<3)|0,(v[E>>2]|0)==(y|0)&&(v[E+4>>2]|0)==(_|0)&&(_t[x>>3]=1.5707963267948966),U=26224+(U<<3)|0,(v[U>>2]|0)==(y|0)&&(v[U+4>>2]|0)==(_|0)&&(_t[x+8>>3]=-1.5707963267948966),+_t[x>>3]!=1.5707963267948966&&+_t[x+8>>3]!=-1.5707963267948966?(U=0,bt=$,U|0):(_t[x+16>>3]=3.141592653589793,_t[x+24>>3]=-3.141592653589793,U=0,bt=$,U|0)}function Km(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;ot=bt,bt=bt+48|0,U=ot+32|0,B=ot+40|0,$=ot,hy(U,0,0,0),Z=v[U>>2]|0,U=v[U+4>>2]|0;do if(x>>>0<=15){if(k=cd(E)|0,k|0){E=$,v[E>>2]=0,v[E+4>>2]=0,v[$+8>>2]=k,v[$+12>>2]=-1,E=$+16|0,Z=$+29|0,v[E>>2]=0,v[E+4>>2]=0,v[E+8>>2]=0,Be[E+12>>0]=0,Be[Z>>0]=Be[B>>0]|0,Be[Z+1>>0]=Be[B+1>>0]|0,Be[Z+2>>0]=Be[B+2>>0]|0;break}if(k=Xt((v[_+8>>2]|0)+1|0,32)|0,k){Tf(_,k),ht=$,v[ht>>2]=Z,v[ht+4>>2]=U,v[$+8>>2]=0,v[$+12>>2]=x,v[$+16>>2]=E,v[$+20>>2]=_,v[$+24>>2]=k,Be[$+28>>0]=0,Z=$+29|0,Be[Z>>0]=Be[B>>0]|0,Be[Z+1>>0]=Be[B+1>>0]|0,Be[Z+2>>0]=Be[B+2>>0]|0;break}else{E=$,v[E>>2]=0,v[E+4>>2]=0,v[$+8>>2]=13,v[$+12>>2]=-1,E=$+16|0,Z=$+29|0,v[E>>2]=0,v[E+4>>2]=0,v[E+8>>2]=0,Be[E+12>>0]=0,Be[Z>>0]=Be[B>>0]|0,Be[Z+1>>0]=Be[B+1>>0]|0,Be[Z+2>>0]=Be[B+2>>0]|0;break}}else Z=$,v[Z>>2]=0,v[Z+4>>2]=0,v[$+8>>2]=4,v[$+12>>2]=-1,Z=$+16|0,ht=$+29|0,v[Z>>2]=0,v[Z+4>>2]=0,v[Z+8>>2]=0,Be[Z+12>>0]=0,Be[ht>>0]=Be[B>>0]|0,Be[ht+1>>0]=Be[B+1>>0]|0,Be[ht+2>>0]=Be[B+2>>0]|0;while(!1);wf($),v[y>>2]=v[$>>2],v[y+4>>2]=v[$+4>>2],v[y+8>>2]=v[$+8>>2],v[y+12>>2]=v[$+12>>2],v[y+16>>2]=v[$+16>>2],v[y+20>>2]=v[$+20>>2],v[y+24>>2]=v[$+24>>2],v[y+28>>2]=v[$+28>>2],bt=ot}function wf(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0;if(Jt=bt,bt=bt+336|0,Ot=Jt+168|0,Dt=Jt,E=y,x=v[E>>2]|0,E=v[E+4>>2]|0,(x|0)==0&(E|0)==0){bt=Jt;return}if(_=y+28|0,Be[_>>0]|0?(x=gy(x,E)|0,E=Tt()|0):Be[_>>0]=1,ae=y+20|0,!(v[v[ae>>2]>>2]|0)){_=y+24|0,x=v[_>>2]|0,x|0&&It(x),se=y,v[se>>2]=0,v[se+4>>2]=0,v[y+8>>2]=0,v[ae>>2]=0,v[y+12>>2]=-1,v[y+16>>2]=0,v[_>>2]=0,bt=Jt;return}se=y+16|0,_=v[se>>2]|0,k=_&15;t:do if((x|0)==0&(E|0)==0)ye=y+24|0;else{Zt=y+12|0,xt=(k|0)==3,ht=_&255,Z=(k|1|0)==3,kt=y+24|0,ot=(k+-1|0)>>>0<3,U=(k|2|0)==3,$=Dt+8|0;e:for(;;){if(B=Me(x|0,E|0,52)|0,Tt()|0,B=B&15,(B|0)==(v[Zt>>2]|0)){switch(ht&15){case 0:case 2:case 3:{if(k=nd(x,E,Ot)|0,k|0){re=15;break e}if(Qm(v[ae>>2]|0,v[kt>>2]|0,Ot)|0){re=19;break e}break}default:}if(Z&&(k=v[(v[ae>>2]|0)+4>>2]|0,v[Ot>>2]=v[k>>2],v[Ot+4>>2]=v[k+4>>2],v[Ot+8>>2]=v[k+8>>2],v[Ot+12>>2]=v[k+12>>2],Xh(26832,Ot)|0)){if(ir(v[(v[ae>>2]|0)+4>>2]|0,B,Dt)|0){re=25;break}if(k=Dt,(v[k>>2]|0)==(x|0)&&(v[k+4>>2]|0)==(E|0)){re=29;break}}if(ot){if(k=su(x,E,Ot)|0,k|0){re=32;break}if(xf(x,E,Dt,0)|0){re=36;break}if(U&&Sf(v[ae>>2]|0,v[kt>>2]|0,Ot,Dt)|0){re=42;break}if(Z&&Ay(v[ae>>2]|0,v[kt>>2]|0,Ot,Dt)|0){re=42;break}}if(xt){if(_=xf(x,E,Ot,1)|0,k=v[kt>>2]|0,_|0){re=45;break}if(ny(k,Ot)|0){if(Rm(Dt,Ot),pi(Ot,v[kt>>2]|0)|0){re=53;break}if(Qm(v[ae>>2]|0,v[kt>>2]|0,$)|0){re=53;break}if(Ay(v[ae>>2]|0,v[kt>>2]|0,Dt,Ot)|0){re=53;break}}}}do if((B|0)<(v[Zt>>2]|0)){if(_=xf(x,E,Ot,1)|0,k=v[kt>>2]|0,_|0){re=58;break e}if(!(ny(k,Ot)|0)){re=73;break}if(pi(v[kt>>2]|0,Ot)|0&&(Rm(Dt,Ot),Sf(v[ae>>2]|0,v[kt>>2]|0,Dt,Ot)|0)){re=65;break e}if(x=ia(x,E,B+1|0,Dt)|0,x|0){re=67;break e}E=Dt,x=v[E>>2]|0,E=v[E+4>>2]|0}else re=73;while(!1);if((re|0)==73&&(re=0,x=gy(x,E)|0,E=Tt()|0),(x|0)==0&(E|0)==0){ye=kt;break t}}switch(re|0){case 15:{_=v[kt>>2]|0,_|0&&It(_),re=y,v[re>>2]=0,v[re+4>>2]=0,v[ae>>2]=0,v[Zt>>2]=-1,v[se>>2]=0,v[kt>>2]=0,v[y+8>>2]=k,re=20;break}case 19:{v[y>>2]=x,v[y+4>>2]=E,re=20;break}case 25:{Ur(27795,27761,470,27772);break}case 29:{v[y>>2]=x,v[y+4>>2]=E,bt=Jt;return}case 32:{_=v[kt>>2]|0,_|0&&It(_),ye=y,v[ye>>2]=0,v[ye+4>>2]=0,v[ae>>2]=0,v[Zt>>2]=-1,v[se>>2]=0,v[kt>>2]=0,v[y+8>>2]=k,bt=Jt;return}case 36:{Ur(27795,27761,493,27772);break}case 42:{v[y>>2]=x,v[y+4>>2]=E,bt=Jt;return}case 45:{k|0&&It(k),re=y,v[re>>2]=0,v[re+4>>2]=0,v[ae>>2]=0,v[Zt>>2]=-1,v[se>>2]=0,v[kt>>2]=0,v[y+8>>2]=_,re=55;break}case 53:{v[y>>2]=x,v[y+4>>2]=E,re=55;break}case 58:{k|0&&It(k),re=y,v[re>>2]=0,v[re+4>>2]=0,v[ae>>2]=0,v[Zt>>2]=-1,v[se>>2]=0,v[kt>>2]=0,v[y+8>>2]=_,re=71;break}case 65:{v[y>>2]=x,v[y+4>>2]=E,re=71;break}case 67:{_=v[kt>>2]|0,_|0&&It(_),ye=y,v[ye>>2]=0,v[ye+4>>2]=0,v[ae>>2]=0,v[Zt>>2]=-1,v[se>>2]=0,v[kt>>2]=0,v[y+8>>2]=x,bt=Jt;return}}if((re|0)==20){bt=Jt;return}else if((re|0)==55){bt=Jt;return}else if((re|0)==71){bt=Jt;return}}while(!1);_=v[ye>>2]|0,_|0&&It(_),re=y,v[re>>2]=0,v[re+4>>2]=0,v[y+8>>2]=0,v[ae>>2]=0,v[y+12>>2]=-1,v[se>>2]=0,v[ye>>2]=0,bt=Jt}function gy(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0;xt=bt,bt=bt+16|0,ht=xt,E=Me(y|0,_|0,52)|0,Tt()|0,E=E&15,x=Me(y|0,_|0,45)|0,Tt()|0;do if(E){for(;x=Re(E+4095|0,0,52)|0,k=Tt()|0|_&-15728641,B=(15-E|0)*3|0,U=Re(7,0,B|0)|0,$=Tt()|0,x=x|y|U,k=k|$,Z=Me(y|0,_|0,B|0)|0,Tt()|0,Z=Z&7,E=E+-1|0,!(Z>>>0<6);)if(E)_=k,y=x;else{ot=4;break}if((ot|0)==4){x=Me(x|0,k|0,45)|0,Tt()|0;break}return ht=(Z|0)==0&(Ei(x,k)|0)!=0,ht=Re((ht?2:1)+Z|0,0,B|0)|0,ot=Tt()|0|_&~$,ht=ht|y&~U,ni(ot|0),bt=xt,ht|0}while(!1);return x=x&127,x>>>0>120?(ot=0,ht=0,ni(ot|0),bt=xt,ht|0):(hy(ht,0,x+1|0,0),ot=v[ht+4>>2]|0,ht=v[ht>>2]|0,ni(ot|0),bt=xt,ht|0)}function uv(y,_,x,E,k,B){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0,B=B|0;var U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0;re=bt,bt=bt+160|0,xt=re+80|0,$=re+64|0,kt=re+112|0,Zt=re,Km(xt,y,_,x),ot=xt,t0($,v[ot>>2]|0,v[ot+4>>2]|0,_),ot=$,Z=v[ot>>2]|0,ot=v[ot+4>>2]|0,U=v[xt+8>>2]|0,Ot=kt+4|0,v[Ot>>2]=v[xt>>2],v[Ot+4>>2]=v[xt+4>>2],v[Ot+8>>2]=v[xt+8>>2],v[Ot+12>>2]=v[xt+12>>2],v[Ot+16>>2]=v[xt+16>>2],v[Ot+20>>2]=v[xt+20>>2],v[Ot+24>>2]=v[xt+24>>2],v[Ot+28>>2]=v[xt+28>>2],Ot=Zt,v[Ot>>2]=Z,v[Ot+4>>2]=ot,Ot=Zt+8|0,v[Ot>>2]=U,y=Zt+12|0,_=kt,x=y+36|0;do v[y>>2]=v[_>>2],y=y+4|0,_=_+4|0;while((y|0)<(x|0));if(kt=Zt+48|0,v[kt>>2]=v[$>>2],v[kt+4>>2]=v[$+4>>2],v[kt+8>>2]=v[$+8>>2],v[kt+12>>2]=v[$+12>>2],(Z|0)==0&(ot|0)==0)return Zt=U,bt=re,Zt|0;x=Zt+16|0,ht=Zt+24|0,xt=Zt+28|0,U=0,$=0,_=Z,y=ot;do{if(!((U|0)<(k|0)|(U|0)==(k|0)&$>>>0<E>>>0)){Dt=4;break}if(ot=$,$=Kt($|0,U|0,1,0)|0,U=Tt()|0,ot=B+(ot<<3)|0,v[ot>>2]=_,v[ot+4>>2]=y,py(kt),y=kt,_=v[y>>2]|0,y=v[y+4>>2]|0,(_|0)==0&(y|0)==0){if(wf(x),_=x,y=v[_>>2]|0,_=v[_+4>>2]|0,(y|0)==0&(_|0)==0){Dt=10;break}fy(y,_,v[xt>>2]|0,kt),y=kt,_=v[y>>2]|0,y=v[y+4>>2]|0}ot=Zt,v[ot>>2]=_,v[ot+4>>2]=y}while(!((_|0)==0&(y|0)==0));return(Dt|0)==4?(y=Zt+40|0,_=v[y>>2]|0,_|0&&It(_),Dt=Zt+16|0,v[Dt>>2]=0,v[Dt+4>>2]=0,v[ht>>2]=0,v[Zt+36>>2]=0,v[xt>>2]=-1,v[Zt+32>>2]=0,v[y>>2]=0,fy(0,0,0,kt),v[Zt>>2]=0,v[Zt+4>>2]=0,v[Ot>>2]=0,Zt=14,bt=re,Zt|0):((Dt|0)==10&&(v[Zt>>2]=0,v[Zt+4>>2]=0,v[Ot>>2]=v[ht>>2]),Zt=v[Ot>>2]|0,bt=re,Zt|0)}function xc(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0;if(xt=bt,bt=bt+48|0,Z=xt+32|0,$=xt+40|0,ot=xt,!(v[y>>2]|0))return ht=E,v[ht>>2]=0,v[ht+4>>2]=0,ht=0,bt=xt,ht|0;hy(Z,0,0,0),U=Z,k=v[U>>2]|0,U=v[U+4>>2]|0;do if(_>>>0>15)ht=ot,v[ht>>2]=0,v[ht+4>>2]=0,v[ot+8>>2]=4,v[ot+12>>2]=-1,ht=ot+16|0,x=ot+29|0,v[ht>>2]=0,v[ht+4>>2]=0,v[ht+8>>2]=0,Be[ht+12>>0]=0,Be[x>>0]=Be[$>>0]|0,Be[x+1>>0]=Be[$+1>>0]|0,Be[x+2>>0]=Be[$+2>>0]|0,x=4,ht=9;else{if(x=cd(x)|0,x|0){Z=ot,v[Z>>2]=0,v[Z+4>>2]=0,v[ot+8>>2]=x,v[ot+12>>2]=-1,Z=ot+16|0,ht=ot+29|0,v[Z>>2]=0,v[Z+4>>2]=0,v[Z+8>>2]=0,Be[Z+12>>0]=0,Be[ht>>0]=Be[$>>0]|0,Be[ht+1>>0]=Be[$+1>>0]|0,Be[ht+2>>0]=Be[$+2>>0]|0,ht=9;break}if(x=Xt((v[y+8>>2]|0)+1|0,32)|0,!x){ht=ot,v[ht>>2]=0,v[ht+4>>2]=0,v[ot+8>>2]=13,v[ot+12>>2]=-1,ht=ot+16|0,x=ot+29|0,v[ht>>2]=0,v[ht+4>>2]=0,v[ht+8>>2]=0,Be[ht+12>>0]=0,Be[x>>0]=Be[$>>0]|0,Be[x+1>>0]=Be[$+1>>0]|0,Be[x+2>>0]=Be[$+2>>0]|0,x=13,ht=9;break}Tf(y,x),Ot=ot,v[Ot>>2]=k,v[Ot+4>>2]=U,U=ot+8|0,v[U>>2]=0,v[ot+12>>2]=_,v[ot+20>>2]=y,v[ot+24>>2]=x,Be[ot+28>>0]=0,k=ot+29|0,Be[k>>0]=Be[$>>0]|0,Be[k+1>>0]=Be[$+1>>0]|0,Be[k+2>>0]=Be[$+2>>0]|0,v[ot+16>>2]=3,kt=+jp(x),kt=kt*+iy(x),B=+Bi(+ +_t[x>>3]),B=kt/+Di(+ +oo(+B,+ +Bi(+ +_t[x+8>>3])))*6371.007180918475*6371.007180918475,k=ot+12|0,x=v[k>>2]|0;t:do if((x|0)>0)do{if(P2(x+-1|0,Z)|0,!(B/+_t[Z>>3]>10))break t;Ot=v[k>>2]|0,x=Ot+-1|0,v[k>>2]=x}while((Ot|0)>1);while(!1);if(wf(ot),k=E,v[k>>2]=0,v[k+4>>2]=0,k=ot,x=v[k>>2]|0,k=v[k+4>>2]|0,!((x|0)==0&(k|0)==0))do Qp(x,k,_,Z)|0,$=Z,y=E,$=Kt(v[y>>2]|0,v[y+4>>2]|0,v[$>>2]|0,v[$+4>>2]|0)|0,y=Tt()|0,Ot=E,v[Ot>>2]=$,v[Ot+4>>2]=y,wf(ot),Ot=ot,x=v[Ot>>2]|0,k=v[Ot+4>>2]|0;while(!((x|0)==0&(k|0)==0));x=v[U>>2]|0}while(!1);return Ot=x,bt=xt,Ot|0}function ld(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;if(!(Xh(_,x)|0)||(_=K_(_)|0,E=+_t[x>>3],k=+_t[x+8>>3],k=_&k<0?k+6.283185307179586:k,kt=v[y>>2]|0,(kt|0)<=0))return kt=0,kt|0;if(xt=v[y+4>>2]|0,_){_=0,ht=k,x=-1,y=0;t:for(;;){for(ot=y;U=+_t[xt+(ot<<4)>>3],k=+_t[xt+(ot<<4)+8>>3],y=(x+2|0)%(kt|0)|0,B=+_t[xt+(y<<4)>>3],$=+_t[xt+(y<<4)+8>>3],U>B?(Z=U,U=$):(Z=B,B=U,U=k,k=$),E=E==B|E==Z?E+2220446049250313e-31:E,!!(E<B|E>Z);)if(x=ot+1|0,(x|0)>=(kt|0)){x=22;break t}else y=ot,ot=x,x=y;if($=U<0?U+6.283185307179586:U,U=k<0?k+6.283185307179586:k,ht=$==ht|U==ht?ht+-2220446049250313e-31:ht,Z=$+(U-$)*((E-B)/(Z-B)),(Z<0?Z+6.283185307179586:Z)>ht&&(_=_^1),y=ot+1|0,(y|0)>=(kt|0)){x=22;break}else x=ot}if((x|0)==22)return _|0}else{_=0,ht=k,x=-1,y=0;t:for(;;){for(ot=y;U=+_t[xt+(ot<<4)>>3],k=+_t[xt+(ot<<4)+8>>3],y=(x+2|0)%(kt|0)|0,B=+_t[xt+(y<<4)>>3],$=+_t[xt+(y<<4)+8>>3],U>B?(Z=U,U=$):(Z=B,B=U,U=k,k=$),E=E==B|E==Z?E+2220446049250313e-31:E,!!(E<B|E>Z);)if(x=ot+1|0,(x|0)>=(kt|0)){x=22;break t}else y=ot,ot=x,x=y;if(ht=U==ht|k==ht?ht+-2220446049250313e-31:ht,U+(k-U)*((E-B)/(Z-B))>ht&&(_=_^1),y=ot+1|0,(y|0)>=(kt|0)){x=22;break}else x=ot}if((x|0)==22)return _|0}return 0}function i0(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0;if(Dt=v[y>>2]|0,!Dt){v[_>>2]=0,v[_+4>>2]=0,v[_+8>>2]=0,v[_+12>>2]=0,v[_+16>>2]=0,v[_+20>>2]=0,v[_+24>>2]=0,v[_+28>>2]=0;return}if(Zt=_+8|0,_t[Zt>>3]=17976931348623157e292,re=_+24|0,_t[re>>3]=17976931348623157e292,_t[_>>3]=-17976931348623157e292,ye=_+16|0,_t[ye>>3]=-17976931348623157e292,!((Dt|0)<=0)){for(kt=v[y+4>>2]|0,ot=17976931348623157e292,ht=-17976931348623157e292,xt=0,y=-1,B=17976931348623157e292,U=17976931348623157e292,Z=-17976931348623157e292,E=-17976931348623157e292,Ot=0;x=+_t[kt+(Ot<<4)>>3],$=+_t[kt+(Ot<<4)+8>>3],y=y+2|0,k=+_t[kt+(((y|0)==(Dt|0)?0:y)<<4)+8>>3],x<B&&(_t[Zt>>3]=x,B=x),$<U&&(_t[re>>3]=$,U=$),x>Z?_t[_>>3]=x:x=Z,$>E&&(_t[ye>>3]=$,E=$),ot=$>0&$<ot?$:ot,ht=$<0&$>ht?$:ht,xt=xt|+Bi(+($-k))>3.141592653589793,y=Ot+1|0,(y|0)!=(Dt|0);)se=Ot,Z=x,Ot=y,y=se;xt&&(_t[ye>>3]=ht,_t[re>>3]=ot)}}function cd(y){return y=y|0,(y>>>0<4?0:15)|0}function Tf(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0;if(Dt=v[y>>2]|0,Dt){if(Zt=_+8|0,_t[Zt>>3]=17976931348623157e292,re=_+24|0,_t[re>>3]=17976931348623157e292,_t[_>>3]=-17976931348623157e292,ye=_+16|0,_t[ye>>3]=-17976931348623157e292,(Dt|0)>0){for(k=v[y+4>>2]|0,kt=17976931348623157e292,Ot=-17976931348623157e292,E=0,x=-1,Z=17976931348623157e292,ot=17976931348623157e292,xt=-17976931348623157e292,U=-17976931348623157e292,se=0;B=+_t[k+(se<<4)>>3],ht=+_t[k+(se<<4)+8>>3],br=x+2|0,$=+_t[k+(((br|0)==(Dt|0)?0:br)<<4)+8>>3],B<Z&&(_t[Zt>>3]=B,Z=B),ht<ot&&(_t[re>>3]=ht,ot=ht),B>xt?_t[_>>3]=B:B=xt,ht>U&&(_t[ye>>3]=ht,U=ht),kt=ht>0&ht<kt?ht:kt,Ot=ht<0&ht>Ot?ht:Ot,E=E|+Bi(+(ht-$))>3.141592653589793,x=se+1|0,(x|0)!=(Dt|0);)br=se,xt=B,se=x,x=br;E&&(_t[ye>>3]=Ot,_t[re>>3]=kt)}}else v[_>>2]=0,v[_+4>>2]=0,v[_+8>>2]=0,v[_+12>>2]=0,v[_+16>>2]=0,v[_+20>>2]=0,v[_+24>>2]=0,v[_+28>>2]=0;if(br=y+8|0,x=v[br>>2]|0,!((x|0)<=0)){Ve=y+12|0,Jt=0;do if(k=v[Ve>>2]|0,E=Jt,Jt=Jt+1|0,re=_+(Jt<<5)|0,ye=v[k+(E<<3)>>2]|0,ye){if(se=_+(Jt<<5)+8|0,_t[se>>3]=17976931348623157e292,y=_+(Jt<<5)+24|0,_t[y>>3]=17976931348623157e292,_t[re>>3]=-17976931348623157e292,ae=_+(Jt<<5)+16|0,_t[ae>>3]=-17976931348623157e292,(ye|0)>0){for(Dt=v[k+(E<<3)+4>>2]|0,kt=17976931348623157e292,Ot=-17976931348623157e292,k=0,E=-1,Zt=0,Z=17976931348623157e292,ot=17976931348623157e292,ht=-17976931348623157e292,U=-17976931348623157e292;B=+_t[Dt+(Zt<<4)>>3],xt=+_t[Dt+(Zt<<4)+8>>3],E=E+2|0,$=+_t[Dt+(((E|0)==(ye|0)?0:E)<<4)+8>>3],B<Z&&(_t[se>>3]=B,Z=B),xt<ot&&(_t[y>>3]=xt,ot=xt),B>ht?_t[re>>3]=B:B=ht,xt>U&&(_t[ae>>3]=xt,U=xt),kt=xt>0&xt<kt?xt:kt,Ot=xt<0&xt>Ot?xt:Ot,k=k|+Bi(+(xt-$))>3.141592653589793,E=Zt+1|0,(E|0)!=(ye|0);)cr=Zt,Zt=E,ht=B,E=cr;k&&(_t[ae>>3]=Ot,_t[y>>3]=kt)}}else v[re>>2]=0,v[re+4>>2]=0,v[re+8>>2]=0,v[re+12>>2]=0,v[re+16>>2]=0,v[re+20>>2]=0,v[re+24>>2]=0,v[re+28>>2]=0,x=v[br>>2]|0;while((Jt|0)<(x|0))}}function Qm(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;if(!(ld(y,_,x)|0))return k=0,k|0;if(k=y+8|0,(v[k>>2]|0)<=0)return k=1,k|0;for(E=y+12|0,y=0;;){if(B=y,y=y+1|0,ld((v[E>>2]|0)+(B<<3)|0,_+(y<<5)|0,x)|0){y=0,E=6;break}if((y|0)>=(v[k>>2]|0)){y=1,E=6;break}}return(E|0)==6?y|0:0}function Sf(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(ot=bt,bt=bt+16|0,$=ot,U=x+8|0,!(ld(y,_,U)|0))return Z=0,bt=ot,Z|0;Z=y+8|0;t:do if((v[Z>>2]|0)>0){for(B=y+12|0,k=0;;){if(ht=k,k=k+1|0,ld((v[B>>2]|0)+(ht<<3)|0,_+(k<<5)|0,U)|0){k=0;break}if((k|0)>=(v[Z>>2]|0))break t}return bt=ot,k|0}while(!1);if(lu(y,_,x,E)|0)return ht=0,bt=ot,ht|0;v[$>>2]=v[x>>2],v[$+4>>2]=U,k=v[Z>>2]|0;t:do if((k|0)>0)for(y=y+12|0,U=0,B=k;;){if(k=v[y>>2]|0,(v[k+(U<<3)>>2]|0)>0){if(ld($,E,v[k+(U<<3)+4>>2]|0)|0){k=0;break t}if(k=U+1|0,lu((v[y>>2]|0)+(U<<3)|0,_+(k<<5)|0,x,E)|0){k=0;break t}B=v[Z>>2]|0}else k=U+1|0;if((k|0)<(B|0))U=k;else{k=1;break}}else k=1;while(!1);return ht=k,bt=ot,ht|0}function lu(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0,br=0,cr=0,Or=0;if(br=bt,bt=bt+176|0,se=br+172|0,k=br+168|0,ae=br,!(ny(_,E)|0))return y=0,bt=br,y|0;if(Q_(_,E,se,k),so(ae|0,x|0,168)|0,(v[x>>2]|0)>0){_=0;do cr=ae+8+(_<<4)+8|0,ye=+xa(+_t[cr>>3],v[k>>2]|0),_t[cr>>3]=ye,_=_+1|0;while((_|0)<(v[x>>2]|0))}Zt=+_t[E>>3],re=+_t[E+8>>3],ye=+xa(+_t[E+16>>3],v[k>>2]|0),Ot=+xa(+_t[E+24>>3],v[k>>2]|0);t:do if((v[y>>2]|0)>0){if(E=y+4|0,k=v[ae>>2]|0,(k|0)<=0){for(_=0;;)if(_=_+1|0,(_|0)>=(v[y>>2]|0)){_=0;break t}}for(x=0;;){if(_=v[E>>2]|0,kt=+_t[_+(x<<4)>>3],Dt=+xa(+_t[_+(x<<4)+8>>3],v[se>>2]|0),_=v[E>>2]|0,x=x+1|0,cr=(x|0)%(v[y>>2]|0)|0,B=+_t[_+(cr<<4)>>3],U=+xa(+_t[_+(cr<<4)+8>>3],v[se>>2]|0),!(kt>=Zt)|!(B>=Zt)&&!(kt<=re)|!(B<=re)&&!(Dt<=Ot)|!(U<=Ot)&&!(Dt>=ye)|!(U>=ye)){xt=B-kt,ot=U-Dt,_=0;do if(Or=_,_=_+1|0,cr=(_|0)==(k|0)?0:_,B=+_t[ae+8+(Or<<4)+8>>3],U=+_t[ae+8+(cr<<4)+8>>3]-B,$=+_t[ae+8+(Or<<4)>>3],Z=+_t[ae+8+(cr<<4)>>3]-$,ht=xt*U-ot*Z,ht!=0&&(Jt=Dt-B,Ve=kt-$,Z=(Jt*Z-U*Ve)/ht,!(Z<0|Z>1))&&(ht=(xt*Jt-ot*Ve)/ht,ht>=0&ht<=1)){_=1;break t}while((_|0)<(k|0))}if((x|0)>=(v[y>>2]|0)){_=0;break}}}else _=0;while(!1);return Or=_,bt=br,Or|0}function Ay(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0;if(lu(y,_,x,E)|0)return B=1,B|0;if(B=y+8|0,(v[B>>2]|0)<=0)return B=0,B|0;for(k=y+12|0,y=0;;){if(U=y,y=y+1|0,lu((v[k>>2]|0)+(U<<3)|0,_+(y<<5)|0,x,E)|0){y=1,k=6;break}if((y|0)>=(v[B>>2]|0)){y=0,k=6;break}}return(k|0)==6?y|0:0}function yy(){return 8}function ud(){return 16}function hv(){return 168}function dv(){return 8}function Jm(){return 16}function fv(){return 12}function I(){return 8}function c(y){return y=y|0,+(+((v[y>>2]|0)>>>0)+4294967296*+(v[y+4>>2]|0))}function f(y){y=y|0;var _=0,x=0;return x=+_t[y>>3],_=+_t[y+8>>3],+ +un(+(x*x+_*_))}function b(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0;ot=+_t[y>>3],Z=+_t[_>>3]-ot,$=+_t[y+8>>3],U=+_t[_+8>>3]-$,xt=+_t[x>>3],B=+_t[E>>3]-xt,kt=+_t[x+8>>3],ht=+_t[E+8>>3]-kt,B=(B*($-kt)-(ot-xt)*ht)/(Z*ht-U*B),_t[k>>3]=ot+Z*B,_t[k+8>>3]=$+U*B}function S(y,_){return y=y|0,_=_|0,+Bi(+(+_t[y>>3]-+_t[_>>3]))<11920928955078125e-23?(_=+Bi(+(+_t[y+8>>3]-+_t[_+8>>3]))<11920928955078125e-23,_|0):(_=0,_|0)}function D(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;return k=+_t[y>>3]-+_t[_>>3],E=+_t[y+8>>3]-+_t[_+8>>3],x=+_t[y+16>>3]-+_t[_+16>>3],+(k*k+E*E+x*x)}function N(y,_){y=y|0,_=_|0;var x=0,E=0,k=0;x=+_t[y>>3],E=+Di(+x),x=+Zi(+x),_t[_+16>>3]=x,x=+_t[y+8>>3],k=E*+Di(+x),_t[_>>3]=k,x=E*+Zi(+x),_t[_+8>>3]=x}function G(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;if(B=bt,bt=bt+16|0,k=B,E=Ei(y,_)|0,(x+-1|0)>>>0>5||(E=(E|0)!=0,(x|0)==1&E))return k=-1,bt=B,k|0;do if(q(y,_,k)|0)E=-1;else if(E){E=((v[26352+(x<<2)>>2]|0)+5-(v[k>>2]|0)|0)%5|0;break}else{E=((v[26384+(x<<2)>>2]|0)+6-(v[k>>2]|0)|0)%6|0;break}while(!1);return k=E,bt=B,k|0}function q(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0;if(ht=bt,bt=bt+32|0,$=ht+16|0,Z=ht,E=id(y,_,$)|0,E|0)return x=E,bt=ht,x|0;B=uy(y,_)|0,ot=Wa(y,_)|0,A2(B,Z),E=y2(B,v[$>>2]|0)|0;do if(tn(B)|0){do switch(B|0){case 4:{k=0;break}case 14:{k=1;break}case 24:{k=2;break}case 38:{k=3;break}case 49:{k=4;break}case 58:{k=5;break}case 63:{k=6;break}case 72:{k=7;break}case 83:{k=8;break}case 97:{k=9;break}case 107:{k=10;break}case 117:{k=11;break}default:Ur(27795,27797,75,27806)}while(!1);if(U=v[26416+(k*24|0)+8>>2]|0,_=v[26416+(k*24|0)+16>>2]|0,y=v[$>>2]|0,(y|0)!=(v[Z>>2]|0)&&(Z=gf(B)|0,y=v[$>>2]|0,Z|(y|0)==(_|0)&&(E=(E+1|0)%6|0)),(ot|0)==3&(y|0)==(_|0)){E=(E+5|0)%6|0;break}(ot|0)==5&(y|0)==(U|0)&&(E=(E+1|0)%6|0)}while(!1);return v[x>>2]=E,x=0,bt=ht,x|0}function K(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0;if(ae=bt,bt=bt+32|0,se=ae+24|0,re=ae+20|0,Dt=ae+8|0,Ot=ae+16|0,kt=ae,Z=(Ei(y,_)|0)==0,Z=Z?6:5,ht=Me(y|0,_|0,52)|0,Tt()|0,ht=ht&15,Z>>>0<=x>>>0)return E=2,bt=ae,E|0;xt=(ht|0)==0,!xt&&(Zt=Re(7,0,(ht^15)*3|0)|0,(Zt&y|0)==0&((Tt()|0)&_|0)==0)?k=x:B=4;t:do if((B|0)==4){if(k=(Ei(y,_)|0)!=0,((k?4:5)|0)<(x|0)||q(y,_,se)|0||(B=(v[se>>2]|0)+x|0,k?k=26704+(((B|0)%5|0)<<2)|0:k=26736+(((B|0)%6|0)<<2)|0,Zt=v[k>>2]|0,(Zt|0)==7))return E=1,bt=ae,E|0;v[re>>2]=0,k=ps(y,_,Zt,re,Dt)|0;do if(!k){if($=Dt,ot=v[$>>2]|0,$=v[$+4>>2]|0,U=$>>>0<_>>>0|($|0)==(_|0)&ot>>>0<y>>>0,B=U?ot:y,U=U?$:_,!xt&&(xt=Re(7,0,(ht^15)*3|0)|0,(ot&xt|0)==0&($&(Tt()|0)|0)==0))k=x;else{if($=(x+-1+Z|0)%(Z|0)|0,k=Ei(y,_)|0,($|0)<0&&Ur(27795,27797,248,27822),Z=(k|0)!=0,((Z?4:5)|0)<($|0)&&Ur(27795,27797,248,27822),q(y,_,se)|0&&Ur(27795,27797,248,27822),k=(v[se>>2]|0)+$|0,Z?k=26704+(((k|0)%5|0)<<2)|0:k=26736+(((k|0)%6|0)<<2)|0,$=v[k>>2]|0,($|0)==7&&Ur(27795,27797,248,27822),v[Ot>>2]=0,k=ps(y,_,$,Ot,kt)|0,k|0)break;ot=kt,Z=v[ot>>2]|0,ot=v[ot+4>>2]|0;do if(ot>>>0<U>>>0|(ot|0)==(U|0)&Z>>>0<B>>>0){if(Ei(Z,ot)|0?B=X_(Z,ot,y,_)|0:B=v[26800+((((v[Ot>>2]|0)+(v[26768+($<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,k=Ei(Z,ot)|0,(B+-1|0)>>>0>5){k=-1,B=Z,U=ot;break}if(k=(k|0)!=0,(B|0)==1&k){k=-1,B=Z,U=ot;break}do if(q(Z,ot,se)|0)k=-1;else if(k){k=((v[26352+(B<<2)>>2]|0)+5-(v[se>>2]|0)|0)%5|0;break}else{k=((v[26384+(B<<2)>>2]|0)+6-(v[se>>2]|0)|0)%6|0;break}while(!1);B=Z,U=ot}else k=x;while(!1);$=Dt,ot=v[$>>2]|0,$=v[$+4>>2]|0}if((B|0)==(ot|0)&(U|0)==($|0)){if(Z=(Ei(ot,$)|0)!=0,Z?y=X_(ot,$,y,_)|0:y=v[26800+((((v[re>>2]|0)+(v[26768+(Zt<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,k=Ei(ot,$)|0,(y+-1|0)>>>0<=5&&(ye=(k|0)!=0,!((y|0)==1&ye)))do if(q(ot,$,se)|0)k=-1;else if(ye){k=((v[26352+(y<<2)>>2]|0)+5-(v[se>>2]|0)|0)%5|0;break}else{k=((v[26384+(y<<2)>>2]|0)+6-(v[se>>2]|0)|0)%6|0;break}while(!1);else k=-1;k=k+1|0,k=(k|0)==6|Z&(k|0)==5?0:k}_=U,y=B;break t}while(!1);return E=k,bt=ae,E|0}while(!1);return ye=Re(k|0,0,56)|0,se=Tt()|0|_&-2130706433|536870912,v[E>>2]=ye|y,v[E+4>>2]=se,E=0,bt=ae,E|0}function it(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;return B=(Ei(y,_)|0)==0,E=K(y,_,0,x)|0,k=(E|0)==0,B?!k||(E=K(y,_,1,x+8|0)|0,E|0)||(E=K(y,_,2,x+16|0)|0,E|0)||(E=K(y,_,3,x+24|0)|0,E|0)||(E=K(y,_,4,x+32|0)|0,E)?(B=E,B|0):K(y,_,5,x+40|0)|0:!k||(E=K(y,_,1,x+8|0)|0,E|0)||(E=K(y,_,2,x+16|0)|0,E|0)||(E=K(y,_,3,x+24|0)|0,E|0)||(E=K(y,_,4,x+32|0)|0,E|0)?(B=E,B|0):(B=x+40|0,v[B>>2]=0,v[B+4>>2]=0,B=0,B|0)}function ct(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0,$=0,Z=0;return Z=bt,bt=bt+192|0,k=Z,B=Z+168|0,U=Me(y|0,_|0,56)|0,Tt()|0,U=U&7,$=_&-2130706433|134217728,E=id(y,$,B)|0,E|0?($=E,bt=Z,$|0):(_=Me(y|0,_|0,52)|0,Tt()|0,_=_&15,Ei(y,$)|0?cy(B,_,U,1,k):_f(B,_,U,1,k),$=k+8|0,v[x>>2]=v[$>>2],v[x+4>>2]=v[$+4>>2],v[x+8>>2]=v[$+8>>2],v[x+12>>2]=v[$+12>>2],$=0,bt=Z,$|0)}function ut(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;return k=bt,bt=bt+16|0,x=k,!(!0&(_&2013265920|0)==536870912)||(E=_&-2130706433|134217728,!(zm(y,E)|0))?(E=0,bt=k,E|0):(B=Me(y|0,_|0,56)|0,Tt()|0,B=(K(y,E,B&7,x)|0)==0,E=x,E=B&((v[E>>2]|0)==(y|0)?(v[E+4>>2]|0)==(_|0):0)&1,bt=k,E|0)}function gt(y,_,x){y=y|0,_=_|0,x=x|0;var E=0;(_|0)>0?(E=Xt(_,4)|0,v[y>>2]=E,E||Ur(27835,27858,40,27872)):v[y>>2]=0,v[y+4>>2]=_,v[y+8>>2]=0,v[y+12>>2]=x}function yt(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0;k=y+4|0,B=y+12|0,U=y+8|0;t:for(;;){for(x=v[k>>2]|0,_=0;;){if((_|0)>=(x|0))break t;if(E=v[y>>2]|0,$=v[E+(_<<2)>>2]|0,!$)_=_+1|0;else break}_=E+(~~(+Bi(+(+Ko(10,+ +(15-(v[B>>2]|0)|0))*(+_t[$>>3]+ +_t[$+8>>3])))%+(x|0))>>>0<<2)|0,x=v[_>>2]|0;e:do if(x|0){if(E=$+32|0,(x|0)==($|0))v[_>>2]=v[E>>2];else{if(x=x+32|0,_=v[x>>2]|0,!_)break;for(;(_|0)!=($|0);)if(x=_+32|0,_=v[x>>2]|0,!_)break e;v[x>>2]=v[E>>2]}It($),v[U>>2]=(v[U>>2]|0)+-1}while(!1)}It(v[y>>2]|0)}function Pt(y){y=y|0;var _=0,x=0,E=0;for(E=v[y+4>>2]|0,x=0;;){if((x|0)>=(E|0)){_=0,x=4;break}if(_=v[(v[y>>2]|0)+(x<<2)>>2]|0,!_)x=x+1|0;else{x=4;break}}return(x|0)==4?_|0:0}function Ct(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;if(x=~~(+Bi(+(+Ko(10,+ +(15-(v[y+12>>2]|0)|0))*(+_t[_>>3]+ +_t[_+8>>3])))%+(v[y+4>>2]|0))>>>0,x=(v[y>>2]|0)+(x<<2)|0,E=v[x>>2]|0,!E)return B=1,B|0;B=_+32|0;do if((E|0)!=(_|0)){if(x=v[E+32>>2]|0,!x)return B=1,B|0;for(k=x;;){if((k|0)==(_|0)){k=8;break}if(x=v[k+32>>2]|0,x)E=k,k=x;else{x=1,k=10;break}}if((k|0)==8){v[E+32>>2]=v[B>>2];break}else if((k|0)==10)return x|0}else v[x>>2]=v[B>>2];while(!1);return It(_),B=y+8|0,v[B>>2]=(v[B>>2]|0)+-1,B=0,B|0}function Rt(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;B=Wt(40)|0,B||Ur(27888,27858,98,27901),v[B>>2]=v[_>>2],v[B+4>>2]=v[_+4>>2],v[B+8>>2]=v[_+8>>2],v[B+12>>2]=v[_+12>>2],k=B+16|0,v[k>>2]=v[x>>2],v[k+4>>2]=v[x+4>>2],v[k+8>>2]=v[x+8>>2],v[k+12>>2]=v[x+12>>2],v[B+32>>2]=0,k=~~(+Bi(+(+Ko(10,+ +(15-(v[y+12>>2]|0)|0))*(+_t[_>>3]+ +_t[_+8>>3])))%+(v[y+4>>2]|0))>>>0,k=(v[y>>2]|0)+(k<<2)|0,E=v[k>>2]|0;do if(!E)v[k>>2]=B;else{for(;!(sd(E,_)|0&&sd(E+16|0,x)|0);)if(k=v[E+32>>2]|0,E=(k|0)==0?E:k,!(v[E+32>>2]|0)){U=10;break}if((U|0)==10){v[E+32>>2]=B;break}return It(B),U=E,U|0}while(!1);return U=y+8|0,v[U>>2]=(v[U>>2]|0)+1,U=B,U|0}function Ut(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0;if(k=~~(+Bi(+(+Ko(10,+ +(15-(v[y+12>>2]|0)|0))*(+_t[_>>3]+ +_t[_+8>>3])))%+(v[y+4>>2]|0))>>>0,k=v[(v[y>>2]|0)+(k<<2)>>2]|0,!k)return x=0,x|0;if(!x){for(y=k;;){if(sd(y,_)|0){E=10;break}if(y=v[y+32>>2]|0,!y){y=0,E=10;break}}if((E|0)==10)return y|0}for(y=k;;){if(sd(y,_)|0&&sd(y+16|0,x)|0){E=10;break}if(y=v[y+32>>2]|0,!y){y=0,E=10;break}}return(E|0)==10?y|0:0}function Gt(y,_){y=y|0,_=_|0;var x=0;if(x=~~(+Bi(+(+Ko(10,+ +(15-(v[y+12>>2]|0)|0))*(+_t[_>>3]+ +_t[_+8>>3])))%+(v[y+4>>2]|0))>>>0,y=v[(v[y>>2]|0)+(x<<2)>>2]|0,!y)return x=0,x|0;for(;;){if(sd(y,_)|0){_=5;break}if(y=v[y+32>>2]|0,!y){y=0,_=5;break}}return(_|0)==5?y|0:0}function zt(){return 27920}function jt(y){return y=+y,~~+Do(+y)|0}function Wt(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0,Zt=0,re=0,ye=0,se=0,ae=0,Jt=0,Ve=0;Ve=bt,bt=bt+16|0,kt=Ve;do if(y>>>0<245){if(ot=y>>>0<11?16:y+11&-8,y=ot>>>3,xt=v[6981]|0,x=xt>>>y,x&3|0)return _=(x&1^1)+y|0,y=27964+(_<<1<<2)|0,x=y+8|0,E=v[x>>2]|0,k=E+8|0,B=v[k>>2]|0,(B|0)==(y|0)?v[6981]=xt&~(1<<_):(v[B+12>>2]=y,v[x>>2]=B),Jt=_<<3,v[E+4>>2]=Jt|3,Jt=E+Jt+4|0,v[Jt>>2]=v[Jt>>2]|1,Jt=k,bt=Ve,Jt|0;if(ht=v[6983]|0,ot>>>0>ht>>>0){if(x|0)return _=2<<y,_=x<<y&(_|0-_),_=(_&0-_)+-1|0,$=_>>>12&16,_=_>>>$,x=_>>>5&8,_=_>>>x,B=_>>>2&4,_=_>>>B,y=_>>>1&2,_=_>>>y,E=_>>>1&1,E=(x|$|B|y|E)+(_>>>E)|0,_=27964+(E<<1<<2)|0,y=_+8|0,B=v[y>>2]|0,$=B+8|0,x=v[$>>2]|0,(x|0)==(_|0)?(y=xt&~(1<<E),v[6981]=y):(v[x+12>>2]=_,v[y>>2]=x,y=xt),Jt=E<<3,U=Jt-ot|0,v[B+4>>2]=ot|3,k=B+ot|0,v[k+4>>2]=U|1,v[B+Jt>>2]=U,ht|0&&(E=v[6986]|0,_=ht>>>3,x=27964+(_<<1<<2)|0,_=1<<_,y&_?(y=x+8|0,_=v[y>>2]|0):(v[6981]=y|_,_=x,y=x+8|0),v[y>>2]=E,v[_+12>>2]=E,v[E+8>>2]=_,v[E+12>>2]=x),v[6983]=U,v[6986]=k,Jt=$,bt=Ve,Jt|0;if(B=v[6982]|0,B){for(x=(B&0-B)+-1|0,k=x>>>12&16,x=x>>>k,E=x>>>5&8,x=x>>>E,U=x>>>2&4,x=x>>>U,$=x>>>1&2,x=x>>>$,Z=x>>>1&1,Z=v[28228+((E|k|U|$|Z)+(x>>>Z)<<2)>>2]|0,x=Z,$=Z,Z=(v[Z+4>>2]&-8)-ot|0;y=v[x+16>>2]|0,!(!y&&(y=v[x+20>>2]|0,!y));)U=(v[y+4>>2]&-8)-ot|0,k=U>>>0<Z>>>0,x=y,$=k?y:$,Z=k?U:Z;if(U=$+ot|0,U>>>0>$>>>0){k=v[$+24>>2]|0,_=v[$+12>>2]|0;do if((_|0)==($|0)){if(y=$+20|0,_=v[y>>2]|0,!_&&(y=$+16|0,_=v[y>>2]|0,!_)){x=0;break}for(;;)if(E=_+20|0,x=v[E>>2]|0,x)_=x,y=E;else if(E=_+16|0,x=v[E>>2]|0,x)_=x,y=E;else break;v[y>>2]=0,x=_}else x=v[$+8>>2]|0,v[x+12>>2]=_,v[_+8>>2]=x,x=_;while(!1);do if(k|0){if(_=v[$+28>>2]|0,y=28228+(_<<2)|0,($|0)==(v[y>>2]|0)){if(v[y>>2]=x,!x){v[6982]=B&~(1<<_);break}}else if(Jt=k+16|0,v[((v[Jt>>2]|0)==($|0)?Jt:k+20|0)>>2]=x,!x)break;v[x+24>>2]=k,_=v[$+16>>2]|0,_|0&&(v[x+16>>2]=_,v[_+24>>2]=x),_=v[$+20>>2]|0,_|0&&(v[x+20>>2]=_,v[_+24>>2]=x)}while(!1);return Z>>>0<16?(Jt=Z+ot|0,v[$+4>>2]=Jt|3,Jt=$+Jt+4|0,v[Jt>>2]=v[Jt>>2]|1):(v[$+4>>2]=ot|3,v[U+4>>2]=Z|1,v[U+Z>>2]=Z,ht|0&&(E=v[6986]|0,_=ht>>>3,x=27964+(_<<1<<2)|0,_=1<<_,_&xt?(y=x+8|0,_=v[y>>2]|0):(v[6981]=_|xt,_=x,y=x+8|0),v[y>>2]=E,v[_+12>>2]=E,v[E+8>>2]=_,v[E+12>>2]=x),v[6983]=Z,v[6986]=U),Jt=$+8|0,bt=Ve,Jt|0}else xt=ot}else xt=ot}else xt=ot}else if(y>>>0<=4294967231)if(y=y+11|0,ot=y&-8,E=v[6982]|0,E){k=0-ot|0,y=y>>>8,y?ot>>>0>16777215?Z=31:(xt=(y+1048320|0)>>>16&8,Zt=y<<xt,$=(Zt+520192|0)>>>16&4,Zt=Zt<<$,Z=(Zt+245760|0)>>>16&2,Z=14-($|xt|Z)+(Zt<<Z>>>15)|0,Z=ot>>>(Z+7|0)&1|Z<<1):Z=0,x=v[28228+(Z<<2)>>2]|0;t:do if(!x)x=0,y=0,Zt=61;else for(y=0,$=ot<<((Z|0)==31?0:25-(Z>>>1)|0),B=0;;){if(U=(v[x+4>>2]&-8)-ot|0,U>>>0<k>>>0)if(U)y=x,k=U;else{y=x,k=0,Zt=65;break t}if(Zt=v[x+20>>2]|0,x=v[x+16+($>>>31<<2)>>2]|0,B=(Zt|0)==0|(Zt|0)==(x|0)?B:Zt,x)$=$<<1;else{x=B,Zt=61;break}}while(!1);if((Zt|0)==61){if((x|0)==0&(y|0)==0){if(y=2<<Z,y=(y|0-y)&E,!y){xt=ot;break}xt=(y&0-y)+-1|0,U=xt>>>12&16,xt=xt>>>U,B=xt>>>5&8,xt=xt>>>B,$=xt>>>2&4,xt=xt>>>$,Z=xt>>>1&2,xt=xt>>>Z,x=xt>>>1&1,y=0,x=v[28228+((B|U|$|Z|x)+(xt>>>x)<<2)>>2]|0}x?Zt=65:($=y,U=k)}if((Zt|0)==65)for(B=x;;)if(xt=(v[B+4>>2]&-8)-ot|0,x=xt>>>0<k>>>0,k=x?xt:k,y=x?B:y,x=v[B+16>>2]|0,x||(x=v[B+20>>2]|0),x)B=x;else{$=y,U=k;break}if(($|0)!=0&&U>>>0<((v[6983]|0)-ot|0)>>>0&&(ht=$+ot|0,ht>>>0>$>>>0)){B=v[$+24>>2]|0,_=v[$+12>>2]|0;do if((_|0)==($|0)){if(y=$+20|0,_=v[y>>2]|0,!_&&(y=$+16|0,_=v[y>>2]|0,!_)){_=0;break}for(;;)if(k=_+20|0,x=v[k>>2]|0,x)_=x,y=k;else if(k=_+16|0,x=v[k>>2]|0,x)_=x,y=k;else break;v[y>>2]=0}else Jt=v[$+8>>2]|0,v[Jt+12>>2]=_,v[_+8>>2]=Jt;while(!1);do if(B){if(y=v[$+28>>2]|0,x=28228+(y<<2)|0,($|0)==(v[x>>2]|0)){if(v[x>>2]=_,!_){E=E&~(1<<y),v[6982]=E;break}}else if(Jt=B+16|0,v[((v[Jt>>2]|0)==($|0)?Jt:B+20|0)>>2]=_,!_)break;v[_+24>>2]=B,y=v[$+16>>2]|0,y|0&&(v[_+16>>2]=y,v[y+24>>2]=_),y=v[$+20>>2]|0,y&&(v[_+20>>2]=y,v[y+24>>2]=_)}while(!1);t:do if(U>>>0<16)Jt=U+ot|0,v[$+4>>2]=Jt|3,Jt=$+Jt+4|0,v[Jt>>2]=v[Jt>>2]|1;else{if(v[$+4>>2]=ot|3,v[ht+4>>2]=U|1,v[ht+U>>2]=U,_=U>>>3,U>>>0<256){x=27964+(_<<1<<2)|0,y=v[6981]|0,_=1<<_,y&_?(y=x+8|0,_=v[y>>2]|0):(v[6981]=y|_,_=x,y=x+8|0),v[y>>2]=ht,v[_+12>>2]=ht,v[ht+8>>2]=_,v[ht+12>>2]=x;break}if(_=U>>>8,_?U>>>0>16777215?x=31:(ae=(_+1048320|0)>>>16&8,Jt=_<<ae,se=(Jt+520192|0)>>>16&4,Jt=Jt<<se,x=(Jt+245760|0)>>>16&2,x=14-(se|ae|x)+(Jt<<x>>>15)|0,x=U>>>(x+7|0)&1|x<<1):x=0,_=28228+(x<<2)|0,v[ht+28>>2]=x,y=ht+16|0,v[y+4>>2]=0,v[y>>2]=0,y=1<<x,!(E&y)){v[6982]=E|y,v[_>>2]=ht,v[ht+24>>2]=_,v[ht+12>>2]=ht,v[ht+8>>2]=ht;break}_=v[_>>2]|0;e:do if((v[_+4>>2]&-8|0)!=(U|0)){for(E=U<<((x|0)==31?0:25-(x>>>1)|0);x=_+16+(E>>>31<<2)|0,y=v[x>>2]|0,!!y;)if((v[y+4>>2]&-8|0)==(U|0)){_=y;break e}else E=E<<1,_=y;v[x>>2]=ht,v[ht+24>>2]=_,v[ht+12>>2]=ht,v[ht+8>>2]=ht;break t}while(!1);ae=_+8|0,Jt=v[ae>>2]|0,v[Jt+12>>2]=ht,v[ae>>2]=ht,v[ht+8>>2]=Jt,v[ht+12>>2]=_,v[ht+24>>2]=0}while(!1);return Jt=$+8|0,bt=Ve,Jt|0}else xt=ot}else xt=ot;else xt=-1;while(!1);if(x=v[6983]|0,x>>>0>=xt>>>0)return _=x-xt|0,y=v[6986]|0,_>>>0>15?(Jt=y+xt|0,v[6986]=Jt,v[6983]=_,v[Jt+4>>2]=_|1,v[y+x>>2]=_,v[y+4>>2]=xt|3):(v[6983]=0,v[6986]=0,v[y+4>>2]=x|3,Jt=y+x+4|0,v[Jt>>2]=v[Jt>>2]|1),Jt=y+8|0,bt=Ve,Jt|0;if(U=v[6984]|0,U>>>0>xt>>>0)return se=U-xt|0,v[6984]=se,Jt=v[6987]|0,ae=Jt+xt|0,v[6987]=ae,v[ae+4>>2]=se|1,v[Jt+4>>2]=xt|3,Jt=Jt+8|0,bt=Ve,Jt|0;if(v[7099]|0?y=v[7101]|0:(v[7101]=4096,v[7100]=4096,v[7102]=-1,v[7103]=-1,v[7104]=0,v[7092]=0,v[7099]=kt&-16^1431655768,y=4096),$=xt+48|0,Z=xt+47|0,B=y+Z|0,k=0-y|0,ot=B&k,ot>>>0<=xt>>>0||(y=v[7091]|0,y|0&&(ht=v[7089]|0,kt=ht+ot|0,kt>>>0<=ht>>>0|kt>>>0>y>>>0)))return Jt=0,bt=Ve,Jt|0;t:do if(v[7092]&4)_=0,Zt=143;else{x=v[6987]|0;e:do if(x){for(E=28372;kt=v[E>>2]|0,!(kt>>>0<=x>>>0&&(kt+(v[E+4>>2]|0)|0)>>>0>x>>>0);)if(y=v[E+8>>2]|0,y)E=y;else{Zt=128;break e}if(_=B-U&k,_>>>0<2147483647)if(y=ao(_|0)|0,(y|0)==((v[E>>2]|0)+(v[E+4>>2]|0)|0)){if((y|0)!=-1){U=_,B=y,Zt=145;break t}}else E=y,Zt=136;else _=0}else Zt=128;while(!1);do if((Zt|0)==128)if(x=ao(0)|0,(x|0)!=-1&&(_=x,Ot=v[7100]|0,Dt=Ot+-1|0,_=((Dt&_|0)==0?0:(Dt+_&0-Ot)-_|0)+ot|0,Ot=v[7089]|0,Dt=_+Ot|0,_>>>0>xt>>>0&_>>>0<2147483647)){if(kt=v[7091]|0,kt|0&&Dt>>>0<=Ot>>>0|Dt>>>0>kt>>>0){_=0;break}if(y=ao(_|0)|0,(y|0)==(x|0)){U=_,B=x,Zt=145;break t}else E=y,Zt=136}else _=0;while(!1);do if((Zt|0)==136){if(x=0-_|0,!($>>>0>_>>>0&(_>>>0<2147483647&(E|0)!=-1)))if((E|0)==-1){_=0;break}else{U=_,B=E,Zt=145;break t}if(y=v[7101]|0,y=Z-_+y&0-y,y>>>0>=2147483647){U=_,B=E,Zt=145;break t}if((ao(y|0)|0)==-1){ao(x|0)|0,_=0;break}else{U=y+_|0,B=E,Zt=145;break t}}while(!1);v[7092]=v[7092]|4,Zt=143}while(!1);if((Zt|0)==143&&ot>>>0<2147483647&&(se=ao(ot|0)|0,Dt=ao(0)|0,re=Dt-se|0,ye=re>>>0>(xt+40|0)>>>0,!((se|0)==-1|ye^1|se>>>0<Dt>>>0&((se|0)!=-1&(Dt|0)!=-1)^1))&&(U=ye?re:_,B=se,Zt=145),(Zt|0)==145){_=(v[7089]|0)+U|0,v[7089]=_,_>>>0>(v[7090]|0)>>>0&&(v[7090]=_),Z=v[6987]|0;t:do if(Z){for(_=28372;;){if(y=v[_>>2]|0,x=v[_+4>>2]|0,(B|0)==(y+x|0)){Zt=154;break}if(E=v[_+8>>2]|0,E)_=E;else break}if((Zt|0)==154&&(ae=_+4|0,(v[_+12>>2]&8|0)==0)&&B>>>0>Z>>>0&y>>>0<=Z>>>0){v[ae>>2]=x+U,Jt=(v[6984]|0)+U|0,se=Z+8|0,se=(se&7|0)==0?0:0-se&7,ae=Z+se|0,se=Jt-se|0,v[6987]=ae,v[6984]=se,v[ae+4>>2]=se|1,v[Z+Jt+4>>2]=40,v[6988]=v[7103];break}for(B>>>0<(v[6985]|0)>>>0&&(v[6985]=B),x=B+U|0,_=28372;;){if((v[_>>2]|0)==(x|0)){Zt=162;break}if(y=v[_+8>>2]|0,y)_=y;else break}if((Zt|0)==162&&(v[_+12>>2]&8|0)==0){v[_>>2]=B,ht=_+4|0,v[ht>>2]=(v[ht>>2]|0)+U,ht=B+8|0,ht=B+((ht&7|0)==0?0:0-ht&7)|0,_=x+8|0,_=x+((_&7|0)==0?0:0-_&7)|0,ot=ht+xt|0,$=_-ht-xt|0,v[ht+4>>2]=xt|3;e:do if((Z|0)==(_|0))Jt=(v[6984]|0)+$|0,v[6984]=Jt,v[6987]=ot,v[ot+4>>2]=Jt|1;else{if((v[6986]|0)==(_|0)){Jt=(v[6983]|0)+$|0,v[6983]=Jt,v[6986]=ot,v[ot+4>>2]=Jt|1,v[ot+Jt>>2]=Jt;break}if(y=v[_+4>>2]|0,(y&3|0)==1){U=y&-8,E=y>>>3;r:do if(y>>>0<256)if(y=v[_+8>>2]|0,x=v[_+12>>2]|0,(x|0)==(y|0)){v[6981]=v[6981]&~(1<<E);break}else{v[y+12>>2]=x,v[x+8>>2]=y;break}else{B=v[_+24>>2]|0,y=v[_+12>>2]|0;do if((y|0)==(_|0)){if(x=_+16|0,E=x+4|0,y=v[E>>2]|0,y)x=E;else if(y=v[x>>2]|0,!y){y=0;break}for(;;)if(k=y+20|0,E=v[k>>2]|0,E)y=E,x=k;else if(k=y+16|0,E=v[k>>2]|0,E)y=E,x=k;else break;v[x>>2]=0}else Jt=v[_+8>>2]|0,v[Jt+12>>2]=y,v[y+8>>2]=Jt;while(!1);if(!B)break;x=v[_+28>>2]|0,E=28228+(x<<2)|0;do if((v[E>>2]|0)!=(_|0)){if(Jt=B+16|0,v[((v[Jt>>2]|0)==(_|0)?Jt:B+20|0)>>2]=y,!y)break r}else{if(v[E>>2]=y,y|0)break;v[6982]=v[6982]&~(1<<x);break r}while(!1);if(v[y+24>>2]=B,x=_+16|0,E=v[x>>2]|0,E|0&&(v[y+16>>2]=E,v[E+24>>2]=y),x=v[x+4>>2]|0,!x)break;v[y+20>>2]=x,v[x+24>>2]=y}while(!1);_=_+U|0,k=U+$|0}else k=$;if(_=_+4|0,v[_>>2]=v[_>>2]&-2,v[ot+4>>2]=k|1,v[ot+k>>2]=k,_=k>>>3,k>>>0<256){x=27964+(_<<1<<2)|0,y=v[6981]|0,_=1<<_,y&_?(y=x+8|0,_=v[y>>2]|0):(v[6981]=y|_,_=x,y=x+8|0),v[y>>2]=ot,v[_+12>>2]=ot,v[ot+8>>2]=_,v[ot+12>>2]=x;break}_=k>>>8;do if(!_)E=0;else{if(k>>>0>16777215){E=31;break}ae=(_+1048320|0)>>>16&8,Jt=_<<ae,se=(Jt+520192|0)>>>16&4,Jt=Jt<<se,E=(Jt+245760|0)>>>16&2,E=14-(se|ae|E)+(Jt<<E>>>15)|0,E=k>>>(E+7|0)&1|E<<1}while(!1);if(_=28228+(E<<2)|0,v[ot+28>>2]=E,y=ot+16|0,v[y+4>>2]=0,v[y>>2]=0,y=v[6982]|0,x=1<<E,!(y&x)){v[6982]=y|x,v[_>>2]=ot,v[ot+24>>2]=_,v[ot+12>>2]=ot,v[ot+8>>2]=ot;break}_=v[_>>2]|0;r:do if((v[_+4>>2]&-8|0)!=(k|0)){for(E=k<<((E|0)==31?0:25-(E>>>1)|0);x=_+16+(E>>>31<<2)|0,y=v[x>>2]|0,!!y;)if((v[y+4>>2]&-8|0)==(k|0)){_=y;break r}else E=E<<1,_=y;v[x>>2]=ot,v[ot+24>>2]=_,v[ot+12>>2]=ot,v[ot+8>>2]=ot;break e}while(!1);ae=_+8|0,Jt=v[ae>>2]|0,v[Jt+12>>2]=ot,v[ae>>2]=ot,v[ot+8>>2]=Jt,v[ot+12>>2]=_,v[ot+24>>2]=0}while(!1);return Jt=ht+8|0,bt=Ve,Jt|0}for(_=28372;y=v[_>>2]|0,!(y>>>0<=Z>>>0&&(Jt=y+(v[_+4>>2]|0)|0,Jt>>>0>Z>>>0));)_=v[_+8>>2]|0;k=Jt+-47|0,y=k+8|0,y=k+((y&7|0)==0?0:0-y&7)|0,k=Z+16|0,y=y>>>0<k>>>0?Z:y,_=y+8|0,x=U+-40|0,se=B+8|0,se=(se&7|0)==0?0:0-se&7,ae=B+se|0,se=x-se|0,v[6987]=ae,v[6984]=se,v[ae+4>>2]=se|1,v[B+x+4>>2]=40,v[6988]=v[7103],x=y+4|0,v[x>>2]=27,v[_>>2]=v[7093],v[_+4>>2]=v[7094],v[_+8>>2]=v[7095],v[_+12>>2]=v[7096],v[7093]=B,v[7094]=U,v[7096]=0,v[7095]=_,_=y+24|0;do ae=_,_=_+4|0,v[_>>2]=7;while((ae+8|0)>>>0<Jt>>>0);if((y|0)!=(Z|0)){if(B=y-Z|0,v[x>>2]=v[x>>2]&-2,v[Z+4>>2]=B|1,v[y>>2]=B,_=B>>>3,B>>>0<256){x=27964+(_<<1<<2)|0,y=v[6981]|0,_=1<<_,y&_?(y=x+8|0,_=v[y>>2]|0):(v[6981]=y|_,_=x,y=x+8|0),v[y>>2]=Z,v[_+12>>2]=Z,v[Z+8>>2]=_,v[Z+12>>2]=x;break}if(_=B>>>8,_?B>>>0>16777215?E=31:(ae=(_+1048320|0)>>>16&8,Jt=_<<ae,se=(Jt+520192|0)>>>16&4,Jt=Jt<<se,E=(Jt+245760|0)>>>16&2,E=14-(se|ae|E)+(Jt<<E>>>15)|0,E=B>>>(E+7|0)&1|E<<1):E=0,x=28228+(E<<2)|0,v[Z+28>>2]=E,v[Z+20>>2]=0,v[k>>2]=0,_=v[6982]|0,y=1<<E,!(_&y)){v[6982]=_|y,v[x>>2]=Z,v[Z+24>>2]=x,v[Z+12>>2]=Z,v[Z+8>>2]=Z;break}_=v[x>>2]|0;e:do if((v[_+4>>2]&-8|0)!=(B|0)){for(E=B<<((E|0)==31?0:25-(E>>>1)|0);x=_+16+(E>>>31<<2)|0,y=v[x>>2]|0,!!y;)if((v[y+4>>2]&-8|0)==(B|0)){_=y;break e}else E=E<<1,_=y;v[x>>2]=Z,v[Z+24>>2]=_,v[Z+12>>2]=Z,v[Z+8>>2]=Z;break t}while(!1);ae=_+8|0,Jt=v[ae>>2]|0,v[Jt+12>>2]=Z,v[ae>>2]=Z,v[Z+8>>2]=Jt,v[Z+12>>2]=_,v[Z+24>>2]=0}}else Jt=v[6985]|0,(Jt|0)==0|B>>>0<Jt>>>0&&(v[6985]=B),v[7093]=B,v[7094]=U,v[7096]=0,v[6990]=v[7099],v[6989]=-1,v[6994]=27964,v[6993]=27964,v[6996]=27972,v[6995]=27972,v[6998]=27980,v[6997]=27980,v[7e3]=27988,v[6999]=27988,v[7002]=27996,v[7001]=27996,v[7004]=28004,v[7003]=28004,v[7006]=28012,v[7005]=28012,v[7008]=28020,v[7007]=28020,v[7010]=28028,v[7009]=28028,v[7012]=28036,v[7011]=28036,v[7014]=28044,v[7013]=28044,v[7016]=28052,v[7015]=28052,v[7018]=28060,v[7017]=28060,v[7020]=28068,v[7019]=28068,v[7022]=28076,v[7021]=28076,v[7024]=28084,v[7023]=28084,v[7026]=28092,v[7025]=28092,v[7028]=28100,v[7027]=28100,v[7030]=28108,v[7029]=28108,v[7032]=28116,v[7031]=28116,v[7034]=28124,v[7033]=28124,v[7036]=28132,v[7035]=28132,v[7038]=28140,v[7037]=28140,v[7040]=28148,v[7039]=28148,v[7042]=28156,v[7041]=28156,v[7044]=28164,v[7043]=28164,v[7046]=28172,v[7045]=28172,v[7048]=28180,v[7047]=28180,v[7050]=28188,v[7049]=28188,v[7052]=28196,v[7051]=28196,v[7054]=28204,v[7053]=28204,v[7056]=28212,v[7055]=28212,Jt=U+-40|0,se=B+8|0,se=(se&7|0)==0?0:0-se&7,ae=B+se|0,se=Jt-se|0,v[6987]=ae,v[6984]=se,v[ae+4>>2]=se|1,v[B+Jt+4>>2]=40,v[6988]=v[7103];while(!1);if(_=v[6984]|0,_>>>0>xt>>>0)return se=_-xt|0,v[6984]=se,Jt=v[6987]|0,ae=Jt+xt|0,v[6987]=ae,v[ae+4>>2]=se|1,v[Jt+4>>2]=xt|3,Jt=Jt+8|0,bt=Ve,Jt|0}return Jt=zt()|0,v[Jt>>2]=12,Jt=0,bt=Ve,Jt|0}function It(y){y=y|0;var _=0,x=0,E=0,k=0,B=0,U=0,$=0,Z=0;if(y){x=y+-8|0,k=v[6985]|0,y=v[y+-4>>2]|0,_=y&-8,Z=x+_|0;do if(y&1)$=x,U=x;else{if(E=v[x>>2]|0,!(y&3)||(U=x+(0-E)|0,B=E+_|0,U>>>0<k>>>0))return;if((v[6986]|0)==(U|0)){if(y=Z+4|0,_=v[y>>2]|0,(_&3|0)!=3){$=U,_=B;break}v[6983]=B,v[y>>2]=_&-2,v[U+4>>2]=B|1,v[U+B>>2]=B;return}if(x=E>>>3,E>>>0<256)if(y=v[U+8>>2]|0,_=v[U+12>>2]|0,(_|0)==(y|0)){v[6981]=v[6981]&~(1<<x),$=U,_=B;break}else{v[y+12>>2]=_,v[_+8>>2]=y,$=U,_=B;break}k=v[U+24>>2]|0,y=v[U+12>>2]|0;do if((y|0)==(U|0)){if(_=U+16|0,x=_+4|0,y=v[x>>2]|0,y)_=x;else if(y=v[_>>2]|0,!y){y=0;break}for(;;)if(E=y+20|0,x=v[E>>2]|0,x)y=x,_=E;else if(E=y+16|0,x=v[E>>2]|0,x)y=x,_=E;else break;v[_>>2]=0}else $=v[U+8>>2]|0,v[$+12>>2]=y,v[y+8>>2]=$;while(!1);if(k){if(_=v[U+28>>2]|0,x=28228+(_<<2)|0,(v[x>>2]|0)==(U|0)){if(v[x>>2]=y,!y){v[6982]=v[6982]&~(1<<_),$=U,_=B;break}}else if($=k+16|0,v[((v[$>>2]|0)==(U|0)?$:k+20|0)>>2]=y,!y){$=U,_=B;break}v[y+24>>2]=k,_=U+16|0,x=v[_>>2]|0,x|0&&(v[y+16>>2]=x,v[x+24>>2]=y),_=v[_+4>>2]|0,_?(v[y+20>>2]=_,v[_+24>>2]=y,$=U,_=B):($=U,_=B)}else $=U,_=B}while(!1);if(!(U>>>0>=Z>>>0)&&(y=Z+4|0,E=v[y>>2]|0,!!(E&1))){if(E&2)v[y>>2]=E&-2,v[$+4>>2]=_|1,v[U+_>>2]=_,k=_;else{if((v[6987]|0)==(Z|0)){if(Z=(v[6984]|0)+_|0,v[6984]=Z,v[6987]=$,v[$+4>>2]=Z|1,($|0)!=(v[6986]|0))return;v[6986]=0,v[6983]=0;return}if((v[6986]|0)==(Z|0)){Z=(v[6983]|0)+_|0,v[6983]=Z,v[6986]=U,v[$+4>>2]=Z|1,v[U+Z>>2]=Z;return}k=(E&-8)+_|0,x=E>>>3;do if(E>>>0<256)if(_=v[Z+8>>2]|0,y=v[Z+12>>2]|0,(y|0)==(_|0)){v[6981]=v[6981]&~(1<<x);break}else{v[_+12>>2]=y,v[y+8>>2]=_;break}else{B=v[Z+24>>2]|0,y=v[Z+12>>2]|0;do if((y|0)==(Z|0)){if(_=Z+16|0,x=_+4|0,y=v[x>>2]|0,y)_=x;else if(y=v[_>>2]|0,!y){x=0;break}for(;;)if(E=y+20|0,x=v[E>>2]|0,x)y=x,_=E;else if(E=y+16|0,x=v[E>>2]|0,x)y=x,_=E;else break;v[_>>2]=0,x=y}else x=v[Z+8>>2]|0,v[x+12>>2]=y,v[y+8>>2]=x,x=y;while(!1);if(B|0){if(y=v[Z+28>>2]|0,_=28228+(y<<2)|0,(v[_>>2]|0)==(Z|0)){if(v[_>>2]=x,!x){v[6982]=v[6982]&~(1<<y);break}}else if(E=B+16|0,v[((v[E>>2]|0)==(Z|0)?E:B+20|0)>>2]=x,!x)break;v[x+24>>2]=B,y=Z+16|0,_=v[y>>2]|0,_|0&&(v[x+16>>2]=_,v[_+24>>2]=x),y=v[y+4>>2]|0,y|0&&(v[x+20>>2]=y,v[y+24>>2]=x)}}while(!1);if(v[$+4>>2]=k|1,v[U+k>>2]=k,($|0)==(v[6986]|0)){v[6983]=k;return}}if(y=k>>>3,k>>>0<256){x=27964+(y<<1<<2)|0,_=v[6981]|0,y=1<<y,_&y?(_=x+8|0,y=v[_>>2]|0):(v[6981]=_|y,y=x,_=x+8|0),v[_>>2]=$,v[y+12>>2]=$,v[$+8>>2]=y,v[$+12>>2]=x;return}y=k>>>8,y?k>>>0>16777215?E=31:(U=(y+1048320|0)>>>16&8,Z=y<<U,B=(Z+520192|0)>>>16&4,Z=Z<<B,E=(Z+245760|0)>>>16&2,E=14-(B|U|E)+(Z<<E>>>15)|0,E=k>>>(E+7|0)&1|E<<1):E=0,y=28228+(E<<2)|0,v[$+28>>2]=E,v[$+20>>2]=0,v[$+16>>2]=0,_=v[6982]|0,x=1<<E;t:do if(!(_&x))v[6982]=_|x,v[y>>2]=$,v[$+24>>2]=y,v[$+12>>2]=$,v[$+8>>2]=$;else{y=v[y>>2]|0;e:do if((v[y+4>>2]&-8|0)!=(k|0)){for(E=k<<((E|0)==31?0:25-(E>>>1)|0);x=y+16+(E>>>31<<2)|0,_=v[x>>2]|0,!!_;)if((v[_+4>>2]&-8|0)==(k|0)){y=_;break e}else E=E<<1,y=_;v[x>>2]=$,v[$+24>>2]=y,v[$+12>>2]=$,v[$+8>>2]=$;break t}while(!1);U=y+8|0,Z=v[U>>2]|0,v[Z+12>>2]=$,v[U>>2]=$,v[$+8>>2]=Z,v[$+12>>2]=y,v[$+24>>2]=0}while(!1);if(Z=(v[6989]|0)+-1|0,v[6989]=Z,!(Z|0)){for(y=28380;y=v[y>>2]|0,y;)y=y+8|0;v[6989]=-1}}}}function Xt(y,_){y=y|0,_=_|0;var x=0;return y?(x=Bs(_,y)|0,(_|y)>>>0>65535&&(x=((x>>>0)/(y>>>0)|0|0)==(_|0)?x:-1)):x=0,y=Wt(x)|0,!y||!(v[y+-4>>2]&3)||pn(y|0,0,x|0)|0,y|0}function Kt(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,x=y+x>>>0,ni(_+E+(x>>>0<y>>>0|0)>>>0|0),x|0|0}function de(y,_,x,E){return y=y|0,_=_|0,x=x|0,E=E|0,E=_-E-(x>>>0>y>>>0|0)>>>0,ni(E|0),y-x>>>0|0|0}function le(y){return y=y|0,(y?31-(gl(y^y-1)|0)|0:32)|0}function me(y,_,x,E,k){y=y|0,_=_|0,x=x|0,E=E|0,k=k|0;var B=0,U=0,$=0,Z=0,ot=0,ht=0,xt=0,kt=0,Ot=0,Dt=0;if(ht=y,Z=_,ot=Z,U=x,kt=E,$=kt,!ot)return B=(k|0)!=0,$?B?(v[k>>2]=y|0,v[k+4>>2]=_&0,kt=0,k=0,ni(kt|0),k|0):(kt=0,k=0,ni(kt|0),k|0):(B&&(v[k>>2]=(ht>>>0)%(U>>>0),v[k+4>>2]=0),kt=0,k=(ht>>>0)/(U>>>0)>>>0,ni(kt|0),k|0);B=($|0)==0;do if(U){if(!B){if(B=(gl($|0)|0)-(gl(ot|0)|0)|0,B>>>0<=31){xt=B+1|0,$=31-B|0,_=B-31>>31,U=xt,y=ht>>>(xt>>>0)&_|ot<<$,_=ot>>>(xt>>>0)&_,B=0,$=ht<<$;break}return k?(v[k>>2]=y|0,v[k+4>>2]=Z|_&0,kt=0,k=0,ni(kt|0),k|0):(kt=0,k=0,ni(kt|0),k|0)}if(B=U-1|0,B&U|0){$=(gl(U|0)|0)+33-(gl(ot|0)|0)|0,Dt=64-$|0,xt=32-$|0,Z=xt>>31,Ot=$-32|0,_=Ot>>31,U=$,y=xt-1>>31&ot>>>(Ot>>>0)|(ot<<xt|ht>>>($>>>0))&_,_=_&ot>>>($>>>0),B=ht<<Dt&Z,$=(ot<<Dt|ht>>>(Ot>>>0))&Z|ht<<xt&$-33>>31;break}return k|0&&(v[k>>2]=B&ht,v[k+4>>2]=0),(U|0)==1?(Ot=Z|_&0,Dt=y|0|0,ni(Ot|0),Dt|0):(Dt=le(U|0)|0,Ot=ot>>>(Dt>>>0)|0,Dt=ot<<32-Dt|ht>>>(Dt>>>0)|0,ni(Ot|0),Dt|0)}else{if(B)return k|0&&(v[k>>2]=(ot>>>0)%(U>>>0),v[k+4>>2]=0),Ot=0,Dt=(ot>>>0)/(U>>>0)>>>0,ni(Ot|0),Dt|0;if(!ht)return k|0&&(v[k>>2]=0,v[k+4>>2]=(ot>>>0)%($>>>0)),Ot=0,Dt=(ot>>>0)/($>>>0)>>>0,ni(Ot|0),Dt|0;if(B=$-1|0,!(B&$))return k|0&&(v[k>>2]=y|0,v[k+4>>2]=B&ot|_&0),Ot=0,Dt=ot>>>((le($|0)|0)>>>0),ni(Ot|0),Dt|0;if(B=(gl($|0)|0)-(gl(ot|0)|0)|0,B>>>0<=30){_=B+1|0,$=31-B|0,U=_,y=ot<<$|ht>>>(_>>>0),_=ot>>>(_>>>0),B=0,$=ht<<$;break}return k?(v[k>>2]=y|0,v[k+4>>2]=Z|_&0,Ot=0,Dt=0,ni(Ot|0),Dt|0):(Ot=0,Dt=0,ni(Ot|0),Dt|0)}while(!1);if(!U)ot=$,Z=0,$=0;else{xt=x|0|0,ht=kt|E&0,ot=Kt(xt|0,ht|0,-1,-1)|0,x=Tt()|0,Z=$,$=0;do E=Z,Z=B>>>31|Z<<1,B=$|B<<1,E=y<<1|E>>>31|0,kt=y>>>31|_<<1|0,de(ot|0,x|0,E|0,kt|0)|0,Dt=Tt()|0,Ot=Dt>>31|((Dt|0)<0?-1:0)<<1,$=Ot&1,y=de(E|0,kt|0,Ot&xt|0,(((Dt|0)<0?-1:0)>>31|((Dt|0)<0?-1:0)<<1)&ht|0)|0,_=Tt()|0,U=U-1|0;while((U|0)!=0);ot=Z,Z=0}return U=0,k|0&&(v[k>>2]=y,v[k+4>>2]=_),Ot=(B|0)>>>31|(ot|U)<<1|(U<<1|B>>>31)&0|Z,Dt=(B<<1|0)&-2|$,ni(Ot|0),Dt|0}function Le(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0;return ot=_>>31|((_|0)<0?-1:0)<<1,Z=((_|0)<0?-1:0)>>31|((_|0)<0?-1:0)<<1,B=E>>31|((E|0)<0?-1:0)<<1,k=((E|0)<0?-1:0)>>31|((E|0)<0?-1:0)<<1,$=de(ot^y|0,Z^_|0,ot|0,Z|0)|0,U=Tt()|0,y=B^ot,_=k^Z,de((me($,U,de(B^x|0,k^E|0,B|0,k|0)|0,Tt()|0,0)|0)^y|0,(Tt()|0)^_|0,y|0,_|0)|0}function $e(y,_){y=y|0,_=_|0;var x=0,E=0,k=0,B=0;return B=y&65535,k=_&65535,x=Bs(k,B)|0,E=y>>>16,y=(x>>>16)+(Bs(k,E)|0)|0,k=_>>>16,_=Bs(k,B)|0,ni((y>>>16)+(Bs(k,E)|0)+(((y&65535)+_|0)>>>16)|0),y+_<<16|x&65535|0|0}function Ee(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0;return k=y,B=x,x=$e(k,B)|0,y=Tt()|0,ni((Bs(_,B)|0)+(Bs(E,k)|0)+y|y&0|0),x|0|0|0}function sr(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0,U=0,$=0,Z=0,ot=0;return k=bt,bt=bt+16|0,$=k|0,U=_>>31|((_|0)<0?-1:0)<<1,B=((_|0)<0?-1:0)>>31|((_|0)<0?-1:0)<<1,ot=E>>31|((E|0)<0?-1:0)<<1,Z=((E|0)<0?-1:0)>>31|((E|0)<0?-1:0)<<1,y=de(U^y|0,B^_|0,U|0,B|0)|0,_=Tt()|0,me(y,_,de(ot^x|0,Z^E|0,ot|0,Z|0)|0,Tt()|0,$)|0,E=de(v[$>>2]^U|0,v[$+4>>2]^B|0,U|0,B|0)|0,x=Tt()|0,bt=k,ni(x|0),E|0}function ur(y,_,x,E){y=y|0,_=_|0,x=x|0,E=E|0;var k=0,B=0;return B=bt,bt=bt+16|0,k=B|0,me(y,_,x,E,k)|0,bt=B,ni(v[k+4>>2]|0),v[k>>2]|0|0}function ji(y,_,x){return y=y|0,_=_|0,x=x|0,(x|0)<32?(ni(_>>x|0),y>>>x|(_&(1<<x)-1)<<32-x):(ni(((_|0)<0?-1:0)|0),_>>x-32|0)}function Me(y,_,x){return y=y|0,_=_|0,x=x|0,(x|0)<32?(ni(_>>>x|0),y>>>x|(_&(1<<x)-1)<<32-x):(ni(0),_>>>x-32|0)}function Re(y,_,x){return y=y|0,_=_|0,x=x|0,(x|0)<32?(ni(_<<x|(y&(1<<x)-1<<32-x)>>>32-x|0),y<<x):(ni(y<<x-32|0),0)}function wn(y,_,x){return y=y|0,_=_|0,x=x|0,_=gl(_)|0,(_|0)==32&&(_=_+(gl(y)|0)|0),ni(0),_|0}function fn(y,_){return y=+y,_=+_,y!=y?+_:_!=_?+y:+q_(+y,+_)}function oo(y,_){return y=+y,_=+_,y!=y?+_:_!=_?+y:+Mm(+y,+_)}function en(y){return y=+y,y>=0?+Ro(y+.5):+mf(y-.5)}function so(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0;if((x|0)>=8192)return d2(y|0,_|0,x|0)|0,y|0;if(B=y|0,k=y+x|0,(y&3)==(_&3)){for(;y&3;){if(!x)return B|0;Be[y>>0]=Be[_>>0]|0,y=y+1|0,_=_+1|0,x=x-1|0}for(x=k&-4|0,E=x-64|0;(y|0)<=(E|0);)v[y>>2]=v[_>>2],v[y+4>>2]=v[_+4>>2],v[y+8>>2]=v[_+8>>2],v[y+12>>2]=v[_+12>>2],v[y+16>>2]=v[_+16>>2],v[y+20>>2]=v[_+20>>2],v[y+24>>2]=v[_+24>>2],v[y+28>>2]=v[_+28>>2],v[y+32>>2]=v[_+32>>2],v[y+36>>2]=v[_+36>>2],v[y+40>>2]=v[_+40>>2],v[y+44>>2]=v[_+44>>2],v[y+48>>2]=v[_+48>>2],v[y+52>>2]=v[_+52>>2],v[y+56>>2]=v[_+56>>2],v[y+60>>2]=v[_+60>>2],y=y+64|0,_=_+64|0;for(;(y|0)<(x|0);)v[y>>2]=v[_>>2],y=y+4|0,_=_+4|0}else for(x=k-4|0;(y|0)<(x|0);)Be[y>>0]=Be[_>>0]|0,Be[y+1>>0]=Be[_+1>>0]|0,Be[y+2>>0]=Be[_+2>>0]|0,Be[y+3>>0]=Be[_+3>>0]|0,y=y+4|0,_=_+4|0;for(;(y|0)<(k|0);)Be[y>>0]=Be[_>>0]|0,y=y+1|0,_=_+1|0;return B|0}function pn(y,_,x){y=y|0,_=_|0,x=x|0;var E=0,k=0,B=0,U=0;if(B=y+x|0,_=_&255,(x|0)>=67){for(;y&3;)Be[y>>0]=_,y=y+1|0;for(E=B&-4|0,U=_|_<<8|_<<16|_<<24,k=E-64|0;(y|0)<=(k|0);)v[y>>2]=U,v[y+4>>2]=U,v[y+8>>2]=U,v[y+12>>2]=U,v[y+16>>2]=U,v[y+20>>2]=U,v[y+24>>2]=U,v[y+28>>2]=U,v[y+32>>2]=U,v[y+36>>2]=U,v[y+40>>2]=U,v[y+44>>2]=U,v[y+48>>2]=U,v[y+52>>2]=U,v[y+56>>2]=U,v[y+60>>2]=U,y=y+64|0;for(;(y|0)<(E|0);)v[y>>2]=U,y=y+4|0}for(;(y|0)<(B|0);)Be[y>>0]=_,y=y+1|0;return B-x|0}function Do(y){return y=+y,y>=0?+Ro(y+.5):+mf(y-.5)}function ao(y){y=y|0;var _=0,x=0,E=0;return E=h2()|0,x=v[$a>>2]|0,_=x+y|0,(y|0)>0&(_|0)<(x|0)|(_|0)<0?(H_(_|0)|0,Em(12),-1):(_|0)>(E|0)&&!(f2(_|0)|0)?(Em(12),-1):(v[$a>>2]=_,x|0)}return{___divdi3:Le,___muldi3:Ee,___remdi3:sr,___uremdi3:ur,_areNeighborCells:w2,_bitshift64Ashr:ji,_bitshift64Lshr:Me,_bitshift64Shl:Re,_calloc:Xt,_cellAreaKm2:C2,_cellAreaM2:bc,_cellAreaRads2:Ym,_cellToBoundary:su,_cellToCenterChild:ia,_cellToChildPos:M2,_cellToChildren:_c,_cellToChildrenSize:Qp,_cellToLatLng:nd,_cellToLocalIj:CM,_cellToParent:Kp,_cellToVertex:K,_cellToVertexes:it,_cellsToDirectedEdge:vo,_cellsToLinkedMultiPolygon:Z_,_childPosToCell:$m,_compactCells:Um,_constructCell:ov,_destroyLinkedMultiPolygon:r0,_directedEdgeToBoundary:yc,_directedEdgeToCells:Hp,_edgeLengthKm:fr,_edgeLengthM:Mr,_edgeLengthRads:bf,_emscripten_replace_memory:Pm,_free:It,_getBaseCellNumber:uy,_getDirectedEdgeDestination:Ga,_getDirectedEdgeOrigin:td,_getHexagonAreaAvgKm2:P2,_getHexagonAreaAvgM2:Wm,_getHexagonEdgeLengthAvgKm:qm,_getHexagonEdgeLengthAvgM:cv,_getIcosahedronFaces:dy,_getIndexDigit:Nm,_getNumCells:Hm,_getPentagons:od,_getRes0Cells:km,_getResolution:nv,_greatCircleDistanceKm:Gm,_greatCircleDistanceM:E2,_greatCircleDistanceRads:lv,_gridDisk:QA,_gridDiskDistances:Yh,_gridDistance:Zm,_gridPathCells:xo,_gridPathCellsSize:dn,_gridRing:TM,_gridRingUnsafe:m2,_i64Add:Kt,_i64Subtract:de,_isPentagon:Ei,_isResClassIII:vf,_isValidCell:zm,_isValidDirectedEdge:qp,_isValidIndex:Zp,_isValidVertex:ut,_latLngToCell:ir,_llvm_ctlz_i64:wn,_llvm_maxnum_f64:fn,_llvm_minnum_f64:oo,_llvm_round_f64:en,_localIjToCell:IM,_malloc:Wt,_maxFaceCount:ih,_maxGridDiskSize:p2,_maxPolygonToCellsSize:g2,_maxPolygonToCellsSizeExperimental:xc,_memcpy:so,_memset:pn,_originToDirectedEdges:ly,_pentagonCount:PM,_polygonToCells:JA,_polygonToCellsExperimental:uv,_readInt64AsDoubleFromPointer:c,_res0CellCount:ry,_round:Do,_sbrk:ao,_sizeOfCellBoundary:hv,_sizeOfCoordIJ:I,_sizeOfGeoLoop:dv,_sizeOfGeoPolygon:Jm,_sizeOfH3Index:yy,_sizeOfLatLng:ud,_sizeOfLinkedGeoPolygon:fv,_uncompactCells:Al,_uncompactCellsSize:Vm,_vertexToLatLng:ct,establishStackSpace:KA,stackAlloc:Ju,stackRestore:ZA,stackSave:Y_}})(jh,k_,Nt),_M=t.___divdi3=je.___divdi3,VA=t.___muldi3=je.___muldi3,R_=t.___remdi3=je.___remdi3,r2=t.___uremdi3=je.___uremdi3,Ye=t._areNeighborCells=je._areNeighborCells,cf=t._bitshift64Ashr=je._bitshift64Ashr,Os=t._bitshift64Lshr=je._bitshift64Lshr,D_=t._bitshift64Shl=je._bitshift64Shl,$h=t._calloc=je._calloc,Je=t._cellAreaKm2=je._cellAreaKm2,Hr=t._cellAreaM2=je._cellAreaM2,gi=t._cellAreaRads2=je._cellAreaRads2,fl=t._cellToBoundary=je._cellToBoundary,kp=t._cellToCenterChild=je._cellToCenterChild,Gh=t._cellToChildPos=je._cellToChildPos,fi=t._cellToChildren=je._cellToChildren,jA=t._cellToChildrenSize=je._cellToChildrenSize,Rp=t._cellToLatLng=je._cellToLatLng,_m=t._cellToLocalIj=je._cellToLocalIj,Dp=t._cellToParent=je._cellToParent,vm=t._cellToVertex=je._cellToVertex,uf=t._cellToVertexes=je._cellToVertexes,tu=t._cellsToDirectedEdge=je._cellsToDirectedEdge,fs=t._cellsToLinkedMultiPolygon=je._cellsToLinkedMultiPolygon,Nn=t._childPosToCell=je._childPosToCell,O_=t._compactCells=je._compactCells,bm=t._constructCell=je._constructCell,Op=t._destroyLinkedMultiPolygon=je._destroyLinkedMultiPolygon,hf=t._directedEdgeToBoundary=je._directedEdgeToBoundary,pl=t._directedEdgeToCells=je._directedEdgeToCells,$A=t._edgeLengthKm=je._edgeLengthKm,Zo=t._edgeLengthM=je._edgeLengthM,i2=t._edgeLengthRads=je._edgeLengthRads,Wh=t._emscripten_replace_memory=je._emscripten_replace_memory,Lp=t._free=je._free,n2=t._getBaseCellNumber=je._getBaseCellNumber,vM=t._getDirectedEdgeDestination=je._getDirectedEdgeDestination,bM=t._getDirectedEdgeOrigin=je._getDirectedEdgeOrigin,L_=t._getHexagonAreaAvgKm2=je._getHexagonAreaAvgKm2,o2=t._getHexagonAreaAvgM2=je._getHexagonAreaAvgM2,GA=t._getHexagonEdgeLengthAvgKm=je._getHexagonEdgeLengthAvgKm,B_=t._getHexagonEdgeLengthAvgM=je._getHexagonEdgeLengthAvgM,s2=t._getIcosahedronFaces=je._getIcosahedronFaces,F_=t._getIndexDigit=je._getIndexDigit,N_=t._getNumCells=je._getNumCells,xM=t._getPentagons=je._getPentagons,xm=t._getRes0Cells=je._getRes0Cells,WA=t._getResolution=je._getResolution,z_=t._greatCircleDistanceKm=je._greatCircleDistanceKm,eu=t._greatCircleDistanceM=je._greatCircleDistanceM,a2=t._greatCircleDistanceRads=je._greatCircleDistanceRads,wM=t._gridDisk=je._gridDisk,Gl=t._gridDiskDistances=je._gridDiskDistances,Bp=t._gridDistance=je._gridDistance,Mi=t._gridPathCells=je._gridPathCells,U_=t._gridPathCellsSize=je._gridPathCellsSize,l2=t._gridRing=je._gridRing,qA=t._gridRingUnsafe=je._gridRingUnsafe,yo=t._i64Add=je._i64Add,Fr=t._i64Subtract=je._i64Subtract,jo=t._isPentagon=je._isPentagon,Hn=t._isResClassIII=je._isResClassIII,Yn=t._isValidCell=je._isValidCell,c2=t._isValidDirectedEdge=je._isValidDirectedEdge,ta=t._isValidIndex=je._isValidIndex,ea=t._isValidVertex=je._isValidVertex,ra=t._latLngToCell=je._latLngToCell,V_=t._llvm_ctlz_i64=je._llvm_ctlz_i64,df=t._llvm_maxnum_f64=je._llvm_maxnum_f64,Xn=t._llvm_minnum_f64=je._llvm_minnum_f64,wm=t._llvm_round_f64=je._llvm_round_f64,ru=t._localIjToCell=je._localIjToCell,Xu=t._malloc=je._malloc,Wl=t._maxFaceCount=je._maxFaceCount,j_=t._maxGridDiskSize=je._maxGridDiskSize,Zu=t._maxPolygonToCellsSize=je._maxPolygonToCellsSize,HA=t._maxPolygonToCellsSizeExperimental=je._maxPolygonToCellsSizeExperimental,Rn=t._memcpy=je._memcpy,Fp=t._memset=je._memset,Ii=t._originToDirectedEdges=je._originToDirectedEdges,ii=t._pentagonCount=je._pentagonCount,Tm=t._polygonToCells=je._polygonToCells,ke=t._polygonToCellsExperimental=je._polygonToCellsExperimental,or=t._readInt64AsDoubleFromPointer=je._readInt64AsDoubleFromPointer,Ar=t._res0CellCount=je._res0CellCount,_i=t._round=je._round,Xi=t._sbrk=je._sbrk,no=t._sizeOfCellBoundary=je._sizeOfCellBoundary,zn=t._sizeOfCoordIJ=je._sizeOfCoordIJ,iu=t._sizeOfGeoLoop=je._sizeOfGeoLoop,Ku=t._sizeOfGeoPolygon=je._sizeOfGeoPolygon,qh=t._sizeOfH3Index=je._sizeOfH3Index,Np=t._sizeOfLatLng=je._sizeOfLatLng,ql=t._sizeOfLinkedGeoPolygon=je._sizeOfLinkedGeoPolygon,Li=t._uncompactCells=je._uncompactCells,Hl=t._uncompactCellsSize=je._uncompactCellsSize,Ls=t._vertexToLatLng=je._vertexToLatLng,ff=t.establishStackSpace=je.establishStackSpace,ko=t.stackAlloc=je.stackAlloc,YA=t.stackRestore=je.stackRestore,Qu=t.stackSave=je.stackSave;if(t.asm=je,t.cwrap=rt,t.setValue=z,t.getValue=W,Va){Cp(Va)||(Va=s(Va));{FA(\"memory initializer\");var Sm=function(pe){pe.byteLength&&(pe=new Uint8Array(pe)),Yt.set(pe,R),t.memoryInitializerRequest&&delete t.memoryInitializerRequest.response,NA(\"memory initializer\")},$_=function(){a(Va,Sm,function(){throw\"could not load memory initializer \"+Va})},Hh=Ds(Va);if(Hh)Sm(Hh.buffer);else if(t.memoryInitializerRequest){var zp=function(){var pe=t.memoryInitializerRequest,De=pe.response;if(pe.status!==200&&pe.status!==0){var Ke=Ds(t.memoryInitializerRequestURL);if(Ke)De=Ke.buffer;else{console.warn(\"a problem seems to have happened with Module.memoryInitializerRequest, status: \"+pe.status+\", retrying \"+Va),$_();return}}Sm(De)};t.memoryInitializerRequest.response?setTimeout(zp,0):t.memoryInitializerRequest.addEventListener(\"load\",zp)}else $_()}}var Up;Vl=function pe(){Up||G_(),Up||(Vl=pe)};function G_(pe){if(pe=pe||n,Rs>0||(Ui(),Rs>0))return;function De(){Up||(Up=!0,!Y&&(ln(),Io(),t.onRuntimeInitialized&&t.onRuntimeInitialized(),qn()))}t.setStatus?(t.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){t.setStatus(\"\")},1),De()},1)):De()}t.run=G_;function Ac(pe){throw t.onAbort&&t.onAbort(pe),pe+=\"\",h(pe),p(pe),Y=!0,\"abort(\"+pe+\"). Build with -s ASSERTIONS=1 for more info.\"}if(t.abort=Ac,t.preInit)for(typeof t.preInit==\"function\"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return G_(),e})(typeof Cs==\"object\"?Cs:{}),Jr=\"number\",Kr=Jr,WT=Jr,ai=Jr,li=Jr,ll=Jr,yr=Jr,Pie=[[\"sizeOfH3Index\",Jr],[\"sizeOfLatLng\",Jr],[\"sizeOfCellBoundary\",Jr],[\"sizeOfGeoLoop\",Jr],[\"sizeOfGeoPolygon\",Jr],[\"sizeOfLinkedGeoPolygon\",Jr],[\"sizeOfCoordIJ\",Jr],[\"readInt64AsDoubleFromPointer\",Jr],[\"isValidCell\",WT,[ai,li]],[\"isValidIndex\",WT,[ai,li]],[\"latLngToCell\",Kr,[Jr,Jr,ll,yr]],[\"cellToLatLng\",Kr,[ai,li,yr]],[\"cellToBoundary\",Kr,[ai,li,yr]],[\"maxGridDiskSize\",Kr,[Jr,yr]],[\"gridDisk\",Kr,[ai,li,Jr,yr]],[\"gridDiskDistances\",Kr,[ai,li,Jr,yr,yr]],[\"gridRing\",Kr,[ai,li,Jr,yr]],[\"gridRingUnsafe\",Kr,[ai,li,Jr,yr]],[\"maxPolygonToCellsSize\",Kr,[yr,ll,Jr,yr]],[\"polygonToCells\",Kr,[yr,ll,Jr,yr]],[\"maxPolygonToCellsSizeExperimental\",Kr,[yr,ll,Jr,yr]],[\"polygonToCellsExperimental\",Kr,[yr,ll,Jr,Jr,Jr,yr]],[\"cellsToLinkedMultiPolygon\",Kr,[yr,Jr,yr]],[\"destroyLinkedMultiPolygon\",null,[yr]],[\"compactCells\",Kr,[yr,yr,Jr,Jr]],[\"uncompactCells\",Kr,[yr,Jr,Jr,yr,Jr,ll]],[\"uncompactCellsSize\",Kr,[yr,Jr,Jr,ll,yr]],[\"isPentagon\",WT,[ai,li]],[\"isResClassIII\",WT,[ai,li]],[\"getBaseCellNumber\",Jr,[ai,li]],[\"getResolution\",Jr,[ai,li]],[\"getIndexDigit\",Jr,[ai,li,Jr]],[\"constructCell\",Kr,[Jr,Jr,yr,yr]],[\"maxFaceCount\",Kr,[ai,li,yr]],[\"getIcosahedronFaces\",Kr,[ai,li,yr]],[\"cellToParent\",Kr,[ai,li,ll,yr]],[\"cellToChildren\",Kr,[ai,li,ll,yr]],[\"cellToCenterChild\",Kr,[ai,li,ll,yr]],[\"cellToChildrenSize\",Kr,[ai,li,ll,yr]],[\"cellToChildPos\",Kr,[ai,li,ll,yr]],[\"childPosToCell\",Kr,[Jr,Jr,ai,li,ll,yr]],[\"areNeighborCells\",Kr,[ai,li,ai,li,yr]],[\"cellsToDirectedEdge\",Kr,[ai,li,ai,li,yr]],[\"getDirectedEdgeOrigin\",Kr,[ai,li,yr]],[\"getDirectedEdgeDestination\",Kr,[ai,li,yr]],[\"isValidDirectedEdge\",WT,[ai,li]],[\"directedEdgeToCells\",Kr,[ai,li,yr]],[\"originToDirectedEdges\",Kr,[ai,li,yr]],[\"directedEdgeToBoundary\",Kr,[ai,li,yr]],[\"gridDistance\",Kr,[ai,li,ai,li,yr]],[\"gridPathCells\",Kr,[ai,li,ai,li,yr]],[\"gridPathCellsSize\",Kr,[ai,li,ai,li,yr]],[\"cellToLocalIj\",Kr,[ai,li,ai,li,Jr,yr]],[\"localIjToCell\",Kr,[ai,li,yr,Jr,yr]],[\"getHexagonAreaAvgM2\",Kr,[ll,yr]],[\"getHexagonAreaAvgKm2\",Kr,[ll,yr]],[\"getHexagonEdgeLengthAvgM\",Kr,[ll,yr]],[\"getHexagonEdgeLengthAvgKm\",Kr,[ll,yr]],[\"greatCircleDistanceM\",Jr,[yr,yr]],[\"greatCircleDistanceKm\",Jr,[yr,yr]],[\"greatCircleDistanceRads\",Jr,[yr,yr]],[\"cellAreaM2\",Kr,[ai,li,yr]],[\"cellAreaKm2\",Kr,[ai,li,yr]],[\"cellAreaRads2\",Kr,[ai,li,yr]],[\"edgeLengthM\",Kr,[ai,li,yr]],[\"edgeLengthKm\",Kr,[ai,li,yr]],[\"edgeLengthRads\",Kr,[ai,li,yr]],[\"getNumCells\",Kr,[ll,yr]],[\"getRes0Cells\",Kr,[yr]],[\"res0CellCount\",Jr],[\"getPentagons\",Kr,[Jr,yr]],[\"pentagonCount\",Jr],[\"cellToVertex\",Kr,[ai,li,Jr,yr]],[\"cellToVertexes\",Kr,[ai,li,yr]],[\"vertexToLatLng\",Kr,[ai,li,yr]],[\"isValidVertex\",WT,[ai,li]]],Cie=0,Iie=1,kie=2,Rie=3,uMt=4,Die=5,Oie=6,Lie=7,Bie=8,Fie=9,Nie=10,zie=11,Uie=12,Vie=13,jie=14,$ie=15,Gie=16,Wie=17,qie=18,Hie=19,Ks={};Ks[Cie]=\"Success\";Ks[Iie]=\"The operation failed but a more specific error is not available\";Ks[kie]=\"Argument was outside of acceptable range\";Ks[Rie]=\"Latitude or longitude arguments were outside of acceptable range\";Ks[uMt]=\"Resolution argument was outside of acceptable range\";Ks[Die]=\"Cell argument was not valid\";Ks[Oie]=\"Directed edge argument was not valid\";Ks[Lie]=\"Undirected edge argument was not valid\";Ks[Bie]=\"Vertex argument was not valid\";Ks[Fie]=\"Pentagon distortion was encountered\";Ks[Nie]=\"Duplicate input\";Ks[zie]=\"Cell arguments were not neighbors\";Ks[Uie]=\"Cell arguments had incompatible resolutions\";Ks[Vie]=\"Memory allocation failed\";Ks[jie]=\"Bounds of provided memory were insufficient\";Ks[$ie]=\"Mode or flags argument was not valid\";Ks[Gie]=\"Index argument was not valid\";Ks[Wie]=\"Base cell number was outside of acceptable range\";Ks[qie]=\"Child indexing digits invalid\";Ks[Hie]=\"Child indexing digits refer to a deleted subsequence\";var hMt=1e3,Yie=1001,dMt=1002,bz={};bz[hMt]=\"Unknown unit\";bz[Yie]=\"Array length out of bounds\";bz[dMt]=\"Got unexpected null value for H3 index\";var Xie=\"Unknown error\";function fMt(e,t,r){var i=r&&\"value\"in r,n=new Error((e[t]||Xie)+\" (code: \"+t+(i?\", value: \"+r.value:\"\")+\")\");return n.code=t,n}function pMt(e,t){var r=arguments.length===2?{value:t}:{};return fMt(Ks,e,r)}function mMt(e,t){var r=arguments.length===2?{value:t}:{};return fMt(bz,e,r)}function HT(e){if(e!==0)throw pMt(e)}var cl={};Pie.forEach(function(t){cl[t[0]]=Cs.cwrap.apply(Cs,t)});var qT=16;var Zie=4;var Ox=8,Kie=8,Met=cl.sizeOfH3Index(),gMt=cl.sizeOfLatLng(),Qie=cl.sizeOfCellBoundary(),S0r=cl.sizeOfGeoPolygon(),M0r=cl.sizeOfGeoLoop(),E0r=cl.sizeOfLinkedGeoPolygon(),P0r=cl.sizeOfCoordIJ(),lMt={m:\"m\",m2:\"m2\",km:\"km\",km2:\"km2\",rads:\"rads\",rads2:\"rads2\"};function Jie(e){if(typeof e!=\"number\"||e<0||e>15||Math.floor(e)!==e)throw pMt(uMt,e);return e}function tne(e){if(!e)throw mMt(dMt);return e}var C0r=Math.pow(2,32)-1;var ene=/[^0-9a-fA-F]/;function YT(e){if(Array.isArray(e)&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1]))return e;if(typeof e!=\"string\"||ene.test(e))return[0,0];var t=parseInt(e.substring(0,e.length-8),qT),r=parseInt(e.substring(e.length-8),qT);return[r,t]}function cMt(e){if(e>=0)return e.toString(qT);e=e&2147483647;var t=AMt(8,e.toString(qT)),r=(parseInt(t[0],qT)+8).toString(qT);return t=r+t.substring(1),t}function rne(e,t){return cMt(t)+AMt(8,cMt(e))}function AMt(e,t){for(var r=e-t.length,i=\"\",n=0;n<r;n++)i+=\"0\";return i=i+t,i}var I0r=Math.pow(2,32);function ine(e,t){t===void 0&&(t=0);var r=Cs.getValue(e+Met*t,\"i32\"),i=Cs.getValue(e+Met*t+Zie,\"i32\");return i?rne(r,i):null}function nne(e,t){return t===void 0&&(t=0),Cs.getValue(e+Ox*t,\"double\")}function one(e){return cl.readInt64AsDoubleFromPointer(e)}function vz(e){return cne(Cs.getValue(e,\"double\"))}function yMt(e){return[vz(e),vz(e+Ox)]}function sne(e){return[vz(e+Ox),vz(e)]}function ane(e,t,r){for(var i=Cs.getValue(e,\"i32\"),n=e+Ox,o=[],s=t?sne:yMt,a=0;a<i*2;a+=2)o.push(s(n+Ox*a));return r&&o.push(o[0]),o}function _Mt(e){var t=YT(e),r=t[0],i=t[1];return!!cl.isPentagon(r,i)}function vMt(e){var t=YT(e),r=t[0],i=t[1];return cl.isValidCell(r,i)?cl.getResolution(r,i):-1}function bMt(e,t,r){var i=Cs._malloc(gMt);Cs.HEAPF64.set([e,t].map(lne),i/Ox);var n=Cs._malloc(Met);try{return HT(cl.latLngToCell(i,r,n)),tne(ine(n))}finally{Cs._free(n),Cs._free(i)}}function P8(e){var t=Cs._malloc(gMt),r=YT(e),i=r[0],n=r[1];try{return HT(cl.cellToLatLng(i,n,t)),yMt(t)}finally{Cs._free(t)}}function xMt(e,t){var r=Cs._malloc(Qie),i=YT(e),n=i[0],o=i[1];try{return HT(cl.cellToBoundary(n,o,r)),ane(r,t,t)}finally{Cs._free(r)}}function wMt(e,t){var r=YT(e),i=r[0],n=r[1],o=YT(t),s=o[0],a=o[1],h=Cs._malloc(Kie);try{return HT(cl.gridDistance(i,n,s,a,h)),one(h)}finally{Cs._free(h)}}function TMt(e,t){Jie(e);var r=Cs._malloc(Ox);try{switch(t){case lMt.m:HT(cl.getHexagonEdgeLengthAvgM(e,r));break;case lMt.km:HT(cl.getHexagonEdgeLengthAvgKm(e,r));break;default:throw mMt(hMt,t)}return nne(r)}finally{Cs._free(r)}}function lne(e){return e*Math.PI/180}function cne(e){return e*180/Math.PI}function SMt(e,t){t=t===void 0?e[0][0]:t;for(let r of e){let i=r[0]-t;i>180?r[0]-=360:i<-180&&(r[0]+=360)}}function une(e,t,r){let[i,n]=P8(e),o=t.length;SMt(t,n);let s=t[0]===t[o-1]?o-1:o;for(let a=0;a<s;a++)t[a][0]=rc(n,t[a][0],r),t[a][1]=rc(i,t[a][1],r)}function MMt(e,t,r){let i=e(t,r),[n,o]=P8(i);return[o,n]}function Eet(e,t=1){let r=xMt(e,!0);return t!==1?une(e,r,t):SMt(r),r}function xz(e){let t=new Float64Array(e.length*2),r=0;for(let i of e)t[r++]=i[0],t[r++]=i[1];return t}var hne={getPentagon:{type:\"accessor\",value:e=>e.pentagon}},C8=class extends zT{indexToBounds(){let{data:t,getPentagon:r}=this.props;return{data:t,_normalize:!1,_windingOrder:\"CCW\",positionFormat:\"XY\",getPolygon:(i,n)=>{let o=r(i,n),s=sMt(typeof o==\"string\"?aMt(o):o,{closedRing:!0,segments:\"auto\"});return xz(s)}}}};C8.layerName=\"A5Layer\";C8.defaultProps=hne;var wz=C8;var Tz=xe(Pet(),1),dne=3,fne=30,pne=2*fne+1,PMt=180/Math.PI;function IMt(e,t,r){let i=1<<t;return[(e[0]+r[0])/i,(e[1]+r[1])/i]}function CMt(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function kMt(e){return[CMt(e[0]),CMt(e[1])]}function RMt(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error(\"Invalid face\")}}function DMt([e,t,r]){let i=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*PMt,i*PMt]}function OMt(e){let t=Tz.default.fromString(e,!0,10).toString(2);for(;t.length<dne+pne;)t=\"0\"+t;let r=t.lastIndexOf(\"1\"),i=t.substring(0,3),n=t.substring(3,r),o=n.length/2,s=Tz.default.fromString(i,!0,2).toString(10),a=Tz.default.fromString(n,!0,2).toString(4);for(;a.length<o;)a=\"0\"+a;return`${s}/${a}`}function mne(e,t,r,i){if(i===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let n=t[0];t[0]=t[1],t[1]=n}}function LMt(e){let t=e.split(\"/\"),r=parseInt(t[0],10),i=t[1],n=i.length,o=[0,0],s;for(let a=n-1;a>=0;a--){s=n-a;let h=i[a],p=0,g=0;h===\"1\"?g=1:h===\"2\"?(p=1,g=1):h===\"3\"&&(p=1);let w=Math.pow(2,s-1);mne(w,o,p,g),o[0]+=w*p,o[1]+=w*g}if(r%2===1){let a=o[0];o[0]=o[1],o[1]=a}return{face:r,ij:o,level:s}}var BMt=xe(Pet(),1);function gne(e){let t=e.padEnd(16,\"0\");return BMt.default.fromString(t,16)}var Ane=100;function yne({face:e,ij:t,level:r}){let i=[[0,0],[0,1],[1,1],[1,0],[0,0]],n=Math.max(1,Math.ceil(Ane*Math.pow(2,-r))),o=new Float64Array(4*n*2+2),s=0,a=0;for(let h=0;h<4;h++){let p=i[h].slice(0),g=i[h+1],w=(g[0]-p[0])/n,C=(g[1]-p[1])/n;for(let R=0;R<n;R++){p[0]+=w,p[1]+=C;let z=IMt(t,r,p),W=kMt(z),Y=RMt(e,W),H=DMt(Y);Math.abs(H[1])>89.999&&(H[0]=a);let Q=H[0]-a;H[0]+=Q>180?-360:Q<-180?360:0,o[s++]=H[0],o[s++]=H[1],a=H[0]}}return o[s++]=o[0],o[s++]=o[1],o}function _ne(e){if(typeof e==\"string\"){if(e.indexOf(\"/\")>0)return e;e=gne(e)}return OMt(e.toString())}function FMt(e){let t=_ne(e),r=LMt(t);return yne(r)}var vne={getS2Token:{type:\"accessor\",value:e=>e.token}},k8=class extends zT{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:\"XY\",getPolygon:(i,n)=>FMt(r(i,n))}}};k8.layerName=\"S2Layer\";k8.defaultProps=vne;var Sz=k8;var Mz=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,\"west\"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error(\"byteLength not defined in tile data\"),t}async _loadData({getData:t,requestScheduler:r,onLoad:i,onError:n}){let{index:o,id:s,bbox:a,userData:h,zoom:p}=this,g=this._loaderId;this._abortController=new AbortController;let{signal:w}=this._abortController,C=await r.scheduleRequest(this,W=>W.isSelected?1:-1);if(!C){this._isCancelled=!0;return}if(this._isCancelled){C.done();return}let R=null,z;try{R=await t({index:o,id:s,bbox:a,userData:h,zoom:p,signal:w})}catch(W){z=W||!0}finally{C.done()}if(g===this._loaderId){if(this._loader=void 0,this.content=R,this._isCancelled&&!R){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,z?n(z,this):i(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var Qs={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var NMt=new rr,bne=new rr,XT=class e{constructor(t=[0,0,0],r=[0,0,0],i){i=i||NMt.copy(t).add(r).scale(.5),this.center=new rr(i),this.halfDiagonal=new rr(r).subtract(this.center),this.minimum=new rr(t),this.maximum=new rr(r)}clone(){return new e(this.minimum,this.maximum,this.center)}equals(t){return this===t||!!t&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,i=bne.from(t.normal),n=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),o=this.center.dot(i)+t.distance;return o-n>0?Qs.INSIDE:o+n<0?Qs.OUTSIDE:Qs.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=NMt.from(t).subtract(this.center),{halfDiagonal:i}=this,n=0,o;return o=Math.abs(r.x)-i.x,o>0&&(n+=o*o),o=Math.abs(r.y)-i.y,o>0&&(n+=o*o),o=Math.abs(r.z)-i.z,o>0&&(n+=o*o),n}};var R8=new rr,zMt=new rr,ZT=class e{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new rr,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=R8.from(r),this.center=new rr().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||!!t&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new e(this.center,this.radius)}union(t){let r=this.center,i=this.radius,n=t.center,o=t.radius,s=R8.copy(n).subtract(r),a=s.magnitude();if(i>=a+o)return this.clone();if(o>=a+i)return t.clone();let h=(i+a+o)*.5;return zMt.copy(s).scale((-i+h)/a).add(r),this.center.copy(zMt),this.radius=h,this}expand(t){let i=R8.from(t).subtract(this.center).magnitude();return i>this.radius&&(this.radius=i),this}transform(t){this.center.transform(t);let r=Gs.getScaling(R8,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let i=R8.from(t).subtract(this.center);return Math.max(0,i.len()-this.radius)}intersectPlane(t){let r=this.center,i=this.radius,o=t.normal.dot(r)+t.distance;return o<-i?Qs.OUTSIDE:o<i?Qs.INTERSECTING:Qs.INSIDE}};var xne=new rr,wne=new rr,Ez=new rr,Pz=new rr,Cz=new rr,Tne=new rr,Sne=new rr,TA={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},D8=class e{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new rr().from(t),this.halfAxes=new es(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new rr(t).len(),new rr(r).len(),new rr(i).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),n=new rr(t).normalize(),o=new rr(r).normalize(),s=new rr(i).normalize();return new b3().fromMatrix3(new es([...n,...o,...s]))}fromCenterHalfSizeQuaternion(t,r,i){let n=new b3(i),o=new es().fromQuaternion(n);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new rr().from(t),this.halfAxes=o,this}clone(){return new e(this.center,this.halfAxes)}equals(t){return this===t||!!t&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new ZT){let r=this.halfAxes,i=r.getColumn(0,Ez),n=r.getColumn(1,Pz),o=r.getColumn(2,Cz),s=xne.copy(i).add(n).add(o);return t.center.copy(this.center),t.radius=s.magnitude(),t}intersectPlane(t){let r=this.center,i=t.normal,n=this.halfAxes,o=i.x,s=i.y,a=i.z,h=Math.abs(o*n[TA.COLUMN0ROW0]+s*n[TA.COLUMN0ROW1]+a*n[TA.COLUMN0ROW2])+Math.abs(o*n[TA.COLUMN1ROW0]+s*n[TA.COLUMN1ROW1]+a*n[TA.COLUMN1ROW2])+Math.abs(o*n[TA.COLUMN2ROW0]+s*n[TA.COLUMN2ROW1]+a*n[TA.COLUMN2ROW2]),p=i.dot(r)+t.distance;return p<=-h?Qs.OUTSIDE:p>=h?Qs.INSIDE:Qs.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=wne.from(t).subtract(this.center),i=this.halfAxes,n=i.getColumn(0,Ez),o=i.getColumn(1,Pz),s=i.getColumn(2,Cz),a=n.magnitude(),h=o.magnitude(),p=s.magnitude();n.normalize(),o.normalize(),s.normalize();let g=0,w;return w=Math.abs(r.dot(n))-a,w>0&&(g+=w*w),w=Math.abs(r.dot(o))-h,w>0&&(g+=w*w),w=Math.abs(r.dot(s))-p,w>0&&(g+=w*w),g}computePlaneDistances(t,r,i=[-0,-0]){let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,h=a.getColumn(0,Ez),p=a.getColumn(1,Pz),g=a.getColumn(2,Cz),w=Tne.copy(h).add(p).add(g).add(s),C=Sne.copy(w).subtract(t),R=r.dot(C);return n=Math.min(R,n),o=Math.max(R,o),w.copy(s).add(h).add(p).subtract(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),w.copy(s).add(h).subtract(p).add(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),w.copy(s).add(h).subtract(p).subtract(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),s.copy(w).subtract(h).add(p).add(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),s.copy(w).subtract(h).add(p).subtract(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),s.copy(w).subtract(h).subtract(p).add(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),s.copy(w).subtract(h).subtract(p).subtract(g),C.copy(w).subtract(t),R=r.dot(C),n=Math.min(R,n),o=Math.max(R,o),i[0]=n,i[1]=o,i}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,Ez);r.transformAsPoint(t);let i=this.halfAxes.getColumn(1,Pz);i.transformAsPoint(t);let n=this.halfAxes.getColumn(2,Cz);return n.transformAsPoint(t),this.halfAxes=new es([...r,...i,...n]),this}getTransform(){throw new Error(\"not implemented\")}};var UMt=new rr,VMt=new rr,yp=class e{constructor(t=[0,0,1],r=0){this.normal=new rr,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return y0(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=UMt.from(t),this.normal.from(r).normalize();let i=-this.normal.dot(t);return this.distance=i,this}fromCoefficients(t,r,i,n){return this.normal.set(t,r,i),y0($s(this.normal.len(),1)),this.distance=n,this}clone(){return new e(this.normal,this.distance)}equals(t){return $s(this.distance,t.distance)&&$s(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=VMt.copy(this.normal).transformAsVector(t).normalize(),i=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(i,r)}projectPointOntoPlane(t,r=[0,0,0]){let i=UMt.from(t),n=this.getPointDistance(i),o=VMt.copy(this.normal).scale(n);return i.subtract(o).to(r)}};var jMt=[new rr([1,0,0]),new rr([0,1,0]),new rr([0,0,1])],$Mt=new rr,Mne=new rr,_p=class e{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*jMt.length;let r=t.center,i=t.radius,n=0;for(let o of jMt){let s=this.planes[n],a=this.planes[n+1];s||(s=this.planes[n]=new yp),a||(a=this.planes[n+1]=new yp);let h=$Mt.copy(o).scale(-i).add(r);s.fromPointNormal(h,o);let p=$Mt.copy(o).scale(i).add(r),g=Mne.copy(o).negate();a.fromPointNormal(p,g),n+=2}return this}computeVisibility(t){let r=Qs.INSIDE;for(let i of this.planes)switch(t.intersectPlane(i)){case Qs.OUTSIDE:return Qs.OUTSIDE;case Qs.INTERSECTING:r=Qs.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(y0(Number.isFinite(r),\"parentPlaneMask is required.\"),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;let i=e.MASK_INSIDE,n=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&(r&s)===0)continue;let a=n[o],h=t.intersectPlane(a);if(h===Qs.OUTSIDE)return e.MASK_OUTSIDE;h===Qs.INTERSECTING&&(i|=s)}return i}};_p.MASK_OUTSIDE=4294967295;_p.MASK_INSIDE=0;_p.MASK_INDETERMINATE=2147483647;var fmr=new rr,pmr=new rr,mmr=new rr,gmr=new rr,Amr=new rr;var wmr=new rr,Tmr=new rr,Smr=new rr,Mmr=new rr,Emr=new rr,Pmr=new rr,Cmr=new rr,Imr=new rr,kmr=new rr,Rmr=new rr,Dmr=new rr,Omr=new rr;var om=new es,Pne=new es,Cne=new es,Iz=new es,GMt=new es;function ket(e,t={}){let r=$E.EPSILON20,i=10,n=0,o=0,s=Pne,a=Cne;s.identity(),a.copy(e);let h=r*Ine(a);for(;o<i&&kne(a)>h;)Rne(a,Iz),GMt.copy(Iz).transpose(),a.multiplyRight(Iz),a.multiplyLeft(GMt),s.multiplyRight(Iz),++n>2&&(++o,n=0);return t.unitary=s.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function Ine(e){let t=0;for(let r=0;r<9;++r){let i=e[r];t+=i*i}return Math.sqrt(t)}var Cet=[1,0,0],Iet=[2,2,1];function kne(e){let t=0;for(let r=0;r<3;++r){let i=e[om.getElementIndex(Iet[r],Cet[r])];t+=2*i*i}return Math.sqrt(t)}function Rne(e,t){let r=$E.EPSILON15,i=0,n=1;for(let p=0;p<3;++p){let g=Math.abs(e[om.getElementIndex(Iet[p],Cet[p])]);g>i&&(n=p,i=g)}let o=Cet[n],s=Iet[n],a=1,h=0;if(Math.abs(e[om.getElementIndex(s,o)])>r){let p=e[om.getElementIndex(s,s)],g=e[om.getElementIndex(o,o)],w=e[om.getElementIndex(s,o)],C=(p-g)/2/w,R;C<0?R=-1/(-C+Math.sqrt(1+C*C)):R=1/(C+Math.sqrt(1+C*C)),a=1/Math.sqrt(1+R*R),h=R*a}return es.IDENTITY.to(t),t[om.getElementIndex(o,o)]=t[om.getElementIndex(s,s)]=a,t[om.getElementIndex(s,o)]=h,t[om.getElementIndex(o,s)]=-h,t}var h_=new rr,Dne=new rr,One=new rr,Lne=new rr,Bne=new rr,Fne=new es,Nne={diagonal:new es,unitary:new es};function O8(e,t=new D8){if(!e||e.length===0)return t.halfAxes=new es([0,0,0,0,0,0,0,0,0]),t.center=new rr,t;let r=e.length,i=new rr(0,0,0);for(let ft of e)i.add(ft);let n=1/r;i.multiplyByScalar(n);let o=0,s=0,a=0,h=0,p=0,g=0;for(let ft of e){let dt=h_.copy(ft).subtract(i);o+=dt.x*dt.x,s+=dt.x*dt.y,a+=dt.x*dt.z,h+=dt.y*dt.y,p+=dt.y*dt.z,g+=dt.z*dt.z}o*=n,s*=n,a*=n,h*=n,p*=n,g*=n;let w=Fne;w[0]=o,w[1]=s,w[2]=a,w[3]=s,w[4]=h,w[5]=p,w[6]=a,w[7]=p,w[8]=g;let{unitary:C}=ket(w,Nne),R=t.halfAxes.copy(C),z=R.getColumn(0,One),W=R.getColumn(1,Lne),Y=R.getColumn(2,Bne),H=-Number.MAX_VALUE,Q=-Number.MAX_VALUE,tt=-Number.MAX_VALUE,rt=Number.MAX_VALUE,at=Number.MAX_VALUE,et=Number.MAX_VALUE;for(let ft of e)h_.copy(ft),H=Math.max(h_.dot(z),H),Q=Math.max(h_.dot(W),Q),tt=Math.max(h_.dot(Y),tt),rt=Math.min(h_.dot(z),rt),at=Math.min(h_.dot(W),at),et=Math.min(h_.dot(Y),et);z=z.multiplyByScalar(.5*(rt+H)),W=W.multiplyByScalar(.5*(at+Q)),Y=Y.multiplyByScalar(.5*(et+tt)),t.center.copy(z).add(W).add(Y);let lt=Dne.set(H-rt,Q-at,tt-et).multiplyByScalar(.5),J=new es([lt[0],0,0,0,lt[1],0,0,0,lt[2]]);return t.halfAxes.multiplyRight(J),t}var KT=512,WMt=3,qMt=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],HMt=qMt.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),zne=HMt.concat([[.25,.5],[.75,.5]]),Ret=class e{constructor(t,r,i){this.x=t,this.y=r,this.z=i}get children(){if(!this._children){let t=this.x*2,r=this.y*2,i=this.z+1;this._children=[new e(t,r,i),new e(t,r+1,i),new e(t+1,r,i),new e(t+1,r+1,i)]}return this._children}update(t){let{viewport:r,cullingVolume:i,elevationBounds:n,minZ:o,maxZ:s,bounds:a,offset:h,project:p}=t,g=this.getBoundingVolume(n,h,p);if(a&&!this.insideBounds(a)||i.computeVisibility(g)<0)return!1;if(!this.childVisible){let{z:C}=this;if(C<s&&C>=o){let R=g.distanceTo(r.cameraPosition)*r.scale/r.height;C+=Math.floor(Math.log2(R))}if(C>=s)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let C of this.children)C.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,i,n]){let o=Math.pow(2,this.z),s=KT/o;return this.x*s<i&&this.y*s<n&&(this.x+1)*s>t&&(this.y+1)*s>r}getBoundingVolume(t,r,i){if(i){let h=this.z<1?zne:this.z<2?HMt:qMt,p=[];for(let g of h){let w=kz(this.x+g[0],this.y+g[1],this.z);w[2]=t[0],p.push(i(w)),t[0]!==t[1]&&(w[2]=t[1],p.push(i(w)))}return O8(p)}let n=Math.pow(2,this.z),o=KT/n,s=this.x*o+r*KT,a=KT-(this.y+1)*o;return new XT([s,a,t[0]],[s+o,a+o,t[1]])}};function YMt(e,t,r,i){let n=e instanceof qf&&e.resolution?e.projectPosition:null,o=Object.values(e.getFrustumPlanes()).map(({normal:R,distance:z})=>new yp(R.clone().negate(),z)),s=new _p(o),a=e.distanceScales.unitsPerMeter[2],h=r&&r[0]*a||0,p=r&&r[1]*a||0,g=e instanceof _h&&e.pitch<=60?t:0;if(i){let[R,z,W,Y]=i,H=vs([R,Y]),Q=vs([W,z]);i=[H[0],KT-H[1],Q[0],KT-Q[1]]}let w=new Ret(0,0,0),C={viewport:e,project:n,cullingVolume:s,elevationBounds:[h,p],minZ:g,maxZ:t,bounds:i,offset:0};if(w.update(C),e instanceof _h&&e.subViewports&&e.subViewports.length>1){for(C.offset=-1;w.update(C)&&!(--C.offset<-WMt););for(C.offset=1;w.update(C)&&!(++C.offset>WMt););}return w.getSelected()}var SA=512,Une=[-1/0,-1/0,1/0,1/0],Oet={type:\"object\",value:null,validate:(e,t)=>t.optional&&e===null||typeof e==\"string\"||Array.isArray(e)&&e.every(r=>typeof r==\"string\"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}};function Rz(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(n=>n[0])),Math.min(...r.map(n=>n[1])),Math.max(...r.map(n=>n[0])),Math.max(...r.map(n=>n[1]))]}function Vne(e){return Math.abs(e.split(\"\").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function Let(e,t){if(!e||!e.length)return null;let{index:r,id:i}=t;if(Array.isArray(e)){let o=Vne(i)%e.length;e=e[o]}let n=e;for(let o of Object.keys(r)){let s=new RegExp(`{${o}}`,\"g\");n=n.replace(s,String(r[o]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(n=n.replace(/\\{-y\\}/g,String(Math.pow(2,r.z)-r.y-1))),n}function jne(e,t,r){let i;if(t&&t.length===2){let[n,o]=t,s=e.getBounds({z:n}),a=e.getBounds({z:o});i=[Math.min(s[0],a[0]),Math.min(s[1],a[1]),Math.max(s[2],a[2]),Math.max(s[3],a[3])]}else i=e.getBounds();return e.isGeospatial?[Math.max(i[0],r[0]),Math.max(i[1],r[1]),Math.min(i[2],r[2]),Math.min(i[3],r[3])]:[Math.max(Math.min(i[0],r[2]),r[0]),Math.max(Math.min(i[1],r[3]),r[1]),Math.min(Math.max(i[2],r[0]),r[2]),Math.min(Math.max(i[3],r[1]),r[3])]}function ZMt({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(n=>Det(n,t||0,r))}function Det(e,t,r){if(!Array.isArray(t)){let o=r.x-e.x,s=r.y-e.y,{width:a,height:h}=r,p={targetZ:t},g=e.unproject([o,s],p),w=e.unproject([o+a,s],p),C=e.unproject([o,s+h],p),R=e.unproject([o+a,s+h],p);return[Math.min(g[0],w[0],C[0],R[0]),Math.min(g[1],w[1],C[1],R[1]),Math.max(g[0],w[0],C[0],R[0]),Math.max(g[1],w[1],C[1],R[1])]}let i=Det(e,t[0],r),n=Det(e,t[1],r);return[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[2],n[2]),Math.max(i[3],n[3])]}function $ne(e,t,r){return r?Rz(e,r).map(n=>n*t/SA):e.map(i=>i*t/SA)}function Bet(e,t){return Math.pow(2,e)*SA/t}function kz(e,t,r){let i=Bet(r,SA),n=e/i*360-180,o=Math.PI-2*Math.PI*t/i,s=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[n,s]}function XMt(e,t,r,i){let n=Bet(r,i);return[e/n*SA,t/n*SA]}function Fet(e,t,r,i,n=SA){if(e.isGeospatial){let[p,g]=kz(t,r,i),[w,C]=kz(t+1,r+1,i);return{west:p,north:g,east:w,south:C}}let[o,s]=XMt(t,r,i,n),[a,h]=XMt(t+1,r+1,i,n);return{left:o,top:s,right:a,bottom:h}}function Gne(e,t,r,i,n){let o=jne(e,null,i),s=Bet(t,r),[a,h,p,g]=$ne(o,s,n),w=[];for(let C=Math.floor(a);C<p;C++)for(let R=Math.floor(h);R<g;R++)w.push({x:C,y:R,z:t});return w}function Net({viewport:e,maxZoom:t,minZoom:r,zRange:i,extent:n,tileSize:o=SA,modelMatrix:s,modelMatrixInverse:a,zoomOffset:h=0}){let p=e.isGeospatial?Math.round(e.zoom+Math.log2(SA/o))+h:Math.ceil(e.zoom)+h;if(typeof r==\"number\"&&Number.isFinite(r)&&p<r){if(!n)return[];p=r}typeof t==\"number\"&&Number.isFinite(t)&&p>t&&(p=t);let g=n;return s&&a&&n&&!e.isGeospatial&&(g=Rz(n,s)),e.isGeospatial?YMt(e,p,i,n):Gne(e,p,o,g||Une,a)}function KMt(e){let t={},r;return i=>{for(let n in i)if(!Wne(i[n],t[n])){r=e(i),t=i;break}return r}}function Wne(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}return!1}var QMt=1,Dz=2,qne=\"never\",Hne=\"no-overlap\",L8=\"best-available\",Yne=5,Xne={[L8]:Kne,[Hne]:Qne,[qne]:()=>{}},Zne={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:\"best-available\",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},d_=class{constructor(t){this._getCullBounds=KMt(ZMt),this.opts={...Zne,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new Jw({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Ji,this._modelMatrixInverse=new Ji}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:i}={zRange:null,modelMatrix:null}){let n=i?new Ji(i):new Ji,o=!n.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!$s(this._zRange,r)||o){o&&(this._modelMatrixInverse=n.clone().invert(),this._modelMatrix=n),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(h=>this._getTile(h,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let s=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),s&&this._frameNumber++,this._frameNumber}isTileVisible(t,r,i){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:o}=t;for(let[s,a,h,p]of n){let g;if(\"west\"in o)g=o.west<h&&o.east>s&&o.south<p&&o.north>a;else{if(i&&!Ji.IDENTITY.equals(i)){let[R,z,W,Y]=Rz([o.left,o.top,o.right,o.bottom],i);o={left:R,top:z,right:W,bottom:Y}}let w=Math.min(o.top,o.bottom),C=Math.max(o.top,o.bottom);g=o.left<h&&o.right>s&&w<p&&C>a}if(g)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:i,zRange:n,modelMatrix:o,modelMatrixInverse:s}){let{tileSize:a,extent:h,zoomOffset:p}=this.opts;return Net({viewport:t,maxZoom:r,minZoom:i,zRange:n,tileSize:a,extent:h,modelMatrix:o,modelMatrixInverse:s,zoomOffset:p})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:Fet(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),i=Math.floor(t.y/2),n=t.z-1;return{x:r,y:i,z:n}}updateTileStates(){let t=this.opts.refinementStrategy||L8,r=new Array(this._cache.size),i=0;for(let n of this._cache.values())r[i++]=n.isVisible,n.isSelected=!1,n.isVisible=!1;for(let n of this._selectedTiles)n.isSelected=!0,n.isVisible=!0;(typeof t==\"function\"?t:Xne[t])(Array.from(this._cache.values())),i=0;for(let n of this._cache.values())if(r[i++]!==n.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],i=0;for(let n of this._cache.values())n.isLoading&&(i++,!n.isSelected&&!n.isVisible&&r.push(n));for(;t>0&&i>t&&r.length>0;)r.shift().abort(),i--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let i=this._getNearestAncestor(r);r.parent=i,i?.children&&i.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,i=r.maxCacheSize??(r.maxCacheByteSize!==null?1/0:Yne*this.selectedTiles.length),n=r.maxCacheByteSize??1/0;if(t.size>i||this._cacheByteSize>n){for(let[s,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize!==null?a.byteLength:0,t.delete(s),this.opts.onTileUnload?.(a)),t.size<=i&&this._cacheByteSize<=n)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((s,a)=>s.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let i=this.getTileId(t),n=this._cache.get(i),o=!1;return!n&&r?(n=new Mz(t),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:i,zoom:this.getTileZoom(n.index)}),o=!0,this._cache.set(i,n),this._dirty=!0):n&&n.needsReload&&(o=!0),n&&o&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}_getNearestAncestor(t){let{_minZoom:r=0}=this,i=t.index;for(;this.getTileZoom(i)>r;){i=this.getParentIndex(i);let n=this._getTile(i);if(n)return n}return null}};function Kne(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!JMt(t)&&zet(t);for(let t of e)t.isVisible=!!(t.state&Dz)}function Qne(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&JMt(r);let t=Array.from(e).sort((r,i)=>r.zoom-i.zoom);for(let r of t)if(r.isVisible=!!(r.state&Dz),r.children&&(r.isVisible||r.state&QMt))for(let i of r.children)i.state=QMt;else r.isSelected&&zet(r)}function JMt(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Dz,!0;t=t.parent}return!1}function zet(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Dz:zet(t)}var Jne={TilesetClass:d_,data:{type:\"data\",value:[]},dataComparator:Oet.equal,renderSubLayers:{type:\"function\",value:e=>new KX(e)},getTileData:{type:\"function\",optional:!0,value:null},onViewportLoad:{type:\"function\",optional:!0,value:null},onTileLoad:{type:\"function\",value:e=>{}},onTileUnload:{type:\"function\",value:e=>{}},onTileError:{type:\"function\",value:e=>console.error(e)},extent:{type:\"array\",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:L8,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},B8=class extends bi{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return!!this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,i=t.propsOrDataChanged||t.updateTriggersChanged,n=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?i&&(r.setOptions(this._getTilesetOptions()),n?r.reloadAll():r.tiles.forEach(o=>{o.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:i,refinementStrategy:n,extent:o,maxZoom:s,minZoom:a,maxRequests:h,debounceTime:p,zoomOffset:g}=this.props;return{maxCacheSize:r,maxCacheByteSize:i,maxZoom:s,minZoom:a,tileSize:t,refinementStrategy:n,extent:o,maxRequests:h,debounceTime:p,zoomOffset:g,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:i}=this.props,n=t.update(this.context.viewport,{zRange:r,modelMatrix:i}),{isLoaded:o}=t,s=this.state.isLoaded!==o,a=this.state.frameNumber!==n;o&&(s||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:n}),this.state.isLoaded=o}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:i,fetch:n}=this.props,{signal:o}=t;return t.url=typeof r==\"string\"||Array.isArray(r)?Let(r,t):null,i?i(t):n&&t.url?n(t.url,{propName:\"data\",layer:this,signal:o}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,i=r.props.tile,n=t.info;return n.picked&&(n.tile=i),n.sourceTile=i,n.sourceTileSubLayer=r,n}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(i=>t.layers[0].props[i]!==r[i])&&(t.layers=t.layers.map(i=>i.clone(r)));else{let i=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=Il(i,Boolean).map(n=>n.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:i}=t.props,{modelMatrix:n}=this.props;return this.state.tileset.isTileVisible(i,r,n?new Ji(n):null)}};B8.defaultProps=Jne;B8.layerName=\"TileLayer\";var QT=B8;var t5t=`uniform tripsUniforms {\n  bool fadeTrail;\n  float trailLength;\n  float currentTime;\n} trips;\n`,e5t={name:\"trips\",vs:t5t,fs:t5t,uniformTypes:{fadeTrail:\"f32\",trailLength:\"f32\",currentTime:\"f32\"}};var toe={fadeTrail:!0,trailLength:{type:\"number\",value:120,min:0},currentTime:{type:\"number\",value:0,min:0},getTimestamps:{type:\"accessor\",value:e=>e.timestamps}},F8=class extends Kf{getShaders(){let t=super.getShaders();return t.inject={\"vs:#decl\":`in float instanceTimestamps;\nin float instanceNextTimestamps;\nout float vTime;\n`,\"vs:#main-end\":`vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n`,\"fs:#decl\":`in float vTime;\n`,\"fs:#main-start\":`if(vTime > trips.currentTime || (trips.fadeTrail && (vTime < trips.currentTime - trips.trailLength))) {\n  discard;\n}\n`,\"fs:DECKGL_FILTER_COLOR\":`if(trips.fadeTrail) {\n  color.a *= 1.0 - (trips.currentTime - vTime) / trips.trailLength;\n}\n`},t.modules=[...t.modules,e5t],t}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:\"getTimestamps\",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(t){let{fadeTrail:r,trailLength:i,currentTime:n}=this.props,o={fadeTrail:r,trailLength:i,currentTime:n};this.state.model.shaderInputs.setProps({trips:o}),super.draw(t)}};F8.layerName=\"TripsLayer\";F8.defaultProps=toe;var Uet=F8;var eoe=10;function roe(e,t){let r;return e==null?r=t:typeof e==\"object\"?r={...e,coverage:t}:r={getHexagon:e,coverage:t},r}var ioe={...wh.defaultProps,highPrecision:\"auto\",coverage:{type:\"number\",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:\"accessor\",value:e=>e.hexagon},extruded:!0},JT=class e extends bi{initializeState(){e._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}shouldUpdateState({changeFlags:t}){return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}updateState({props:t,changeFlags:r}){if(t.highPrecision!==!0&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){let i=this._calculateH3DataProps();this.setState(i)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(){let t=-1,r=!1,i=!1,{iterable:n,objectInfo:o}=Lc(this.props.data);for(let s of n){o.index++;let a=this.props.getHexagon(s,o),h=vMt(a);if(t<0){if(t=h,!this.props.highPrecision)break}else if(t!==h){i=!0;break}if(_Mt(a)){r=!0;break}}return{resolution:t,edgeLengthKM:t>=0?TMt(t,\"km\"):0,hasMultipleRes:i,hasPentagon:r}}_shouldUseHighPrecision(){if(this.props.highPrecision===\"auto\"){let{resolution:t,hasPentagon:r,hasMultipleRes:i}=this.state,{viewport:n}=this.context;return!!n?.resolution||i||r||t>=0&&t<=5}return this.props.highPrecision}_updateVertices(t){if(this._shouldUseHighPrecision())return;let{resolution:r,edgeLengthKM:i,centerHex:n}=this.state;if(r<0)return;let o=this.props.centerHexagon||bMt(t.latitude,t.longitude,r);if(n===o)return;if(n)try{if(wMt(n,o)*i<eoe)return}catch{}let{unitsPerMeter:s}=t.distanceScales,a=Eet(o),[h,p]=P8(o),[g,w]=t.projectFlat([p,h]);a=a.map(C=>{let R=t.projectFlat(C);return[(R[0]-g)/s[0],(R[1]-w)/s[1]]}),this.setState({centerHex:o,vertices:a})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){let{elevationScale:t,material:r,coverage:i,extruded:n,wireframe:o,stroked:s,filled:a,lineWidthUnits:h,lineWidthScale:p,lineWidthMinPixels:g,lineWidthMaxPixels:w,getFillColor:C,getElevation:R,getLineColor:z,getLineWidth:W,transitions:Y,updateTriggers:H}=this.props;return{elevationScale:t,extruded:n,coverage:i,wireframe:o,stroked:s,filled:a,lineWidthUnits:h,lineWidthScale:p,lineWidthMinPixels:g,lineWidthMaxPixels:w,material:r,getElevation:R,getFillColor:C,getLineColor:z,getLineWidth:W,transitions:Y,updateTriggers:{getFillColor:H.getFillColor,getElevation:H.getElevation,getLineColor:H.getLineColor,getLineWidth:H.getLineWidth}}}_renderPolygonLayer(){let{data:t,getHexagon:r,updateTriggers:i,coverage:n}=this.props,o=this.getSubLayerClass(\"hexagon-cell-hifi\",wh),s=this._getForwardProps();return s.updateTriggers.getPolygon=roe(i.getHexagon,n),new o(s,this.getSubLayerProps({id:\"hexagon-cell-hifi\",updateTriggers:s.updateTriggers}),{data:t,_normalize:!1,_windingOrder:\"CCW\",positionFormat:\"XY\",getPolygon:(a,h)=>{let p=r(a,h);return xz(Eet(p,n))}})}_renderColumnLayer(){let{data:t,getHexagon:r,updateTriggers:i}=this.props,n=this.getSubLayerClass(\"hexagon-cell\",q3),o=this._getForwardProps();return o.updateTriggers.getPosition=i.getHexagon,new n(o,this.getSubLayerProps({id:\"hexagon-cell\",flatShading:!0,updateTriggers:o.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:MMt.bind(null,r)})}};JT.defaultProps=ioe;JT.layerName=\"H3HexagonLayer\";JT._checkH3Lib=()=>{};var Oz=JT;Ci();var Vet=Math.PI/180,Lz=new Float32Array(16),r5t=new Float32Array(12);function i5t(e,t,r){let i=t[0]*Vet,n=t[1]*Vet,o=t[2]*Vet,s=Math.sin(o),a=Math.sin(i),h=Math.sin(n),p=Math.cos(o),g=Math.cos(i),w=Math.cos(n),C=r[0],R=r[1],z=r[2];e[0]=C*w*g,e[1]=C*h*g,e[2]=C*-a,e[3]=R*(-h*p+w*a*s),e[4]=R*(w*p+h*a*s),e[5]=R*g*s,e[6]=z*(h*s+w*a*p),e[7]=z*(-w*s+h*a*p),e[8]=z*g*p}function n5t(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var o5t={size:12,accessor:[\"getOrientation\",\"getScale\",\"getTranslation\",\"getTransformMatrix\"],shaderAttributes:{instanceModelMatrixCol0:{size:3,elementOffset:0},instanceModelMatrixCol1:{size:3,elementOffset:3},instanceModelMatrixCol2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(e,{startRow:t,endRow:r}){let{data:i,getOrientation:n,getScale:o,getTranslation:s,getTransformMatrix:a}=this.props,h=Array.isArray(a),p=h&&a.length===16,g=Array.isArray(o),w=Array.isArray(n),C=Array.isArray(s),R=p||!h&&!!a(i[0]);R?e.constant=p:e.constant=w&&g&&C;let z=e.value;if(e.constant){let W;R?(Lz.set(a),W=n5t(Lz)):(W=r5t,i5t(W,n,o),W.set(s,9)),e.value=new Float32Array(W)}else{let W=t*e.size,{iterable:Y,objectInfo:H}=Lc(i,t,r);for(let Q of Y){H.index++;let tt;if(R)Lz.set(p?a:a(Q,H)),tt=n5t(Lz);else{tt=r5t;let rt=w?n:n(Q,H),at=g?o:o(Q,H);i5t(tt,rt,at),tt.set(C?s:s(Q,H),9)}z[W++]=tt[0],z[W++]=tt[1],z[W++]=tt[2],z[W++]=tt[3],z[W++]=tt[4],z[W++]=tt[5],z[W++]=tt[6],z[W++]=tt[7],z[W++]=tt[8],z[W++]=tt[9],z[W++]=tt[10],z[W++]=tt[11]}}}};function s5t(e,t){return t===Vr.CARTESIAN||t===Vr.METER_OFFSETS||t===Vr.DEFAULT&&!e.isGeospatial}var a5t=`uniform simpleMeshUniforms {\n  float sizeScale;\n  bool composeModelMatrix;\n  bool hasTexture;\n  bool flatShading;\n} simpleMesh;\n`,l5t={name:\"simpleMesh\",vs:a5t,fs:a5t,uniformTypes:{sizeScale:\"f32\",composeModelMatrix:\"f32\",hasTexture:\"f32\",flatShading:\"f32\"}};var c5t=`#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = texCoords;\ngeometry.pickingColor = instancePickingColors;\nvTexCoord = texCoords;\ncameraPosition = project.cameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;\nif (simpleMesh.composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\ngeometry.position = position_commonspace;\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\n}\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;var u5t=`#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform sampler2D sampler;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (simpleMesh.flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = simpleMesh.hasTexture ? texture(sampler, vTexCoord) : vColor;\nDECKGL_FILTER_COLOR(color, geometry);\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * layer.opacity);\n}\n`;function jet(e){let t=e.positions||e.POSITION;hr.assert(t,'no \"postions\" or \"POSITION\" attribute in mesh');let r=t.value.length/t.size,i=e.COLOR_0||e.colors;i||(i={size:3,value:new Float32Array(r*3).fill(1)});let n=e.NORMAL||e.normals;n||(n={size:3,value:new Float32Array(r*3).fill(0)});let o=e.TEXCOORD_0||e.texCoords;return o||(o={size:2,value:new Float32Array(r*2).fill(0)}),{positions:t,colors:i,normals:n,texCoords:o}}function h5t(e){return e instanceof xs?(e.attributes=jet(e.attributes),e):e.attributes?new xs({...e,topology:\"triangle-list\",attributes:jet(e.attributes)}):new xs({topology:\"triangle-list\",attributes:jet(e)})}var noe=[0,0,0,255],ooe={mesh:{type:\"object\",value:null,async:!0},texture:{type:\"image\",value:null,async:!0},sizeScale:{type:\"number\",value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:\"accessor\",value:e=>e.position},getColor:{type:\"accessor\",value:noe},getOrientation:{type:\"accessor\",value:[0,0,0]},getScale:{type:\"accessor\",value:[1,1,1]},getTranslation:{type:\"accessor\",value:[0,0,0]},getTransformMatrix:{type:\"accessor\",value:[]},textureParameters:{type:\"object\",ignore:!0,value:null}},N8=class extends ho{getShaders(){return super.getShaders({vs:c5t,fs:u5t,modules:[Mo,lb,bs,l5t]})}getBounds(){if(this.props._instanced)return super.getBounds();let t=this.state.positionBounds;if(t)return t;let{mesh:r}=this.props;if(!r)return null;if(t=r.header?.boundingBox,!t){let{attributes:i}=h5t(r);i.POSITION=i.POSITION||i.positions,t=wq(i)}return this.state.positionBounds=t,t}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:\"float64\",fp64:this.use64bitPositions(),size:3,accessor:\"getPosition\"},instanceColors:{type:\"unorm8\",transition:!0,size:this.props.colorFormat.length,accessor:\"getColor\",defaultValue:[0,0,0,255]},instanceModelMatrix:o5t}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(t){super.updateState(t);let{props:r,oldProps:i,changeFlags:n}=t;if(r.mesh!==i.mesh||n.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),r.mesh){this.state.model=this.getModel(r.mesh);let o=r.mesh.attributes||r.mesh;this.setState({hasNormals:!!(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}r.texture!==i.texture&&r.texture instanceof Jo&&this.setTexture(r.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?\"line-strip\":\"triangle-list\")}finalizeState(t){super.finalizeState(t),this.state.emptyTexture.delete()}draw({uniforms:t}){let{model:r}=this.state;if(!r)return;let{viewport:i,renderPass:n}=this.context,{sizeScale:o,coordinateSystem:s,_instanced:a}=this.props,h={sizeScale:o,composeModelMatrix:!a||s5t(i,s),flatShading:!this.state.hasNormals};r.shaderInputs.setProps({simpleMesh:h}),r.draw(n)}get isLoaded(){return!!(this.state?.model&&super.isLoaded)}getModel(t){let r=new sn(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:h5t(t),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:n}=this.state,o={sampler:i||n,hasTexture:!!i};return r.shaderInputs.setProps({simpleMesh:o}),r}setTexture(t){let{emptyTexture:r,model:i}=this.state;if(i){let n={sampler:t||r,hasTexture:!!t};i.shaderInputs.setProps({simpleMesh:n})}}};N8.defaultProps=ooe;N8.layerName=\"SimpleMeshLayer\";var tS=N8;var d5t=\"0123456789bcdefghjkmnpqrstuvwxyz\",f5t={};for(let e=0;e<d5t.length;e++)f5t[d5t.charAt(e)]=e;var soe=-90,aoe=90,loe=-180,coe=180;function uoe(e){let t=!0,r=aoe,i=soe,n=coe,o=loe,s,a=0;for(let h=0,p=e.length;h<p;h++){let g=e[h].toLowerCase();a=f5t[g];for(let w=4;w>=0;w--){let C=a>>w&1;t?(s=(n+o)/2,C===1?o=s:n=s):(s=(r+i)/2,C===1?i=s:r=s),t=!t}}return[i,o,r,n]}function p5t(e){let[t,r,i,n]=uoe(e);return[n,i,n,t,r,t,r,i,n,i]}var hoe={getGeohash:{type:\"accessor\",value:e=>e.geohash}},z8=class extends zT{indexToBounds(){let{data:t,getGeohash:r}=this.props;return{data:t,_normalize:!1,positionFormat:\"XY\",getPolygon:(i,n)=>p5t(r(i,n))}}};z8.layerName=\"GeohashLayer\";z8.defaultProps=hoe;var Bz=z8;function H8(e){\"@babel/helpers - typeof\";return H8=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(t){return typeof t}:function(t){return t&&typeof Symbol==\"function\"&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},H8(e)}function doe(e,t){if(H8(e)!=\"object\"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||\"default\");if(H8(i)!=\"object\")return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(t===\"string\"?String:Number)(e)}function foe(e){var t=doe(e,\"string\");return H8(t)==\"symbol\"?t:String(t)}function tf(e,t,r){return t=foe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var poe={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...poe}};var Fz=globalThis.mathgl.config;function Wet(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Yz(e,t,r){let i=Fz.EPSILON;r&&(Fz.EPSILON=r);try{if(e===t)return!0;if(Wet(e)&&Wet(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!Yz(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e==\"number\"&&typeof t==\"number\"?Math.abs(e-t)<=Fz.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Fz.EPSILON=i}}var m5t={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function moe(e,t,r={}){return goe(e,r)!==t?(yoe(e,r),!0):!1}function goe(e,t={}){return Math.sign(ert(e,t))}var cS={x:0,y:1,z:2};function ert(e,t={}){let{start:r=0,end:i=e.length,plane:n=\"xy\"}=t,o=t.size||2,s=0,a=cS[n[0]],h=cS[n[1]];for(let p=r,g=i-o;p<i;p+=o)s+=(e[p+a]-e[g+a])*(e[p+h]+e[g+h]),g=p;return s/2}function Aoe(e,t,r={}){let{start:i=0,end:n=e.length,size:o=2,isClosed:s}=r,a=(n-i)/o;for(let g=0;g<a-1;++g)t(e[i+g*o],e[i+g*o+1],e[i+(g+1)*o],e[i+(g+1)*o+1],g,g+1);let h=i+(a-1)*o;s||Yz(e[i],e[h])&&Yz(e[i+1],e[h+1])||t(e[h],e[h+1],e[i],e[i+1],a-1,0)}function yoe(e,t){let{start:r=0,end:i=e.length,size:n=2}=t,o=(i-r)/n,s=Math.floor(o/2);for(let a=0;a<s;++a){let h=r+a*n,p=r+(o-1-a)*n;for(let g=0;g<n;++g){let w=e[h+g];e[h+g]=e[p+g],e[p+g]=w}}}function _oe(e,t,r={}){return voe(e,r)!==t?(e.reverse(),!0):!1}function voe(e,t={}){return Math.sign(B5t(e,t))}function B5t(e,t={}){let{start:r=0,end:i=e.length,plane:n=\"xy\"}=t,o=0,s=cS[n[0]],a=cS[n[1]];for(let h=r,p=i-1;h<i;++h)o+=(e[h][s]-e[p][s])*(e[h][a]+e[p][a]),p=h;return o/2}function boe(e,t,r={}){let{start:i=0,end:n=e.length,isClosed:o}=r;for(let a=i;a<n-1;++a)t(e[a],e[a+1],a,a+1);o||Yz(e[n-1],e[0])||t(e[n-1],e[0],n-1,0)}var qet=class{constructor(t,r={}){tf(this,\"points\",void 0),tf(this,\"isFlatArray\",void 0),tf(this,\"options\",void 0),this.points=t,this.isFlatArray=!Wet(t[0]),this.options={start:r.start||0,end:r.end||t.length,size:r.size||2,isClosed:r.isClosed},Object.freeze(this)}getSignedArea(){return this.isFlatArray?ert(this.points,this.options):B5t(this.points,this.options)}getArea(){return Math.abs(this.getSignedArea())}getWindingDirection(){return Math.sign(this.getSignedArea())}forEachSegment(t){this.isFlatArray?Aoe(this.points,(r,i,n,o,s,a)=>{t([r,i],[n,o],s,a)},this.options):boe(this.points,t,this.options)}modifyWindingDirection(t){return this.isFlatArray?moe(this.points,t,this.options):_oe(this.points,t,this.options)}};function xoe(e,t,r=2,i,n=\"xy\"){let o=t&&t.length,s=o?t[0]*r:e.length,a=F5t(e,0,s,r,!0,i&&i[0],n),h=[];if(!a||a.next===a.prev)return h;let p,g,w,C,R,z,W;if(o&&(a=Eoe(e,t,a,r,i,n)),e.length>80*r){C=g=e[0],R=w=e[1];for(let Y=r;Y<s;Y+=r)z=e[Y],W=e[Y+1],z<C&&(C=z),W<R&&(R=W),z>g&&(g=z),W>w&&(w=W);p=Math.max(g-C,w-R),p=p!==0?32767/p:0}return Y8(a,h,r,C,R,p,0),h}function F5t(e,t,r,i,n,o,s){let a,h;o===void 0&&(o=ert(e,{start:t,end:r,size:i,plane:s}));let p=cS[s[0]],g=cS[s[1]];if(n===o<0)for(a=t;a<r;a+=i)h=g5t(a,e[a+p],e[a+g],h);else for(a=r-i;a>=t;a-=i)h=g5t(a,e[a+p],e[a+g],h);return h&&eU(h,h.next)&&(Z8(h),h=h.next),h}function Lx(e,t){if(!e)return e;t||(t=e);let r=e,i;do if(i=!1,!r.steiner&&(eU(r,r.next)||cs(r.prev,r,r.next)===0)){if(Z8(r),r=t=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==t);return t}function Y8(e,t,r,i,n,o,s){if(!e)return;!s&&o&&Roe(e,i,n,o);let a=e,h,p;for(;e.prev!==e.next;){if(h=e.prev,p=e.next,o?Toe(e,i,n,o):woe(e)){t.push(h.i/r|0),t.push(e.i/r|0),t.push(p.i/r|0),Z8(e),e=p.next,a=p.next;continue}if(e=p,e===a){s?s===1?(e=Soe(Lx(e),t,r),Y8(e,t,r,i,n,o,2)):s===2&&Moe(e,t,r,i,n,o):Y8(Lx(e),t,r,i,n,o,1);break}}}function woe(e){let t=e.prev,r=e,i=e.next;if(cs(t,r,i)>=0)return!1;let n=t.x,o=r.x,s=i.x,a=t.y,h=r.y,p=i.y,g=n<o?n<s?n:s:o<s?o:s,w=a<h?a<p?a:p:h<p?h:p,C=n>o?n>s?n:s:o>s?o:s,R=a>h?a>p?a:p:h>p?h:p,z=i.next;for(;z!==t;){if(z.x>=g&&z.x<=C&&z.y>=w&&z.y<=R&&rS(n,a,o,h,s,p,z.x,z.y)&&cs(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function Toe(e,t,r,i){let n=e.prev,o=e,s=e.next;if(cs(n,o,s)>=0)return!1;let a=n.x,h=o.x,p=s.x,g=n.y,w=o.y,C=s.y,R=a<h?a<p?a:p:h<p?h:p,z=g<w?g<C?g:C:w<C?w:C,W=a>h?a>p?a:p:h>p?h:p,Y=g>w?g>C?g:C:w>C?w:C,H=Het(R,z,t,r,i),Q=Het(W,Y,t,r,i),tt=e.prevZ,rt=e.nextZ;for(;tt&&tt.z>=H&&rt&&rt.z<=Q;){if(tt.x>=R&&tt.x<=W&&tt.y>=z&&tt.y<=Y&&tt!==n&&tt!==s&&rS(a,g,h,w,p,C,tt.x,tt.y)&&cs(tt.prev,tt,tt.next)>=0||(tt=tt.prevZ,rt.x>=R&&rt.x<=W&&rt.y>=z&&rt.y<=Y&&rt!==n&&rt!==s&&rS(a,g,h,w,p,C,rt.x,rt.y)&&cs(rt.prev,rt,rt.next)>=0))return!1;rt=rt.nextZ}for(;tt&&tt.z>=H;){if(tt.x>=R&&tt.x<=W&&tt.y>=z&&tt.y<=Y&&tt!==n&&tt!==s&&rS(a,g,h,w,p,C,tt.x,tt.y)&&cs(tt.prev,tt,tt.next)>=0)return!1;tt=tt.prevZ}for(;rt&&rt.z<=Q;){if(rt.x>=R&&rt.x<=W&&rt.y>=z&&rt.y<=Y&&rt!==n&&rt!==s&&rS(a,g,h,w,p,C,rt.x,rt.y)&&cs(rt.prev,rt,rt.next)>=0)return!1;rt=rt.nextZ}return!0}function Soe(e,t,r){let i=e;do{let n=i.prev,o=i.next.next;!eU(n,o)&&N5t(n,i,i.next,o)&&X8(n,o)&&X8(o,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),Z8(i),Z8(i.next),i=e=o),i=i.next}while(i!==e);return Lx(i)}function Moe(e,t,r,i,n,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Loe(s,a)){let h=z5t(s,a);s=Lx(s,s.next),h=Lx(h,h.next),Y8(s,t,r,i,n,o,0),Y8(h,t,r,i,n,o,0);return}a=a.next}s=s.next}while(s!==e)}function Eoe(e,t,r,i,n,o){let s=[],a,h,p,g,w;for(a=0,h=t.length;a<h;a++)p=t[a]*i,g=a<h-1?t[a+1]*i:e.length,w=F5t(e,p,g,i,!1,n&&n[a+1],o),w===w.next&&(w.steiner=!0),s.push(Ooe(w));for(s.sort(Poe),a=0;a<s.length;a++)r=Coe(s[a],r);return r}function Poe(e,t){return e.x-t.x}function Coe(e,t){let r=Ioe(e,t);if(!r)return t;let i=z5t(r,e);return Lx(i,i.next),Lx(r,r.next)}function Ioe(e,t){let r=t,i=e.x,n=e.y,o=-1/0,s;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let C=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(C<=i&&C>o&&(o=C,s=r.x<r.next.x?r:r.next,C===i))return s}r=r.next}while(r!==t);if(!s)return null;let a=s,h=s.x,p=s.y,g=1/0,w;r=s;do i>=r.x&&r.x>=h&&i!==r.x&&rS(n<p?i:o,n,h,p,n<p?o:i,n,r.x,r.y)&&(w=Math.abs(n-r.y)/(i-r.x),X8(r,e)&&(w<g||w===g&&(r.x>s.x||r.x===s.x&&koe(s,r)))&&(s=r,g=w)),r=r.next;while(r!==a);return s}function koe(e,t){return cs(e.prev,e,t.prev)<0&&cs(t.next,e,e.next)<0}function Roe(e,t,r,i){let n=e;do n.z===0&&(n.z=Het(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,Doe(n)}function Doe(e){let t,r,i=1,n,o,s,a,h,p;do{for(o=e,e=null,p=null,n=0;o;){for(n++,a=o,s=0,r=0;r<i&&(s++,a=a.nextZ,!!a);r++);for(h=i;s>0||h>0&&a;)s!==0&&(h===0||!a||o.z<=a.z)?(t=o,o=o.nextZ,s--):(t=a,a=a.nextZ,h--),p?p.nextZ=t:e=t,t.prevZ=p,p=t;o=a}p.nextZ=null,i*=2}while(n>1);return e}function Het(e,t,r,i,n){return e=(e-r)*n|0,t=(t-i)*n|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ooe(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function rS(e,t,r,i,n,o,s,a){return(n-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function Loe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Boe(e,t)&&(X8(e,t)&&X8(t,e)&&Foe(e,t)&&(cs(e.prev,e,t.prev)||cs(e,t.prev,t))||eU(e,t)&&cs(e.prev,e,e.next)>0&&cs(t.prev,t,t.next)>0)}function cs(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function eU(e,t){return e.x===t.x&&e.y===t.y}function N5t(e,t,r,i){let n=zz(cs(e,t,r)),o=zz(cs(e,t,i)),s=zz(cs(r,i,e)),a=zz(cs(r,i,t));return!!(n!==o&&s!==a||n===0&&Nz(e,r,t)||o===0&&Nz(e,i,t)||s===0&&Nz(r,e,i)||a===0&&Nz(r,t,i))}function Nz(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function zz(e){return e>0?1:e<0?-1:0}function Boe(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&N5t(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function X8(e,t){return cs(e.prev,e,e.next)<0?cs(e,t,e.next)>=0&&cs(e,e.prev,t)>=0:cs(e,t,e.prev)<0||cs(e,e.next,t)<0}function Foe(e,t){let r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}function z5t(e,t){let r=new K8(e.i,e.x,e.y),i=new K8(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function g5t(e,t,r,i){let n=new K8(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Z8(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var K8=class{constructor(t,r,i){tf(this,\"i\",void 0),tf(this,\"x\",void 0),tf(this,\"y\",void 0),tf(this,\"prev\",null),tf(this,\"next\",null),tf(this,\"z\",0),tf(this,\"prevZ\",null),tf(this,\"nextZ\",null),tf(this,\"steiner\",!1),this.i=t,this.x=r,this.y=i}};function ek(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function rk(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function dS(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function Noe(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function zoe(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function rU(e){return\"data\"in e?e.getChildAt(0):e.children[0]}var Si=Object.freeze({__proto__:null,getLineStringChild:rk,getMultiLineStringChild:zoe,getMultiPointChild:Noe,getMultiPolygonChild:rU,getPointChild:ek,getPolygonChild:dS});function iU(e,t){let r=e.valueOffsets,i=dS(e),n=i.valueOffsets,o=rk(i),s=o.type.listSize,a=ek(o),h=r[t],p=r[t+1],g=n[h],w=n[p],C=a.values.subarray(g*s,w*s);return new qet(C,{size:s,isClosed:!0})}function U5t(e){if(\"data\"in e)return new Er(e.data.map(r=>U5t(r)));let t=new Float64Array(e.length);for(let r=0;r<e.length;r++){let i=iU(e,r);t[r]=i.getArea()}return Pr({type:new al(bn.DOUBLE),length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,data:t})}function V5t(e){if(\"data\"in e)return new Er(e.data.map(r=>V5t(r)));let t=new Float64Array(e.length);for(let r=0;r<e.length;r++){let i=iU(e,r);t[r]=i.getSignedArea()}return Pr({type:new al(bn.DOUBLE),length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,data:t})}function j5t(e){if(\"data\"in e)return e.data.map(o=>j5t(o));let t=[],r=0;for(let o=0;o<e.length;o++){let s=Uoe(e,o);t.push(s),r+=s.length}let i=new Uint32Array(r),n=0;for(let o of t)for(let s of o)i[n]=s,n+=1;return i}function Uoe(e,t){let r=e.valueOffsets,i=dS(e),n=i.valueOffsets,o=rk(i),s=o.type.listSize,a=ek(o),h=r[t],p=r[t+1],g=n[h],w=n[p],C=a.values.subarray(g*s,w*s),R=n[h],z=[];for(let Y=h+1;Y<p;Y++)z.push(n[Y]-R);let W=xoe(C,z,s);for(let Y=0;Y<W.length;Y++)W[Y]+=R;return W}function $5t(e){return\"data\"in e?new Er(e.data.map(t=>$5t(t))):dS(e)}function G5t(e){return\"data\"in e?new Er(e.data.map(t=>G5t(t))):rU(e)}function rrt(e){return tr.isFixedSizeList(e)?!(![2,3,4].includes(e.listSize)||!tr.isFloat(e.children[0])):tr.isStruct(e)?!(![2,3,4].includes(e.children.length)||!e.children.every(t=>[\"x\",\"y\",\"z\",\"m\"].includes(t.name))||!e.children.every(t=>tr.isFloat(t))):!1}function irt(e){return!(!tr.isList(e)||!rrt(e.children[0].type))}function W5t(e){return!(!tr.isList(e)||!irt(e.children[0].type))}function Voe(e){return!(!tr.isList(e)||!rrt(e.children[0].type))}function joe(e){return!(!tr.isList(e)||!irt(e.children[0].type))}function $oe(e){return!(!tr.isList(e)||!W5t(e.children[0].type))}function q5t(e){return rrt(e.type)}function H5t(e){return irt(e.type)}function Y5t(e){return W5t(e.type)}function X5t(e){return Voe(e.type)}function Z5t(e){return joe(e.type)}function K5t(e){return $oe(e.type)}var zr=Object.freeze({__proto__:null,isLineStringData:H5t,isMultiLineStringData:Z5t,isMultiPointData:X5t,isMultiPolygonData:K5t,isPointData:q5t,isPolygonData:Y5t});function Goe(e,t){if(!e)throw new Error(`assertion failed ${t}`)}function Woe(){throw new Error(\"assertion failed\")}function Q5t(e,t){if(q5t(e))return J5t(e,t);if(H5t(e))return Yet(e,t);if(Y5t(e))return Xet(e,t);if(X5t(e))return Yet(e,t);if(Z5t(e))return Xet(e,t);if(K5t(e))return qoe(e,t);Woe()}function J5t(e,t){Goe(e.type.listSize===2,\"expected 2D\");let r=ek(e),i=r.values,n=new Float64Array(i.length);for(let s=0;s<e.length;s++){let a=i[s*2],h=i[s*2+1],[p,g]=t(a,h);n[s*2]=p,n[s*2+1]=g}let o=Pr({type:r.type,length:r.length,nullCount:r.nullCount,nullBitmap:r.nullBitmap,data:n});return Pr({type:e.type,length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:o})}function Yet(e,t){let r=rk(e),i=J5t(r,t);return Pr({type:e.type,length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:i,valueOffsets:e.valueOffsets})}function Xet(e,t){let r=dS(e),i=Yet(r,t);return Pr({type:e.type,length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:i,valueOffsets:e.valueOffsets})}function qoe(e,t){let r=rU(e),i=Xet(r,t);return Pr({type:e.type,length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:i,valueOffsets:e.valueOffsets})}function Hoe(e){e(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),e(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),e(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\"),e.WGS84=e[\"EPSG:4326\"],e[\"EPSG:3785\"]=e[\"EPSG:3857\"],e.GOOGLE=e[\"EPSG:3857\"],e[\"EPSG:900913\"]=e[\"EPSG:3857\"],e[\"EPSG:102113\"]=e[\"EPSG:3857\"]}var Bx=1,Fx=2,aS=3,Yoe=4,Zet=5,A5t=6378137,Xoe=6356752314e-3,y5t=.0066943799901413165,W8=484813681109536e-20,Qe=Math.PI/2,Zoe=.16666666666666666,Koe=.04722222222222222,Qoe=.022156084656084655,pr=1e-10,Fl=.017453292519943295,am=57.29577951308232,Ln=Math.PI/4,Q8=Math.PI*2,Js=3.14159265359,Lu={};Lu.greenwich=0;Lu.lisbon=-9.131906111111;Lu.paris=2.337229166667;Lu.bogota=-74.080916666667;Lu.madrid=-3.687938888889;Lu.rome=12.452333333333;Lu.bern=7.439583333333;Lu.jakarta=106.807719444444;Lu.ferro=-17.666666666667;Lu.brussels=4.367975;Lu.stockholm=18.058277777778;Lu.athens=23.7163375;Lu.oslo=10.722916666667;var Joe={ft:{to_meter:.3048},\"us-ft\":{to_meter:1200/3937}},_5t=/[\\s_\\-\\/\\(\\)]/g;function m_(e,t){if(e[t])return e[t];for(var r=Object.keys(e),i=t.toLowerCase().replace(_5t,\"\"),n=-1,o,s;++n<r.length;)if(o=r[n],s=o.toLowerCase().replace(_5t,\"\"),s===i)return e[o]}function Ket(e){var t={},r=e.split(\"+\").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,h){var p=h.split(\"=\");return p.push(!0),a[p[0].toLowerCase()]=p[1],a},{}),i,n,o,s={proj:\"projName\",datum:\"datumCode\",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*Fl},lat_1:function(a){t.lat1=a*Fl},lat_2:function(a){t.lat2=a*Fl},lat_ts:function(a){t.lat_ts=a*Fl},lon_0:function(a){t.long0=a*Fl},lon_1:function(a){t.long1=a*Fl},lon_2:function(a){t.long2=a*Fl},alpha:function(a){t.alpha=parseFloat(a)*Fl},gamma:function(a){t.rectified_grid_angle=parseFloat(a)},lonc:function(a){t.longc=a*Fl},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(\",\").map(function(h){return parseFloat(h)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var h=m_(Joe,a);h&&(t.to_meter=h.to_meter)},from_greenwich:function(a){t.from_greenwich=a*Fl},pm:function(a){var h=m_(Lu,a);t.from_greenwich=(h||parseFloat(a))*Fl},nadgrids:function(a){a===\"@null\"?t.datumCode=\"none\":t.nadgrids=a},axis:function(a){var h=\"ewnsud\";a.length===3&&h.indexOf(a.substr(0,1))!==-1&&h.indexOf(a.substr(1,1))!==-1&&h.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(i in r)n=r[i],i in s?(o=s[i],typeof o==\"function\"?o(n):t[o]=n):t[i]=n;return typeof t.datumCode==\"string\"&&t.datumCode!==\"WGS84\"&&(t.datumCode=t.datumCode.toLowerCase()),t}var J8=1,tEt=2,eEt=3,Xz=4,rEt=5,nrt=-1,tse=/\\s/,ese=/[A-Za-z]/,rse=/[A-Za-z84_]/,nU=/[,\\]]/,iEt=/[\\d\\.E\\-\\+]/;function MA(e){if(typeof e!=\"string\")throw new Error(\"not a string\");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=J8}MA.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==Xz)for(;tse.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case J8:return this.neutral(e);case tEt:return this.keyword(e);case Xz:return this.quoted(e);case rEt:return this.afterquote(e);case eEt:return this.number(e);case nrt:return}};MA.prototype.afterquote=function(e){if(e==='\"'){this.word+='\"',this.state=Xz;return}if(nU.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in afterquote yet, index '+this.place)};MA.prototype.afterItem=function(e){if(e===\",\"){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=J8;return}if(e===\"]\"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=J8,this.currentObject=this.stack.pop(),this.currentObject||(this.state=nrt);return}};MA.prototype.number=function(e){if(iEt.test(e)){this.word+=e;return}if(nU.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in number yet, index '+this.place)};MA.prototype.quoted=function(e){if(e==='\"'){this.state=rEt;return}this.word+=e};MA.prototype.keyword=function(e){if(rse.test(e)){this.word+=e;return}if(e===\"[\"){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=J8;return}if(nU.test(e)){this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in keyword yet, index '+this.place)};MA.prototype.neutral=function(e){if(ese.test(e)){this.word=e,this.state=tEt;return}if(e==='\"'){this.word=\"\",this.state=Xz;return}if(iEt.test(e)){this.word=e,this.state=eEt;return}if(nU.test(e)){this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in neutral yet, index '+this.place)};MA.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===nrt)return this.root;throw new Error('unable to parse string \"'+this.text+'\". State is '+this.state)};function ise(e){var t=new MA(e);return t.output()}function v5t(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var i=t?{}:e,n=r.reduce(function(o,s){return iS(s,o),o},i);t&&(e[t]=n)}function iS(e,t){if(!Array.isArray(e)){t[e]=!0;return}var r=e.shift();if(r===\"PARAMETER\"&&(r=e.shift()),e.length===1){if(Array.isArray(e[0])){t[r]={},iS(e[0],t[r]);return}t[r]=e[0];return}if(!e.length){t[r]=!0;return}if(r===\"TOWGS84\"){t[r]=e;return}if(r===\"AXIS\"){r in t||(t[r]=[]),t[r].push(e);return}Array.isArray(r)||(t[r]={});var i;switch(r){case\"UNIT\":case\"PRIMEM\":case\"VERT_DATUM\":t[r]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&iS(e[2],t[r]);return;case\"SPHEROID\":case\"ELLIPSOID\":t[r]={name:e[0],a:e[1],rf:e[2]},e.length===4&&iS(e[3],t[r]);return;case\"PROJECTEDCRS\":case\"PROJCRS\":case\"GEOGCS\":case\"GEOCCS\":case\"PROJCS\":case\"LOCAL_CS\":case\"GEODCRS\":case\"GEODETICCRS\":case\"GEODETICDATUM\":case\"EDATUM\":case\"ENGINEERINGDATUM\":case\"VERT_CS\":case\"VERTCRS\":case\"VERTICALCRS\":case\"COMPD_CS\":case\"COMPOUNDCRS\":case\"ENGINEERINGCRS\":case\"ENGCRS\":case\"FITTED_CS\":case\"LOCAL_DATUM\":case\"DATUM\":e[0]=[\"name\",e[0]],v5t(t,r,e);return;default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return iS(e,t[r]);return v5t(t,r,e)}}var nse=.017453292519943295;function ose(e,t){var r=t[0],i=t[1];!(r in e)&&i in e&&(e[r]=e[i],t.length===3&&(e[r]=t[2](e[r])))}function sm(e){return e*nse}function sse(e){if(e.type===\"GEOGCS\"?e.projName=\"longlat\":e.type===\"LOCAL_CS\"?(e.projName=\"identity\",e.local=!0):typeof e.PROJECTION==\"object\"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t=\"\",r=0,i=e.AXIS.length;r<i;++r){var n=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];n[0].indexOf(\"north\")!==-1||(n[0]===\"y\"||n[0]===\"lat\")&&n[1]===\"north\"?t+=\"n\":n[0].indexOf(\"south\")!==-1||(n[0]===\"y\"||n[0]===\"lat\")&&n[1]===\"south\"?t+=\"s\":n[0].indexOf(\"east\")!==-1||(n[0]===\"x\"||n[0]===\"lon\")&&n[1]===\"east\"?t+=\"e\":(n[0].indexOf(\"west\")!==-1||(n[0]===\"x\"||n[0]===\"lon\")&&n[1]===\"west\")&&(t+=\"w\")}t.length===2&&(t+=\"u\"),t.length===3&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units===\"metre\"&&(e.units=\"meter\"),e.UNIT.convert&&(e.type===\"GEOGCS\"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type===\"GEOGCS\"&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)===\"d_\"&&(e.datumCode=e.datumCode.slice(2)),(e.datumCode===\"new_zealand_geodetic_datum_1949\"||e.datumCode===\"new_zealand_1949\")&&(e.datumCode=\"nzgd49\"),(e.datumCode===\"wgs_1984\"||e.datumCode===\"world_geodetic_system_1984\")&&(e.PROJECTION===\"Mercator_Auxiliary_Sphere\"&&(e.sphere=!0),e.datumCode=\"wgs84\"),e.datumCode.slice(-6)===\"_ferro\"&&(e.datumCode=e.datumCode.slice(0,-6)),e.datumCode.slice(-8)===\"_jakarta\"&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf(\"belge\")&&(e.datumCode=\"rnb72\"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),e.ellps.toLowerCase().slice(0,13)===\"international\"&&(e.ellps=\"intl\"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf(\"osgb_1936\")&&(e.datumCode=\"osgb36\"),~e.datumCode.indexOf(\"osni_1952\")&&(e.datumCode=\"osni52\"),(~e.datumCode.indexOf(\"tm65\")||~e.datumCode.indexOf(\"geodetic_datum_of_1965\"))&&(e.datumCode=\"ire65\"),e.datumCode===\"ch1903+\"&&(e.datumCode=\"ch1903\"),~e.datumCode.indexOf(\"israel\")&&(e.datumCode=\"isr93\")),e.b&&!isFinite(e.b)&&(e.b=e.a);function s(p){var g=e.to_meter||1;return p*g}var a=function(p){return ose(e,p)},h=[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_1\",\"Latitude of 1st standard parallel\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"standard_parallel_2\",\"Latitude of 2nd standard parallel\"],[\"false_easting\",\"False_Easting\"],[\"false_easting\",\"False easting\"],[\"false-easting\",\"Easting at false origin\"],[\"false_northing\",\"False_Northing\"],[\"false_northing\",\"False northing\"],[\"false_northing\",\"Northing at false origin\"],[\"central_meridian\",\"Central_Meridian\"],[\"central_meridian\",\"Longitude of natural origin\"],[\"central_meridian\",\"Longitude of false origin\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"latitude_of_origin\",\"Latitude of natural origin\"],[\"latitude_of_origin\",\"Latitude of false origin\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_Of_Center\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",sm],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longitude_of_center\",\"Longitude_of_center\"],[\"longc\",\"longitude_of_center\",sm],[\"x0\",\"false_easting\",s],[\"y0\",\"false_northing\",s],[\"long0\",\"central_meridian\",sm],[\"lat0\",\"latitude_of_origin\",sm],[\"lat0\",\"standard_parallel_1\",sm],[\"lat1\",\"standard_parallel_1\",sm],[\"lat2\",\"standard_parallel_2\",sm],[\"azimuth\",\"Azimuth\"],[\"alpha\",\"azimuth\",sm],[\"srsCode\",\"name\"]];h.forEach(a),!e.long0&&e.longc&&(e.projName===\"Albers_Conic_Equal_Area\"||e.projName===\"Lambert_Azimuthal_Equal_Area\")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName===\"Stereographic_South_Pole\"||e.projName===\"Polar Stereographic (variant B)\")?(e.lat0=sm(e.lat1>0?90:-90),e.lat_ts=e.lat1):!e.lat_ts&&e.lat0&&e.projName===\"Polar_Stereographic\"&&(e.lat_ts=e.lat0,e.lat0=sm(e.lat0>0?90:-90))}function nEt(e){var t=ise(e),r=t.shift(),i=t.shift();t.unshift([\"name\",i]),t.unshift([\"type\",r]);var n={};return iS(t,n),sse(n),n}function Wc(e){var t=this;if(arguments.length===2){var r=arguments[1];typeof r==\"string\"?r.charAt(0)===\"+\"?Wc[e]=Ket(arguments[1]):Wc[e]=nEt(arguments[1]):Wc[e]=r}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(i){Array.isArray(i)?Wc.apply(t,i):Wc(i)});if(typeof e==\"string\"){if(e in Wc)return Wc[e]}else\"EPSG\"in e?Wc[\"EPSG:\"+e.EPSG]=e:\"ESRI\"in e?Wc[\"ESRI:\"+e.ESRI]=e:\"IAU2000\"in e?Wc[\"IAU2000:\"+e.IAU2000]=e:console.log(e);return}}Hoe(Wc);function ase(e){return typeof e==\"string\"}function lse(e){return e in Wc}var cse=[\"PROJECTEDCRS\",\"PROJCRS\",\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\",\"GEODCRS\",\"GEODETICCRS\",\"GEODETICDATUM\",\"ENGCRS\",\"ENGINEERINGCRS\"];function use(e){return cse.some(function(t){return e.indexOf(t)>-1})}var hse=[\"3857\",\"900913\",\"3785\",\"102113\"];function dse(e){var t=m_(e,\"authority\");if(t){var r=m_(t,\"epsg\");return r&&hse.indexOf(r)>-1}}function fse(e){var t=m_(e,\"extension\");if(t)return m_(t,\"proj4\")}function pse(e){return e[0]===\"+\"}function mse(e){if(ase(e)){if(lse(e))return Wc[e];if(use(e)){var t=nEt(e);if(dse(t))return Wc[\"EPSG:3857\"];var r=fse(t);return r?Ket(r):t}if(pse(e))return Ket(e)}else return e}function b5t(e,t){e=e||{};var r,i;if(!t)return e;for(i in t)r=t[i],r!==void 0&&(e[i]=r);return e}function cm(e,t,r){var i=e*t;return r/Math.sqrt(1-i*i)}function ik(e){return e<0?-1:1}function Tr(e){return Math.abs(e)<=Js?e:e-ik(e)*Q8}function vp(e,t,r){var i=e*r,n=.5*e;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(Qe-t))/i}function tk(e,t){for(var r=.5*e,i,n,o=Qe-2*Math.atan(t),s=0;s<=15;s++)if(i=e*Math.sin(o),n=Qe-2*Math.atan(t*Math.pow((1-i)/(1+i),r))-o,o+=n,Math.abs(n)<=1e-10)return o;return-9999}function gse(){var e=this.b/this.a;this.es=1-e*e,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=cm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Ase(e){var t=e.x,r=e.y;if(r*am>90&&r*am<-90&&t*am>180&&t*am<-180)return null;var i,n;if(Math.abs(Math.abs(r)-Qe)<=pr)return null;if(this.sphere)i=this.x0+this.a*this.k0*Tr(t-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Ln+.5*r));else{var o=Math.sin(r),s=vp(this.e,r,o);i=this.x0+this.a*this.k0*Tr(t-this.long0),n=this.y0-this.a*this.k0*Math.log(s)}return e.x=i,e.y=n,e}function yse(e){var t=e.x-this.x0,r=e.y-this.y0,i,n;if(this.sphere)n=Qe-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(n=tk(this.e,o),n===-9999)return null}return i=Tr(this.long0+t/(this.a*this.k0)),e.x=i,e.y=n,e}var _se=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"merc\"],vse={init:gse,forward:Ase,inverse:yse,names:_se};function bse(){}function x5t(e){return e}var xse=[\"longlat\",\"identity\"],wse={init:bse,forward:x5t,inverse:x5t,names:xse},Tse=[vse,wse],$z={},Zz=[];function oEt(e,t){var r=Zz.length;return e.names?(Zz[r]=e,e.names.forEach(function(i){$z[i.toLowerCase()]=r}),this):(console.log(t),!0)}function Sse(e){if(!e)return!1;var t=e.toLowerCase();if(typeof $z[t]<\"u\"&&Zz[$z[t]])return Zz[$z[t]]}function Mse(){Tse.forEach(oEt)}var Ese={start:Mse,add:oEt,get:Sse},xi={};xi.MERIT={a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"};xi.SGS85={a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"};xi.GRS80={a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"};xi.IAU76={a:6378140,rf:298.257,ellipseName:\"IAU 1976\"};xi.airy={a:6377563396e-3,b:635625691e-2,ellipseName:\"Airy 1830\"};xi.APL4={a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"};xi.NWL9D={a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"};xi.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:\"Modified Airy\"};xi.andrae={a:637710443e-2,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"};xi.aust_SA={a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"};xi.GRS67={a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"};xi.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:\"Bessel 1841\"};xi.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"};xi.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:\"Clarke 1866\"};xi.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"};xi.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:\"Clarke 1880 (IGN)\"};xi.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:\"Clarke 1858\"};xi.CPM={a:63757387e-1,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"};xi.delmbr={a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"};xi.engelis={a:637813605e-2,rf:298.2566,ellipseName:\"Engelis 1985\"};xi.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:\"Everest 1830\"};xi.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:\"Everest 1948\"};xi.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:\"Everest 1956\"};xi.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:\"Everest 1969\"};xi.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"};xi.fschr60={a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"};xi.fschr60m={a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"};xi.fschr68={a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"};xi.helmert={a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"};xi.hough={a:6378270,rf:297,ellipseName:\"Hough\"};xi.intl={a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"};xi.kaula={a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"};xi.lerch={a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"};xi.mprts={a:6397300,rf:191,ellipseName:\"Maupertius 1738\"};xi.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:\"New International 1967\"};xi.plessis={a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"};xi.krass={a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"};xi.SEasia={a:6378155,b:63567733205e-4,ellipseName:\"Southeast Asia\"};xi.walbeck={a:6376896,b:63558348467e-4,ellipseName:\"Walbeck\"};xi.WGS60={a:6378165,rf:298.3,ellipseName:\"WGS 60\"};xi.WGS66={a:6378145,rf:298.25,ellipseName:\"WGS 66\"};xi.WGS7={a:6378135,rf:298.26,ellipseName:\"WGS 72\"};var Pse=xi.WGS84={a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"};xi.sphere={a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"};function Cse(e,t,r,i){var n=e*e,o=t*t,s=(n-o)/n,a=0;i?(e*=1-s*(Zoe+s*(Koe+s*Qoe)),n=e*e,s=0):a=Math.sqrt(s);var h=(n-o)/o;return{es:s,e:a,ep2:h}}function Ise(e,t,r,i,n){if(!e){var o=m_(xi,i);o||(o=Pse),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(r===0||Math.abs(e-t)<pr)&&(n=!0,t=e),{a:e,b:t,rf:r,sphere:n}}var Ba={};Ba.wgs84={towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"};Ba.ch1903={towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"};Ba.ggrs87={towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"};Ba.nad83={towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"};Ba.nad27={nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"};Ba.potsdam={towgs84:\"598.1,73.7,418.2,0.202,0.045,-2.455,6.7\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"};Ba.carthage={towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"};Ba.hermannskogel={towgs84:\"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",ellipse:\"bessel\",datumName:\"Hermannskogel\"};Ba.militargeographische_institut={towgs84:\"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",ellipse:\"bessel\",datumName:\"Militar-Geographische Institut\"};Ba.osni52={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"airy\",datumName:\"Irish National\"};Ba.ire65={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"};Ba.rassadiran={towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"};Ba.nzgd49={towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"};Ba.osgb36={towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Airy 1830\"};Ba.s_jtsk={towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"};Ba.beduaram={towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"};Ba.gunung_segara={towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"};Ba.rnb72={towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"};function kse(e,t,r,i,n,o,s){var a={};return e===void 0||e===\"none\"?a.datum_type=Zet:a.datum_type=Yoe,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=Bx),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Fx,a.datum_params[3]*=W8,a.datum_params[4]*=W8,a.datum_params[5]*=W8,a.datum_params[6]=a.datum_params[6]/1e6+1)),s&&(a.datum_type=aS,a.grids=s),a.a=r,a.b=i,a.es=n,a.ep2=o,a}var sEt={};function Rse(e,t){var r=new DataView(t),i=Lse(r),n=Bse(r,i),o=Fse(r,n,i),s={header:n,subgrids:o};return sEt[e]=s,s}function Dse(e){if(e===void 0)return null;var t=e.split(\",\");return t.map(Ose)}function Ose(e){if(e.length===0)return null;var t=e[0]===\"@\";return t&&(e=e.slice(1)),e===\"null\"?{name:\"null\",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:sEt[e]||null,isNull:!1}}function nS(e){return e/3600*Math.PI/180}function Lse(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn(\"Failed to detect nadgrid endian-ness, defaulting to little-endian\"),!0)}function Bse(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Qet(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function Qet(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function Fse(e,t,r){for(var i=176,n=[],o=0;o<t.nSubgrids;o++){var s=zse(e,i,r),a=Use(e,i,s,r),h=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),p=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);n.push({ll:[nS(s.lowerLongitude),nS(s.lowerLatitude)],del:[nS(s.longitudeInterval),nS(s.latitudeInterval)],lim:[h,p],count:s.gridNodeCount,cvs:Nse(a)}),i+=176+s.gridNodeCount*16}return n}function Nse(e){return e.map(function(t){return[nS(t.longitudeShift),nS(t.latitudeShift)]})}function zse(e,t,r){return{name:Qet(e,t+8,t+16).trim(),parent:Qet(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function Use(e,t,r,i){for(var n=t+176,o=16,s=[],a=0;a<r.gridNodeCount;a++){var h={latitudeShift:e.getFloat32(n+a*o,i),longitudeShift:e.getFloat32(n+a*o+4,i),latitudeAccuracy:e.getFloat32(n+a*o+8,i),longitudeAccuracy:e.getFloat32(n+a*o+12,i)};s.push(h)}return s}function lm(e,t){if(!(this instanceof lm))return new lm(e);t=t||function(p){if(p)throw p};var r=mse(e);if(typeof r!=\"object\"){t(e);return}var i=lm.projections.get(r.projName);if(!i){t(e);return}if(r.datumCode&&r.datumCode!==\"none\"){var n=m_(Ba,r.datumCode);n&&(r.datum_params=r.datum_params||(n.towgs84?n.towgs84.split(\",\"):null),r.ellps=n.ellipse,r.datumName=n.datumName?n.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||\"enu\",r.ellps=r.ellps||\"wgs84\",r.lat1=r.lat1||r.lat0;var o=Ise(r.a,r.b,r.rf,r.ellps,r.sphere),s=Cse(o.a,o.b,o.rf,r.R_A),a=Dse(r.nadgrids),h=r.datum||kse(r.datumCode,r.datum_params,o.a,o.b,s.es,s.ep2,a);b5t(this,r),b5t(this,i),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=s.es,this.e=s.e,this.ep2=s.ep2,this.datum=h,this.init(),t(null,this)}lm.projections=Ese;lm.projections.start();function Vse(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===Bx?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Fx?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function aEt(e,t,r){var i=e.x,n=e.y,o=e.z?e.z:0,s,a,h,p;if(n<-Qe&&n>-1.001*Qe)n=-Qe;else if(n>Qe&&n<1.001*Qe)n=Qe;else{if(n<-Qe)return{x:-1/0,y:-1/0,z:e.z};if(n>Qe)return{x:1/0,y:1/0,z:e.z}}return i>Math.PI&&(i-=2*Math.PI),a=Math.sin(n),p=Math.cos(n),h=a*a,s=r/Math.sqrt(1-t*h),{x:(s+o)*p*Math.cos(i),y:(s+o)*p*Math.sin(i),z:(s*(1-t)+o)*a}}function lEt(e,t,r,i){var n=1e-12,o=n*n,s=30,a,h,p,g,w,C,R,z,W,Y,H,Q,tt,rt=e.x,at=e.y,et=e.z?e.z:0,lt,J,ft;if(a=Math.sqrt(rt*rt+at*at),h=Math.sqrt(rt*rt+at*at+et*et),a/r<n){if(lt=0,h/r<n)return J=Qe,ft=-i,{x:e.x,y:e.y,z:e.z}}else lt=Math.atan2(at,rt);p=et/h,g=a/h,w=1/Math.sqrt(1-t*(2-t)*g*g),z=g*(1-t)*w,W=p*w,tt=0;do tt++,R=r/Math.sqrt(1-t*W*W),ft=a*z+et*W-R*(1-t*W*W),C=t*R/(R+ft),w=1/Math.sqrt(1-C*(2-C)*g*g),Y=g*(1-C)*w,H=p*w,Q=H*z-Y*W,z=Y,W=H;while(Q*Q>o&&tt<s);return J=Math.atan(H/Math.abs(Y)),{x:lt,y:J,z:ft}}function jse(e,t,r){if(t===Bx)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Fx){var i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],h=r[5],p=r[6];return{x:p*(e.x-h*e.y+a*e.z)+i,y:p*(h*e.x+e.y-s*e.z)+n,z:p*(-a*e.x+s*e.y+e.z)+o}}}function $se(e,t,r){if(t===Bx)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Fx){var i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],h=r[5],p=r[6],g=(e.x-i)/p,w=(e.y-n)/p,C=(e.z-o)/p;return{x:g+h*w-a*C,y:-h*g+w+s*C,z:a*g-s*w+C}}}function Uz(e){return e===Bx||e===Fx}function Gse(e,t,r){if(Vse(e,t)||e.datum_type===Zet||t.datum_type===Zet)return r;var i=e.a,n=e.es;if(e.datum_type===aS){var o=w5t(e,!1,r);if(o!==0)return;i=A5t,n=y5t}var s=t.a,a=t.b,h=t.es;if(t.datum_type===aS&&(s=A5t,a=Xoe,h=y5t),n===h&&i===s&&!Uz(e.datum_type)&&!Uz(t.datum_type))return r;if(r=aEt(r,n,i),Uz(e.datum_type)&&(r=jse(r,e.datum_type,e.datum_params)),Uz(t.datum_type)&&(r=$se(r,t.datum_type,t.datum_params)),r=lEt(r,h,s,a),t.datum_type===aS){var p=w5t(t,!0,r);if(p!==0)return}return r}function w5t(e,t,r){if(e.grids===null||e.grids.length===0)return console.log(\"Grid shift grids not found\"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},o=[];t:for(var s=0;s<e.grids.length;s++){var a=e.grids[s];if(o.push(a.name),a.isNull){n=i;break}if(a.mandatory,a.grid===null){if(a.mandatory)return console.log(\"Unable to find mandatory grid '\"+a.name+\"'\"),-1;continue}for(var h=a.grid.subgrids,p=0,g=h.length;p<g;p++){var w=h[p],C=(Math.abs(w.del[1])+Math.abs(w.del[0]))/1e4,R=w.ll[0]-C,z=w.ll[1]-C,W=w.ll[0]+(w.lim[0]-1)*w.del[0]+C,Y=w.ll[1]+(w.lim[1]-1)*w.del[1]+C;if(!(z>i.y||R>i.x||Y<i.y||W<i.x)&&(n=Wse(i,t,w),!isNaN(n.x)))break t}}return isNaN(n.x)?(console.log(\"Failed to find a grid shift table for location '\"+-i.x*am+\" \"+i.y*am+\" tried: '\"+o+\"'\"),-1):(r.x=-n.x,r.y=n.y,0)}function Wse(e,t,r){var i={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return i;var n={x:e.x,y:e.y};n.x-=r.ll[0],n.y-=r.ll[1],n.x=Tr(n.x-Math.PI)+Math.PI;var o=T5t(n,r);if(t){if(isNaN(o.x))return i;o.x=n.x-o.x,o.y=n.y-o.y;var s=9,a=1e-12,h,p;do{if(p=T5t(o,r),isNaN(p.x)){console.log(\"Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.\");break}h={x:n.x-(p.x+o.x),y:n.y-(p.y+o.y)},o.x+=h.x,o.y+=h.y}while(s--&&Math.abs(h.x)>a&&Math.abs(h.y)>a);if(s<0)return console.log(\"Inverse grid shift iterator failed to converge.\"),i;i.x=Tr(o.x+r.ll[0]),i.y=o.y+r.ll[1]}else isNaN(o.x)||(i.x=e.x+o.x,i.y=e.y+o.y);return i}function T5t(e,t){var r={x:e.x/t.del[0],y:e.y/t.del[1]},i={x:Math.floor(r.x),y:Math.floor(r.y)},n={x:r.x-1*i.x,y:r.y-1*i.y},o={x:Number.NaN,y:Number.NaN},s;if(i.x<0||i.x>=t.lim[0]||i.y<0||i.y>=t.lim[1])return o;s=i.y*t.lim[0]+i.x;var a={x:t.cvs[s][0],y:t.cvs[s][1]};s++;var h={x:t.cvs[s][0],y:t.cvs[s][1]};s+=t.lim[0];var p={x:t.cvs[s][0],y:t.cvs[s][1]};s--;var g={x:t.cvs[s][0],y:t.cvs[s][1]},w=n.x*n.y,C=n.x*(1-n.y),R=(1-n.x)*(1-n.y),z=(1-n.x)*n.y;return o.x=R*a.x+C*h.x+z*g.x+w*p.x,o.y=R*a.y+C*h.y+z*g.y+w*p.y,o}function S5t(e,t,r){var i=r.x,n=r.y,o=r.z||0,s,a,h,p={};for(h=0;h<3;h++)if(!(t&&h===2&&r.z===void 0))switch(h===0?(s=i,\"ew\".indexOf(e.axis[h])!==-1?a=\"x\":a=\"y\"):h===1?(s=n,\"ns\".indexOf(e.axis[h])!==-1?a=\"y\":a=\"x\"):(s=o,a=\"z\"),e.axis[h]){case\"e\":p[a]=s;break;case\"w\":p[a]=-s;break;case\"n\":p[a]=s;break;case\"s\":p[a]=-s;break;case\"u\":r[a]!==void 0&&(p.z=s);break;case\"d\":r[a]!==void 0&&(p.z=-s);break;default:return null}return p}function cEt(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function qse(e){M5t(e.x),M5t(e.y)}function M5t(e){if(typeof Number.isFinite==\"function\"){if(Number.isFinite(e))return;throw new TypeError(\"coordinates must be finite numbers\")}if(typeof e!=\"number\"||e!==e||!isFinite(e))throw new TypeError(\"coordinates must be finite numbers\")}function Hse(e,t){return(e.datum.datum_type===Bx||e.datum.datum_type===Fx||e.datum.datum_type===aS)&&t.datumCode!==\"WGS84\"||(t.datum.datum_type===Bx||t.datum.datum_type===Fx||t.datum.datum_type===aS)&&e.datumCode!==\"WGS84\"}function Kz(e,t,r,i){var n;Array.isArray(r)?r=cEt(r):r={x:r.x,y:r.y,z:r.z,m:r.m};var o=r.z!==void 0;if(qse(r),e.datum&&t.datum&&Hse(e,t)&&(n=new lm(\"WGS84\"),r=Kz(e,n,r,i),e=n),i&&e.axis!==\"enu\"&&(r=S5t(e,!1,r)),e.projName===\"longlat\")r={x:r.x*Fl,y:r.y*Fl,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),r=e.inverse(r),!r)return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=Gse(e.datum,t.datum,r),!!r)return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),t.projName===\"longlat\"?r={x:r.x*am,y:r.y*am,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),i&&t.axis!==\"enu\"?S5t(t,!0,r):(r&&!o&&delete r.z,r)}var E5t=lm(\"WGS84\");function $et(e,t,r,i){var n,o,s;return Array.isArray(r)?(n=Kz(e,t,r,i)||{x:NaN,y:NaN},r.length>2?typeof e.name<\"u\"&&e.name===\"geocent\"||typeof t.name<\"u\"&&t.name===\"geocent\"?typeof n.z==\"number\"?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(o=Kz(e,t,r,i),s=Object.keys(r),s.length===2||s.forEach(function(a){if(typeof e.name<\"u\"&&e.name===\"geocent\"||typeof t.name<\"u\"&&t.name===\"geocent\"){if(a===\"x\"||a===\"y\"||a===\"z\")return}else if(a===\"x\"||a===\"y\")return;o[a]=r[a]}),o)}function P5t(e){return e instanceof lm?e:e.oProj?e.oProj:lm(e)}function Nh(e,t,r){e=P5t(e);var i=!1,n;return typeof t>\"u\"?(t=e,e=E5t,i=!0):(typeof t.x<\"u\"||Array.isArray(t))&&(r=t,t=e,e=E5t,i=!0),t=P5t(t),r?$et(e,t,r):(n={forward:function(o,s){return $et(e,t,o,s)},inverse:function(o,s){return $et(t,e,o,s)}},i&&(n.oProj=t),n)}var C5t=6,uEt=\"AJSAJS\",hEt=\"AFAFAF\",oS=65,Ou=73,Jd=79,j8=86,$8=90,Yse={forward:dEt,inverse:Xse,toPoint:fEt};function dEt(e,t){return t=t||5,Qse(Zse({lat:e[1],lon:e[0]}),t)}function Xse(e){var t=ort(mEt(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function fEt(e){var t=ort(mEt(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Get(e){return e*(Math.PI/180)}function I5t(e){return 180*(e/Math.PI)}function Zse(e){var t=e.lat,r=e.lon,i=6378137,n=.00669438,o=.9996,s,a,h,p,g,w,C,R=Get(t),z=Get(r),W,Y;Y=Math.floor((r+180)/6)+1,r===180&&(Y=60),t>=56&&t<64&&r>=3&&r<12&&(Y=32),t>=72&&t<84&&(r>=0&&r<9?Y=31:r>=9&&r<21?Y=33:r>=21&&r<33?Y=35:r>=33&&r<42&&(Y=37)),s=(Y-1)*6-180+3,W=Get(s),a=n/(1-n),h=i/Math.sqrt(1-n*Math.sin(R)*Math.sin(R)),p=Math.tan(R)*Math.tan(R),g=a*Math.cos(R)*Math.cos(R),w=Math.cos(R)*(z-W),C=i*((1-n/4-3*n*n/64-5*n*n*n/256)*R-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*R)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*R)-35*n*n*n/3072*Math.sin(6*R));var H=o*h*(w+(1-p+g)*w*w*w/6+(5-18*p+p*p+72*g-58*a)*w*w*w*w*w/120)+5e5,Q=o*(C+h*Math.tan(R)*(w*w/2+(5-p+9*g+4*g*g)*w*w*w*w/24+(61-58*p+p*p+600*g-330*a)*w*w*w*w*w*w/720));return t<0&&(Q+=1e7),{northing:Math.round(Q),easting:Math.round(H),zoneNumber:Y,zoneLetter:Kse(t)}}function ort(e){var t=e.northing,r=e.easting,i=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var o=.9996,s=6378137,a=.00669438,h,p=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),g,w,C,R,z,W,Y,H,Q,tt=r-5e5,rt=t;i<\"N\"&&(rt-=1e7),Y=(n-1)*6-180+3,h=a/(1-a),W=rt/o,H=W/(s*(1-a/4-3*a*a/64-5*a*a*a/256)),Q=H+(3*p/2-27*p*p*p/32)*Math.sin(2*H)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*H)+151*p*p*p/96*Math.sin(6*H),g=s/Math.sqrt(1-a*Math.sin(Q)*Math.sin(Q)),w=Math.tan(Q)*Math.tan(Q),C=h*Math.cos(Q)*Math.cos(Q),R=s*(1-a)/Math.pow(1-a*Math.sin(Q)*Math.sin(Q),1.5),z=tt/(g*o);var at=Q-g*Math.tan(Q)/R*(z*z/2-(5+3*w+10*C-4*C*C-9*h)*z*z*z*z/24+(61+90*w+298*C+45*w*w-252*h-3*C*C)*z*z*z*z*z*z/720);at=I5t(at);var et=(z-(1+2*w+C)*z*z*z/6+(5-2*C+28*w-3*C*C+8*h+24*w*w)*z*z*z*z*z/120)/Math.cos(Q);et=Y+I5t(et);var lt;if(e.accuracy){var J=ort({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});lt={top:J.lat,right:J.lon,bottom:at,left:et}}else lt={lat:at,lon:et};return lt}function Kse(e){var t=\"Z\";return 84>=e&&e>=72?t=\"X\":72>e&&e>=64?t=\"W\":64>e&&e>=56?t=\"V\":56>e&&e>=48?t=\"U\":48>e&&e>=40?t=\"T\":40>e&&e>=32?t=\"S\":32>e&&e>=24?t=\"R\":24>e&&e>=16?t=\"Q\":16>e&&e>=8?t=\"P\":8>e&&e>=0?t=\"N\":0>e&&e>=-8?t=\"M\":-8>e&&e>=-16?t=\"L\":-16>e&&e>=-24?t=\"K\":-24>e&&e>=-32?t=\"J\":-32>e&&e>=-40?t=\"H\":-40>e&&e>=-48?t=\"G\":-48>e&&e>=-56?t=\"F\":-56>e&&e>=-64?t=\"E\":-64>e&&e>=-72?t=\"D\":-72>e&&e>=-80&&(t=\"C\"),t}function Qse(e,t){var r=\"00000\"+e.easting,i=\"00000\"+e.northing;return e.zoneNumber+e.zoneLetter+Jse(e.easting,e.northing,e.zoneNumber)+r.substr(r.length-5,t)+i.substr(i.length-5,t)}function Jse(e,t,r){var i=pEt(r),n=Math.floor(e/1e5),o=Math.floor(t/1e5)%20;return tae(n,o,i)}function pEt(e){var t=e%C5t;return t===0&&(t=C5t),t}function tae(e,t,r){var i=r-1,n=uEt.charCodeAt(i),o=hEt.charCodeAt(i),s=n+e-1,a=o+t,h=!1;s>$8&&(s=s-$8+oS-1,h=!0),(s===Ou||n<Ou&&s>Ou||(s>Ou||n<Ou)&&h)&&s++,(s===Jd||n<Jd&&s>Jd||(s>Jd||n<Jd)&&h)&&(s++,s===Ou&&s++),s>$8&&(s=s-$8+oS-1),a>j8?(a=a-j8+oS-1,h=!0):h=!1,(a===Ou||o<Ou&&a>Ou||(a>Ou||o<Ou)&&h)&&a++,(a===Jd||o<Jd&&a>Jd||(a>Jd||o<Jd)&&h)&&(a++,a===Ou&&a++),a>j8&&(a=a-j8+oS-1);var p=String.fromCharCode(s)+String.fromCharCode(a);return p}function mEt(e){if(e&&e.length===0)throw\"MGRSPoint coverting from nothing\";for(var t=e.length,r=null,i=\"\",n,o=0;!/[A-Z]/.test(n=e.charAt(o));){if(o>=2)throw\"MGRSPoint bad conversion from: \"+e;i+=n,o++}var s=parseInt(i,10);if(o===0||o+3>t)throw\"MGRSPoint bad conversion from: \"+e;var a=e.charAt(o++);if(a<=\"A\"||a===\"B\"||a===\"Y\"||a>=\"Z\"||a===\"I\"||a===\"O\")throw\"MGRSPoint zone letter \"+a+\" not handled: \"+e;r=e.substring(o,o+=2);for(var h=pEt(s),p=eae(r.charAt(0),h),g=rae(r.charAt(1),h);g<iae(a);)g+=2e6;var w=t-o;if(w%2!==0)throw`MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters`+e;var C=w/2,R=0,z=0,W,Y,H,Q,tt;return C>0&&(W=1e5/Math.pow(10,C),Y=e.substring(o,o+C),R=parseFloat(Y)*W,H=e.substring(o+C),z=parseFloat(H)*W),Q=R+p,tt=z+g,{easting:Q,northing:tt,zoneLetter:a,zoneNumber:s,accuracy:W}}function eae(e,t){for(var r=uEt.charCodeAt(t-1),i=1e5,n=!1;r!==e.charCodeAt(0);){if(r++,r===Ou&&r++,r===Jd&&r++,r>$8){if(n)throw\"Bad character: \"+e;r=oS,n=!0}i+=1e5}return i}function rae(e,t){if(e>\"V\")throw\"MGRSPoint given invalid Northing \"+e;for(var r=hEt.charCodeAt(t-1),i=0,n=!1;r!==e.charCodeAt(0);){if(r++,r===Ou&&r++,r===Jd&&r++,r>j8){if(n)throw\"Bad character: \"+e;r=oS,n=!0}i+=1e5}return i}function iae(e){var t;switch(e){case\"C\":t=11e5;break;case\"D\":t=2e6;break;case\"E\":t=28e5;break;case\"F\":t=37e5;break;case\"G\":t=46e5;break;case\"H\":t=55e5;break;case\"J\":t=64e5;break;case\"K\":t=73e5;break;case\"L\":t=82e5;break;case\"M\":t=91e5;break;case\"N\":t=0;break;case\"P\":t=8e5;break;case\"Q\":t=17e5;break;case\"R\":t=26e5;break;case\"S\":t=35e5;break;case\"T\":t=44e5;break;case\"U\":t=53e5;break;case\"V\":t=62e5;break;case\"W\":t=7e6;break;case\"X\":t=79e5;break;default:t=-1}if(t>=0)return t;throw\"Invalid zone letter: \"+e}function uS(e,t,r){if(!(this instanceof uS))return new uS(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==\"object\")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==\"string\"&&typeof t>\"u\"){var i=e.split(\",\");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn(\"proj4.Point will be removed in version 3, use proj4.toPoint\")}uS.fromMGRS=function(e){return new uS(fEt(e))};uS.prototype.toMGRS=function(e){return dEt([this.x,this.y],e)};var nae=1,oae=.25,k5t=.046875,R5t=.01953125,D5t=.01068115234375,sae=.75,aae=.46875,lae=.013020833333333334,cae=.007120768229166667,uae=.3645833333333333,hae=.005696614583333333,dae=.3076171875;function gEt(e){var t=[];t[0]=nae-e*(oae+e*(k5t+e*(R5t+e*D5t))),t[1]=e*(sae-e*(k5t+e*(R5t+e*D5t)));var r=e*e;return t[2]=r*(aae-e*(lae+e*cae)),r*=e,t[3]=r*(uae-e*hae),t[4]=r*e*dae,t}function oU(e,t,r,i){return r*=t,t*=t,i[0]*e-r*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var fae=20;function AEt(e,t,r){for(var i=1/(1-t),n=e,o=fae;o;--o){var s=Math.sin(n),a=1-t*s*s;if(a=(oU(n,s,Math.cos(n),r)-e)*(a*Math.sqrt(a))*i,n-=a,Math.abs(a)<pr)return n}return n}function pae(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=gEt(this.es),this.ml0=oU(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function mae(e){var t=e.x,r=e.y,i=Tr(t-this.long0),n,o,s,a=Math.sin(r),h=Math.cos(r);if(this.es){var g=h*i,w=Math.pow(g,2),C=this.ep2*Math.pow(h,2),R=Math.pow(C,2),z=Math.abs(h)>pr?Math.tan(r):0,W=Math.pow(z,2),Y=Math.pow(W,2);n=1-this.es*Math.pow(a,2),g=g/Math.sqrt(n);var H=oU(r,a,h,this.en);o=this.a*(this.k0*g*(1+w/6*(1-W+C+w/20*(5-18*W+Y+14*C-58*W*C+w/42*(61+179*Y-Y*W-479*W)))))+this.x0,s=this.a*(this.k0*(H-this.ml0+a*i*g/2*(1+w/12*(5-W+9*C+4*R+w/30*(61+Y-58*W+270*C-330*W*C+w/56*(1385+543*Y-Y*W-3111*W))))))+this.y0}else{var p=h*Math.sin(i);if(Math.abs(Math.abs(p)-1)<pr)return 93;if(o=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,s=h*Math.cos(i)/Math.sqrt(1-Math.pow(p,2)),p=Math.abs(s),p>=1){if(p-1>pr)return 93;s=0}else s=Math.acos(s);r<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return e.x=o,e.y=s,e}function gae(e){var t,r,i,n,o=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+s/this.k0,r=AEt(t,this.es,this.en),Math.abs(r)<Qe){var w=Math.sin(r),C=Math.cos(r),R=Math.abs(C)>pr?Math.tan(r):0,z=this.ep2*Math.pow(C,2),W=Math.pow(z,2),Y=Math.pow(R,2),H=Math.pow(Y,2);t=1-this.es*Math.pow(w,2);var Q=o*Math.sqrt(t)/this.k0,tt=Math.pow(Q,2);t=t*R,i=r-t*tt/(1-this.es)*.5*(1-tt/12*(5+3*Y-9*z*Y+z-4*W-tt/30*(61+90*Y-252*z*Y+45*H+46*z-tt/56*(1385+3633*Y+4095*H+1574*H*Y)))),n=Tr(this.long0+Q*(1-tt/6*(1+2*Y+z-tt/20*(5+28*Y+24*H+8*z*Y+6*z-tt/42*(61+662*Y+1320*H+720*H*Y))))/C)}else i=Qe*ik(s),n=0;else{var a=Math.exp(o/this.k0),h=.5*(a-1/a),p=this.lat0+s/this.k0,g=Math.cos(p);t=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(h,2))),i=Math.asin(t),s<0&&(i=-i),h===0&&g===0?n=0:n=Tr(Math.atan2(h,g)+this.long0)}return e.x=n,e.y=i,e}var Aae=[\"Fast_Transverse_Mercator\",\"Fast Transverse Mercator\"],Gz={init:pae,forward:mae,inverse:gae,names:Aae};function yEt(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function ef(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),i=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function yae(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function _ae(e){var t=Math.abs(e);return t=yae(t*(1+t/(ef(1,t)+1))),e<0?-t:t}function srt(e,t){for(var r=2*Math.cos(2*t),i=e.length-1,n=e[i],o=0,s;--i>=0;)s=-o+r*n+e[i],o=n,n=s;return t+s*Math.sin(2*t)}function vae(e,t){for(var r=2*Math.cos(t),i=e.length-1,n=e[i],o=0,s;--i>=0;)s=-o+r*n+e[i],o=n,n=s;return Math.sin(t)*s}function bae(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function _Et(e,t,r){for(var i=Math.sin(t),n=Math.cos(t),o=yEt(r),s=bae(r),a=2*n*s,h=-2*i*o,p=e.length-1,g=e[p],w=0,C=0,R=0,z,W;--p>=0;)z=C,W=w,C=g,w=R,g=-z+a*C-h*w+e[p],R=-W+h*C+a*w;return a=i*s,h=n*o,[a*g-h*R,a*R+h*g]}function xae(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');this.approx&&(Gz.init.apply(this),this.forward=Gz.forward,this.inverse=Gz.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var i=srt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+vae(this.gtu,2*i))}function wae(e){var t=Tr(e.x-this.long0),r=e.y;r=srt(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),o=Math.sin(t),s=Math.cos(t);r=Math.atan2(i,s*n),t=Math.atan2(o*n,ef(i,n*s)),t=_ae(Math.tan(t));var a=_Et(this.gtu,2*r,2*t);r=r+a[0],t=t+a[1];var h,p;return Math.abs(t)<=2.623395162778?(h=this.a*(this.Qn*t)+this.x0,p=this.a*(this.Qn*r+this.Zb)+this.y0):(h=1/0,p=1/0),e.x=h,e.y=p,e}function Tae(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var i,n;if(Math.abs(t)<=2.623395162778){var o=_Et(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(yEt(t));var s=Math.sin(r),a=Math.cos(r),h=Math.sin(t),p=Math.cos(t);r=Math.atan2(s*p,ef(h,p*a)),t=Math.atan2(h,p*a),i=Tr(t+this.long0),n=srt(this.cgb,r)}else i=1/0,n=1/0;return e.x=i,e.y=n,e}var Sae=[\"Extended_Transverse_Mercator\",\"Extended Transverse Mercator\",\"etmerc\",\"Transverse_Mercator\",\"Transverse Mercator\",\"Gauss Kruger\",\"Gauss_Kruger\",\"tmerc\"],Wz={init:xae,forward:wae,inverse:Tae,names:Sae};function Mae(e,t){if(e===void 0){if(e=Math.floor((Tr(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var Eae=\"etmerc\";function Pae(){var e=Mae(this.zone,this.long0);if(e===void 0)throw new Error(\"unknown utm zone\");this.lat0=0,this.long0=(6*Math.abs(e)-183)*Fl,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Wz.init.apply(this),this.forward=Wz.forward,this.inverse=Wz.inverse}var Cae=[\"Universal Transverse Mercator System\",\"utm\"],Iae={init:Pae,names:Cae,dependsOn:Eae};function art(e,t){return Math.pow((1-e)/(1+e),t)}var kae=20;function Rae(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ln)/(Math.pow(Math.tan(.5*this.lat0+Ln),this.C)*art(this.e*e,this.ratexp))}function Dae(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+Ln),this.C)*art(this.e*Math.sin(r),this.ratexp))-Qe,e.x=this.C*t,e}function Oae(e){for(var t=1e-14,r=e.x/this.C,i=e.y,n=Math.pow(Math.tan(.5*i+Ln)/this.K,1/this.C),o=kae;o>0&&(i=2*Math.atan(n*art(this.e*Math.sin(e.y),-.5*this.e))-Qe,!(Math.abs(i-e.y)<t));--o)e.y=i;return o?(e.x=r,e.y=i,e):null}var Lae=[\"gauss\"],lrt={init:Rae,forward:Dae,inverse:Oae,names:Lae};function Bae(){lrt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title=\"Oblique Stereographic Alternative\"))}function Fae(e){var t,r,i,n;return e.x=Tr(e.x-this.long0),lrt.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),i=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*i),e.x=n*r*Math.sin(e.x),e.y=n*(this.cosc0*t-this.sinc0*r*i),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Nae(e){var t,r,i,n,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=ef(e.x,e.y)){var s=2*Math.atan2(o,this.R2);t=Math.sin(s),r=Math.cos(s),n=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),i=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else n=this.phic0,i=0;return e.x=i,e.y=n,lrt.inverse.apply(this,[e]),e.x=Tr(e.x+this.long0),e}var zae=[\"Stereographic_North_Pole\",\"Oblique_Stereographic\",\"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"],Uae={init:Bae,forward:Fae,inverse:Nae,names:zae};function Vae(e,t,r){return t*=r,Math.tan(.5*(Qe+e))*Math.pow((1-t)/(1+t),.5*r)}function jae(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=pr&&(this.k0=.5*(1+ik(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=pr&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=pr&&Math.abs(Math.cos(this.lat_ts))>pr&&(this.k0=.5*this.cons*cm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/vp(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=cm(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Qe,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function $ae(e){var t=e.x,r=e.y,i=Math.sin(r),n=Math.cos(r),o,s,a,h,p,g,w=Tr(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=pr&&Math.abs(r+this.lat0)<=pr?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*i+this.coslat0*n*Math.cos(w)),e.x=this.a*o*n*Math.sin(w)+this.x0,e.y=this.a*o*(this.coslat0*i-this.sinlat0*n*Math.cos(w))+this.y0,e):(s=2*Math.atan(this.ssfn_(r,i,this.e))-Qe,h=Math.cos(s),a=Math.sin(s),Math.abs(this.coslat0)<=pr?(p=vp(this.e,r*this.con,this.con*i),g=2*this.a*this.k0*p/this.cons,e.x=this.x0+g*Math.sin(t-this.long0),e.y=this.y0-this.con*g*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<pr?(o=2*this.a*this.k0/(1+h*Math.cos(w)),e.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(w))),e.y=o*(this.cosX0*a-this.sinX0*h*Math.cos(w))+this.y0),e.x=o*h*Math.sin(w)+this.x0,e))}function Gae(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,n,o,s=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var a=2*Math.atan(s/(2*this.a*this.k0));return t=this.long0,r=this.lat0,s<=pr?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(a)*this.sinlat0+e.y*Math.sin(a)*this.coslat0/s),Math.abs(this.coslat0)<pr?this.lat0>0?t=Tr(this.long0+Math.atan2(e.x,-1*e.y)):t=Tr(this.long0+Math.atan2(e.x,e.y)):t=Tr(this.long0+Math.atan2(e.x*Math.sin(a),s*this.coslat0*Math.cos(a)-e.y*this.sinlat0*Math.sin(a))),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=pr){if(s<=pr)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,i=s*this.cons/(2*this.a*this.k0),r=this.con*tk(this.e,i),t=this.con*Tr(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,s<=pr?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/s),t=Tr(this.long0+Math.atan2(e.x*Math.sin(n),s*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),r=-1*tk(this.e,Math.tan(.5*(Qe+o)));return e.x=t,e.y=r,e}var Wae=[\"stere\",\"Stereographic_South_Pole\",\"Polar Stereographic (variant B)\",\"Polar_Stereographic\"],qae={init:jae,forward:$ae,inverse:Gae,names:Wae,ssfn_:Vae};function Hae(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,i=this.rf,n=1/i,o=2*n-Math.pow(n,2),s=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+e/2)),p=Math.log((1+s*t)/(1-s*t));this.K=a-this.alpha*h+this.alpha*s/2*p}function Yae(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),i=-this.alpha*(t+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*s+this.x0,e}function Xae(e){for(var t=e.x-this.x0,r=e.y-this.y0,i=t/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),s=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+s/this.alpha,h=0,p=o,g=-1e3,w=0;Math.abs(p-g)>1e-7;){if(++w>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(p))/2)),g=p,p=2*Math.atan(Math.exp(h))-Math.PI/2}return e.x=a,e.y=p,e}var Zae=[\"somerc\"],Kae={init:Hae,forward:Yae,inverse:Xae,names:Zae},eS=1e-7;function Qae(e){var t=[\"Hotine_Oblique_Mercator\",\"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\"],r=typeof e.PROJECTION==\"object\"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return\"no_uoff\"in e||\"no_off\"in e||t.indexOf(r)!==-1}function Jae(){var e,t,r,i,n,o,s,a,h,p,g=0,w,C=0,R=0,z=0,W=0,Y=0,H=0;this.no_off=Qae(this),this.no_rot=\"no_rot\"in this;var Q=!1;\"alpha\"in this&&(Q=!0);var tt=!1;if(\"rectified_grid_angle\"in this&&(tt=!0),Q&&(H=this.alpha),tt&&(g=this.rectified_grid_angle*Fl),Q||tt)C=this.longc;else if(R=this.long1,W=this.lat1,z=this.long2,Y=this.lat2,Math.abs(W-Y)<=eS||(e=Math.abs(W))<=eS||Math.abs(e-Qe)<=eS||Math.abs(Math.abs(this.lat0)-Qe)<=eS||Math.abs(Math.abs(Y)-Qe)<=eS)throw new Error;var rt=1-this.es;t=Math.sqrt(rt),Math.abs(this.lat0)>pr?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/rt),this.A=this.B*this.k0*t/e,i=this.B*t/(r*Math.sqrt(e)),n=i*i-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(vp(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=n=1),Q||tt?(Q?(w=Math.asin(Math.sin(H)/i),tt||(g=H)):(w=g,H=Math.asin(i*Math.sin(w))),this.lam0=C-Math.asin(.5*(n-1/n)*Math.tan(w))/this.B):(o=Math.pow(vp(this.e,W,Math.sin(W)),this.B),s=Math.pow(vp(this.e,Y,Math.sin(Y)),this.B),n=this.E/o,h=(s-o)/(s+o),p=this.E*this.E,p=(p-s*o)/(p+s*o),e=R-z,e<-Math.pi?z-=Q8:e>Math.pi&&(z+=Q8),this.lam0=Tr(.5*(R+z)-Math.atan(p*Math.tan(.5*this.B*(R-z))/h)/this.B),w=Math.atan(2*Math.sin(this.B*Tr(R-this.lam0))/(n-1/n)),g=H=Math.asin(i*Math.sin(w))),this.singam=Math.sin(w),this.cosgam=Math.cos(w),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(H))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*w,this.v_pole_n=this.ArB*Math.log(Math.tan(Ln-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ln+n))}function tle(e){var t={},r,i,n,o,s,a,h,p;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Qe)>pr){if(s=this.E/Math.pow(vp(this.e,e.y,Math.sin(e.y)),this.B),a=1/s,r=.5*(s-a),i=.5*(s+a),o=Math.sin(this.B*e.x),n=(r*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(n)-1)<pr)throw new Error;p=.5*this.ArB*Math.log((1-n)/(1+n)),a=Math.cos(this.B*e.x),Math.abs(a)<eS?h=this.A*e.x:h=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,a)}else p=e.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*e.y;return this.no_rot?(t.x=h,t.y=p):(h-=this.u_0,t.x=p*this.cosrot+h*this.sinrot,t.y=h*this.cosrot-p*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function ele(e){var t,r,i,n,o,s,a,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*r),n=.5*(i-1/i),o=.5*(i+1/i),s=Math.sin(this.BrA*t),a=(s*this.cosgam+n*this.singam)/o,Math.abs(Math.abs(a)-1)<pr)h.x=0,h.y=a<0?-Qe:Qe;else{if(h.y=this.E/Math.sqrt((1+a)/(1-a)),h.y=tk(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(n*this.cosgam-s*this.singam,Math.cos(this.BrA*t))}return h.x+=this.lam0,h}var rle=[\"Hotine_Oblique_Mercator\",\"Hotine Oblique Mercator\",\"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\",\"Hotine_Oblique_Mercator_Two_Point_Natural_Origin\",\"Hotine_Oblique_Mercator_Azimuth_Center\",\"Oblique_Mercator\",\"omerc\"],ile={init:Jae,forward:tle,inverse:ele,names:rle};function nle(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<pr)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),i=cm(this.e,t,r),n=vp(this.e,this.lat1,t),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=cm(this.e,o,s),h=vp(this.e,this.lat2,o),p=vp(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>pr?this.ns=Math.log(i/a)/Math.log(n/h):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(p,this.ns),this.title||(this.title=\"Lambert Conformal Conic\")}}function ole(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=pr&&(r=ik(r)*(Qe-2*pr));var i=Math.abs(Math.abs(r)-Qe),n,o;if(i>pr)n=vp(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(n,this.ns);else{if(i=r*this.ns,i<=0)return null;o=0}var s=this.ns*Tr(t-this.long0);return e.x=this.k0*(o*Math.sin(s))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(s))+this.y0,e}function sle(e){var t,r,i,n,o,s=(e.x-this.x0)/this.k0,a=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(s*s+a*a),r=1):(t=-Math.sqrt(s*s+a*a),r=-1);var h=0;if(t!==0&&(h=Math.atan2(r*s,r*a)),t!==0||this.ns>0){if(r=1/this.ns,i=Math.pow(t/(this.a*this.f0),r),n=tk(this.e,i),n===-9999)return null}else n=-Qe;return o=Tr(h/this.ns+this.long0),e.x=o,e.y=n,e}var ale=[\"Lambert Tangential Conformal Conic Projection\",\"Lambert_Conformal_Conic\",\"Lambert_Conformal_Conic_1SP\",\"Lambert_Conformal_Conic_2SP\",\"lcc\",\"Lambert Conic Conformal (1SP)\",\"Lambert Conic Conformal (2SP)\"],lle={init:nle,forward:ole,inverse:sle,names:ale};function cle(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function ule(e){var t,r,i,n,o,s,a,h=e.x,p=e.y,g=Tr(h-this.long0);return t=Math.pow((1+this.e*Math.sin(p))/(1-this.e*Math.sin(p)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(p/2+this.s45),this.alfa)/t)-this.s45),i=-g*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),o=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=a*Math.cos(s)/1,e.x=a*Math.sin(s)/1,this.czech||(e.y*=-1,e.x*=-1),e}function hle(e){var t,r,i,n,o,s,a,h,p=e.x;e.x=e.y,e.y=p,this.czech||(e.y*=-1,e.x*=-1),s=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),n=o/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(t)),e.x=this.long0-r/this.alfa,a=t,h=0;var g=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(h=1),a=e.y,g+=1;while(h===0&&g<15);return g>=15?null:e}var dle=[\"Krovak\",\"krovak\"],fle={init:cle,forward:ule,inverse:hle,names:dle};function qc(e,t,r,i,n){return e*n-t*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function nk(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function ok(e){return .375*e*(1+.25*e*(1+.46875*e))}function sk(e){return .05859375*e*e*(1+.75*e)}function ak(e){return e*e*e*(35/3072)}function hS(e,t,r){var i=t*r;return e/Math.sqrt(1-i*i)}function fS(e){return Math.abs(e)<Qe?e:e-ik(e)*Math.PI}function Qz(e,t,r,i,n){var o,s;o=e/t;for(var a=0;a<15;a++)if(s=(e-(t*o-r*Math.sin(2*o)+i*Math.sin(4*o)-n*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*i*Math.cos(4*o)-6*n*Math.cos(6*o)),o+=s,Math.abs(s)<=1e-10)return o;return NaN}function ple(){this.sphere||(this.e0=nk(this.es),this.e1=ok(this.es),this.e2=sk(this.es),this.e3=ak(this.es),this.ml0=this.a*qc(this.e0,this.e1,this.e2,this.e3,this.lat0))}function mle(e){var t,r,i=e.x,n=e.y;if(i=Tr(i-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(i)),r=this.a*(Math.atan2(Math.tan(n),Math.cos(i))-this.lat0);else{var o=Math.sin(n),s=Math.cos(n),a=hS(this.a,this.e,o),h=Math.tan(n)*Math.tan(n),p=i*Math.cos(n),g=p*p,w=this.es*s*s/(1-this.es),C=this.a*qc(this.e0,this.e1,this.e2,this.e3,n);t=a*p*(1-g*h*(1/6-(8-h+8*w)*g/120)),r=C-this.ml0+a*o/s*g*(.5+(5-h+6*w)*g/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function gle(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,i,n;if(this.sphere){var o=r+this.lat0;i=Math.asin(Math.sin(o)*Math.cos(t)),n=Math.atan2(Math.tan(t),Math.cos(o))}else{var s=this.ml0/this.a+r,a=Qz(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-Qe)<=pr)return e.x=this.long0,e.y=Qe,r<0&&(e.y*=-1),e;var h=hS(this.a,this.e,Math.sin(a)),p=h*h*h/this.a/this.a*(1-this.es),g=Math.pow(Math.tan(a),2),w=t*this.a/h,C=w*w;i=a-h*Math.tan(a)/p*w*w*(.5-(1+3*g)*w*w/24),n=w*(1-C*(g/3+(1+3*g)*g*C/15))/Math.cos(a)}return e.x=Tr(n+this.long0),e.y=fS(i),e}var Ale=[\"Cassini\",\"Cassini_Soldner\",\"cass\"],yle={init:ple,forward:mle,inverse:gle,names:Ale};function p_(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var _le=1,vle=2,ble=3,xle=4;function wle(){var e=Math.abs(this.lat0);if(Math.abs(e-Qe)<pr?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<pr?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=p_(this.e,1),this.mmf=.5/(1-this.es),this.apa=Rle(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=p_(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Tle(e){var t,r,i,n,o,s,a,h,p,g,w=e.x,C=e.y;if(w=Tr(w-this.long0),this.sphere){if(o=Math.sin(C),g=Math.cos(C),i=Math.cos(w),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+g*i:1+this.sinph0*o+this.cosph0*g*i,r<=pr)return null;r=Math.sqrt(2/r),t=r*g*Math.sin(w),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*g*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(C+this.lat0)<pr)return null;r=Ln-C*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(w),r*=i}}else{switch(a=0,h=0,p=0,i=Math.cos(w),n=Math.sin(w),o=Math.sin(C),s=p_(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=s/this.qp,h=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:p=1+this.sinb1*a+this.cosb1*h*i;break;case this.EQUIT:p=1+h*i;break;case this.N_POLE:p=Qe+C,s=this.qp-s;break;case this.S_POLE:p=C-Qe,s=this.qp+s;break}if(Math.abs(p)<pr)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:p=Math.sqrt(2/p),this.mode===this.OBLIQ?r=this.ymf*p*(this.cosb1*a-this.sinb1*h*i):r=(p=Math.sqrt(2/(1+h*i)))*a*this.ymf,t=this.xmf*p*h*n;break;case this.N_POLE:case this.S_POLE:s>=0?(t=(p=Math.sqrt(s))*n,r=i*(this.mode===this.S_POLE?p:-p)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function Sle(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,i,n,o,s,a,h,p;if(this.sphere){var g=0,w,C=0;if(w=Math.sqrt(t*t+r*r),n=w*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(C=Math.sin(n),g=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(w)<=pr?0:Math.asin(r*C/w),t*=C,r=g*w;break;case this.OBLIQ:n=Math.abs(w)<=pr?this.lat0:Math.asin(g*this.sinph0+r*C*this.cosph0/w),t*=C*this.cosph0,r=(g-Math.sin(n)*this.sinph0)*w;break;case this.N_POLE:r=-r,n=Qe-n;break;case this.S_POLE:n-=Qe;break}i=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(p=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,h=Math.sqrt(t*t+r*r),h<pr)return e.x=this.long0,e.y=this.lat0,e;s=2*Math.asin(.5*h/this.rq),o=Math.cos(s),t*=s=Math.sin(s),this.mode===this.OBLIQ?(p=o*this.sinb1+r*s*this.cosb1/h,a=this.qp*p,r=h*this.cosb1*o-r*this.sinb1*s):(p=r*s/h,a=this.qp*p,r=h*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),a=t*t+r*r,!a)return e.x=this.long0,e.y=this.lat0,e;p=1-a/this.qp,this.mode===this.S_POLE&&(p=-p)}i=Math.atan2(t,r),n=Dle(Math.asin(p),this.apa)}return e.x=Tr(this.long0+i),e.y=n,e}var Mle=.3333333333333333,Ele=.17222222222222222,Ple=.10257936507936508,Cle=.06388888888888888,Ile=.0664021164021164,kle=.016415012942191543;function Rle(e){var t,r=[];return r[0]=e*Mle,t=e*e,r[0]+=t*Ele,r[1]=t*Cle,t*=e,r[0]+=t*Ple,r[1]+=t*Ile,r[2]=t*kle,r}function Dle(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var Ole=[\"Lambert Azimuthal Equal Area\",\"Lambert_Azimuthal_Equal_Area\",\"laea\"],Lle={init:wle,forward:Tle,inverse:Sle,names:Ole,S_POLE:_le,N_POLE:vle,EQUIT:ble,OBLIQ:xle};function g_(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function Ble(){Math.abs(this.lat1+this.lat2)<pr||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=cm(this.e3,this.sin_po,this.cos_po),this.qs1=p_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=cm(this.e3,this.sin_po,this.cos_po),this.qs2=p_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=p_(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>pr?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Fle(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=p_(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,o=this.ns0*Tr(t-this.long0),s=n*Math.sin(o)+this.x0,a=this.rh-n*Math.cos(o)+this.y0;return e.x=s,e.y=a,e}function Nle(e){var t,r,i,n,o,s;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),i=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),n=0,t!==0&&(n=Math.atan2(i*e.x,i*e.y)),i=t*this.ns0/this.a,this.sphere?s=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,s=this.phi1z(this.e3,r)),o=Tr(n/this.ns0+this.long0),e.x=o,e.y=s,e}function zle(e,t){var r,i,n,o,s,a=g_(.5*t);if(e<pr)return a;for(var h=e*e,p=1;p<=25;p++)if(r=Math.sin(a),i=Math.cos(a),n=e*r,o=1-n*n,s=.5*o*o/i*(t/(1-h)-r/o+.5/e*Math.log((1-n)/(1+n))),a=a+s,Math.abs(s)<=1e-7)return a;return null}var Ule=[\"Albers_Conic_Equal_Area\",\"Albers\",\"aea\"],Vle={init:Ble,forward:Fle,inverse:Nle,names:Ule,phi1z:zle};function jle(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function $le(e){var t,r,i,n,o,s,a,h,p=e.x,g=e.y;return i=Tr(p-this.long0),t=Math.sin(g),r=Math.cos(g),n=Math.cos(i),s=this.sin_p14*t+this.cos_p14*r*n,o=1,s>0||Math.abs(s)<=pr?(a=this.x0+this.a*o*r*Math.sin(i)/s,h=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*n)/s):(a=this.x0+this.infinity_dist*r*Math.sin(i),h=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*n)),e.x=a,e.y=h,e}function Gle(e){var t,r,i,n,o,s;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(n=Math.atan2(t,this.rc),r=Math.sin(n),i=Math.cos(n),s=g_(i*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),o=Tr(this.long0+o)):(s=this.phic0,o=0),e.x=o,e.y=s,e}var Wle=[\"gnom\"],qle={init:jle,forward:$le,inverse:Gle,names:Wle};function Hle(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*Qe:Qe;for(var i=Math.asin(.5*t),n,o,s,a,h=0;h<30;h++)if(o=Math.sin(i),s=Math.cos(i),a=e*o,n=Math.pow(1-a*a,2)/(2*s)*(t/(1-e*e)-o/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),i+=n,Math.abs(n)<=1e-10)return i;return NaN}function Yle(){this.sphere||(this.k0=cm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Xle(e){var t=e.x,r=e.y,i,n,o=Tr(t-this.long0);if(this.sphere)i=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var s=p_(this.e,Math.sin(r));i=this.x0+this.a*this.k0*o,n=this.y0+this.a*s*.5/this.k0}return e.x=i,e.y=n,e}function Zle(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=Tr(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=Hle(this.e,2*e.y*this.k0/this.a),t=Tr(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e}var Kle=[\"cea\"],Qle={init:Yle,forward:Xle,inverse:Zle,names:Kle};function Jle(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||\"Equidistant Cylindrical (Plate Carre)\",this.rc=Math.cos(this.lat_ts)}function tce(e){var t=e.x,r=e.y,i=Tr(t-this.long0),n=fS(r-this.lat0);return e.x=this.x0+this.a*i*this.rc,e.y=this.y0+this.a*n,e}function ece(e){var t=e.x,r=e.y;return e.x=Tr(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=fS(this.lat0+(r-this.y0)/this.a),e}var rce=[\"Equirectangular\",\"Equidistant_Cylindrical\",\"eqc\"],ice={init:Jle,forward:tce,inverse:ece,names:rce},O5t=20;function nce(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=nk(this.es),this.e1=ok(this.es),this.e2=sk(this.es),this.e3=ak(this.es),this.ml0=this.a*qc(this.e0,this.e1,this.e2,this.e3,this.lat0)}function oce(e){var t=e.x,r=e.y,i,n,o,s=Tr(t-this.long0);if(o=s*Math.sin(r),this.sphere)Math.abs(r)<=pr?(i=this.a*s,n=-1*this.a*this.lat0):(i=this.a*Math.sin(o)/Math.tan(r),n=this.a*(fS(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=pr)i=this.a*s,n=-1*this.ml0;else{var a=hS(this.a,this.e,Math.sin(r))/Math.tan(r);i=a*Math.sin(o),n=this.a*qc(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+a*(1-Math.cos(o))}return e.x=i+this.x0,e.y=n+this.y0,e}function sce(e){var t,r,i,n,o,s,a,h,p;if(i=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=pr)t=Tr(i/this.a+this.long0),r=0;else{s=this.lat0+n/this.a,a=i*i/this.a/this.a+s*s,h=s;var g;for(o=O5t;o;--o)if(g=Math.tan(h),p=-1*(s*(h*g+1)-h-.5*(h*h+a)*g)/((h-s)/g-1),h+=p,Math.abs(p)<=pr){r=h;break}t=Tr(this.long0+Math.asin(i*Math.tan(h)/this.a)/Math.sin(r))}else if(Math.abs(n+this.ml0)<=pr)r=0,t=Tr(this.long0+i/this.a);else{s=(this.ml0+n)/this.a,a=i*i/this.a/this.a+s*s,h=s;var w,C,R,z,W;for(o=O5t;o;--o)if(W=this.e*Math.sin(h),w=Math.sqrt(1-W*W)*Math.tan(h),C=this.a*qc(this.e0,this.e1,this.e2,this.e3,h),R=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),z=C/this.a,p=(s*(w*z+1)-z-.5*w*(z*z+a))/(this.es*Math.sin(2*h)*(z*z+a-2*s*z)/(4*w)+(s-z)*(w*R-2/Math.sin(2*h))-R),h-=p,Math.abs(p)<=pr){r=h;break}w=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=Tr(this.long0+Math.asin(i*w/this.a)/Math.sin(r))}return e.x=t,e.y=r,e}var ace=[\"Polyconic\",\"poly\"],lce={init:nce,forward:oce,inverse:sce,names:ace};function cce(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function uce(e){var t,r=e.x,i=e.y,n=i-this.lat0,o=r-this.long0,s=n/W8*1e-5,a=o,h=1,p=0;for(t=1;t<=10;t++)h=h*s,p=p+this.A[t]*h;var g=p,w=a,C=1,R=0,z,W,Y=0,H=0;for(t=1;t<=6;t++)z=C*g-R*w,W=R*g+C*w,C=z,R=W,Y=Y+this.B_re[t]*C-this.B_im[t]*R,H=H+this.B_im[t]*C+this.B_re[t]*R;return e.x=H*this.a+this.x0,e.y=Y*this.a+this.y0,e}function hce(e){var t,r=e.x,i=e.y,n=r-this.x0,o=i-this.y0,s=o/this.a,a=n/this.a,h=1,p=0,g,w,C=0,R=0;for(t=1;t<=6;t++)g=h*s-p*a,w=p*s+h*a,h=g,p=w,C=C+this.C_re[t]*h-this.C_im[t]*p,R=R+this.C_im[t]*h+this.C_re[t]*p;for(var z=0;z<this.iterations;z++){var W=C,Y=R,H,Q,tt=s,rt=a;for(t=2;t<=6;t++)H=W*C-Y*R,Q=Y*C+W*R,W=H,Y=Q,tt=tt+(t-1)*(this.B_re[t]*W-this.B_im[t]*Y),rt=rt+(t-1)*(this.B_im[t]*W+this.B_re[t]*Y);W=1,Y=0;var at=this.B_re[1],et=this.B_im[1];for(t=2;t<=6;t++)H=W*C-Y*R,Q=Y*C+W*R,W=H,Y=Q,at=at+t*(this.B_re[t]*W-this.B_im[t]*Y),et=et+t*(this.B_im[t]*W+this.B_re[t]*Y);var lt=at*at+et*et;C=(tt*at+rt*et)/lt,R=(rt*at-tt*et)/lt}var J=C,ft=R,dt=1,Mt=0;for(t=1;t<=9;t++)dt=dt*J,Mt=Mt+this.D[t]*dt;var Ft=this.lat0+Mt*W8*1e5,Nt=this.long0+ft;return e.x=Nt,e.y=Ft,e}var dce=[\"New_Zealand_Map_Grid\",\"nzmg\"],fce={init:cce,forward:uce,inverse:hce,names:dce};function pce(){}function mce(e){var t=e.x,r=e.y,i=Tr(t-this.long0),n=this.x0+this.a*i,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=n,e.y=o,e}function gce(e){e.x-=this.x0,e.y-=this.y0;var t=Tr(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var Ace=[\"Miller_Cylindrical\",\"mill\"],yce={init:pce,forward:mce,inverse:gce,names:Ace},_ce=20;function vce(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=gEt(this.es)}function bce(e){var t,r,i=e.x,n=e.y;if(i=Tr(i-this.long0),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var o=this.n*Math.sin(n),s=_ce;s;--s){var a=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=a,Math.abs(a)<pr)break}t=this.a*this.C_x*i*(this.m+Math.cos(n)),r=this.a*this.C_y*n}else{var h=Math.sin(n),p=Math.cos(n);r=this.a*oU(n,h,p,this.en),t=this.a*i*p/Math.sqrt(1-this.es*h*h)}return e.x=t,e.y=r,e}function xce(e){var t,r,i,n;return e.x-=this.x0,i=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(t))),this.m?t=g_((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=g_(Math.sin(t)/this.n)),i=Tr(i+this.long0),t=fS(t)):(t=AEt(e.y/this.a,this.es,this.en),n=Math.abs(t),n<Qe?(n=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),i=Tr(r)):n-pr<Qe&&(i=this.long0)),e.x=i,e.y=t,e}var wce=[\"Sinusoidal\",\"sinu\"],Tce={init:vce,forward:bce,inverse:xce,names:wce};function Sce(){}function Mce(e){for(var t=e.x,r=e.y,i=Tr(t-this.long0),n=r,o=Math.PI*Math.sin(r);;){var s=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=s,Math.abs(s)<pr)break}n/=2,Math.PI/2-Math.abs(r)<pr&&(i=0);var a=.900316316158*this.a*i*Math.cos(n)+this.x0,h=1.4142135623731*this.a*Math.sin(n)+this.y0;return e.x=a,e.y=h,e}function Ece(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var i=Tr(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return e.x=i,e.y=n,e}var Pce=[\"Mollweide\",\"moll\"],Cce={init:Sce,forward:Mce,inverse:Ece,names:Pce};function Ice(){Math.abs(this.lat1+this.lat2)<pr||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=nk(this.es),this.e1=ok(this.es),this.e2=sk(this.es),this.e3=ak(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=cm(this.e,this.sinphi,this.cosphi),this.ml1=qc(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<pr?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=cm(this.e,this.sinphi,this.cosphi),this.ml2=qc(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=qc(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function kce(e){var t=e.x,r=e.y,i;if(this.sphere)i=this.a*(this.g-r);else{var n=qc(this.e0,this.e1,this.e2,this.e3,r);i=this.a*(this.g-n)}var o=this.ns*Tr(t-this.long0),s=this.x0+i*Math.sin(o),a=this.y0+this.rh-i*Math.cos(o);return e.x=s,e.y=a,e}function Rce(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,i,n;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=Tr(this.long0+o/this.ns),i=fS(this.g-r/this.a),e.x=n,e.y=i,e;var s=this.g-r/this.a;return i=Qz(s,this.e0,this.e1,this.e2,this.e3),n=Tr(this.long0+o/this.ns),e.x=n,e.y=i,e}var Dce=[\"Equidistant_Conic\",\"eqdc\"],Oce={init:Ice,forward:kce,inverse:Rce,names:Dce};function Lce(){this.R=this.a}function Bce(e){var t=e.x,r=e.y,i=Tr(t-this.long0),n,o;Math.abs(r)<=pr&&(n=this.x0+this.R*i,o=this.y0);var s=g_(2*Math.abs(r/Math.PI));(Math.abs(i)<=pr||Math.abs(Math.abs(r)-Qe)<=pr)&&(n=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*s):o=this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/i-i/Math.PI),h=a*a,p=Math.sin(s),g=Math.cos(s),w=g/(p+g-1),C=w*w,R=w*(2/p-1),z=R*R,W=Math.PI*this.R*(a*(w-z)+Math.sqrt(h*(w-z)*(w-z)-(z+h)*(C-z)))/(z+h);i<0&&(W=-W),n=this.x0+W;var Y=h+w;return W=Math.PI*this.R*(R*Y-a*Math.sqrt((z+h)*(h+1)-Y*Y))/(z+h),r>=0?o=this.y0+W:o=this.y0-W,e.x=n,e.y=o,e}function Fce(e){var t,r,i,n,o,s,a,h,p,g,w,C,R;return e.x-=this.x0,e.y-=this.y0,w=Math.PI*this.R,i=e.x/w,n=e.y/w,o=i*i+n*n,s=-Math.abs(n)*(1+o),a=s-2*n*n+i*i,h=-2*s+1+2*n*n+o*o,R=n*n/h+(2*a*a*a/h/h/h-9*s*a/h/h)/27,p=(s-a*a/3/h)/h,g=2*Math.sqrt(-p/3),w=3*R/p/g,Math.abs(w)>1&&(w>=0?w=1:w=-1),C=Math.acos(w)/3,e.y>=0?r=(-g*Math.cos(C+Math.PI/3)-a/3/h)*Math.PI:r=-(-g*Math.cos(C+Math.PI/3)-a/3/h)*Math.PI,Math.abs(i)<pr?t=this.long0:t=Tr(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(i*i-n*n)+o*o))/2/i),e.x=t,e.y=r,e}var Nce=[\"Van_der_Grinten_I\",\"VanDerGrinten\",\"vandg\"],zce={init:Lce,forward:Bce,inverse:Fce,names:Nce};function Uce(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Vce(e){var t=e.x,r=e.y,i=Math.sin(e.y),n=Math.cos(e.y),o=Tr(t-this.long0),s,a,h,p,g,w,C,R,z,W,Y,H,Q,tt,rt,at,et,lt,J,ft,dt,Mt,Ft;return this.sphere?Math.abs(this.sin_p12-1)<=pr?(e.x=this.x0+this.a*(Qe-r)*Math.sin(o),e.y=this.y0-this.a*(Qe-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=pr?(e.x=this.x0+this.a*(Qe+r)*Math.sin(o),e.y=this.y0+this.a*(Qe+r)*Math.cos(o),e):(lt=this.sin_p12*i+this.cos_p12*n*Math.cos(o),at=Math.acos(lt),et=at?at/Math.sin(at):1,e.x=this.x0+this.a*et*n*Math.sin(o),e.y=this.y0+this.a*et*(this.cos_p12*i-this.sin_p12*n*Math.cos(o)),e):(s=nk(this.es),a=ok(this.es),h=sk(this.es),p=ak(this.es),Math.abs(this.sin_p12-1)<=pr?(g=this.a*qc(s,a,h,p,Qe),w=this.a*qc(s,a,h,p,r),e.x=this.x0+(g-w)*Math.sin(o),e.y=this.y0-(g-w)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=pr?(g=this.a*qc(s,a,h,p,Qe),w=this.a*qc(s,a,h,p,r),e.x=this.x0+(g+w)*Math.sin(o),e.y=this.y0+(g+w)*Math.cos(o),e):(C=i/n,R=hS(this.a,this.e,this.sin_p12),z=hS(this.a,this.e,i),W=Math.atan((1-this.es)*C+this.es*R*this.sin_p12/(z*n)),Y=Math.atan2(Math.sin(o),this.cos_p12*Math.tan(W)-this.sin_p12*Math.cos(o)),Y===0?J=Math.asin(this.cos_p12*Math.sin(W)-this.sin_p12*Math.cos(W)):Math.abs(Math.abs(Y)-Math.PI)<=pr?J=-Math.asin(this.cos_p12*Math.sin(W)-this.sin_p12*Math.cos(W)):J=Math.asin(Math.sin(o)*Math.cos(W)/Math.sin(Y)),H=this.e*this.sin_p12/Math.sqrt(1-this.es),Q=this.e*this.cos_p12*Math.cos(Y)/Math.sqrt(1-this.es),tt=H*Q,rt=Q*Q,ft=J*J,dt=ft*J,Mt=dt*J,Ft=Mt*J,at=R*J*(1-ft*rt*(1-rt)/6+dt/8*tt*(1-2*rt)+Mt/120*(rt*(4-7*rt)-3*H*H*(1-7*rt))-Ft/48*tt),e.x=this.x0+at*Math.sin(Y),e.y=this.y0+at*Math.cos(Y),e))}function jce(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,n,o,s,a,h,p,g,w,C,R,z,W,Y,H,Q,tt,rt,at,et,lt,J;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*Qe*this.a?void 0:(r=t/this.a,i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(t)<=pr?s=this.lat0:(s=g_(n*this.sin_p12+e.y*i*this.cos_p12/t),a=Math.abs(this.lat0)-Qe,Math.abs(a)<=pr?this.lat0>=0?o=Tr(this.long0+Math.atan2(e.x,-e.y)):o=Tr(this.long0-Math.atan2(-e.x,e.y)):o=Tr(this.long0+Math.atan2(e.x*i,t*this.cos_p12*n-e.y*this.sin_p12*i))),e.x=o,e.y=s,e)):(h=nk(this.es),p=ok(this.es),g=sk(this.es),w=ak(this.es),Math.abs(this.sin_p12-1)<=pr?(C=this.a*qc(h,p,g,w,Qe),t=Math.sqrt(e.x*e.x+e.y*e.y),R=C-t,s=Qz(R/this.a,h,p,g,w),o=Tr(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=s,e):Math.abs(this.sin_p12+1)<=pr?(C=this.a*qc(h,p,g,w,Qe),t=Math.sqrt(e.x*e.x+e.y*e.y),R=t-C,s=Qz(R/this.a,h,p,g,w),o=Tr(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=s,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),Y=Math.atan2(e.x,e.y),z=hS(this.a,this.e,this.sin_p12),H=Math.cos(Y),Q=this.e*this.cos_p12*H,tt=-Q*Q/(1-this.es),rt=3*this.es*(1-tt)*this.sin_p12*this.cos_p12*H/(1-this.es),at=t/z,et=at-tt*(1+tt)*Math.pow(at,3)/6-rt*(1+3*tt)*Math.pow(at,4)/24,lt=1-tt*et*et/2-at*et*et*et/6,W=Math.asin(this.sin_p12*Math.cos(et)+this.cos_p12*Math.sin(et)*H),o=Tr(this.long0+Math.asin(Math.sin(Y)*Math.sin(et)/Math.cos(W))),J=Math.sin(W),s=Math.atan2((J-this.es*lt*this.sin_p12)*Math.tan(W),J*(1-this.es)),e.x=o,e.y=s,e))}var $ce=[\"Azimuthal_Equidistant\",\"aeqd\"],Gce={init:Uce,forward:Vce,inverse:jce,names:$ce};function Wce(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function qce(e){var t,r,i,n,o,s,a,h,p=e.x,g=e.y;return i=Tr(p-this.long0),t=Math.sin(g),r=Math.cos(g),n=Math.cos(i),s=this.sin_p14*t+this.cos_p14*r*n,o=1,(s>0||Math.abs(s)<=pr)&&(a=this.a*o*r*Math.sin(i),h=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*n)),e.x=a,e.y=h,e}function Hce(e){var t,r,i,n,o,s,a;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=g_(t/this.a),i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(t)<=pr?(a=this.lat0,e.x=s,e.y=a,e):(a=g_(n*this.sin_p14+e.y*i*this.cos_p14/t),o=Math.abs(this.lat0)-Qe,Math.abs(o)<=pr?(this.lat0>=0?s=Tr(this.long0+Math.atan2(e.x,-e.y)):s=Tr(this.long0-Math.atan2(-e.x,e.y)),e.x=s,e.y=a,e):(s=Tr(this.long0+Math.atan2(e.x*i,t*this.cos_p14*n-e.y*this.sin_p14*i)),e.x=s,e.y=a,e))}var Yce=[\"ortho\"],Xce={init:Wce,forward:qce,inverse:Hce,names:Yce},ls={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Bn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Zce(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||\"Quadrilateralized Spherical Cube\",this.lat0>=Qe-Ln/2?this.face=ls.TOP:this.lat0<=-(Qe-Ln/2)?this.face=ls.BOTTOM:Math.abs(this.long0)<=Ln?this.face=ls.FRONT:Math.abs(this.long0)<=Qe+Ln?this.face=this.long0>0?ls.RIGHT:ls.LEFT:this.face=ls.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Kce(e){var t={x:0,y:0},r,i,n,o,s,a,h={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,i=e.x,this.face===ls.TOP)o=Qe-r,i>=Ln&&i<=Qe+Ln?(h.value=Bn.AREA_0,n=i-Qe):i>Qe+Ln||i<=-(Qe+Ln)?(h.value=Bn.AREA_1,n=i>0?i-Js:i+Js):i>-(Qe+Ln)&&i<=-Ln?(h.value=Bn.AREA_2,n=i+Qe):(h.value=Bn.AREA_3,n=i);else if(this.face===ls.BOTTOM)o=Qe+r,i>=Ln&&i<=Qe+Ln?(h.value=Bn.AREA_0,n=-i+Qe):i<Ln&&i>=-Ln?(h.value=Bn.AREA_1,n=-i):i<-Ln&&i>=-(Qe+Ln)?(h.value=Bn.AREA_2,n=-i-Qe):(h.value=Bn.AREA_3,n=i>0?-i+Js:-i-Js);else{var p,g,w,C,R,z,W;this.face===ls.RIGHT?i=lS(i,+Qe):this.face===ls.BACK?i=lS(i,+Js):this.face===ls.LEFT&&(i=lS(i,-Qe)),C=Math.sin(r),R=Math.cos(r),z=Math.sin(i),W=Math.cos(i),p=R*W,g=R*z,w=C,this.face===ls.FRONT?(o=Math.acos(p),n=Vz(o,w,g,h)):this.face===ls.RIGHT?(o=Math.acos(g),n=Vz(o,w,-p,h)):this.face===ls.BACK?(o=Math.acos(-p),n=Vz(o,w,-g,h)):this.face===ls.LEFT?(o=Math.acos(-g),n=Vz(o,w,p,h)):(o=n=0,h.value=Bn.AREA_0)}return a=Math.atan(12/Js*(n+Math.acos(Math.sin(n)*Math.cos(Ln))-Qe)),s=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),h.value===Bn.AREA_1?a+=Qe:h.value===Bn.AREA_2?a+=Js:h.value===Bn.AREA_3&&(a+=1.5*Js),t.x=s*Math.cos(a),t.y=s*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Qce(e){var t={lam:0,phi:0},r,i,n,o,s,a,h,p,g,w={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?w.value=Bn.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(w.value=Bn.AREA_1,r-=Qe):e.x<0&&-e.x>=Math.abs(e.y)?(w.value=Bn.AREA_2,r=r<0?r+Js:r-Js):(w.value=Bn.AREA_3,r+=Qe),g=Js/12*Math.tan(r),s=Math.sin(g)/(Math.cos(g)-1/Math.sqrt(2)),a=Math.atan(s),n=Math.cos(r),o=Math.tan(i),h=1-n*n*o*o*(1-Math.cos(Math.atan(1/Math.cos(a)))),h<-1?h=-1:h>1&&(h=1),this.face===ls.TOP)p=Math.acos(h),t.phi=Qe-p,w.value===Bn.AREA_0?t.lam=a+Qe:w.value===Bn.AREA_1?t.lam=a<0?a+Js:a-Js:w.value===Bn.AREA_2?t.lam=a-Qe:t.lam=a;else if(this.face===ls.BOTTOM)p=Math.acos(h),t.phi=p-Qe,w.value===Bn.AREA_0?t.lam=-a+Qe:w.value===Bn.AREA_1?t.lam=-a:w.value===Bn.AREA_2?t.lam=-a-Qe:t.lam=a<0?-a-Js:-a+Js;else{var C,R,z;C=h,g=C*C,g>=1?z=0:z=Math.sqrt(1-g)*Math.sin(a),g+=z*z,g>=1?R=0:R=Math.sqrt(1-g),w.value===Bn.AREA_1?(g=R,R=-z,z=g):w.value===Bn.AREA_2?(R=-R,z=-z):w.value===Bn.AREA_3&&(g=R,R=z,z=-g),this.face===ls.RIGHT?(g=C,C=-R,R=g):this.face===ls.BACK?(C=-C,R=-R):this.face===ls.LEFT&&(g=C,C=R,R=-g),t.phi=Math.acos(-z)-Qe,t.lam=Math.atan2(R,C),this.face===ls.RIGHT?t.lam=lS(t.lam,-Qe):this.face===ls.BACK?t.lam=lS(t.lam,-Js):this.face===ls.LEFT&&(t.lam=lS(t.lam,+Qe))}if(this.es!==0){var W,Y,H;W=t.phi<0?1:0,Y=Math.tan(t.phi),H=this.b/Math.sqrt(Y*Y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-H*H)/(this.one_minus_f*H)),W&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function Vz(e,t,r,i){var n;return e<pr?(i.value=Bn.AREA_0,n=0):(n=Math.atan2(t,r),Math.abs(n)<=Ln?i.value=Bn.AREA_0:n>Ln&&n<=Qe+Ln?(i.value=Bn.AREA_1,n-=Qe):n>Qe+Ln||n<=-(Qe+Ln)?(i.value=Bn.AREA_2,n=n>=0?n-Js:n+Js):(i.value=Bn.AREA_3,n+=Qe)),n}function lS(e,t){var r=e+t;return r<-Js?r+=Q8:r>+Js&&(r-=Q8),r}var Jce=[\"Quadrilateralized Spherical Cube\",\"Quadrilateralized_Spherical_Cube\",\"qsc\"],tue={init:Zce,forward:Kce,inverse:Qce,names:Jce},Jet=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],G8=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],vEt=.8487,bEt=1.3523,xEt=am/5,eue=1/xEt,sS=18,Jz=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},rue=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function iue(e,t,r,i){for(var n=t;i;--i){var o=e(n);if(n-=o,Math.abs(o)<r)break}return n}function nue(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||\"Robinson\"}function oue(e){var t=Tr(e.x-this.long0),r=Math.abs(e.y),i=Math.floor(r*xEt);i<0?i=0:i>=sS&&(i=sS-1),r=am*(r-eue*i);var n={x:Jz(Jet[i],r)*t,y:Jz(G8[i],r)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*vEt+this.x0,n.y=n.y*this.a*bEt+this.y0,n}function sue(e){var t={x:(e.x-this.x0)/(this.a*vEt),y:Math.abs(e.y-this.y0)/(this.a*bEt)};if(t.y>=1)t.x/=Jet[sS][0],t.y=e.y<0?-Qe:Qe;else{var r=Math.floor(t.y*sS);for(r<0?r=0:r>=sS&&(r=sS-1);;)if(G8[r][0]>t.y)--r;else if(G8[r+1][0]<=t.y)++r;else break;var i=G8[r],n=5*(t.y-i[0])/(G8[r+1][0]-i[0]);n=iue(function(o){return(Jz(i,o)-t.y)/rue(i,o)},n,pr,100),t.x/=Jz(Jet[r],n),t.y=(5*r+n)*Fl,e.y<0&&(t.y=-t.y)}return t.x=Tr(t.x+this.long0),t}var aue=[\"Robinson\",\"robin\"],lue={init:nue,forward:oue,inverse:sue,names:aue};function cue(){this.name=\"geocent\"}function uue(e){var t=aEt(e,this.es,this.a);return t}function hue(e){var t=lEt(e,this.es,this.a,this.b);return t}var due=[\"Geocentric\",\"geocentric\",\"geocent\",\"Geocent\"],fue={init:cue,forward:uue,inverse:hue,names:due},dc={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},U8={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function pue(){if(Object.keys(U8).forEach(function(r){if(typeof this[r]>\"u\")this[r]=U8[r].def;else{if(U8[r].num&&isNaN(this[r]))throw new Error(\"Invalid parameter value, must be numeric \"+r+\" = \"+this[r]);U8[r].num&&(this[r]=parseFloat(this[r]))}U8[r].degrees&&(this[r]=this[r]*Fl)}.bind(this)),Math.abs(Math.abs(this.lat0)-Qe)<pr?this.mode=this.lat0<0?dc.S_POLE:dc.N_POLE:Math.abs(this.lat0)<pr?this.mode=dc.EQUIT:(this.mode=dc.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error(\"Invalid height\");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function mue(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),i=Math.cos(e.x),n,o;switch(this.mode){case dc.OBLIQ:o=this.sinph0*t+this.cosph0*r*i;break;case dc.EQUIT:o=r*i;break;case dc.S_POLE:o=-t;break;case dc.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),n=o*r*Math.sin(e.x),this.mode){case dc.OBLIQ:o*=this.cosph0*t-this.sinph0*r*i;break;case dc.EQUIT:o*=t;break;case dc.N_POLE:o*=-(r*i);break;case dc.S_POLE:o*=r*i;break}var s,a;return s=o*this.cg+n*this.sg,a=1/(s*this.sw*this.h1+this.cw),n=(n*this.cg-o*this.sg)*this.cw*a,o=s*a,e.x=n*this.a,e.y=o*this.a,e}function gue(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,i,n;n=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*n,i=this.pn1*e.y*this.cw*n,e.x=r*this.cg+i*this.sg,e.y=i*this.cg-r*this.sg;var o=ef(e.x,e.y);if(Math.abs(o)<pr)t.x=0,t.y=e.y;else{var s,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),s=Math.sqrt(1-a*a),this.mode){case dc.OBLIQ:t.y=Math.asin(s*this.sinph0+e.y*a*this.cosph0/o),e.y=(s-this.sinph0*Math.sin(t.y))*o,e.x*=a*this.cosph0;break;case dc.EQUIT:t.y=Math.asin(e.y*a/o),e.y=s*o,e.x*=a;break;case dc.N_POLE:t.y=Math.asin(s),e.y=-e.y;break;case dc.S_POLE:t.y=-Math.asin(s);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var Aue=[\"Tilted_Perspective\",\"tpers\"],yue={init:pue,forward:mue,inverse:gue,names:Aue};function _ue(){if(this.flip_axis=this.sweep===\"x\"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=\"ellipse\"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=\"sphere\";this.title||(this.title=\"Geostationary Satellite View\")}function vue(e){var t=e.x,r=e.y,i,n,o,s;if(t=t-this.long0,this.shape===\"ellipse\"){r=Math.atan(this.radius_p2*Math.tan(r));var a=this.radius_p/ef(this.radius_p*Math.cos(r),Math.sin(r));if(n=a*Math.cos(t)*Math.cos(r),o=a*Math.sin(t)*Math.cos(r),s=a*Math.sin(r),(this.radius_g-n)*n-o*o-s*s*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/ef(s,i)),e.y=this.radius_g_1*Math.atan(s/i)):(e.x=this.radius_g_1*Math.atan(o/i),e.y=this.radius_g_1*Math.atan(s/ef(o,i)))}else this.shape===\"sphere\"&&(i=Math.cos(r),n=Math.cos(t)*i,o=Math.sin(t)*i,s=Math.sin(r),i=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/ef(s,i)),e.y=this.radius_g_1*Math.atan(s/i)):(e.x=this.radius_g_1*Math.atan(o/i),e.y=this.radius_g_1*Math.atan(s/ef(o,i))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function bue(e){var t=-1,r=0,i=0,n,o,s,a;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape===\"ellipse\"){this.flip_axis?(i=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*ef(1,i)):(r=Math.tan(e.x/this.radius_g_1),i=Math.tan(e.y/this.radius_g_1)*ef(1,r));var h=i/this.radius_p;if(n=r*r+h*h+t*t,o=2*this.radius_g*t,s=o*o-4*n*this.C,s<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-o-Math.sqrt(s))/(2*n),t=this.radius_g+a*t,r*=a,i*=a,e.x=Math.atan2(r,t),e.y=Math.atan(i*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===\"sphere\"){if(this.flip_axis?(i=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+i*i)):(r=Math.tan(e.x/this.radius_g_1),i=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),n=r*r+i*i+t*t,o=2*this.radius_g*t,s=o*o-4*n*this.C,s<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-o-Math.sqrt(s))/(2*n),t=this.radius_g+a*t,r*=a,i*=a,e.x=Math.atan2(r,t),e.y=Math.atan(i*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var xue=[\"Geostationary Satellite View\",\"Geostationary_Satellite\",\"geos\"],wue={init:_ue,forward:vue,inverse:bue,names:xue};function Tue(e){e.Proj.projections.add(Gz),e.Proj.projections.add(Wz),e.Proj.projections.add(Iae),e.Proj.projections.add(Uae),e.Proj.projections.add(qae),e.Proj.projections.add(Kae),e.Proj.projections.add(ile),e.Proj.projections.add(lle),e.Proj.projections.add(fle),e.Proj.projections.add(yle),e.Proj.projections.add(Lle),e.Proj.projections.add(Vle),e.Proj.projections.add(qle),e.Proj.projections.add(Qle),e.Proj.projections.add(ice),e.Proj.projections.add(lce),e.Proj.projections.add(fce),e.Proj.projections.add(yce),e.Proj.projections.add(Tce),e.Proj.projections.add(Cce),e.Proj.projections.add(Oce),e.Proj.projections.add(zce),e.Proj.projections.add(Gce),e.Proj.projections.add(Xce),e.Proj.projections.add(tue),e.Proj.projections.add(lue),e.Proj.projections.add(fue),e.Proj.projections.add(yue),e.Proj.projections.add(wue)}Nh.defaultDatum=\"WGS84\";Nh.Proj=lm;Nh.WGS84=new Nh.Proj(\"WGS84\");Nh.Point=uS;Nh.toPoint=cEt;Nh.defs=Wc;Nh.nadgrid=Rse;Nh.transform=Kz;Nh.mgrs=Yse;Nh.version=\"__VERSION__\";Tue(Nh);function Sue(e,t,r){let i=Nh(t,r);return\"data\"in e?new Er(e.data.map(n=>L5t(n,i))):L5t(e,i)}function L5t(e,t){let r=[0,0];return Q5t(e,(n,o)=>(r[0]=n,r[1]=o,t.forward(r)))}var f_;(function(e){e.POINT=\"geoarrow.point\",e.LINESTRING=\"geoarrow.linestring\",e.POLYGON=\"geoarrow.polygon\",e.MULTIPOINT=\"geoarrow.multipoint\",e.MULTILINESTRING=\"geoarrow.multilinestring\",e.MULTIPOLYGON=\"geoarrow.multipolygon\"})(f_||(f_={}));var tU=class{minX;minY;maxX;maxY;constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}updateBbox(t){t.minX<this.minX&&(this.minX=t.minX),t.minY<this.minY&&(this.minY=t.minY),t.maxX>this.maxX&&(this.maxX=t.maxX),t.maxY>this.maxY&&(this.maxY=t.maxY)}updateCoord(t,r){t<this.minX&&(this.minX=t),r<this.minY&&(this.minY=r),t>this.maxX&&(this.maxX=t),r>this.maxY&&(this.maxY=r)}};function Mue(e,t){switch(t.metadata.get(\"ARROW:extension:name\")){case f_.POINT:return wEt(e);case f_.LINESTRING:case f_.MULTIPOINT:return TEt(e);case f_.POLYGON:case f_.MULTILINESTRING:return SEt(e);case f_.MULTIPOLYGON:return Pue(e);default:throw new Error(\"Unknown ext type name\")}}function Eue(e){let r=ek(e).values,i=new tU;for(let n=0;n<e.length;n++){let o=r[n*2],s=r[n*2+1];i.updateCoord(o,s)}return i}function wEt(e){let t=new tU;for(let r of e.data)t.updateBbox(Eue(r));return t}function TEt(e){let t=rk(e);return wEt(t)}function SEt(e){let t=dS(e);return TEt(t)}function Pue(e){let t=rU(e);return SEt(t)}var trt;(function(e){e[e.CLOCKWISE=m5t.CLOCKWISE]=\"CLOCKWISE\",e[e.COUNTER_CLOCKWISE=m5t.COUNTER_CLOCKWISE]=\"COUNTER_CLOCKWISE\"})(trt||(trt={}));function MEt(e){if(\"data\"in e)return new Er(e.data.map(r=>MEt(r)));let t=new a_({type:new Pu,nullValues:[null]});t.set(e.length-1,null);for(let r=0;r<e.length;r++){if(!e.getValid(r)){t.setValid(r,!1);continue}let n=iU(e,r).getWindingDirection();t.set(r,n===trt.CLOCKWISE)}return t.finish().flush()}function EEt(e,t){if(\"data\"in e){e.data.forEach(r=>EEt(r,t));return}for(let r=0;r<e.length;r++)iU(e,r).modifyWindingDirection(t)}var crt=Object.freeze({__proto__:null,area:U5t,earcut:j5t,getMultiPolygonExterior:G5t,getPolygonExterior:$5t,mapCoords:Q5t,modifyWindingDirection:EEt,reproject:Sue,signedArea:V5t,totalBounds:Mue,windingDirection:MEt});function q8(e,t=!1){if(\"data\"in e)return new Er(e.data.map(o=>q8(o,t)));let r=[];for(let o of e.children)r.push(q8(o,t));let i;e.dictionary!==void 0&&(i=q8(e.dictionary,t));let n={[Hi.OFFSET]:jz(e.buffers[Hi.OFFSET],t),[Hi.DATA]:jz(e.buffers[Hi.DATA],t),[Hi.VALIDITY]:jz(e.buffers[Hi.VALIDITY],t),[Hi.TYPE]:jz(e.buffers[Hi.TYPE],t)};return new Fi(e.type,e.offset,e.length,e._nullCount,n,r,i)}function qz(e){if(\"data\"in e)return e.data.some(r=>qz(r));for(let r of e.children)if(qz(r))return!0;if(e.dictionary!==void 0&&qz(e.dictionary))return!0;let t=[Hi.OFFSET,Hi.DATA,Hi.VALIDITY,Hi.TYPE];for(let r of t)if(e.buffers[r]!==void 0&&PEt(e.buffers[r]))return!0;return!1}function PEt(e){return!(e.byteOffset===0&&e.byteLength===e.buffer.byteLength)}function jz(e,t){return e===void 0||!t&&!PEt(e)?e:e.slice()}function Hz(e,t=!1){if(\"data\"in e){let i=[],n=[];for(let s of e.data){let[a,h]=Hz(s);i.push(a),n.push(...h)}return[new Er(i),n]}e=q8(e,t);let r=[];for(let i=0;i<e.children.length;i++){let n=e.children[i],[o,s]=Hz(n);e.children[i]=o,r.push(...s)}if(e.dictionary!==void 0){let[i,n]=Hz(e.dictionary);e.dictionary=i,r.push(...n)}return e.buffers[Hi.OFFSET]!==void 0&&r.push(e.buffers[Hi.OFFSET].buffer),e.buffers[Hi.DATA]!==void 0&&r.push(e.buffers[Hi.DATA].buffer),e.buffers[Hi.VALIDITY]!==void 0&&r.push(e.buffers[Hi.VALIDITY].buffer),e.buffers[Hi.TYPE]!==void 0&&r.push(e.buffers[Hi.TYPE].buffer),[e,r]}function CEt(e){switch(e.typeId){case Qt.Null:return new sl;case Qt.Int:return new Ms(e.isSigned,e.bitWidth);case Qt.Float:return new al(e.precision);case Qt.Binary:return new jd;case Qt.Utf8:return new $d;case Qt.Bool:return new Pu;case Qt.Decimal:return new Gd(e.scale,e.precision,e.bitWidth);case Qt.Date:return new Wd(e.unit);case Qt.Time:return new qd(e.unit,e.bitWidth);case Qt.Timestamp:return new Hd(e.unit,e.timezone);case Qt.Interval:return new Yd(e.unit);case Qt.List:{let t=e.children.map(V8);if(t.length>1)throw new Error(\"expected 1 field\");return new Oa(t[0])}case Qt.Struct:{let t=e.children.map(V8);return new jn(t)}case Qt.Union:{let t=e.children.map(V8);return new Cu(e.mode,e.typeIds,t)}case Qt.FixedSizeBinary:return new Zd(e.byteWidth);case Qt.FixedSizeList:{let t=e.children.map(V8);if(t.length>1)throw new Error(\"expected 1 field\");return new lc(e.listSize,t[0])}case Qt.Map:{let t=e.children.map(V8);if(t.length>1)throw new Error(\"expected 1 field\");let r=t[0];return new Iu(r,e.keysSorted)}case Qt.Duration:return new Xd(e.unit);default:throw new Error(`unknown type ${e}`)}}function V8(e){let t=CEt(e.type);return new mi(e.name,t,e.nullable,e.metadata)}function urt(e){let t=e.children.map(n=>urt(n)),r=e.dictionary?IEt(e.dictionary):void 0,i={[Hi.OFFSET]:e.valueOffsets,[Hi.DATA]:e.values,[Hi.VALIDITY]:e.nullBitmap,[Hi.TYPE]:e.typeIds};return new Fi(CEt(e.type),e.offset,e.length,e._nullCount,i,t,r)}function IEt(e){return new Er(e.data.map(t=>urt(t)))}var hrt=Object.freeze({__proto__:null,hardClone:q8,isShared:qz,preparePostMessage:Hz,rehydrateData:urt,rehydrateVector:IEt});function Cue(e,t,r){let i=e.fields.findIndex(n=>n.name===r||n.metadata.get(\"ARROW:extension:name\")===t);return i!==-1?i:null}function Iue(e){return tr.isFixedSizeList(e.type)}function kue(e){return tr.isStruct(e.type)}function go(e){if(tr.isList(e.type))return go(e.children[0]);if(tr.isStruct(e.type))return!0;if(tr.isFixedSizeList(e.type))return!1;throw new Error(`Unsupported geometry data type: ${e.type}`)}function Hc(e){if(Iue(e))return e;if(kue(e)){let t=e.children.length,r=new Float64Array(e.length*t);for(let a=0;a<e.length;a++)for(let h=0;h<t;h++)r[a*t+h]=e.children[h].values[a];let i=new cx,n=new lc(t,new mi(\"coords\",i)),o=Pr({type:i,length:r.length,data:r});return Pr({type:n,length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:o})}throw new Error(`Unsupported coordinate data type: ${e.type}`)}function pS(e){let t=Si.getLineStringChild(e),r=Hc(t);return Pr({type:new Oa(new mi(\"element\",r.type)),length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,valueOffsets:e.valueOffsets,offset:e.offset,child:r})}function Nx(e){let t=Si.getPolygonChild(e),r=pS(t);return Pr({type:new Oa(new mi(\"element\",r.type)),length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,valueOffsets:e.valueOffsets,offset:e.offset,child:r})}function Rue(e,t){let{index:r,data:i}=e,n=r;i.invertedGeomOffsets!==void 0&&(n=i.invertedGeomOffsets[r]);let o={data:i.data,length:i.length,attributes:i.attributes},s={index:n,data:o,target:e.target};return t(s)}function $n(e){let{props:t,propName:r,propInput:i,geomCoordOffsets:n}=e;if(i!==void 0)if(t.data.attributes=t.data.attributes||{},i instanceof Fi){let o=i;if(tr.isFixedSizeList(o)){_r(o.children.length===1);let s=o.children[0].values;n&&(s=sU(s,o.type.listSize,n)),t.data.attributes[r]={value:s,size:o.type.listSize,normalized:!0}}else if(tr.isFloat(o)){let s=o.values;n&&(s=sU(s,1,n)),t.data.attributes[r]={value:s,size:1}}}else typeof i==\"function\"?t[r]=(o,s)=>r===\"getPolygonOffset\"?i(o,s):Rue(s,i):t[r]=i}function sU(e,t,r){let i=r[r.length-1],n=new e.constructor(i*t);for(let o=0;o<r.length-1;o++){let s=r[o],a=r[o+1];for(let h=s;h<a;h++)for(let p=0;p<t;p++)n[h*t+p]=e[o*t+p]}return n}function qo(e,t){let r=Cue(e.schema,t);if(r===null)return null;let i=e.getChildAt(r);return _r(i?.data.length===1),i.data[0]}function kEt(e){let t=e.valueOffsets,i=Si.getMultiLineStringChild(e).valueOffsets,n=new Int32Array(t.length);for(let o=0;o<n.length;++o)n[o]=i[t[o]];return n}function drt(e){let t=e.valueOffsets,i=Si.getPolygonChild(e).valueOffsets,n=new Int32Array(t.length);for(let o=0;o<n.length;++o)n[o]=i[t[o]];return n}function REt(e){let t=Si.getMultiPolygonChild(e),r=Si.getPolygonChild(t),i=e.valueOffsets,n=t.valueOffsets,o=r.valueOffsets,s=new Int32Array(i.length);for(let a=0;a<s.length;++a)s[a]=o[n[i[a]]];return s}function mS(e){let t=e[e.length-1],r=e.length<Math.pow(2,8)?Uint8Array:e.length<Math.pow(2,16)?Uint16Array:Uint32Array,i=new r(t);for(let n=0;n<e.length-1;n++){let o=e[n],s=e[n+1];for(let a=o;a<s;a++)i[a]=n}return i}function Gn(e,t){let r={},i={};for(let[n,o]of Object.entries(e))t.includes(n)||(n.startsWith(\"get\")?r[n]=o:i[n]=o);return[r,i]}function Is({info:e,sourceLayer:t},r){let i=e.index;t.props.data.invertedGeomOffsets&&(i=t.props.data.invertedGeomOffsets[i]);let n=r.get(i);return n===null?e:{...e,index:i,object:n}}function Wn(e,t){let r=[],i=[];for(let[n,o]of Object.entries(e))n.startsWith(\"get\")&&o instanceof Fi&&(r.push(o),n.endsWith(\"Color\")&&i.push(o));Due(t,r);for(let n of i)Oue(n)}function Due(e,t){for(let r of t)_r(e.numRows===r.length)}function Oue(e){_r(tr.isFixedSizeList(e.type)),_r(e.type.listSize===3||e.type.listSize===4),_r(tr.isInt(e.type.children[0])),_r(e.type.children[0].type.bitWidth===8)}var{data:TAr,getPentagon:SAr,...Lue}=wz.defaultProps,DEt={_validate:!0},Bue={...Lue,...DEt},lk=class extends bi{static defaultProps=Bue;static layerName=\"GeoArrowA5Layer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){return this._renderLayer()}_renderLayer(){let{data:t,getPentagon:r}=this.props;this.props._validate&&Wn(this.props,t);let[i,n]=Gn(this.props,[\"getPentagon\"]),o=new Er([r]),s={...DEt,...n,id:`${this.props.id}-geoarrow-a5`,data:{data:t,length:t.numRows},getPentagon:(a,h)=>o.get(h.index)};for(let[a,h]of Object.entries(i))$n({props:s,propName:a,propInput:h});return new wz(this.getSubLayerProps(s))}};var{data:DAr,getSourcePosition:OAr,getTargetPosition:LAr,...Fue}=u9.defaultProps,OEt={_validate:!0},Nue={...Fue,...OEt},ck=class extends bi{static defaultProps=Nue;static layerName=\"GeoArrowArcLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){return this._renderLayersPoint()}_renderLayersPoint(){let{data:t}=this.props,{getSourcePosition:r,getTargetPosition:i}=this.props;this.props._validate&&(Wn(this.props,t),_r(zr.isPointData(r)),_r(zr.isPointData(i)));let[n,o]=Gn(this.props,[\"getSourcePosition\",\"getTargetPosition\"]);go(r)&&(r=Hc(r));let s=Si.getPointChild(r).values;go(i)&&(i=Hc(i));let a=Si.getPointChild(i).values,h={...OEt,...o,id:`${this.props.id}-geoarrow-arc`,data:{data:t,length:r.length,attributes:{getSourcePosition:{value:s,size:r.type.listSize},getTargetPosition:{value:a,size:i.type.listSize}}}};for(let[p,g]of Object.entries(n))$n({props:h,propName:p,propInput:g});return new u9(this.getSubLayerProps(h))}};var Co;(function(e){e.POINT=\"geoarrow.point\",e.LINESTRING=\"geoarrow.linestring\",e.POLYGON=\"geoarrow.polygon\",e.MULTIPOINT=\"geoarrow.multipoint\",e.MULTILINESTRING=\"geoarrow.multilinestring\",e.MULTIPOLYGON=\"geoarrow.multipolygon\"})(Co||(Co={}));var{data:GAr,getPosition:WAr,...zue}=q3.defaultProps,LEt={_validate:!0},Uue={...zue,...LEt},uk=class extends bi{static defaultProps=Uue;static layerName=\"GeoArrowColumnLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{data:t}=this.props,r=qo(t,Co.POINT);if(r!==null&&zr.isPointData(r))return this._renderPointLayer(r);let i=this.props.getPosition;if(i!==void 0&&zr.isPointData(i))return this._renderPointLayer(i);throw new Error(\"getPosition not GeoArrow point\")}_renderPointLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isPointData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPosition\"]);go(t)&&(t=Hc(t));let s=Si.getPointChild(t).values,a={...LEt,...n,id:`${this.props.id}-geoarrow-column`,data:{data:r,length:t.length,attributes:{getPosition:{value:s,size:t.type.listSize}}}};for(let[h,p]of Object.entries(i))$n({props:a,propName:h,propInput:p});return new q3(this.getSubLayerProps(a))}};var{data:QAr,getGeohash:JAr,...Vue}=Bz.defaultProps,BEt={_validate:!0},jue={...Vue,...BEt},hk=class extends bi{static defaultProps=jue;static layerName=\"GeoArrowGeohashLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){return this._renderLayer()}_renderLayer(){let{data:t,getGeohash:r}=this.props;this.props._validate&&Wn(this.props,t);let[i,n]=Gn(this.props,[\"getGeohash\"]),o=new Er([r]),s={...BEt,...n,id:`${this.props.id}-geoarrow-geohash`,data:{data:t,length:t.numRows},getGeohash:(a,h)=>o.get(h.index)};for(let[a,h]of Object.entries(i))$n({props:s,propName:a,propInput:h});return new Bz(this.getSubLayerProps(s))}};var{data:syr,getHexagon:ayr,...$ue}=Oz.defaultProps,FEt={_validate:!0},Gue={...$ue,...FEt},dk=class extends bi{static defaultProps=Gue;static layerName=\"GeoArrowH3HexagonLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){return this._renderLayer()}_renderLayer(){let{data:t,getHexagon:r}=this.props;this.props._validate&&Wn(this.props,t);let[i,n]=Gn(this.props,[\"getHexagon\"]),o=new Er([r]),s={...FEt,...n,id:`${this.props.id}-geoarrow-h3`,data:{data:t,length:r.length},getHexagon:(a,h)=>{let p=o.get(h.index);return typeof p==\"string\"?p:p.toString(16)}};for(let[a,h]of Object.entries(i))$n({props:s,propName:a,propInput:h});return new Oz(this.getSubLayerProps(s))}};var NEt=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function zEt(e,t=!1,r=Float32Array){let i;if(Number.isFinite(e[0]))i=new r(e);else{i=new r(e.length*4);let n=0;for(let o=0;o<e.length;o++){let s=e[o];i[n++]=s[0],i[n++]=s[1],i[n++]=s[2],i[n++]=Number.isFinite(s[3])?s[3]:255}}if(t)for(let n=0;n<i.length;n++)i[n]/=255;return i}function VEt(e){let t=e.map(a=>a[0]),r=e.map(a=>a[1]),i=Math.min.apply(null,t),n=Math.max.apply(null,t),o=Math.min.apply(null,r),s=Math.max.apply(null,r);return[i,o,n,s]}function jEt(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}var UEt=new Float32Array(12);function frt(e,t=2){let r=0;for(let i of e)for(let n=0;n<t;n++)UEt[r++]=i[n]||0;return UEt}function $Et(e,t,r){let[i,n,o,s]=e,a=o-i,h=s-n,p=a,g=h;a/h<t/r?p=t/r*h:g=r/t*a,p<t&&(p=t,g=r);let w=(o+i)/2,C=(s+n)/2;return[w-p/2,C-g/2,w+p/2,C+g/2]}function GEt(e,t){let[r,i,n,o]=t;return[(e[0]-r)/(n-r),(e[1]-i)/(o-i)]}var WEt=`#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\nuniform sampler2D maxTexture;\nin vec3 positions;\nin vec2 texCoords;\nout vec2 vTexCoords;\nout float vIntensityMin;\nout float vIntensityMax;\nvoid main(void) {\ngl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\nvTexCoords = texCoords;\nvec4 maxTexture = texture(maxTexture, vec2(0.5));\nfloat maxValue = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\nfloat minValue = maxValue * triangle.threshold;\nif (triangle.colorDomain[1] > 0.) {\nmaxValue = triangle.colorDomain[1];\nminValue = triangle.colorDomain[0];\n}\nvIntensityMax = triangle.intensity / maxValue;\nvIntensityMin = triangle.intensity / minValue;\n}\n`;var qEt=`#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\nprecision highp float;\nuniform sampler2D weightsTexture;\nuniform sampler2D colorTexture;\nin vec2 vTexCoords;\nin float vIntensityMin;\nin float vIntensityMax;\nout vec4 fragColor;\nvec4 getLinearColor(float value) {\nfloat factor = clamp(value * vIntensityMax, 0., 1.);\nvec4 color = texture(colorTexture, vec2(factor, 0.5));\ncolor.a *= min(value * vIntensityMin, 1.0);\nreturn color;\n}\nvoid main(void) {\nvec4 weights = texture(weightsTexture, vTexCoords);\nfloat weight = weights.r;\nif (triangle.aggregationMode > 0.5) {\nweight /= max(1.0, weights.a);\n}\nif (weight <= 0.) {\ndiscard;\n}\nvec4 linearColor = getLinearColor(weight);\nlinearColor.a *= layer.opacity;\nfragColor = linearColor;\n}\n`;var HEt=`uniform triangleUniforms {\n  float aggregationMode;\n  vec2 colorDomain;\n  float intensity;\n  float threshold;\n} triangle;\n`,YEt={name:\"triangle\",vs:HEt,fs:HEt,uniformTypes:{aggregationMode:\"f32\",colorDomain:\"vec2<f32>\",intensity:\"f32\",threshold:\"f32\"}};var aU=class extends ho{getShaders(){return super.getShaders({vs:WEt,fs:qEt,modules:[Mo,YEt]})}initializeState({device:t}){this.setState({model:this._getModel(t)})}_getModel(t){let{vertexCount:r,data:i}=this.props;return new sn(t,{...this.getShaders(),id:this.props.id,attributes:i.attributes,bufferLayout:[{name:\"positions\",format:\"float32x3\"},{name:\"texCoords\",format:\"float32x2\"}],topology:\"triangle-strip\",vertexCount:r})}draw(){let{model:t}=this.state,{aggregationMode:r,colorDomain:i,intensity:n,threshold:o,colorTexture:s,maxTexture:a,weightsTexture:h}=this.props,p={aggregationMode:r,colorDomain:i,intensity:n,threshold:o,colorTexture:s,maxTexture:a,weightsTexture:h};t.shaderInputs.setProps({triangle:p}),t.draw(this.context.renderPass)}};aU.layerName=\"TriangleLayer\";var XEt=aU;function ZEt(e,t){let r={};for(let i in e)t.includes(i)||(r[i]=e[i]);return r}var lU=class extends bi{initializeAggregationLayer(t){super.initializeState(this.context),this.setState({ignoreProps:ZEt(this.constructor._propTypes,t.data.props),dimensions:t})}updateState(t){super.updateState(t);let{changeFlags:r}=t;if(r.extensionsChanged){let i=this.getShaders({});i&&i.defines&&(i.defines.NON_INSTANCED_MODEL=1),this.updateShaders(i)}this._updateAttributes()}updateAttributes(t){this.setState({changedAttributes:t})}getAttributes(){return this.getAttributeManager().getAttributes()}getModuleSettings(){let{viewport:t,mousePosition:r,device:i}=this.context;return Object.assign(Object.create(this.props),{viewport:t,mousePosition:r,picking:{isActive:0},devicePixelRatio:i.canvasContext.cssToDeviceRatio()})}updateShaders(t){}isAggregationDirty(t,r={}){let{props:i,oldProps:n,changeFlags:o}=t,{compareAll:s=!1,dimension:a}=r,{ignoreProps:h}=this.state,{props:p,accessors:g=[]}=a,{updateTriggersChanged:w}=o;if(o.dataChanged)return!0;if(w){if(w.all)return!0;for(let C of g)if(w[C])return!0}if(s)return o.extensionsChanged?!0:NP({oldProps:n,newProps:i,ignoreProps:h,propTypes:this.constructor._propTypes});for(let C of p)if(i[C]!==n[C])return!0;return!1}isAttributeChanged(t){let{changedAttributes:r}=this.state;return t?r&&r[t]!==void 0:!Wue(r)}_getAttributeManager(){return new P0(this.context.device,{id:this.props.id,stats:this.context.stats})}};lU.layerName=\"AggregationLayer\";var KEt=lU;function Wue(e){let t=!0;for(let r in e){t=!1;break}return t}var cU=`#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nvoid main()\n{\nweightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);\nfloat radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);\ngl_PointSize = radiusTexels * 2.;\nvec3 commonPosition = project_position(positions, positions64Low);\ngl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;\ngl_Position.xy = (gl_Position.xy * 2.) - (1.);\ngl_Position.w = 1.0;\n}\n`;var uU=`#version 300 es\nin vec4 weightsTexture;\nout vec4 fragColor;\nfloat gaussianKDE(float u){\nreturn pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\nfloat dist = length(gl_PointCoord - vec2(0.5, 0.5));\nif (dist > 0.5) {\ndiscard;\n}\nfragColor = weightsTexture * gaussianKDE(2. * dist);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;var QEt=`#version 300 es\nuniform sampler2D inTexture;\nout vec4 outTexture;\nvoid main()\n{\nint yIndex = gl_VertexID / int(maxWeight.textureSize);\nint xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));\nvec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;\noutTexture = texture(inTexture, uv);\ngl_Position = vec4(0.0, 0.0, 0.0, 1.0);\ngl_PointSize = 1.0;\n}\n`;var JEt=`#version 300 es\nin vec4 outTexture;\nout vec4 fragColor;\nvoid main() {\nfragColor = outTexture;\nfragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n`;var que=`uniform weightUniforms {\n  vec4 commonBounds;\n  float radiusPixels;\n  float textureWidth;\n  float weightsScale;\n} weight;\n`,tPt={name:\"weight\",vs:que,uniformTypes:{commonBounds:\"vec4<f32>\",radiusPixels:\"f32\",textureWidth:\"f32\",weightsScale:\"f32\"}},ePt={name:\"maxWeight\",vs:`uniform maxWeightUniforms {\n  float textureSize;\n} maxWeight;\n`,uniformTypes:{textureSize:\"f32\"}};var Hue=2,prt={format:\"rgba8unorm\",dimension:\"2d\",width:1,height:1,sampler:{minFilter:\"linear\",magFilter:\"linear\",addressModeU:\"clamp-to-edge\",addressModeV:\"clamp-to-edge\"}},rPt=[0,0],Yue={SUM:0,MEAN:1},Xue={getPosition:{type:\"accessor\",value:e=>e.position},getWeight:{type:\"accessor\",value:1},intensity:{type:\"number\",min:0,value:1},radiusPixels:{type:\"number\",min:1,max:100,value:50},colorRange:NEt,threshold:{type:\"number\",min:0,max:1,value:.05},colorDomain:{type:\"array\",value:null,optional:!0},aggregation:\"SUM\",weightsTextureSize:{type:\"number\",min:128,max:2048,value:2048},debounceTimeout:{type:\"number\",min:0,max:1e3,value:500}},Zue=[\"float32-renderable-webgl\",\"texture-blend-float-webgl\"],Kue={data:{props:[\"radiusPixels\"]}},fk=class extends KEt{getShaders(t){let r=[Mo];return t.modules&&(r=[...r,...t.modules]),super.getShaders({...t,modules:r})}initializeState(){super.initializeAggregationLayer(Kue),this.setState({colorDomain:rPt}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState(t){super.updateState(t),this._updateHeatmapState(t)}_updateHeatmapState(t){let{props:r,oldProps:i}=t,n=this._getChangeFlags(t);if((n.dataChanged||n.viewportChanged)&&(n.boundsChanged=this._updateBounds(n.dataChanged),this._updateTextureRenderingBounds()),n.dataChanged||n.boundsChanged){if(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0}),n.dataChanged){let o=this.getShaders({vs:cU,fs:uU});this._createWeightsTransform(o)}}else n.viewportZoomChanged&&this._debouncedUpdateWeightmap();r.colorRange!==i.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){let{weightsTexture:t,triPositionBuffer:r,triTexCoordBuffer:i,maxWeightsTexture:n,colorTexture:o,colorDomain:s}=this.state,{updateTriggers:a,intensity:h,threshold:p,aggregation:g}=this.props,w=this.getSubLayerClass(\"triangle\",XEt);return new w(this.getSubLayerProps({id:\"triangle-layer\",updateTriggers:a}),{coordinateSystem:Vr.DEFAULT,data:{attributes:{positions:r,texCoords:i}},vertexCount:4,maxTexture:n,colorTexture:o,aggregationMode:Yue[g]||0,weightsTexture:t,intensity:h,threshold:p,colorDomain:s})}finalizeState(t){super.finalizeState(t);let{weightsTransform:r,weightsTexture:i,maxWeightTransform:n,maxWeightsTexture:o,triPositionBuffer:s,triTexCoordBuffer:a,colorTexture:h,updateTimer:p}=this.state;r?.destroy(),i?.destroy(),n?.destroy(),o?.destroy(),s?.destroy(),a?.destroy(),h?.destroy(),p&&clearTimeout(p)}_getAttributeManager(){return new P0(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){let r={},{dimensions:i}=this.state;r.dataChanged=this.isAttributeChanged()&&\"attribute changed\"||this.isAggregationDirty(t,{compareAll:!0,dimension:i.data})&&\"aggregation is dirty\",r.viewportChanged=t.changeFlags.viewportChanged;let{zoom:n}=this.state;return(!t.context.viewport||t.context.viewport.zoom!==n)&&(r.viewportZoomChanged=!0),r}_createTextures(){let{textureSize:t,format:r}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...prt,width:t,height:t,format:r}),maxWeightsTexture:this.context.device.createTexture({...prt,width:1,height:1,format:r})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:\"float64\",accessor:\"getPosition\"},weights:{size:1,accessor:\"getWeight\"}}),this.setState({positionAttributeName:\"positions\"})}_setupTextureParams(){let{device:t}=this.context,{weightsTextureSize:r}=this.props,i=Math.min(r,t.limits.maxTextureDimension2D),n=Zue.every(a=>t.features.has(a)),o=n?\"rgba32float\":\"rgba8unorm\",s=n?1:1/255;this.setState({textureSize:i,format:o,weightsScale:s}),n||hr.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(t){let{weightsTransform:r}=this.state,{weightsTexture:i}=this.state,n=this.getAttributeManager();r?.destroy(),r=new O3(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:n.getBufferLayouts(),vertexCount:1,targetTexture:i,parameters:{depthWriteEnabled:!1,blend:!0,blendColorOperation:\"add\",blendColorSrcFactor:\"one\",blendColorDstFactor:\"one\",blendAlphaSrcFactor:\"one\",blendAlphaDstFactor:\"one\"},topology:\"point-list\",...t,modules:[...t.modules,tPt]}),this.setState({weightsTransform:r})}_setupResources(){this._createTextures();let{device:t}=this.context,{textureSize:r,weightsTexture:i,maxWeightsTexture:n}=this.state,o=this.getShaders({vs:cU,fs:uU});this._createWeightsTransform(o);let s=this.getShaders({vs:QEt,fs:JEt,modules:[ePt]}),a=new O3(t,{id:`${this.id}-max-weights-transform`,targetTexture:n,...s,vertexCount:r*r,topology:\"point-list\",parameters:{depthWriteEnabled:!1,blend:!0,blendColorOperation:\"max\",blendAlphaOperation:\"max\",blendColorSrcFactor:\"one\",blendColorDstFactor:\"one\",blendAlphaSrcFactor:\"one\",blendAlphaDstFactor:\"one\"}}),h={inTexture:i,textureSize:r};a.model.shaderInputs.setProps({maxWeight:h}),this.setState({weightsTexture:i,maxWeightsTexture:n,maxWeightTransform:a,zoom:null,triPositionBuffer:t.createBuffer({byteLength:48}),triTexCoordBuffer:t.createBuffer({byteLength:48})})}updateShaders(t){this._createWeightsTransform({vs:cU,fs:uU,...t})}_updateMaxWeightValue(){let{maxWeightTransform:t}=this.state;t.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(t=!1){let{viewport:r}=this.context,i=[r.unproject([0,0]),r.unproject([r.width,0]),r.unproject([0,r.height]),r.unproject([r.width,r.height])].map(a=>a.map(Math.fround)),n=VEt(i),o={visibleWorldBounds:n,viewportCorners:i},s=!1;if(t||!this.state.worldBounds||!jEt(this.state.worldBounds,n)){let a=this._worldToCommonBounds(n),h=this._commonToWorldBounds(a);this.props.coordinateSystem===Vr.LNGLAT&&(h[1]=Math.max(h[1],-85.051129),h[3]=Math.min(h[3],85.051129),h[0]=Math.max(h[0],-360),h[2]=Math.min(h[2],360));let p=this._worldToCommonBounds(h);o.worldBounds=h,o.normalizedCommonBounds=p,s=!0}return this.setState(o),s}_updateTextureRenderingBounds(){let{triPositionBuffer:t,triTexCoordBuffer:r,normalizedCommonBounds:i,viewportCorners:n}=this.state,{viewport:o}=this.context;t.write(frt(n,3));let s=n.map(a=>GEt(o.projectPosition(a),i));r.write(frt(s,2))}_updateColorTexture(t){let{colorRange:r}=t.props,{colorTexture:i}=this.state,n=zEt(r,!1,Uint8Array);i?.destroy(),i=this.context.device.createTexture({...prt,data:n,width:r.length,height:1}),this.setState({colorTexture:i})}_updateWeightmap(){let{radiusPixels:t,colorDomain:r,aggregation:i}=this.props,{worldBounds:n,textureSize:o,weightsScale:s,weightsTexture:a}=this.state,h=this.state.weightsTransform;this.state.isWeightMapDirty=!1;let p=this._worldToCommonBounds(n,{useLayerCoordinateSystem:!0});if(r&&i===\"SUM\"){let{viewport:tt}=this.context,rt=tt.distanceScales.metersPerUnit[2]*(p[2]-p[0])/o;this.state.colorDomain=[r[0]*rt*s,r[1]*rt*s]}else this.state.colorDomain=r||rPt;let w=this.getAttributeManager().getAttributes(),C=this.getModuleSettings();this._setModelAttributes(h.model,w),h.model.setVertexCount(this.getNumInstances());let R={radiusPixels:t,commonBounds:p,textureWidth:o,weightsScale:s,weightsTexture:a},{viewport:z,devicePixelRatio:W,coordinateSystem:Y,coordinateOrigin:H}=C,{modelMatrix:Q}=this.props;h.model.shaderInputs.setProps({project:{viewport:z,devicePixelRatio:W,modelMatrix:Q,coordinateSystem:Y,coordinateOrigin:H},weight:R}),h.run({parameters:{viewport:[0,0,o,o]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(t=!1){let{updateTimer:r}=this.state,{debounceTimeout:i}=this.props;t?(r=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(r),r=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),i)),this.setState({updateTimer:r})}_worldToCommonBounds(t,r={}){let{useLayerCoordinateSystem:i=!1}=r,[n,o,s,a]=t,{viewport:h}=this.context,{textureSize:p}=this.state,{coordinateSystem:g}=this.props,w=i&&(g===Vr.LNGLAT_OFFSETS||g===Vr.METER_OFFSETS),C=w?h.projectPosition(this.props.coordinateOrigin):[0,0],R=p*Hue/h.scale,z,W;return i&&!w?(z=this.projectPosition([n,o,0]),W=this.projectPosition([s,a,0])):(z=h.projectPosition([n,o,0]),W=h.projectPosition([s,a,0])),$Et([z[0]-C[0],z[1]-C[1],W[0]-C[0],W[1]-C[1]],R,R)}_commonToWorldBounds(t){let[r,i,n,o]=t,{viewport:s}=this.context,a=s.unprojectPosition([r,i]),h=s.unprojectPosition([n,o]);return a.slice(0,2).concat(h.slice(0,2))}};fk.layerName=\"HeatmapLayer\";fk.defaultProps=Xue;var hU=fk;var{data:Yyr,getPosition:Xyr,...Que}=hU.defaultProps,iPt={_validate:!0},Jue={...Que,...iPt},pk=class extends bi{static defaultProps=Jue;static layerName=\"GeoArrowHeatmapLayer\";renderLayers(){let{data:t}=this.props;if(this.props.getPosition!==void 0){let r=this.props.getPosition;if(r!==void 0&&zr.isPointData(r))return this._renderPointLayer(r);throw new Error(\"getPosition should pass in an arrow Data of Point type\")}else{let r=qo(t,Co.POINT);if(r!==null&&zr.isPointData(r))return this._renderPointLayer(r)}throw new Error(\"getPosition not GeoArrow point\")}_renderPointLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isPointData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPosition\"]);go(t)&&(t=Hc(t));let s=Si.getPointChild(t).values,a={...iPt,...n,id:`${this.props.id}-geoarrow-heatmap`,data:{data:r,length:t.length,attributes:{getPosition:{value:s,size:t.type.listSize}}}};for(let[h,p]of Object.entries(i))$n({props:a,propName:h,propInput:p});return new hU(this.getSubLayerProps(a))}};var{data:i1r,getPath:n1r,...the}=Kf.defaultProps,mrt={_pathType:\"open\",_validate:!0},grt={...the,...mrt},zx=class extends bi{static defaultProps=grt;static layerName=\"GeoArrowPathLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{data:t}=this.props;if(this.props.getPath!==void 0){let r=this.props.getPath;if(r!==void 0&&zr.isLineStringData(r))return this._renderLineStringLayer(r);if(r!==void 0&&zr.isMultiLineStringData(r))return this._renderMultiLineStringLayer(r);throw new Error(\"getPath should be an arrow Data of LineString or MultiLineString type\")}else{let r=qo(t,Co.LINESTRING);if(r!==null&&zr.isLineStringData(r))return this._renderLineStringLayer(r);let i=qo(t,Co.MULTILINESTRING);if(i!==null&&zr.isMultiLineStringData(i))return this._renderMultiLineStringLayer(i)}throw new Error(\"getPath not GeoArrow LineString or MultiLineString\")}_renderLineStringLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isLineStringData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPath\"]);go(t)&&(t=pS(t));let o=t.valueOffsets,s=Si.getLineStringChild(t),a=s.type.listSize,p=Si.getPointChild(s).values,g={...mrt,...n,id:`${this.props.id}-geoarrow-path-linestring`,data:{data:r,length:t.length,startIndices:o,attributes:{getPath:{value:p,size:a}}}};for(let[w,C]of Object.entries(i))$n({props:g,propName:w,propInput:C,geomCoordOffsets:o});return new Kf(this.getSubLayerProps(g))}_renderMultiLineStringLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isMultiLineStringData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPath\"]),o=Si.getMultiLineStringChild(t);go(o)&&(o=pS(o));let s=Si.getLineStringChild(o),a=Si.getPointChild(s),h=t.valueOffsets,p=o.valueOffsets,g=s.type.listSize,w=a.values,C=kEt(t),R={...mrt,...n,id:`${this.props.id}-geoarrow-path-multilinestring`,data:{data:r,invertedGeomOffsets:mS(h),length:o.length,startIndices:p,attributes:{getPath:{value:w,size:g}}}};for(let[z,W]of Object.entries(i))$n({props:R,propName:z,propInput:W,geomCoordOffsets:C});return new Kf(this.getSubLayerProps(R))}};var{data:d1r,getPosition:f1r,...ehe}=d9.defaultProps,nPt={_validate:!0},rhe={...ehe,...nPt},mk=class extends bi{static defaultProps=rhe;static layerName=\"GeoArrowPointCloudLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{data:t}=this.props;if(this.props.getPosition!==void 0){let r=this.props.getPosition;if(r!==void 0&&zr.isPointData(r))return this._renderPointLayer(r);throw new Error(\"getPosition should pass in an arrow Data of Point type\")}else{let r=qo(t,Co.POINT);if(r!==null&&zr.isPointData(r))return this._renderPointLayer(r)}throw new Error(\"getPosition not GeoArrow point\")}_renderPointLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isPointData(t),\"The geometry column is not a valid PointVector.\"),_r(t.type.listSize===3,\"Points of a PointCloudLayer in the geometry column must be three-dimensional.\"),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPosition\"]);go(t)&&(t=Hc(t));let s=Si.getPointChild(t).values,a={...nPt,...n,id:`${this.props.id}-geoarrow-pointcloud`,data:{data:r,length:t.length,attributes:{getPosition:{value:s,size:t.type.listSize}}}};for(let[h,p]of Object.entries(i))$n({props:a,propName:h,propInput:p});return new d9(this.getSubLayerProps(a))}};var PA=xe(dCt(),1),r_r=PA.default.registerSerializer,PU=PA.default.spawn,CU=PA.default.BlobWorker,i_r=PA.default.DefaultSerializer,IU=PA.default.Pool,n_r=PA.default.Thread,Grt=PA.default.Transfer,o_r=PA.default.Worker;var{data:p_r,getPolygon:m_r,...Ufe}=jg.defaultProps,Wrt={_normalize:!1,_windingOrder:\"CCW\",_validate:!0,metrics:!1,earcutWorkerUrl:\"https://cdn.jsdelivr.net/npm/@geoarrow/geoarrow-js@0.3.0/dist/earcut-worker.min.js\",earcutWorkerPoolSize:1},Vfe={...Ufe,...Wrt},Gx=class extends bi{static defaultProps=Vfe;static layerName=\"GeoArrowSolidPolygonLayer\";initializeState(t){this.state={batch:null,triangles:null,earcutWorkerRequest:this.props.earcutWorkerUrl===null||this.props.earcutWorkerUrl===void 0?null:fetch(this.props.earcutWorkerUrl).then(r=>r.text()),earcutWorkerPool:this.props.earcutWorkerPool||null}}async initEarcutPool(){if(this.state.earcutWorkerPool)return this.state.earcutWorkerPool;let t=await this.state.earcutWorkerRequest;if(!t||window?.location?.href.startsWith(\"file://\"))return null;try{let r=IU(()=>PU(CU.fromText(t)),this.props.earcutWorkerPoolSize||1);return this.state.earcutWorkerPool=r,this.state.earcutWorkerPool}catch{return null}}async finalizeState(t){await this.state?.earcutWorkerPool?.terminate(),console.log(\"terminated\")}async updateData(){let{data:t}=this.props,r=await this._updateEarcut(t);this.setState({batch:this.props.data,triangles:r})}async _updateEarcut(t){let r=qo(t,Co.POLYGON);if(r!==null&&zr.isPolygonData(r))return this._earcutPolygonData(r);let i=qo(t,Co.MULTIPOLYGON);if(i!==null&&zr.isMultiPolygonData(i))return this._earcutMultiPolygonData(i);let n=this.props.getPolygon;if(n!==void 0&&zr.isPolygonData(n))return this._earcutPolygonData(n);if(n!==void 0&&zr.isMultiPolygonData(n))return this._earcutMultiPolygonData(n);throw new Error(\"geometryColumn not Polygon or MultiPolygon\")}async _earcutPolygonData(t){let r=await this.initEarcutPool();if(!r)return this._earcutPolygonVectorMainThread(t);let i=null,n=(Date.now()+Math.floor(Math.random()*1e3)).toString();this.props.metrics&&console.time(n),go(t)&&(t=Nx(t));let[o,s]=hrt.preparePostMessage(t,!0);return r.queue(async a=>{i=await a(Grt(o,s))}),await r.completed(),this.props.metrics&&console.timeEnd(n),_r(i!==null),i}_earcutPolygonVectorMainThread(t){return go(t)&&(t=Nx(t)),crt.earcut(t)}async _earcutMultiPolygonData(t){let r=await this.initEarcutPool();if(!r)return this._earcutMultiPolygonVectorMainThread(t);let i=null,n=(Date.now()+Math.floor(Math.random()*1e3)).toString();this.props.metrics&&console.time(n);let o=Si.getMultiPolygonChild(t);go(o)&&(o=Nx(o));let[s,a]=hrt.preparePostMessage(o,!0);return r.queue(async h=>{i=await h(Grt(s,a))}),await r.completed(),this.props.metrics&&console.timeEnd(n),_r(i!==null),i}_earcutMultiPolygonVectorMainThread(t){let r=Si.getMultiPolygonChild(t);return go(r)&&(r=Nx(r)),crt.earcut(r)}updateState({props:t,changeFlags:r}){r.dataChanged&&this.updateData()}getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{batch:t}=this.state;if(!t)return null;if(this.props.getPolygon!==void 0){let r=this.props.getPolygon;if(r!==void 0&&zr.isPolygonData(r))return this._renderPolygonLayer(r);if(r!==void 0&&zr.isMultiPolygonData(r))return this._renderMultiPolygonLayer(r);throw new Error(\"getPolygon should be an arrow Data of Polygon or MultiPolygon type\")}else{let r=qo(t,Co.POLYGON);if(r!==null&&zr.isPolygonData(r))return this._renderPolygonLayer(r);let i=qo(t,Co.MULTIPOLYGON);if(i!==null&&zr.isMultiPolygonData(i))return this._renderMultiPolygonLayer(i)}throw new Error(\"getPolygon not GeoArrow Polygon or MultiPolygon\")}_renderPolygonLayer(t){let{batch:r}=this.state;if(!r)return null;this.props._validate&&(_r(zr.isPolygonData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPolygon\"]);go(t)&&(t=Nx(t));let o=Si.getPolygonChild(t),s=Si.getLineStringChild(o),a=Si.getPointChild(s),h=s.type.listSize,p=a.values,g=drt(t);if(!this.state.triangles)return null;let w=this.state.triangles,C={...Wrt,...n,id:`${this.props.id}-geoarrow-solid-polygon`,data:{data:r,length:t.length,startIndices:g,attributes:{getPolygon:{value:p,size:h},indices:{value:w,size:1}}}};for(let[R,z]of Object.entries(i))$n({props:C,propName:R,propInput:z,geomCoordOffsets:g});return new jg(this.getSubLayerProps(C))}_renderMultiPolygonLayer(t){let{batch:r}=this.state;if(!r)return null;this.props._validate&&(_r(zr.isMultiPolygonData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPolygon\"]),o=Si.getMultiPolygonChild(t);go(o)&&(o=Nx(o));let s=Si.getPolygonChild(o),a=Si.getLineStringChild(s),h=Si.getPointChild(a),p=a.type.listSize,g=t.valueOffsets,w=h.values;if(!this.state.triangles)return null;let C=this.state.triangles,R=drt(o),z=REt(t),W={...Wrt,...n,id:`${this.props.id}-geoarrow-solid-polygon-multi`,data:{data:r,invertedGeomOffsets:mS(g),length:o.length,startIndices:R,attributes:{getPolygon:{value:w,size:p},indices:{value:C,size:1}}}};for(let[H,Q]of Object.entries(i))$n({props:W,propName:H,propInput:Q,geomCoordOffsets:z});let Y=this.getSubLayerProps(W);return new jg(Y)}};function fCt(e){return\"data\"in e?new Er(e.data.map(t=>fCt(t))):e}function pCt(e){if(\"data\"in e)return new Er(e.data.map(s=>pCt(s)));let t=e.valueOffsets,r=Si.getMultiPolygonChild(e),i=r.valueOffsets,n=Si.getPolygonChild(r),o=new Int32Array(t.length);for(let s=0;s<o.length;++s)o[s]=i[t[s]];return Pr({type:new Oa(r.type.children[0]),length:e.length,nullCount:e.nullCount,nullBitmap:e.nullBitmap,child:n,valueOffsets:o})}var{data:w_r,getPolygon:T_r,...jfe}=wh.defaultProps,$fe={_normalize:!1,_windingOrder:\"CCW\",_validate:!0},Gfe={...jfe,...$fe},Wfe=[0,0,0,255];var Ik=class extends bi{static defaultProps=Gfe;static layerName=\"GeoArrowPolygonLayer\";getPickingInfo(t){return t.info}renderLayers(){let{data:t}=this.props;if(this.props.getPolygon!==void 0){let r=this.props.getPolygon;if(zr.isPolygonData(r))return this._renderLayers(r);if(zr.isMultiPolygonData(r))return this._renderLayers(r);throw new Error(\"getPolygon should be an arrow Data of Polygon or MultiPolygon type\")}else{let r=qo(t,Co.POLYGON);if(r!==null&&zr.isPolygonData(r))return this._renderLayers(r);let i=qo(t,Co.MULTIPOLYGON);if(i!==null&&zr.isMultiPolygonData(i))return this._renderLayers(i)}throw new Error(\"geometryColumn not Polygon or MultiPolygon\")}_renderLayers(t){let{data:r}=this.props,i;zr.isPolygonData(t)?i=fCt(t):zr.isMultiPolygonData(t)?i=pCt(t):_r(!1);let{data:n,_dataDiff:o,stroked:s,filled:a,extruded:h,wireframe:p,_normalize:g,_windingOrder:w,elevationScale:C,transitions:R,positionFormat:z}=this.props,{lineWidthUnits:W,lineWidthScale:Y,lineWidthMinPixels:H,lineWidthMaxPixels:Q,lineJointRounded:tt,lineMiterLimit:rt,lineDashJustified:at}=this.props,{getFillColor:et,getLineColor:lt,getLineWidth:J,getElevation:ft,getPolygon:dt,updateTriggers:Mt,material:Ft,earcutWorkerPool:Nt,earcutWorkerPoolSize:$t,earcutWorkerUrl:Yt}=this.props,_e=this.getSubLayerClass(\"fill\",Gx),Pe=this.getSubLayerClass(\"stroke\",zx),we=new _e({extruded:h,elevationScale:C,filled:a,wireframe:p,_normalize:g,_windingOrder:w,getElevation:ft,getFillColor:et,getLineColor:h&&p?lt:Wfe,material:Ft,transitions:R,earcutWorkerPool:Nt,earcutWorkerPoolSize:$t,earcutWorkerUrl:Yt},this.getSubLayerProps({id:\"fill\",updateTriggers:Mt&&{getPolygon:Mt.getPolygon,getElevation:Mt.getElevation,getFillColor:Mt.getFillColor,getLineColor:Mt.getLineColor}}),{data:n,positionFormat:z,getPolygon:dt}),Ue=!h&&s&&new Pe({widthUnits:W,widthScale:Y,widthMinPixels:H,widthMaxPixels:Q,jointRounded:tt,miterLimit:rt,dashJustified:at,_pathType:\"loop\",transitions:R&&{getWidth:R.getLineWidth,getColor:R.getLineColor,getPath:R.getPolygon},getColor:this.getSubLayerAccessor(lt),getWidth:this.getSubLayerAccessor(J)},this.getSubLayerProps({id:\"stroke\",updateTriggers:Mt&&{getWidth:Mt.getLineWidth,getColor:Mt.getLineColor,getDashArray:Mt.getLineDashArray}}),{data:r,positionFormat:z,getPath:i,pickable:!1});return[!h&&we,Ue,h&&we]}};var{data:k_r,getS2Token:R_r,...qfe}=Sz.defaultProps,mCt={_validate:!0},Hfe={...qfe,...mCt},kk=class extends bi{static defaultProps=Hfe;static layerName=\"GeoArrowS2Layer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){return this._renderLayer()}_renderLayer(){let{data:t,getS2Token:r}=this.props;this.props._validate&&Wn(this.props,t);let[i,n]=Gn(this.props,[\"getS2Token\"]),o=new Er([r]),s={...mCt,...n,id:`${this.props.id}-geoarrow-S2`,data:{data:t,length:t.numRows},getS2Token:(a,h)=>{let p=o.get(h.index);return typeof p==\"string\"?p:p.toString(16)}};for(let[a,h]of Object.entries(i))$n({props:s,propName:a,propInput:h});return new Sz(this.getSubLayerProps(s))}};var{data:U_r,getPosition:V_r,...Yfe}=Sb.defaultProps,qrt={_validate:!0},Xfe={...Yfe,...qrt},Rk=class extends bi{static defaultProps=Xfe;static layerName=\"GeoArrowScatterplotLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{data:t}=this.props;if(this.props.getPosition!==void 0){let r=this.props.getPosition;if(r!==void 0&&zr.isPointData(r))return this._renderPointLayer(r);if(r!==void 0&&zr.isMultiPointData(r))return this._renderMultiPointLayer(r);throw new Error(\"getPosition should pass in an arrow Data of Point or MultiPoint type\")}else{let r=qo(t,Co.POINT);if(r!==null&&zr.isPointData(r))return this._renderPointLayer(r);let i=qo(t,Co.MULTIPOINT);if(i!==null&&zr.isMultiPointData(i))return this._renderMultiPointLayer(i)}throw new Error(\"getPosition not GeoArrow point or multipoint\")}_renderPointLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isPointData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPosition\"]);go(t)&&(t=Hc(t));let s=Si.getPointChild(t).values,a={...qrt,...n,id:`${this.props.id}-geoarrow-scatterplot-point`,data:{data:r,length:t.length,attributes:{getPosition:{value:s,size:t.type.listSize}}}};for(let[h,p]of Object.entries(i))$n({props:a,propName:h,propInput:p});return new Sb(this.getSubLayerProps(a))}_renderMultiPointLayer(t){let{data:r}=this.props;this.props._validate&&(_r(zr.isMultiPointData(t)),Wn(this.props,r));let[i,n]=Gn(this.props,[\"getPosition\"]),o=Si.getMultiPointChild(t);go(o)&&(o=Hc(o));let s=t.valueOffsets,h=Si.getPointChild(o).values,p={...qrt,...n,id:`${this.props.id}-geoarrow-scatterplot-multipoint`,data:{data:r,invertedGeomOffsets:mS(s),length:o.length,attributes:{getPosition:{value:h,size:o.type.listSize}}}};for(let[g,w]of Object.entries(i))$n({props:p,propName:g,propInput:w,geomCoordOffsets:s});return new Sb(this.getSubLayerProps(p))}};var{data:X_r,getPosition:Z_r,getText:K_r,getTextAnchor:Q_r,getAlignmentBaseline:J_r,getPixelOffset:tvr,...Zfe}=Z3.defaultProps,gCt={getTextAnchor:\"middle\",getAlignmentBaseline:\"center\",getPixelOffset:[0,0],_validate:!0},Kfe={...Zfe,...gCt},Dk=class extends bi{static defaultProps=Kfe;static layerName=\"GeoArrowTextLayer\";getPickingInfo(t){return Is(t,this.props.data)}renderLayers(){let{data:t}=this.props;if(this.props.getPosition!==void 0){let r=this.props.getPosition;if(r!==void 0&&zr.isPointData(r))return this._renderTextLayer(r,this.props.getText);throw new Error(\"getPosition should pass in an arrow Data of Point type\")}else{let r=qo(t,Co.POINT);if(r!==null&&zr.isPointData(r))return this._renderTextLayer(r,this.props.getText)}throw new Error(\"getPosition not GeoArrow point\")}_renderTextLayer(t,r){let{data:i}=this.props;this.props._validate&&(_r(zr.isPointData(t)),Wn(this.props,i));let[n,o]=Gn(this.props,[\"getPosition\",\"getText\"]);go(t)&&(t=Hc(t));let a=Si.getPointChild(t).values,h=r.values,p=r.valueOffsets,g={...gCt,...o,id:`${this.props.id}-geoarrow-text`,data:{data:i,length:t.length,startIndices:p,attributes:{getPosition:{value:sU(a,t.type.listSize,p),size:t.type.listSize},getText:{value:h}}}};for(let[w,C]of Object.entries(n))$n({props:g,propName:w,propInput:C,geomCoordOffsets:p});return new Z3(this.getSubLayerProps(g))}};var{data:lvr,getPath:cvr,...Qfe}=grt,ACt={_pathType:\"open\",_validate:!0},Jfe={...Qfe,...ACt},Ok=class extends bi{static defaultProps=Jfe;static layerName=\"GeoArrowTripsLayer\";renderLayers(){let{data:t,getTimestamps:r}=this.props;if(this.props.getPath!==void 0){let i=this.props.getPath;if(i!==void 0&&zr.isLineStringData(i))return this._renderLineStringLayer(i,r);throw new Error(\"getPath should be an arrow Data of LineString type\")}else{let i=qo(t,Co.LINESTRING);if(i!==null&&zr.isLineStringData(i))return this._renderLineStringLayer(i,r)}throw new Error(\"getPath not GeoArrow LineString\")}_renderLineStringLayer(t,r){let{data:i}=this.props;this.props._validate&&(_r(zr.isLineStringData(t)),Wn(this.props,i));let[n,o]=Gn(this.props,[\"getPath\",\"getTimestamps\"]);go(t)&&(t=pS(t));let s=t.valueOffsets,a=Si.getLineStringChild(t),h=a.type.listSize,g=Si.getPointChild(a).values,w=r.children[0].values,C={...ACt,...o,id:`${this.props.id}-geoarrow-trip`,data:{data:i,length:t.length,startIndices:s,attributes:{getPath:{value:g,size:h},getTimestamps:{value:w,size:1}}}};for(let[R,z]of Object.entries(n))$n({props:C,propName:R,propInput:z,geomCoordOffsets:s});return new Uet(C)}};function Ho(e,t){return Array.isArray(e)?e:e.data[t]}function Yo(e,t){return typeof e==\"number\"?e:e.data[t]}var MS=class extends Zs{static layerType=\"arc\";greatCircle;numSegments;widthUnits;widthScale;widthMinPixels;widthMaxPixels;getSourcePosition;getTargetPosition;getSourceColor;getTargetColor;getWidth;getHeight;getTilt;constructor(t,r){super(t,r),this.initRegularAttribute(\"great_circle\",\"greatCircle\"),this.initRegularAttribute(\"num_segments\",\"numSegments\"),this.initRegularAttribute(\"width_units\",\"widthUnits\"),this.initRegularAttribute(\"width_scale\",\"widthScale\"),this.initRegularAttribute(\"width_min_pixels\",\"widthMinPixels\"),this.initRegularAttribute(\"width_max_pixels\",\"widthMaxPixels\"),this.initVectorizedAccessor(\"get_source_position\",\"getSourcePosition\"),this.initVectorizedAccessor(\"get_target_position\",\"getTargetPosition\"),this.initVectorizedAccessor(\"get_source_color\",\"getSourceColor\"),this.initVectorizedAccessor(\"get_target_color\",\"getTargetColor\"),this.initVectorizedAccessor(\"get_width\",\"getWidth\"),this.initVectorizedAccessor(\"get_height\",\"getHeight\"),this.initVectorizedAccessor(\"get_tilt\",\"getTilt\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],getSourcePosition:this.getSourcePosition.data[t],getTargetPosition:this.getTargetPosition.data[t],...Ht(this.greatCircle)&&{greatCircle:this.greatCircle},...Ht(this.numSegments)&&{numSegments:this.numSegments},...Ht(this.widthUnits)&&{widthUnits:this.widthUnits},...Ht(this.widthScale)&&{widthScale:this.widthScale},...Ht(this.widthMinPixels)&&{widthMinPixels:this.widthMinPixels},...Ht(this.widthMaxPixels)&&{widthMaxPixels:this.widthMaxPixels},...Ht(this.getSourceColor)&&{getSourceColor:Ho(this.getSourceColor,t)},...Ht(this.getTargetColor)&&{getTargetColor:Ho(this.getTargetColor,t)},...Ht(this.getWidth)&&{getWidth:Yo(this.getWidth,t)},...Ht(this.getHeight)&&{getHeight:Yo(this.getHeight,t)},...Ht(this.getTilt)&&{getTilt:Yo(this.getTilt,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new ck({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var ES=class extends gp{static layerType=\"bitmap\";image;bounds;desaturate;transparentColor;tintColor;constructor(t,r){super(t,r),this.initRegularAttribute(\"image\",\"image\"),this.initRegularAttribute(\"bounds\",\"bounds\"),this.initRegularAttribute(\"desaturate\",\"desaturate\"),this.initRegularAttribute(\"transparent_color\",\"transparentColor\"),this.initRegularAttribute(\"tint_color\",\"tintColor\")}layerProps(){return{id:this.model.model_id,...Ht(this.image)&&{image:this.image},...Ht(this.bounds)&&{bounds:this.bounds},...Ht(this.desaturate)&&{desaturate:this.desaturate},...Ht(this.transparentColor)&&{transparentColor:this.transparentColor},...Ht(this.tintColor)&&{tintColor:this.tintColor}}}render(){return new G3({...this.baseLayerProps(),...this.layerProps(),data:void 0,pickable:!1})}},PS=class extends gp{static layerType=\"bitmap-tile\";data;tileSize;zoomOffset;maxZoom;minZoom;extent;maxCacheSize;maxCacheByteSize;refinementStrategy;maxRequests;desaturate;transparentColor;tintColor;constructor(t,r){super(t,r),this.initRegularAttribute(\"data\",\"data\"),this.initRegularAttribute(\"tile_size\",\"tileSize\"),this.initRegularAttribute(\"zoom_offset\",\"zoomOffset\"),this.initRegularAttribute(\"max_zoom\",\"maxZoom\"),this.initRegularAttribute(\"min_zoom\",\"minZoom\"),this.initRegularAttribute(\"extent\",\"extent\"),this.initRegularAttribute(\"max_cache_size\",\"maxCacheSize\"),this.initRegularAttribute(\"max_cache_byte_size\",\"maxCacheByteSize\"),this.initRegularAttribute(\"refinement_strategy\",\"refinementStrategy\"),this.initRegularAttribute(\"max_requests\",\"maxRequests\"),this.initRegularAttribute(\"desaturate\",\"desaturate\"),this.initRegularAttribute(\"transparent_color\",\"transparentColor\"),this.initRegularAttribute(\"tint_color\",\"tintColor\")}bitmapLayerProps(){return{id:this.model.model_id,...Ht(this.desaturate)&&{desaturate:this.desaturate},...Ht(this.transparentColor)&&{transparentColor:this.transparentColor},...Ht(this.tintColor)&&{tintColor:this.tintColor}}}layerProps(){return{id:this.model.model_id,data:this.data,...Ht(this.tileSize)&&{tileSize:this.tileSize},...Ht(this.zoomOffset)&&{zoomOffset:this.zoomOffset},...Ht(this.maxZoom)&&{maxZoom:this.maxZoom},...Ht(this.minZoom)&&{minZoom:this.minZoom},...Ht(this.extent)&&{extent:this.extent},...Ht(this.maxCacheSize)&&{maxCacheSize:this.maxCacheSize},...Ht(this.maxCacheByteSize)&&{maxCacheByteSize:this.maxCacheByteSize},...Ht(this.refinementStrategy)&&{refinementStrategy:this.refinementStrategy},...Ht(this.maxRequests)&&{maxRequests:this.maxRequests}}}render(){return new QT({...this.baseLayerProps(),...this.layerProps(),renderSubLayers:t=>{let[r,i]=t.tile.boundingBox;return new G3(t,{...this.bitmapLayerProps(),data:void 0,image:t.data,bounds:[r[0],r[1],i[0],i[1]]})}})}};var CS=class extends Zs{static layerType=\"column\";diskResolution;radius;angle;offset;coverage;elevationScale;filled;stroked;extruded;wireframe;flatShading;radiusUnits;lineWidthUnits;lineWidthScale;lineWidthMinPixels;lineWidthMaxPixels;getPosition;getFillColor;getLineColor;getElevation;getLineWidth;constructor(t,r){super(t,r),this.initRegularAttribute(\"disk_resolution\",\"diskResolution\"),this.initRegularAttribute(\"radius\",\"radius\"),this.initRegularAttribute(\"angle\",\"angle\"),this.initRegularAttribute(\"offset\",\"offset\"),this.initRegularAttribute(\"coverage\",\"coverage\"),this.initRegularAttribute(\"elevation_scale\",\"elevationScale\"),this.initRegularAttribute(\"filled\",\"filled\"),this.initRegularAttribute(\"stroked\",\"stroked\"),this.initRegularAttribute(\"extruded\",\"extruded\"),this.initRegularAttribute(\"wireframe\",\"wireframe\"),this.initRegularAttribute(\"flat_shading\",\"flatShading\"),this.initRegularAttribute(\"radius_units\",\"radiusUnits\"),this.initRegularAttribute(\"line_width_units\",\"lineWidthUnits\"),this.initRegularAttribute(\"line_width_scale\",\"lineWidthScale\"),this.initRegularAttribute(\"line_width_min_pixels\",\"lineWidthMinPixels\"),this.initRegularAttribute(\"line_width_max_pixels\",\"lineWidthMaxPixels\"),this.initVectorizedAccessor(\"get_position\",\"getPosition\"),this.initVectorizedAccessor(\"get_fill_color\",\"getFillColor\"),this.initVectorizedAccessor(\"get_line_color\",\"getLineColor\"),this.initVectorizedAccessor(\"get_elevation\",\"getElevation\"),this.initVectorizedAccessor(\"get_line_width\",\"getLineWidth\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],...Ht(this.diskResolution)&&{diskResolution:this.diskResolution},...Ht(this.radius)&&{radius:this.radius},...Ht(this.angle)&&{angle:this.angle},...Ht(this.offset)&&{offset:this.offset},...Ht(this.coverage)&&{coverage:this.coverage},...Ht(this.elevationScale)&&{elevationScale:this.elevationScale},...Ht(this.filled)&&{filled:this.filled},...Ht(this.stroked)&&{stroked:this.stroked},...Ht(this.extruded)&&{extruded:this.extruded},...Ht(this.wireframe)&&{wireframe:this.wireframe},...Ht(this.flatShading)&&{flatShading:this.flatShading},...Ht(this.radiusUnits)&&{radiusUnits:this.radiusUnits},...Ht(this.lineWidthUnits)&&{lineWidthUnits:this.lineWidthUnits},...Ht(this.lineWidthScale)&&{lineWidthScale:this.lineWidthScale},...Ht(this.lineWidthMinPixels)&&{lineWidthMinPixels:this.lineWidthMinPixels},...Ht(this.lineWidthMaxPixels)&&{lineWidthMaxPixels:this.lineWidthMaxPixels},...Ht(this.getPosition)&&{getPosition:this.getPosition.data[t]},...Ht(this.getFillColor)&&{getFillColor:Ho(this.getFillColor,t)},...Ht(this.getLineColor)&&{getLineColor:Ho(this.getLineColor,t)},...Ht(this.getElevation)&&{getElevation:Yo(this.getElevation,t)},...Ht(this.getLineWidth)&&{getLineWidth:Yo(this.getLineWidth,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new uk({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var IS=class extends Zs{static layerType=\"heatmap\";radiusPixels;colorRange;intensity;threshold;colorDomain;aggregation;weightsTextureSize;debounceTimeout;getPosition;getWeight;constructor(t,r){super(t,r),this.initRegularAttribute(\"radius_pixels\",\"radiusPixels\"),this.initRegularAttribute(\"color_range\",\"colorRange\"),this.initRegularAttribute(\"intensity\",\"intensity\"),this.initRegularAttribute(\"threshold\",\"threshold\"),this.initRegularAttribute(\"color_domain\",\"colorDomain\"),this.initRegularAttribute(\"aggregation\",\"aggregation\"),this.initRegularAttribute(\"weights_texture_size\",\"weightsTextureSize\"),this.initRegularAttribute(\"debounce_timeout\",\"debounceTimeout\"),this.initVectorizedAccessor(\"get_position\",\"getPosition\"),this.initVectorizedAccessor(\"get_weight\",\"getWeight\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],...Ht(this.radiusPixels)&&{radiusPixels:this.radiusPixels},...Ht(this.colorRange)&&{colorRange:this.colorRange},...Ht(this.intensity)&&{intensity:this.intensity},...Ht(this.threshold)&&{threshold:this.threshold},...Ht(this.colorDomain)&&{colorDomain:this.colorDomain},...Ht(this.aggregation)&&{aggregation:this.aggregation},...Ht(this.weightsTextureSize)&&{weightsTextureSize:this.weightsTextureSize},...Ht(this.debounceTimeout)&&{debounceTimeout:this.debounceTimeout},...Ht(this.getPosition)&&{getPosition:this.getPosition.data[t]},...Ht(this.getWeight)&&{getWeight:Yo(this.getWeight,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new pk({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var kS=class extends Zs{static layerType=\"path\";widthUnits;widthScale;widthMinPixels;widthMaxPixels;jointRounded;capRounded;miterLimit;billboard;getColor;getWidth;constructor(t,r){super(t,r),this.initRegularAttribute(\"width_units\",\"widthUnits\"),this.initRegularAttribute(\"width_scale\",\"widthScale\"),this.initRegularAttribute(\"width_min_pixels\",\"widthMinPixels\"),this.initRegularAttribute(\"width_max_pixels\",\"widthMaxPixels\"),this.initRegularAttribute(\"joint_rounded\",\"jointRounded\"),this.initRegularAttribute(\"cap_rounded\",\"capRounded\"),this.initRegularAttribute(\"miter_limit\",\"miterLimit\"),this.initRegularAttribute(\"billboard\",\"billboard\"),this.initVectorizedAccessor(\"get_color\",\"getColor\"),this.initVectorizedAccessor(\"get_width\",\"getWidth\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],...Ht(this.widthUnits)&&{widthUnits:this.widthUnits},...Ht(this.widthScale)&&{widthScale:this.widthScale},...Ht(this.widthMinPixels)&&{widthMinPixels:this.widthMinPixels},...Ht(this.widthMaxPixels)&&{widthMaxPixels:this.widthMaxPixels},...Ht(this.jointRounded)&&{jointRounded:this.jointRounded},...Ht(this.capRounded)&&{capRounded:this.capRounded},...Ht(this.miterLimit)&&{miterLimit:this.miterLimit},...Ht(this.billboard)&&{billboard:this.billboard},...Ht(this.getColor)&&{getColor:Ho(this.getColor,t)},...Ht(this.getWidth)&&{getWidth:Yo(this.getWidth,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new zx({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var RS=class extends Zs{static layerType=\"point-cloud\";sizeUnits;pointSize;getColor;getNormal;constructor(t,r){super(t,r),this.initRegularAttribute(\"size_units\",\"sizeUnits\"),this.initRegularAttribute(\"point_size\",\"pointSize\"),this.initVectorizedAccessor(\"get_color\",\"getColor\"),this.initVectorizedAccessor(\"get_normal\",\"getNormal\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],...Ht(this.sizeUnits)&&{sizeUnits:this.sizeUnits},...Ht(this.pointSize)&&{pointSize:this.pointSize},...Ht(this.getColor)&&{getColor:Ho(this.getColor,t)},...Ht(this.getNormal)&&{getNormal:this.getNormal.data[t]}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new mk({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var yCt='var Ie=Object.create;var ie=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Oe=(e,t,n,r)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let o of Ve(t))!Ze.call(e,o)&&o!==n&&ie(e,o,{get:()=>t[o],enumerable:!(r=Ae(t,o))||r.enumerable});return e};var Be=(e,t,n)=>(n=e!=null?Ie(We(e)):{},Oe(t||!e||!e.__esModule?ie(n,\"default\",{value:e,enumerable:!0}):n,e));var le=z((At,se)=>{\"use strict\";se.exports=e=>e?typeof Symbol.observable==\"symbol\"&&typeof e[Symbol.observable]==\"function\"?e===e[Symbol.observable]():typeof e[\"@@observable\"]==\"function\"?e===e[\"@@observable\"]():!1:!1});var ce=z(E=>{\"use strict\";Object.defineProperty(E,\"__esModule\",{value:!0});E.DefaultSerializer=E.extendSerializer=void 0;function $e(e,t){let n=e.deserialize.bind(e),r=e.serialize.bind(e);return{deserialize(o){return t.deserialize(o,n)},serialize(o){return t.serialize(o,r)}}}E.extendSerializer=$e;var ue={deserialize(e){return Object.assign(Error(e.message),{name:e.name,stack:e.stack})},serialize(e){return{__error_marker:\"$$error\",message:e.message,name:e.name,stack:e.stack}}},je=e=>e&&typeof e==\"object\"&&\"__error_marker\"in e&&e.__error_marker===\"$$error\";E.DefaultSerializer={deserialize(e){return je(e)?ue.deserialize(e):e},serialize(e){return e instanceof Error?ue.serialize(e):e}}});var J=z(D=>{\"use strict\";Object.defineProperty(D,\"__esModule\",{value:!0});D.serialize=D.deserialize=D.registerSerializer=void 0;var fe=ce(),$=fe.DefaultSerializer;function Fe(e){$=fe.extendSerializer($,e)}D.registerSerializer=Fe;function Re(e){return $.deserialize(e)}D.deserialize=Re;function He(e){return $.serialize(e)}D.serialize=He});var ae=z(S=>{\"use strict\";Object.defineProperty(S,\"__esModule\",{value:!0});S.$worker=S.$transferable=S.$terminate=S.$events=S.$errors=void 0;S.$errors=Symbol(\"thread.errors\");S.$events=Symbol(\"thread.events\");S.$terminate=Symbol(\"thread.terminate\");S.$transferable=Symbol(\"thread.transferable\");S.$worker=Symbol(\"thread.worker\")});var K=z(k=>{\"use strict\";Object.defineProperty(k,\"__esModule\",{value:!0});k.Transfer=k.isTransferDescriptor=void 0;var ge=ae();function Ge(e){return!(!e||typeof e!=\"object\")}function Ne(e){return e&&typeof e==\"object\"&&e[ge.$transferable]}k.isTransferDescriptor=Ne;function Je(e,t){if(!t){if(!Ge(e))throw Error();t=[e]}return{[ge.$transferable]:!0,send:e,transferables:t}}k.Transfer=Je});var ye=z(w=>{\"use strict\";Object.defineProperty(w,\"__esModule\",{value:!0});w.WorkerMessageType=w.MasterMessageType=void 0;var Ke;(function(e){e.cancel=\"cancel\",e.run=\"run\"})(Ke=w.MasterMessageType||(w.MasterMessageType={}));var Ue;(function(e){e.error=\"error\",e.init=\"init\",e.result=\"result\",e.running=\"running\",e.uncaughtError=\"uncaughtError\"})(Ue=w.WorkerMessageType||(w.WorkerMessageType={}))});var pe=z(U=>{\"use strict\";Object.defineProperty(U,\"__esModule\",{value:!0});var qe=function(){let t=typeof self<\"u\"&&typeof Window<\"u\"&&self instanceof Window;return!!(typeof self<\"u\"&&self.postMessage&&!t)},Qe=function(t,n){self.postMessage(t,n)},Xe=function(t){let n=o=>{t(o.data)},r=()=>{self.removeEventListener(\"message\",n)};return self.addEventListener(\"message\",n),r};U.default={isWorkerRuntime:qe,postMessageToMaster:Qe,subscribeToMasterMessages:Xe}});var ve=z(M=>{\"use strict\";var Ye=M&&M.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function l(f){try{u(r.next(f))}catch(a){i(a)}}function c(f){try{u(r.throw(f))}catch(a){i(a)}}function u(f){f.done?s(f.value):o(f.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Pe=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(M,\"__esModule\",{value:!0});M.expose=M.isWorkerRuntime=M.Transfer=M.registerSerializer=void 0;var et=Pe(le()),C=J(),tt=K(),L=ye(),v=Pe(pe()),nt=J();Object.defineProperty(M,\"registerSerializer\",{enumerable:!0,get:function(){return nt.registerSerializer}});var rt=K();Object.defineProperty(M,\"Transfer\",{enumerable:!0,get:function(){return rt.Transfer}});M.isWorkerRuntime=v.default.isWorkerRuntime;var de=!1,A=new Map,ot=e=>e&&e.type===L.MasterMessageType.cancel,xe=e=>e&&e.type===L.MasterMessageType.run,he=e=>et.default(e)||it(e);function it(e){return e&&typeof e==\"object\"&&typeof e.subscribe==\"function\"}function Me(e){return tt.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function st(){let e={type:L.WorkerMessageType.init,exposed:{type:\"function\"}};v.default.postMessageToMaster(e)}function lt(e){let t={type:L.WorkerMessageType.init,exposed:{type:\"module\",methods:e}};v.default.postMessageToMaster(t)}function q(e,t){let{payload:n,transferables:r}=Me(t),o={type:L.WorkerMessageType.error,uid:e,error:C.serialize(n)};v.default.postMessageToMaster(o,r)}function Q(e,t,n){let{payload:r,transferables:o}=Me(n),s={type:L.WorkerMessageType.result,uid:e,complete:t?!0:void 0,payload:r};v.default.postMessageToMaster(s,o)}function ut(e,t){let n={type:L.WorkerMessageType.running,uid:e,resultType:t};v.default.postMessageToMaster(n)}function j(e){try{let t={type:L.WorkerMessageType.uncaughtError,error:C.serialize(e)};v.default.postMessageToMaster(t)}catch(t){console.error(`Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\\nLatest error:`,t,`\\nOriginal error:`,e)}}function me(e,t,n){return Ye(this,void 0,void 0,function*(){let r;try{r=t(...n)}catch(s){return q(e,s)}let o=he(r)?\"observable\":\"promise\";if(ut(e,o),he(r)){let s=r.subscribe(i=>Q(e,!1,C.serialize(i)),i=>{q(e,C.serialize(i)),A.delete(e)},()=>{Q(e,!0),A.delete(e)});A.set(e,s)}else try{let s=yield r;Q(e,!0,C.serialize(s))}catch(s){q(e,C.serialize(s))}})}function ct(e){if(!v.default.isWorkerRuntime())throw Error(\"expose() called in the master thread.\");if(de)throw Error(\"expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.\");if(de=!0,typeof e==\"function\")v.default.subscribeToMasterMessages(t=>{xe(t)&&!t.method&&me(t.uid,e,t.args.map(C.deserialize))}),st();else if(typeof e==\"object\"&&e){v.default.subscribeToMasterMessages(n=>{xe(n)&&n.method&&me(n.uid,e[n.method],n.args.map(C.deserialize))});let t=Object.keys(e).filter(n=>typeof e[n]==\"function\");lt(t)}else throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);v.default.subscribeToMasterMessages(t=>{if(ot(t)){let n=t.uid,r=A.get(n);r&&(r.unsubscribe(),A.delete(n))}})}M.expose=ct;typeof self<\"u\"&&typeof self.addEventListener==\"function\"&&v.default.isWorkerRuntime()&&(self.addEventListener(\"error\",e=>{setTimeout(()=>j(e.error||e),250)}),self.addEventListener(\"unhandledrejection\",e=>{let t=e.reason;t&&typeof t.message==\"string\"&&setTimeout(()=>j(t),250)}));typeof process<\"u\"&&typeof process.on==\"function\"&&v.default.isWorkerRuntime()&&(process.on(\"uncaughtException\",e=>{setTimeout(()=>j(e),250)}),process.on(\"unhandledRejection\",e=>{e&&typeof e.message==\"string\"&&setTimeout(()=>j(e),250)}))});var F=Be(ve(),1),Se=F.default.expose,Ft=F.default.registerSerializer,be=F.default.Transfer;function T(e){\"@babel/helpers - typeof\";return T=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(t){return typeof t}:function(t){return t&&typeof Symbol==\"function\"&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},T(e)}function X(e,t){if(T(e)!=\"object\"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||\"default\");if(T(r)!=\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(t===\"string\"?String:Number)(e)}function Y(e){var t=X(e,\"string\");return T(t)==\"symbol\"?t:String(t)}function b(e,t,n){return t=Y(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V={x:0,y:1,z:2};function R(e,t={}){let{start:n=0,end:r=e.length,plane:o=\"xy\"}=t,s=t.size||2,i=0,l=V[o[0]],c=V[o[1]];for(let u=n,f=r-s;u<r;u+=s)i+=(e[u+l]-e[f+l])*(e[u+c]+e[f+c]),f=u;return i/2}function te(e,t,n=2,r,o=\"xy\"){let s=t&&t.length,i=s?t[0]*n:e.length,l=De(e,0,i,n,!0,r&&r[0],o),c=[];if(!l||l.next===l.prev)return c;let u,f,a,p,m,d,P;if(s&&(l=xt(e,t,l,n,r,o)),e.length>80*n){p=f=e[0],m=a=e[1];for(let h=n;h<i;h+=n)d=e[h],P=e[h+1],d<p&&(p=d),P<m&&(m=P),d>f&&(f=d),P>a&&(a=P);u=Math.max(f-p,a-m),u=u!==0?32767/u:0}return W(l,c,n,p,m,u,0),c}function De(e,t,n,r,o,s,i){let l,c;s===void 0&&(s=R(e,{start:t,end:n,size:r,plane:i}));let u=V[i[0]],f=V[i[1]];if(o===s<0)for(l=t;l<n;l+=r)c=ze(l,e[l+u],e[l+f],c);else for(l=n-r;l>=t;l-=r)c=ze(l,e[l+u],e[l+f],c);return c&&N(c,c.next)&&(O(c),c=c.next),c}function _(e,t){if(!e)return e;t||(t=e);let n=e,r;do if(r=!1,!n.steiner&&(N(n,n.next)||x(n.prev,n,n.next)===0)){if(O(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function W(e,t,n,r,o,s,i){if(!e)return;!i&&s&&vt(e,r,o,s);let l=e,c,u;for(;e.prev!==e.next;){if(c=e.prev,u=e.next,s?yt(e,r,o,s):gt(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),O(e),e=u.next,l=u.next;continue}if(e=u,e===l){i?i===1?(e=pt(_(e),t,n),W(e,t,n,r,o,s,2)):i===2&&dt(e,t,n,r,o,s):W(_(e),t,n,r,o,s,1);break}}}function gt(e){let t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;let o=t.x,s=n.x,i=r.x,l=t.y,c=n.y,u=r.y,f=o<s?o<i?o:i:s<i?s:i,a=l<c?l<u?l:u:c<u?c:u,p=o>s?o>i?o:i:s>i?s:i,m=l>c?l>u?l:u:c>u?c:u,d=r.next;for(;d!==t;){if(d.x>=f&&d.x<=p&&d.y>=a&&d.y<=m&&I(o,l,s,c,i,u,d.x,d.y)&&x(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function yt(e,t,n,r){let o=e.prev,s=e,i=e.next;if(x(o,s,i)>=0)return!1;let l=o.x,c=s.x,u=i.x,f=o.y,a=s.y,p=i.y,m=l<c?l<u?l:u:c<u?c:u,d=f<a?f<p?f:p:a<p?a:p,P=l>c?l>u?l:u:c>u?c:u,h=f>a?f>p?f:p:a>p?a:p,re=ee(m,d,t,n,r),oe=ee(P,h,t,n,r),g=e.prevZ,y=e.nextZ;for(;g&&g.z>=re&&y&&y.z<=oe;){if(g.x>=m&&g.x<=P&&g.y>=d&&g.y<=h&&g!==o&&g!==i&&I(l,f,c,a,u,p,g.x,g.y)&&x(g.prev,g,g.next)>=0||(g=g.prevZ,y.x>=m&&y.x<=P&&y.y>=d&&y.y<=h&&y!==o&&y!==i&&I(l,f,c,a,u,p,y.x,y.y)&&x(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;g&&g.z>=re;){if(g.x>=m&&g.x<=P&&g.y>=d&&g.y<=h&&g!==o&&g!==i&&I(l,f,c,a,u,p,g.x,g.y)&&x(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;y&&y.z<=oe;){if(y.x>=m&&y.x<=P&&y.y>=d&&y.y<=h&&y!==o&&y!==i&&I(l,f,c,a,u,p,y.x,y.y)&&x(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function pt(e,t,n){let r=e;do{let o=r.prev,s=r.next.next;!N(o,s)&&we(o,r,r.next,s)&&Z(o,s)&&Z(s,o)&&(t.push(o.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),O(r),O(r.next),r=e=s),r=r.next}while(r!==e);return _(r)}function dt(e,t,n,r,o,s){let i=e;do{let l=i.next.next;for(;l!==i.prev;){if(i.i!==l.i&&zt(i,l)){let c=Ce(i,l);i=_(i,i.next),c=_(c,c.next),W(i,t,n,r,o,s,0),W(c,t,n,r,o,s,0);return}l=l.next}i=i.next}while(i!==e)}function xt(e,t,n,r,o,s){let i=[],l,c,u,f,a;for(l=0,c=t.length;l<c;l++)u=t[l]*r,f=l<c-1?t[l+1]*r:e.length,a=De(e,u,f,r,!1,o&&o[l+1],s),a===a.next&&(a.steiner=!0),i.push(bt(a));for(i.sort(ht),l=0;l<i.length;l++)n=mt(i[l],n);return n}function ht(e,t){return e.x-t.x}function mt(e,t){let n=Pt(e,t);if(!n)return t;let r=Ce(n,e);return _(r,r.next),_(n,n.next)}function Pt(e,t){let n=t,r=e.x,o=e.y,s=-1/0,i;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let p=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(p<=r&&p>s&&(s=p,i=n.x<n.next.x?n:n.next,p===r))return i}n=n.next}while(n!==t);if(!i)return null;let l=i,c=i.x,u=i.y,f=1/0,a;n=i;do r>=n.x&&n.x>=c&&r!==n.x&&I(o<u?r:s,o,c,u,o<u?s:r,o,n.x,n.y)&&(a=Math.abs(o-n.y)/(r-n.x),Z(n,e)&&(a<f||a===f&&(n.x>i.x||n.x===i.x&&Mt(i,n)))&&(i=n,f=a)),n=n.next;while(n!==l);return i}function Mt(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function vt(e,t,n,r){let o=e;do o.z===0&&(o.z=ee(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,St(o)}function St(e){let t,n,r=1,o,s,i,l,c,u;do{for(s=e,e=null,u=null,o=0;s;){for(o++,l=s,i=0,n=0;n<r&&(i++,l=l.nextZ,!!l);n++);for(c=r;i>0||c>0&&l;)i!==0&&(c===0||!l||s.z<=l.z)?(t=s,s=s.nextZ,i--):(t=l,l=l.nextZ,c--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;s=l}u.nextZ=null,r*=2}while(o>1);return e}function ee(e,t,n,r,o){return e=(e-n)*o|0,t=(t-r)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function bt(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function I(e,t,n,r,o,s,i,l){return(o-i)*(t-l)>=(e-i)*(s-l)&&(e-i)*(r-l)>=(n-i)*(t-l)&&(n-i)*(s-l)>=(o-i)*(r-l)}function zt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Dt(e,t)&&(Z(e,t)&&Z(t,e)&&wt(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||N(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function N(e,t){return e.x===t.x&&e.y===t.y}function we(e,t,n,r){let o=G(x(e,t,n)),s=G(x(e,t,r)),i=G(x(n,r,e)),l=G(x(n,r,t));return!!(o!==s&&i!==l||o===0&&H(e,n,t)||s===0&&H(e,r,t)||i===0&&H(n,e,r)||l===0&&H(n,t,r))}function H(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function G(e){return e>0?1:e<0?-1:0}function Dt(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&we(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Z(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function wt(e,t){let n=e,r=!1,o=(e.x+t.x)/2,s=(e.y+t.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&o<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function Ce(e,t){let n=new B(e.i,e.x,e.y),r=new B(t.i,t.x,t.y),o=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function ze(e,t,n,r){let o=new B(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var B=class{constructor(t,n,r){b(this,\"i\",void 0),b(this,\"x\",void 0),b(this,\"y\",void 0),b(this,\"prev\",null),b(this,\"next\",null),b(this,\"z\",0),b(this,\"prevZ\",null),b(this,\"nextZ\",null),b(this,\"steiner\",!1),this.i=t,this.x=n,this.y=r}};function _e(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function Ee(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function ke(e){return\"data\"in e?e.getChildAt(0):e.children[0]}function ne(e){if(\"data\"in e)return e.data.map(s=>ne(s));let t=[],n=0;for(let s=0;s<e.length;s++){let i=Et(e,s);t.push(i),n+=i.length}let r=new Uint32Array(n),o=0;for(let s of t)for(let i of s)r[o]=i,o+=1;return r}function Et(e,t){let n=e.valueOffsets,r=ke(e),o=r.valueOffsets,s=Ee(r),i=s.type.listSize,l=_e(s),c=n[t],u=n[t+1],f=o[c],a=o[u],p=l.values.subarray(f*i,a*i),m=o[c],d=[];for(let h=c+1;h<u;h++)d.push(o[h]-m);let P=te(p,d,i);for(let h=0;h<P.length;h++)P[h]+=m;return P}function kt(e){let t=ne(e);return be(t,[t.buffer])}Se(kt);\\n';var epe=8;function rpe(e){return IU(()=>PU(CU.fromText(yCt)),e)}var Hrt=rpe(epe);var DS=class extends Zs{static layerType=\"solid-polygon\";filled;extruded;wireframe;elevationScale;getElevation;getFillColor;getLineColor;constructor(t,r){super(t,r),this.initRegularAttribute(\"filled\",\"filled\"),this.initRegularAttribute(\"extruded\",\"extruded\"),this.initRegularAttribute(\"wireframe\",\"wireframe\"),this.initRegularAttribute(\"elevation_scale\",\"elevationScale\"),this.initVectorizedAccessor(\"get_elevation\",\"getElevation\"),this.initVectorizedAccessor(\"get_fill_color\",\"getFillColor\"),this.initVectorizedAccessor(\"get_line_color\",\"getLineColor\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],earcutWorkerPool:Hrt,...Ht(this.filled)&&{filled:this.filled},...Ht(this.extruded)&&{extruded:this.extruded},...Ht(this.wireframe)&&{wireframe:this.wireframe},...Ht(this.elevationScale)&&{elevationScale:this.elevationScale},...Ht(this.getElevation)&&{getElevation:Yo(this.getElevation,t)},...Ht(this.getFillColor)&&{getFillColor:Ho(this.getFillColor,t)},...Ht(this.getLineColor)&&{getLineColor:Ho(this.getLineColor,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new Gx({...this.baseLayerProps(r),...this.layerProps(r)}));return t}},Wx=class extends Zs{stroked;filled;extruded;wireframe;elevationScale;lineWidthUnits;lineWidthScale;lineWidthMinPixels;lineWidthMaxPixels;lineJointRounded;lineMiterLimit;getFillColor;getLineColor;getLineWidth;getElevation;constructor(t,r){super(t,r),this.initRegularAttribute(\"stroked\",\"stroked\"),this.initRegularAttribute(\"filled\",\"filled\"),this.initRegularAttribute(\"extruded\",\"extruded\"),this.initRegularAttribute(\"wireframe\",\"wireframe\"),this.initRegularAttribute(\"elevation_scale\",\"elevationScale\"),this.initRegularAttribute(\"line_width_units\",\"lineWidthUnits\"),this.initRegularAttribute(\"line_width_scale\",\"lineWidthScale\"),this.initRegularAttribute(\"line_width_min_pixels\",\"lineWidthMinPixels\"),this.initRegularAttribute(\"line_width_max_pixels\",\"lineWidthMaxPixels\"),this.initRegularAttribute(\"line_joint_rounded\",\"lineJointRounded\"),this.initRegularAttribute(\"line_miter_limit\",\"lineMiterLimit\"),this.initVectorizedAccessor(\"get_fill_color\",\"getFillColor\"),this.initVectorizedAccessor(\"get_line_color\",\"getLineColor\"),this.initVectorizedAccessor(\"get_line_width\",\"getLineWidth\"),this.initVectorizedAccessor(\"get_elevation\",\"getElevation\")}basePolygonLayerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],earcutWorkerPool:Hrt,...Ht(this.stroked)&&{stroked:this.stroked},...Ht(this.filled)&&{filled:this.filled},...Ht(this.extruded)&&{extruded:this.extruded},...Ht(this.wireframe)&&{wireframe:this.wireframe},...Ht(this.elevationScale)&&{elevationScale:this.elevationScale},...Ht(this.lineWidthUnits)&&{lineWidthUnits:this.lineWidthUnits},...Ht(this.lineWidthScale)&&{lineWidthScale:this.lineWidthScale},...Ht(this.lineWidthMinPixels)&&{lineWidthMinPixels:this.lineWidthMinPixels},...Ht(this.lineWidthMaxPixels)&&{lineWidthMaxPixels:this.lineWidthMaxPixels},...Ht(this.lineJointRounded)&&{lineJointRounded:this.lineJointRounded},...Ht(this.lineMiterLimit)&&{lineMiterLimit:this.lineMiterLimit},...Ht(this.getFillColor)&&{getFillColor:Ho(this.getFillColor,t)},...Ht(this.getLineColor)&&{getLineColor:Ho(this.getLineColor,t)},...Ht(this.getLineWidth)&&{getLineWidth:Yo(this.getLineWidth,t)},...Ht(this.getElevation)&&{getElevation:Yo(this.getElevation,t)}}}},OS=class extends Wx{static layerType=\"polygon\";layerProps(t){return this.basePolygonLayerProps(t)}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new Ik({...this.baseLayerProps(r),...this.layerProps(r)}));return t}},LS=class extends Wx{static layerType=\"h3-hexagon\";highPrecision;coverage;getHexagon;constructor(t,r){super(t,r),this.initRegularAttribute(\"high_precision\",\"highPrecision\"),this.initRegularAttribute(\"coverage\",\"coverage\"),this.initVectorizedAccessor(\"get_hexagon\",\"getHexagon\")}layerProps(t){return{getHexagon:this.getHexagon.data[t],...Ht(this.highPrecision)&&{highPrecision:this.highPrecision},...Ht(this.coverage)&&{coverage:this.coverage},...this.basePolygonLayerProps(t)}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new dk({...this.baseLayerProps(),...this.layerProps(r)}));return t}},BS=class extends Wx{static layerType=\"a5\";getPentagon;constructor(t,r){super(t,r),this.initVectorizedAccessor(\"get_pentagon\",\"getPentagon\")}layerProps(t){return{getPentagon:this.getPentagon.data[t],...this.basePolygonLayerProps(t)}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new lk({...this.baseLayerProps(),...this.layerProps(r)}));return t}},Lk=class extends Wx{static layerType=\"geohash\";getGeohash;constructor(t,r){super(t,r),this.initVectorizedAccessor(\"get_geohash\",\"getGeohash\")}layerProps(t){return{getGeohash:this.getGeohash.data[t],...this.basePolygonLayerProps(t)}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new hk({...this.baseLayerProps(),...this.layerProps(r)}));return t}},Bk=class extends Wx{static layerType=\"s2\";getS2Token;constructor(t,r){super(t,r),this.initVectorizedAccessor(\"get_s2_token\",\"getS2Token\")}layerProps(t){return{getS2Token:this.getS2Token.data[t],...this.basePolygonLayerProps(t)}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new kk({...this.baseLayerProps(),...this.layerProps(r)}));return t}};function xp([e,t,r,i,n,o],s,a){return[e*s+t*a+r,i*s+n*a+o]}function _Ct([e,t,r,i,n,o]){let s=e*n-t*i;if(s===0)throw new Error(\"Cannot invert degenerate transform\");let a=1/s,h=n*a,p=-t*a,g=-i*a,w=e*a;return[h,p,-r*h-o*p,g,w,-r*g-o*w]}var ipe=[[.3333333333333333,.3333333333333333,.3333333333333333],[.5,.5,0],[.5,0,.5],[0,.5,.5]],npe=.125,Fk=class{reprojectors;width;height;uvs;exactOutputPositions;triangles;_halfedges;_candidatesUV;_queueIndices;_queue;_errors;_pending;_pendingLen;constructor(t,r,i=r){this.reprojectors=t,this.width=r,this.height=i,this.uvs=[],this.exactOutputPositions=[],this.triangles=[],this._halfedges=[],this._candidatesUV=[],this._queueIndices=[],this._queue=[],this._errors=[],this._pending=[],this._pendingLen=0;let n=1,o=1,s=this._addPoint(0,0),a=this._addPoint(n,0),h=this._addPoint(0,o),p=this._addPoint(n,o),g=this._addTriangle(p,s,h,-1,-1,-1);this._addTriangle(s,p,a,g,-1,-1),this._flush()}run(t=npe,{maxIterations:r=1e4}={}){if(t<=0)throw new Error(\"maxError must be positive\");let i=0;for(;this.getMaxError()>t;)if(this.refine(),++i>r){console.warn(`RasterReprojector: mesh refinement did not converge after ${i} iterations (maxError=${t}, currentError=${this.getMaxError()})`);break}}refine(){this._step(),this._flush()}getMaxError(){return this._errors[0]}_flush(){for(let t=0;t<this._pendingLen;t++){let r=this._pending[t];this._findReprojectionCandidate(r)}this._pendingLen=0}_findReprojectionCandidate(t){let r=2*this.triangles[t*3+0],i=2*this.triangles[t*3+1],n=2*this.triangles[t*3+2],o=this.uvs[r],s=this.uvs[r+1],a=this.uvs[i],h=this.uvs[i+1],p=this.uvs[n],g=this.uvs[n+1],w=this.exactOutputPositions[r],C=this.exactOutputPositions[r+1],R=this.exactOutputPositions[i],z=this.exactOutputPositions[i+1],W=this.exactOutputPositions[n],Y=this.exactOutputPositions[n+1],H=0,Q=0,tt=0;for(let rt of ipe){let at=kU(o,a,p,rt[0],rt[1],rt[2]),et=kU(s,h,g,rt[0],rt[1],rt[2]),lt=kU(w,R,W,rt[0],rt[1],rt[2]),J=kU(C,z,Y,rt[0],rt[1],rt[2]),ft=at*(this.width-1),dt=et*(this.height-1),Mt=this.reprojectors.inverseReproject(lt,J),Ft=this.reprojectors.inverseTransform(Mt[0],Mt[1]),Nt=ft-Ft[0],$t=dt-Ft[1],Yt=Math.hypot(Nt,$t);Yt>H&&(H=Yt,Q=at,tt=et)}(Q===o&&tt===s||Q===a&&tt===h||Q===p&&tt===g)&&(H=0),this._candidatesUV[2*t]=Q,this._candidatesUV[2*t+1]=tt,this._queuePush(t,H)}_step(){let t=this._queuePop(),r=t*3+0,i=t*3+1,n=t*3+2,o=this.triangles[r],s=this.triangles[i],a=this.triangles[n],h=this.uvs[2*o],p=this.uvs[2*o+1],g=this.uvs[2*s],w=this.uvs[2*s+1],C=this.uvs[2*a],R=this.uvs[2*a+1],z=this._candidatesUV[2*t],W=this._candidatesUV[2*t+1],Y=this._addPoint(z,W);if(Yrt(h,p,g,w,z,W)===0)this._handleCollinear(Y,r);else if(Yrt(g,w,C,R,z,W)===0)this._handleCollinear(Y,i);else if(Yrt(C,R,h,p,z,W)===0)this._handleCollinear(Y,n);else{let H=this._halfedges[r],Q=this._halfedges[i],tt=this._halfedges[n],rt=this._addTriangle(o,s,Y,H,-1,-1,r),at=this._addTriangle(s,a,Y,Q,-1,rt+1),et=this._addTriangle(a,o,Y,tt,rt+2,at+1);this._legalize(rt),this._legalize(at),this._legalize(et)}}_addPoint(t,r){let i=this.uvs.length>>1;this.uvs.push(t,r);let n=t*(this.width-1),o=r*(this.height-1),s=this.reprojectors.forwardTransform(n,o),a=this.reprojectors.forwardReproject(s[0],s[1]);return this.exactOutputPositions.push(a[0],a[1]),i}_addTriangle(t,r,i,n,o,s,a=this.triangles.length){let h=a/3;return this.triangles[a+0]=t,this.triangles[a+1]=r,this.triangles[a+2]=i,this._halfedges[a+0]=n,this._halfedges[a+1]=o,this._halfedges[a+2]=s,n>=0&&(this._halfedges[n]=a+0),o>=0&&(this._halfedges[o]=a+1),s>=0&&(this._halfedges[s]=a+2),this._candidatesUV[2*h+0]=0,this._candidatesUV[2*h+1]=0,this._queueIndices[h]=-1,this._pending[this._pendingLen++]=h,a}_legalize(t){let r=this._halfedges[t];if(r<0)return;let i=t-t%3,n=r-r%3,o=i+(t+1)%3,s=i+(t+2)%3,a=n+(r+2)%3,h=n+(r+1)%3,p=this.triangles[s],g=this.triangles[t],w=this.triangles[o],C=this.triangles[a],R=this.uvs;if(!ope(R[2*p],R[2*p+1],R[2*g],R[2*g+1],R[2*w],R[2*w+1],R[2*C],R[2*C+1]))return;let z=this._halfedges[o],W=this._halfedges[s],Y=this._halfedges[a],H=this._halfedges[h];this._queueRemove(i/3),this._queueRemove(n/3);let Q=this._addTriangle(p,C,w,-1,Y,z,i),tt=this._addTriangle(C,p,g,Q,W,H,n);this._legalize(Q+1),this._legalize(tt+2)}_handleCollinear(t,r){let i=r-r%3,n=i+(r+1)%3,o=i+(r+2)%3,s=this.triangles[o],a=this.triangles[r],h=this.triangles[n],p=this._halfedges[n],g=this._halfedges[o],w=this._halfedges[r];if(w<0){let et=this._addTriangle(t,s,a,-1,g,-1,i),lt=this._addTriangle(s,t,h,et,-1,p);this._legalize(et+1),this._legalize(lt+2);return}let C=w-w%3,R=C+(w+2)%3,z=C+(w+1)%3,W=this.triangles[R],Y=this._halfedges[R],H=this._halfedges[z];this._queueRemove(C/3);let Q=this._addTriangle(s,a,t,g,-1,-1,i),tt=this._addTriangle(a,W,t,H,-1,Q+1,C),rt=this._addTriangle(W,h,t,Y,-1,tt+1),at=this._addTriangle(h,s,t,p,Q+2,rt+1);this._legalize(Q),this._legalize(tt),this._legalize(rt),this._legalize(at)}_queuePush(t,r){let i=this._queue.length;this._queueIndices[t]=i,this._queue.push(t),this._errors.push(r),this._queueUp(i)}_queuePop(){let t=this._queue.length-1;return this._queueSwap(0,t),this._queueDown(0,t),this._queuePopBack()}_queuePopBack(){let t=this._queue.pop();return this._errors.pop(),this._queueIndices[t]=-1,t}_queueRemove(t){let r=this._queueIndices[t];if(r<0){let n=this._pending.indexOf(t);if(n!==-1)this._pending[n]=this._pending[--this._pendingLen];else throw new Error(\"Broken triangulation (something went wrong).\");return}let i=this._queue.length-1;i!==r&&(this._queueSwap(r,i),this._queueDown(r,i)||this._queueUp(r)),this._queuePopBack()}_queueLess(t,r){return this._errors[t]>this._errors[r]}_queueSwap(t,r){let i=this._queue[t],n=this._queue[r];this._queue[t]=n,this._queue[r]=i,this._queueIndices[i]=r,this._queueIndices[n]=t;let o=this._errors[t];this._errors[t]=this._errors[r],this._errors[r]=o}_queueUp(t){let r=t;for(;;){let i=r-1>>1;if(i===r||!this._queueLess(r,i))break;this._queueSwap(i,r),r=i}}_queueDown(t,r){let i=t;for(;;){let n=2*i+1;if(n>=r||n<0)break;let o=n+1,s=n;if(o<r&&this._queueLess(o,n)&&(s=o),!this._queueLess(s,i))break;this._queueSwap(i,s),i=s}return i>t}};function Yrt(e,t,r,i,n,o){return(r-n)*(t-o)-(i-o)*(e-n)}function ope(e,t,r,i,n,o,s,a){let h=e-s,p=t-a,g=r-s,w=i-a,C=n-s,R=o-a,z=h*h+p*p,W=g*g+w*w,Y=C*C+R*R;return h*(w*Y-W*R)-p*(g*Y-W*C)+z*(g*R-w*C)<0}function kU(e,t,r,i,n,o){return i*e+n*t+o*r}var vCt={name:\"create-texture-unorm\",inject:{\"fs:#decl\":\"uniform sampler2D textureName;\",\"fs:DECKGL_FILTER_COLOR\":`\n      color = texture(textureName, geometry.uv);\n    `},getUniforms:e=>({textureName:e.textureName})};var bCt=`#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (simpleMesh.flatShading) {\n\n  normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n  } else {\n    normal = normals_commonspace;\n  }\n\n  // We initialize color here before passing into DECKGL_FILTER_COLOR\n  vec4 color;\n  DECKGL_FILTER_COLOR(color, geometry);\n\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * layer.opacity);\n}\n`;var spe={...tS.defaultProps,image:{type:\"image\",value:null,async:!0},renderPipeline:{type:\"array\",value:[],compare:!0}},RU=class extends tS{static layerName=\"mesh-texture-layer\";static defaultProps=spe;_resolveRenderPipeline(){let{image:t,renderPipeline:r}=this.props;return[...t?[{module:vCt,props:{textureName:t}}]:[],...r??[]]}getShaders(){let t=super.getShaders(),r=t.modules;for(let i of this._resolveRenderPipeline())r.push(i.module);return{...t,fs:bCt,modules:r}}draw(t){let r={};for(let i of this._resolveRenderPipeline())r[i.module.name]=i.props||{};for(let i of super.getModels())i.shaderInputs.setProps(r);super.draw(t)}};var ape=.125,xCt=[[252,73,163],[255,51,204],[204,102,255],[153,51,255],[102,204,255],[51,153,255],[102,255,204],[51,255,170],[0,255,0],[51,204,51],[255,204,102],[255,179,71],[255,102,102],[255,80,80],[255,0,0],[204,0,0],[255,128,0],[255,153,51],[255,255,102],[255,255,51],[0,255,255],[0,204,255]],lpe={image:{type:\"image\",value:null,async:!0},renderPipeline:{type:\"array\",value:[],compare:!0},debug:!1,debugOpacity:.5},Nk=class extends bi{static layerName=\"RasterLayer\";static defaultProps=lpe;initializeState(){this.setState({})}updateState(t){super.updateState(t);let{props:r,oldProps:i,changeFlags:n}=t,o=r.reprojectionFns.forwardTransform!==i.reprojectionFns?.forwardTransform||r.reprojectionFns.inverseTransform!==i.reprojectionFns?.inverseTransform||r.reprojectionFns.forwardReproject!==i.reprojectionFns?.forwardReproject||r.reprojectionFns.inverseReproject!==i.reprojectionFns?.inverseReproject;(n.dataChanged||r.width!==i.width||r.height!==i.height||o||r.maxError!==i.maxError)&&this._generateMesh()}_generateMesh(){let{width:t,height:r,reprojectionFns:i,maxError:n=ape}=this.props,o=new Fk(i,t+1,r+1);o.run(n);let{indices:s,positions:a,texCoords:h}=cpe(o);this.setState({reprojector:o,mesh:{positions:a,indices:s,texCoords:h}})}renderDebugLayer(){let{reprojector:t}=this.state,{debugOpacity:r}=this.props;return t?new wh(this.getSubLayerProps({id:\"polygon\",data:{reprojector:t,length:t.triangles.length/3},getPolygon:(i,{index:n,data:o})=>{let s=o.reprojector.triangles,a=t.exactOutputPositions,h=s[n*3],p=s[n*3+1],g=s[n*3+2];return[[a[h*2],a[h*2+1]],[a[p*2],a[p*2+1]],[a[g*2],a[g*2+1]],[a[h*2],a[h*2+1]]]},getFillColor:(i,{index:n,target:o})=>{let s=xCt[n%xCt.length];return o[0]=s[0],o[1]=s[1],o[2]=s[2],o[3]=255,o},getLineColor:[0,0,0],getLineWidth:1,lineWidthUnits:\"pixels\",opacity:r!==void 0&&Number.isFinite(r)?Math.max(0,Math.min(1,r)):1,pickable:!1})):null}renderLayers(){let{mesh:t}=this.state,{debug:r,image:i,renderPipeline:n}=this.props;if(!t||!i&&(n?.length??0)===0)return null;let{indices:o,positions:s,texCoords:a}=t,p=[new RU(this.getSubLayerProps({id:\"raster\",image:i,renderPipeline:n,data:[1],mesh:{indices:{value:o,size:1},attributes:{POSITION:{value:s,size:3},TEXCOORD_0:{value:a,size:2}}},_instanced:!1,getPosition:[0,0,0],getColor:[255,255,255]}))];if(r){let g=this.renderDebugLayer();g&&p.push(g)}return p}};function cpe(e){let t=e.uvs.length/2,r=new Float32Array(t*3),i=new Float32Array(e.uvs);for(let o=0;o<t;o++)r[o*3]=e.exactOutputPositions[o*2],r[o*3+1]=e.exactOutputPositions[o*2+1],r[o*3+2]=0;return{indices:new Uint32Array(e.triangles),positions:r,texCoords:i}}function qx(e,t){let r=upe(e,t.row),[i,n]=e.pointOfOrigin,o=e.cornerOfOrigin===\"bottomLeft\"?1:-1,s=r*e.cellSize*e.tileWidth,a=e.cellSize*e.tileHeight;return[r*e.cellSize,0,i+t.col*s,0,o*e.cellSize,n+o*t.row*a]}function upe(e,t){if(!e.variableMatrixWidths)return 1;for(let r of e.variableMatrixWidths)if(t>=r.minTileRow&&t<=r.maxTileRow)return r.coalesce;return 1}function wCt(e){return\"tileMatrices\"in e}function Xrt(e,t){let r=dpe(e,t),{tileHeight:i,tileWidth:n}=r,{x:o,y:s}=t,a=qx(r,{col:o,row:s}),[h,p]=xp(a,0,0),[g,w]=xp(a,n,i);return r.cornerOfOrigin===\"bottomLeft\"?{lowerLeft:[h,p],upperRight:[g,w]}:{lowerLeft:[h,w],upperRight:[g,p]}}function dpe(e,t){if(wCt(e)){if(t.z===void 0)throw new Error(\"Tile z level is required when input is a TileMatrixSet\");let r=e.tileMatrices[t.z];if(!r)throw new Error(`Tile z level ${t.z} is out of bounds for TileMatrixSet with ${e.tileMatrices.length} levels.`);return r}else return e}function Zrt(e,t,r,i,n,o={}){let{densifyPts:s=21}=o,a=[t,i,i,t],h=[r,r,n,n],p=1/0,g=1/0,w=-1/0,C=-1/0;for(let R=0;R<4;R++){let z=a[R],W=h[R],Y=a[(R+1)%4],H=h[(R+1)%4];for(let Q=0;Q<=s;Q++){let tt=Q/(s+1),[rt,at]=e(z+(Y-z)*tt,W+(H-W)*tt);rt<p&&(p=rt),at<g&&(g=at),rt>w&&(w=rt),at>C&&(C=at)}}return[p,g,w,C]}var TCt=512,fpe=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],ppe=fpe.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Krt=6378137,Qrt=2*Math.PI*Krt,SCt=Qrt/2,MCt=85.05112877980659,mpe=28e-5,DU=class e{x;y;z;metadata;childVisible;selected;_children;projectTo3857;projectTo4326;_boundingVolume;constructor(t,r,i,{metadata:n,projectTo3857:o,projectTo4326:s}){this.x=t,this.y=r,this.z=i,this.metadata=n,this.projectTo3857=o,this.projectTo4326=s}get tileMatrix(){return this.metadata.tileMatrices[this.z]}get children(){if(!this._children){let t=this.metadata.tileMatrices.length-1;if(this.z>=t)return this._children=null,null;let r=this.tileMatrix,i=this.z+1,n=this.metadata.tileMatrices[i],o=Jrt(r,{x:this.x,y:this.y}),{minCol:s,maxCol:a,minRow:h,maxRow:p}=_pe(o,n),g=[],{metadata:w,projectTo3857:C,projectTo4326:R}=this;for(let z=h;z<=p;z++)for(let W=s;W<=a;W++)g.push(new e(W,z,i,{metadata:w,projectTo3857:C,projectTo4326:R}));this._children=g.length>0?g:null}return this._children}update(t){this.childVisible=!1,this.selected=!1;let{viewport:r,cullingVolume:i,elevationBounds:n,minZ:o,maxZ:s=this.metadata.tileMatrices.length-1,project:a,bounds:h}=t,{boundingVolume:p,commonSpaceBounds:g}=this.getBoundingVolume(n,a);if(h&&!this.insideBounds(h,g)||i.computeVisibility(p)<0)return!1;let C=this.children;if(!this.childVisible&&this.z>=o){let R=bpe(p,r.zoom);if(this.tileMatrix.scaleDenominator*mpe<=R||this.z>=s||C===null&&this.z>=o)return this.selected=!0,!0}if(C&&C.length>0){this.selected=!1;let R=!1;for(let z of C)z.update(t)&&(R=!0);return this.childVisible=R,R}return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds(t,r){let[i,n,o,s]=t,[a,h,p,g]=r;return a<o&&p>i&&h<s&&g>n}getBoundingVolume(t,r){let i=this._boundingVolume;if(i&&i.zRange[0]===t[0]&&i.zRange[1]===t[1])return i.result;r&&_r(!1,\"TODO: implement getBoundingVolume in Globe view\");let n=this._getGenericBoundingVolume(t);return this._boundingVolume={zRange:t,result:n},n}_getGenericBoundingVolume(t){let r=this.tileMatrix,[i,n]=t,o=Jrt(r,{x:this.x,y:this.y}),a=Ape(ppe,o,this.projectTo3857,this.projectTo4326).map(z=>ype(z)),h=[];for(let z of a)h.push([z[0],z[1],i]),i!==n&&h.push([z[0],z[1],n]);let p=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let[z,W]of a)z<p&&(p=z),W<g&&(g=W),z>w&&(w=z),W>C&&(C=W);let R=[p,g,w,C];return{boundingVolume:O8(h),commonSpaceBounds:R}}};function Jrt(e,{x:t,y:r}){let i=Xrt(e,{x:t,y:r});return[i.lowerLeft[0],i.lowerLeft[1],i.upperRight[0],i.upperRight[1]]}function gpe(e,t){return(r,i)=>{let[n,o]=e(r,i);if(Number.isFinite(n)&&Number.isFinite(o))return[n,o];let[s,a]=t(r,i),p=Math.max(-MCt,Math.min(MCt,a))*Math.PI/180,g=s*Math.PI*Krt/180,w=Math.log(Math.tan(Math.PI/4+p/2))*Krt;return[g,w]}}function Ape(e,t,r,i){let[n,o,s,a]=t,h=gpe(r,i),p=[];for(let[g,w]of e){let C=n+g*(s-n),R=o+w*(a-o);p.push(h(C,R))}return p}function ype([e,t]){let r=Math.max(-SCt,Math.min(SCt,t));return[(e/Qrt+.5)*TCt,(r/Qrt+.5)*TCt]}function _pe(e,t){let[r,i,n,o]=e,{tileWidth:s,tileHeight:a,cellSize:h,matrixWidth:p,matrixHeight:g,pointOfOrigin:w}=t,C=s*h,R=a*h,z=w[0],W=w[1],Y=Math.floor((r-z)/C),H=Math.floor((n-z)/C),Q=Math.floor((W-o)/R),tt=Math.floor((W-i)/R);return Y=Math.max(0,Math.min(p-1,Y)),H=Math.max(0,Math.min(p-1,H)),Q=Math.max(0,Math.min(g-1,Q)),tt=Math.max(0,Math.min(g-1,tt)),{minCol:Y,maxCol:H,minRow:Q,maxRow:tt}}function ECt(e,t){let{viewport:r,maxZ:i,zRange:n,wgs84Bounds:o}=t,s=r instanceof qf&&r.resolution?r.projectPosition:null,a=Object.values(r.getFrustumPlanes()).map(({normal:dt,distance:Mt})=>new yp(dt.clone().negate(),Mt)),h=new _p(a),p=r.distanceScales.unitsPerMeter[2],g=n&&n[0]*p||0,w=n&&n[1]*p||0,C=0,{lowerLeft:R,upperRight:z}=o,[W,Y]=R,[H,Q]=z,tt=vs([W,Y]),rt=vs([H,Q]),at=[tt[0],tt[1],rt[0],rt[1]],et=e.tileMatrices[0],lt=[];for(let dt=0;dt<et.matrixHeight;dt++)for(let Mt=0;Mt<et.matrixWidth;Mt++)lt.push(new DU(Mt,dt,0,{metadata:e,projectTo3857:t.projectTo3857,projectTo4326:t.projectTo4326}));let J={viewport:r,project:s,cullingVolume:h,elevationBounds:[g,w],minZ:C,maxZ:i,bounds:at};for(let dt of lt)dt.update(J);let ft=[];for(let dt of lt)dt.getSelected(ft);return ft}function vpe(e,t){return 40075016686e-3*Math.cos(e*Math.PI/180)/2**(t+8)}function bpe(e,t){let[r,i]=ic(e.center);return vpe(i,t)}var PCt={computeProjectedTileBounds:Jrt,RasterTileNode:DU};var FS=class extends d_{tms;wgs84Bounds;projectTo3857;projectTo4326;constructor(t,r,{projectTo4326:i,projectTo3857:n}){if(super(t),this.tms=r,this.projectTo3857=n,this.projectTo4326=i,!r.boundingBox)throw new Error(\"Bounding Box inference not yet implemented; should be provided on TileMatrixSet\");this.wgs84Bounds=xpe(r.boundingBox,i,{densifyPts:10})}getTileIndices(t){let r=this.tms.tileMatrices.length-1,i=typeof t.maxZoom==\"number\"?Math.min(t.maxZoom,r):r;return ECt(this.tms,{viewport:t.viewport,maxZ:i,zRange:t.zRange??null,wgs84Bounds:this.wgs84Bounds,projectTo3857:this.projectTo3857,projectTo4326:this.projectTo4326})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getParentIndex(t){if(t.z===0)return t;let r=this.tms.tileMatrices[t.z],i=this.tms.tileMatrices[t.z-1],n=i.cellSize*i.tileWidth,o=i.cellSize*i.tileHeight,s=r.cellSize*r.tileWidth,a=r.cellSize*r.tileHeight,h=n/s,p=o/a;return{x:Math.floor(t.x/h),y:Math.floor(t.y/p),z:t.z-1}}getTileZoom(t){return t.z}getTileMetadata(t){let{x:r,y:i,z:n}=t,{tileMatrices:o}=this.tms,s=o[n],{tileHeight:a,tileWidth:h}=s,p=qx(s,{col:r,row:i}),g=xp(p,0,0),w=xp(p,h,0),C=xp(p,0,a),R=xp(p,h,a),z={topLeft:g,topRight:w,bottomLeft:C,bottomRight:R},W=[Math.min(g[0],w[0],C[0],R[0]),Math.min(g[1],w[1],C[1],R[1]),Math.max(g[0],w[0],C[0],R[0]),Math.max(g[1],w[1],C[1],R[1])],[Y,H,Q,tt]=Zrt(this.projectTo4326,...W);return{bbox:{west:Y,south:H,east:Q,north:tt},projectedBbox:{left:W[0],bottom:W[1],right:W[2],top:W[3]},projectedCorners:z,tileWidth:h,tileHeight:a,tileMatrix:s}}};function xpe(e,t,{densifyPts:r}){let{lowerLeft:i,upperRight:n}=e,o=[i,[n[0],i[1]],n,[i[0],n[1]]],s=[];for(let w=0;w<o.length;w++){let C=o[w],R=o[(w+1)%o.length];for(let z=0;z<=r;z++){let W=z/(r+1);s.push([C[0]+(R[0]-C[0])*W,C[1]+(R[1]-C[1])*W])}}let a=1/0,h=1/0,p=-1/0,g=-1/0;for(let[w,C]of s){let[R,z]=t(w,C);R<a&&(a=R),z<h&&(h=z),R>p&&(p=R),z>g&&(g=z)}return{lowerLeft:[a,h],upperRight:[p,g]}}var txr={...PCt};function CCt(e){e(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),e(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),e(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\");for(var t=1;t<=60;++t)e(\"EPSG:\"+(32600+t),\"+proj=utm +zone=\"+t+\" +datum=WGS84 +units=m\"),e(\"EPSG:\"+(32700+t),\"+proj=utm +zone=\"+t+\" +south +datum=WGS84 +units=m\");e(\"EPSG:5041\",\"+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m\"),e(\"EPSG:5042\",\"+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m\"),e.WGS84=e[\"EPSG:4326\"],e[\"EPSG:3785\"]=e[\"EPSG:3857\"],e.GOOGLE=e[\"EPSG:3857\"],e[\"EPSG:900913\"]=e[\"EPSG:3857\"],e[\"EPSG:102113\"]=e[\"EPSG:3857\"]}var wp=1,Tp=2,CA=3,ICt=4,zk=5,tit=6378137,kCt=6356752314e-3,eit=.0066943799901413165,Hx=484813681109536e-20,Oe=Math.PI/2,RCt=.16666666666666666,DCt=.04722222222222222,OCt=.022156084656084655,Ge=1e-10,io=.017453292519943295,Fa=57.29577951308232,an=Math.PI/4,S_=Math.PI*2,us=3.14159265359;var zu={};zu.greenwich=0;zu.lisbon=-9.131906111111;zu.paris=2.337229166667;zu.bogota=-74.080916666667;zu.madrid=-3.687938888889;zu.rome=12.452333333333;zu.bern=7.439583333333;zu.jakarta=106.807719444444;zu.ferro=-17.666666666667;zu.brussels=4.367975;zu.stockholm=18.058277777778;zu.athens=23.7163375;zu.oslo=10.722916666667;var LCt=zu;var BCt={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},\"us-ft\":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},\"us-ch\":{to_meter:20.1168402336805},\"us-mi\":{to_meter:1609.34721869444},km:{to_meter:1e3},\"ind-ft\":{to_meter:.30479841},\"ind-yd\":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},\"ind-ch\":{to_meter:20.11669506},\"us-in\":{to_meter:.025400050800101},\"us-yd\":{to_meter:.914401828803658}};var FCt=/[\\s_\\-\\/\\(\\)]/g;function Uh(e,t){if(e[t])return e[t];for(var r=Object.keys(e),i=t.toLowerCase().replace(FCt,\"\"),n=-1,o,s;++n<r.length;)if(o=r[n],s=o.toLowerCase().replace(FCt,\"\"),s===i)return e[o]}function Uk(e){var t={},r=e.split(\"+\").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,h){var p=h.split(\"=\");return p.push(!0),a[p[0].toLowerCase()]=p[1],a},{}),i,n,o,s={proj:\"projName\",datum:\"datumCode\",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*io},lat_1:function(a){t.lat1=a*io},lat_2:function(a){t.lat2=a*io},lat_ts:function(a){t.lat_ts=a*io},lon_0:function(a){t.long0=a*io},lon_1:function(a){t.long1=a*io},lon_2:function(a){t.long2=a*io},alpha:function(a){t.alpha=parseFloat(a)*io},gamma:function(a){t.rectified_grid_angle=parseFloat(a)*io},lonc:function(a){t.longc=a*io},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r:function(a){t.a=t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(\",\").map(function(h){return parseFloat(h)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var h=Uh(BCt,a);h&&(t.to_meter=h.to_meter)},from_greenwich:function(a){t.from_greenwich=a*io},pm:function(a){var h=Uh(LCt,a);t.from_greenwich=(h||parseFloat(a))*io},nadgrids:function(a){a===\"@null\"?t.datumCode=\"none\":t.nadgrids=a},axis:function(a){var h=\"ewnsud\";a.length===3&&h.indexOf(a.substr(0,1))!==-1&&h.indexOf(a.substr(1,1))!==-1&&h.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0},over:function(){t.over=!0}};for(i in r)n=r[i],i in s?(o=s[i],typeof o==\"function\"?o(n):t[o]=n):t[i]=n;return typeof t.datumCode==\"string\"&&t.datumCode!==\"WGS84\"&&(t.datumCode=t.datumCode.toLowerCase()),t.projStr=e,t}var rit=class{static getId(t){let r=t.find(i=>Array.isArray(i)&&i[0]===\"ID\");return r&&r.length>=3?{authority:r[1],code:parseInt(r[2],10)}:null}static convertUnit(t,r=\"unit\"){if(!t||t.length<3)return{type:r,name:\"unknown\",conversion_factor:null};let i=t[1],n=parseFloat(t[2])||null,o=t.find(a=>Array.isArray(a)&&a[0]===\"ID\"),s=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:r,name:i,conversion_factor:n,id:s}}static convertAxis(t){let r=t[1]||\"Unknown\",i,n=r.match(/^\\((.)\\)$/);if(n){let p=n[1].toUpperCase();if(p===\"E\")i=\"east\";else if(p===\"N\")i=\"north\";else if(p===\"U\")i=\"up\";else if(t[2])i=t[2];else throw new Error(`Unknown axis abbreviation: ${p}`)}else i=t[2]||\"unknown\";let o=t.find(p=>Array.isArray(p)&&p[0]===\"ORDER\"),s=o?parseInt(o[1],10):null,a=t.find(p=>Array.isArray(p)&&(p[0]===\"LENGTHUNIT\"||p[0]===\"ANGLEUNIT\"||p[0]===\"SCALEUNIT\")),h=this.convertUnit(a);return{name:r,direction:i,unit:h,order:s}}static extractAxes(t){return t.filter(r=>Array.isArray(r)&&r[0]===\"AXIS\").map(r=>this.convertAxis(r)).sort((r,i)=>(r.order||0)-(i.order||0))}static convert(t,r={}){switch(t[0]){case\"PROJCRS\":r.type=\"ProjectedCRS\",r.name=t[1],r.base_crs=t.find(R=>Array.isArray(R)&&R[0]===\"BASEGEOGCRS\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"BASEGEOGCRS\")):null,r.conversion=t.find(R=>Array.isArray(R)&&R[0]===\"CONVERSION\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"CONVERSION\")):null;let i=t.find(R=>Array.isArray(R)&&R[0]===\"CS\");i&&(r.coordinate_system={type:i[1],axis:this.extractAxes(t)});let n=t.find(R=>Array.isArray(R)&&R[0]===\"LENGTHUNIT\");if(n){let R=this.convertUnit(n);r.coordinate_system.unit=R}r.id=this.getId(t);break;case\"BASEGEOGCRS\":case\"GEOGCRS\":case\"GEODCRS\":r.type=t[0]===\"GEODCRS\"?\"GeodeticCRS\":\"GeographicCRS\",r.name=t[1];let o=t.find(R=>Array.isArray(R)&&(R[0]===\"DATUM\"||R[0]===\"ENSEMBLE\"));if(o){let R=this.convert(o);o[0]===\"ENSEMBLE\"?r.datum_ensemble=R:r.datum=R;let z=t.find(W=>Array.isArray(W)&&W[0]===\"PRIMEM\");z&&z[1]!==\"Greenwich\"&&(R.prime_meridian={name:z[1],longitude:parseFloat(z[2])})}r.coordinate_system={type:\"ellipsoidal\",axis:this.extractAxes(t)},r.id=this.getId(t);break;case\"DATUM\":r.type=\"GeodeticReferenceFrame\",r.name=t[1],r.ellipsoid=t.find(R=>Array.isArray(R)&&R[0]===\"ELLIPSOID\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"ELLIPSOID\")):null;break;case\"ENSEMBLE\":r.type=\"DatumEnsemble\",r.name=t[1],r.members=t.filter(R=>Array.isArray(R)&&R[0]===\"MEMBER\").map(R=>({type:\"DatumEnsembleMember\",name:R[1],id:this.getId(R)}));let s=t.find(R=>Array.isArray(R)&&R[0]===\"ENSEMBLEACCURACY\");s&&(r.accuracy=parseFloat(s[1]));let a=t.find(R=>Array.isArray(R)&&R[0]===\"ELLIPSOID\");a&&(r.ellipsoid=this.convert(a)),r.id=this.getId(t);break;case\"ELLIPSOID\":r.type=\"Ellipsoid\",r.name=t[1],r.semi_major_axis=parseFloat(t[2]),r.inverse_flattening=parseFloat(t[3]);let h=t.find(R=>Array.isArray(R)&&R[0]===\"LENGTHUNIT\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"LENGTHUNIT\"),r):null;break;case\"CONVERSION\":r.type=\"Conversion\",r.name=t[1],r.method=t.find(R=>Array.isArray(R)&&R[0]===\"METHOD\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"METHOD\")):null,r.parameters=t.filter(R=>Array.isArray(R)&&R[0]===\"PARAMETER\").map(R=>this.convert(R));break;case\"METHOD\":r.type=\"Method\",r.name=t[1],r.id=this.getId(t);break;case\"PARAMETER\":r.type=\"Parameter\",r.name=t[1],r.value=parseFloat(t[2]),r.unit=this.convertUnit(t.find(R=>Array.isArray(R)&&(R[0]===\"LENGTHUNIT\"||R[0]===\"ANGLEUNIT\"||R[0]===\"SCALEUNIT\"))),r.id=this.getId(t);break;case\"BOUNDCRS\":r.type=\"BoundCRS\";let p=t.find(R=>Array.isArray(R)&&R[0]===\"SOURCECRS\");if(p){let R=p.find(z=>Array.isArray(z));r.source_crs=R?this.convert(R):null}let g=t.find(R=>Array.isArray(R)&&R[0]===\"TARGETCRS\");if(g){let R=g.find(z=>Array.isArray(z));r.target_crs=R?this.convert(R):null}let w=t.find(R=>Array.isArray(R)&&R[0]===\"ABRIDGEDTRANSFORMATION\");w?r.transformation=this.convert(w):r.transformation=null;break;case\"ABRIDGEDTRANSFORMATION\":if(r.type=\"Transformation\",r.name=t[1],r.method=t.find(R=>Array.isArray(R)&&R[0]===\"METHOD\")?this.convert(t.find(R=>Array.isArray(R)&&R[0]===\"METHOD\")):null,r.parameters=t.filter(R=>Array.isArray(R)&&(R[0]===\"PARAMETER\"||R[0]===\"PARAMETERFILE\")).map(R=>{if(R[0]===\"PARAMETER\")return this.convert(R);if(R[0]===\"PARAMETERFILE\")return{name:R[1],value:R[2],id:{authority:\"EPSG\",code:8656}}}),r.parameters.length===7){let R=r.parameters[6];R.name===\"Scale difference\"&&(R.value=Math.round((R.value-1)*1e12)/1e6)}r.id=this.getId(t);break;case\"AXIS\":r.coordinate_system||(r.coordinate_system={type:\"unspecified\",axis:[]}),r.coordinate_system.axis.push(this.convertAxis(t));break;case\"LENGTHUNIT\":let C=this.convertUnit(t,\"LinearUnit\");r.coordinate_system&&r.coordinate_system.axis&&r.coordinate_system.axis.forEach(R=>{R.unit||(R.unit=C)}),C.conversion_factor&&C.conversion_factor!==1&&r.semi_major_axis&&(r.semi_major_axis={value:r.semi_major_axis,unit:C});break;default:r.keyword=t[0];break}return r}},OU=rit;var iit=class extends OU{static convert(t,r={}){return super.convert(t,r),r.coordinate_system&&r.coordinate_system.subtype===\"Cartesian\"&&delete r.coordinate_system,r.usage&&delete r.usage,r}},NCt=iit;var nit=class extends OU{static convert(t,r={}){super.convert(t,r);let i=t.find(o=>Array.isArray(o)&&o[0]===\"CS\");i&&(r.coordinate_system={subtype:i[1],axis:this.extractAxes(t)});let n=t.find(o=>Array.isArray(o)&&o[0]===\"USAGE\");if(n){let o=n.find(h=>Array.isArray(h)&&h[0]===\"SCOPE\"),s=n.find(h=>Array.isArray(h)&&h[0]===\"AREA\"),a=n.find(h=>Array.isArray(h)&&h[0]===\"BBOX\");r.usage={},o&&(r.usage.scope=o[1]),s&&(r.usage.area=s[1]),a&&(r.usage.bbox=a.slice(1))}return r}},zCt=nit;function wpe(e){return e.find(t=>Array.isArray(t)&&t[0]===\"USAGE\")?\"2019\":(e.find(t=>Array.isArray(t)&&t[0]===\"CS\")||e[0]===\"BOUNDCRS\"||e[0]===\"PROJCRS\"||e[0]===\"GEOGCRS\",\"2015\")}function UCt(e){return(wpe(e)===\"2019\"?zCt:NCt).convert(e)}function VCt(e){let t=e.toUpperCase();return t.includes(\"PROJCRS\")||t.includes(\"GEOGCRS\")||t.includes(\"BOUNDCRS\")||t.includes(\"VERTCRS\")||t.includes(\"LENGTHUNIT\")||t.includes(\"ANGLEUNIT\")||t.includes(\"SCALEUNIT\")?\"WKT2\":(t.includes(\"PROJCS\")||t.includes(\"GEOGCS\")||t.includes(\"LOCAL_CS\")||t.includes(\"VERT_CS\")||t.includes(\"UNIT\"),\"WKT1\")}var jCt=Epe,Vk=1,$Ct=2,GCt=3,LU=4,WCt=5,oit=-1,Tpe=/\\s/,Spe=/[A-Za-z]/,Mpe=/[A-Za-z84_]/,BU=/[,\\]]/,qCt=/[\\d\\.E\\-\\+]/;function IA(e){if(typeof e!=\"string\")throw new Error(\"not a string\");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Vk}IA.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==LU)for(;Tpe.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case Vk:return this.neutral(e);case $Ct:return this.keyword(e);case LU:return this.quoted(e);case WCt:return this.afterquote(e);case GCt:return this.number(e);case oit:return}};IA.prototype.afterquote=function(e){if(e==='\"'){this.word+='\"',this.state=LU;return}if(BU.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in afterquote yet, index '+this.place)};IA.prototype.afterItem=function(e){if(e===\",\"){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Vk;return}if(e===\"]\"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Vk,this.currentObject=this.stack.pop(),this.currentObject||(this.state=oit);return}};IA.prototype.number=function(e){if(qCt.test(e)){this.word+=e;return}if(BU.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in number yet, index '+this.place)};IA.prototype.quoted=function(e){if(e==='\"'){this.state=WCt;return}this.word+=e};IA.prototype.keyword=function(e){if(Mpe.test(e)){this.word+=e;return}if(e===\"[\"){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=Vk;return}if(BU.test(e)){this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in keyword yet, index '+this.place)};IA.prototype.neutral=function(e){if(Spe.test(e)){this.word=e,this.state=$Ct;return}if(e==='\"'){this.word=\"\",this.state=LU;return}if(qCt.test(e)){this.word=e,this.state=GCt;return}if(BU.test(e)){this.afterItem(e);return}throw new Error(`havn't handled \"`+e+'\" in neutral yet, index '+this.place)};IA.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===oit)return this.root;throw new Error('unable to parse string \"'+this.text+'\". State is '+this.state)};function Epe(e){var t=new IA(e);return t.output()}function sit(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var i=t?{}:e,n=r.reduce(function(o,s){return Yx(s,o),o},i);t&&(e[t]=n)}function Yx(e,t){if(!Array.isArray(e)){t[e]=!0;return}var r=e.shift();if(r===\"PARAMETER\"&&(r=e.shift()),e.length===1){if(Array.isArray(e[0])){t[r]={},Yx(e[0],t[r]);return}t[r]=e[0];return}if(!e.length){t[r]=!0;return}if(r===\"TOWGS84\"){t[r]=e;return}if(r===\"AXIS\"){r in t||(t[r]=[]),t[r].push(e);return}Array.isArray(r)||(t[r]={});var i;switch(r){case\"UNIT\":case\"PRIMEM\":case\"VERT_DATUM\":t[r]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&Yx(e[2],t[r]);return;case\"SPHEROID\":case\"ELLIPSOID\":t[r]={name:e[0],a:e[1],rf:e[2]},e.length===4&&Yx(e[3],t[r]);return;case\"EDATUM\":case\"ENGINEERINGDATUM\":case\"LOCAL_DATUM\":case\"DATUM\":case\"VERT_CS\":case\"VERTCRS\":case\"VERTICALCRS\":e[0]=[\"name\",e[0]],sit(t,r,e);return;case\"COMPD_CS\":case\"COMPOUNDCRS\":case\"FITTED_CS\":case\"PROJECTEDCRS\":case\"PROJCRS\":case\"GEOGCS\":case\"GEOCCS\":case\"PROJCS\":case\"LOCAL_CS\":case\"GEODCRS\":case\"GEODETICCRS\":case\"GEODETICDATUM\":case\"ENGCRS\":case\"ENGINEERINGCRS\":e[0]=[\"name\",e[0]],sit(t,r,e),t[r].type=r;return;default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return Yx(e,t[r]);return sit(t,r,e)}}var Ppe=.017453292519943295;function of(e){return e*Ppe}function FU(e){let t=(e.projName||\"\").toLowerCase().replace(/_/g,\" \");!e.long0&&e.longc&&(t===\"albers conic equal area\"||t===\"lambert azimuthal equal area\")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(t===\"stereographic south pole\"||t===\"polar stereographic (variant b)\")?(e.lat0=of(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(t===\"polar stereographic\"||t===\"polar stereographic (variant a)\")&&(e.lat_ts=e.lat0,e.lat0=of(e.lat0>0?90:-90),delete e.lat1)}function HCt(e){let t={units:null,to_meter:void 0};return typeof e==\"string\"?(t.units=e.toLowerCase(),t.units===\"metre\"&&(t.units=\"meter\"),t.units===\"meter\"&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),t.units===\"metre\"&&(t.units=\"meter\"),t.to_meter=e.conversion_factor),t}function YCt(e){return typeof e==\"object\"?e.value*e.unit.conversion_factor:e}function XCt(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=YCt(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening!==void 0?t.rf=e.ellipsoid.inverse_flattening:e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-YCt(e.ellipsoid.semi_minor_axis))))}function jk(e,t={}){return!e||typeof e!=\"object\"?e:e.type===\"BoundCRS\"?(jk(e.source_crs,t),e.transformation&&(e.transformation.method&&e.transformation.method.name===\"NTv2\"?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map(r=>r.value)),t):(Object.keys(e).forEach(r=>{let i=e[r];if(i!==null)switch(r){case\"name\":if(t.srsCode)break;t.name=i,t.srsCode=i;break;case\"type\":i===\"GeographicCRS\"?t.projName=\"longlat\":i===\"GeodeticCRS\"?e.coordinate_system&&e.coordinate_system.subtype===\"Cartesian\"?t.projName=\"geocent\":t.projName=\"longlat\":i===\"ProjectedCRS\"&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case\"datum\":case\"datum_ensemble\":i.ellipsoid&&(t.ellps=i.ellipsoid.name,XCt(i,t)),i.prime_meridian&&(t.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case\"ellipsoid\":t.ellps=i.name,XCt(i,t);break;case\"prime_meridian\":t.long0=(i.longitude||0)*Math.PI/180;break;case\"coordinate_system\":if(i.axis){let n={east:\"e\",north:\"n\",west:\"w\",south:\"s\",up:\"u\",down:\"d\",geocentricx:\"e\",geocentricy:\"n\",geocentricz:\"u\"},o=i.axis.map(s=>n[s.direction.toLowerCase()]);if(o.every(Boolean)&&(t.axis=o.join(\"\"),t.axis.length===2&&(t.axis+=\"u\")),i.unit){let{units:s,to_meter:a}=HCt(i.unit);t.units=s,t.to_meter=a}else if(i.axis[0]&&i.axis[0].unit){let{units:s,to_meter:a}=HCt(i.axis[0].unit);t.units=s,t.to_meter=a}}break;case\"id\":i.authority&&i.code&&(t.title=i.authority+\":\"+i.code);break;case\"conversion\":i.method&&i.method.name&&(t.projName=i.method.name),i.parameters&&i.parameters.forEach(n=>{let o=n.name.toLowerCase().replace(/\\s+/g,\"_\"),s=n.value;n.unit&&n.unit.conversion_factor?t[o]=s*n.unit.conversion_factor:n.unit===\"degree\"?t[o]=s*Math.PI/180:t[o]=s});break;case\"unit\":i.name&&(t.units=i.name.toLowerCase(),t.units===\"metre\"&&(t.units=\"meter\")),i.conversion_factor&&(t.to_meter=i.conversion_factor);break;case\"base_crs\":jk(i,t),t.datumCode=i.id?i.id.authority+\"_\"+i.id.code:i.name;break;default:break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),FU(t),t)}var Cpe=[\"PROJECTEDCRS\",\"PROJCRS\",\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\",\"GEODCRS\",\"GEODETICCRS\",\"GEODETICDATUM\",\"ENGCRS\",\"ENGINEERINGCRS\"];function Ipe(e,t){var r=t[0],i=t[1];!(r in e)&&i in e&&(e[r]=e[i],t.length===3&&(e[r]=t[2](e[r])))}function ZCt(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;++r){var n=t[r];Cpe.indexOf(n)!==-1&&kpe(e[n]),typeof e[n]==\"object\"&&ZCt(e[n])}}function kpe(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+\":\"+e.AUTHORITY[t])}if(e.type===\"GEOGCS\"?e.projName=\"longlat\":e.type===\"LOCAL_CS\"?(e.projName=\"identity\",e.local=!0):typeof e.PROJECTION==\"object\"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var r=\"\",i=0,n=e.AXIS.length;i<n;++i){var o=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];o[0].indexOf(\"north\")!==-1||(o[0]===\"y\"||o[0]===\"lat\")&&o[1]===\"north\"?r+=\"n\":o[0].indexOf(\"south\")!==-1||(o[0]===\"y\"||o[0]===\"lat\")&&o[1]===\"south\"?r+=\"s\":o[0].indexOf(\"east\")!==-1||(o[0]===\"x\"||o[0]===\"lon\")&&o[1]===\"east\"?r+=\"e\":(o[0].indexOf(\"west\")!==-1||(o[0]===\"x\"||o[0]===\"lon\")&&o[1]===\"west\")&&(r+=\"w\")}r.length===2&&(r+=\"u\"),r.length===3&&(e.axis=r)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units===\"metre\"&&(e.units=\"meter\"),e.UNIT.convert&&(e.type===\"GEOGCS\"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var s=e.GEOGCS;e.type===\"GEOGCS\"&&(s=e),s&&(s.DATUM?e.datumCode=s.DATUM.name.toLowerCase():e.datumCode=s.name.toLowerCase(),e.datumCode.slice(0,2)===\"d_\"&&(e.datumCode=e.datumCode.slice(2)),e.datumCode===\"new_zealand_1949\"&&(e.datumCode=\"nzgd49\"),(e.datumCode===\"wgs_1984\"||e.datumCode===\"world_geodetic_system_1984\")&&(e.PROJECTION===\"Mercator_Auxiliary_Sphere\"&&(e.sphere=!0),e.datumCode=\"wgs84\"),e.datumCode===\"belge_1972\"&&(e.datumCode=\"rnb72\"),s.DATUM&&s.DATUM.SPHEROID&&(e.ellps=s.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),e.ellps.toLowerCase().slice(0,13)===\"international\"&&(e.ellps=\"intl\"),e.a=s.DATUM.SPHEROID.a,e.rf=parseFloat(s.DATUM.SPHEROID.rf)),s.DATUM&&s.DATUM.TOWGS84&&(e.datum_params=s.DATUM.TOWGS84),~e.datumCode.indexOf(\"osgb_1936\")&&(e.datumCode=\"osgb36\"),~e.datumCode.indexOf(\"osni_1952\")&&(e.datumCode=\"osni52\"),(~e.datumCode.indexOf(\"tm65\")||~e.datumCode.indexOf(\"geodetic_datum_of_1965\"))&&(e.datumCode=\"ire65\"),e.datumCode===\"ch1903+\"&&(e.datumCode=\"ch1903\"),~e.datumCode.indexOf(\"israel\")&&(e.datumCode=\"isr93\")),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&(e.rectified_grid_angle=of(e.rectified_grid_angle));function a(g){var w=e.to_meter||1;return g*w}var h=function(g){return Ipe(e,g)},p=[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_1\",\"Latitude of 1st standard parallel\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"standard_parallel_2\",\"Latitude of 2nd standard parallel\"],[\"false_easting\",\"False_Easting\"],[\"false_easting\",\"False easting\"],[\"false-easting\",\"Easting at false origin\"],[\"false_northing\",\"False_Northing\"],[\"false_northing\",\"False northing\"],[\"false_northing\",\"Northing at false origin\"],[\"central_meridian\",\"Central_Meridian\"],[\"central_meridian\",\"Longitude of natural origin\"],[\"central_meridian\",\"Longitude of false origin\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"latitude_of_origin\",\"Latitude of natural origin\"],[\"latitude_of_origin\",\"Latitude of false origin\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_Of_Center\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",of],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longitude_of_center\",\"Longitude_of_center\"],[\"longc\",\"longitude_of_center\",of],[\"x0\",\"false_easting\",a],[\"y0\",\"false_northing\",a],[\"long0\",\"central_meridian\",of],[\"lat0\",\"latitude_of_origin\",of],[\"lat0\",\"standard_parallel_1\",of],[\"lat1\",\"standard_parallel_1\",of],[\"lat2\",\"standard_parallel_2\",of],[\"azimuth\",\"Azimuth\"],[\"alpha\",\"azimuth\",of],[\"srsCode\",\"name\"]];p.forEach(h),FU(e)}function NS(e){if(typeof e==\"object\")return jk(e);let t=VCt(e);var r=jCt(e);if(t===\"WKT2\"){let o=UCt(r);return jk(o)}var i=r[0],n={};return Yx(r,n),ZCt(n),n[i]}function Uu(e){var t=this;if(arguments.length===2){var r=arguments[1];typeof r==\"string\"?r.charAt(0)===\"+\"?Uu[e]=Uk(arguments[1]):Uu[e]=NS(arguments[1]):r&&typeof r==\"object\"&&!(\"projName\"in r)?Uu[e]=NS(arguments[1]):(Uu[e]=r,r||delete Uu[e])}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(i){return Array.isArray(i)?Uu.apply(t,i):Uu(i)});if(typeof e==\"string\"){if(e in Uu)return Uu[e]}else\"EPSG\"in e?Uu[\"EPSG:\"+e.EPSG]=e:\"ESRI\"in e?Uu[\"ESRI:\"+e.ESRI]=e:\"IAU2000\"in e?Uu[\"IAU2000:\"+e.IAU2000]=e:console.log(e);return}}CCt(Uu);var zS=Uu;function Rpe(e){return typeof e==\"string\"}function Dpe(e){return e in zS}function Ope(e){return e.indexOf(\"+\")!==0&&e.indexOf(\"[\")!==-1||typeof e==\"object\"&&!(\"srsCode\"in e)}var KCt=[\"3857\",\"900913\",\"3785\",\"102113\"];function Lpe(e){if(e.title)return e.title.toLowerCase().indexOf(\"epsg:\")===0&&KCt.indexOf(e.title.substr(5))>-1;var t=Uh(e,\"authority\");if(t){var r=Uh(t,\"epsg\");return r&&KCt.indexOf(r)>-1}}function Bpe(e){var t=Uh(e,\"extension\");if(t)return Uh(t,\"proj4\")}function Fpe(e){return e[0]===\"+\"}function Npe(e){let t;if(Rpe(e))if(Dpe(e))t=zS[e];else if(Ope(e)){t=NS(e);var r=Bpe(t);r&&(t=Uk(r))}else Fpe(e)&&(t=Uk(e));else\"projName\"in e?t=e:t=NS(e);return t&&Lpe(t)?zS[\"EPSG:3857\"]:t}var QCt=Npe;function ait(e,t){e=e||{};var r,i;if(!t)return e;for(i in t)r=t[i],r!==void 0&&(e[i]=r);return e}function fc(e,t,r){var i=e*t;return r/Math.sqrt(1-i*i)}function hm(e){return e<0?-1:1}function qe(e,t){return t||Math.abs(e)<=us?e:e-hm(e)*S_}function Zc(e,t,r){var i=e*r,n=.5*e;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(Oe-t))/i}function kA(e,t){for(var r=.5*e,i,n,o=Oe-2*Math.atan(t),s=0;s<=15;s++)if(i=e*Math.sin(o),n=Oe-2*Math.atan(t*Math.pow((1-i)/(1+i),r))-o,o+=n,Math.abs(n)<=1e-10)return o;return-9999}function zpe(){var e=this.b/this.a;this.es=1-e*e,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=fc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Upe(e){var t=e.x,r=e.y;if(r*Fa>90&&r*Fa<-90&&t*Fa>180&&t*Fa<-180)return null;var i,n;if(Math.abs(Math.abs(r)-Oe)<=Ge)return null;if(this.sphere)i=this.x0+this.a*this.k0*qe(t-this.long0,this.over),n=this.y0+this.a*this.k0*Math.log(Math.tan(an+.5*r));else{var o=Math.sin(r),s=Zc(this.e,r,o);i=this.x0+this.a*this.k0*qe(t-this.long0,this.over),n=this.y0-this.a*this.k0*Math.log(s)}return e.x=i,e.y=n,e}function Vpe(e){var t=e.x-this.x0,r=e.y-this.y0,i,n;if(this.sphere)n=Oe-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(n=kA(this.e,o),n===-9999)return null}return i=qe(this.long0+t/(this.a*this.k0),this.over),e.x=i,e.y=n,e}var jpe=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"Mercator_Variant_A\",\"merc\"],JCt={init:zpe,forward:Upe,inverse:Vpe,names:jpe};function $pe(){}function t6t(e){return e}var lit=[\"longlat\",\"identity\"],e6t={init:$pe,forward:t6t,inverse:t6t,names:lit};var Gpe=[JCt,e6t],Xx={},US=[];function r6t(e,t){var r=US.length;return e.names?(US[r]=e,e.names.forEach(function(i){Xx[i.toLowerCase()]=r}),this):(console.log(t),!0)}function cit(e){return e.replace(/[-\\(\\)\\s]+/g,\" \").trim().replace(/ /g,\"_\")}function Wpe(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Xx[t]<\"u\"&&US[Xx[t]]||(t=cit(t),t in Xx&&US[Xx[t]]))return US[Xx[t]]}function qpe(){Gpe.forEach(r6t)}var i6t={start:qpe,add:r6t,get:Wpe};var Hpe={MERIT:{a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"},SGS85:{a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"},GRS80:{a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"},IAU76:{a:6378140,rf:298.257,ellipseName:\"IAU 1976\"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:\"Airy 1830\"},APL4:{a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"},NWL9D:{a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:\"Modified Airy\"},andrae:{a:637710443e-2,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"},aust_SA:{a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"},GRS67:{a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:\"Bessel 1841\"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:\"Clarke 1866\"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:\"Clarke 1880 (IGN)\"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:\"Clarke 1858\"},CPM:{a:63757387e-1,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"},delmbr:{a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:\"Engelis 1985\"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:\"Everest 1830\"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:\"Everest 1948\"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:\"Everest 1956\"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:\"Everest 1969\"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"},fschr60:{a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"},fschr60m:{a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"},fschr68:{a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"},helmert:{a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"},hough:{a:6378270,rf:297,ellipseName:\"Hough\"},intl:{a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"},kaula:{a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"},lerch:{a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"},mprts:{a:6397300,rf:191,ellipseName:\"Maupertius 1738\"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:\"New International 1967\"},plessis:{a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"},krass:{a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:\"Southeast Asia\"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:\"Walbeck\"},WGS60:{a:6378165,rf:298.3,ellipseName:\"WGS 60\"},WGS66:{a:6378145,rf:298.25,ellipseName:\"WGS 66\"},WGS7:{a:6378135,rf:298.26,ellipseName:\"WGS 72\"},WGS84:{a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"},sphere:{a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"}},uit=Hpe;var Ype=uit.WGS84;function n6t(e,t,r,i){var n=e*e,o=t*t,s=(n-o)/n,a=0;i?(e*=1-s*(RCt+s*(DCt+s*OCt)),n=e*e,s=0):a=Math.sqrt(s);var h=(n-o)/o;return{es:s,e:a,ep2:h}}function o6t(e,t,r,i,n){if(!e){var o=Uh(uit,i);o||(o=Ype),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(r===0||Math.abs(e-t)<Ge)&&(n=!0,t=e),{a:e,b:t,rf:r,sphere:n}}var zU={wgs84:{towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"},ch1903:{towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"},ggrs87:{towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"},nad83:{towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"},nad27:{nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"},potsdam:{towgs84:\"598.1,73.7,418.2,0.202,0.045,-2.455,6.7\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"},carthage:{towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"},hermannskogel:{towgs84:\"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",ellipse:\"bessel\",datumName:\"Hermannskogel\"},mgi:{towgs84:\"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",ellipse:\"bessel\",datumName:\"Militar-Geographische Institut\"},osni52:{towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"airy\",datumName:\"Irish National\"},ire65:{towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"},rassadiran:{towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"},nzgd49:{towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"},osgb36:{towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Ordnance Survey of Great Britain 1936\"},s_jtsk:{towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"},beduaram:{towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"},gunung_segara:{towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"},rnb72:{towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"},EPSG_5451:{towgs84:\"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649\"},IGNF_LURESG:{towgs84:\"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43\"},EPSG_4614:{towgs84:\"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065\"},EPSG_4615:{towgs84:\"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748\"},ESRI_37241:{towgs84:\"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031\"},ESRI_37249:{towgs84:\"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438\"},ESRI_37245:{towgs84:\"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071\"},EPSG_4178:{towgs84:\"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01\"},EPSG_4622:{towgs84:\"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984\"},EPSG_4625:{towgs84:\"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227\"},EPSG_5252:{towgs84:\"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439\"},EPSG_4314:{towgs84:\"597.1,71.4,412.1,0.894,0.068,-1.563,7.58\"},EPSG_4282:{towgs84:\"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166\"},EPSG_4231:{towgs84:\"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218\"},EPSG_4274:{towgs84:\"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95\"},EPSG_4134:{towgs84:\"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006\"},EPSG_4254:{towgs84:\"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013\"},EPSG_4159:{towgs84:\"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175\"},EPSG_4687:{towgs84:\"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093\"},EPSG_4227:{towgs84:\"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225\"},EPSG_4746:{towgs84:\"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46\"},EPSG_4745:{towgs84:\"612.4,77,440.2,-0.054,0.057,-2.797,2.55\"},EPSG_6311:{towgs84:\"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926\"},EPSG_4289:{towgs84:\"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244\"},EPSG_4230:{towgs84:\"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4\"},EPSG_4154:{towgs84:\"-123.02,-158.95,-168.47\"},EPSG_4156:{towgs84:\"570.8,85.7,462.8,4.998,1.587,5.261,3.56\"},EPSG_4299:{towgs84:\"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15\"},EPSG_4179:{towgs84:\"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84\"},EPSG_4313:{towgs84:\"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747\"},EPSG_4194:{towgs84:\"163.511,127.533,-159.789\"},EPSG_4195:{towgs84:\"105,326,-102.5\"},EPSG_4196:{towgs84:\"-45,417,-3.5\"},EPSG_4611:{towgs84:\"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246\"},EPSG_4633:{towgs84:\"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824\"},EPSG_4641:{towgs84:\"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993\"},EPSG_4643:{towgs84:\"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002\"},EPSG_4300:{towgs84:\"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15\"},EPSG_4188:{towgs84:\"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15\"},EPSG_4660:{towgs84:\"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805\"},EPSG_4662:{towgs84:\"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259\"},EPSG_3906:{towgs84:\"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664\"},EPSG_4307:{towgs84:\"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547\"},EPSG_6892:{towgs84:\"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686\"},EPSG_4690:{towgs84:\"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648\"},EPSG_4691:{towgs84:\"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817\"},EPSG_4629:{towgs84:\"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653\"},EPSG_4630:{towgs84:\"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111\"},EPSG_4692:{towgs84:\"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093\"},EPSG_9333:{towgs84:\"0,0,0,-0.008393,0.000749,-0.010276,0\"},EPSG_9059:{towgs84:\"0,0,0\"},EPSG_4312:{towgs84:\"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887\"},EPSG_4123:{towgs84:\"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496\"},EPSG_4309:{towgs84:\"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365\"},ESRI_104106:{towgs84:\"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058\"},EPSG_4281:{towgs84:\"-219.247,-73.802,269.529\"},EPSG_4322:{towgs84:\"0,0,4.5\"},EPSG_4324:{towgs84:\"0,0,1.9\"},EPSG_4284:{towgs84:\"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549\"},EPSG_4277:{towgs84:\"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489\"},EPSG_4207:{towgs84:\"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46\"},EPSG_4688:{towgs84:\"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647\"},EPSG_4689:{towgs84:\"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218\"},EPSG_4720:{towgs84:\"0,0,4.5\"},EPSG_4273:{towgs84:\"278.3,93,474.5,7.889,0.05,-6.61,6.21\"},EPSG_4240:{towgs84:\"204.64,834.74,293.8\"},EPSG_4817:{towgs84:\"278.3,93,474.5,7.889,0.05,-6.61,6.21\"},ESRI_104131:{towgs84:\"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1\"},EPSG_4265:{towgs84:\"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68\"},EPSG_4263:{towgs84:\"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032\"},EPSG_4298:{towgs84:\"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536\"},EPSG_4270:{towgs84:\"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424\"},EPSG_4229:{towgs84:\"-121.8,98.1,-10.7\"},EPSG_4220:{towgs84:\"-55.5,-348,-229.2\"},EPSG_4214:{towgs84:\"12.646,-155.176,-80.863\"},EPSG_4232:{towgs84:\"-345,3,223\"},EPSG_4238:{towgs84:\"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037\"},EPSG_4168:{towgs84:\"-170,33,326\"},EPSG_4131:{towgs84:\"199,931,318.9\"},EPSG_4152:{towgs84:\"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0\"},EPSG_5228:{towgs84:\"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378\"},EPSG_8351:{towgs84:\"485.021,169.465,483.839,7.786342,4.397554,4.102655,0\"},EPSG_4683:{towgs84:\"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06\"},EPSG_4133:{towgs84:\"0,0,0\"},EPSG_7373:{towgs84:\"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693\"},EPSG_9075:{towgs84:\"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0\"},EPSG_9072:{towgs84:\"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0\"},EPSG_9294:{towgs84:\"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388\"},EPSG_4212:{towgs84:\"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492\"},EPSG_4191:{towgs84:\"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703\"},EPSG_4237:{towgs84:\"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191\"},EPSG_4740:{towgs84:\"-1.08,-0.27,-0.9\"},EPSG_4124:{towgs84:\"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496\"},EPSG_5681:{towgs84:\"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922\"},EPSG_4141:{towgs84:\"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262\"},EPSG_4204:{towgs84:\"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194\"},EPSG_4319:{towgs84:\"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798\"},EPSG_4200:{towgs84:\"24.82,-131.21,-82.66\"},EPSG_4130:{towgs84:\"0,0,0\"},EPSG_4127:{towgs84:\"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359\"},EPSG_4149:{towgs84:\"674.374,15.056,405.346\"},EPSG_4617:{towgs84:\"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0\"},EPSG_4663:{towgs84:\"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485\"},EPSG_4664:{towgs84:\"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384\"},EPSG_4665:{towgs84:\"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048\"},EPSG_4666:{towgs84:\"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43\"},EPSG_4756:{towgs84:\"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188\"},EPSG_4723:{towgs84:\"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925\"},EPSG_4726:{towgs84:\"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081\"},EPSG_4267:{towgs84:\"-8.0,160.0,176.0\"},EPSG_5365:{towgs84:\"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693\"},EPSG_4218:{towgs84:\"304.5,306.5,-318.1\"},EPSG_4242:{towgs84:\"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95\"},EPSG_4216:{towgs84:\"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289\"},ESRI_104105:{towgs84:\"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43\"},ESRI_104129:{towgs84:\"0,0,0\"},EPSG_4673:{towgs84:\"174.05,-25.49,112.57\"},EPSG_4202:{towgs84:\"-124,-60,154\"},EPSG_4203:{towgs84:\"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191\"},EPSG_3819:{towgs84:\"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408\"},EPSG_8694:{towgs84:\"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169\"},EPSG_4145:{towgs84:\"275.57,676.78,229.6\"},EPSG_4283:{towgs84:\"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994\"},EPSG_4317:{towgs84:\"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063\"},EPSG_4272:{towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\"},EPSG_4248:{towgs84:\"-307.7,265.3,-363.5\"},EPSG_5561:{towgs84:\"24,-121,-76\"},EPSG_5233:{towgs84:\"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338\"},ESRI_104130:{towgs84:\"-86,-98,-119\"},ESRI_104102:{towgs84:\"682,-203,480\"},ESRI_37207:{towgs84:\"7,-10,-26\"},EPSG_4675:{towgs84:\"59.935,118.4,-10.871\"},ESRI_104109:{towgs84:\"-89.121,-348.182,260.871\"},ESRI_104112:{towgs84:\"-185.583,-230.096,281.361\"},ESRI_104113:{towgs84:\"25.1,-275.6,222.6\"},IGNF_WGS72G:{towgs84:\"0,12,6\"},IGNF_NTFG:{towgs84:\"-168,-60,320\"},IGNF_EFATE57G:{towgs84:\"-127,-769,472\"},IGNF_PGP50G:{towgs84:\"324.8,153.6,172.1\"},IGNF_REUN47G:{towgs84:\"94,-948,-1262\"},IGNF_CSG67G:{towgs84:\"-186,230,110\"},IGNF_GUAD48G:{towgs84:\"-467,-16,-300\"},IGNF_TAHI51G:{towgs84:\"162,117,154\"},IGNF_TAHAAG:{towgs84:\"65,342,77\"},IGNF_NUKU72G:{towgs84:\"84,274,65\"},IGNF_PETRELS72G:{towgs84:\"365,194,166\"},IGNF_WALL78G:{towgs84:\"253,-133,-127\"},IGNF_MAYO50G:{towgs84:\"-382,-59,-262\"},IGNF_TANNAG:{towgs84:\"-139,-967,436\"},IGNF_IGN72G:{towgs84:\"-13,-348,292\"},IGNF_ATIGG:{towgs84:\"1118,23,66\"},IGNF_FANGA84G:{towgs84:\"150.57,158.33,118.32\"},IGNF_RUSAT84G:{towgs84:\"202.13,174.6,-15.74\"},IGNF_KAUE70G:{towgs84:\"126.74,300.1,-75.49\"},IGNF_MOP90G:{towgs84:\"-10.8,-1.8,12.77\"},IGNF_MHPF67G:{towgs84:\"338.08,212.58,-296.17\"},IGNF_TAHI79G:{towgs84:\"160.61,116.05,153.69\"},IGNF_ANAA92G:{towgs84:\"1.5,3.84,4.81\"},IGNF_MARQUI72G:{towgs84:\"330.91,-13.92,58.56\"},IGNF_APAT86G:{towgs84:\"143.6,197.82,74.05\"},IGNF_TUBU69G:{towgs84:\"237.17,171.61,-77.84\"},IGNF_STPM50G:{towgs84:\"11.363,424.148,373.13\"},EPSG_4150:{towgs84:\"674.374,15.056,405.346\"},EPSG_4754:{towgs84:\"-208.4058,-109.8777,-2.5764\"},ESRI_104101:{towgs84:\"372.87,149.23,585.29\"},EPSG_4693:{towgs84:\"0,-0.15,0.68\"},EPSG_6207:{towgs84:\"293.17,726.18,245.36\"},EPSG_4153:{towgs84:\"-133.63,-157.5,-158.62\"},EPSG_4132:{towgs84:\"-241.54,-163.64,396.06\"},EPSG_4221:{towgs84:\"-154.5,150.7,100.4\"},EPSG_4266:{towgs84:\"-80.7,-132.5,41.1\"},EPSG_4193:{towgs84:\"-70.9,-151.8,-41.4\"},EPSG_5340:{towgs84:\"-0.41,0.46,-0.35\"},EPSG_4246:{towgs84:\"-294.7,-200.1,525.5\"},EPSG_4318:{towgs84:\"-3.2,-5.7,2.8\"},EPSG_4121:{towgs84:\"-199.87,74.79,246.62\"},EPSG_4223:{towgs84:\"-260.1,5.5,432.2\"},EPSG_4158:{towgs84:\"-0.465,372.095,171.736\"},EPSG_4285:{towgs84:\"-128.16,-282.42,21.93\"},EPSG_4613:{towgs84:\"-404.78,685.68,45.47\"},EPSG_4607:{towgs84:\"195.671,332.517,274.607\"},EPSG_4475:{towgs84:\"-381.788,-57.501,-256.673\"},EPSG_4208:{towgs84:\"-157.84,308.54,-146.6\"},EPSG_4743:{towgs84:\"70.995,-335.916,262.898\"},EPSG_4710:{towgs84:\"-323.65,551.39,-491.22\"},EPSG_7881:{towgs84:\"-0.077,0.079,0.086\"},EPSG_4682:{towgs84:\"283.729,735.942,261.143\"},EPSG_4739:{towgs84:\"-156,-271,-189\"},EPSG_4679:{towgs84:\"-80.01,253.26,291.19\"},EPSG_4750:{towgs84:\"-56.263,16.136,-22.856\"},EPSG_4644:{towgs84:\"-10.18,-350.43,291.37\"},EPSG_4695:{towgs84:\"-103.746,-9.614,-255.95\"},EPSG_4292:{towgs84:\"-355,21,72\"},EPSG_4302:{towgs84:\"-61.702,284.488,472.052\"},EPSG_4143:{towgs84:\"-124.76,53,466.79\"},EPSG_4606:{towgs84:\"-153,153,307\"},EPSG_4699:{towgs84:\"-770.1,158.4,-498.2\"},EPSG_4247:{towgs84:\"-273.5,110.6,-357.9\"},EPSG_4160:{towgs84:\"8.88,184.86,106.69\"},EPSG_4161:{towgs84:\"-233.43,6.65,173.64\"},EPSG_9251:{towgs84:\"-9.5,122.9,138.2\"},EPSG_9253:{towgs84:\"-78.1,101.6,133.3\"},EPSG_4297:{towgs84:\"-198.383,-240.517,-107.909\"},EPSG_4269:{towgs84:\"0,0,0\"},EPSG_4301:{towgs84:\"-147,506,687\"},EPSG_4618:{towgs84:\"-59,-11,-52\"},EPSG_4612:{towgs84:\"0,0,0\"},EPSG_4678:{towgs84:\"44.585,-131.212,-39.544\"},EPSG_4250:{towgs84:\"-130,29,364\"},EPSG_4144:{towgs84:\"214,804,268\"},EPSG_4147:{towgs84:\"-17.51,-108.32,-62.39\"},EPSG_4259:{towgs84:\"-254.1,-5.36,-100.29\"},EPSG_4164:{towgs84:\"-76,-138,67\"},EPSG_4211:{towgs84:\"-378.873,676.002,-46.255\"},EPSG_4182:{towgs84:\"-422.651,-172.995,84.02\"},EPSG_4224:{towgs84:\"-143.87,243.37,-33.52\"},EPSG_4225:{towgs84:\"-205.57,168.77,-4.12\"},EPSG_5527:{towgs84:\"-67.35,3.88,-38.22\"},EPSG_4752:{towgs84:\"98,390,-22\"},EPSG_4310:{towgs84:\"-30,190,89\"},EPSG_9248:{towgs84:\"-192.26,65.72,132.08\"},EPSG_4680:{towgs84:\"124.5,-63.5,-281\"},EPSG_4701:{towgs84:\"-79.9,-158,-168.9\"},EPSG_4706:{towgs84:\"-146.21,112.63,4.05\"},EPSG_4805:{towgs84:\"682,-203,480\"},EPSG_4201:{towgs84:\"-165,-11,206\"},EPSG_4210:{towgs84:\"-157,-2,-299\"},EPSG_4183:{towgs84:\"-104,167,-38\"},EPSG_4139:{towgs84:\"11,72,-101\"},EPSG_4668:{towgs84:\"-86,-98,-119\"},EPSG_4717:{towgs84:\"-2,151,181\"},EPSG_4732:{towgs84:\"102,52,-38\"},EPSG_4280:{towgs84:\"-377,681,-50\"},EPSG_4209:{towgs84:\"-138,-105,-289\"},EPSG_4261:{towgs84:\"31,146,47\"},EPSG_4658:{towgs84:\"-73,46,-86\"},EPSG_4721:{towgs84:\"265.025,384.929,-194.046\"},EPSG_4222:{towgs84:\"-136,-108,-292\"},EPSG_4601:{towgs84:\"-255,-15,71\"},EPSG_4602:{towgs84:\"725,685,536\"},EPSG_4603:{towgs84:\"72,213.7,93\"},EPSG_4605:{towgs84:\"9,183,236\"},EPSG_4621:{towgs84:\"137,248,-430\"},EPSG_4657:{towgs84:\"-28,199,5\"},EPSG_4316:{towgs84:\"103.25,-100.4,-307.19\"},EPSG_4642:{towgs84:\"-13,-348,292\"},EPSG_4698:{towgs84:\"145,-187,103\"},EPSG_4192:{towgs84:\"-206.1,-174.7,-87.7\"},EPSG_4311:{towgs84:\"-265,120,-358\"},EPSG_4135:{towgs84:\"58,-283,-182\"},ESRI_104138:{towgs84:\"198,-226,-347\"},EPSG_4245:{towgs84:\"-11,851,5\"},EPSG_4142:{towgs84:\"-125,53,467\"},EPSG_4213:{towgs84:\"-106,-87,188\"},EPSG_4253:{towgs84:\"-133,-77,-51\"},EPSG_4129:{towgs84:\"-132,-110,-335\"},EPSG_4713:{towgs84:\"-77,-128,142\"},EPSG_4239:{towgs84:\"217,823,299\"},EPSG_4146:{towgs84:\"295,736,257\"},EPSG_4155:{towgs84:\"-83,37,124\"},EPSG_4165:{towgs84:\"-173,253,27\"},EPSG_4672:{towgs84:\"175,-38,113\"},EPSG_4236:{towgs84:\"-637,-549,-203\"},EPSG_4251:{towgs84:\"-90,40,88\"},EPSG_4271:{towgs84:\"-2,374,172\"},EPSG_4175:{towgs84:\"-88,4,101\"},EPSG_4716:{towgs84:\"298,-304,-375\"},EPSG_4315:{towgs84:\"-23,259,-9\"},EPSG_4744:{towgs84:\"-242.2,-144.9,370.3\"},EPSG_4244:{towgs84:\"-97,787,86\"},EPSG_4293:{towgs84:\"616,97,-251\"},EPSG_4714:{towgs84:\"-127,-769,472\"},EPSG_4736:{towgs84:\"260,12,-147\"},EPSG_6883:{towgs84:\"-235,-110,393\"},EPSG_6894:{towgs84:\"-63,176,185\"},EPSG_4205:{towgs84:\"-43,-163,45\"},EPSG_4256:{towgs84:\"41,-220,-134\"},EPSG_4262:{towgs84:\"639,405,60\"},EPSG_4604:{towgs84:\"174,359,365\"},EPSG_4169:{towgs84:\"-115,118,426\"},EPSG_4620:{towgs84:\"-106,-129,165\"},EPSG_4184:{towgs84:\"-203,141,53\"},EPSG_4616:{towgs84:\"-289,-124,60\"},EPSG_9403:{towgs84:\"-307,-92,127\"},EPSG_4684:{towgs84:\"-133,-321,50\"},EPSG_4708:{towgs84:\"-491,-22,435\"},EPSG_4707:{towgs84:\"114,-116,-333\"},EPSG_4709:{towgs84:\"145,75,-272\"},EPSG_4712:{towgs84:\"-205,107,53\"},EPSG_4711:{towgs84:\"124,-234,-25\"},EPSG_4718:{towgs84:\"230,-199,-752\"},EPSG_4719:{towgs84:\"211,147,111\"},EPSG_4724:{towgs84:\"208,-435,-229\"},EPSG_4725:{towgs84:\"189,-79,-202\"},EPSG_4735:{towgs84:\"647,1777,-1124\"},EPSG_4722:{towgs84:\"-794,119,-298\"},EPSG_4728:{towgs84:\"-307,-92,127\"},EPSG_4734:{towgs84:\"-632,438,-609\"},EPSG_4727:{towgs84:\"912,-58,1227\"},EPSG_4729:{towgs84:\"185,165,42\"},EPSG_4730:{towgs84:\"170,42,84\"},EPSG_4733:{towgs84:\"276,-57,149\"},ESRI_37218:{towgs84:\"230,-199,-752\"},ESRI_37240:{towgs84:\"-7,215,225\"},ESRI_37221:{towgs84:\"252,-209,-751\"},ESRI_4305:{towgs84:\"-123,-206,219\"},ESRI_104139:{towgs84:\"-73,-247,227\"},EPSG_4748:{towgs84:\"51,391,-36\"},EPSG_4219:{towgs84:\"-384,664,-48\"},EPSG_4255:{towgs84:\"-333,-222,114\"},EPSG_4257:{towgs84:\"-587.8,519.75,145.76\"},EPSG_4646:{towgs84:\"-963,510,-359\"},EPSG_6881:{towgs84:\"-24,-203,268\"},EPSG_6882:{towgs84:\"-183,-15,273\"},EPSG_4715:{towgs84:\"-104,-129,239\"},IGNF_RGF93GDD:{towgs84:\"0,0,0\"},IGNF_RGM04GDD:{towgs84:\"0,0,0\"},IGNF_RGSPM06GDD:{towgs84:\"0,0,0\"},IGNF_RGTAAF07GDD:{towgs84:\"0,0,0\"},IGNF_RGFG95GDD:{towgs84:\"0,0,0\"},IGNF_RGNCG:{towgs84:\"0,0,0\"},IGNF_RGPFGDD:{towgs84:\"0,0,0\"},IGNF_ETRS89G:{towgs84:\"0,0,0\"},IGNF_RGR92GDD:{towgs84:\"0,0,0\"},EPSG_4173:{towgs84:\"0,0,0\"},EPSG_4180:{towgs84:\"0,0,0\"},EPSG_4619:{towgs84:\"0,0,0\"},EPSG_4667:{towgs84:\"0,0,0\"},EPSG_4075:{towgs84:\"0,0,0\"},EPSG_6706:{towgs84:\"0,0,0\"},EPSG_7798:{towgs84:\"0,0,0\"},EPSG_4661:{towgs84:\"0,0,0\"},EPSG_4669:{towgs84:\"0,0,0\"},EPSG_8685:{towgs84:\"0,0,0\"},EPSG_4151:{towgs84:\"0,0,0\"},EPSG_9702:{towgs84:\"0,0,0\"},EPSG_4758:{towgs84:\"0,0,0\"},EPSG_4761:{towgs84:\"0,0,0\"},EPSG_4765:{towgs84:\"0,0,0\"},EPSG_8997:{towgs84:\"0,0,0\"},EPSG_4023:{towgs84:\"0,0,0\"},EPSG_4670:{towgs84:\"0,0,0\"},EPSG_4694:{towgs84:\"0,0,0\"},EPSG_4148:{towgs84:\"0,0,0\"},EPSG_4163:{towgs84:\"0,0,0\"},EPSG_4167:{towgs84:\"0,0,0\"},EPSG_4189:{towgs84:\"0,0,0\"},EPSG_4190:{towgs84:\"0,0,0\"},EPSG_4176:{towgs84:\"0,0,0\"},EPSG_4659:{towgs84:\"0,0,0\"},EPSG_3824:{towgs84:\"0,0,0\"},EPSG_3889:{towgs84:\"0,0,0\"},EPSG_4046:{towgs84:\"0,0,0\"},EPSG_4081:{towgs84:\"0,0,0\"},EPSG_4558:{towgs84:\"0,0,0\"},EPSG_4483:{towgs84:\"0,0,0\"},EPSG_5013:{towgs84:\"0,0,0\"},EPSG_5264:{towgs84:\"0,0,0\"},EPSG_5324:{towgs84:\"0,0,0\"},EPSG_5354:{towgs84:\"0,0,0\"},EPSG_5371:{towgs84:\"0,0,0\"},EPSG_5373:{towgs84:\"0,0,0\"},EPSG_5381:{towgs84:\"0,0,0\"},EPSG_5393:{towgs84:\"0,0,0\"},EPSG_5489:{towgs84:\"0,0,0\"},EPSG_5593:{towgs84:\"0,0,0\"},EPSG_6135:{towgs84:\"0,0,0\"},EPSG_6365:{towgs84:\"0,0,0\"},EPSG_5246:{towgs84:\"0,0,0\"},EPSG_7886:{towgs84:\"0,0,0\"},EPSG_8431:{towgs84:\"0,0,0\"},EPSG_8427:{towgs84:\"0,0,0\"},EPSG_8699:{towgs84:\"0,0,0\"},EPSG_8818:{towgs84:\"0,0,0\"},EPSG_4757:{towgs84:\"0,0,0\"},EPSG_9140:{towgs84:\"0,0,0\"},EPSG_8086:{towgs84:\"0,0,0\"},EPSG_4686:{towgs84:\"0,0,0\"},EPSG_4737:{towgs84:\"0,0,0\"},EPSG_4702:{towgs84:\"0,0,0\"},EPSG_4747:{towgs84:\"0,0,0\"},EPSG_4749:{towgs84:\"0,0,0\"},EPSG_4674:{towgs84:\"0,0,0\"},EPSG_4755:{towgs84:\"0,0,0\"},EPSG_4759:{towgs84:\"0,0,0\"},EPSG_4762:{towgs84:\"0,0,0\"},EPSG_4763:{towgs84:\"0,0,0\"},EPSG_4764:{towgs84:\"0,0,0\"},EPSG_4166:{towgs84:\"0,0,0\"},EPSG_4170:{towgs84:\"0,0,0\"},EPSG_5546:{towgs84:\"0,0,0\"},EPSG_7844:{towgs84:\"0,0,0\"},EPSG_4818:{towgs84:\"589,76,480\"},EPSG_10328:{towgs84:\"0,0,0\"},EPSG_9782:{towgs84:\"0,0,0\"},EPSG_9777:{towgs84:\"0,0,0\"},EPSG_10690:{towgs84:\"0,0,0\"},EPSG_10639:{towgs84:\"0,0,0\"},EPSG_10739:{towgs84:\"0,0,0\"},EPSG_7686:{towgs84:\"0,0,0\"},EPSG_8900:{towgs84:\"0,0,0\"},EPSG_5886:{towgs84:\"0,0,0\"},EPSG_7683:{towgs84:\"0,0,0\"},EPSG_6668:{towgs84:\"0,0,0\"},EPSG_20046:{towgs84:\"0,0,0\"},EPSG_10299:{towgs84:\"0,0,0\"},EPSG_10310:{towgs84:\"0,0,0\"},EPSG_10475:{towgs84:\"0,0,0\"},EPSG_4742:{towgs84:\"0,0,0\"},EPSG_10671:{towgs84:\"0,0,0\"},EPSG_10762:{towgs84:\"0,0,0\"},EPSG_10725:{towgs84:\"0,0,0\"},EPSG_10791:{towgs84:\"0,0,0\"},EPSG_10800:{towgs84:\"0,0,0\"},EPSG_10305:{towgs84:\"0,0,0\"},EPSG_10941:{towgs84:\"0,0,0\"},EPSG_10968:{towgs84:\"0,0,0\"},EPSG_10875:{towgs84:\"0,0,0\"},EPSG_6318:{towgs84:\"0,0,0\"},EPSG_10910:{towgs84:\"0,0,0\"}};for(s6t in zU)NU=zU[s6t],NU.datumName&&(zU[NU.datumName]=NU);var NU,s6t,a6t=zU;function Xpe(e,t,r,i,n,o,s){var a={};return e===void 0||e===\"none\"?a.datum_type=zk:a.datum_type=ICt,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=wp),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Tp,a.datum_params[3]*=Hx,a.datum_params[4]*=Hx,a.datum_params[5]*=Hx,a.datum_params[6]=a.datum_params[6]/1e6+1)),s&&(a.datum_type=CA,a.grids=s),a.a=r,a.b=i,a.es=n,a.ep2=o,a}var l6t=Xpe;var dit={};function fit(e,t,r){return t instanceof ArrayBuffer?Zpe(e,t,r):{ready:Kpe(e,t)}}function Zpe(e,t,r){var i=!0;r!==void 0&&r.includeErrorFields===!1&&(i=!1);var n=new DataView(t),o=Jpe(n),s=t0e(n,o),a=e0e(n,s,o,i),h={header:s,subgrids:a};return dit[e]=h,h}async function Kpe(e,t){for(var r=[],i=await t.getImageCount(),n=i-1;n>=0;n--){var o=await t.getImage(n),s=await o.readRasters(),a=s,h=[o.getWidth(),o.getHeight()],p=o.getBoundingBox().map(c6t),g=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(c6t),w=p[0]+(h[0]-1)*g[0],C=p[3]-(h[1]-1)*g[1],R=a[0],z=a[1],W=[];for(let Q=h[1]-1;Q>=0;Q--)for(let tt=h[0]-1;tt>=0;tt--){var Y=Q*h[0]+tt;W.push([-M_(z[Y]),M_(R[Y])])}r.push({del:g,lim:h,ll:[-w,C],cvs:W})}var H={header:{nSubgrids:i},subgrids:r};return dit[e]=H,H}function u6t(e){if(e===void 0)return null;var t=e.split(\",\");return t.map(Qpe)}function Qpe(e){if(e.length===0)return null;var t=e[0]===\"@\";return t&&(e=e.slice(1)),e===\"null\"?{name:\"null\",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:dit[e]||null,isNull:!1}}function c6t(e){return e*Math.PI/180}function M_(e){return e/3600*Math.PI/180}function Jpe(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn(\"Failed to detect nadgrid endian-ness, defaulting to little-endian\"),!0)}function t0e(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:hit(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function hit(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function e0e(e,t,r,i){for(var n=176,o=[],s=0;s<t.nSubgrids;s++){var a=i0e(e,n,r),h=n0e(e,n,a,r,i),p=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),g=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);o.push({ll:[M_(a.lowerLongitude),M_(a.lowerLatitude)],del:[M_(a.longitudeInterval),M_(a.latitudeInterval)],lim:[p,g],count:a.gridNodeCount,cvs:r0e(h)});var w=16;i===!1&&(w=8),n+=176+a.gridNodeCount*w}return o}function r0e(e){return e.map(function(t){return[M_(t.longitudeShift),M_(t.latitudeShift)]})}function i0e(e,t,r){return{name:hit(e,t+8,t+16).trim(),parent:hit(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function n0e(e,t,r,i,n){var o=t+176,s=16;n===!1&&(s=8);for(var a=[],h=0;h<r.gridNodeCount;h++){var p={latitudeShift:e.getFloat32(o+h*s,i),longitudeShift:e.getFloat32(o+h*s+4,i)};n!==!1&&(p.latitudeAccuracy=e.getFloat32(o+h*s+8,i),p.longitudeAccuracy=e.getFloat32(o+h*s+12,i)),a.push(p)}return a}function VS(e,t){if(!(this instanceof VS))return new VS(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,t=t||function(p){if(p)throw p};var r=QCt(e);if(typeof r!=\"object\"){t(\"Could not parse to valid json: \"+e);return}var i=VS.projections.get(r.projName);if(!i){t(\"Could not get projection name from: \"+e);return}if(r.datumCode&&r.datumCode!==\"none\"){var n=Uh(a6t,r.datumCode);n&&(r.datum_params=r.datum_params||(n.towgs84?n.towgs84.split(\",\"):null),r.ellps=n.ellipse,r.datumName=n.datumName?n.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||\"enu\",r.ellps=r.ellps||\"wgs84\",r.lat1=r.lat1||r.lat0;var o=o6t(r.a,r.b,r.rf,r.ellps,r.sphere),s=n6t(o.a,o.b,o.rf,r.R_A),a=u6t(r.nadgrids),h=r.datum||l6t(r.datumCode,r.datum_params,o.a,o.b,s.es,s.ep2,a);ait(this,r),ait(this,i),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=s.es,this.e=s.e,this.ep2=s.ep2,this.datum=h,\"init\"in this&&typeof this.init==\"function\"&&this.init(),t(null,this)}VS.projections=i6t;VS.projections.start();var Sp=VS;function h6t(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===wp?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Tp?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function UU(e,t,r){var i=e.x,n=e.y,o=e.z?e.z:0,s,a,h,p;if(n<-Oe&&n>-1.001*Oe)n=-Oe;else if(n>Oe&&n<1.001*Oe)n=Oe;else{if(n<-Oe)return{x:-1/0,y:-1/0,z:e.z};if(n>Oe)return{x:1/0,y:1/0,z:e.z}}return i>Math.PI&&(i-=2*Math.PI),a=Math.sin(n),p=Math.cos(n),h=a*a,s=r/Math.sqrt(1-t*h),{x:(s+o)*p*Math.cos(i),y:(s+o)*p*Math.sin(i),z:(s*(1-t)+o)*a}}function VU(e,t,r,i){var n=1e-12,o=n*n,s=30,a,h,p,g,w,C,R,z,W,Y,H,Q,tt,rt=e.x,at=e.y,et=e.z?e.z:0,lt,J,ft;if(a=Math.sqrt(rt*rt+at*at),h=Math.sqrt(rt*rt+at*at+et*et),a/r<n){if(lt=0,h/r<n)return J=Oe,ft=-i,{x:e.x,y:e.y,z:e.z}}else lt=Math.atan2(at,rt);p=et/h,g=a/h,w=1/Math.sqrt(1-t*(2-t)*g*g),z=g*(1-t)*w,W=p*w,tt=0;do tt++,R=r/Math.sqrt(1-t*W*W),ft=a*z+et*W-R*(1-t*W*W),C=t*R/(R+ft),w=1/Math.sqrt(1-C*(2-C)*g*g),Y=g*(1-C)*w,H=p*w,Q=H*z-Y*W,z=Y,W=H;while(Q*Q>o&&tt<s);return J=Math.atan(H/Math.abs(Y)),{x:lt,y:J,z:ft}}function d6t(e,t,r){if(t===wp)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Tp){var i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],h=r[5],p=r[6];return{x:p*(e.x-h*e.y+a*e.z)+i,y:p*(h*e.x+e.y-s*e.z)+n,z:p*(-a*e.x+s*e.y+e.z)+o}}}function f6t(e,t,r){if(t===wp)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Tp){var i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],h=r[5],p=r[6],g=(e.x-i)/p,w=(e.y-n)/p,C=(e.z-o)/p;return{x:g+h*w-a*C,y:-h*g+w+s*C,z:a*g-s*w+C}}}function jU(e){return e===wp||e===Tp}function g6t(e,t,r){if(h6t(e,t)||e.datum_type===zk||t.datum_type===zk)return r;var i=e.a,n=e.es;if(e.datum_type===CA){var o=p6t(e,!1,r);if(o!==0)return;i=tit,n=eit}var s=t.a,a=t.b,h=t.es;if(t.datum_type===CA&&(s=tit,a=kCt,h=eit),n===h&&i===s&&!jU(e.datum_type)&&!jU(t.datum_type))return r;if(r=UU(r,n,i),jU(e.datum_type)&&(r=d6t(r,e.datum_type,e.datum_params)),jU(t.datum_type)&&(r=f6t(r,t.datum_type,t.datum_params)),r=VU(r,h,s,a),t.datum_type===CA){var p=p6t(t,!0,r);if(p!==0)return}return r}function p6t(e,t,r){if(e.grids===null||e.grids.length===0)return console.log(\"Grid shift grids not found\"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},o=[];t:for(var s=0;s<e.grids.length;s++){var a=e.grids[s];if(o.push(a.name),a.isNull){n=i;break}if(a.grid===null){if(a.mandatory)return console.log(\"Unable to find mandatory grid '\"+a.name+\"'\"),-1;continue}for(var h=a.grid.subgrids,p=0,g=h.length;p<g;p++){var w=h[p],C=(Math.abs(w.del[1])+Math.abs(w.del[0]))/1e4,R=w.ll[0]-C,z=w.ll[1]-C,W=w.ll[0]+(w.lim[0]-1)*w.del[0]+C,Y=w.ll[1]+(w.lim[1]-1)*w.del[1]+C;if(!(z>i.y||R>i.x||Y<i.y||W<i.x)&&(n=o0e(i,t,w),!isNaN(n.x)))break t}}return isNaN(n.x)?(console.log(\"Failed to find a grid shift table for location '\"+-i.x*Fa+\" \"+i.y*Fa+\" tried: '\"+o+\"'\"),-1):(r.x=-n.x,r.y=n.y,0)}function o0e(e,t,r){var i={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return i;var n={x:e.x,y:e.y};n.x-=r.ll[0],n.y-=r.ll[1],n.x=qe(n.x-Math.PI)+Math.PI;var o=m6t(n,r);if(t){if(isNaN(o.x))return i;o.x=n.x-o.x,o.y=n.y-o.y;var s=9,a=1e-12,h,p;do{if(p=m6t(o,r),isNaN(p.x)){console.log(\"Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.\");break}h={x:n.x-(p.x+o.x),y:n.y-(p.y+o.y)},o.x+=h.x,o.y+=h.y}while(s--&&Math.abs(h.x)>a&&Math.abs(h.y)>a);if(s<0)return console.log(\"Inverse grid shift iterator failed to converge.\"),i;i.x=qe(o.x+r.ll[0]),i.y=o.y+r.ll[1]}else isNaN(o.x)||(i.x=e.x+o.x,i.y=e.y+o.y);return i}function m6t(e,t){var r={x:e.x/t.del[0],y:e.y/t.del[1]},i={x:Math.floor(r.x),y:Math.floor(r.y)},n={x:r.x-1*i.x,y:r.y-1*i.y},o={x:Number.NaN,y:Number.NaN},s;if(i.x<0||i.x>=t.lim[0]||i.y<0||i.y>=t.lim[1])return o;s=i.y*t.lim[0]+i.x;var a={x:t.cvs[s][0],y:t.cvs[s][1]};s++;var h={x:t.cvs[s][0],y:t.cvs[s][1]};s+=t.lim[0];var p={x:t.cvs[s][0],y:t.cvs[s][1]};s--;var g={x:t.cvs[s][0],y:t.cvs[s][1]},w=n.x*n.y,C=n.x*(1-n.y),R=(1-n.x)*(1-n.y),z=(1-n.x)*n.y;return o.x=R*a.x+C*h.x+z*g.x+w*p.x,o.y=R*a.y+C*h.y+z*g.y+w*p.y,o}function pit(e,t,r){var i=r.x,n=r.y,o=r.z||0,s,a,h,p={};for(h=0;h<3;h++)if(!(t&&h===2&&r.z===void 0))switch(h===0?(s=i,\"ew\".indexOf(e.axis[h])!==-1?a=\"x\":a=\"y\"):h===1?(s=n,\"ns\".indexOf(e.axis[h])!==-1?a=\"y\":a=\"x\"):(s=o,a=\"z\"),e.axis[h]){case\"e\":p[a]=s;break;case\"w\":p[a]=-s;break;case\"n\":p[a]=s;break;case\"s\":p[a]=-s;break;case\"u\":r[a]!==void 0&&(p.z=s);break;case\"d\":r[a]!==void 0&&(p.z=-s);break;default:return null}return p}function $U(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function y6t(e){A6t(e.x),A6t(e.y)}function A6t(e){if(typeof Number.isFinite==\"function\"){if(Number.isFinite(e))return;throw new TypeError(\"coordinates must be finite numbers\")}if(typeof e!=\"number\"||e!==e||!isFinite(e))throw new TypeError(\"coordinates must be finite numbers\")}function s0e(e,t){return(e.datum.datum_type===wp||e.datum.datum_type===Tp||e.datum.datum_type===CA)&&t.datumCode!==\"WGS84\"||(t.datum.datum_type===wp||t.datum.datum_type===Tp||t.datum.datum_type===CA)&&e.datumCode!==\"WGS84\"}function Zx(e,t,r,i){var n;Array.isArray(r)?r=$U(r):r={x:r.x,y:r.y,z:r.z,m:r.m};var o=r.z!==void 0;if(y6t(r),e.datum&&t.datum&&s0e(e,t)&&(n=new Sp(\"WGS84\"),r=Zx(e,n,r,i),e=n),i&&e.axis!==\"enu\"&&(r=pit(e,!1,r)),e.projName===\"longlat\")r={x:r.x*io,y:r.y*io,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),r=e.inverse(r),!r)return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=g6t(e.datum,t.datum,r),!!r)return r=r,t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),t.projName===\"longlat\"?r={x:r.x*Fa,y:r.y*Fa,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),i&&t.axis!==\"enu\"?pit(t,!0,r):(r&&!o&&delete r.z,r)}var _6t=Sp(\"WGS84\");function mit(e,t,r,i){var n,o,s;return Array.isArray(r)?(n=Zx(e,t,r,i)||{x:NaN,y:NaN},r.length>2?typeof e.name<\"u\"&&e.name===\"geocent\"||typeof t.name<\"u\"&&t.name===\"geocent\"?typeof n.z==\"number\"?[n.x,n.y,n.z].concat(r.slice(3)):[n.x,n.y,r[2]].concat(r.slice(3)):[n.x,n.y].concat(r.slice(2)):[n.x,n.y]):(o=Zx(e,t,r,i),s=Object.keys(r),s.length===2||s.forEach(function(a){if(typeof e.name<\"u\"&&e.name===\"geocent\"||typeof t.name<\"u\"&&t.name===\"geocent\"){if(a===\"x\"||a===\"y\"||a===\"z\")return}else if(a===\"x\"||a===\"y\")return;o[a]=r[a]}),o)}function GU(e){return e instanceof Sp?e:typeof e==\"object\"&&\"oProj\"in e?e.oProj:Sp(e)}function a0e(e,t,r){var i,n,o=!1,s;return typeof t>\"u\"?(n=GU(e),i=_6t,o=!0):(typeof t.x<\"u\"||Array.isArray(t))&&(r=t,n=GU(e),i=_6t,o=!0),i||(i=GU(e)),n||(n=GU(t)),r?mit(i,n,r):(s={forward:function(a,h){return mit(i,n,a,h)},inverse:function(a,h){return mit(n,i,a,h)}},o&&(s.oProj=n),s)}var v6t=a0e;var b6t=6,w6t=\"AJSAJS\",T6t=\"AFAFAF\",jS=65,Vu=73,sf=79,$k=86,Gk=90,S6t={forward:Ait,inverse:l0e,toPoint:yit};function Ait(e,t){return t=t||5,h0e(c0e({lat:e[1],lon:e[0]}),t)}function l0e(e){var t=_it(E6t(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function yit(e){var t=_it(E6t(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function git(e){return e*(Math.PI/180)}function x6t(e){return 180*(e/Math.PI)}function c0e(e){var t=e.lat,r=e.lon,i=6378137,n=.00669438,o=.9996,s,a,h,p,g,w,C,R=git(t),z=git(r),W,Y;Y=Math.floor((r+180)/6)+1,r===180&&(Y=60),t>=56&&t<64&&r>=3&&r<12&&(Y=32),t>=72&&t<84&&(r>=0&&r<9?Y=31:r>=9&&r<21?Y=33:r>=21&&r<33?Y=35:r>=33&&r<42&&(Y=37)),s=(Y-1)*6-180+3,W=git(s),a=n/(1-n),h=i/Math.sqrt(1-n*Math.sin(R)*Math.sin(R)),p=Math.tan(R)*Math.tan(R),g=a*Math.cos(R)*Math.cos(R),w=Math.cos(R)*(z-W),C=i*((1-n/4-3*n*n/64-5*n*n*n/256)*R-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*R)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*R)-35*n*n*n/3072*Math.sin(6*R));var H=o*h*(w+(1-p+g)*w*w*w/6+(5-18*p+p*p+72*g-58*a)*w*w*w*w*w/120)+5e5,Q=o*(C+h*Math.tan(R)*(w*w/2+(5-p+9*g+4*g*g)*w*w*w*w/24+(61-58*p+p*p+600*g-330*a)*w*w*w*w*w*w/720));return t<0&&(Q+=1e7),{northing:Math.round(Q),easting:Math.round(H),zoneNumber:Y,zoneLetter:u0e(t)}}function _it(e){var t=e.northing,r=e.easting,i=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var o=.9996,s=6378137,a=.00669438,h,p=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),g,w,C,R,z,W,Y,H,Q,tt=r-5e5,rt=t;i<\"N\"&&(rt-=1e7),Y=(n-1)*6-180+3,h=a/(1-a),W=rt/o,H=W/(s*(1-a/4-3*a*a/64-5*a*a*a/256)),Q=H+(3*p/2-27*p*p*p/32)*Math.sin(2*H)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*H)+151*p*p*p/96*Math.sin(6*H),g=s/Math.sqrt(1-a*Math.sin(Q)*Math.sin(Q)),w=Math.tan(Q)*Math.tan(Q),C=h*Math.cos(Q)*Math.cos(Q),R=s*(1-a)/Math.pow(1-a*Math.sin(Q)*Math.sin(Q),1.5),z=tt/(g*o);var at=Q-g*Math.tan(Q)/R*(z*z/2-(5+3*w+10*C-4*C*C-9*h)*z*z*z*z/24+(61+90*w+298*C+45*w*w-252*h-3*C*C)*z*z*z*z*z*z/720);at=x6t(at);var et=(z-(1+2*w+C)*z*z*z/6+(5-2*C+28*w-3*C*C+8*h+24*w*w)*z*z*z*z*z/120)/Math.cos(Q);et=Y+x6t(et);var lt;if(e.accuracy){var J=_it({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});lt={top:J.lat,right:J.lon,bottom:at,left:et}}else lt={lat:at,lon:et};return lt}function u0e(e){var t=\"Z\";return 84>=e&&e>=72?t=\"X\":72>e&&e>=64?t=\"W\":64>e&&e>=56?t=\"V\":56>e&&e>=48?t=\"U\":48>e&&e>=40?t=\"T\":40>e&&e>=32?t=\"S\":32>e&&e>=24?t=\"R\":24>e&&e>=16?t=\"Q\":16>e&&e>=8?t=\"P\":8>e&&e>=0?t=\"N\":0>e&&e>=-8?t=\"M\":-8>e&&e>=-16?t=\"L\":-16>e&&e>=-24?t=\"K\":-24>e&&e>=-32?t=\"J\":-32>e&&e>=-40?t=\"H\":-40>e&&e>=-48?t=\"G\":-48>e&&e>=-56?t=\"F\":-56>e&&e>=-64?t=\"E\":-64>e&&e>=-72?t=\"D\":-72>e&&e>=-80&&(t=\"C\"),t}function h0e(e,t){var r=\"00000\"+e.easting,i=\"00000\"+e.northing;return e.zoneNumber+e.zoneLetter+d0e(e.easting,e.northing,e.zoneNumber)+r.substr(r.length-5,t)+i.substr(i.length-5,t)}function d0e(e,t,r){var i=M6t(r),n=Math.floor(e/1e5),o=Math.floor(t/1e5)%20;return f0e(n,o,i)}function M6t(e){var t=e%b6t;return t===0&&(t=b6t),t}function f0e(e,t,r){var i=r-1,n=w6t.charCodeAt(i),o=T6t.charCodeAt(i),s=n+e-1,a=o+t,h=!1;s>Gk&&(s=s-Gk+jS-1,h=!0),(s===Vu||n<Vu&&s>Vu||(s>Vu||n<Vu)&&h)&&s++,(s===sf||n<sf&&s>sf||(s>sf||n<sf)&&h)&&(s++,s===Vu&&s++),s>Gk&&(s=s-Gk+jS-1),a>$k?(a=a-$k+jS-1,h=!0):h=!1,(a===Vu||o<Vu&&a>Vu||(a>Vu||o<Vu)&&h)&&a++,(a===sf||o<sf&&a>sf||(a>sf||o<sf)&&h)&&(a++,a===Vu&&a++),a>$k&&(a=a-$k+jS-1);var p=String.fromCharCode(s)+String.fromCharCode(a);return p}function E6t(e){if(e&&e.length===0)throw\"MGRSPoint coverting from nothing\";for(var t=e.length,r=null,i=\"\",n,o=0;!/[A-Z]/.test(n=e.charAt(o));){if(o>=2)throw\"MGRSPoint bad conversion from: \"+e;i+=n,o++}var s=parseInt(i,10);if(o===0||o+3>t)throw\"MGRSPoint bad conversion from: \"+e;var a=e.charAt(o++);if(a<=\"A\"||a===\"B\"||a===\"Y\"||a>=\"Z\"||a===\"I\"||a===\"O\")throw\"MGRSPoint zone letter \"+a+\" not handled: \"+e;r=e.substring(o,o+=2);for(var h=M6t(s),p=p0e(r.charAt(0),h),g=m0e(r.charAt(1),h);g<g0e(a);)g+=2e6;var w=t-o;if(w%2!==0)throw`MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters`+e;var C=w/2,R=0,z=0,W,Y,H,Q,tt;return C>0&&(W=1e5/Math.pow(10,C),Y=e.substring(o,o+C),R=parseFloat(Y)*W,H=e.substring(o+C),z=parseFloat(H)*W),Q=R+p,tt=z+g,{easting:Q,northing:tt,zoneLetter:a,zoneNumber:s,accuracy:W}}function p0e(e,t){for(var r=w6t.charCodeAt(t-1),i=1e5,n=!1;r!==e.charCodeAt(0);){if(r++,r===Vu&&r++,r===sf&&r++,r>Gk){if(n)throw\"Bad character: \"+e;r=jS,n=!0}i+=1e5}return i}function m0e(e,t){if(e>\"V\")throw\"MGRSPoint given invalid Northing \"+e;for(var r=T6t.charCodeAt(t-1),i=0,n=!1;r!==e.charCodeAt(0);){if(r++,r===Vu&&r++,r===sf&&r++,r>$k){if(n)throw\"Bad character: \"+e;r=jS,n=!0}i+=1e5}return i}function g0e(e){var t;switch(e){case\"C\":t=11e5;break;case\"D\":t=2e6;break;case\"E\":t=28e5;break;case\"F\":t=37e5;break;case\"G\":t=46e5;break;case\"H\":t=55e5;break;case\"J\":t=64e5;break;case\"K\":t=73e5;break;case\"L\":t=82e5;break;case\"M\":t=91e5;break;case\"N\":t=0;break;case\"P\":t=8e5;break;case\"Q\":t=17e5;break;case\"R\":t=26e5;break;case\"S\":t=35e5;break;case\"T\":t=44e5;break;case\"U\":t=53e5;break;case\"V\":t=62e5;break;case\"W\":t=7e6;break;case\"X\":t=79e5;break;default:t=-1}if(t>=0)return t;throw\"Invalid zone letter: \"+e}function $S(e,t,r){if(!(this instanceof $S))return new $S(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==\"object\")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==\"string\"&&typeof t>\"u\"){var i=e.split(\",\");this.x=parseFloat(i[0]),this.y=parseFloat(i[1]),this.z=parseFloat(i[2])||0}else this.x=e,this.y=t,this.z=r||0;console.warn(\"proj4.Point will be removed in version 3, use proj4.toPoint\")}$S.fromMGRS=function(e){return new $S(yit(e))};$S.prototype.toMGRS=function(e){return Ait([this.x,this.y],e)};var P6t=$S;var A0e=1,y0e=.25,C6t=.046875,I6t=.01953125,k6t=.01068115234375,_0e=.75,v0e=.46875,b0e=.013020833333333334,x0e=.007120768229166667,w0e=.3645833333333333,T0e=.005696614583333333,S0e=.3076171875;function GS(e){var t=[];t[0]=A0e-e*(y0e+e*(C6t+e*(I6t+e*k6t))),t[1]=e*(_0e-e*(C6t+e*(I6t+e*k6t)));var r=e*e;return t[2]=r*(v0e-e*(b0e+e*x0e)),r*=e,t[3]=r*(w0e-e*T0e),t[4]=r*e*S0e,t}function dm(e,t,r,i){return r*=t,t*=t,i[0]*e-r*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var M0e=20;function WS(e,t,r){for(var i=1/(1-t),n=e,o=M0e;o;--o){var s=Math.sin(n),a=1-t*s*s;if(a=(dm(n,s,Math.cos(n),r)-e)*(a*Math.sqrt(a))*i,n-=a,Math.abs(a)<Ge)return n}return n}function E0e(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=GS(this.es),this.ml0=dm(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function P0e(e){var t=e.x,r=e.y,i=qe(t-this.long0,this.over),n,o,s,a=Math.sin(r),h=Math.cos(r);if(this.es){var g=h*i,w=Math.pow(g,2),C=this.ep2*Math.pow(h,2),R=Math.pow(C,2),z=Math.abs(h)>Ge?Math.tan(r):0,W=Math.pow(z,2),Y=Math.pow(W,2);n=1-this.es*Math.pow(a,2),g=g/Math.sqrt(n);var H=dm(r,a,h,this.en);o=this.a*(this.k0*g*(1+w/6*(1-W+C+w/20*(5-18*W+Y+14*C-58*W*C+w/42*(61+179*Y-Y*W-479*W)))))+this.x0,s=this.a*(this.k0*(H-this.ml0+a*i*g/2*(1+w/12*(5-W+9*C+4*R+w/30*(61+Y-58*W+270*C-330*W*C+w/56*(1385+543*Y-Y*W-3111*W))))))+this.y0}else{var p=h*Math.sin(i);if(Math.abs(Math.abs(p)-1)<Ge)return 93;if(o=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,s=h*Math.cos(i)/Math.sqrt(1-Math.pow(p,2)),p=Math.abs(s),p>=1){if(p-1>Ge)return 93;s=0}else s=Math.acos(s);r<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return e.x=o,e.y=s,e}function C0e(e){var t,r,i,n,o=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+s/this.k0,r=WS(t,this.es,this.en),Math.abs(r)<Oe){var w=Math.sin(r),C=Math.cos(r),R=Math.abs(C)>Ge?Math.tan(r):0,z=this.ep2*Math.pow(C,2),W=Math.pow(z,2),Y=Math.pow(R,2),H=Math.pow(Y,2);t=1-this.es*Math.pow(w,2);var Q=o*Math.sqrt(t)/this.k0,tt=Math.pow(Q,2);t=t*R,i=r-t*tt/(1-this.es)*.5*(1-tt/12*(5+3*Y-9*z*Y+z-4*W-tt/30*(61+90*Y-252*z*Y+45*H+46*z-tt/56*(1385+3633*Y+4095*H+1574*H*Y)))),n=qe(this.long0+Q*(1-tt/6*(1+2*Y+z-tt/20*(5+28*Y+24*H+8*z*Y+6*z-tt/42*(61+662*Y+1320*H+720*H*Y))))/C,this.over)}else i=Oe*hm(s),n=0;else{var a=Math.exp(o/this.k0),h=.5*(a-1/a),p=this.lat0+s/this.k0,g=Math.cos(p);t=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(h,2))),i=Math.asin(t),s<0&&(i=-i),h===0&&g===0?n=0:n=qe(Math.atan2(h,g)+this.long0,this.over)}return e.x=n,e.y=i,e}var I0e=[\"Fast_Transverse_Mercator\",\"Fast Transverse Mercator\"],qS={init:E0e,forward:P0e,inverse:C0e,names:I0e};function WU(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function va(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),i=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function R6t(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function D6t(e){var t=Math.abs(e);return t=R6t(t*(1+t/(va(1,t)+1))),e<0?-t:t}function qU(e,t){for(var r=2*Math.cos(2*t),i=e.length-1,n=e[i],o=0,s;--i>=0;)s=-o+r*n+e[i],o=n,n=s;return t+s*Math.sin(2*t)}function O6t(e,t){for(var r=2*Math.cos(t),i=e.length-1,n=e[i],o=0,s;--i>=0;)s=-o+r*n+e[i],o=n,n=s;return Math.sin(t)*s}function L6t(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function vit(e,t,r){for(var i=Math.sin(t),n=Math.cos(t),o=WU(r),s=L6t(r),a=2*n*s,h=-2*i*o,p=e.length-1,g=e[p],w=0,C=0,R=0,z,W;--p>=0;)z=C,W=w,C=g,w=R,g=-z+a*C-h*w+e[p],R=-W+h*C+a*w;return a=i*s,h=n*o,[a*g-h*R,a*R+h*g]}function k0e(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');this.approx&&(qS.init.apply(this),this.forward=qS.forward,this.inverse=qS.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var i=qU(this.cbg,this.lat0);this.Zb=-this.Qn*(i+O6t(this.gtu,2*i))}function R0e(e){var t=qe(e.x-this.long0,this.over),r=e.y;r=qU(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),o=Math.sin(t),s=Math.cos(t);r=Math.atan2(i,s*n),t=Math.atan2(o*n,va(i,n*s)),t=D6t(Math.tan(t));var a=vit(this.gtu,2*r,2*t);r=r+a[0],t=t+a[1];var h,p;return Math.abs(t)<=2.623395162778?(h=this.a*(this.Qn*t)+this.x0,p=this.a*(this.Qn*r+this.Zb)+this.y0):(h=1/0,p=1/0),e.x=h,e.y=p,e}function D0e(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var i,n;if(Math.abs(t)<=2.623395162778){var o=vit(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(WU(t));var s=Math.sin(r),a=Math.cos(r),h=Math.sin(t),p=Math.cos(t);r=Math.atan2(s*p,va(h,p*a)),t=Math.atan2(h,p*a),i=qe(t+this.long0,this.over),n=qU(this.cgb,r)}else i=1/0,n=1/0;return e.x=i,e.y=n,e}var O0e=[\"Extended_Transverse_Mercator\",\"Extended Transverse Mercator\",\"etmerc\",\"Transverse_Mercator\",\"Transverse Mercator\",\"Gauss Kruger\",\"Gauss_Kruger\",\"tmerc\"],HS={init:k0e,forward:R0e,inverse:D0e,names:O0e};function B6t(e,t){if(e===void 0){if(e=Math.floor((qe(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var L0e=\"etmerc\";function B0e(){var e=B6t(this.zone,this.long0);if(e===void 0)throw new Error(\"unknown utm zone\");this.lat0=0,this.long0=(6*Math.abs(e)-183)*io,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,HS.init.apply(this),this.forward=HS.forward,this.inverse=HS.inverse}var F0e=[\"Universal Transverse Mercator System\",\"utm\"],F6t={init:B0e,names:F0e,dependsOn:L0e};function HU(e,t){return Math.pow((1-e)/(1+e),t)}var N0e=20;function z0e(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+an)/(Math.pow(Math.tan(.5*this.lat0+an),this.C)*HU(this.e*e,this.ratexp))}function U0e(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+an),this.C)*HU(this.e*Math.sin(r),this.ratexp))-Oe,e.x=this.C*t,e}function V0e(e){for(var t=1e-14,r=e.x/this.C,i=e.y,n=Math.pow(Math.tan(.5*i+an)/this.K,1/this.C),o=N0e;o>0&&(i=2*Math.atan(n*HU(this.e*Math.sin(e.y),-.5*this.e))-Oe,!(Math.abs(i-e.y)<t));--o)e.y=i;return o?(e.x=r,e.y=i,e):null}var j0e=[\"gauss\"],YU={init:z0e,forward:U0e,inverse:V0e,names:j0e};function $0e(){YU.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title=\"Oblique Stereographic Alternative\"))}function G0e(e){var t,r,i,n;return e.x=qe(e.x-this.long0,this.over),YU.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),i=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*i),e.x=n*r*Math.sin(e.x),e.y=n*(this.cosc0*t-this.sinc0*r*i),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function W0e(e){var t,r,i,n,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=va(e.x,e.y)){var s=2*Math.atan2(o,this.R2);t=Math.sin(s),r=Math.cos(s),n=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),i=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else n=this.phic0,i=0;return e.x=i,e.y=n,YU.inverse.apply(this,[e]),e.x=qe(e.x+this.long0,this.over),e}var q0e=[\"Stereographic_North_Pole\",\"Oblique_Stereographic\",\"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"],N6t={init:$0e,forward:G0e,inverse:W0e,names:q0e};function bit(e,t,r){return t*=r,Math.tan(.5*(Oe+e))*Math.pow((1-t)/(1+t),.5*r)}function H0e(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Ge&&(this.k0=.5*(1+hm(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Ge&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Ge&&Math.abs(Math.cos(this.lat_ts))>Ge&&(this.k0=.5*this.cons*fc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Zc(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=fc(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(bit(this.lat0,this.sinlat0,this.e))-Oe,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Y0e(e){var t=e.x,r=e.y,i=Math.sin(r),n=Math.cos(r),o,s,a,h,p,g,w=qe(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Ge&&Math.abs(r+this.lat0)<=Ge?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*i+this.coslat0*n*Math.cos(w)),e.x=this.a*o*n*Math.sin(w)+this.x0,e.y=this.a*o*(this.coslat0*i-this.sinlat0*n*Math.cos(w))+this.y0,e):(s=2*Math.atan(bit(r,i,this.e))-Oe,h=Math.cos(s),a=Math.sin(s),Math.abs(this.coslat0)<=Ge?(p=Zc(this.e,r*this.con,this.con*i),g=2*this.a*this.k0*p/this.cons,e.x=this.x0+g*Math.sin(t-this.long0),e.y=this.y0-this.con*g*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Ge?(o=2*this.a*this.k0/(1+h*Math.cos(w)),e.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(w))),e.y=o*(this.cosX0*a-this.sinX0*h*Math.cos(w))+this.y0),e.x=o*h*Math.sin(w)+this.x0,e))}function X0e(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,n,o,s=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var a=2*Math.atan(s/(2*this.a*this.k0));return t=this.long0,r=this.lat0,s<=Ge?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(a)*this.sinlat0+e.y*Math.sin(a)*this.coslat0/s),Math.abs(this.coslat0)<Ge?this.lat0>0?t=qe(this.long0+Math.atan2(e.x,-1*e.y),this.over):t=qe(this.long0+Math.atan2(e.x,e.y),this.over):t=qe(this.long0+Math.atan2(e.x*Math.sin(a),s*this.coslat0*Math.cos(a)-e.y*this.sinlat0*Math.sin(a)),this.over),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=Ge){if(s<=Ge)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,i=s*this.cons/(2*this.a*this.k0),r=this.con*kA(this.e,i),t=this.con*qe(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else n=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,s<=Ge?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/s),t=qe(this.long0+Math.atan2(e.x*Math.sin(n),s*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)),this.over)),r=-1*kA(this.e,Math.tan(.5*(Oe+o)));return e.x=t,e.y=r,e}var Z0e=[\"stere\",\"Stereographic_South_Pole\",\"Polar_Stereographic_variant_A\",\"Polar_Stereographic_variant_B\",\"Polar_Stereographic\"],z6t={init:H0e,forward:Y0e,inverse:X0e,names:Z0e,ssfn_:bit};function K0e(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,i=this.rf,n=1/i,o=2*n-Math.pow(n,2),s=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+e/2)),p=Math.log((1+s*t)/(1-s*t));this.K=a-this.alpha*h+this.alpha*s/2*p}function Q0e(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),i=-this.alpha*(t+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*s+this.x0,e}function J0e(e){for(var t=e.x-this.x0,r=e.y-this.y0,i=t/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),s=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+s/this.alpha,h=0,p=o,g=-1e3,w=0;Math.abs(p-g)>1e-7;){if(++w>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(p))/2)),g=p,p=2*Math.atan(Math.exp(h))-Math.PI/2}return e.x=a,e.y=p,e}var tme=[\"somerc\"],U6t={init:K0e,forward:Q0e,inverse:J0e,names:tme};var YS=1e-7;function eme(e){var t=[\"Hotine_Oblique_Mercator\",\"Hotine_Oblique_Mercator_variant_A\",\"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\"],r=typeof e.projName==\"object\"?Object.keys(e.projName)[0]:e.projName;return\"no_uoff\"in e||\"no_off\"in e||t.indexOf(r)!==-1||t.indexOf(cit(r))!==-1}function rme(){var e,t,r,i,n,o,s,a,h,p,g=0,w,C=0,R=0,z=0,W=0,Y=0,H=0;this.no_off=eme(this),this.no_rot=\"no_rot\"in this;var Q=!1;\"alpha\"in this&&(Q=!0);var tt=!1;if(\"rectified_grid_angle\"in this&&(tt=!0),Q&&(H=this.alpha),tt&&(g=this.rectified_grid_angle),Q||tt)C=this.longc;else if(R=this.long1,W=this.lat1,z=this.long2,Y=this.lat2,Math.abs(W-Y)<=YS||(e=Math.abs(W))<=YS||Math.abs(e-Oe)<=YS||Math.abs(Math.abs(this.lat0)-Oe)<=YS||Math.abs(Math.abs(Y)-Oe)<=YS)throw new Error;var rt=1-this.es;t=Math.sqrt(rt),Math.abs(this.lat0)>Ge?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/rt),this.A=this.B*this.k0*t/e,i=this.B*t/(r*Math.sqrt(e)),n=i*i-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(Zc(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=n=1),Q||tt?(Q?(w=Math.asin(Math.sin(H)/i),tt||(g=H)):(w=g,H=Math.asin(i*Math.sin(w))),this.lam0=C-Math.asin(.5*(n-1/n)*Math.tan(w))/this.B):(o=Math.pow(Zc(this.e,W,Math.sin(W)),this.B),s=Math.pow(Zc(this.e,Y,Math.sin(Y)),this.B),n=this.E/o,h=(s-o)/(s+o),p=this.E*this.E,p=(p-s*o)/(p+s*o),e=R-z,e<-Math.PI?z-=S_:e>Math.PI&&(z+=S_),this.lam0=qe(.5*(R+z)-Math.atan(p*Math.tan(.5*this.B*(R-z))/h)/this.B,this.over),w=Math.atan(2*Math.sin(this.B*qe(R-this.lam0,this.over))/(n-1/n)),g=H=Math.asin(i*Math.sin(w))),this.singam=Math.sin(w),this.cosgam=Math.cos(w),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(H))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*w,this.v_pole_n=this.ArB*Math.log(Math.tan(an-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(an+n))}function ime(e){var t={},r,i,n,o,s,a,h,p;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Oe)>Ge){if(s=this.E/Math.pow(Zc(this.e,e.y,Math.sin(e.y)),this.B),a=1/s,r=.5*(s-a),i=.5*(s+a),o=Math.sin(this.B*e.x),n=(r*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(n)-1)<Ge)throw new Error;p=.5*this.ArB*Math.log((1-n)/(1+n)),a=Math.cos(this.B*e.x),Math.abs(a)<YS?h=this.A*e.x:h=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,a)}else p=e.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*e.y;return this.no_rot?(t.x=h,t.y=p):(h-=this.u_0,t.x=p*this.cosrot+h*this.sinrot,t.y=h*this.cosrot-p*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function nme(e){var t,r,i,n,o,s,a,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*r),n=.5*(i-1/i),o=.5*(i+1/i),s=Math.sin(this.BrA*t),a=(s*this.cosgam+n*this.singam)/o,Math.abs(Math.abs(a)-1)<Ge)h.x=0,h.y=a<0?-Oe:Oe;else{if(h.y=this.E/Math.sqrt((1+a)/(1-a)),h.y=kA(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(n*this.cosgam-s*this.singam,Math.cos(this.BrA*t))}return h.x+=this.lam0,h}var ome=[\"Hotine_Oblique_Mercator\",\"Hotine Oblique Mercator\",\"Hotine_Oblique_Mercator_variant_A\",\"Hotine_Oblique_Mercator_Variant_B\",\"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\",\"Hotine_Oblique_Mercator_Two_Point_Natural_Origin\",\"Hotine_Oblique_Mercator_Azimuth_Center\",\"Oblique_Mercator\",\"omerc\"],V6t={init:rme,forward:ime,inverse:nme,names:ome};function sme(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Ge)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),i=fc(this.e,t,r),n=Zc(this.e,this.lat1,t),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=fc(this.e,o,s),h=Zc(this.e,this.lat2,o),p=Math.abs(Math.abs(this.lat0)-Oe)<Ge?0:Zc(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Ge?this.ns=Math.log(i/a)/Math.log(n/h):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(p,this.ns),this.title||(this.title=\"Lambert Conformal Conic\")}}function ame(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Ge&&(r=hm(r)*(Oe-2*Ge));var i=Math.abs(Math.abs(r)-Oe),n,o;if(i>Ge)n=Zc(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(n,this.ns);else{if(i=r*this.ns,i<=0)return null;o=0}var s=this.ns*qe(t-this.long0,this.over);return e.x=this.k0*(o*Math.sin(s))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(s))+this.y0,e}function lme(e){var t,r,i,n,o,s=(e.x-this.x0)/this.k0,a=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(s*s+a*a),r=1):(t=-Math.sqrt(s*s+a*a),r=-1);var h=0;if(t!==0&&(h=Math.atan2(r*s,r*a)),t!==0||this.ns>0){if(r=1/this.ns,i=Math.pow(t/(this.a*this.f0),r),n=kA(this.e,i),n===-9999)return null}else n=-Oe;return o=qe(h/this.ns+this.long0,this.over),e.x=o,e.y=n,e}var cme=[\"Lambert Tangential Conformal Conic Projection\",\"Lambert_Conformal_Conic\",\"Lambert_Conformal_Conic_1SP\",\"Lambert_Conformal_Conic_2SP\",\"lcc\",\"Lambert Conic Conformal (1SP)\",\"Lambert Conic Conformal (2SP)\"],j6t={init:sme,forward:ame,inverse:lme,names:cme};function ume(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function hme(e){var t,r,i,n,o,s,a,h=e.x,p=e.y,g=qe(h-this.long0,this.over);return t=Math.pow((1+this.e*Math.sin(p))/(1-this.e*Math.sin(p)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(p/2+this.s45),this.alfa)/t)-this.s45),i=-g*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),o=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=a*Math.cos(s)/1,e.x=a*Math.sin(s)/1,this.czech||(e.y*=-1,e.x*=-1),e}function dme(e){var t,r,i,n,o,s,a,h,p=e.x;e.x=e.y,e.y=p,this.czech||(e.y*=-1,e.x*=-1),s=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),n=o/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(t)),e.x=this.long0-r/this.alfa,a=t,h=0;var g=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(h=1),a=e.y,g+=1;while(h===0&&g<15);return g>=15?null:e}var fme=[\"Krovak\",\"Krovak Modified\",\"Krovak (North Orientated)\",\"Krovak Modified (North Orientated)\",\"krovak\"],$6t={init:ume,forward:hme,inverse:dme,names:fme};function Na(e,t,r,i,n){return e*n-t*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function RA(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function DA(e){return .375*e*(1+.25*e*(1+.46875*e))}function OA(e){return .05859375*e*e*(1+.75*e)}function LA(e){return e*e*e*(35/3072)}function Wk(e,t,r){var i=t*r;return e/Math.sqrt(1-i*i)}function ju(e){return Math.abs(e)<Oe?e:e-hm(e)*Math.PI}function Kx(e,t,r,i,n){var o,s;o=e/t;for(var a=0;a<15;a++)if(s=(e-(t*o-r*Math.sin(2*o)+i*Math.sin(4*o)-n*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*i*Math.cos(4*o)-6*n*Math.cos(6*o)),o+=s,Math.abs(s)<=1e-10)return o;return NaN}function pme(){this.sphere||(this.e0=RA(this.es),this.e1=DA(this.es),this.e2=OA(this.es),this.e3=LA(this.es),this.ml0=this.a*Na(this.e0,this.e1,this.e2,this.e3,this.lat0))}function mme(e){var t,r,i=e.x,n=e.y;if(i=qe(i-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(i)),r=this.a*(Math.atan2(Math.tan(n),Math.cos(i))-this.lat0);else{var o=Math.sin(n),s=Math.cos(n),a=Wk(this.a,this.e,o),h=Math.tan(n)*Math.tan(n),p=i*Math.cos(n),g=p*p,w=this.es*s*s/(1-this.es),C=this.a*Na(this.e0,this.e1,this.e2,this.e3,n);t=a*p*(1-g*h*(1/6-(8-h+8*w)*g/120)),r=C-this.ml0+a*o/s*g*(.5+(5-h+6*w)*g/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function gme(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,i,n;if(this.sphere){var o=r+this.lat0;i=Math.asin(Math.sin(o)*Math.cos(t)),n=Math.atan2(Math.tan(t),Math.cos(o))}else{var s=this.ml0/this.a+r,a=Kx(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-Oe)<=Ge)return e.x=this.long0,e.y=Oe,r<0&&(e.y*=-1),e;var h=Wk(this.a,this.e,Math.sin(a)),p=h*h*h/this.a/this.a*(1-this.es),g=Math.pow(Math.tan(a),2),w=t*this.a/h,C=w*w;i=a-h*Math.tan(a)/p*w*w*(.5-(1+3*g)*w*w/24),n=w*(1-C*(g/3+(1+3*g)*g*C/15))/Math.cos(a)}return e.x=qe(n+this.long0,this.over),e.y=ju(i),e}var Ame=[\"Cassini\",\"Cassini_Soldner\",\"cass\"],G6t={init:pme,forward:mme,inverse:gme,names:Ame};function Mp(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var xit=1,wit=2,Tit=3,XU=4;function yme(){var e=Math.abs(this.lat0);if(Math.abs(e-Oe)<Ge?this.mode=this.lat0<0?xit:wit:Math.abs(e)<Ge?this.mode=Tit:this.mode=XU,this.es>0){var t;switch(this.qp=Mp(this.e,1),this.mmf=.5/(1-this.es),this.apa=Eme(this.es),this.mode){case wit:this.dd=1;break;case xit:this.dd=1;break;case Tit:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case XU:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Mp(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===XU&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function _me(e){var t,r,i,n,o,s,a,h,p,g,w=e.x,C=e.y;if(w=qe(w-this.long0,this.over),this.sphere){if(o=Math.sin(C),g=Math.cos(C),i=Math.cos(w),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+g*i:1+this.sinph0*o+this.cosph0*g*i,r<=Ge)return null;r=Math.sqrt(2/r),t=r*g*Math.sin(w),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*g*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(C+this.lat0)<Ge)return null;r=an-C*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(w),r*=i}}else{switch(a=0,h=0,p=0,i=Math.cos(w),n=Math.sin(w),o=Math.sin(C),s=Mp(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=s/this.qp,h=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:p=1+this.sinb1*a+this.cosb1*h*i;break;case this.EQUIT:p=1+h*i;break;case this.N_POLE:p=Oe+C,s=this.qp-s;break;case this.S_POLE:p=C-Oe,s=this.qp+s;break}if(Math.abs(p)<Ge)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:p=Math.sqrt(2/p),this.mode===this.OBLIQ?r=this.ymf*p*(this.cosb1*a-this.sinb1*h*i):r=(p=Math.sqrt(2/(1+h*i)))*a*this.ymf,t=this.xmf*p*h*n;break;case this.N_POLE:case this.S_POLE:s>=0?(t=(p=Math.sqrt(s))*n,r=i*(this.mode===this.S_POLE?p:-p)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function vme(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,i,n,o,s,a,h,p;if(this.sphere){var g=0,w,C=0;if(w=Math.sqrt(t*t+r*r),n=w*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(C=Math.sin(n),g=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(w)<=Ge?0:Math.asin(r*C/w),t*=C,r=g*w;break;case this.OBLIQ:n=Math.abs(w)<=Ge?this.lat0:Math.asin(g*this.sinph0+r*C*this.cosph0/w),t*=C*this.cosph0,r=(g-Math.sin(n)*this.sinph0)*w;break;case this.N_POLE:r=-r,n=Oe-n;break;case this.S_POLE:n-=Oe;break}i=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(p=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,h=Math.sqrt(t*t+r*r),h<Ge)return e.x=this.long0,e.y=this.lat0,e;s=2*Math.asin(.5*h/this.rq),o=Math.cos(s),t*=s=Math.sin(s),this.mode===this.OBLIQ?(p=o*this.sinb1+r*s*this.cosb1/h,a=this.qp*p,r=h*this.cosb1*o-r*this.sinb1*s):(p=r*s/h,a=this.qp*p,r=h*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),a=t*t+r*r,!a)return e.x=this.long0,e.y=this.lat0,e;p=1-a/this.qp,this.mode===this.S_POLE&&(p=-p)}i=Math.atan2(t,r),n=Pme(Math.asin(p),this.apa)}return e.x=qe(this.long0+i,this.over),e.y=n,e}var bme=.3333333333333333,xme=.17222222222222222,wme=.10257936507936508,Tme=.06388888888888888,Sme=.0664021164021164,Mme=.016415012942191543;function Eme(e){var t,r=[];return r[0]=e*bme,t=e*e,r[0]+=t*xme,r[1]=t*Tme,t*=e,r[0]+=t*wme,r[1]+=t*Sme,r[2]=t*Mme,r}function Pme(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var Cme=[\"Lambert Azimuthal Equal Area\",\"Lambert_Azimuthal_Equal_Area\",\"laea\"],W6t={init:yme,forward:_me,inverse:vme,names:Cme,S_POLE:xit,N_POLE:wit,EQUIT:Tit,OBLIQ:XU};function $u(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function Ime(){Math.abs(this.lat1+this.lat2)<Ge||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=fc(this.e3,this.sin_po,this.cos_po),this.qs1=Mp(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=fc(this.e3,this.sin_po,this.cos_po),this.qs2=Mp(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Mp(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Ge?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function kme(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=Mp(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,o=this.ns0*qe(t-this.long0,this.over),s=n*Math.sin(o)+this.x0,a=this.rh-n*Math.cos(o)+this.y0;return e.x=s,e.y=a,e}function Rme(e){var t,r,i,n,o,s;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),i=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),n=0,t!==0&&(n=Math.atan2(i*e.x,i*e.y)),i=t*this.ns0/this.a,this.sphere?s=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,s=this.phi1z(this.e3,r)),o=qe(n/this.ns0+this.long0,this.over),e.x=o,e.y=s,e}function Dme(e,t){var r,i,n,o,s,a=$u(.5*t);if(e<Ge)return a;for(var h=e*e,p=1;p<=25;p++)if(r=Math.sin(a),i=Math.cos(a),n=e*r,o=1-n*n,s=.5*o*o/i*(t/(1-h)-r/o+.5/e*Math.log((1-n)/(1+n))),a=a+s,Math.abs(s)<=1e-7)return a;return null}var Ome=[\"Albers_Conic_Equal_Area\",\"Albers_Equal_Area\",\"Albers\",\"aea\"],q6t={init:Ime,forward:kme,inverse:Rme,names:Ome,phi1z:Dme};function Lme(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Bme(e){var t,r,i,n,o,s,a,h,p=e.x,g=e.y;return i=qe(p-this.long0,this.over),t=Math.sin(g),r=Math.cos(g),n=Math.cos(i),s=this.sin_p14*t+this.cos_p14*r*n,o=1,s>0||Math.abs(s)<=Ge?(a=this.x0+this.a*o*r*Math.sin(i)/s,h=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*n)/s):(a=this.x0+this.infinity_dist*r*Math.sin(i),h=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*n)),e.x=a,e.y=h,e}function Fme(e){var t,r,i,n,o,s;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(n=Math.atan2(t,this.rc),r=Math.sin(n),i=Math.cos(n),s=$u(i*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),o=qe(this.long0+o,this.over)):(s=this.phic0,o=0),e.x=o,e.y=s,e}var Nme=[\"gnom\"],H6t={init:Lme,forward:Bme,inverse:Fme,names:Nme};function Y6t(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*Oe:Oe;for(var i=Math.asin(.5*t),n,o,s,a,h=0;h<30;h++)if(o=Math.sin(i),s=Math.cos(i),a=e*o,n=Math.pow(1-a*a,2)/(2*s)*(t/(1-e*e)-o/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),i+=n,Math.abs(n)<=1e-10)return i;return NaN}function zme(){this.sphere||(this.k0=fc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Ume(e){var t=e.x,r=e.y,i,n,o=qe(t-this.long0,this.over);if(this.sphere)i=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var s=Mp(this.e,Math.sin(r));i=this.x0+this.a*this.k0*o,n=this.y0+this.a*s*.5/this.k0}return e.x=i,e.y=n,e}function Vme(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=qe(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=Y6t(this.e,2*e.y*this.k0/this.a),t=qe(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=r,e}var jme=[\"cea\"],X6t={init:zme,forward:Ume,inverse:Vme,names:jme};function $me(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||\"Equidistant Cylindrical (Plate Carre)\",this.rc=Math.cos(this.lat_ts)}function Gme(e){var t=e.x,r=e.y,i=qe(t-this.long0,this.over),n=ju(r-this.lat0);return e.x=this.x0+this.a*i*this.rc,e.y=this.y0+this.a*n,e}function Wme(e){var t=e.x,r=e.y;return e.x=qe(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=ju(this.lat0+(r-this.y0)/this.a),e}var qme=[\"Equirectangular\",\"Equidistant_Cylindrical\",\"Equidistant_Cylindrical_Spherical\",\"eqc\"],Z6t={init:$me,forward:Gme,inverse:Wme,names:qme};var K6t=20;function Hme(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=RA(this.es),this.e1=DA(this.es),this.e2=OA(this.es),this.e3=LA(this.es),this.ml0=this.a*Na(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Yme(e){var t=e.x,r=e.y,i,n,o,s=qe(t-this.long0,this.over);if(o=s*Math.sin(r),this.sphere)Math.abs(r)<=Ge?(i=this.a*s,n=-1*this.a*this.lat0):(i=this.a*Math.sin(o)/Math.tan(r),n=this.a*(ju(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=Ge)i=this.a*s,n=-1*this.ml0;else{var a=Wk(this.a,this.e,Math.sin(r))/Math.tan(r);i=a*Math.sin(o),n=this.a*Na(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+a*(1-Math.cos(o))}return e.x=i+this.x0,e.y=n+this.y0,e}function Xme(e){var t,r,i,n,o,s,a,h,p;if(i=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=Ge)t=qe(i/this.a+this.long0,this.over),r=0;else{s=this.lat0+n/this.a,a=i*i/this.a/this.a+s*s,h=s;var g;for(o=K6t;o;--o)if(g=Math.tan(h),p=-1*(s*(h*g+1)-h-.5*(h*h+a)*g)/((h-s)/g-1),h+=p,Math.abs(p)<=Ge){r=h;break}t=qe(this.long0+Math.asin(i*Math.tan(h)/this.a)/Math.sin(r),this.over)}else if(Math.abs(n+this.ml0)<=Ge)r=0,t=qe(this.long0+i/this.a,this.over);else{s=(this.ml0+n)/this.a,a=i*i/this.a/this.a+s*s,h=s;var w,C,R,z,W;for(o=K6t;o;--o)if(W=this.e*Math.sin(h),w=Math.sqrt(1-W*W)*Math.tan(h),C=this.a*Na(this.e0,this.e1,this.e2,this.e3,h),R=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),z=C/this.a,p=(s*(w*z+1)-z-.5*w*(z*z+a))/(this.es*Math.sin(2*h)*(z*z+a-2*s*z)/(4*w)+(s-z)*(w*R-2/Math.sin(2*h))-R),h-=p,Math.abs(p)<=Ge){r=h;break}w=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=qe(this.long0+Math.asin(i*w/this.a)/Math.sin(r),this.over)}return e.x=t,e.y=r,e}var Zme=[\"Polyconic\",\"American_Polyconic\",\"poly\"],Q6t={init:Hme,forward:Yme,inverse:Xme,names:Zme};function Kme(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Qme(e){var t,r=e.x,i=e.y,n=i-this.lat0,o=r-this.long0,s=n/Hx*1e-5,a=o,h=1,p=0;for(t=1;t<=10;t++)h=h*s,p=p+this.A[t]*h;var g=p,w=a,C=1,R=0,z,W,Y=0,H=0;for(t=1;t<=6;t++)z=C*g-R*w,W=R*g+C*w,C=z,R=W,Y=Y+this.B_re[t]*C-this.B_im[t]*R,H=H+this.B_im[t]*C+this.B_re[t]*R;return e.x=H*this.a+this.x0,e.y=Y*this.a+this.y0,e}function Jme(e){var t,r=e.x,i=e.y,n=r-this.x0,o=i-this.y0,s=o/this.a,a=n/this.a,h=1,p=0,g,w,C=0,R=0;for(t=1;t<=6;t++)g=h*s-p*a,w=p*s+h*a,h=g,p=w,C=C+this.C_re[t]*h-this.C_im[t]*p,R=R+this.C_im[t]*h+this.C_re[t]*p;for(var z=0;z<this.iterations;z++){var W=C,Y=R,H,Q,tt=s,rt=a;for(t=2;t<=6;t++)H=W*C-Y*R,Q=Y*C+W*R,W=H,Y=Q,tt=tt+(t-1)*(this.B_re[t]*W-this.B_im[t]*Y),rt=rt+(t-1)*(this.B_im[t]*W+this.B_re[t]*Y);W=1,Y=0;var at=this.B_re[1],et=this.B_im[1];for(t=2;t<=6;t++)H=W*C-Y*R,Q=Y*C+W*R,W=H,Y=Q,at=at+t*(this.B_re[t]*W-this.B_im[t]*Y),et=et+t*(this.B_im[t]*W+this.B_re[t]*Y);var lt=at*at+et*et;C=(tt*at+rt*et)/lt,R=(rt*at-tt*et)/lt}var J=C,ft=R,dt=1,Mt=0;for(t=1;t<=9;t++)dt=dt*J,Mt=Mt+this.D[t]*dt;var Ft=this.lat0+Mt*Hx*1e5,Nt=this.long0+ft;return e.x=Nt,e.y=Ft,e}var tge=[\"New_Zealand_Map_Grid\",\"nzmg\"],J6t={init:Kme,forward:Qme,inverse:Jme,names:tge};function ege(){}function rge(e){var t=e.x,r=e.y,i=qe(t-this.long0,this.over),n=this.x0+this.a*i,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=n,e.y=o,e}function ige(e){e.x-=this.x0,e.y-=this.y0;var t=qe(this.long0+e.x/this.a,this.over),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var nge=[\"Miller_Cylindrical\",\"mill\"],tIt={init:ege,forward:rge,inverse:ige,names:nge};var oge=20;function sge(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=GS(this.es)}function age(e){var t,r,i=e.x,n=e.y;if(i=qe(i-this.long0,this.over),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var o=this.n*Math.sin(n),s=oge;s;--s){var a=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=a,Math.abs(a)<Ge)break}t=this.a*this.C_x*i*(this.m+Math.cos(n)),r=this.a*this.C_y*n}else{var h=Math.sin(n),p=Math.cos(n);r=this.a*dm(n,h,p,this.en),t=this.a*i*p/Math.sqrt(1-this.es*h*h)}return e.x=t,e.y=r,e}function lge(e){var t,r,i,n;return e.x-=this.x0,i=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(t))),this.m?t=$u((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=$u(Math.sin(t)/this.n)),i=qe(i+this.long0,this.over),t=ju(t)):(t=WS(e.y/this.a,this.es,this.en),n=Math.abs(t),n<Oe?(n=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),i=qe(r,this.over)):n-Ge<Oe&&(i=this.long0)),e.x=i,e.y=t,e}var cge=[\"Sinusoidal\",\"sinu\"],eIt={init:sge,forward:age,inverse:lge,names:cge};function uge(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function hge(e){for(var t=e.x,r=e.y,i=qe(t-this.long0,this.over),n=r,o=Math.PI*Math.sin(r);;){var s=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=s,Math.abs(s)<Ge)break}n/=2,Math.PI/2-Math.abs(r)<Ge&&(i=0);var a=.900316316158*this.a*i*Math.cos(n)+this.x0,h=1.4142135623731*this.a*Math.sin(n)+this.y0;return e.x=a,e.y=h,e}function dge(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var i=qe(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return e.x=i,e.y=n,e}var fge=[\"Mollweide\",\"moll\"],rIt={init:uge,forward:hge,inverse:dge,names:fge};function pge(){Math.abs(this.lat1+this.lat2)<Ge||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=RA(this.es),this.e1=DA(this.es),this.e2=OA(this.es),this.e3=LA(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=fc(this.e,this.sin_phi,this.cos_phi),this.ml1=Na(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Ge?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=fc(this.e,this.sin_phi,this.cos_phi),this.ml2=Na(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Na(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function mge(e){var t=e.x,r=e.y,i;if(this.sphere)i=this.a*(this.g-r);else{var n=Na(this.e0,this.e1,this.e2,this.e3,r);i=this.a*(this.g-n)}var o=this.ns*qe(t-this.long0,this.over),s=this.x0+i*Math.sin(o),a=this.y0+this.rh-i*Math.cos(o);return e.x=s,e.y=a,e}function gge(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,i,n;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=qe(this.long0+o/this.ns,this.over),i=ju(this.g-r/this.a),e.x=n,e.y=i,e;var s=this.g-r/this.a;return i=Kx(s,this.e0,this.e1,this.e2,this.e3),n=qe(this.long0+o/this.ns,this.over),e.x=n,e.y=i,e}var Age=[\"Equidistant_Conic\",\"eqdc\"],iIt={init:pge,forward:mge,inverse:gge,names:Age};function yge(){this.R=this.a}function _ge(e){var t=e.x,r=e.y,i=qe(t-this.long0,this.over),n,o;Math.abs(r)<=Ge&&(n=this.x0+this.R*i,o=this.y0);var s=$u(2*Math.abs(r/Math.PI));(Math.abs(i)<=Ge||Math.abs(Math.abs(r)-Oe)<=Ge)&&(n=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*s):o=this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/i-i/Math.PI),h=a*a,p=Math.sin(s),g=Math.cos(s),w=g/(p+g-1),C=w*w,R=w*(2/p-1),z=R*R,W=Math.PI*this.R*(a*(w-z)+Math.sqrt(h*(w-z)*(w-z)-(z+h)*(C-z)))/(z+h);i<0&&(W=-W),n=this.x0+W;var Y=h+w;return W=Math.PI*this.R*(R*Y-a*Math.sqrt((z+h)*(h+1)-Y*Y))/(z+h),r>=0?o=this.y0+W:o=this.y0-W,e.x=n,e.y=o,e}function vge(e){var t,r,i,n,o,s,a,h,p,g,w,C,R;return e.x-=this.x0,e.y-=this.y0,w=Math.PI*this.R,i=e.x/w,n=e.y/w,o=i*i+n*n,s=-Math.abs(n)*(1+o),a=s-2*n*n+i*i,h=-2*s+1+2*n*n+o*o,R=n*n/h+(2*a*a*a/h/h/h-9*s*a/h/h)/27,p=(s-a*a/3/h)/h,g=2*Math.sqrt(-p/3),w=3*R/p/g,Math.abs(w)>1&&(w>=0?w=1:w=-1),C=Math.acos(w)/3,e.y>=0?r=(-g*Math.cos(C+Math.PI/3)-a/3/h)*Math.PI:r=-(-g*Math.cos(C+Math.PI/3)-a/3/h)*Math.PI,Math.abs(i)<Ge?t=this.long0:t=qe(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(i*i-n*n)+o*o))/2/i,this.over),e.x=t,e.y=r,e}var bge=[\"Van_der_Grinten_I\",\"VanDerGrinten\",\"Van_der_Grinten\",\"vandg\"],nIt={init:yge,forward:_ge,inverse:vge,names:bge};function oIt(e,t,r,i,n,o){let s=i-t,a=Math.atan((1-o)*Math.tan(e)),h=Math.atan((1-o)*Math.tan(r)),p=Math.sin(a),g=Math.cos(a),w=Math.sin(h),C=Math.cos(h),R=s,z,W=100,Y,H,Q,tt,rt,at,et,lt,J,ft,dt,Mt,Ft,Nt;do{if(Y=Math.sin(R),H=Math.cos(R),Q=Math.sqrt(C*Y*(C*Y)+(g*w-p*C*H)*(g*w-p*C*H)),Q===0)return{azi1:0,s12:0};tt=p*w+g*C*H,rt=Math.atan2(Q,tt),at=g*C*Y/Q,et=1-at*at,lt=et!==0?tt-2*p*w/et:0,J=o/16*et*(4+o*(4-3*et)),z=R,R=s+(1-J)*o*at*(rt+J*Q*(lt+J*tt*(-1+2*lt*lt)))}while(Math.abs(R-z)>1e-12&&--W>0);return W===0?{azi1:NaN,s12:NaN}:(ft=et*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),dt=1+ft/16384*(4096+ft*(-768+ft*(320-175*ft))),Mt=ft/1024*(256+ft*(-128+ft*(74-47*ft))),Ft=Mt*Q*(lt+Mt/4*(tt*(-1+2*lt*lt)-Mt/6*lt*(-3+4*Q*Q)*(-3+4*lt*lt))),Nt=n*(1-o)*dt*(rt-Ft),{azi1:Math.atan2(C*Y,g*w-p*C*H),s12:Nt})}function sIt(e,t,r,i,n,o){let s=Math.atan((1-o)*Math.tan(e)),a=Math.sin(s),h=Math.cos(s),p=Math.sin(r),g=Math.cos(r),w=Math.atan2(a,h*g),C=h*p,R=1-C*C,z=R*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),W=1+z/16384*(4096+z*(-768+z*(320-175*z))),Y=z/1024*(256+z*(-128+z*(74-47*z))),H=i/(n*(1-o)*W),Q,tt=100,rt,at,et,lt;do rt=Math.cos(2*w+H),at=Math.sin(H),et=Math.cos(H),lt=Y*at*(rt+Y/4*(et*(-1+2*rt*rt)-Y/6*rt*(-3+4*at*at)*(-3+4*rt*rt))),Q=H,H=i/(n*(1-o)*W)+lt;while(Math.abs(H-Q)>1e-12&&--tt>0);if(tt===0)return{lat2:NaN,lon2:NaN};let J=a*at-h*et*g,ft=Math.atan2(a*et+h*at*g,(1-o)*Math.sqrt(C*C+J*J)),dt=Math.atan2(at*p,h*et-a*at*g),Mt=o/16*R*(4+o*(4-3*R)),Ft=dt-(1-Mt)*o*C*(H+Mt*at*(rt+Mt*et*(-1+2*rt*rt))),Nt=t+Ft;return{lat2:ft,lon2:Nt}}function xge(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function wge(e){var t=e.x,r=e.y,i=Math.sin(e.y),n=Math.cos(e.y),o=qe(t-this.long0,this.over),s,a,h,p,g,w,C,R,z,W,Y;return this.sphere?Math.abs(this.sin_p12-1)<=Ge?(e.x=this.x0+this.a*(Oe-r)*Math.sin(o),e.y=this.y0-this.a*(Oe-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Ge?(e.x=this.x0+this.a*(Oe+r)*Math.sin(o),e.y=this.y0+this.a*(Oe+r)*Math.cos(o),e):(z=this.sin_p12*i+this.cos_p12*n*Math.cos(o),C=Math.acos(z),R=C?C/Math.sin(C):1,e.x=this.x0+this.a*R*n*Math.sin(o),e.y=this.y0+this.a*R*(this.cos_p12*i-this.sin_p12*n*Math.cos(o)),e):(s=RA(this.es),a=DA(this.es),h=OA(this.es),p=LA(this.es),Math.abs(this.sin_p12-1)<=Ge?(g=this.a*Na(s,a,h,p,Oe),w=this.a*Na(s,a,h,p,r),e.x=this.x0+(g-w)*Math.sin(o),e.y=this.y0-(g-w)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Ge?(g=this.a*Na(s,a,h,p,Oe),w=this.a*Na(s,a,h,p,r),e.x=this.x0+(g+w)*Math.sin(o),e.y=this.y0+(g+w)*Math.cos(o),e):Math.abs(t)<Ge&&Math.abs(r-this.lat0)<Ge?(e.x=e.y=0,e):(W=oIt(this.lat0,this.long0,r,t,this.a,this.f),Y=W.azi1,e.x=W.s12*Math.sin(Y),e.y=W.s12*Math.cos(Y),e))}function Tge(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,n,o,s,a,h,p,g,w,C,R,z,W,Y;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*Oe*this.a?void 0:(r=t/this.a,i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(t)<=Ge?s=this.lat0:(s=$u(n*this.sin_p12+e.y*i*this.cos_p12/t),a=Math.abs(this.lat0)-Oe,Math.abs(a)<=Ge?this.lat0>=0?o=qe(this.long0+Math.atan2(e.x,-e.y),this.over):o=qe(this.long0-Math.atan2(-e.x,e.y),this.over):o=qe(this.long0+Math.atan2(e.x*i,t*this.cos_p12*n-e.y*this.sin_p12*i),this.over)),e.x=o,e.y=s,e)):(h=RA(this.es),p=DA(this.es),g=OA(this.es),w=LA(this.es),Math.abs(this.sin_p12-1)<=Ge?(C=this.a*Na(h,p,g,w,Oe),t=Math.sqrt(e.x*e.x+e.y*e.y),R=C-t,s=Kx(R/this.a,h,p,g,w),o=qe(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=o,e.y=s,e):Math.abs(this.sin_p12+1)<=Ge?(C=this.a*Na(h,p,g,w,Oe),t=Math.sqrt(e.x*e.x+e.y*e.y),R=t-C,s=Kx(R/this.a,h,p,g,w),o=qe(this.long0+Math.atan2(e.x,e.y),this.over),e.x=o,e.y=s,e):(z=Math.atan2(e.x,e.y),W=Math.sqrt(e.x*e.x+e.y*e.y),Y=sIt(this.lat0,this.long0,z,W,this.a,this.f),e.x=Y.lon2,e.y=Y.lat2,e))}var Sge=[\"Azimuthal_Equidistant\",\"aeqd\"],aIt={init:xge,forward:wge,inverse:Tge,names:Sge};function Mge(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function Ege(e){var t,r,i,n,o,s,a,h,p=e.x,g=e.y;return i=qe(p-(this.long0||0),this.over),t=Math.sin(g),r=Math.cos(g),n=Math.cos(i),s=this.sin_p14*t+this.cos_p14*r*n,o=1,(s>0||Math.abs(s)<=Ge)&&(a=this.a*o*r*Math.sin(i),h=(this.y0||0)+this.a*o*(this.cos_p14*t-this.sin_p14*r*n)),e.x=a,e.y=h,e}function Pge(e){var t,r,i,n,o,s,a,h,p;return e.x-=this.x0||0,e.y-=this.y0||0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=$u(t/this.a),i=Math.sin(r),n=Math.cos(r),h=this.long0||0,p=this.lat0||0,s=h,Math.abs(t)<=Ge?(a=p,e.x=s,e.y=a,e):(a=$u(n*this.sin_p14+e.y*i*this.cos_p14/t),o=Math.abs(p)-Oe,Math.abs(o)<=Ge?(p>=0?s=qe(h+Math.atan2(e.x,-e.y),this.over):s=qe(h-Math.atan2(-e.x,e.y),this.over),e.x=s,e.y=a,e):(s=qe(h+Math.atan2(e.x*i,t*this.cos_p14*n-e.y*this.sin_p14*i),this.over),e.x=s,e.y=a,e))}var Cge=[\"ortho\"],lIt={init:Mge,forward:Ege,inverse:Pge,names:Cge};var hs={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Fn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ige(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||\"Quadrilateralized Spherical Cube\",this.lat0>=Oe-an/2?this.face=hs.TOP:this.lat0<=-(Oe-an/2)?this.face=hs.BOTTOM:Math.abs(this.long0)<=an?this.face=hs.FRONT:Math.abs(this.long0)<=Oe+an?this.face=this.long0>0?hs.RIGHT:hs.LEFT:this.face=hs.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function kge(e){var t={x:0,y:0},r,i,n,o,s,a,h={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,i=e.x,this.face===hs.TOP)o=Oe-r,i>=an&&i<=Oe+an?(h.value=Fn.AREA_0,n=i-Oe):i>Oe+an||i<=-(Oe+an)?(h.value=Fn.AREA_1,n=i>0?i-us:i+us):i>-(Oe+an)&&i<=-an?(h.value=Fn.AREA_2,n=i+Oe):(h.value=Fn.AREA_3,n=i);else if(this.face===hs.BOTTOM)o=Oe+r,i>=an&&i<=Oe+an?(h.value=Fn.AREA_0,n=-i+Oe):i<an&&i>=-an?(h.value=Fn.AREA_1,n=-i):i<-an&&i>=-(Oe+an)?(h.value=Fn.AREA_2,n=-i-Oe):(h.value=Fn.AREA_3,n=i>0?-i+us:-i-us);else{var p,g,w,C,R,z,W;this.face===hs.RIGHT?i=XS(i,+Oe):this.face===hs.BACK?i=XS(i,+us):this.face===hs.LEFT&&(i=XS(i,-Oe)),C=Math.sin(r),R=Math.cos(r),z=Math.sin(i),W=Math.cos(i),p=R*W,g=R*z,w=C,this.face===hs.FRONT?(o=Math.acos(p),n=ZU(o,w,g,h)):this.face===hs.RIGHT?(o=Math.acos(g),n=ZU(o,w,-p,h)):this.face===hs.BACK?(o=Math.acos(-p),n=ZU(o,w,-g,h)):this.face===hs.LEFT?(o=Math.acos(-g),n=ZU(o,w,p,h)):(o=n=0,h.value=Fn.AREA_0)}return a=Math.atan(12/us*(n+Math.acos(Math.sin(n)*Math.cos(an))-Oe)),s=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),h.value===Fn.AREA_1?a+=Oe:h.value===Fn.AREA_2?a+=us:h.value===Fn.AREA_3&&(a+=1.5*us),t.x=s*Math.cos(a),t.y=s*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Rge(e){var t={lam:0,phi:0},r,i,n,o,s,a,h,p,g,w={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?w.value=Fn.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(w.value=Fn.AREA_1,r-=Oe):e.x<0&&-e.x>=Math.abs(e.y)?(w.value=Fn.AREA_2,r=r<0?r+us:r-us):(w.value=Fn.AREA_3,r+=Oe),g=us/12*Math.tan(r),s=Math.sin(g)/(Math.cos(g)-1/Math.sqrt(2)),a=Math.atan(s),n=Math.cos(r),o=Math.tan(i),h=1-n*n*o*o*(1-Math.cos(Math.atan(1/Math.cos(a)))),h<-1?h=-1:h>1&&(h=1),this.face===hs.TOP)p=Math.acos(h),t.phi=Oe-p,w.value===Fn.AREA_0?t.lam=a+Oe:w.value===Fn.AREA_1?t.lam=a<0?a+us:a-us:w.value===Fn.AREA_2?t.lam=a-Oe:t.lam=a;else if(this.face===hs.BOTTOM)p=Math.acos(h),t.phi=p-Oe,w.value===Fn.AREA_0?t.lam=-a+Oe:w.value===Fn.AREA_1?t.lam=-a:w.value===Fn.AREA_2?t.lam=-a-Oe:t.lam=a<0?-a-us:-a+us;else{var C,R,z;C=h,g=C*C,g>=1?z=0:z=Math.sqrt(1-g)*Math.sin(a),g+=z*z,g>=1?R=0:R=Math.sqrt(1-g),w.value===Fn.AREA_1?(g=R,R=-z,z=g):w.value===Fn.AREA_2?(R=-R,z=-z):w.value===Fn.AREA_3&&(g=R,R=z,z=-g),this.face===hs.RIGHT?(g=C,C=-R,R=g):this.face===hs.BACK?(C=-C,R=-R):this.face===hs.LEFT&&(g=C,C=R,R=-g),t.phi=Math.acos(-z)-Oe,t.lam=Math.atan2(R,C),this.face===hs.RIGHT?t.lam=XS(t.lam,-Oe):this.face===hs.BACK?t.lam=XS(t.lam,-us):this.face===hs.LEFT&&(t.lam=XS(t.lam,+Oe))}if(this.es!==0){var W,Y,H;W=t.phi<0?1:0,Y=Math.tan(t.phi),H=this.b/Math.sqrt(Y*Y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-H*H)/(this.one_minus_f*H)),W&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function ZU(e,t,r,i){var n;return e<Ge?(i.value=Fn.AREA_0,n=0):(n=Math.atan2(t,r),Math.abs(n)<=an?i.value=Fn.AREA_0:n>an&&n<=Oe+an?(i.value=Fn.AREA_1,n-=Oe):n>Oe+an||n<=-(Oe+an)?(i.value=Fn.AREA_2,n=n>=0?n-us:n+us):(i.value=Fn.AREA_3,n+=Oe)),n}function XS(e,t){var r=e+t;return r<-us?r+=S_:r>+us&&(r-=S_),r}var Dge=[\"Quadrilateralized Spherical Cube\",\"Quadrilateralized_Spherical_Cube\",\"qsc\"],cIt={init:Ige,forward:kge,inverse:Rge,names:Dge};var Sit=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],qk=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],uIt=.8487,hIt=1.3523,dIt=Fa/5,Oge=1/dIt,ZS=18,KU=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},Lge=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function Bge(e,t,r,i){for(var n=t;i;--i){var o=e(n);if(n-=o,Math.abs(o)<r)break}return n}function Fge(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||\"Robinson\"}function Nge(e){var t=qe(e.x-this.long0,this.over),r=Math.abs(e.y),i=Math.floor(r*dIt);i<0?i=0:i>=ZS&&(i=ZS-1),r=Fa*(r-Oge*i);var n={x:KU(Sit[i],r)*t,y:KU(qk[i],r)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*uIt+this.x0,n.y=n.y*this.a*hIt+this.y0,n}function zge(e){var t={x:(e.x-this.x0)/(this.a*uIt),y:Math.abs(e.y-this.y0)/(this.a*hIt)};if(t.y>=1)t.x/=Sit[ZS][0],t.y=e.y<0?-Oe:Oe;else{var r=Math.floor(t.y*ZS);for(r<0?r=0:r>=ZS&&(r=ZS-1);;)if(qk[r][0]>t.y)--r;else if(qk[r+1][0]<=t.y)++r;else break;var i=qk[r],n=5*(t.y-i[0])/(qk[r+1][0]-i[0]);n=Bge(function(o){return(KU(i,o)-t.y)/Lge(i,o)},n,Ge,100),t.x/=KU(Sit[r],n),t.y=(5*r+n)*io,e.y<0&&(t.y=-t.y)}return t.x=qe(t.x+this.long0,this.over),t}var Uge=[\"Robinson\",\"robin\"],fIt={init:Fge,forward:Nge,inverse:zge,names:Uge};function Vge(){this.name=\"geocent\"}function jge(e){var t=UU(e,this.es,this.a);return t}function $ge(e){var t=VU(e,this.es,this.a,this.b);return t}var Gge=[\"Geocentric\",\"geocentric\",\"geocent\",\"Geocent\"],pIt={init:Vge,forward:jge,inverse:$ge,names:Gge};var pc={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Hk={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Wge(){if(Object.keys(Hk).forEach(function(r){if(typeof this[r]>\"u\")this[r]=Hk[r].def;else{if(Hk[r].num&&isNaN(this[r]))throw new Error(\"Invalid parameter value, must be numeric \"+r+\" = \"+this[r]);Hk[r].num&&(this[r]=parseFloat(this[r]))}Hk[r].degrees&&(this[r]=this[r]*io)}.bind(this)),Math.abs(Math.abs(this.lat0)-Oe)<Ge?this.mode=this.lat0<0?pc.S_POLE:pc.N_POLE:Math.abs(this.lat0)<Ge?this.mode=pc.EQUIT:(this.mode=pc.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error(\"Invalid height\");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function qge(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),i=Math.cos(e.x),n,o;switch(this.mode){case pc.OBLIQ:o=this.sinph0*t+this.cosph0*r*i;break;case pc.EQUIT:o=r*i;break;case pc.S_POLE:o=-t;break;case pc.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),n=o*r*Math.sin(e.x),this.mode){case pc.OBLIQ:o*=this.cosph0*t-this.sinph0*r*i;break;case pc.EQUIT:o*=t;break;case pc.N_POLE:o*=-(r*i);break;case pc.S_POLE:o*=r*i;break}var s,a;return s=o*this.cg+n*this.sg,a=1/(s*this.sw*this.h1+this.cw),n=(n*this.cg-o*this.sg)*this.cw*a,o=s*a,e.x=n*this.a,e.y=o*this.a,e}function Hge(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,i,n;n=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*n,i=this.pn1*e.y*this.cw*n,e.x=r*this.cg+i*this.sg,e.y=i*this.cg-r*this.sg;var o=va(e.x,e.y);if(Math.abs(o)<Ge)t.x=0,t.y=e.y;else{var s,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),s=Math.sqrt(1-a*a),this.mode){case pc.OBLIQ:t.y=Math.asin(s*this.sinph0+e.y*a*this.cosph0/o),e.y=(s-this.sinph0*Math.sin(t.y))*o,e.x*=a*this.cosph0;break;case pc.EQUIT:t.y=Math.asin(e.y*a/o),e.y=s*o,e.x*=a;break;case pc.N_POLE:t.y=Math.asin(s),e.y=-e.y;break;case pc.S_POLE:t.y=-Math.asin(s);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var Yge=[\"Tilted_Perspective\",\"tpers\"],mIt={init:Wge,forward:qge,inverse:Hge,names:Yge};function Xge(){if(this.flip_axis=this.sweep===\"x\"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=\"ellipse\"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=\"sphere\";this.title||(this.title=\"Geostationary Satellite View\")}function Zge(e){var t=e.x,r=e.y,i,n,o,s;if(t=t-this.long0,this.shape===\"ellipse\"){r=Math.atan(this.radius_p2*Math.tan(r));var a=this.radius_p/va(this.radius_p*Math.cos(r),Math.sin(r));if(n=a*Math.cos(t)*Math.cos(r),o=a*Math.sin(t)*Math.cos(r),s=a*Math.sin(r),(this.radius_g-n)*n-o*o-s*s*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/va(s,i)),e.y=this.radius_g_1*Math.atan(s/i)):(e.x=this.radius_g_1*Math.atan(o/i),e.y=this.radius_g_1*Math.atan(s/va(o,i)))}else this.shape===\"sphere\"&&(i=Math.cos(r),n=Math.cos(t)*i,o=Math.sin(t)*i,s=Math.sin(r),i=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/va(s,i)),e.y=this.radius_g_1*Math.atan(s/i)):(e.x=this.radius_g_1*Math.atan(o/i),e.y=this.radius_g_1*Math.atan(s/va(o,i))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function Kge(e){var t=-1,r=0,i=0,n,o,s,a;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape===\"ellipse\"){this.flip_axis?(i=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*va(1,i)):(r=Math.tan(e.x/this.radius_g_1),i=Math.tan(e.y/this.radius_g_1)*va(1,r));var h=i/this.radius_p;if(n=r*r+h*h+t*t,o=2*this.radius_g*t,s=o*o-4*n*this.C,s<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-o-Math.sqrt(s))/(2*n),t=this.radius_g+a*t,r*=a,i*=a,e.x=Math.atan2(r,t),e.y=Math.atan(i*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===\"sphere\"){if(this.flip_axis?(i=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+i*i)):(r=Math.tan(e.x/this.radius_g_1),i=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),n=r*r+i*i+t*t,o=2*this.radius_g*t,s=o*o-4*n*this.C,s<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-o-Math.sqrt(s))/(2*n),t=this.radius_g+a*t,r*=a,i*=a,e.x=Math.atan2(r,t),e.y=Math.atan(i*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var Qge=[\"Geostationary Satellite View\",\"Geostationary_Satellite\",\"geos\"],gIt={init:Xge,forward:Zge,inverse:Kge,names:Qge};var Yk=1.340264,Xk=-.081106,Zk=893e-6,Kk=.003796,QU=Math.sqrt(3)/2;function Jge(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function tAe(e){var t=qe(e.x-this.long0,this.over),r=e.y,i=Math.asin(QU*Math.sin(r)),n=i*i,o=n*n*n;return e.x=t*Math.cos(i)/(QU*(Yk+3*Xk*n+o*(7*Zk+9*Kk*n))),e.y=i*(Yk+Xk*n+o*(Zk+Kk*n)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function eAe(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,r=12,i=e.y,n,o,s,a,h,p;for(p=0;p<r&&(n=i*i,o=n*n*n,s=i*(Yk+Xk*n+o*(Zk+Kk*n))-e.y,a=Yk+3*Xk*n+o*(7*Zk+9*Kk*n),i-=h=s/a,!(Math.abs(h)<t));++p);return n=i*i,o=n*n*n,e.x=QU*e.x*(Yk+3*Xk*n+o*(7*Zk+9*Kk*n))/Math.cos(i),e.y=Math.asin(Math.sin(i)/QU),e.x=qe(e.x+this.long0,this.over),e}var rAe=[\"eqearth\",\"Equal Earth\",\"Equal_Earth\"],AIt={init:Jge,forward:tAe,inverse:eAe,names:rAe};var Qk=1e-10;function iAe(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<Qk)throw new Error;this.es?(this.en=GS(this.es),this.m1=dm(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=oAe,this.forward=nAe):(Math.abs(this.phi1)+Qk>=Oe?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=aAe,this.forward=sAe)}function nAe(e){var t=qe(e.x-(this.long0||0),this.over),r=e.y,i,n,o;return i=this.am1+this.m1-dm(r,n=Math.sin(r),o=Math.cos(r),this.en),n=o*t/(i*Math.sqrt(1-this.es*n*n)),e.x=i*Math.sin(n),e.y=this.am1-i*Math.cos(n),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function oAe(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,r,i,n;if(r=va(e.x,e.y=this.am1-e.y),n=WS(this.am1+this.m1-r,this.es,this.en),(t=Math.abs(n))<Oe)t=Math.sin(n),i=r*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(n);else if(Math.abs(t-Oe)<=Qk)i=0;else throw new Error;return e.x=qe(i+(this.long0||0),this.over),e.y=ju(n),e}function sAe(e){var t=qe(e.x-(this.long0||0),this.over),r=e.y,i,n;return n=this.cphi1+this.phi1-r,Math.abs(n)>Qk?(e.x=n*Math.sin(i=t*Math.cos(r)/n),e.y=this.cphi1-n*Math.cos(i)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function aAe(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,r,i=va(e.x,e.y=this.cphi1-e.y);if(r=this.cphi1+this.phi1-i,Math.abs(r)>Oe)throw new Error;return Math.abs(Math.abs(r)-Oe)<=Qk?t=0:t=i*Math.atan2(e.x,e.y)/Math.cos(r),e.x=qe(t+(this.long0||0),this.over),e.y=ju(r),e}var lAe=[\"bonne\",\"Bonne (Werner lat_1=90)\"],yIt={init:iAe,names:lAe};var _It={OBLIQUE:{forward:fAe,inverse:mAe},TRANSVERSE:{forward:pAe,inverse:gAe}},JU={ROTATE:{o_alpha:\"oAlpha\",o_lon_c:\"oLongC\",o_lat_c:\"oLatC\"},NEW_POLE:{o_lat_p:\"oLatP\",o_lon_p:\"oLongP\"},NEW_EQUATOR:{o_lon_1:\"oLong1\",o_lat_1:\"oLat1\",o_lon_2:\"oLong2\",o_lat_2:\"oLat2\"}};function cAe(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||\"General Oblique Transformation\",this.isIdentity=lit.includes(this.o_proj),!this.o_proj)throw new Error(\"Missing parameter: o_proj\");if(this.o_proj===\"ob_tran\")throw new Error(\"Invalid value for o_proj: \"+this.o_proj);let e=this.projStr.replace(\"+proj=ob_tran\",\"\").replace(\"+o_proj=\",\"+proj=\").trim(),t=Sp(e);if(!t)throw new Error(\"Invalid parameter: o_proj. Unknown projection \"+this.o_proj);t.long0=0,this.obliqueProjection=t;let r,i=Object.keys(JU),n=a=>{if(typeof this[a]>\"u\")return;let h=parseFloat(this[a])*io;if(isNaN(h))throw new Error(\"Invalid value for \"+a+\": \"+this[a]);return h};for(let a=0;a<i.length;a++){let h=i[a],p=JU[h],g=Object.entries(p);if(g.some(([C])=>typeof this[C]<\"u\")){r=p;for(let C=0;C<g.length;C++){let[R,z]=g[C],W=n(R);if(typeof W>\"u\")throw new Error(\"Missing parameter: \"+R+\".\");this[z]=W}break}}if(!r)throw new Error(\"No valid parameters provided for ob_tran projection.\");let{lamp:o,phip:s}=dAe(this,r);this.lamp=o,Math.abs(s)>Ge?(this.cphip=Math.cos(s),this.sphip=Math.sin(s),this.projectionType=_It.OBLIQUE):this.projectionType=_It.TRANSVERSE}function uAe(e){return this.projectionType.forward(this,e)}function hAe(e){return this.projectionType.inverse(this,e)}function dAe(e,t){let r,i;if(t===JU.ROTATE){let n=e.oLongC,o=e.oLatC,s=e.oAlpha;if(Math.abs(Math.abs(o)-Oe)<=Ge)throw new Error(\"Invalid value for o_lat_c: \"+e.o_lat_c+\" should be < 90\\xB0\");i=n+Math.atan2(-1*Math.cos(s),-1*Math.sin(s)*Math.sin(o)),r=Math.asin(Math.cos(o)*Math.sin(s))}else if(t===JU.NEW_POLE)i=e.oLongP,r=e.oLatP;else{let n=e.oLong1,o=e.oLat1,s=e.oLong2,a=e.oLat2,h=Math.abs(o);if(Math.abs(o)>Oe-Ge)throw new Error(\"Invalid value for o_lat_1: \"+e.o_lat_1+\" should be < 90\\xB0\");if(Math.abs(a)>Oe-Ge)throw new Error(\"Invalid value for o_lat_2: \"+e.o_lat_2+\" should be < 90\\xB0\");if(Math.abs(o-a)<Ge)throw new Error(\"Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2\");if(h<Ge)throw new Error(\"Invalid value for o_lat_1: o_lat_1 should be different from zero\");i=Math.atan2(Math.cos(o)*Math.sin(a)*Math.cos(n)-Math.sin(o)*Math.cos(a)*Math.cos(s),Math.sin(o)*Math.cos(a)*Math.sin(s)-Math.cos(o)*Math.sin(a)*Math.sin(n)),r=Math.atan(-1*Math.cos(i-n)/Math.tan(o))}return{lamp:i,phip:r}}function fAe(e,t){let{x:r,y:i}=t;r+=e.long0;let n=Math.cos(r),o=Math.sin(i),s=Math.cos(i);t.x=qe(Math.atan2(s*Math.sin(r),e.sphip*s*n+e.cphip*o)+e.lamp),t.y=Math.asin(e.sphip*o-e.cphip*s*n);let a=e.obliqueProjection.forward(t);return e.isIdentity&&(a.x*=Fa,a.y*=Fa),a}function pAe(e,t){let{x:r,y:i}=t;r+=e.long0;let n=Math.cos(i),o=Math.cos(r);t.x=qe(Math.atan2(n*Math.sin(r),Math.sin(i))+e.lamp),t.y=Math.asin(-1*n*o);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=Fa,s.y*=Fa),s}function mAe(e,t){e.isIdentity&&(t.x*=io,t.y*=io);let r=e.obliqueProjection.inverse(t),{x:i,y:n}=r;if(i<Number.MAX_VALUE){i-=e.lamp;let o=Math.cos(i),s=Math.sin(n),a=Math.cos(n);t.x=Math.atan2(a*Math.sin(i),e.sphip*a*o-e.cphip*s),t.y=Math.asin(e.sphip*s+e.cphip*a*o)}return t.x=qe(t.x+e.long0),t}function gAe(e,t){e.isIdentity&&(t.x*=io,t.y*=io);let r=e.obliqueProjection.inverse(t),{x:i,y:n}=r;if(i<Number.MAX_VALUE){let o=Math.cos(n);i-=e.lamp,t.x=Math.atan2(o*Math.sin(i),-1*Math.sin(n)),t.y=Math.asin(o*Math.cos(i))}return t.x=qe(t.x+e.long0),t}var AAe=[\"General Oblique Transformation\",\"General_Oblique_Transformation\",\"ob_tran\"],vIt={init:cAe,forward:uAe,inverse:hAe,names:AAe};function bIt(e){e.Proj.projections.add(qS),e.Proj.projections.add(HS),e.Proj.projections.add(F6t),e.Proj.projections.add(N6t),e.Proj.projections.add(z6t),e.Proj.projections.add(U6t),e.Proj.projections.add(V6t),e.Proj.projections.add(j6t),e.Proj.projections.add($6t),e.Proj.projections.add(G6t),e.Proj.projections.add(W6t),e.Proj.projections.add(q6t),e.Proj.projections.add(H6t),e.Proj.projections.add(X6t),e.Proj.projections.add(Z6t),e.Proj.projections.add(Q6t),e.Proj.projections.add(J6t),e.Proj.projections.add(tIt),e.Proj.projections.add(eIt),e.Proj.projections.add(rIt),e.Proj.projections.add(iIt),e.Proj.projections.add(nIt),e.Proj.projections.add(aIt),e.Proj.projections.add(lIt),e.Proj.projections.add(cIt),e.Proj.projections.add(fIt),e.Proj.projections.add(pIt),e.Proj.projections.add(mIt),e.Proj.projections.add(gIt),e.Proj.projections.add(AIt),e.Proj.projections.add(yIt),e.Proj.projections.add(vIt)}var xIt=Object.assign(v6t,{defaultDatum:\"WGS84\",Proj:Sp,WGS84:new Sp(\"WGS84\"),Point:P6t,toPoint:$U,defs:zS,nadgrid:fit,transform:Zx,mgrs:S6t,version:\"__VERSION__\"});bIt(xIt);var Jk=xIt;async function tV(e,t,r=\"lonboard-command\",i={}){let n=K6(),o=i.signal??AbortSignal.timeout(i.timeout??5e3);return new Promise((s,a)=>{let h=!1;if(o.aborted){a(o.reason);return}let p=()=>{h||(h=!0,e.off(\"msg:custom\",g),e.send({id:n,kind:`${r}-cancel`}),a(o.reason))};o.addEventListener(\"abort\",p);function g(w,C){w.id===n&&(h||(h=!0,e.off(\"msg:custom\",g),s([w.response,C])))}e.on(\"msg:custom\",g),e.send({id:n,kind:r,msg:t},void 0,i.buffers??[])})}var yAe=\"raster-get-tile-data\",tR=class extends gp{static layerType=\"raster\";tileMatrixSet;crs;tileSize;zoomOffset;maxZoom;minZoom;extent;maxCacheSize;debounceTime;converters;constructor(t,r){super(t,r),this.initRegularAttribute(\"_tile_matrix_set\",\"tileMatrixSet\"),this.initRegularAttribute(\"_crs\",\"crs\"),this.initRegularAttribute(\"_tile_size\",\"tileSize\"),this.initRegularAttribute(\"zoom_offset\",\"zoomOffset\"),this.initRegularAttribute(\"max_zoom\",\"maxZoom\"),this.initRegularAttribute(\"min_zoom\",\"minZoom\"),this.initRegularAttribute(\"extent\",\"extent\"),this.initRegularAttribute(\"max_cache_size\",\"maxCacheSize\"),this.initRegularAttribute(\"debounce_time\",\"debounceTime\"),this.crs&&(this.converters={4326:Jk(this.crs,\"EPSG:4326\"),3857:Jk(this.crs,\"EPSG:3857\")}),this.model.on(\"change:_crs\",()=>{let i=this.model.get(\"_crs\");this.converters={4326:Jk(i,\"EPSG:4326\"),3857:Jk(i,\"EPSG:3857\")}})}accessConverters(){let t=this.converters;if(!t)throw new Error(\"CRS converters are not initialized\");return{forwardTo4326:(r,i)=>t[4326].forward([r,i]),inverseFrom4326:(r,i)=>t[4326].inverse([r,i]),forwardTo3857:(r,i)=>t[3857].forward([r,i])}}layerProps(){return{id:`${this.model.model_id}`,data:null,...Ht(this.tileSize)&&{tileSize:this.tileSize},...Ht(this.zoomOffset)&&{zoomOffset:this.zoomOffset},...Ht(this.maxZoom)&&{maxZoom:this.maxZoom},...Ht(this.minZoom)&&{minZoom:this.minZoom},...Ht(this.extent)&&{extent:this.extent},...Ht(this.maxCacheSize)&&{maxCacheSize:this.maxCacheSize},...Ht(this.debounceTime)&&{debounceTime:this.debounceTime}}}getTileData=async t=>{let{index:r}=t,{signal:i}=t,{x:n,y:o,z:s}=r,[a,h]=await tV(this.model,{tile:{index:{x:n,y:o,z:s}}},yAe,{signal:i,timeout:1e4});if(\"type\"in a&&a.type===\"empty\")return null;if(\"error\"in a)return console.error(\"Error fetching tile data:\",a.error),null;if(i?.aborted)return null;let p=await _Ae(h[0],a.media_type),g=this.tileMatrixSet?.tileMatrices[s];if(!g)return null;let w=qx(g,{col:n,row:o}),C=_Ct(w);return{image:p,forwardTransform:(W,Y)=>xp(w,W,Y),inverseTransform:(W,Y)=>xp(C,W,Y)}};renderRasterSubLayer=t=>{if(!t.data)return null;let{image:r,forwardTransform:i,inverseTransform:n}=t.data,{inverseFrom4326:o,forwardTo4326:s}=this.accessConverters();return new Nk({id:`${t.id}-raster`,width:r.width,height:r.height,image:r,reprojectionFns:{forwardTransform:i,inverseTransform:n,forwardReproject:s,inverseReproject:o}})};renderTileMatrixSet(t,r,i){class n extends FS{constructor(s){super(s,t,{projectTo4326:r,projectTo3857:i})}}return new QT({...this.baseLayerProps(),...this.layerProps(),getTileData:this.getTileData,TilesetClass:n,renderSubLayers:this.renderRasterSubLayer})}render(){let t=this.tileMatrixSet,r=this.converters;return t&&r?this.renderTileMatrixSet(t,(i,n)=>r[4326].forward([i,n]),(i,n)=>r[3857].forward([i,n])):new QT({...this.baseLayerProps(),...this.layerProps(),getTileData:this.getTileData,renderSubLayers:i=>{let{tile:n}=i,{boundingBox:o}=n;if(!i.data||i.data===null)return null;let{image:s}=i.data;return new G3(i,{image:s,bounds:[o[0][0],o[0][1],o[1][0],o[1][1]]})}})}};function _Ae(e,t){let{buffer:r,byteOffset:i,byteLength:n}=e;if(!(r instanceof ArrayBuffer))throw new TypeError(\"SharedArrayBuffer is not supported\");let o=new Uint8Array(r,i,n),s=new Blob([o],{type:t});return createImageBitmap(s)}var KS=class extends Zs{static layerType=\"scatterplot\";radiusUnits;radiusScale;radiusMinPixels;radiusMaxPixels;lineWidthUnits;lineWidthScale;lineWidthMinPixels;lineWidthMaxPixels;stroked;filled;billboard;antialiasing;getRadius;getFillColor;getLineColor;getLineWidth;constructor(t,r){super(t,r),this.initRegularAttribute(\"radius_units\",\"radiusUnits\"),this.initRegularAttribute(\"radius_scale\",\"radiusScale\"),this.initRegularAttribute(\"radius_min_pixels\",\"radiusMinPixels\"),this.initRegularAttribute(\"radius_max_pixels\",\"radiusMaxPixels\"),this.initRegularAttribute(\"line_width_units\",\"lineWidthUnits\"),this.initRegularAttribute(\"line_width_scale\",\"lineWidthScale\"),this.initRegularAttribute(\"line_width_min_pixels\",\"lineWidthMinPixels\"),this.initRegularAttribute(\"line_width_max_pixels\",\"lineWidthMaxPixels\"),this.initRegularAttribute(\"stroked\",\"stroked\"),this.initRegularAttribute(\"filled\",\"filled\"),this.initRegularAttribute(\"billboard\",\"billboard\"),this.initRegularAttribute(\"antialiasing\",\"antialiasing\"),this.initVectorizedAccessor(\"get_radius\",\"getRadius\"),this.initVectorizedAccessor(\"get_fill_color\",\"getFillColor\"),this.initVectorizedAccessor(\"get_line_color\",\"getLineColor\"),this.initVectorizedAccessor(\"get_line_width\",\"getLineWidth\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],...Ht(this.radiusUnits)&&{radiusUnits:this.radiusUnits},...Ht(this.radiusScale)&&{radiusScale:this.radiusScale},...Ht(this.radiusMinPixels)&&{radiusMinPixels:this.radiusMinPixels},...Ht(this.radiusMaxPixels)&&{radiusMaxPixels:this.radiusMaxPixels},...Ht(this.lineWidthUnits)&&{lineWidthUnits:this.lineWidthUnits},...Ht(this.lineWidthScale)&&{lineWidthScale:this.lineWidthScale},...Ht(this.lineWidthMinPixels)&&{lineWidthMinPixels:this.lineWidthMinPixels},...Ht(this.lineWidthMaxPixels)&&{lineWidthMaxPixels:this.lineWidthMaxPixels},...Ht(this.stroked)&&{stroked:this.stroked},...Ht(this.filled)&&{filled:this.filled},...Ht(this.billboard)&&{billboard:this.billboard},...Ht(this.antialiasing)&&{antialiasing:this.antialiasing},...Ht(this.getRadius)&&{getRadius:Yo(this.getRadius,t)},...Ht(this.getFillColor)&&{getFillColor:Ho(this.getFillColor,t)},...Ht(this.getLineColor)&&{getLineColor:Ho(this.getLineColor,t)},...Ht(this.getLineWidth)&&{getLineWidth:Yo(this.getLineWidth,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new Rk({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var QS=class extends gp{static layerType=\"surface\";positions;texCoords;triangles;texture;wireframe;constructor(t,r){super(t,r),this.initVectorizedAccessor(\"positions\",\"positions\"),this.initVectorizedAccessor(\"tex_coords\",\"texCoords\"),this.initVectorizedAccessor(\"triangles\",\"triangles\"),this.initRegularAttribute(\"texture\",\"texture\"),this.initRegularAttribute(\"wireframe\",\"wireframe\")}prepareTexture(){if(!Ht(this.texture))return;if(typeof this.texture==\"string\")return this.texture;let t=new Uint8ClampedArray(this.texture.data.buffer,this.texture.data.byteOffset,this.texture.data.byteLength);return new ImageData(t,this.texture.width,this.texture.height)}layerProps(){return{id:this.model.model_id,data:[1],mesh:{indices:{value:this.triangles.data[0].children[0].values,size:1},attributes:{POSITION:{value:this.positions.data[0].children[0].values,size:3},TEXCOORD_0:{value:this.texCoords.data[0].children[0].values,size:2}}},...Ht(this.texture)&&{texture:this.prepareTexture()},...Ht(this.wireframe)&&{wireframe:this.wireframe},_instanced:!1,getPosition:[0,0,0],getColor:[255,255,255]}}render(){return new tS({...this.baseLayerProps(),...this.layerProps()})}};var JS=class extends Zs{static layerType=\"text\";billboard;sizeScale;sizeUnits;sizeMinPixels;sizeMaxPixels;getBackgroundColor;getBorderColor;getBorderWidth;backgroundPadding;characterSet;fontFamily;fontWeight;lineHeight;outlineWidth;outlineColor;fontSettings;wordBreak;maxWidth;getText;getPosition;getColor;getSize;getAngle;getTextAnchor;getAlignmentBaseline;getPixelOffset;constructor(t,r){super(t,r),this.initRegularAttribute(\"billboard\",\"billboard\"),this.initRegularAttribute(\"size_scale\",\"sizeScale\"),this.initRegularAttribute(\"size_units\",\"sizeUnits\"),this.initRegularAttribute(\"size_min_pixels\",\"sizeMinPixels\"),this.initRegularAttribute(\"size_max_pixels\",\"sizeMaxPixels\"),this.initRegularAttribute(\"background_padding\",\"backgroundPadding\"),this.initRegularAttribute(\"character_set\",\"characterSet\"),this.initRegularAttribute(\"font_family\",\"fontFamily\"),this.initRegularAttribute(\"font_weight\",\"fontWeight\"),this.initRegularAttribute(\"line_height\",\"lineHeight\"),this.initRegularAttribute(\"outline_width\",\"outlineWidth\"),this.initRegularAttribute(\"outline_color\",\"outlineColor\"),this.initRegularAttribute(\"font_settings\",\"fontSettings\"),this.initRegularAttribute(\"word_break\",\"wordBreak\"),this.initRegularAttribute(\"max_width\",\"maxWidth\"),this.initVectorizedAccessor(\"get_background_color\",\"getBackgroundColor\"),this.initVectorizedAccessor(\"get_border_color\",\"getBorderColor\"),this.initVectorizedAccessor(\"get_border_width\",\"getBorderWidth\"),this.initVectorizedAccessor(\"get_text\",\"getText\"),this.initVectorizedAccessor(\"get_position\",\"getPosition\"),this.initVectorizedAccessor(\"get_color\",\"getColor\"),this.initVectorizedAccessor(\"get_size\",\"getSize\"),this.initVectorizedAccessor(\"get_angle\",\"getAngle\"),this.initVectorizedAccessor(\"get_text_anchor\",\"getTextAnchor\"),this.initVectorizedAccessor(\"get_alignment_baseline\",\"getAlignmentBaseline\"),this.initVectorizedAccessor(\"get_pixel_offset\",\"getPixelOffset\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],getText:this.getText.data[t],...Ht(this.billboard)&&{billboard:this.billboard},...Ht(this.sizeScale)&&{sizeScale:this.sizeScale},...Ht(this.sizeUnits)&&{sizeUnits:this.sizeUnits},...Ht(this.sizeMinPixels)&&{sizeMinPixels:this.sizeMinPixels},...Ht(this.sizeMaxPixels)&&{sizeMaxPixels:this.sizeMaxPixels},...Ht(this.backgroundPadding)&&{backgroundPadding:this.backgroundPadding},...Ht(this.characterSet)&&{characterSet:this.characterSet},...Ht(this.fontFamily)&&{fontFamily:this.fontFamily},...Ht(this.fontWeight)&&{fontWeight:this.fontWeight},...Ht(this.lineHeight)&&{lineHeight:this.lineHeight},...Ht(this.outlineWidth)&&{outlineWidth:this.outlineWidth},...Ht(this.outlineColor)&&{outlineColor:this.outlineColor},...Ht(this.fontSettings)&&{fontSettings:this.fontSettings},...Ht(this.wordBreak)&&{wordBreak:this.wordBreak},...Ht(this.maxWidth)&&{maxWidth:this.maxWidth},...Ht(this.getBackgroundColor)&&{getBackgroundColor:Ho(this.getBackgroundColor,t)},...Ht(this.getBorderColor)&&{getBorderColor:Ho(this.getBorderColor,t)},...Ht(this.getBorderWidth)&&{getBorderWidth:Yo(this.getBorderWidth,t)},...Ht(this.getPosition)&&{getPosition:this.getPosition.data[t]},...Ht(this.getColor)&&{getColor:Ho(this.getColor,t)},...Ht(this.getSize)&&{getSize:Yo(this.getSize,t)},...Ht(this.getAngle)&&{getAngle:Yo(this.getAngle,t)},...Ht(this.getTextAnchor)&&{getTextAnchor:typeof this.getTextAnchor==\"string\"?this.getTextAnchor:this.getTextAnchor.data[t]},...Ht(this.getAlignmentBaseline)&&{getAlignmentBaseline:typeof this.getAlignmentBaseline==\"string\"?this.getAlignmentBaseline:this.getAlignmentBaseline.data[t]},...Ht(this.getPixelOffset)&&{getPixelOffset:Array.isArray(this.getPixelOffset)?this.getPixelOffset:this.getPixelOffset.data[t]}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new Dk({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};var tM=class extends Zs{static layerType=\"trip\";widthUnits;widthScale;widthMinPixels;widthMaxPixels;jointRounded;capRounded;miterLimit;billboard;fadeTrail;trailLength;currentTime;getColor;getWidth;getTimestamps;constructor(t,r){super(t,r),this.initRegularAttribute(\"width_units\",\"widthUnits\"),this.initRegularAttribute(\"width_scale\",\"widthScale\"),this.initRegularAttribute(\"width_min_pixels\",\"widthMinPixels\"),this.initRegularAttribute(\"width_max_pixels\",\"widthMaxPixels\"),this.initRegularAttribute(\"joint_rounded\",\"jointRounded\"),this.initRegularAttribute(\"cap_rounded\",\"capRounded\"),this.initRegularAttribute(\"miter_limit\",\"miterLimit\"),this.initRegularAttribute(\"billboard\",\"billboard\"),this.initRegularAttribute(\"fade_trail\",\"fadeTrail\"),this.initRegularAttribute(\"trail_length\",\"trailLength\"),this.initRegularAttribute(\"_current_time\",\"currentTime\"),this.initVectorizedAccessor(\"get_color\",\"getColor\"),this.initVectorizedAccessor(\"get_width\",\"getWidth\"),this.initVectorizedAccessor(\"get_timestamps\",\"getTimestamps\")}layerProps(t){return{id:`${this.model.model_id}-${t}`,data:this.table.batches[t],getTimestamps:this.getTimestamps.data[t],...Ht(this.widthUnits)&&{widthUnits:this.widthUnits},...Ht(this.widthScale)&&{widthScale:this.widthScale},...Ht(this.widthMinPixels)&&{widthMinPixels:this.widthMinPixels},...Ht(this.widthMaxPixels)&&{widthMaxPixels:this.widthMaxPixels},...Ht(this.jointRounded)&&{jointRounded:this.jointRounded},...Ht(this.capRounded)&&{capRounded:this.capRounded},...Ht(this.miterLimit)&&{miterLimit:this.miterLimit},...Ht(this.billboard)&&{billboard:this.billboard},...Ht(this.fadeTrail)&&{fadeTrail:this.fadeTrail},...Ht(this.trailLength)&&{trailLength:this.trailLength},...Ht(this.currentTime)&&{currentTime:this.currentTime},...Ht(this.getColor)&&{getColor:Ho(this.getColor,t)},...Ht(this.getWidth)&&{getWidth:Yo(this.getWidth,t)}}}render(){let t=[];for(let r=0;r<this.table.batches.length;r++)t.push(new Ok({...this.baseLayerProps(r),...this.layerProps(r)}));return t}};async function Mit(e,t){let r=e.get(\"_layer_type\"),i;switch(r){case BS.layerType:i=new BS(e,t);break;case MS.layerType:i=new MS(e,t);break;case ES.layerType:i=new ES(e,t);break;case PS.layerType:i=new PS(e,t);break;case CS.layerType:i=new CS(e,t);break;case Lk.layerType:i=new Lk(e,t);break;case LS.layerType:i=new LS(e,t);break;case IS.layerType:i=new IS(e,t);break;case kS.layerType:i=new kS(e,t);break;case RS.layerType:i=new RS(e,t);break;case OS.layerType:i=new OS(e,t);break;case tR.layerType:i=new tR(e,t);break;case Bk.layerType:i=new Bk(e,t);break;case KS.layerType:i=new KS(e,t);break;case DS.layerType:i=new DS(e,t);break;case QS.layerType:i=new QS(e,t);break;case JS.layerType:i=new JS(e,t);break;case tM.layerType:i=new tM(e,t);break;default:throw new Error(`no layer supported for ${r}`)}return await i.loadSubModels(),i}var MIt=xe(ze(),1),Nl=xe(ze(),1);var eV=xe(ze(),1),vAe=typeof window<\"u\"?eV.useLayoutEffect:eV.useEffect,wIt=vAe;var iV=xe(ze(),1),TIt=xe(ze(),1);function eM(e,t){for(;e;){if(e===t)return!0;e=Object.getPrototypeOf(e)}return!1}var Eit=xe(ze(),1),bAe={position:\"absolute\",zIndex:-1};function rV(e,t){if(typeof e==\"function\")return e(t);if(Array.isArray(e))return e.map(r=>rV(r,t));if(rM(e)){if(xAe(e))return t.style=bAe,(0,Eit.cloneElement)(e,t);if(wAe(e))return(0,Eit.cloneElement)(e,t)}return e}function rM(e){return e&&typeof e==\"object\"&&\"type\"in e||!1}function xAe(e){return e.props?.mapStyle}function wAe(e){let t=e.type;return t&&t.deckGLViewProps}function Pit(e){if(typeof e==\"function\")return(0,TIt.createElement)(Ws,{},e);if(Array.isArray(e))return e.map(Pit);if(rM(e)){if(e.type===iV.Fragment)return Pit(e.props.children);if(eM(e.type,Ws))return e}return e}function Cit({children:e,layers:t=[],views:r=null}){let i=[],n=[],o={};return iV.Children.forEach(Pit(e),s=>{if(rM(s)){let a=s.type;if(eM(a,ho)){let h=TAe(a,s.props);n.push(h)}else i.push(s);if(eM(a,Ws)&&a!==Ws&&s.props.id){let h=new a(s.props);o[h.id]=h}}else s&&i.push(s)}),Object.keys(o).length>0&&(Array.isArray(r)?r.forEach(s=>{o[s.id]=s}):r&&(o[r.id]=r),r=Object.values(o)),t=n.length>0?[...n,...t]:t,{layers:t,children:i,views:r}}function TAe(e,t){let r={},i=e.defaultProps||{};for(let n in t)i[n]!==t[n]&&(r[n]=t[n]);return new e(r)}var Iit=xe(ze(),1);var SIt=xe(ze(),1),nV=(0,SIt.createContext)();function kit({children:e,deck:t,ContextProvider:r=nV.Provider}){let{viewManager:i}=t||{};if(!i||!i.views.length)return[];let n={},o=i.views[0].id;for(let s of e){let a=o,h=s;rM(s)&&eM(s.type,Ws)&&(a=s.props.id||o,h=s.props.children);let p=i.getViewport(a),g=i.getViewState(a);if(p){g.padding=p.padding;let{x:w,y:C,width:R,height:z}=p;h=rV(h,{x:w,y:C,width:R,height:z,viewport:p,viewState:g}),n[a]||(n[a]={viewport:p,children:[]}),n[a].children.push(h)}}return Object.keys(n).map(s=>{let{viewport:a,children:h}=n[s],{x:p,y:g,width:w,height:C}=a,R={position:\"absolute\",left:p,top:g,width:w,height:C},z=`view-${s}`,W=(0,Iit.createElement)(\"div\",{key:z,id:z,style:R},...h),Y={deck:t,viewport:a,container:t.canvas.offsetParent,eventManager:t.eventManager,onViewStateChange:Q=>{Q.viewId=s,t._onViewStateChange(Q)},widgets:[]},H=`view-${s}-context`;return(0,Iit.createElement)(r,{key:H,value:Y},W)})}var SAe={mixBlendMode:null};function Rit({width:e,height:t,style:r}){let i={position:\"absolute\",zIndex:0,left:0,top:0,width:e,height:t},n={left:0,top:0};if(r)for(let o in r)o in SAe?n[o]=r[o]:i[o]=r[o];return{containerStyle:i,canvasStyle:n}}function MAe(e){return{get deck(){return e.deck},pickObject:t=>e.deck.pickObject(t),pickMultipleObjects:t=>e.deck.pickMultipleObjects(t),pickObjects:t=>e.deck.pickObjects(t)}}function EIt(e){e.redrawReason&&(e.deck._drawLayers(e.redrawReason),e.redrawReason=null)}function EAe(e,t,r){let i=new t({...r,_customRender:r.deviceProps?.adapters?.[0]?.type===\"webgpu\"?void 0:n=>{e.redrawReason=n;let o=i.getViewports();e.lastRenderedViewports!==o?e.forceUpdate():EIt(e)}});return i}function PAe(e,t){let[r,i]=(0,Nl.useState)(0),o=(0,Nl.useRef)({control:null,version:r,forceUpdate:()=>i(at=>at+1)}).current,s=(0,Nl.useRef)(null),a=(0,Nl.useRef)(null),h=(0,Nl.useMemo)(()=>Cit(e),[e.layers,e.views,e.children]),p=!0,g=at=>p&&e.viewState?(o.viewStateUpdateRequested=at,null):(o.viewStateUpdateRequested=null,e.onViewStateChange?.(at)),w=at=>{p?o.interactionStateUpdateRequested=at:(o.interactionStateUpdateRequested=null,e.onInteractionStateChange?.(at))},C=(0,Nl.useMemo)(()=>{let at={widgets:[],...e,style:null,width:\"100%\",height:\"100%\",parent:s.current,canvas:a.current,layers:h.layers,views:h.views,onViewStateChange:g,onInteractionStateChange:w};return delete at._customRender,o.deck&&o.deck.setProps(at),at},[e]);(0,Nl.useEffect)(()=>{let at=e.Deck||j3;return o.deck=EAe(o,at,{...C,parent:s.current,canvas:a.current}),()=>o.deck?.finalize()},[]),wIt(()=>{EIt(o);let{viewStateUpdateRequested:at,interactionStateUpdateRequested:et}=o;at&&g(at),et&&w(et),o.deck?.isInitialized&&o.deck.redraw(\"Initial render\")}),(0,Nl.useImperativeHandle)(t,()=>MAe(o),[]);let R=o.deck&&o.deck.isInitialized?o.deck.getViewports():void 0,{ContextProvider:z,width:W=\"100%\",height:Y=\"100%\",id:H,style:Q}=e,{containerStyle:tt,canvasStyle:rt}=(0,Nl.useMemo)(()=>Rit({width:W,height:Y,style:Q}),[W,Y,Q]);if(!o.viewStateUpdateRequested&&o.lastRenderedViewports===R||o.version!==r){o.lastRenderedViewports=R,o.version=r;let at=kit({children:h.children,deck:o.deck,ContextProvider:z}),et=(0,Nl.createElement)(\"canvas\",{key:\"canvas\",id:H||\"deckgl-overlay\",ref:a,style:rt});o.control=(0,Nl.createElement)(\"div\",{id:`${H||\"deckgl\"}-wrapper`,ref:s,style:tt},[et,at])}return p=!1,o.control}var CAe=MIt.forwardRef(PAe),Dit=CAe;var hV,Ao,RIt,IAe,E_,PIt,DIt,OIt,LIt,Fit,Oit,Lit,kAe,lV={},cV=[],RAe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dV=Array.isArray;function BA(e,t){for(var r in t)e[r]=t[r];return e}function Nit(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function DAe(e,t,r){var i,n,o,s={};for(o in t)o==\"key\"?i=t[o]:o==\"ref\"?n=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?hV.call(arguments,2):r),typeof e==\"function\"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return sV(e,s,i,n,null)}function sV(e,t,r,i,n){var o={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++RIt,__i:-1,__u:0};return n==null&&Ao.vnode!=null&&Ao.vnode(o),o}function nM(e){return e.children}function aV(e,t){this.props=e,this.context=t}function iM(e,t){if(t==null)return e.__?iM(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type==\"function\"?iM(e):null}function OAe(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],o=BA({},t);o.__v=t.__v+1,Ao.vnode&&Ao.vnode(o),zit(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,r??iM(t),!!(32&t.__u),n),o.__v=t.__v,o.__.__k[o.__i]=o,zIt(i,o,n),t.__e=t.__=null,o.__e!=r&&BIt(o)}}function BIt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),BIt(e)}function CIt(e){(!e.__d&&(e.__d=!0)&&E_.push(e)&&!uV.__r++||PIt!=Ao.debounceRendering)&&((PIt=Ao.debounceRendering)||DIt)(uV)}function uV(){try{for(var e,t=1;E_.length;)E_.length>t&&E_.sort(OIt),e=E_.shift(),t=E_.length,OAe(e)}finally{E_.length=uV.__r=0}}function FIt(e,t,r,i,n,o,s,a,h,p,g){var w,C,R,z,W,Y,H,Q=i&&i.__k||cV,tt=t.length;for(h=LAe(r,t,Q,h,tt),w=0;w<tt;w++)(R=r.__k[w])!=null&&(C=R.__i!=-1&&Q[R.__i]||lV,R.__i=w,Y=zit(e,R,C,n,o,s,a,h,p,g),z=R.__e,R.ref&&C.ref!=R.ref&&(C.ref&&Uit(C.ref,null,R),g.push(R.ref,R.__c||z,R)),W==null&&z!=null&&(W=z),(H=!!(4&R.__u))||C.__k===R.__k?h=NIt(R,h,e,H):typeof R.type==\"function\"&&Y!==void 0?h=Y:z&&(h=z.nextSibling),R.__u&=-7);return r.__e=W,h}function LAe(e,t,r,i,n){var o,s,a,h,p,g=r.length,w=g,C=0;for(e.__k=new Array(n),o=0;o<n;o++)(s=t[o])!=null&&typeof s!=\"boolean\"&&typeof s!=\"function\"?(typeof s==\"string\"||typeof s==\"number\"||typeof s==\"bigint\"||s.constructor==String?s=e.__k[o]=sV(null,s,null,null,null):dV(s)?s=e.__k[o]=sV(nM,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=sV(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,h=o+C,s.__=e,s.__b=e.__b+1,a=null,(p=s.__i=BAe(s,r,h,w))!=-1&&(w--,(a=r[p])&&(a.__u|=2)),a==null||a.__v==null?(p==-1&&(n>g?C--:n<g&&C++),typeof s.type!=\"function\"&&(s.__u|=4)):p!=h&&(p==h-1?C--:p==h+1?C++:(p>h?C--:C++,s.__u|=4))):e.__k[o]=null;if(w)for(o=0;o<g;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==i&&(i=iM(a)),VIt(a,a));return i}function NIt(e,t,r,i){var n,o;if(typeof e.type==\"function\"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=NIt(n[o],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=iM(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function BAe(e,t,r,i){var n,o,s,a=e.key,h=e.type,p=t[r],g=p!=null&&(2&p.__u)==0;if(p===null&&a==null||g&&a==p.key&&h==p.type)return r;if(i>(g?1:0)){for(n=r-1,o=r+1;n>=0||o<t.length;)if((p=t[s=n>=0?n--:o++])!=null&&(2&p.__u)==0&&a==p.key&&h==p.type)return s}return-1}function IIt(e,t,r){t[0]==\"-\"?e.setProperty(t,r??\"\"):e[t]=r==null?\"\":typeof r!=\"number\"||RAe.test(t)?r:r+\"px\"}function oV(e,t,r,i,n){var o,s;t:if(t==\"style\")if(typeof r==\"string\")e.style.cssText=r;else{if(typeof i==\"string\"&&(e.style.cssText=i=\"\"),i)for(t in i)r&&t in r||IIt(e.style,t,\"\");if(r)for(t in r)i&&r[t]==i[t]||IIt(e.style,t,r[t])}else if(t[0]==\"o\"&&t[1]==\"n\")o=t!=(t=t.replace(LIt,\"$1\")),s=t.toLowerCase(),t=s in e||t==\"onFocusOut\"||t==\"onFocusIn\"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?i?r.u=i.u:(r.u=Fit,e.addEventListener(t,o?Lit:Oit,o)):e.removeEventListener(t,o?Lit:Oit,o);else{if(n==\"http://www.w3.org/2000/svg\")t=t.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(t!=\"width\"&&t!=\"height\"&&t!=\"href\"&&t!=\"list\"&&t!=\"form\"&&t!=\"tabIndex\"&&t!=\"download\"&&t!=\"rowSpan\"&&t!=\"colSpan\"&&t!=\"role\"&&t!=\"popover\"&&t in e)try{e[t]=r??\"\";break t}catch{}typeof r==\"function\"||(r==null||r===!1&&t[4]!=\"-\"?e.removeAttribute(t):e.setAttribute(t,t==\"popover\"&&r==1?\"\":r))}}function kIt(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Fit++;else if(t.t<r.u)return;return r(Ao.event?Ao.event(t):t)}}}function zit(e,t,r,i,n,o,s,a,h,p){var g,w,C,R,z,W,Y,H,Q,tt,rt,at,et,lt,J,ft=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(h=!!(32&r.__u),o=[a=t.__e=r.__e]),(g=Ao.__b)&&g(t);t:if(typeof ft==\"function\")try{if(H=t.props,Q=ft.prototype&&ft.prototype.render,tt=(g=ft.contextType)&&i[g.__c],rt=g?tt?tt.props.value:g.__:i,r.__c?Y=(w=t.__c=r.__c).__=w.__E:(Q?t.__c=w=new ft(H,rt):(t.__c=w=new aV(H,rt),w.constructor=ft,w.render=NAe),tt&&tt.sub(w),w.state||(w.state={}),w.__n=i,C=w.__d=!0,w.__h=[],w._sb=[]),Q&&w.__s==null&&(w.__s=w.state),Q&&ft.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=BA({},w.__s)),BA(w.__s,ft.getDerivedStateFromProps(H,w.__s))),R=w.props,z=w.state,w.__v=t,C)Q&&ft.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),Q&&w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(Q&&ft.getDerivedStateFromProps==null&&H!==R&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(H,rt),t.__v==r.__v||!w.__e&&w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(H,w.__s,rt)===!1){t.__v!=r.__v&&(w.props=H,w.state=w.__s,w.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(dt){dt&&(dt.__=t)}),cV.push.apply(w.__h,w._sb),w._sb=[],w.__h.length&&s.push(w);break t}w.componentWillUpdate!=null&&w.componentWillUpdate(H,w.__s,rt),Q&&w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(R,z,W)})}if(w.context=rt,w.props=H,w.__P=e,w.__e=!1,at=Ao.__r,et=0,Q)w.state=w.__s,w.__d=!1,at&&at(t),g=w.render(w.props,w.state,w.context),cV.push.apply(w.__h,w._sb),w._sb=[];else do w.__d=!1,at&&at(t),g=w.render(w.props,w.state,w.context),w.state=w.__s;while(w.__d&&++et<25);w.state=w.__s,w.getChildContext!=null&&(i=BA(BA({},i),w.getChildContext())),Q&&!C&&w.getSnapshotBeforeUpdate!=null&&(W=w.getSnapshotBeforeUpdate(R,z)),lt=g!=null&&g.type===nM&&g.key==null?UIt(g.props.children):g,a=FIt(e,dV(lt)?lt:[lt],t,r,i,n,o,s,a,h,p),w.base=t.__e,t.__u&=-161,w.__h.length&&s.push(w),Y&&(w.__E=w.__=null)}catch(dt){if(t.__v=null,h||o!=null)if(dt.then){for(t.__u|=h?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,t.__e=a}else{for(J=o.length;J--;)Nit(o[J]);Bit(t)}else t.__e=r.__e,t.__k=r.__k,dt.then||Bit(t);Ao.__e(dt,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=FAe(r.__e,t,r,i,n,o,s,h,p);return(g=Ao.diffed)&&g(t),128&t.__u?void 0:a}function Bit(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Bit))}function zIt(e,t,r){for(var i=0;i<r.length;i++)Uit(r[i],r[++i],r[++i]);Ao.__c&&Ao.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){Ao.__e(o,n.__v)}})}function UIt(e){return typeof e!=\"object\"||e==null||e.__b>0?e:dV(e)?e.map(UIt):BA({},e)}function FAe(e,t,r,i,n,o,s,a,h){var p,g,w,C,R,z,W,Y=r.props||lV,H=t.props,Q=t.type;if(Q==\"svg\"?n=\"http://www.w3.org/2000/svg\":Q==\"math\"?n=\"http://www.w3.org/1998/Math/MathML\":n||(n=\"http://www.w3.org/1999/xhtml\"),o!=null){for(p=0;p<o.length;p++)if((R=o[p])&&\"setAttribute\"in R==!!Q&&(Q?R.localName==Q:R.nodeType==3)){e=R,o[p]=null;break}}if(e==null){if(Q==null)return document.createTextNode(H);e=document.createElementNS(n,Q,H.is&&H),a&&(Ao.__m&&Ao.__m(t,o),a=!1),o=null}if(Q==null)Y===H||a&&e.data==H||(e.data=H);else{if(o=o&&hV.call(e.childNodes),!a&&o!=null)for(Y={},p=0;p<e.attributes.length;p++)Y[(R=e.attributes[p]).name]=R.value;for(p in Y)R=Y[p],p==\"dangerouslySetInnerHTML\"?w=R:p==\"children\"||p in H||p==\"value\"&&\"defaultValue\"in H||p==\"checked\"&&\"defaultChecked\"in H||oV(e,p,null,R,n);for(p in H)R=H[p],p==\"children\"?C=R:p==\"dangerouslySetInnerHTML\"?g=R:p==\"value\"?z=R:p==\"checked\"?W=R:a&&typeof R!=\"function\"||Y[p]===R||oV(e,p,R,Y[p],n);if(g)a||w&&(g.__html==w.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(w&&(e.innerHTML=\"\"),FIt(t.type==\"template\"?e.content:e,dV(C)?C:[C],t,r,i,Q==\"foreignObject\"?\"http://www.w3.org/1999/xhtml\":n,o,s,o?o[0]:r.__k&&iM(r,0),a,h),o!=null)for(p=o.length;p--;)Nit(o[p]);a||(p=\"value\",Q==\"progress\"&&z==null?e.removeAttribute(\"value\"):z!=null&&(z!==e[p]||Q==\"progress\"&&!z||Q==\"option\"&&z!=Y[p])&&oV(e,p,z,Y[p],n),p=\"checked\",W!=null&&W!=e[p]&&oV(e,p,W,Y[p],n))}return e}function Uit(e,t,r){try{if(typeof e==\"function\"){var i=typeof e.__u==\"function\";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(n){Ao.__e(n,r)}}function VIt(e,t,r){var i,n;if(Ao.unmount&&Ao.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Uit(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){Ao.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&VIt(i[n],t,r||typeof e.type!=\"function\");r||Nit(e.__e),e.__c=e.__=e.__e=void 0}function NAe(e,t,r){return this.constructor(e,r)}function P_(e,t,r){var i,n,o,s;t==document&&(t=document.documentElement),Ao.__&&Ao.__(e,t),n=(i=typeof r==\"function\")?null:r&&r.__k||t.__k,o=[],s=[],zit(t,e=(!i&&r||t).__k=DAe(nM,null,[e]),n||lV,lV,t.namespaceURI,!i&&r?[r]:n?null:t.firstChild?hV.call(t.childNodes):null,o,!i&&r?r:n?n.__e:t.firstChild,i,s),zIt(o,e,s)}hV=cV.slice,Ao={__e:function(e,t,r,i){for(var n,o,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(a){e=a}throw e}},RIt=0,IAe=function(e){return e!=null&&e.constructor===void 0},aV.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=BA({},this.state),typeof e==\"function\"&&(e=e(BA({},r),this.props)),e&&BA(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),CIt(this))},aV.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),CIt(this))},aV.prototype.render=nM,E_=[],DIt=typeof Promise==\"function\"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,OIt=function(e,t){return e.__v.__b-t.__v.__b},uV.__r=0,LIt=/(PointerCapture)$|Capture$/i,Fit=0,Oit=kIt(!1),Lit=kIt(!0),kAe=0;var zAe=0;function kn(e,t,r,i,n,o){t||(t={});var s,a,h=t;if(\"ref\"in h)for(a in h={},t)a==\"ref\"?s=t[a]:h[a]=t[a];var p={type:e,props:h,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--zAe,__i:-1,__u:0,__source:n,__self:o};if(typeof e==\"function\"&&(s=e.defaultProps))for(a in s)h[a]===void 0&&(h[a]=s[a]);return Ao.vnode&&Ao.vnode(p),p}var jIt=e=>{let{children:t,orientation:r=\"horizontal\"}=e;return kn(\"div\",{className:`deck-widget-button-group ${r}`,children:t})};var Vit=e=>{let{className:t=\"\",label:r,onClick:i,children:n}=e;return kn(\"button\",{className:`deck-widget-icon-button ${t}`,type:\"button\",onClick:i,title:r,children:n||kn(\"div\",{className:\"deck-widget-icon\"})})};var oM=class extends Ca{constructor(t={}){super(t),this.className=\"deck-widget-zoom\",this.placement=\"top-left\",this.viewports={},this.setProps(this.props)}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId,super.setProps(t)}onRenderHTML(t){let r=kn(jIt,{orientation:this.props.orientation,children:[kn(Vit,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:\"deck-widget-zoom-in\"}),kn(Vit,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:\"deck-widget-zoom-out\"})]});P_(r,t)}onViewportChange(t){this.viewports[t.id]=t}handleZoom(t,r){let i=this.viewId||t?.id||\"default-view\",n={...t,zoom:r};this.props.transitionDuration>0&&(n.transitionDuration=this.props.transitionDuration,n.transitionInterpolator=\"latitude\"in n?new C0:new el({transitionProps:[\"zoom\"]})),this.setViewState(i,n)}handleZoomIn(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom+1)}handleZoomOut(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom-1)}setViewState(t,r){this.deck._onViewStateChange({viewId:t,viewState:r,interactionState:{}})}};oM.defaultProps={...Ca.defaultProps,id:\"zoom\",placement:\"top-left\",orientation:\"vertical\",transitionDuration:200,zoomInLabel:\"Zoom In\",zoomOutLabel:\"Zoom Out\",viewId:null};var $It=e=>{let{className:t=\"\",label:r,onClick:i,children:n}=e;return kn(\"div\",{className:\"deck-widget-button\",children:kn(\"button\",{className:`deck-widget-icon-button ${t}`,type:\"button\",onClick:i,title:r,children:n||kn(\"div\",{className:\"deck-widget-icon\"})})})};var sM=class extends Ca{constructor(t={}){super(t),this.className=\"deck-widget-compass\",this.placement=\"top-left\",this.viewports={},this.setProps(this.props)}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId,super.setProps(t)}onRenderHTML(t){let r=this.viewId||Object.values(this.viewports)[0]?.id||\"default-view\",i=this.viewports[r],[n,o]=this.getRotation(i),s=kn(\"div\",{className:\"deck-widget-button\",style:{perspective:100},children:kn(\"button\",{type:\"button\",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},title:this.props.label,style:{transform:`rotateX(${o}deg)`},children:kn(\"svg\",{fill:\"none\",width:\"100%\",height:\"100%\",viewBox:\"0 0 26 26\",children:kn(\"g\",{transform:`rotate(${n},13,13)`,children:[kn(\"path\",{d:\"M10 13.0001L12.9999 5L15.9997 13.0001H10Z\",fill:\"var(--icon-compass-north-color, rgb(240, 92, 68))\"}),kn(\"path\",{d:\"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z\",fill:\"var(--icon-compass-south-color, rgb(204, 204, 204))\"})]})})})});P_(s,t)}onViewportChange(t){t.equals(this.viewports[t.id])||(this.viewports[t.id]=t,this.updateHTML())}getRotation(t){return t instanceof _h?[-t.bearing,t.pitch]:t instanceof qf?[0,Math.max(-80,Math.min(80,t.latitude))]:[0,0]}handleCompassReset(t){let r=this.viewId||t.id||\"default-view\";if(t instanceof _h){let i={...t,bearing:0,...this.getRotation(t)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new C0};this.deck._onViewStateChange({viewId:r,viewState:i,interactionState:{}})}}};sM.defaultProps={...Ca.defaultProps,id:\"compass\",placement:\"top-left\",viewId:null,label:\"Reset Compass\",transitionDuration:200};var aM=class extends Ca{constructor(t={}){super(t),this.className=\"deck-widget-scale\",this.placement=\"bottom-left\",this.scaleWidth=10,this.scaleValue=0,this.scaleText=\"\",this.setProps(this.props)}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId,super.setProps(t)}onRenderHTML(t){let i=50+this.scaleWidth,n=10;P_(kn(\"svg\",{className:\"deck-widget-scale\",width:i,height:30,style:{overflow:\"visible\",background:\"transparent\"},onClick:this.handleClick.bind(this),children:[kn(\"text\",{x:55,y:\"10\",textAnchor:\"end\",alignmentBaseline:\"middle\",style:{fontSize:\"16px\",fill:\"black\",fontWeight:\"bold\",fontFamily:\"sans-serif\"},children:this.scaleText}),kn(\"line\",{x1:50,y1:\"15\",x2:50+this.scaleWidth,y2:\"15\",stroke:\"black\",strokeWidth:\"6\"}),kn(\"line\",{x1:50,y1:\"15\",x2:50,y2:15-n,stroke:\"black\",strokeWidth:\"6\"}),kn(\"line\",{x1:50+this.scaleWidth,y1:\"15\",x2:50+this.scaleWidth,y2:15-n,stroke:\"black\",strokeWidth:\"6\"})]}),t)}onViewportChange(t){if(!(\"latitude\"in t))return;let{latitude:r,zoom:i}=t,n=UAe(r,i),{candidate:o,candidatePixels:s}=VAe(n);this.scaleValue=o,this.scaleWidth=s,o>=1e3?this.scaleText=`${(o/1e3).toFixed(1)} km`:this.scaleText=`${o} m`,this.updateHTML()}handleClick(){}};aM.defaultProps={...Ca.defaultProps,id:\"scale\",placement:\"bottom-left\",label:\"Scale\",viewId:null};function UAe(e,t){return 40075016686e-3*Math.cos(e*Math.PI/180)/Math.pow(2,t+8)}function VAe(e){let n=150*e,o=Math.floor(Math.log10(n)),s=Math.pow(10,o),a=[1,2,5],h=a[0]*s,p=h/e;for(let g=0;g<a.length;g++){let w=a[g]*s,C=w/e;if(C>=100&&C<=200){h=w,p=C;break}if(C>200){h=g>0?a[g-1]*s:w,p=h/e;break}g===a.length-1&&C<100&&(h=a[0]*s*10,p=h/e)}return{candidate:h,candidatePixels:p}}var lM=class extends Ca{constructor(t={}){super(t),this.className=\"deck-widget-fullscreen\",this.placement=\"top-left\",this.fullscreen=!1,this.setProps(this.props)}onAdd(){document.addEventListener(\"fullscreenchange\",this.onFullscreenChange.bind(this))}onRemove(){document.removeEventListener(\"fullscreenchange\",this.onFullscreenChange.bind(this))}onRenderHTML(t){P_(kn($It,{onClick:()=>{this.handleClick().catch(r=>hr.error(r)())},label:this.fullscreen?this.props.exitLabel:this.props.enterLabel,className:this.fullscreen?\"deck-widget-fullscreen-exit\":\"deck-widget-fullscreen-enter\"}),t)}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId,super.setProps(t)}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let t=this.fullscreen,r=document.fullscreenElement===this.getContainer();t!==r&&(this.fullscreen=!this.fullscreen),this.updateHTML()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.updateHTML()}async requestFullscreen(){let t=this.getContainer();t?.requestFullscreen?await t.requestFullscreen({navigationUI:\"hide\"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle(\"deck-pseudo-fullscreen\")}};lM.defaultProps={...Ca.defaultProps,id:\"fullscreen\",placement:\"top-left\",viewId:null,enterLabel:\"Enter Fullscreen\",exitLabel:\"Exit Fullscreen\",container:void 0};var Qx=xe(ze(),1);function C_(e,t){let r=(0,Qx.useContext)(nV),{widgets:i,deck:n}=r;(0,Qx.useEffect)(()=>{let s=n?.props.widgets;return i?.length&&s?.length&&!to(s,i,1)&&hr.warn('\"widgets\" prop will be ignored because React widgets are in use.')(),()=>{let a=i?.indexOf(o);a&&a!==-1&&(i?.splice(a,1),n?.setProps({widgets:i}))}},[]);let o=(0,Qx.useMemo)(()=>new e(t),[e]);return i?.push(o),o.setProps(t),(0,Qx.useEffect)(()=>{n?.setProps({widgets:i})},[i]),o}var jit=(e={})=>(C_(sM,e),null);var $it=(e={})=>(C_(lM,e),null);var Git=(e={})=>(C_(oM,e),null);var Wit=(e={})=>(C_(aM,e),null);function qit(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{p(i.next(g))}catch(w){s(w)}}function h(g){try{p(i.throw(g))}catch(w){s(w)}}function p(g){g.done?o(g.value):n(g.value).then(a,h)}p((i=i.apply(e,t||[])).next())})}var fV=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:typeof global<\"u\"?global:typeof self<\"u\"?self:{};function AV(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var Hit,GIt;function JIt(){if(GIt)return Hit;GIt=1,Hit=t;var e=Object.prototype.hasOwnProperty;function t(){for(var r={},i=0;i<arguments.length;i++){var n=arguments[i];for(var o in n)e.call(n,o)&&(r[o]=n[o])}return r}return Hit}var Yit={exports:{}},WIt;function jAe(){return WIt||(WIt=1,(function(e,t){(function(){var r={};e.exports=r,r.simpleFilter=function(i,n){return n.filter(function(o){return r.test(i,o)})},r.test=function(i,n){return r.match(i,n)!==null},r.match=function(i,n,o){o=o||{};var s=0,a=[],h=n.length,p=0,g=0,w=o.pre||\"\",C=o.post||\"\",R=o.caseSensitive&&n||n.toLowerCase(),z;i=o.caseSensitive&&i||i.toLowerCase();for(var W=0;W<h;W++)z=n[W],R[W]===i[s]?(z=w+z+C,s+=1,g+=1+g):g=0,p+=g,a[a.length]=z;return s===i.length?(p=R===i?1/0:p,{rendered:a.join(\"\"),score:p}):null},r.filter=function(i,n,o){return!n||n.length===0?[]:typeof i!=\"string\"?n:(o=o||{},n.reduce(function(s,a,h,p){var g=a;o.extract&&(g=o.extract(a));var w=r.match(i,g,o);return w!=null&&(s[s.length]={string:w.rendered,score:w.score,index:h,original:a}),s},[]).sort(function(s,a){var h=a.score-s.score;return h||s.index-a.index}))}})()})(Yit)),Yit.exports}var Xit,qIt;function $Ae(){if(qIt)return Xit;qIt=1;var e=function(t){return this.component=t,this.items=[],this.active=t.options.noInitialSelection?-1:0,this.wrapper=document.createElement(\"div\"),this.wrapper.className=\"suggestions-wrapper\",this.element=document.createElement(\"ul\"),this.element.className=\"suggestions\",this.wrapper.appendChild(this.element),this.selectingListItem=!1,t.el.parentNode.insertBefore(this.wrapper,t.el.nextSibling),this};return e.prototype.show=function(){this.element.style.display=\"block\"},e.prototype.hide=function(){this.element.style.display=\"none\"},e.prototype.add=function(t){this.items.push(t)},e.prototype.clear=function(){this.items=[],this.active=this.component.options.noInitialSelection?-1:0},e.prototype.isEmpty=function(){return!this.items.length},e.prototype.isVisible=function(){return this.element.style.display===\"block\"},e.prototype.draw=function(){if(this.element.innerHTML=\"\",this.items.length===0){this.hide();return}for(var t=0;t<this.items.length;t++)this.drawItem(this.items[t],this.active===t);this.show()},e.prototype.drawItem=function(t,r){var i=document.createElement(\"li\"),n=document.createElement(\"a\");r&&(i.className+=\" active\"),n.innerHTML=t.string,i.appendChild(n),this.element.appendChild(i),i.addEventListener(\"mousedown\",function(){this.selectingListItem=!0}.bind(this)),i.addEventListener(\"mouseup\",function(){this.handleMouseUp.call(this,t)}.bind(this))},e.prototype.handleMouseUp=function(t){this.selectingListItem=!1,this.component.value(t.original),this.clear(),this.draw()},e.prototype.move=function(t){this.active=t,this.draw()},e.prototype.previous=function(){this.move(this.active<=0?this.items.length-1:this.active-1)},e.prototype.next=function(){this.move(this.active>=this.items.length-1?0:this.active+1)},e.prototype.drawError=function(t){var r=document.createElement(\"li\");r.innerHTML=t,this.element.appendChild(r),this.show()},Xit=e,Xit}var Zit,HIt;function GAe(){if(HIt)return Zit;HIt=1;var e=JIt(),t=jAe(),r=$Ae(),i=function(n,o,s){return s=s||{},this.options=e({minLength:2,limit:5,filter:!0,hideOnBlur:!0,noInitialSelection:!0},s),this.el=n,this.data=o||[],this.list=new r(this),this.query=\"\",this.selected=null,this.list.draw(),this.el.addEventListener(\"keyup\",function(a){this.handleKeyUp(a.keyCode,a)}.bind(this),!1),this.el.addEventListener(\"keydown\",function(a){this.handleKeyDown(a)}.bind(this)),this.el.addEventListener(\"focus\",function(){this.handleFocus()}.bind(this)),this.el.addEventListener(\"blur\",function(){this.handleBlur()}.bind(this)),this.el.addEventListener(\"paste\",function(a){this.handlePaste(a)}.bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};return i.prototype.handleKeyUp=function(n,o){if(!(n===40||n===38||n===27||n===9)){if(n===13){this.list.items[this.list.active]&&(this.list.handleMouseUp(this.list.items[this.list.active]),o.stopPropagation());return}this.handleInputChange(this.el.value)}},i.prototype.handleKeyDown=function(n){switch(n.keyCode){case 13:this.list.active>=0&&(this.list.selectingListItem=!0);break;case 9:this.list.isEmpty()||(this.list.isVisible()&&n.preventDefault(),this.value(this.list.active>=0?this.list.items[this.list.active].original:null),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next();break}},i.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()},i.prototype.handlePaste=function(n){if(n.clipboardData)this.handleInputChange(n.clipboardData.getData(\"Text\"));else{var o=this;setTimeout(function(){o.handleInputChange(n.target.value)},100)}},i.prototype.handleInputChange=function(n){if(this.query=this.normalize(n),this.list.clear(),this.query.length<this.options.minLength){this.list.draw();return}this.getCandidates(function(o){for(var s=0;s<o.length&&(this.list.add(o[s]),s!==this.options.limit-1);s++);this.list.draw()}.bind(this))},i.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1},i.prototype.update=function(n){this.data=n,this.handleKeyUp()},i.prototype.clear=function(){this.data=[],this.list.clear()},i.prototype.normalize=function(n){return n=n.toLowerCase(),n},i.prototype.match=function(n,o){return n.indexOf(o)>-1},i.prototype.value=function(n){if(this.selected=n,this.el.value=this.getItemValue(n||{place_name:this.query}),document.createEvent){var o=document.createEvent(\"HTMLEvents\");o.initEvent(\"change\",!0,!1),this.el.dispatchEvent(o)}else this.el.fireEvent(\"onchange\")},i.prototype.getCandidates=function(n){var o={pre:\"<strong>\",post:\"</strong>\",extract:function(a){return this.getItemValue(a)}.bind(this)},s;this.options.filter?(s=t.filter(this.query,this.data,o),s=s.map(function(a){return{original:a.original,string:this.render(a.original,a.string)}}.bind(this))):s=this.data.map(function(a){var h=this.render(a);return{original:a,string:h}}.bind(this)),n(s)},i.prototype.getItemValue=function(n){return n},i.prototype.render=function(n,o){if(o)return o;for(var s=n.original?this.getItemValue(n.original):this.getItemValue(n),a=this.normalize(s),h=a.lastIndexOf(this.query);h>-1;){var p=h+this.query.length;s=s.slice(0,h)+\"<strong>\"+s.slice(h,p)+\"</strong>\"+s.slice(p),h=a.slice(0,h).lastIndexOf(this.query)}return s},i.prototype.renderError=function(n){this.list.drawError(n)},Zit=i,Zit}var Kit,YIt;function WAe(){if(YIt)return Kit;YIt=1;var e=GAe();return Kit=e,typeof window<\"u\"&&(window.Suggestions=e),Kit}var qAe=WAe(),HAe=AV(qAe),mV={exports:{}},YAe=mV.exports,XIt;function XAe(){return XIt||(XIt=1,(function(e){(function(t,r,i){e.exports?e.exports=i():t[r]=i()})(YAe,\"subtag\",function(){var t=\"\",r=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function i(h){return h.match(r)||[]}function n(h){return i(h).filter(function(p,g){return p&&g})}function o(h){return h=i(h),{language:h[1]||t,extlang:h[2]||t,script:h[3]||t,region:h[4]||t}}function s(h,p,g){Object.defineProperty(h,p,{value:g,enumerable:!0})}function a(h,p,g){function w(C){return i(C)[h]||t}s(w,\"pattern\",p),s(o,g,w)}return a(1,/^[a-zA-Z]{2,3}$/,\"language\"),a(2,/^[a-zA-Z]{3}$/,\"extlang\"),a(3,/^[a-zA-Z]{4}$/,\"script\"),a(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,\"region\"),s(o,\"split\",n),o})})(mV)),mV.exports}var ZAe=XAe(),KAe=AV(ZAe),Qit,ZIt;function QAe(){if(ZIt)return Qit;ZIt=1;var e=\"Expected a function\",t=NaN,r=\"[object Symbol]\",i=/^\\s+|\\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,h=typeof fV==\"object\"&&fV&&fV.Object===Object&&fV,p=typeof self==\"object\"&&self&&self.Object===Object&&self,g=h||p||Function(\"return this\")(),w=Object.prototype,C=w.toString,R=Math.max,z=Math.min,W=function(){return g.Date.now()};function Y(at,et,lt){var J,ft,dt,Mt,Ft,Nt,$t=0,Yt=!1,_e=!1,Pe=!0;if(typeof at!=\"function\")throw new TypeError(e);et=rt(et)||0,H(lt)&&(Yt=!!lt.leading,_e=\"maxWait\"in lt,dt=_e?R(rt(lt.maxWait)||0,et):dt,Pe=\"trailing\"in lt?!!lt.trailing:Pe);function we(Rr){var ti=J,wr=ft;return J=ft=void 0,$t=Rr,Mt=at.apply(wr,ti),Mt}function Ue(Rr){return $t=Rr,Ft=setTimeout(Ce,et),Yt?we(Rr):Mt}function lr(Rr){var ti=Rr-Nt,wr=Rr-$t,He=et-ti;return _e?z(He,dt-wr):He}function ee(Rr){var ti=Rr-Nt,wr=Rr-$t;return Nt===void 0||ti>=et||ti<0||_e&&wr>=dt}function Ce(){var Rr=W();if(ee(Rr))return mr(Rr);Ft=setTimeout(Ce,lr(Rr))}function mr(Rr){return Ft=void 0,Pe&&J?we(Rr):(J=ft=void 0,Mt)}function gr(){Ft!==void 0&&clearTimeout(Ft),$t=0,J=Nt=ft=Ft=void 0}function Br(){return Ft===void 0?Mt:mr(W())}function Cr(){var Rr=W(),ti=ee(Rr);if(J=arguments,ft=this,Nt=Rr,ti){if(Ft===void 0)return Ue(Nt);if(_e)return Ft=setTimeout(Ce,et),we(Nt)}return Ft===void 0&&(Ft=setTimeout(Ce,et)),Mt}return Cr.cancel=gr,Cr.flush=Br,Cr}function H(at){var et=typeof at;return!!at&&(et==\"object\"||et==\"function\")}function Q(at){return!!at&&typeof at==\"object\"}function tt(at){return typeof at==\"symbol\"||Q(at)&&C.call(at)==r}function rt(at){if(typeof at==\"number\")return at;if(tt(at))return t;if(H(at)){var et=typeof at.valueOf==\"function\"?at.valueOf():at;at=H(et)?et+\"\":et}if(typeof at!=\"string\")return at===0?at:+at;at=at.replace(i,\"\");var lt=o.test(at);return lt||s.test(at)?a(at.slice(2),lt?2:8):n.test(at)?t:+at}return Qit=Y,Qit}var JAe=QAe(),tye=AV(JAe),eye=JIt(),Ep=AV(eye),pV={exports:{}},KIt;function rye(){if(KIt)return pV.exports;KIt=1;var e=typeof Reflect==\"object\"?Reflect:null,t=e&&typeof e.apply==\"function\"?e.apply:function(at,et,lt){return Function.prototype.apply.call(at,et,lt)},r;e&&typeof e.ownKeys==\"function\"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(at){return Object.getOwnPropertyNames(at).concat(Object.getOwnPropertySymbols(at))}:r=function(at){return Object.getOwnPropertyNames(at)};function i(rt){console&&console.warn&&console.warn(rt)}var n=Number.isNaN||function(at){return at!==at};function o(){o.init.call(this)}pV.exports=o,pV.exports.once=H,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(rt){if(typeof rt!=\"function\")throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof rt)}Object.defineProperty(o,\"defaultMaxListeners\",{enumerable:!0,get:function(){return s},set:function(rt){if(typeof rt!=\"number\"||rt<0||n(rt))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+rt+\".\");s=rt}}),o.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},o.prototype.setMaxListeners=function(at){if(typeof at!=\"number\"||at<0||n(at))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+at+\".\");return this._maxListeners=at,this};function h(rt){return rt._maxListeners===void 0?o.defaultMaxListeners:rt._maxListeners}o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(at){for(var et=[],lt=1;lt<arguments.length;lt++)et.push(arguments[lt]);var J=at===\"error\",ft=this._events;if(ft!==void 0)J=J&&ft.error===void 0;else if(!J)return!1;if(J){var dt;if(et.length>0&&(dt=et[0]),dt instanceof Error)throw dt;var Mt=new Error(\"Unhandled error.\"+(dt?\" (\"+dt.message+\")\":\"\"));throw Mt.context=dt,Mt}var Ft=ft[at];if(Ft===void 0)return!1;if(typeof Ft==\"function\")t(Ft,this,et);else for(var Nt=Ft.length,$t=z(Ft,Nt),lt=0;lt<Nt;++lt)t($t[lt],this,et);return!0};function p(rt,at,et,lt){var J,ft,dt;if(a(et),ft=rt._events,ft===void 0?(ft=rt._events=Object.create(null),rt._eventsCount=0):(ft.newListener!==void 0&&(rt.emit(\"newListener\",at,et.listener?et.listener:et),ft=rt._events),dt=ft[at]),dt===void 0)dt=ft[at]=et,++rt._eventsCount;else if(typeof dt==\"function\"?dt=ft[at]=lt?[et,dt]:[dt,et]:lt?dt.unshift(et):dt.push(et),J=h(rt),J>0&&dt.length>J&&!dt.warned){dt.warned=!0;var Mt=new Error(\"Possible EventEmitter memory leak detected. \"+dt.length+\" \"+String(at)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");Mt.name=\"MaxListenersExceededWarning\",Mt.emitter=rt,Mt.type=at,Mt.count=dt.length,i(Mt)}return rt}o.prototype.addListener=function(at,et){return p(this,at,et,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(at,et){return p(this,at,et,!0)};function g(){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 w(rt,at,et){var lt={fired:!1,wrapFn:void 0,target:rt,type:at,listener:et},J=g.bind(lt);return J.listener=et,lt.wrapFn=J,J}o.prototype.once=function(at,et){return a(et),this.on(at,w(this,at,et)),this},o.prototype.prependOnceListener=function(at,et){return a(et),this.prependListener(at,w(this,at,et)),this},o.prototype.removeListener=function(at,et){var lt,J,ft,dt,Mt;if(a(et),J=this._events,J===void 0)return this;if(lt=J[at],lt===void 0)return this;if(lt===et||lt.listener===et)--this._eventsCount===0?this._events=Object.create(null):(delete J[at],J.removeListener&&this.emit(\"removeListener\",at,lt.listener||et));else if(typeof lt!=\"function\"){for(ft=-1,dt=lt.length-1;dt>=0;dt--)if(lt[dt]===et||lt[dt].listener===et){Mt=lt[dt].listener,ft=dt;break}if(ft<0)return this;ft===0?lt.shift():W(lt,ft),lt.length===1&&(J[at]=lt[0]),J.removeListener!==void 0&&this.emit(\"removeListener\",at,Mt||et)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(at){var et,lt,J;if(lt=this._events,lt===void 0)return this;if(lt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):lt[at]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete lt[at]),this;if(arguments.length===0){var ft=Object.keys(lt),dt;for(J=0;J<ft.length;++J)dt=ft[J],dt!==\"removeListener\"&&this.removeAllListeners(dt);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(et=lt[at],typeof et==\"function\")this.removeListener(at,et);else if(et!==void 0)for(J=et.length-1;J>=0;J--)this.removeListener(at,et[J]);return this};function C(rt,at,et){var lt=rt._events;if(lt===void 0)return[];var J=lt[at];return J===void 0?[]:typeof J==\"function\"?et?[J.listener||J]:[J]:et?Y(J):z(J,J.length)}o.prototype.listeners=function(at){return C(this,at,!0)},o.prototype.rawListeners=function(at){return C(this,at,!1)},o.listenerCount=function(rt,at){return typeof rt.listenerCount==\"function\"?rt.listenerCount(at):R.call(rt,at)},o.prototype.listenerCount=R;function R(rt){var at=this._events;if(at!==void 0){var et=at[rt];if(typeof et==\"function\")return 1;if(et!==void 0)return et.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function z(rt,at){for(var et=new Array(at),lt=0;lt<at;++lt)et[lt]=rt[lt];return et}function W(rt,at){for(;at+1<rt.length;at++)rt[at]=rt[at+1];rt.pop()}function Y(rt){for(var at=new Array(rt.length),et=0;et<at.length;++et)at[et]=rt[et].listener||rt[et];return at}function H(rt,at){return new Promise(function(et,lt){function J(dt){rt.removeListener(at,ft),lt(dt)}function ft(){typeof rt.removeListener==\"function\"&&rt.removeListener(\"error\",J),et([].slice.call(arguments))}tt(rt,at,ft,{once:!0}),at!==\"error\"&&Q(rt,J,{once:!0})})}function Q(rt,at,et){typeof rt.on==\"function\"&&tt(rt,\"error\",at,et)}function tt(rt,at,et,lt){if(typeof rt.on==\"function\")lt.once?rt.once(at,et):rt.on(at,et);else if(typeof rt.addEventListener==\"function\")rt.addEventListener(at,function J(ft){lt.once&&rt.removeEventListener(at,J),et(ft)});else throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof rt)}return pV.exports}var iye=rye(),QIt={fr:{name:\"France\",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:\"United States\",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:\"Russia\",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:\"Canada\",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}},nye={de:\"Suche\",it:\"Ricerca\",en:\"Search\",nl:\"Zoeken\",fr:\"Chercher\",ca:\"Cerca\",he:\"\\u05DC\\u05D7\\u05E4\\u05E9\",ja:\"\\u30B5\\u30FC\\u30C1\",lv:\"Mekl\\u0113t\",pt:\"Procurar\",sr:\"\\u041F\\u0440\\u0435\\u0442\\u0440\\u0430\\u0433\\u0430\",zh:\"\\u641C\\u7D22\",cs:\"Vyhled\\xE1v\\xE1n\\xED\",hu:\"Keres\\xE9s\",ka:\"\\u10EB\\u10D8\\u10D4\\u10D1\\u10D0\",nb:\"S\\xF8ke\",sk:\"Vyh\\u013Ead\\xE1vanie\",th:\"\\u0E04\\u0E49\\u0E19\\u0E2B\\u0E32\",fi:\"Hae\",is:\"Leita\",ko:\"\\uC218\\uC0C9\",pl:\"Szukaj\",sl:\"Iskanje\",fa:\"\\u062C\\u0633\\u062A\\u062C\\u0648\",ru:\"\\u041F\\u043E\\u0438\\u0441\\u043A\",es:\"Buscar\"},oye={en:\"No results found\",de:\"Keine Ergebnisse gefunden\",es:\"No hay resultados\",fr:\"Aucun r\\xE9sultat trouv\\xE9\"},sye={en:\"There was an error reaching the server\",de:\"Verbindung fehlgeschlagen\",es:\"Error al conectarse al servidor\",fr:\"Une erreur est survenue lors de la connexion au serveur\"},eR={placeholder:nye,errorNoResults:oye,errorConnectionFailed:sye},aye=/(-?\\d+\\.?\\d*)[, ]+(-?\\d+\\.?\\d*)[ ]*$/,gV=class{constructor(t,r,i=(n,o,s)=>new HAe(n,o,s)){this.options={zoom:16,flyTo:!0,trackProximity:!0,showResultsWhileTyping:!1,minLength:2,reverseGeocode:!1,limit:5,enableEventLogging:!0,marker:!0,popup:!1,maplibregl:void 0,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,proximityMinZoom:9,getItemValue:n=>n.text!=null?n.text:n.place_name,render:n=>{if(!(\"geometry\"in n)){let s=n.text,a=s.toLowerCase().indexOf(this._typeahead.query.toLowerCase()),h=this._typeahead.query.length,p=s.substring(0,a),g=s.substring(a,a+h),w=s.substring(a+h);return'<div class=\"maplibregl-ctrl-geocoder--suggestion\"><svg class=\"maplibregl-ctrl-geocoder--suggestion-icon\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22.8702 20.1258H21.4248L20.9125 19.6318C22.7055 17.546 23.785 14.8382 23.785 11.8925C23.785 5.32419 18.4608 0 11.8925 0C5.32419 0 0 5.32419 0 11.8925C0 18.4608 5.32419 23.785 11.8925 23.785C14.8382 23.785 17.546 22.7055 19.6318 20.9125L20.1258 21.4248V22.8702L29.2739 32L32 29.2739L22.8702 20.1258ZM11.8925 20.1258C7.33676 20.1258 3.65923 16.4483 3.65923 11.8925C3.65923 7.33676 7.33676 3.65923 11.8925 3.65923C16.4483 3.65923 20.1258 7.33676 20.1258 11.8925C20.1258 16.4483 16.4483 20.1258 11.8925 20.1258Z\" fill=\"#687078\"/></svg><div class=\"maplibregl-ctrl-geocoder--suggestion-info\"><div class=\"maplibregl-ctrl-geocoder--suggestion-title\">'+p+'<span class=\"maplibregl-ctrl-geocoder--suggestion-match\">'+g+\"</span>\"+w+\"</div></div></div>\"}let o=n.place_name.split(\",\");return'<div class=\"maplibregl-ctrl-geocoder--result\"><svg class=\"maplibregl-ctrl-geocoder--result-icon\" viewBox=\"0 0 24 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 0C5.36571 0 0 5.38676 0 12.0471C0 21.0824 12 32 12 32C12 32 24 21.0824 24 12.0471C24 5.38676 18.6343 0 12 0ZM12 16.3496C9.63428 16.3496 7.71429 14.4221 7.71429 12.0471C7.71429 9.67207 9.63428 7.74454 12 7.74454C14.3657 7.74454 16.2857 9.67207 16.2857 12.0471C16.2857 14.4221 14.3657 16.3496 12 16.3496Z\" fill=\"#687078\"/></svg><div><div class=\"maplibregl-ctrl-geocoder--result-title\">'+o[0]+'</div><div class=\"maplibregl-ctrl-geocoder--result-address\">'+o.splice(1,o.length).join(\",\")+\"</div></div></div>\"},popupRender:n=>{let o=n.place_name.split(\",\");return'<div class=\"maplibregl-ctrl-geocoder--suggestion popup-suggestion\"><div class=\"maplibregl-ctrl-geocoder--suggestion-title popup-suggestion-title\">'+o[0]+'</div><div class=\"maplibregl-ctrl-geocoder--suggestion-address popup-suggestion-address\">'+o.splice(1,o.length).join(\",\")+\"</div></div>\"},showResultMarkers:!0,debounceSearch:200},this._eventEmitter=new iye.EventEmitter,this.options=Ep({},this.options,r),this.fresh=!0,this.lastSelected=null,this.geocoderApi=t,this.typeaheadFactory=i}addTo(t){function r(i,n){if(!document.body.contains(n))throw new Error(\"Element provided to #addTo() exists, but is not in the DOM\");let o=i.onAdd();n.appendChild(o)}if(t instanceof HTMLElement)r(this,t);else if(typeof t==\"string\"){let i=document.querySelectorAll(t);if(i.length===0)throw new Error(\"Element \"+t+\"not found.\");if(i.length>1)throw new Error(\"Geocoder can only be added to a single html element\");r(this,i[0])}else if(\"addControl\"in t)t.addControl(this);else throw new Error(\"Error: addTo must be a maplibre-gl-js map, an html element, or a CSS selector query for a single html element\")}onAdd(t){if(t&&typeof t!=\"string\"&&(this._map=t),this.setLanguage(),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error(\"A localGeocoder function must be specified to use localGeocoderOnly mode\");this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);let r=this.container=document.createElement(\"div\");r.className=\"maplibregl-ctrl-geocoder maplibregl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl\";let i=this.createIcon(\"search\",'<path d=\"M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z\"/>');this._inputEl=document.createElement(\"input\"),this._inputEl.type=\"search\",this._inputEl.className=\"maplibregl-ctrl-geocoder--input\",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener(\"mouseenter\",this._unCollapse),this.container.addEventListener(\"mouseleave\",this._collapse),this._inputEl.addEventListener(\"focus\",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener(\"blur\",this._onBlur),this._inputEl.addEventListener(\"keydown\",tye(this._onKeyDown,this.options.debounceSearch)),this._inputEl.addEventListener(\"paste\",this._onPaste),this._inputEl.addEventListener(\"change\",this._onChange),this.container.addEventListener(\"mouseenter\",this._showButton),this.container.addEventListener(\"mouseleave\",this._hideButton);let n=document.createElement(\"div\");n.classList.add(\"maplibregl-ctrl-geocoder--pin-right\"),this._clearEl=document.createElement(\"button\"),this._clearEl.setAttribute(\"type\",\"button\"),this._clearEl.setAttribute(\"aria-label\",\"Clear\"),this._clearEl.addEventListener(\"click\",this.clear),this._clearEl.className=\"maplibregl-ctrl-geocoder--button\";let o=this.createIcon(\"close\",'<path d=\"M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z\"/>');return this._clearEl.appendChild(o),this._loadingEl=this.createIcon(\"loading\",'<path fill=\"#333\" d=\"M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z\"/><path opacity=\".1\" d=\"M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z\"/>'),n.appendChild(this._clearEl),n.appendChild(this._loadingEl),r.appendChild(i),r.appendChild(this._inputEl),r.appendChild(n),this._typeahead=this.typeaheadFactory(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit,noInitialSelection:!0}),this.container.addEventListener(\"click\",()=>{this._typeahead.update(this._typeahead.data)}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this.resultMarkers=[],this._handleMarker=this._handleMarker.bind(this),this._handleResultMarkers=this._handleResultMarkers.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on(\"moveend\",this._updateProximity)),this._maplibregl=this.options.maplibregl,!this._maplibregl&&this.options.marker&&(console.error(\"No maplibregl detected in options. Map markers are disabled. Please set options.maplibregl.\"),this.options.marker=!1)),r}createIcon(t,r){let i=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");if(i.setAttribute(\"class\",\"maplibregl-ctrl-geocoder--icon maplibregl-ctrl-geocoder--icon-\"+t),i.setAttribute(\"viewBox\",\"0 0 18 18\"),i.setAttribute(\"xml:space\",\"preserve\"),i.setAttribute(\"width\",\"18\"),i.setAttribute(\"height\",\"18\"),\"innerHTML\"in i)i.innerHTML=r;else{let n=document.createElement(\"div\");n.innerHTML=\"<svg>\"+r.valueOf().toString()+\"</svg>\";let o=n.firstChild,s=o.firstChild;i.appendChild(s)}return i}onRemove(){return this.container.remove(),this.options.trackProximity&&this._map&&this._map.off(\"moveend\",this._updateProximity),this._removeMarker(),this._map=null,this}_onPaste(t){let r=(t.clipboardData||window.clipboardData).getData(\"text\");r.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(r)}_onKeyDown(t){if(t.key===\"Escape\"&&this.options.clearAndBlurOnEsc){this._clear(t),this._inputEl.blur();return}let r=this._inputEl.value;if(!r){this.fresh=!0,t.key!==\"Tab\"&&this.clear(t),this._clearEl.style.display=\"none\";return}if(!(t.metaKey||t.key===\"Tab\"||t.key===\"Escape\"||t.key===\"ArrowLeft\"||t.key===\"ArrowRight\"||t.key===\"ArrowUp\"||t.key===\"ArrowDown\")){if(t.key===\"Enter\")if(!this.options.showResultsWhileTyping)this._typeahead.selected||this._geocode(r);else{this._typeahead.selected==null&&this.geocoderApi.getSuggestions?this._geocode(r,!0):this._typeahead.selected==null&&this.options.showResultMarkers&&this._fitBoundsForMarkers();return}r.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(r)}}_showButton(){this._inputEl.value.length>0&&(this._clearEl.style.display=\"block\")}_hideButton(){this._typeahead.selected&&(this._clearEl.style.display=\"none\")}_onBlur(t){this.options.clearOnBlur&&this._clearOnBlur(t),this.options.collapsed&&this._collapse()}_onChange(){var t;let r=this._typeahead.selected;if(r){if(!(\"geometry\"in r)){r.placeId?this._geocode(r.placeId,!0,!0):this._geocode(r.text,!0);return}if(JSON.stringify(r)!==this.lastSelected){if(this._clearEl.style.display=\"none\",this.options.flyTo){let i;if(this._removeResultMarkers(),r.properties&&QIt[r.properties.short_code])i=Ep({},this.options.flyTo),this._map&&this._map.fitBounds(QIt[r.properties.short_code].bbox,i);else if(r.bbox){let n=r.bbox;i=Ep({},this.options.flyTo),this._map&&this._map.fitBounds([[n[0],n[1]],[n[2],n[3]]],i)}else{let n={zoom:this.options.zoom};i=Ep({},n,this.options.flyTo),r.center?i.center=r.center:((t=r.geometry)===null||t===void 0?void 0:t.type)===\"Point\"&&r.geometry.coordinates&&(i.center=r.geometry.coordinates),this._map&&this._map.flyTo(i)}}this.options.marker&&this._maplibregl&&this._handleMarker(r),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(r),this._typeahead.selected=null,this._eventEmitter.emit(\"result\",{result:r})}}}_getConfigForRequest(){return[\"bbox\",\"limit\",\"proximity\",\"countries\",\"types\",\"language\",\"reverseMode\"].reduce((i,n)=>(this.options[n]&&([\"countries\",\"types\",\"language\"].indexOf(n)>-1?i[n]=this.options[n].split(/[\\s,]+/):i[n]=this.options[n],n===\"proximity\"&&this.options[n]&&typeof this.options[n].longitude==\"number\"&&typeof this.options[n].latitude==\"number\"&&(i[n]=[this.options[n].longitude,this.options[n].latitude])),i),{})}_geocode(t){return qit(this,arguments,void 0,function*(r,i=!1,n=!1){this._loadingEl.style.display=\"block\",this._eventEmitter.emit(\"loading\",{query:r});let o=this._getConfigForRequest(),s=this._createGeocodeRequest(o,r,i,n),a=this.options.localGeocoder?this.options.localGeocoder(r)||[]:[];try{let h=yield s;yield this._handleGeocodeResponse(h,o,r,i,a)}catch(h){this._handleGeocodeErrorResponse(h,a)}return s})}_createGeocodeRequest(t,r,i,n){return this.options.localGeocoderOnly?Promise.resolve({}):this.options.reverseGeocode&&aye.test(r)?this._createReverseGeocodeRequest(r,t):(t.query=r,this.geocoderApi.getSuggestions?i?this.geocoderApi.searchByPlaceId&&n?this.geocoderApi.searchByPlaceId(t):this.geocoderApi.forwardGeocode(t):this.geocoderApi.getSuggestions(t):this.geocoderApi.forwardGeocode(t))}_createReverseGeocodeRequest(t,r){let i=t.split(/[\\s(,)?]+/).map(n=>parseFloat(n)).reverse();return r.query=i,r.limit=1,\"proximity\"in r&&delete r.proximity,this.geocoderApi.reverseGeocode(r)}_handleGeocodeResponse(t,r,i,n,o){return qit(this,void 0,void 0,function*(){this._loadingEl.style.display=\"none\";let s={};t?s=t:s={type:\"FeatureCollection\",features:[]},s.config=r,this.fresh&&(this.fresh=!1),s.features=s.features?o.concat(s.features):o;let a=this.options.externalGeocoder?this.options.externalGeocoder(i,s.features,r)||Promise.resolve([]):Promise.resolve([]);try{let p=yield a;s.features=s.features?p.concat(s.features):p}catch{}this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter));let h=[];\"suggestions\"in s?h=s.suggestions:\"place\"in s?h=Array.isArray(s.place)?s.place:[s.place]:h=s.features,h.length?(this._clearEl.style.display=\"block\",this._typeahead.update(h),(!this.options.showResultsWhileTyping||n)&&this.options.showResultMarkers&&(s.features.length>0||\"place\"in s)&&this._fitBoundsForMarkers(),this._eventEmitter.emit(\"results\",s)):(this._clearEl.style.display=\"none\",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit(\"results\",s))})}_handleGeocodeErrorResponse(t,r){this._loadingEl.style.display=\"none\",r.length&&this.options.localGeocoder?(this._clearEl.style.display=\"block\",this._typeahead.update(r)):(this._clearEl.style.display=\"none\",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit(\"results\",{features:r}),this._eventEmitter.emit(\"error\",{error:t})}_clear(t){t&&t.preventDefault(),this._inputEl.value=\"\",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display=\"none\",this._removeMarker(),this._removeResultMarkers(),this.lastSelected=null,this._eventEmitter.emit(\"clear\"),this.fresh=!0}clear(t){this._clear(t),this._inputEl.focus()}_clearOnBlur(t){t.relatedTarget&&this._clear(t)}_onQueryResult(t){if(!(\"features\"in t)||!t.features.length)return;let r=t.features[0];this._typeahead.selected=r,this._inputEl.value=r.place_name,this._onChange()}_updateProximity(){if(this._map)if(this._map.getZoom()>this.options.proximityMinZoom){let t=this._map.getCenter().wrap();this.setProximity({longitude:t.lng,latitude:t.lat})}else this.setProximity(null)}_collapse(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add(\"maplibregl-ctrl-geocoder--collapsed\")}_unCollapse(){this.container.classList.remove(\"maplibregl-ctrl-geocoder--collapsed\")}query(t){return qit(this,void 0,void 0,function*(){let r=yield this._geocode(t);this._onQueryResult(r)})}_renderError(){let t=`<div class='maplibre-gl-geocoder--error'>${this._localize(\"errorConnectionFailed\")}</div>`;this._renderMessage(t)}_renderNoResults(){let t=`<div class='maplibre-gl-geocoder--error maplibre-gl-geocoder--no-results'>\n        ${this._localize(\"errorNoResults\")}</div>`;this._renderMessage(t)}_renderMessage(t){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(t)}_localize(t){let r=KAe.language(this.options.language.split(\",\")[0]);return this.options.language&&eR?.[t][r]?eR[t][r]:eR[t].en}_fitBoundsForMarkers(){var t;if(this._typeahead.data.length<1)return;let r=this._typeahead.data.filter(i=>typeof i!=\"string\").slice(0,this.options.limit);if(this._clearEl.style.display=\"none\",this.options.flyTo&&this._maplibregl&&this._map){let n=Ep({},{padding:100},this.options.flyTo),o=new this._maplibregl.LngLatBounds;for(let s of r)\"geometry\"in s&&((t=s.geometry)===null||t===void 0?void 0:t.type)===\"Point\"&&o.extend(s.geometry.coordinates);this._map.fitBounds(o,n)}return r.length>0&&this._maplibregl&&this._handleResultMarkers(r),this}setInput(t){return this._inputEl.value=t,this._typeahead.selected=null,this._typeahead.clear(),t.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(t),this}setProximity(t){return this.options.proximity=t,this}getProximity(){return this.options.proximity}setRenderFunction(t){return t&&typeof t==\"function\"&&(this._typeahead.render=t),this}getRenderFunction(){return this._typeahead.render}setLanguage(t){return this.options.language=t||this.options.language||navigator.language,this}getLanguage(){return this.options.language}getZoom(){return this.options.zoom}setZoom(t){return this.options.zoom=t,this}getFlyTo(){return this.options.flyTo}setFlyTo(t){return this.options.flyTo=t,this}getPlaceholder(){return this.options.placeholder}setPlaceholder(t){return this.options.placeholder=t||this.options.placeholder||this._localize(\"placeholder\"),this._inputEl.placeholder=this.options.placeholder,this._inputEl.setAttribute(\"aria-label\",this.options.placeholder),this}getBbox(){return this.options.bbox}setBbox(t){return this.options.bbox=t,this}getCountries(){return this.options.countries}setCountries(t){return this.options.countries=t,this}getTypes(){return this.options.types}setTypes(t){return this.options.types=t,this}getMinLength(){return this.options.minLength}setMinLength(t){return this.options.minLength=t,this._typeahead&&(this._typeahead.options.minLength=t),this}getLimit(){return this.options.limit}setLimit(t){return this.options.limit=t,this._typeahead&&(this._typeahead.options.limit=t),this}getFilter(){return this.options.filter}setFilter(t){return this.options.filter=t,this}setGeocoderApi(t){return this.geocoderApi=t,this}getGeocoderApi(){return this.geocoderApi}_handleMarker(t){var r;if(!this._map)return;this._removeMarker();let n=Ep({},{color:\"#4668F2\"},this.options.marker);this.mapMarker=new this._maplibregl.Marker(n);let o=null;if(this.options.popup){let a=Ep({},{},this.options.popup);o=new this._maplibregl.Popup(a).setHTML(this.options.popupRender(t))}return t.center?(this.mapMarker.setLngLat(t.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(o)):((r=t.geometry)===null||r===void 0?void 0:r.type)===\"Point\"&&t.geometry.coordinates&&(this.mapMarker.setLngLat(t.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(o)),this}_removeMarker(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)}_handleResultMarkers(t){if(!this._map)return;this._removeResultMarkers();let i=Ep({},{color:\"#4668F2\"},this.options.showResultMarkers);for(let n of t){let o;if(this.options.showResultMarkers){this.options.showResultMarkers&&this.options.showResultMarkers.element&&(o=this.options.showResultMarkers.element.cloneNode(!0),i=Ep(i,{element:o}));let s=new this._maplibregl.Marker(Ep({},i,{element:o})),a;if(this.options.popup){let p=Ep({},{},this.options.popup);a=new this._maplibregl.Popup(p).setHTML(this.options.popupRender(n))}n.center?(s.setLngLat(n.center).addTo(this._map),this.options.popup&&s.setPopup(a)):n.geometry&&n.geometry.type&&n.geometry.type===\"Point\"&&n.geometry.coordinates&&(s.setLngLat(n.geometry.coordinates).addTo(this._map),this.options.popup&&s.setPopup(a)),this.resultMarkers.push(s)}}return this}_removeResultMarkers(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(t){t.remove()}),this.resultMarkers=[])}on(t,r){return this._eventEmitter.on(t,r),this}once(t){return new Promise(r=>{this._eventEmitter.once(t,r)})}off(t,r){return this._eventEmitter.removeListener(t,r),this}};var I_=xe(ze(),1),Vh=xe(ze(),1);var Jit=xe(ze(),1),yV=xe(ze(),1);var t8t=Jit.createContext(null);function e8t(e,t){let r=Array.isArray(e)?e[0]:e?e.x:0,i=Array.isArray(e)?e[1]:e?e.y:0,n=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return r===n&&i===o}function Kc(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Kc(e[r],t[r]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e==\"object\"&&typeof t==\"object\"){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let n of r)if(!t.hasOwnProperty(n)||!Kc(e[n],t[n]))return!1;return!0}return!1}function tnt(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function ent(e,t){let r=t.viewState||t,i={};if(\"longitude\"in r&&\"latitude\"in r&&(r.longitude!==e.center.lng||r.latitude!==e.center.lat)){let n=e.center.constructor;i.center=new n(r.longitude,r.latitude)}return\"zoom\"in r&&r.zoom!==e.zoom&&(i.zoom=r.zoom),\"bearing\"in r&&r.bearing!==e.bearing&&(i.bearing=r.bearing),\"pitch\"in r&&r.pitch!==e.pitch&&(i.pitch=r.pitch),r.padding&&e.padding&&!Kc(r.padding,e.padding)&&(i.padding=r.padding),i}var lye=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"];function rnt(e){if(!e)return null;if(typeof e==\"string\"||(\"toJS\"in e&&(e=e.toJS()),!e.layers))return e;let t={};for(let i of e.layers)t[i.id]=i;let r=e.layers.map(i=>{let n=null;\"interactive\"in i&&(n=Object.assign({},i),delete n.interactive);let o=t[i.ref];if(o){n=n||Object.assign({},i),delete n.ref;for(let s of lye)s in o&&(n[s]=o[s])}return n||i});return{...e,layers:r}}var r8t={version:8,sources:{},layers:[]},i8t={mousedown:\"onMouseDown\",mouseup:\"onMouseUp\",mouseover:\"onMouseOver\",mousemove:\"onMouseMove\",click:\"onClick\",dblclick:\"onDblClick\",mouseenter:\"onMouseEnter\",mouseleave:\"onMouseLeave\",mouseout:\"onMouseOut\",contextmenu:\"onContextMenu\",touchstart:\"onTouchStart\",touchend:\"onTouchEnd\",touchmove:\"onTouchMove\",touchcancel:\"onTouchCancel\"},n8t={movestart:\"onMoveStart\",move:\"onMove\",moveend:\"onMoveEnd\",dragstart:\"onDragStart\",drag:\"onDrag\",dragend:\"onDragEnd\",zoomstart:\"onZoomStart\",zoom:\"onZoom\",zoomend:\"onZoomEnd\",rotatestart:\"onRotateStart\",rotate:\"onRotate\",rotateend:\"onRotateEnd\",pitchstart:\"onPitchStart\",pitch:\"onPitch\",pitchend:\"onPitchEnd\"},o8t={wheel:\"onWheel\",boxzoomstart:\"onBoxZoomStart\",boxzoomend:\"onBoxZoomEnd\",boxzoomcancel:\"onBoxZoomCancel\",resize:\"onResize\",load:\"onLoad\",render:\"onRender\",idle:\"onIdle\",remove:\"onRemove\",data:\"onData\",styledata:\"onStyleData\",sourcedata:\"onSourceData\",error:\"onError\"},cye=[\"minZoom\",\"maxZoom\",\"minPitch\",\"maxPitch\",\"maxBounds\",\"projection\",\"renderWorldCopies\"],uye=[\"scrollZoom\",\"boxZoom\",\"dragRotate\",\"dragPan\",\"keyboard\",\"doubleClickZoom\",\"touchZoomRotate\",\"touchPitch\"],_V=class e{constructor(t,r,i){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=n=>{let o=this.props[o8t[n.type]];o?o(n):n.type===\"error\"&&console.error(n.error)},this._onCameraEvent=n=>{if(this._internalUpdate)return;n.viewState=this._propsedCameraUpdate||tnt(this._map.transform);let o=this.props[n8t[n.type]];o&&o(n)},this._onCameraUpdate=n=>this._internalUpdate?n:(this._propsedCameraUpdate=tnt(n),ent(n,this.props)),this._onPointerEvent=n=>{(n.type===\"mousemove\"||n.type===\"mouseout\")&&this._updateHover(n);let o=this.props[i8t[n.type]];o&&(this.props.interactiveLayerIds&&n.type!==\"mouseover\"&&n.type!==\"mouseout\"&&(n.features=this._hoveredFeatures||this._queryRenderedFeatures(n.point)),o(n),delete n.features)},this._MapClass=t,this.props=r,this._initialize(i)}get map(){return this._map}setProps(t){let r=this.props;this.props=t;let i=this._updateSettings(t,r),n=this._updateSize(t),o=this._updateViewState(t);this._updateStyle(t,r),this._updateStyleComponents(t),this._updateHandlers(t,r),(i||n||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,r){let i=e.savedMaps.pop();if(!i)return null;let n=i.map,o=n.getContainer();for(r.className=o.className;o.childNodes.length>0;)r.appendChild(o.childNodes[0]);n._container=r;let s=n._resizeObserver;s&&(s.disconnect(),s.observe(r)),i.setProps({...t,styleDiffing:!1}),n.resize();let{initialViewState:a}=t;return a&&(a.bounds?n.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):i._updateViewState(a)),n.isStyleLoaded()?n.fire(\"load\"):n.once(\"style.load\",()=>n.fire(\"load\")),n._update(),i}_initialize(t){let{props:r}=this,{mapStyle:i=r8t}=r,n={...r,...r.initialViewState,container:t,style:rnt(i)},o=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),r.gl){let a=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=a,r.gl)}let s=new this._MapClass(n);o.padding&&s.setPadding(o.padding),r.cursor&&(s.getCanvas().style.cursor=r.cursor),s.transformCameraUpdate=this._onCameraUpdate,s.on(\"style.load\",()=>{this._styleComponents={light:s.getLight(),sky:s.getSky(),projection:s.getProjection?.(),terrain:s.getTerrain()},this._updateStyleComponents(this.props)}),s.on(\"sourcedata\",()=>{this._updateStyleComponents(this.props)});for(let a in i8t)s.on(a,this._onPointerEvent);for(let a in n8t)s.on(a,this._onCameraEvent);for(let a in o8t)s.on(a,this._onEvent);this._map=s}recycle(){this.map.getContainer().querySelector(\"[mapboxgl-children]\")?.remove(),e.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){let{viewState:r}=t;if(r){let i=this._map;if(r.width!==i.transform.width||r.height!==i.transform.height)return i.resize(),!0}return!1}_updateViewState(t){let r=this._map,i=r.transform;if(!r.isMoving()){let o=ent(i,t);if(Object.keys(o).length>0)return this._internalUpdate=!0,r.jumpTo(o),this._internalUpdate=!1,!0}return!1}_updateSettings(t,r){let i=this._map,n=!1;for(let o of cye)o in t&&!Kc(t[o],r[o])&&(n=!0,i[`set${o[0].toUpperCase()}${o.slice(1)}`]?.call(i,t[o]));return n}_updateStyle(t,r){if(t.cursor!==r.cursor&&(this._map.getCanvas().style.cursor=t.cursor||\"\"),t.mapStyle!==r.mapStyle){let{mapStyle:i=r8t,styleDiffing:n=!0}=t,o={diff:n};\"localIdeographFontFamily\"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(rnt(i),o)}}_updateStyleComponents({light:t,projection:r,sky:i,terrain:n}){let o=this._map,s=this._styleComponents;o.style._loaded&&(t&&!Kc(t,s.light)&&(s.light=t,o.setLight(t)),r&&!Kc(r,s.projection)&&r!==s.projection?.type&&(s.projection=typeof r==\"string\"?{type:r}:r,o.setProjection?.(s.projection)),i&&!Kc(i,s.sky)&&(s.sky=i,o.setSky(i)),n!==void 0&&!Kc(n,s.terrain)&&(!n||o.getSource(n.source))&&(s.terrain=n,o.setTerrain(n)))}_updateHandlers(t,r){let i=this._map;for(let n of uye){let o=t[n]??!0,s=r[n]??!0;Kc(o,s)||(o?i[n].enable(o):i[n].disable())}}_queryRenderedFeatures(t){let r=this._map,{interactiveLayerIds:i=[]}=this.props;try{return r.queryRenderedFeatures(t,{layers:i.filter(r.getLayer.bind(r))})}catch{return[]}}_updateHover(t){let{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){let n=t.type,o=this._hoveredFeatures?.length>0,s=this._queryRenderedFeatures(t.point),a=s.length>0;!a&&o&&(t.type=\"mouseleave\",this._onPointerEvent(t)),this._hoveredFeatures=s,a&&!o&&(t.type=\"mouseenter\",this._onPointerEvent(t)),t.type=n}else this._hoveredFeatures=null}};_V.savedMaps=[];var int=_V;var hye=[\"setMaxBounds\",\"setMinZoom\",\"setMaxZoom\",\"setMinPitch\",\"setMaxPitch\",\"setRenderWorldCopies\",\"setProjection\",\"setStyle\",\"addSource\",\"removeSource\",\"addLayer\",\"removeLayer\",\"setLayerZoomRange\",\"setFilter\",\"setPaintProperty\",\"setLayoutProperty\",\"setLight\",\"setTerrain\",\"setFog\",\"remove\"];function nnt(e){if(!e)return null;let t=e.map,r={getMap:()=>t};for(let i of dye(t))!(i in r)&&!hye.includes(i)&&(r[i]=t[i].bind(t));return r}function dye(e){let t=new Set,r=e;for(;r;){for(let i of Object.getOwnPropertyNames(r))i[0]!==\"_\"&&typeof e[i]==\"function\"&&i!==\"fire\"&&i!==\"setEventedParent\"&&t.add(i);r=Object.getPrototypeOf(r)}return Array.from(t)}var vV=xe(ze(),1),fye=typeof document<\"u\"?vV.useLayoutEffect:vV.useEffect,s8t=fye;function ont(e,t){let{RTLTextPlugin:r,maxParallelImageRequests:i,workerCount:n,workerUrl:o}=t;if(r&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()===\"unavailable\"){let{pluginUrl:s,lazy:a=!0}=typeof r==\"string\"?{pluginUrl:r}:r;e.setRTLTextPlugin(s,h=>{h&&console.error(h)},a)}i!==void 0&&e.setMaxParallelImageRequests(i),n!==void 0&&e.setWorkerCount(n),o!==void 0&&e.setWorkerUrl(o)}var fm=I_.createContext(null);function pye(e,t){let r=(0,Vh.useContext)(t8t),[i,n]=(0,Vh.useState)(null),o=(0,Vh.useRef)(),{current:s}=(0,Vh.useRef)({mapLib:null,map:null});(0,Vh.useEffect)(()=>{let p=e.mapLib,g=!0,w;return Promise.resolve(p||Promise.resolve().then(()=>xe(l8t(),1))).then(C=>{if(!g)return;if(!C)throw new Error(\"Invalid mapLib\");let R=\"Map\"in C?C:C.default;if(!R.Map)throw new Error(\"Invalid mapLib\");ont(R,e),e.reuseMaps&&(w=int.reuse(e,o.current)),w||(w=new int(R.Map,e,o.current)),s.map=nnt(w),s.mapLib=R,n(w),r?.onMapMount(s.map,e.id)}).catch(C=>{let{onError:R}=e;R?R({type:\"error\",target:null,originalEvent:null,error:C}):console.error(C)}),()=>{g=!1,w&&(r?.onMapUnmount(e.id),e.reuseMaps?w.recycle():w.destroy())}},[]),s8t(()=>{i&&i.setProps(e)}),(0,Vh.useImperativeHandle)(t,()=>s.map,[i]);let a=(0,Vh.useMemo)(()=>({position:\"relative\",width:\"100%\",height:\"100%\",...e.style}),[e.style]),h={height:\"100%\"};return I_.createElement(\"div\",{id:e.id,ref:o,style:a},i&&I_.createElement(fm.Provider,{value:s},I_.createElement(\"div\",{\"mapboxgl-children\":\"\",style:h},e.children)))}var cM=I_.forwardRef(pye);var u8t=xe(ze(),1),h8t=xe(t5(),1),Qc=xe(ze(),1);var mye=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function hl(e,t){if(!e||!t)return;let r=e.style;for(let i in t){let n=t[i];Number.isFinite(n)&&!mye.test(i)?r[i]=`${n}px`:r[i]=n}}function bV(e,t){if(e===t)return null;let r=c8t(e),i=c8t(t),n=[];for(let o of i)r.has(o)||n.push(o);for(let o of r)i.has(o)||n.push(o);return n.length===0?null:n}function c8t(e){return new Set(e?e.trim().split(/\\s+/):[])}var gye=(0,Qc.memo)((0,Qc.forwardRef)((e,t)=>{let{map:r,mapLib:i}=(0,Qc.useContext)(fm),n=(0,Qc.useRef)({props:e}),o=(0,Qc.useMemo)(()=>{let H=!1;u8t.Children.forEach(e.children,rt=>{rt&&(H=!0)});let Q={...e,element:H?document.createElement(\"div\"):void 0},tt=new i.Marker(Q);return tt.setLngLat([e.longitude,e.latitude]),tt.getElement().addEventListener(\"click\",rt=>{n.current.props.onClick?.({type:\"click\",target:tt,originalEvent:rt})}),tt.on(\"dragstart\",rt=>{let at=rt;at.lngLat=o.getLngLat(),n.current.props.onDragStart?.(at)}),tt.on(\"drag\",rt=>{let at=rt;at.lngLat=o.getLngLat(),n.current.props.onDrag?.(at)}),tt.on(\"dragend\",rt=>{let at=rt;at.lngLat=o.getLngLat(),n.current.props.onDragEnd?.(at)}),tt},[]);(0,Qc.useEffect)(()=>(o.addTo(r.getMap()),()=>{o.remove()}),[]);let{longitude:s,latitude:a,offset:h,style:p,draggable:g=!1,popup:w=null,rotation:C=0,rotationAlignment:R=\"auto\",pitchAlignment:z=\"auto\"}=e;(0,Qc.useEffect)(()=>{hl(o.getElement(),p)},[p]),(0,Qc.useImperativeHandle)(t,()=>o,[]);let W=n.current.props;(o.getLngLat().lng!==s||o.getLngLat().lat!==a)&&o.setLngLat([s,a]),h&&!e8t(o.getOffset(),h)&&o.setOffset(h),o.isDraggable()!==g&&o.setDraggable(g),o.getRotation()!==C&&o.setRotation(C),o.getRotationAlignment()!==R&&o.setRotationAlignment(R),o.getPitchAlignment()!==z&&o.setPitchAlignment(z),o.getPopup()!==w&&o.setPopup(w);let Y=bV(W.className,e.className);if(Y)for(let H of Y)o.toggleClassName(H);return n.current.props=e,(0,h8t.createPortal)(e.children,o.getElement())}));var d8t=xe(t5(),1),mc=xe(ze(),1);var Aye=(0,mc.memo)((0,mc.forwardRef)((e,t)=>{let{map:r,mapLib:i}=(0,mc.useContext)(fm),n=(0,mc.useMemo)(()=>document.createElement(\"div\"),[]),o=(0,mc.useRef)({props:e}),s=(0,mc.useMemo)(()=>{let a={...e},h=new i.Popup(a);return h.setLngLat([e.longitude,e.latitude]),h.once(\"open\",p=>{o.current.props.onOpen?.(p)}),h},[]);if((0,mc.useEffect)(()=>{let a=h=>{o.current.props.onClose?.(h)};return s.on(\"close\",a),s.setDOMContent(n).addTo(r.getMap()),()=>{s.off(\"close\",a),s.isOpen()&&s.remove()}},[]),(0,mc.useEffect)(()=>{hl(s.getElement(),e.style)},[e.style]),(0,mc.useImperativeHandle)(t,()=>s,[]),s.isOpen()){let a=o.current.props;(s.getLngLat().lng!==e.longitude||s.getLngLat().lat!==e.latitude)&&s.setLngLat([e.longitude,e.latitude]),e.offset&&!Kc(a.offset,e.offset)&&s.setOffset(e.offset),(a.anchor!==e.anchor||a.maxWidth!==e.maxWidth)&&(s.options.anchor=e.anchor,s.setMaxWidth(e.maxWidth));let h=bV(a.className,e.className);if(h)for(let p of h)s.toggleClassName(p);o.current.props=e}return(0,d8t.createPortal)(e.children,n)}));var xV=xe(ze(),1);var uM=xe(ze(),1);function za(e,t,r,i){let n=(0,uM.useContext)(fm),o=(0,uM.useMemo)(()=>e(n),[]);return(0,uM.useEffect)(()=>{let s=i||r||t,a=typeof t==\"function\"&&typeof r==\"function\"?t:null,h=typeof r==\"function\"?r:typeof t==\"function\"?t:null,{map:p}=n;return p.hasControl(o)||(p.addControl(o,s?.position),a&&a(n)),()=>{h&&h(n),p.hasControl(o)&&p.removeControl(o)}},[]),o}function yye(e){let t=za(({mapLib:r})=>new r.AttributionControl(e),{position:e.position});return(0,xV.useEffect)(()=>{hl(t._container,e.style)},[e.style]),null}var _ye=(0,xV.memo)(yye);var wV=xe(ze(),1);function vye(e){let t=za(({mapLib:r})=>new r.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,wV.useEffect)(()=>{hl(t._controlContainer,e.style)},[e.style]),null}var lnt=(0,wV.memo)(vye);var pm=xe(ze(),1);function bye(e,t){let r=(0,pm.useRef)({props:e}),i=za(({mapLib:n})=>{let o=new n.GeolocateControl(e),s=o._setupUI;return o._setupUI=()=>{o._container.hasChildNodes()||s()},o.on(\"geolocate\",a=>{r.current.props.onGeolocate?.(a)}),o.on(\"error\",a=>{r.current.props.onError?.(a)}),o.on(\"outofmaxbounds\",a=>{r.current.props.onOutOfMaxBounds?.(a)}),o.on(\"trackuserlocationstart\",a=>{r.current.props.onTrackUserLocationStart?.(a)}),o.on(\"trackuserlocationend\",a=>{r.current.props.onTrackUserLocationEnd?.(a)}),o},{position:e.position});return r.current.props=e,(0,pm.useImperativeHandle)(t,()=>i,[]),(0,pm.useEffect)(()=>{hl(i._container,e.style)},[e.style]),null}var xye=(0,pm.memo)((0,pm.forwardRef)(bye));var TV=xe(ze(),1);function wye(e){let t=za(({mapLib:r})=>new r.NavigationControl(e),{position:e.position});return(0,TV.useEffect)(()=>{hl(t._container,e.style)},[e.style]),null}var cnt=(0,TV.memo)(wye);var hM=xe(ze(),1);function Tye(e){let t=za(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),r=(0,hM.useRef)(e),i=r.current;r.current=e;let{style:n}=e;return e.maxWidth!==void 0&&e.maxWidth!==i.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==i.unit&&t.setUnit(e.unit),(0,hM.useEffect)(()=>{hl(t._container,n)},[n]),null}var unt=(0,hM.memo)(Tye);var SV=xe(ze(),1);function Sye(e){let t=za(({mapLib:r})=>new r.TerrainControl(e),{position:e.position});return(0,SV.useEffect)(()=>{hl(t._container,e.style)},[e.style]),null}var Mye=(0,SV.memo)(Sye);var MV=xe(ze(),1);function Eye(e){let t=za(({mapLib:r})=>new r.LogoControl(e),{position:e.position});return(0,MV.useEffect)(()=>{hl(t._container,e.style)},[e.style]),null}var Pye=(0,MV.memo)(Eye);var Iye=xe(ze(),1),dM=xe(ze(),1);var rR=xe(ze(),1);var Gu=xe(fo(),1),Jx=class extends Bh{static controlType;position;constructor(t,r){super(t,r),this.initRegularAttribute(\"position\",\"position\")}baseDeckProps(){return{...Ht(this.position)?{placement:this.position}:{}}}baseMaplibreProps(){return{...Ht(this.position)?{position:this.position}:{}}}},iR=class extends Jx{static controlType=\"fullscreen\";renderDeck(){let{placement:t,...r}=this.baseDeckProps(),i={placement:t||\"top-right\",...r};return console.log(t),(0,Gu.jsx)(\"div\",{children:(0,Gu.jsx)($it,{...i})})}renderMaplibre(){return(0,Gu.jsx)(\"div\",{children:(0,Gu.jsx)(lnt,{...this.baseMaplibreProps()})})}},kye=\"geocoder-query\";function Rye({api:e,props:t={},opts:r={}}){return za(()=>new gV(e,t),r),null}var EV=class extends Jx{static controlType=\"geocoder\";async invokePythonGeocode(t){let[r]=await tV(this.model,{query:t},kye,{timeout:1e4});return r?\"features\"in r?r:{type:\"FeatureCollection\",features:[r]}:null}emptyFeature(){return{id:\"\",text:\"\",place_name:\"\",place_type:[],type:\"Feature\",geometry:{type:\"Point\",coordinates:[0,0]},properties:{}}}emptyFeatureCollection(){return{type:\"FeatureCollection\",features:[this.emptyFeature()]}}deckGeocoder(){return{name:\"python-geocoder\",requiresApiKey:!1,geocode:async t=>{let r=await this.invokePythonGeocode(t);if(!r)return null;let i=r.features[0];if(!i)return null;let{center:n}=i;return!n||n.length<2?null:{longitude:n[0],latitude:n[1]}}}}maplibreApi(){return{forwardGeocode:async t=>{let r=t.query?.toString();return r?await this.invokePythonGeocode(r)??this.emptyFeatureCollection():this.emptyFeatureCollection()}}}renderDeck(){return null}renderMaplibre(){let t=this.maplibreApi();return t?(0,Gu.jsx)(Rye,{api:t,opts:this.baseMaplibreProps()}):null}},nR=class extends Jx{static controlType=\"navigation\";showCompass;showZoom;visualizePitch;visualizeRoll;constructor(t,r){super(t,r),this.initRegularAttribute(\"show_compass\",\"showCompass\"),this.initRegularAttribute(\"show_zoom\",\"showZoom\"),this.initRegularAttribute(\"visualize_pitch\",\"visualizePitch\"),this.initRegularAttribute(\"visualize_roll\",\"visualizeRoll\")}renderDeck(){return(0,Gu.jsxs)(\"div\",{children:[this.showZoom&&(0,Gu.jsx)(Git,{...this.baseDeckProps()}),this.showCompass&&(0,Gu.jsx)(jit,{...this.baseDeckProps()})]})}renderMaplibre(){let t={...this.baseMaplibreProps(),...Ht(this.showCompass)&&{showCompass:this.showCompass},...Ht(this.showZoom)&&{showZoom:this.showZoom},...Ht(this.visualizePitch)&&{visualizePitch:this.visualizePitch},...Ht(this.visualizeRoll)&&{visualizeRoll:this.visualizeRoll}};return(0,Gu.jsx)(cnt,{...t})}},oR=class extends Jx{static controlType=\"scale\";maxWidth;unit;constructor(t,r){super(t,r),this.initRegularAttribute(\"max_width\",\"maxWidth\"),this.initRegularAttribute(\"unit\",\"unit\")}renderDeck(){return(0,Gu.jsx)(Wit,{...this.baseDeckProps()})}renderMaplibre(){let t={...this.baseMaplibreProps(),...Ht(this.maxWidth)&&{maxWidth:this.maxWidth},...Ht(this.unit)&&{unit:this.unit}};return(0,Gu.jsx)(\"div\",{children:(0,Gu.jsx)(unt,{...t})})}};async function f8t(e,t){let r=e.get(\"_control_type\"),i;switch(r){case iR.controlType:i=new iR(e,t);break;case EV.controlType:i=new EV(e,t);break;case nR.controlType:i=new nR(e,t);break;case oR.controlType:i=new oR(e,t);break;default:throw new Error(`no control supported for ${r}`)}return i}function hnt(e,t,r){let[i,n]=(0,fM.useState)({}),o=(0,fM.useRef)(i);return o.current=i,(0,fM.useEffect)(()=>{(async()=>{try{let a=await wA(t,e,o.current,async h=>f8t(h,r));n(a)}catch(a){console.error(\"Error loading controls:\",a)}})()},[e,r,t]),Object.values(i)}var pM=xe(ze(),1);function dnt(e,t,r,i,n,o){let[s,a]=(0,pM.useState)({}),h=(0,pM.useRef)(s);return h.current=s,(0,pM.useEffect)(()=>{(async()=>{try{let g=await wA(t,e,h.current,async w=>Mit(w,r));a(g),n||o(i)}catch(g){console.error(\"Error loading child models or setting bounds:\",g)}})()},[e,i,n,o,r,t]),Object.values(s).flatMap(p=>p.render())}var mM=xe(ze(),1);var t2=class extends Bh{x;y;width;height;padding;constructor(t,r){super(t,r),this.initRegularAttribute(\"x\",\"x\"),this.initRegularAttribute(\"y\",\"y\"),this.initRegularAttribute(\"width\",\"width\"),this.initRegularAttribute(\"height\",\"height\"),this.initRegularAttribute(\"padding\",\"padding\")}baseViewProps(){return{id:this.model.model_id,...Ht(this.x)&&{x:this.x},...Ht(this.y)&&{y:this.y},...Ht(this.width)&&{width:this.width},...Ht(this.height)&&{height:this.height},...Ht(this.padding)&&{padding:this.padding}}}},PV=class extends t2{static viewType=\"first-person-view\";projectionMatrix;fovy;near;far;focalDistance;constructor(t,r){super(t,r),this.initRegularAttribute(\"projection_matrix\",\"projectionMatrix\"),this.initRegularAttribute(\"fovy\",\"fovy\"),this.initRegularAttribute(\"near\",\"near\"),this.initRegularAttribute(\"far\",\"far\"),this.initRegularAttribute(\"focal_distance\",\"focalDistance\")}viewProps(){return{...Ht(this.projectionMatrix)&&{projectionMatrix:this.projectionMatrix},...Ht(this.fovy)&&{fovy:this.fovy},...Ht(this.near)&&{near:this.near},...Ht(this.far)&&{far:this.far},...Ht(this.focalDistance)&&{focalDistance:this.focalDistance}}}build(){return new kX({...this.baseViewProps(),...this.viewProps()})}},CV=class extends t2{static viewType=\"globe-view\";resolution;nearZMultiplier;farZMultiplier;constructor(t,r){super(t,r),this.initRegularAttribute(\"resolution\",\"resolution\"),this.initRegularAttribute(\"near_z_multiplier\",\"nearZMultiplier\"),this.initRegularAttribute(\"far_z_multiplier\",\"farZMultiplier\")}viewProps(){return{...Ht(this.resolution)&&{resolution:this.resolution},...Ht(this.nearZMultiplier)&&{nearZMultiplier:this.nearZMultiplier},...Ht(this.farZMultiplier)&&{farZMultiplier:this.farZMultiplier}}}build(){return new Tb({...this.baseViewProps(),...this.viewProps()})}},IV=class extends t2{static viewType=\"map-view\";repeat;nearZMultiplier;farZMultiplier;projectionMatrix;fovy;altitude;orthographic;constructor(t,r){super(t,r),this.initRegularAttribute(\"repeat\",\"repeat\"),this.initRegularAttribute(\"near_z_multiplier\",\"nearZMultiplier\"),this.initRegularAttribute(\"far_z_multiplier\",\"farZMultiplier\"),this.initRegularAttribute(\"projection_matrix\",\"projectionMatrix\"),this.initRegularAttribute(\"fovy\",\"fovy\"),this.initRegularAttribute(\"altitude\",\"altitude\"),this.initRegularAttribute(\"orthographic\",\"orthographic\")}viewProps(){return{...Ht(this.repeat)&&{repeat:this.repeat},...Ht(this.nearZMultiplier)&&{nearZMultiplier:this.nearZMultiplier},...Ht(this.farZMultiplier)&&{farZMultiplier:this.farZMultiplier},...Ht(this.projectionMatrix)&&{projectionMatrix:this.projectionMatrix},...Ht(this.fovy)&&{fovy:this.fovy},...Ht(this.altitude)&&{altitude:this.altitude},...Ht(this.orthographic)&&{orthographic:this.orthographic}}}build(){return new g1({...this.baseViewProps(),...this.viewProps()})}},kV=class extends t2{static viewType=\"orbit-view\";orbitAxis;projectionMatrix;fovy;near;far;orthographic;constructor(t,r){super(t,r),this.initRegularAttribute(\"orbit_axis\",\"orbitAxis\"),this.initRegularAttribute(\"projection_matrix\",\"projectionMatrix\"),this.initRegularAttribute(\"fovy\",\"fovy\"),this.initRegularAttribute(\"near\",\"near\"),this.initRegularAttribute(\"far\",\"far\"),this.initRegularAttribute(\"orthographic\",\"orthographic\")}viewProps(){return{...Ht(this.orbitAxis)&&{orbitAxis:this.orbitAxis},...Ht(this.projectionMatrix)&&{projectionMatrix:this.projectionMatrix},...Ht(this.fovy)&&{fovy:this.fovy},...Ht(this.near)&&{near:this.near},...Ht(this.far)&&{far:this.far},...Ht(this.orthographic)&&{orthographic:this.orthographic}}}build(){return new RX({...this.baseViewProps(),...this.viewProps()})}},RV=class extends t2{static viewType=\"orthographic-view\";flipY;near;far;constructor(t,r){super(t,r),this.initRegularAttribute(\"flip_y\",\"flipY\"),this.initRegularAttribute(\"near\",\"near\"),this.initRegularAttribute(\"far\",\"far\")}viewProps(){return{...Ht(this.flipY)&&{flipY:this.flipY},...Ht(this.near)&&{near:this.near},...Ht(this.far)&&{far:this.far}}}build(){return new OX({...this.baseViewProps(),...this.viewProps()})}};async function p8t(e,t){let r=e.get(\"_view_type\");switch(r){case PV.viewType:return new PV(e,t);case CV.viewType:return new CV(e,t);case IV.viewType:return new IV(e,t);case kV.viewType:return new kV(e,t);case RV.viewType:return new RV(e,t);default:throw new Error(`no view supported for ${r}`)}}function fnt(e,t,r){let[i,n]=(0,mM.useState)({}),o=(0,mM.useRef)(i);o.current=i,(0,mM.useEffect)(()=>{(async()=>{try{if(!e){n({});return}let h=await wA(t,typeof e==\"string\"?[e]:e,o.current,async p=>p8t(p,r));n(h)}catch(h){console.error(\"Error loading child views:\",h)}})()},[e,t,r]);let s=Object.values(i).map(a=>a.build());return s.length>0?s:void 0}var pnt=xe(ze(),1);function m8t(e,t){let{longitude:r,latitude:i,zoom:n,pitch:o,bearing:s,transitionDuration:a,curve:h,speed:p,screenSpeed:g}=e,w=new C0({...Ht(h)&&{curve:h},...Ht(p)&&{speed:p},...Ht(g)&&{screenSpeed:g}});t({longitude:r,latitude:i,zoom:n,pitch:o,bearing:s,transitionDuration:a,transitionInterpolator:w})}var DV=xe(fo(),1),Dye=pnt.default.forwardRef((e,t)=>{let{controls:r,mapStyle:i,customAttribution:n,deckRef:o,renderBasemap:s,setViewState:a,...h}=e;return pnt.default.useImperativeHandle(t,()=>({flyTo(p){m8t(p,a)}})),(0,DV.jsxs)(Dit,{ref:o,style:{width:\"100%\",height:\"100%\"},controller:!0,...h,children:[r.map(p=>p.renderDeck()),s&&(0,DV.jsx)(cM,{mapStyle:i,attributionControl:{customAttribution:n}})]})}),g8t=Dye;var sR=\"mapbox\",mnt=512,Oye=Math.PI/180;function y8t({map:e,deck:t}){if(e.__deck)return e.__deck;let r=t.props._customRender,i=t.props.onLoad,n={...t.props,_customRender:()=>{e.triggerRepaint(),r?.(\"\")}};return n.views||(n.views=gM(e)),Object.assign(n,{width:null,height:null,touchAction:\"unset\",viewState:AM(e)}),t.isInitialized?A8t(t,e):n.onLoad=()=>{i?.(),A8t(t,e)},t.setProps(n),e.__deck=t,e.on(\"render\",()=>{t.isInitialized&&Bye(t,e)}),t}function A8t(e,t){let r=()=>{e.isInitialized?Fye(e,t):t.off(\"move\",r)};t.on(\"move\",r)}function _8t(e){e.__deck?.finalize(),e.__deck=null}function OV(e,t){let r=t?{depthWriteEnabled:!0,depthCompare:\"less-equal\",depthBias:0,blend:!0,blendColorSrcFactor:\"src-alpha\",blendColorDstFactor:\"one-minus-src-alpha\",blendAlphaSrcFactor:\"one\",blendAlphaDstFactor:\"one-minus-src-alpha\",blendColorOperation:\"add\",blendAlphaOperation:\"add\"}:{};return LV(e)===\"globe\"&&(r.cullMode=\"back\"),r}function v8t(e,t,r,i){if(!e.isInitialized)return;let{currentViewport:n}=e.userData,o=!1;n||(n=gnt(e,t,i),e.userData.currentViewport=n,o=!0),e._drawLayers(\"mapbox-repaint\",{viewports:[n],layerFilter:s=>(!e.props.layerFilter||e.props.layerFilter(s))&&(r.id===s.layer.id||s.layer.props.operation.includes(\"terrain\")),clearStack:o,clearCanvas:!1})}function b8t(e,t,r,i){if(!e.isInitialized)return;let{currentViewport:n}=e.userData,o=!1;n||(n=gnt(e,t,i),e.userData.currentViewport=n,o=!0),e._drawLayers(\"mapbox-repaint\",{viewports:[n],layerFilter:s=>{if(e.props.layerFilter&&!e.props.layerFilter(s))return!1;let a=s.layer;return a.props.beforeId===r.beforeId&&a.props.slot===r.slot},clearStack:o,clearCanvas:!1})}function LV(e){let t=e.getProjection?.(),r=t?.type||t?.name;if(r===\"globe\")return\"globe\";if(r&&r!==\"mercator\")throw new Error(\"Unsupported projection\");return\"mercator\"}function gM(e){return LV(e)===\"globe\"?new Tb({id:sR}):new g1({id:sR})}function AM(e){let{lng:t,lat:r}=e.getCenter(),i={longitude:(t+540)%360-180,latitude:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),padding:e.getPadding(),repeat:e.getRenderWorldCopies()};return e.getTerrain?.()&&Lye(e,i),i}function Lye(e,t){if(e.getFreeCameraOptions){let{position:r}=e.getFreeCameraOptions();if(!r||r.z===void 0)return;let i=e.transform.height,{longitude:n,latitude:o,pitch:s}=t,a=r.x*mnt,h=(1-r.y)*mnt,p=r.z*mnt,g=vs([n,o]),w=a-g[0],C=h-g[1],R=Math.sqrt(w*w+C*C),z=s*Oye,W=1.5*i,Y=z<.001?W*Math.cos(z)/p:W*Math.sin(z)/R;t.zoom=Math.log2(Y);let H=W*Math.cos(z)/Y,Q=p-H;t.position=[0,0,Q/hb(o)]}else typeof e.transform.elevation==\"number\"&&(t.position=[0,0,e.transform.elevation])}function gnt(e,t,r){let i=AM(t),n=e.getView(sR)||gM(t);r&&(n.props.nearZMultiplier=.2);let o=r?.nearZ??t.transform._nearZ,s=r?.farZ??t.transform._farZ;return Number.isFinite(o)&&(i.nearZ=o/t.transform.height,i.farZ=s/t.transform.height),n.makeViewport({width:e.width,height:e.height,viewState:i})}function Bye(e,t){let i=Il(e.props.layers,Boolean).some(a=>a&&!t.getLayer(a.id)),n=e.getViewports(),o=n.findIndex(a=>a.id===sR),s=n.length>1||o<0;(i||s)&&(o>=0&&(n=n.slice(),n[o]=gnt(e,t)),e._drawLayers(\"mapbox-repaint\",{viewports:n,layerFilter:a=>(!e.props.layerFilter||e.props.layerFilter(a))&&(a.viewport.id!==sR||!t.getLayer(a.layer.id)),clearCanvas:!1})),e.userData.currentViewport=null}function Fye(e,t){e.setProps({viewState:AM(t)}),e.needsRedraw({clearRedrawFlags:!0})}var aR=class{constructor(t){if(!t.id)throw new Error(\"Layer must have an unique id\");this.id=t.id,this.type=\"custom\",this.renderingMode=t.renderingMode||\"3d\",this.slot=t.slot,this.map=null,this.props=t}onAdd(t,r){this.map=t}onRemove(){this.map=null}setProps(t){Object.assign(this.props,t,{id:this.id})}render(t,r){this.map&&v8t(this.map.__deck,this.map,this,r)}};var Ant=\"__UNDEFINED__\";function x8t(e,t,r,i){if(!e||!t||!e.style||!e.style._loaded)return;let n=Il(i,Boolean);if(r!==i){let a=Il(r,Boolean),h=new Set(a.map(p=>p.id));for(let p of n)h.delete(p.id);for(let p of h)e.getLayer(p)&&e.removeLayer(p)}for(let a of n){let h=e.getLayer(a.id);h?(h.implementation||h).setProps(a.props):e.addLayer(new aR({id:a.id,slot:a.props.slot}),a.props.beforeId)}let o=e.style._order,s={};for(let a of n){let{beforeId:h}=a.props;(!h||!o.includes(h))&&(h=Ant),s[h]=s[h]||[],s[h].push(a.id)}for(let a in s){let h=s[a],p=a===Ant?o.length:o.indexOf(a),g=a===Ant?void 0:a;for(let w=h.length-1;w>=0;w--){let C=h[w],R=o.indexOf(C);R!==p-1&&(e.moveLayer(C,g),R>p&&p++),p--,g=C}}}var lR=class{constructor(t){_r(t.id,\"id is required\"),this.id=t.id,this.type=\"custom\",this.renderingMode=t.renderingMode||\"3d\",this.slot=t.slot,this.beforeId=t.beforeId,this.map=null}onAdd(t,r){this.map=t}render(t,r){this.map&&b8t(this.map.__deck,this.map,this,r)}};var ynt=\"__UNDEFINED__\";function _nt(e){return e.props.beforeId?`deck-layer-group-before:${e.props.beforeId}`:e.props.slot?`deck-layer-group-slot:${e.props.slot}`:\"deck-layer-group-last\"}function w8t(e,t,r){if(!e||!e.style||!e.style._loaded)return;let i=Il(r,Boolean);if(t!==r){let s=Il(t,Boolean),a=new Set(s.map(p=>_nt(p))),h=new Set(i.map(p=>_nt(p)));for(let p of a)h.has(p)||e.getLayer(p)&&e.removeLayer(p)}let n={};for(let s of i){let a=_nt(s),h=e.getLayer(a);if(h){let p=h.implementation||h;n[a]=p}else{let p=new lR({id:a,slot:s.props.slot,beforeId:s.props.beforeId});n[a]=p,e.addLayer(p,s.props.beforeId)}}let o=e.style._order;for(let[s,a]of Object.entries(n)){let h=a.beforeId||ynt,p=h===ynt?o.length:o.indexOf(h);if(o.indexOf(s)!==p-1){let w=h===ynt?void 0:h;e.moveLayer(s,w)}}}var yM=class{constructor(t){this._handleStyleChange=()=>{if(this._resolveLayers(this._map,this._deck,this._props.layers,this._props.layers),!this._map)return;LV(this._map)&&!this._props.views&&this._deck?.setProps({views:gM(this._map)})},this._updateContainerSize=()=>{if(this._map&&this._container){let{clientWidth:i,clientHeight:n}=this._map.getContainer();Object.assign(this._container.style,{width:`${i}px`,height:`${n}px`})}},this._updateViewState=()=>{let i=this._deck,n=this._map;i&&n&&(i.setProps({views:this._props.views||gM(n),viewState:AM(n)}),i.isInitialized&&i.redraw())},this._handleMouseEvent=i=>{let n=this._deck;if(!n||!n.isInitialized)return;let o={type:i.type,offsetCenter:i.point,srcEvent:i},s=this._lastMouseDownPoint;switch(!i.point&&s&&(o.deltaX=i.originalEvent.clientX-s.clientX,o.deltaY=i.originalEvent.clientY-s.clientY,o.offsetCenter={x:s.x+o.deltaX,y:s.y+o.deltaY}),o.type){case\"mousedown\":n._onPointerDown(o),this._lastMouseDownPoint={...i.point,clientX:i.originalEvent.clientX,clientY:i.originalEvent.clientY};break;case\"dragstart\":o.type=\"panstart\",n._onEvent(o);break;case\"drag\":o.type=\"panmove\",n._onEvent(o);break;case\"dragend\":o.type=\"panend\",n._onEvent(o);break;case\"click\":o.tapCount=1,n._onEvent(o);break;case\"dblclick\":o.type=\"click\",o.tapCount=2,n._onEvent(o);break;case\"mousemove\":o.type=\"pointermove\",n._onPointerMove(o);break;case\"mouseout\":o.type=\"pointerleave\",n._onPointerMove(o);break;default:return}};let{interleaved:r=!1}=t;this._interleaved=r,this._renderLayersInGroups=t._renderLayersInGroups||!1,this._props=this.filterProps(t)}filterProps(t){let{interleaved:r=!1,useDevicePixels:i,...n}=t;return!r&&i!==void 0&&(n.useDevicePixels=i),n}setProps(t){this._interleaved&&t.layers&&this._resolveLayers(this._map,this._deck,this._props.layers,t.layers),Object.assign(this._props,this.filterProps(t)),this._deck&&this._map&&this._deck.setProps({...this._props,parameters:{...OV(this._map,this._interleaved),...this._props.parameters}})}onAdd(t){return this._map=t,this._interleaved?this._onAddInterleaved(t):this._onAddOverlaid(t)}_onAddOverlaid(t){let r=document.createElement(\"div\");return Object.assign(r.style,{position:\"absolute\",left:0,top:0,textAlign:\"initial\",pointerEvents:\"none\"}),this._container=r,this._deck=new j3({...this._props,parent:r,parameters:{...OV(t,!1),...this._props.parameters},views:this._props.views||gM(t),viewState:AM(t)}),t.on(\"resize\",this._updateContainerSize),t.on(\"render\",this._updateViewState),t.on(\"mousedown\",this._handleMouseEvent),t.on(\"dragstart\",this._handleMouseEvent),t.on(\"drag\",this._handleMouseEvent),t.on(\"dragend\",this._handleMouseEvent),t.on(\"mousemove\",this._handleMouseEvent),t.on(\"mouseout\",this._handleMouseEvent),t.on(\"click\",this._handleMouseEvent),t.on(\"dblclick\",this._handleMouseEvent),this._updateContainerSize(),r}_onAddInterleaved(t){let r=t.painter.context.gl;return r instanceof WebGLRenderingContext&&hr.warn(\"Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility\")(),this._deck=y8t({map:t,deck:new j3({...this._props,gl:r,parameters:{...OV(t,!0),...this._props.parameters}})}),t.on(\"styledata\",this._handleStyleChange),this._resolveLayers(t,this._deck,[],this._props.layers),document.createElement(\"div\")}_resolveLayers(t,r,i,n){this._renderLayersInGroups?w8t(t,i,n):x8t(t,r,i,n)}onRemove(){let t=this._map;t&&(this._interleaved?this._onRemoveInterleaved(t):this._onRemoveOverlaid(t)),this._deck=void 0,this._map=void 0,this._container=void 0}_onRemoveOverlaid(t){t.off(\"resize\",this._updateContainerSize),t.off(\"render\",this._updateViewState),t.off(\"mousedown\",this._handleMouseEvent),t.off(\"dragstart\",this._handleMouseEvent),t.off(\"drag\",this._handleMouseEvent),t.off(\"dragend\",this._handleMouseEvent),t.off(\"mousemove\",this._handleMouseEvent),t.off(\"mouseout\",this._handleMouseEvent),t.off(\"click\",this._handleMouseEvent),t.off(\"dblclick\",this._handleMouseEvent),this._deck?.finalize()}_onRemoveInterleaved(t){t.off(\"styledata\",this._handleStyleChange),this._resolveLayers(t,this._deck,this._props.layers,[]),_8t(t)}getDefaultPosition(){return\"top-left\"}pickObject(t){return _r(this._deck),this._deck.pickObject(t)}pickMultipleObjects(t){return _r(this._deck),this._deck.pickMultipleObjects(t)}pickObjects(t){return _r(this._deck),this._deck.pickObjects(t)}finalize(){this._map&&this._map.removeControl(this)}getCanvas(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}};var BV=xe(ze(),1);var FV=xe(fo(),1);function Nye(e){return za(()=>new yM(e)).setProps(e),null}var zye=BV.default.forwardRef((e,t)=>{let{controls:r,mapStyle:i,customAttribution:n,initialViewState:o,views:s,onViewStateChange:a,...h}=e,p=BV.default.useRef(null);return BV.default.useImperativeHandle(t,()=>({flyTo(w){let C=p.current?.getMap();C&&C.flyTo({center:[w.longitude,w.latitude],zoom:w.zoom,duration:w.transitionDuration===\"auto\"?void 0:w.transitionDuration,...w.pitch!=null&&{pitch:w.pitch},...w.bearing!=null&&{bearing:w.bearing},...w.curve!=null&&{curve:w.curve},...w.speed!=null&&{speed:w.speed},...w.screenSpeed!=null&&{screenSpeed:w.screenSpeed}})}})),(0,FV.jsxs)(cM,{ref:p,reuseMaps:!0,initialViewState:o,mapStyle:i,attributionControl:{customAttribution:n},style:{width:\"100%\",height:\"100%\"},onMoveEnd:a?w=>{let C={longitude:w.viewState.longitude,latitude:w.viewState.latitude,zoom:w.viewState.zoom,pitch:w.viewState.pitch,bearing:w.viewState.bearing};a({viewId:\"mapLibreId\",viewState:C})}:void 0,...ez(s)&&{projection:\"globe\"},children:[r.map(w=>w.renderMaplibre()),(0,FV.jsx)(Nye,{...h})]})}),T8t=zye;var M8t=xe(ze(),1);var cR=xe(fo(),1),NV=({fill:e=\"currentColor\",filled:t=!1,size:r,height:i,width:n,label:o,...s})=>{let a=r||n||i||16;return(0,cR.jsx)(\"svg\",{width:a,height:a,viewBox:\"0 0 16 16\",fill:t?e:\"none\",xmlns:\"http://www.w3.org/2000/svg\",role:\"img\",\"aria-label\":o,...s,children:(0,cR.jsx)(\"polygon\",{points:\"14.707,2.707 13.293,1.293 8,6.586 2.707,1.293 1.293,2.707 6.586,8 1.293,13.293 2.707,14.707 8,9.414 13.293,14.707 14.707,13.293 9.414,8 \",fill:e})})},S8t=({fill:e=\"currentColor\",filled:t=!1,size:r,height:i,width:n,label:o,...s})=>{let a=r||n||i||24;return(0,cR.jsx)(\"svg\",{width:a,height:a,viewBox:\"0 0 24 24\",fill:t?e:\"none\",xmlns:\"http://www.w3.org/2000/svg\",role:\"img\",\"aria-label\":o,...s,children:(0,cR.jsx)(\"rect\",{x:\"6\",y:\"6\",width:\"12\",height:\"12\",fill:e})})};var Jc=xe(fo(),1),zV=Symbol.for(\"rowIndex\"),Uye=({onClose:e})=>(0,Jc.jsxs)(\"div\",{className:\"pl-4 py-3 flex justify-between items-center border-b border-default-300 bg-default-100\",children:[(0,Jc.jsx)(\"div\",{className:\"font-bold text-lg\",children:\"Feature properties\"}),(0,Jc.jsx)(Y6,{onClick:e,variant:\"flat\",isIconOnly:!0,className:\"bg-default-100\",children:(0,Jc.jsx)(NV,{})})]}),Vye=({info:e,onClose:t})=>{let{object:r}=e;if(!r||r[zV]===null||r[zV]===void 0||r[zV]&&r[zV]<0)return null;let i=r.toJSON?.()||r;if(!i||typeof i!=\"object\")return null;let{...n}=i;return Object.keys(n).length===0?null:(0,Jc.jsxs)(\"div\",{className:\"bg-white shadow-md text-black h-full w-96 overflow-y-auto overflow-x-hidden box-border mr-1\",children:[(0,Jc.jsx)(Uye,{onClose:t}),(0,Jc.jsx)(\"table\",{className:\"w-full border-collapse [&_td]:block\",children:(0,Jc.jsx)(\"tbody\",{className:\"grid grid-cols-[minmax(0,_2fr)_minmax(0,_3fr)]\",children:Object.entries(n).filter(([o])=>o!==\"geometry\").map(([o,s],a)=>(0,Jc.jsxs)(M8t.default.Fragment,{children:[(0,Jc.jsx)(\"td\",{className:`border border-gray-300 px-4 py-2 font-medium ${a%2===0?\"bg-white\":\"bg-gray-100\"}`,children:(0,Jc.jsx)(\"div\",{className:\"truncate\",title:o,children:o})}),(0,Jc.jsx)(\"td\",{className:`border border-gray-300 px-4 py-2 ${a%2===0?\"bg-white\":\"bg-gray-100\"}`,children:(0,Jc.jsx)(\"div\",{className:\"break-words\",title:String(s),children:String(s)})})]},o))})})]})},E8t=Vye;var P8t=xe(FJ(),1),UV=xe(ze(),1),jye=(0,P8t.default)(e=>{e.save_changes()},300);function vnt(e){let t=Q5(),[r,i]=UV.useState(t.get(e));return UV.useEffect(()=>{let n=()=>i(t.get(e));return t.on(`change:${e}`,n),()=>t.off(`change:${e}`,n)},[t,e]),[r,n=>{t.set(e,n),jye(t)}]}var C8t=e=>{let t,r=new Set,i=(p,g)=>{let w=typeof p==\"function\"?p(t):p;if(!Object.is(w,t)){let C=t;t=g??(typeof w!=\"object\"||w===null)?w:Object.assign({},t,w),r.forEach(R=>R(t,C))}},n=()=>t,a={setState:i,getState:n,getInitialState:()=>h,subscribe:p=>(r.add(p),()=>r.delete(p))},h=t=e(i,n,a);return a},I8t=(e=>e?C8t(e):C8t);var uR=xe(ze(),1);var $ye=e=>e;function Gye(e,t=$ye){let r=uR.default.useSyncExternalStore(e.subscribe,uR.default.useCallback(()=>t(e.getState()),[e,t]),uR.default.useCallback(()=>t(e.getInitialState()),[e,t]));return uR.default.useDebugValue(r),r}var k8t=e=>{let t=I8t(e),r=i=>Gye(t,i);return Object.assign(r,t),r},R8t=(e=>e?k8t(e):k8t);var zl=R8t(e=>({highlightedFeature:void 0,setHighlightedFeature:t=>e({highlightedFeature:t}),bboxSelectStart:void 0,bboxSelectEnd:void 0,isDrawingBbox:!1,startBboxSelection:()=>e({isDrawingBbox:!0,bboxSelectStart:void 0,bboxSelectEnd:void 0}),cancelBboxSelection:()=>e({isDrawingBbox:!1,bboxSelectStart:void 0,bboxSelectEnd:void 0}),clearBboxSelection:()=>e({bboxSelectStart:void 0,bboxSelectEnd:void 0}),setBboxStart:t=>e({bboxSelectStart:t}),setBboxEnd:t=>e(r=>r.bboxSelectStart?{bboxSelectEnd:t,isDrawingBbox:!1}:{}),setBboxHover:t=>e(r=>r.isDrawingBbox&&r.bboxSelectStart?{bboxSelectEnd:t}:{})}));var e2=xe(fo(),1),Wye=()=>{let e=zl(h=>h.isDrawingBbox),t=zl(h=>h.bboxSelectStart),r=zl(h=>h.bboxSelectEnd),i=zl(h=>h.startBboxSelection),n=zl(h=>h.cancelBboxSelection),o=zl(h=>h.clearBboxSelection),s=t&&r;return(0,e2.jsx)(\"div\",{style:{position:\"absolute\",bottom:\"20px\",right:\"20px\",zIndex:1e3,backgroundColor:\"white\",borderRadius:\"8px\",boxShadow:\"0 4px 6px rgba(0, 0, 0, 0.1)\",padding:\"4px\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-end\",gap:\"4px\"},children:(0,e2.jsx)(TJ,{variant:\"flat\",children:(0,e2.jsx)(OJ,{content:e?\"Cancel drawing\":s?\"Clear bounding box\":\"Start bounding box selection\",placement:\"bottom\",children:(0,e2.jsx)(Y6,{isIconOnly:!0,\"aria-label\":e?\"Cancel drawing\":s?\"Clear bounding box\":\"Select BBox\",color:e?\"warning\":s?\"danger\":\"default\",onClick:()=>{e?n():s?o():i()},children:e||s?(0,e2.jsx)(NV,{}):(0,e2.jsx)(S8t,{})})})})})},D8t=Wye;var VV=Symbol.for(\"rowIndex\");function qye(e){return`<table>\n      <tbody>\n        ${Object.keys(e).map(t=>{let r=e[t];return`<tr>\n              <td>${t}</td>\n              <td>${r}</td>\n            </tr>`}).join(\"\")}\n      </tbody>\n    </table>`}function O8t({object:e}){if(e){if(e[VV]===null||e[VV]===void 0||e[VV]&&e[VV]<0)return null;let t=e.toJSON();return!t||(delete t.geometry,Object.keys(t).length===0)?null:{className:\"lonboard-tooltip\",html:qye(t),style:{backgroundColor:\"#fff\",boxShadow:\"0 0 15px rgba(0, 0, 0, 0.1)\",color:\"#000\",padding:\"6px\"}}}return null}var Pp=xe(fo(),1);await ETt();function Hye(){let e=zl(He=>He.highlightedFeature),t=zl(He=>He.setHighlightedFeature),r=zl(He=>He.isDrawingBbox),i=zl(He=>He.bboxSelectStart),n=zl(He=>He.bboxSelectEnd),o=zl(He=>He.setBboxStart),s=zl(He=>He.setBboxEnd),a=zl(He=>He.setBboxHover),h=r&&i!==void 0,p=(0,Ua.useMemo)(()=>{if(i&&n){let[He,Ui]=i,[ln,Io]=n;return[Math.min(He,ln),Math.min(Ui,Io),Math.max(He,ln),Math.max(Ui,Io)]}return null},[i,n]),g=(0,Ua.useMemo)(()=>{if(i&&n){let He={id:\"bbox-select-polygon\",data:[[[i[0],i[1]],[n[0],i[1]],[n[0],n[1]],[i[0],n[1]]]],getPolygon:Ui=>Ui,getFillColor:[0,0,0,50],getLineColor:[0,0,0,130],stroked:!0,getLineWidth:2,lineWidthUnits:\"pixels\"};return r&&(He.getFillColor=[255,255,0,120],He.getLineColor=[211,211,38,200],He.getLineWidth=2),new wh(He)}return null},[i,n,r]),[w,C]=(0,Ua.useState)(!1),R=(0,Ua.useRef)(null);(0,Ua.useEffect)(()=>{R.current&&typeof window<\"u\"&&(window.__deck=R.current.deck)},[]);let z=Q5(),[W]=gh(\"basemap\"),[Y]=gh(\"height\"),[H]=gh(\"use_device_pixels\"),[Q]=gh(\"parameters\"),[tt]=gh(\"show_tooltip\"),[rt]=gh(\"show_side_panel\"),[at]=gh(\"picking_radius\"),[et]=gh(\"custom_attribution\"),[lt]=(0,Ua.useState)(K6()),[J]=gh(\"layers\"),[ft]=gh(\"view\"),[dt]=gh(\"controls\"),[Mt,Ft]=gh(\"selected_bounds\"),[Nt,$t]=vnt(\"view_state\"),Yt=(0,Ua.useRef)(null);(0,Ua.useEffect)(()=>{let He=Ui=>{Ui.type===\"fly-to\"&&Yt.current?.flyTo(Ui)};return z.on(\"msg:custom\",He),()=>z.off(\"msg:custom\",He)},[z]);let[_e,Pe]=(0,Ua.useState)(new Date),we=(0,Ua.useCallback)(()=>Pe(new Date),[]),Ue=tet(W,z.widget_manager,we),lr=hnt(dt,z.widget_manager,we),ee=dnt(J,z.widget_manager,we,p,r,Ft),Ce=fnt(ft,z.widget_manager,we),mr=(0,Ua.useCallback)(He=>{typeof He.coordinate<\"u\"&&z.get(\"_has_click_handlers\")&&z.send({kind:\"on-click\",coordinate:He.coordinate}),C(!0);let Ui=He.object;t(typeof Ui<\"u\"?He:void 0),r&&He.coordinate&&(i===void 0?o(He.coordinate):s(He.coordinate)),setTimeout(()=>{C(!1)},100)},[t,r,i,o,s,z.get,z.send]),gr=(0,Ua.useRef)(h);gr.current=h;let Br=(0,Ua.useRef)(w);Br.current=w;let Cr=(0,Ua.useRef)((0,B8t.default)(He=>{gr.current&&!Br.current&&He.coordinate&&a(He.coordinate)},100)).current,Rr={mapStyle:Ue?.style||CTt,customAttribution:et,deckRef:R,initialViewState:Nt,layers:g?ee.concat(g):ee,getTooltip:tt&&O8t||void 0,getCursor:()=>r?\"crosshair\":\"grab\",pickingRadius:at,onClick:mr,onHover:Cr,...Ht(H)&&{useDevicePixels:H},onResize:(0,L8t.default)(we,100),onViewStateChange:He=>{$t(HTt(Ce,He.viewState))},parameters:Q||{},views:Ce,controls:lr},ti={interleaved:Ue?.mode===\"interleaved\"},wr={renderBasemap:!!Ue,setViewState:$t};return(0,Pp.jsx)(\"div\",{className:\"lonboard\",style:{minHeight:\"100%\",height:Y},\"data-jp-suppress-context-menu\":!0,children:(0,Pp.jsxs)(\"div\",{id:`map-${lt}`,className:\"flex\",style:{width:\"100%\",height:\"100%\",...ez(Ce)&&{background:\"linear-gradient(0, #000, #223)\"}},children:[(0,Pp.jsx)(D8t,{}),rt&&e&&(0,Pp.jsx)(E8t,{info:e,onClose:()=>t(void 0)}),(0,Pp.jsx)(\"div\",{className:\"bg-transparent h-full w-full relative\",children:Ue?.mode===\"overlaid\"||Ue?.mode===\"interleaved\"?(0,Pp.jsx)(T8t,{ref:Yt,...Rr,...ti}):(0,Pp.jsx)(g8t,{ref:Yt,...Rr,...wr})})]})})}var Yye=()=>(0,Pp.jsx)(oJ,{children:(0,Pp.jsx)(Hye,{})}),Xye={render:Rht(Yye)},eIr=Xye;export{eIr as default};\n/*! Bundled license information:\n\nreact/cjs/react.production.js:\n  (**\n   * @license React\n   * react.production.js\n   *\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nscheduler/cjs/scheduler.production.js:\n  (**\n   * @license React\n   * scheduler.production.js\n   *\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nreact-dom/cjs/react-dom.production.js:\n  (**\n   * @license React\n   * react-dom.production.js\n   *\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nreact-dom/cjs/react-dom-client.production.js:\n  (**\n   * @license React\n   * react-dom-client.production.js\n   *\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nreact/cjs/react-jsx-runtime.production.js:\n  (**\n   * @license React\n   * react-jsx-runtime.production.js\n   *\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nlong/dist/long.js:\n  (**\n   * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>\n   * Released under the Apache License, Version 2.0\n   * see: https://github.com/dcodeIO/long.js for details\n   *)\n\nmaplibre-gl/dist/maplibre-gl.js:\n  (**\n   * MapLibre GL JS\n   * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.21.1/LICENSE.txt\n   *)\n\n@nextui-org/shared-utils/dist/chunk-RFEIBVIG.mjs:\n  (**\n   * @license React\n   * react.development.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n  (**\n   * @license React\n   * react.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n*/\n",
       "_has_click_handlers": false,
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "basemap": "IPY_MODEL_be2d7ebdafa144cdb0b1a323bacbfad9",
       "controls": [
        "IPY_MODEL_ec7e437229794497bb4fb01e692803c2",
        "IPY_MODEL_206ee61a9fdf48a39fe75026c1beacd8",
        "IPY_MODEL_a4413b96fda54f0280dd7cd68bf846bd"
       ],
       "custom_attribution": "",
       "height": "500px",
       "layers": [
        "IPY_MODEL_e73833c24286410eab47e92427225e44",
        "IPY_MODEL_9c41188f01e44e3496c2dc72f6720a81"
       ],
       "layout": "IPY_MODEL_0372e9c3b18a46f6b7a2fa6db4ee34e0",
       "parameters": null,
       "picking_radius": 5,
       "selected_bounds": null,
       "show_side_panel": true,
       "show_tooltip": false,
       "tabbable": null,
       "tooltip": null,
       "use_device_pixels": null,
       "view": null,
       "view_state": {
        "bearing": 0,
        "latitude": 28.225971347194026,
        "longitude": 84.29094224474478,
        "maxPitch": 60,
        "maxZoom": 20,
        "minPitch": 0,
        "minZoom": 0,
        "pitch": 0,
        "zoom": 7
       }
      }
     },
     "82b4da9cf1e449dc9cd0f1a1e71588f2": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.stat.widget.Stat",
       "_css": ".manywidgets-stat {\n  display: inline-block;\n  min-width: 140px;\n  padding: 14px 18px;\n  border: 1px solid #e1e4e8;\n  border-radius: 10px;\n  background: #ffffff;\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n}\n\n.manywidgets-stat__label {\n  color: #586069;\n  font-size: 12px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.manywidgets-stat__value-row {\n  display: flex;\n  align-items: baseline;\n  gap: 4px;\n  margin-top: 6px;\n}\n\n.manywidgets-stat__value {\n  font-size: 30px;\n  font-weight: 700;\n  color: #24292e;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__unit {\n  font-size: 14px;\n  color: #586069;\n}\n\n.manywidgets-stat__delta {\n  margin-top: 4px;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__delta--up {\n  color: #1a7f37;\n}\n.manywidgets-stat__delta--down {\n  color: #cf222e;\n}\n.manywidgets-stat__delta--flat {\n  color: #586069;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction onChanges(model, names, fn) {\n  for (const name of names) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// src/manywidgets/stat/src/index.ts\nfunction render({ model, el }) {\n  const card = document.createElement(\"div\");\n  card.className = \"manywidgets-stat\";\n  const labelEl = document.createElement(\"div\");\n  labelEl.className = \"manywidgets-stat__label\";\n  const valueRow = document.createElement(\"div\");\n  valueRow.className = \"manywidgets-stat__value-row\";\n  const valueEl = document.createElement(\"span\");\n  valueEl.className = \"manywidgets-stat__value\";\n  const unitEl = document.createElement(\"span\");\n  unitEl.className = \"manywidgets-stat__unit\";\n  valueRow.appendChild(valueEl);\n  valueRow.appendChild(unitEl);\n  const deltaEl = document.createElement(\"div\");\n  deltaEl.className = \"manywidgets-stat__delta\";\n  card.appendChild(labelEl);\n  card.appendChild(valueRow);\n  card.appendChild(deltaEl);\n  el.appendChild(card);\n  function update() {\n    labelEl.textContent = model.get(\"label\");\n    valueEl.textContent = String(model.get(\"value\"));\n    unitEl.textContent = model.get(\"unit\");\n    const delta = model.get(\"delta\");\n    if (delta == null || delta === \"\") {\n      deltaEl.textContent = \"\";\n      deltaEl.className = \"manywidgets-stat__delta\";\n      return;\n    }\n    const n = Number(delta);\n    const sign = n > 0 ? \"\\u25B2\" : n < 0 ? \"\\u25BC\" : \"\\u2022\";\n    const dir = n > 0 ? \"up\" : n < 0 ? \"down\" : \"flat\";\n    deltaEl.textContent = `${sign} ${Math.abs(n)}`;\n    deltaEl.className = `manywidgets-stat__delta manywidgets-stat__delta--${dir}`;\n  }\n  update();\n  onChanges(model, [\"label\", \"value\", \"unit\", \"delta\"], update);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "delta": null,
       "label": "Share exposed",
       "layout": "IPY_MODEL_688c600b02f84f8d9b01973072fa51ea",
       "tabbable": null,
       "tooltip": null,
       "unit": "",
       "value": "61.2%",
       "widget_id": "stat_3"
      }
     },
     "8c23f46fc5d24ebb9da7b17bb44e0edb": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_b05b15ede4774c5eae43eda614a3be7d",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "8eb8e931e4884fb4b0fd431ac6553c5a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "91875a6a76ac465aa1747d5d9272c619": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_655aaa71cec94eddbf2f6dd75abccd17",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "93bd8c63c2d1461b8ce78525386348f4": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.row.widget.Row",
       "_css": ".manywidgets-row {\n  margin: 10px 0;\n}\n\n.manywidgets-row__cell {\n  min-width: 0;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction stripIpy(id) {\n  return id ? String(id).replace(/^IPY_MODEL_/, \"\") : \"\";\n}\nvar noop = () => {\n};\nasync function renderChild(args, ref, el) {\n  if (args.host && typeof args.host.renderChild === \"function\") {\n    const dispose = await args.host.renderChild(ref, el);\n    return typeof dispose === \"function\" ? dispose : noop;\n  }\n  const wm = args.model.widget_manager;\n  if (!wm || typeof wm.create_view !== \"function\") {\n    throw new Error(\n      \"[manywidgets] renderChild needs a static host or a widget_manager with create_view\"\n    );\n  }\n  let child;\n  if (typeof ref === \"string\") {\n    if (!wm.get_model) throw new Error(\"[manywidgets] widget_manager has no get_model\");\n    child = await wm.get_model(stripIpy(ref));\n  } else {\n    child = ref;\n  }\n  const view = await wm.create_view(child);\n  el.appendChild(view.el);\n  return () => {\n    try {\n      view.remove?.();\n    } catch {\n    }\n  };\n}\n\n// src/manywidgets/row/src/index.ts\nasync function render(args) {\n  const { model, el } = args;\n  const container = document.createElement(\"div\");\n  container.className = \"manywidgets-row\";\n  el.appendChild(container);\n  let cleanups = [];\n  function applyStyle() {\n    container.style.display = \"flex\";\n    container.style.flexDirection = \"row\";\n    container.style.flexWrap = \"wrap\";\n    container.style.gap = model.get(\"gap\") || \"8px\";\n    container.style.alignItems = model.get(\"align\") || \"stretch\";\n  }\n  async function build() {\n    cleanups.forEach((d) => d());\n    cleanups = [];\n    container.replaceChildren();\n    const refs = model.get(\"children\") || [];\n    for (const ref of refs) {\n      const cell = document.createElement(\"div\");\n      cell.className = \"manywidgets-row__cell\";\n      container.appendChild(cell);\n      cleanups.push(await renderChild(args, ref, cell));\n    }\n  }\n  applyStyle();\n  await build();\n  model.on(\"change:gap\", applyStyle);\n  model.on(\"change:align\", applyStyle);\n  model.on(\"change:children\", () => {\n    void build();\n  });\n  return () => cleanups.forEach((d) => d());\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_myst_child_traits": [
        "children"
       ],
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "align": "stretch",
       "children": [
        "IPY_MODEL_10ae88b9cd2c4cd19ef92e80fccbb94c",
        "IPY_MODEL_fe6a66aac1754dd390c9d5f2ed22571b",
        "IPY_MODEL_82b4da9cf1e449dc9cd0f1a1e71588f2",
        "IPY_MODEL_a8ecfd5f968444cf97d44ef84896f10e"
       ],
       "gap": "16px",
       "layout": "IPY_MODEL_8eb8e931e4884fb4b0fd431ac6553c5a",
       "tabbable": null,
       "tooltip": null,
       "widget_id": "row_1"
      }
     },
     "9c41188f01e44e3496c2dc72f6720a81": {
      "buffers": [
       {
        "data": "UEFSMRUEFTAVQkwVBBUAEgAAKLUv/SAYwQAABwAAAHNjaG9vbHMJAAAAaG9zcGl0YWxzFQAVFhUoLBUcFRAVBhUGHDYAKAdzY2hvb2xzGAlob3NwaXRhbHMREQAAACi1L/0gC1kAAAIAAAAcAQEaAAIBFQQV4AEVUkwVHBUAEgAAKLUv/SBwBQEAqAACAwQGBwgNEBETFBgaAAAAAAAAAA1kAbADDwTCBBIVABUgFTIsFRwVEBUGFQYcGAgaAAAAAAAAABgIAAAAAAAAAAAWACgIGgAAAAAAAAAYCAAAAAAAAAAAEREAAAAotS/9IBCBAAACAAAAHAEEBRAyVHaYutwAFQQVwAMV0gNMFTgVABIAACi1L/0g4AEHAMTEnHZV/VRAMFZ6Sw6CPEBP4DWz8fpUQGZUxAbEfjxA6ITr3yL6VEDj196S14o8QGZJ9fiZ+VRAdlyysVo1PEBEhdhZgBJVQK7EEBTdeDxAJ5N5ng4VVUDji2L8Krg8QHOhENziEVVAwFlyv8mlPEBDQtOgWxhVQHh8pA/NGjxAEaKeShEOVUAZR3zLJXU8QGTvncNa/lRAgIarV9ugPEBgFTLZIPdUQNjFg4z3tzxAbufrF233VEC4cL+h5008QB+dAtjFD1VAUCFX1DNYPEDzCzD53wpVQFHOm0/CbzxAFQAVShVcLBU4FRAVBhUGHBgIQ0LToFsYVUAYCHh8pA/NGjxAFgAoCENC06BbGFVAGAh4fKQPzRo8QBERAAAAKLUv/SAlKQEABQAAAAmqqqoKAgAAADgDBQkgiEGKOSipxZp7MMpJq7046w0AABUEGWw1ABgGc2NoZW1hFQYAFQwlAhgFbGF5ZXIlAEwcAAAAFQQlAhgRX19pbmRleF9sZXZlbF8wX18ANQIYCGdlb21ldHJ5FQIVBkw8AAAANQQYBGxpc3QVAgAVCiUCGAdlbGVtZW50ABYcGRwZPCYAHBUMGTUABhAZGAVsYXllchUMFhwWuAEW3AEmZiYIHDYAKAdzY2hvb2xzGAlob3NwaXRhbHMREQAZLBUEFQAVAgAVABUQFQIAPBbIARkGGSYAHAAAACYAHBUEGTUABhAZGBFfX2luZGV4X2xldmVsXzBfXxUMFhwWnAMWoAIm1AIm5AEcGAgaAAAAAAAAABgIAAAAAAAAAAAWACgIGgAAAAAAAAAYCAAAAAAAAAAAEREAGSwVBBUAFQIAFQAVEBUCADwpBhkmABwAAAAmABwVChk1AAYQGTgIZ2VvbWV0cnkEbGlzdAdlbGVtZW50FQwWOBaoBRbMBSb2ByaEBBwYCENC06BbGFVAGAh4fKQPzRo8QBYAKAhDQtOgWxhVQBgIeHykD80aPEAREQAZLBUEFQAVAgAVABUQFQIAPCkmHBwZRgAAADgAAAAW/AkWHCYIFsgJABksGAZwYW5kYXMYjwR7ImluZGV4X2NvbHVtbnMiOiBbIl9faW5kZXhfbGV2ZWxfMF9fIl0sICJjb2x1bW5faW5kZXhlcyI6IFt7Im5hbWUiOiBudWxsLCAiZmllbGRfbmFtZSI6IG51bGwsICJwYW5kYXNfdHlwZSI6ICJ1bmljb2RlIiwgIm51bXB5X3R5cGUiOiAic3RyIiwgIm1ldGFkYXRhIjogeyJlbmNvZGluZyI6ICJVVEYtOCJ9fV0sICJjb2x1bW5zIjogW3sibmFtZSI6ICJsYXllciIsICJmaWVsZF9uYW1lIjogImxheWVyIiwgInBhbmRhc190eXBlIjogInVuaWNvZGUiLCAibnVtcHlfdHlwZSI6ICJzdHJpbmdbcHlhcnJvd10iLCAibWV0YWRhdGEiOiBudWxsfSwgeyJuYW1lIjogbnVsbCwgImZpZWxkX25hbWUiOiAiX19pbmRleF9sZXZlbF8wX18iLCAicGFuZGFzX3R5cGUiOiAiaW50NjQiLCAibnVtcHlfdHlwZSI6ICJpbnQ2NCIsICJtZXRhZGF0YSI6IG51bGx9XSwgImF0dHJpYnV0ZXMiOiB7fSwgImNyZWF0b3IiOiB7ImxpYnJhcnkiOiAicHlhcnJvdyIsICJ2ZXJzaW9uIjogIjI1LjAuMSJ9LCAicGFuZGFzX3ZlcnNpb24iOiAiMy4wLjUifQAYDEFSUk9XOnNjaGVtYRiAGy8vLy8veGdLQUFBUUFBQUFBQUFLQUE0QUJnQUZBQWdBQ2dBQUFBQUJCQUFRQUFBQUFBQUtBQXdBQUFBRUFBZ0FDZ0FBQUR3Q0FBQUVBQUFBQVFBQUFBUUFBQUE0L2YvL0hBSUFBQVFBQUFBUEFnQUFleUpwYm1SbGVGOWpiMngxYlc1eklqb2dXeUpmWDJsdVpHVjRYMnhsZG1Wc1h6QmZYeUpkTENBaVkyOXNkVzF1WDJsdVpHVjRaWE1pT2lCYmV5SnVZVzFsSWpvZ2JuVnNiQ3dnSW1acFpXeGtYMjVoYldVaU9pQnVkV3hzTENBaWNHRnVaR0Z6WDNSNWNHVWlPaUFpZFc1cFkyOWtaU0lzSUNKdWRXMXdlVjkwZVhCbElqb2dJbk4wY2lJc0lDSnRaWFJoWkdGMFlTSTZJSHNpWlc1amIyUnBibWNpT2lBaVZWUkdMVGdpZlgxZExDQWlZMjlzZFcxdWN5STZJRnQ3SW01aGJXVWlPaUFpYkdGNVpYSWlMQ0FpWm1sbGJHUmZibUZ0WlNJNklDSnNZWGxsY2lJc0lDSndZVzVrWVhOZmRIbHdaU0k2SUNKMWJtbGpiMlJsSWl3Z0ltNTFiWEI1WDNSNWNHVWlPaUFpYzNSeWFXNW5XM0I1WVhKeWIzZGRJaXdnSW0xbGRHRmtZWFJoSWpvZ2JuVnNiSDBzSUhzaWJtRnRaU0k2SUc1MWJHd3NJQ0ptYVdWc1pGOXVZVzFsSWpvZ0lsOWZhVzVrWlhoZmJHVjJaV3hmTUY5Zklpd2dJbkJoYm1SaGMxOTBlWEJsSWpvZ0ltbHVkRFkwSWl3Z0ltNTFiWEI1WDNSNWNHVWlPaUFpYVc1ME5qUWlMQ0FpYldWMFlXUmhkR0VpT2lCdWRXeHNmVjBzSUNKaGRIUnlhV0oxZEdWeklqb2dlMzBzSUNKamNtVmhkRzl5SWpvZ2V5SnNhV0p5WVhKNUlqb2dJbkI1WVhKeWIzY2lMQ0FpZG1WeWMybHZiaUk2SUNJeU5TNHdMakVpZlN3Z0luQmhibVJoYzE5MlpYSnphVzl1SWpvZ0lqTXVNQzQxSW4wQUJnQUFBSEJoYm1SaGN3QUFBd0FBQUlBSEFBQW9Cd0FBR0FBQUFBQUFFZ0FZQUFnQUJnQUhBQXdBQUFBUUFCUUFFZ0FBQUFBQUFSQVlBQUFBeUFZQUFBZ0FBQUFjQUFBQUFRQUFBTUFHQUFBSUFBQUFaMlZ2YldWMGNua0FBQUFBQWdBQUFFd0FBQUFFQUFBQXhQLy8veHdBQUFBRUFBQUFEZ0FBQUdkbGIyRnljbTkzTG5CdmFXNTBBQUFVQUFBQVFWSlNUMWM2WlhoMFpXNXphVzl1T201aGJXVUFBQUFBQ0FBTUFBUUFDQUFJQUFBQUxBWUFBQVFBQUFBZUJnQUFleUpqY25NaU9pQjdJaVJ6WTJobGJXRWlPaUFpYUhSMGNITTZMeTl3Y205cUxtOXlaeTl6WTJobGJXRnpMM1l3TGpjdmNISnZhbXB6YjI0dWMyTm9aVzFoTG1wemIyNGlMQ0FpZEhsd1pTSTZJQ0pIWlc5bmNtRndhR2xqUTFKVElpd2dJbTVoYldVaU9pQWlWMGRUSURnMElpd2dJbVJoZEhWdFgyVnVjMlZ0WW14bElqb2dleUp1WVcxbElqb2dJbGR2Y214a0lFZGxiMlJsZEdsaklGTjVjM1JsYlNBeE9UZzBJR1Z1YzJWdFlteGxJaXdnSW0xbGJXSmxjbk1pT2lCYmV5SnVZVzFsSWpvZ0lsZHZjbXhrSUVkbGIyUmxkR2xqSUZONWMzUmxiU0F4T1RnMElDaFVjbUZ1YzJsMEtTSXNJQ0pwWkNJNklIc2lZWFYwYUc5eWFYUjVJam9nSWtWUVUwY2lMQ0FpWTI5a1pTSTZJREV4TmpaOWZTd2dleUp1WVcxbElqb2dJbGR2Y214a0lFZGxiMlJsZEdsaklGTjVjM1JsYlNBeE9UZzBJQ2hITnpNd0tTSXNJQ0pwWkNJNklIc2lZWFYwYUc5eWFYUjVJam9nSWtWUVUwY2lMQ0FpWTI5a1pTSTZJREV4TlRKOWZTd2dleUp1WVcxbElqb2dJbGR2Y214a0lFZGxiMlJsZEdsaklGTjVjM1JsYlNBeE9UZzBJQ2hIT0RjektTSXNJQ0pwWkNJNklIc2lZWFYwYUc5eWFYUjVJam9nSWtWUVUwY2lMQ0FpWTI5a1pTSTZJREV4TlROOWZTd2dleUp1WVcxbElqb2dJbGR2Y214a0lFZGxiMlJsZEdsaklGTjVjM1JsYlNBeE9UZzBJQ2hITVRFMU1Da2lMQ0FpYVdRaU9pQjdJbUYxZEdodmNtbDBlU0k2SUNKRlVGTkhJaXdnSW1OdlpHVWlPaUF4TVRVMGZYMHNJSHNpYm1GdFpTSTZJQ0pYYjNKc1pDQkhaVzlrWlhScFl5QlRlWE4wWlcwZ01UazROQ0FvUnpFMk56UXBJaXdnSW1sa0lqb2dleUpoZFhSb2IzSnBkSGtpT2lBaVJWQlRSeUlzSUNKamIyUmxJam9nTVRFMU5YMTlMQ0I3SW01aGJXVWlPaUFpVjI5eWJHUWdSMlZ2WkdWMGFXTWdVM2x6ZEdWdElERTVPRFFnS0VjeE56WXlLU0lzSUNKcFpDSTZJSHNpWVhWMGFHOXlhWFI1SWpvZ0lrVlFVMGNpTENBaVkyOWtaU0k2SURFeE5UWjlmU3dnZXlKdVlXMWxJam9nSWxkdmNteGtJRWRsYjJSbGRHbGpJRk41YzNSbGJTQXhPVGcwSUNoSE1qRXpPU2tpTENBaWFXUWlPaUI3SW1GMWRHaHZjbWwwZVNJNklDSkZVRk5ISWl3Z0ltTnZaR1VpT2lBeE16QTVmWDBzSUhzaWJtRnRaU0k2SUNKWGIzSnNaQ0JIWlc5a1pYUnBZeUJUZVhOMFpXMGdNVGs0TkNBb1J6SXlPVFlwSWl3Z0ltbGtJam9nZXlKaGRYUm9iM0pwZEhraU9pQWlSVkJUUnlJc0lDSmpiMlJsSWpvZ01UTTRNMzE5WFN3Z0ltVnNiR2x3YzI5cFpDSTZJSHNpYm1GdFpTSTZJQ0pYUjFNZ09EUWlMQ0FpYzJWdGFWOXRZV3B2Y2w5aGVHbHpJam9nTmpNM09ERXpOeXdnSW1sdWRtVnljMlZmWm14aGRIUmxibWx1WnlJNklESTVPQzR5TlRjeU1qTTFOak45TENBaVlXTmpkWEpoWTNraU9pQWlNaTR3SWl3Z0ltbGtJam9nZXlKaGRYUm9iM0pwZEhraU9pQWlSVkJUUnlJc0lDSmpiMlJsSWpvZ05qTXlObjE5TENBaVkyOXZjbVJwYm1GMFpWOXplWE4wWlcwaU9pQjdJbk4xWW5SNWNHVWlPaUFpWld4c2FYQnpiMmxrWVd3aUxDQWlZWGhwY3lJNklGdDdJbTVoYldVaU9pQWlSMlZ2WkdWMGFXTWdiR0YwYVhSMVpHVWlMQ0FpWVdKaWNtVjJhV0YwYVc5dUlqb2dJa3hoZENJc0lDSmthWEpsWTNScGIyNGlPaUFpYm05eWRHZ2lMQ0FpZFc1cGRDSTZJQ0prWldkeVpXVWlmU3dnZXlKdVlXMWxJam9nSWtkbGIyUmxkR2xqSUd4dmJtZHBkSFZrWlNJc0lDSmhZbUp5WlhacFlYUnBiMjRpT2lBaVRHOXVJaXdnSW1ScGNtVmpkR2x2YmlJNklDSmxZWE4wSWl3Z0luVnVhWFFpT2lBaVpHVm5jbVZsSW4xZGZTd2dJbk5qYjNCbElqb2dJa2h2Y21sNmIyNTBZV3dnWTI5dGNHOXVaVzUwSUc5bUlETkVJSE41YzNSbGJTNGlMQ0FpWVhKbFlTSTZJQ0pYYjNKc1pDNGlMQ0FpWW1KdmVDSTZJSHNpYzI5MWRHaGZiR0YwYVhSMVpHVWlPaUF0T1RBc0lDSjNaWE4wWDJ4dmJtZHBkSFZrWlNJNklDMHhPREFzSUNKdWIzSjBhRjlzWVhScGRIVmtaU0k2SURrd0xDQWlaV0Z6ZEY5c2IyNW5hWFIxWkdVaU9pQXhPREI5TENBaWFXUWlPaUI3SW1GMWRHaHZjbWwwZVNJNklDSkZVRk5ISWl3Z0ltTnZaR1VpT2lBME16STJmWDBzSUNKamNuTmZkSGx3WlNJNklDSndjbTlxYW5OdmJpSjlBQUFZQUFBQVFWSlNUMWM2WlhoMFpXNXphVzl1T20xbGRHRmtZWFJoQUFBR0FBZ0FCQUFHQUFBQUFnQUFBSXovLy84QUFBRURFQUFBQUJ3QUFBQUVBQUFBQUFBQUFBSUFBQUI0ZVFBQUFBQUdBQWdBQmdBR0FBQUFBQUFDQUx6Ly8vOEFBQUVDRUFBQUFDd0FBQUFFQUFBQUFBQUFBQkVBQUFCZlgybHVaR1Y0WDJ4bGRtVnNYekJmWHdBQUFBZ0FEQUFJQUFjQUNBQUFBQUFBQUFGQUFBQUFFQUFVQUFnQUJnQUhBQXdBQUFBUUFCQUFBQUFBQUFFRkVBQUFBQndBQUFBRUFBQUFBQUFBQUFVQUFBQnNZWGxsY2dBQUFBUUFCQUFFQUFBQQAYIHBhcnF1ZXQtY3BwLWFycm93IHZlcnNpb24gMjUuMC4xGTwcAAAcAAAcAAAAohEAAFBBUjE=",
        "encoding": "base64",
        "path": [
         "table",
         0
        ]
       }
      ],
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_layer_type": "scatterplot",
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "antialiasing": null,
       "auto_highlight": false,
       "before_id": null,
       "billboard": null,
       "extensions": [],
       "filled": null,
       "get_fill_color": [
        31,
        36,
        48
       ],
       "get_line_color": null,
       "get_line_width": null,
       "get_radius": null,
       "highlight_color": [
        0,
        0,
        128,
        128
       ],
       "line_width_max_pixels": null,
       "line_width_min_pixels": null,
       "line_width_scale": null,
       "line_width_units": null,
       "opacity": 1.0,
       "pickable": true,
       "radius_max_pixels": null,
       "radius_min_pixels": 3.0,
       "radius_scale": null,
       "radius_units": null,
       "selected_index": null,
       "stroked": null,
       "table": [
        null
       ],
       "visible": true
      }
     },
     "a35cd520994c464abcd1b1a928dc724a": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.row.widget.Row",
       "_css": ".manywidgets-row {\n  margin: 10px 0;\n}\n\n.manywidgets-row__cell {\n  min-width: 0;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction stripIpy(id) {\n  return id ? String(id).replace(/^IPY_MODEL_/, \"\") : \"\";\n}\nvar noop = () => {\n};\nasync function renderChild(args, ref, el) {\n  if (args.host && typeof args.host.renderChild === \"function\") {\n    const dispose = await args.host.renderChild(ref, el);\n    return typeof dispose === \"function\" ? dispose : noop;\n  }\n  const wm = args.model.widget_manager;\n  if (!wm || typeof wm.create_view !== \"function\") {\n    throw new Error(\n      \"[manywidgets] renderChild needs a static host or a widget_manager with create_view\"\n    );\n  }\n  let child;\n  if (typeof ref === \"string\") {\n    if (!wm.get_model) throw new Error(\"[manywidgets] widget_manager has no get_model\");\n    child = await wm.get_model(stripIpy(ref));\n  } else {\n    child = ref;\n  }\n  const view = await wm.create_view(child);\n  el.appendChild(view.el);\n  return () => {\n    try {\n      view.remove?.();\n    } catch {\n    }\n  };\n}\n\n// src/manywidgets/row/src/index.ts\nasync function render(args) {\n  const { model, el } = args;\n  const container = document.createElement(\"div\");\n  container.className = \"manywidgets-row\";\n  el.appendChild(container);\n  let cleanups = [];\n  function applyStyle() {\n    container.style.display = \"flex\";\n    container.style.flexDirection = \"row\";\n    container.style.flexWrap = \"wrap\";\n    container.style.gap = model.get(\"gap\") || \"8px\";\n    container.style.alignItems = model.get(\"align\") || \"stretch\";\n  }\n  async function build() {\n    cleanups.forEach((d) => d());\n    cleanups = [];\n    container.replaceChildren();\n    const refs = model.get(\"children\") || [];\n    for (const ref of refs) {\n      const cell = document.createElement(\"div\");\n      cell.className = \"manywidgets-row__cell\";\n      container.appendChild(cell);\n      cleanups.push(await renderChild(args, ref, cell));\n    }\n  }\n  applyStyle();\n  await build();\n  model.on(\"change:gap\", applyStyle);\n  model.on(\"change:align\", applyStyle);\n  model.on(\"change:children\", () => {\n    void build();\n  });\n  return () => cleanups.forEach((d) => d());\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_myst_child_traits": [
        "children"
       ],
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "align": "start",
       "children": [
        "IPY_MODEL_ac204f92b0244fa087ae3bc6645f9f34",
        "IPY_MODEL_a73e2933b34f479bbc643b9a2dba450a"
       ],
       "gap": "24px",
       "layout": "IPY_MODEL_afe1f5994c1b4ccfb0ae962802e3c805",
       "tabbable": null,
       "tooltip": null,
       "widget_id": "row_2"
      }
     },
     "a4413b96fda54f0280dd7cd68bf846bd": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_control_type": "scale",
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "max_width": null,
       "position": null,
       "unit": null
      }
     },
     "a73e2933b34f479bbc643b9a2dba450a": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.legend.widget.Legend",
       "_css": ".manywidgets-legend {\n  display: inline-block;\n  padding: 10px 14px;\n  border: 1px solid #e1e4e8;\n  border-radius: 8px;\n  background: #ffffff;\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n}\n\n.manywidgets-legend__title {\n  color: #586069;\n  font-size: 12px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n  margin-bottom: 6px;\n}\n\n.manywidgets-legend__list {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  display: grid;\n  gap: 4px;\n}\n\n.manywidgets-legend__item {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n}\n\n.manywidgets-legend__swatch {\n  width: 14px;\n  height: 14px;\n  border-radius: 3px;\n  flex: none;\n  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);\n}\n\n.manywidgets-legend__label {\n  font-size: 14px;\n  color: #24292e;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction onChanges(model, names, fn) {\n  for (const name of names) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// src/manywidgets/legend/src/index.ts\nfunction toCss(color) {\n  if (typeof color === \"string\") return color;\n  if (Array.isArray(color)) {\n    const [r, g, b, a] = color;\n    if (color.length >= 4) return `rgba(${r}, ${g}, ${b}, ${a / 255})`;\n    return `rgb(${r}, ${g}, ${b})`;\n  }\n  return \"transparent\";\n}\nfunction render({ model, el }) {\n  const container = document.createElement(\"div\");\n  container.className = \"manywidgets-legend\";\n  const titleEl = document.createElement(\"div\");\n  titleEl.className = \"manywidgets-legend__title\";\n  const list = document.createElement(\"ul\");\n  list.className = \"manywidgets-legend__list\";\n  container.appendChild(titleEl);\n  container.appendChild(list);\n  el.appendChild(container);\n  function update() {\n    const title = model.get(\"title\") || \"\";\n    titleEl.textContent = title;\n    titleEl.style.display = title ? \"\" : \"none\";\n    list.replaceChildren();\n    for (const entry of model.get(\"entries\") || []) {\n      const [color, label] = entry;\n      const li = document.createElement(\"li\");\n      li.className = \"manywidgets-legend__item\";\n      const swatch = document.createElement(\"span\");\n      swatch.className = \"manywidgets-legend__swatch\";\n      swatch.style.background = toCss(color);\n      const text = document.createElement(\"span\");\n      text.className = \"manywidgets-legend__label\";\n      text.textContent = String(label);\n      li.appendChild(swatch);\n      li.appendChild(text);\n      list.appendChild(li);\n    }\n  }\n  update();\n  onChanges(model, [\"entries\", \"title\"], update);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "entries": [
        [
         [
          255,
          247,
          236
         ],
         "0%"
        ],
        [
         [
          253,
          211,
          157
         ],
         "15%"
        ],
        [
         [
          251,
          140,
          88
         ],
         "31%"
        ],
        [
         [
          214,
          46,
          30
         ],
         "46%"
        ],
        [
         [
          127,
          0,
          0
         ],
         "61%"
        ]
       ],
       "layout": "IPY_MODEL_745b81af88384cc28af3521c0eceaca7",
       "tabbable": null,
       "title": "Exposed population share",
       "tooltip": null,
       "widget_id": "legend_1"
      }
     },
     "a8ecfd5f968444cf97d44ef84896f10e": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.stat.widget.Stat",
       "_css": ".manywidgets-stat {\n  display: inline-block;\n  min-width: 140px;\n  padding: 14px 18px;\n  border: 1px solid #e1e4e8;\n  border-radius: 10px;\n  background: #ffffff;\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n}\n\n.manywidgets-stat__label {\n  color: #586069;\n  font-size: 12px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.manywidgets-stat__value-row {\n  display: flex;\n  align-items: baseline;\n  gap: 4px;\n  margin-top: 6px;\n}\n\n.manywidgets-stat__value {\n  font-size: 30px;\n  font-weight: 700;\n  color: #24292e;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__unit {\n  font-size: 14px;\n  color: #586069;\n}\n\n.manywidgets-stat__delta {\n  margin-top: 4px;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__delta--up {\n  color: #1a7f37;\n}\n.manywidgets-stat__delta--down {\n  color: #cf222e;\n}\n.manywidgets-stat__delta--flat {\n  color: #586069;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction onChanges(model, names, fn) {\n  for (const name of names) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// src/manywidgets/stat/src/index.ts\nfunction render({ model, el }) {\n  const card = document.createElement(\"div\");\n  card.className = \"manywidgets-stat\";\n  const labelEl = document.createElement(\"div\");\n  labelEl.className = \"manywidgets-stat__label\";\n  const valueRow = document.createElement(\"div\");\n  valueRow.className = \"manywidgets-stat__value-row\";\n  const valueEl = document.createElement(\"span\");\n  valueEl.className = \"manywidgets-stat__value\";\n  const unitEl = document.createElement(\"span\");\n  unitEl.className = \"manywidgets-stat__unit\";\n  valueRow.appendChild(valueEl);\n  valueRow.appendChild(unitEl);\n  const deltaEl = document.createElement(\"div\");\n  deltaEl.className = \"manywidgets-stat__delta\";\n  card.appendChild(labelEl);\n  card.appendChild(valueRow);\n  card.appendChild(deltaEl);\n  el.appendChild(card);\n  function update() {\n    labelEl.textContent = model.get(\"label\");\n    valueEl.textContent = String(model.get(\"value\"));\n    unitEl.textContent = model.get(\"unit\");\n    const delta = model.get(\"delta\");\n    if (delta == null || delta === \"\") {\n      deltaEl.textContent = \"\";\n      deltaEl.className = \"manywidgets-stat__delta\";\n      return;\n    }\n    const n = Number(delta);\n    const sign = n > 0 ? \"\\u25B2\" : n < 0 ? \"\\u25BC\" : \"\\u2022\";\n    const dir = n > 0 ? \"up\" : n < 0 ? \"down\" : \"flat\";\n    deltaEl.textContent = `${sign} ${Math.abs(n)}`;\n    deltaEl.className = `manywidgets-stat__delta manywidgets-stat__delta--${dir}`;\n  }\n  update();\n  onChanges(model, [\"label\", \"value\", \"unit\", \"delta\"], update);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "delta": null,
       "label": "Facilities exposed",
       "layout": "IPY_MODEL_f24e418eb8954fe4bec6482cfda60d83",
       "tabbable": null,
       "tooltip": null,
       "unit": "",
       "value": 14,
       "widget_id": "stat_4"
      }
     },
     "ac204f92b0244fa087ae3bc6645f9f34": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.column.widget.Column",
       "_css": ".manywidgets-column {\n  margin: 10px 0;\n}\n\n.manywidgets-column__cell {\n  min-width: 0;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction stripIpy(id) {\n  return id ? String(id).replace(/^IPY_MODEL_/, \"\") : \"\";\n}\nvar noop = () => {\n};\nasync function renderChild(args, ref, el) {\n  if (args.host && typeof args.host.renderChild === \"function\") {\n    const dispose = await args.host.renderChild(ref, el);\n    return typeof dispose === \"function\" ? dispose : noop;\n  }\n  const wm = args.model.widget_manager;\n  if (!wm || typeof wm.create_view !== \"function\") {\n    throw new Error(\n      \"[manywidgets] renderChild needs a static host or a widget_manager with create_view\"\n    );\n  }\n  let child;\n  if (typeof ref === \"string\") {\n    if (!wm.get_model) throw new Error(\"[manywidgets] widget_manager has no get_model\");\n    child = await wm.get_model(stripIpy(ref));\n  } else {\n    child = ref;\n  }\n  const view = await wm.create_view(child);\n  el.appendChild(view.el);\n  return () => {\n    try {\n      view.remove?.();\n    } catch {\n    }\n  };\n}\n\n// src/manywidgets/column/src/index.ts\nasync function render(args) {\n  const { model, el } = args;\n  const container = document.createElement(\"div\");\n  container.className = \"manywidgets-column\";\n  el.appendChild(container);\n  let cleanups = [];\n  function applyStyle() {\n    container.style.display = \"flex\";\n    container.style.flexDirection = \"column\";\n    container.style.gap = model.get(\"gap\") || \"8px\";\n    container.style.alignItems = model.get(\"align\") || \"stretch\";\n  }\n  async function build() {\n    cleanups.forEach((d) => d());\n    cleanups = [];\n    container.replaceChildren();\n    const refs = model.get(\"children\") || [];\n    for (const ref of refs) {\n      const cell = document.createElement(\"div\");\n      cell.className = \"manywidgets-column__cell\";\n      container.appendChild(cell);\n      cleanups.push(await renderChild(args, ref, cell));\n    }\n  }\n  applyStyle();\n  await build();\n  model.on(\"change:gap\", applyStyle);\n  model.on(\"change:align\", applyStyle);\n  model.on(\"change:children\", () => {\n    void build();\n  });\n  return () => cleanups.forEach((d) => d());\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_myst_child_traits": [
        "children"
       ],
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "align": "stretch",
       "children": [
        "IPY_MODEL_cb0be52c265d45259fa8c7c3bbc04c15",
        "IPY_MODEL_ea9359ac0f8545a79e42b557de733ddf"
       ],
       "gap": "6px",
       "layout": "IPY_MODEL_39b0c53e85f94f50ba56c3bdbc1f5176",
       "tabbable": null,
       "tooltip": null,
       "widget_id": "column_1"
      }
     },
     "afe1f5994c1b4ccfb0ae962802e3c805": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "b05b15ede4774c5eae43eda614a3be7d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "b16917cd632e4368af5bff43e628cae0": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_2554306e59bc405bbf3bd3cdec8c1c05",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "b6c1904085144b3c9af4b7a35ca7a7c8": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_413cbca649654f64ac162dbe0c8b7a83",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "ba202f2652b04a05b3177accfba4cf34": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "bde16f262b0c401789c1dd3c93cf259d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "be2d7ebdafa144cdb0b1a323bacbfad9": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "mode": "overlaid",
       "style": "https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json"
      }
     },
     "cb0be52c265d45259fa8c7c3bbc04c15": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.lonboard.layer_toggle.widget.LayerToggle",
       "_css": ".manywidgets-layertoggle {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  margin: 10px 0;\n  cursor: pointer;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n  user-select: none;\n}\n\n.manywidgets-layertoggle__input {\n  position: absolute;\n  opacity: 0;\n  width: 0;\n  height: 0;\n}\n\n.manywidgets-layertoggle__track {\n  position: relative;\n  width: 40px;\n  height: 22px;\n  border-radius: 11px;\n  background: #d0d7de;\n  transition: background 0.2s ease;\n  flex: none;\n}\n\n.manywidgets-layertoggle__track::after {\n  content: \"\";\n  position: absolute;\n  top: 2px;\n  left: 2px;\n  width: 18px;\n  height: 18px;\n  border-radius: 50%;\n  background: #fff;\n  transition: transform 0.2s ease;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);\n}\n\n.manywidgets-layertoggle__input:checked + .manywidgets-layertoggle__track {\n  background: #0366d6;\n}\n\n.manywidgets-layertoggle__input:checked + .manywidgets-layertoggle__track::after {\n  transform: translateX(18px);\n}\n\n.manywidgets-layertoggle__label {\n  color: #24292e;\n  font-size: 14px;\n  font-weight: 600;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction safeSaveChanges(model) {\n  try {\n    model?.save_changes?.();\n  } catch {\n  }\n}\nfunction stripIpy(id) {\n  return id ? String(id).replace(/^IPY_MODEL_/, \"\") : \"\";\n}\nfunction idOf(ref) {\n  if (typeof ref === \"string\") return stripIpy(ref);\n  const m = ref;\n  return m && typeof m.model_id === \"string\" ? m.model_id : \"\";\n}\nfunction setByPath(model, path, value) {\n  const parts = path.split(\".\");\n  if (parts.length === 1) {\n    model.set(parts[0], value);\n    return;\n  }\n  const topKey = parts[0];\n  const existing = model.get(topKey);\n  const next = existing && typeof existing === \"object\" ? { ...existing } : {};\n  let cursor = next;\n  for (let i = 1; i < parts.length - 1; i++) {\n    const k = parts[i];\n    const child = cursor[k];\n    cursor[k] = child && typeof child === \"object\" ? { ...child } : {};\n    cursor = cursor[k];\n  }\n  cursor[parts[parts.length - 1]] = value;\n  model.set(topKey, next);\n}\nfunction deliverCustomMessage(model, content, buffers = []) {\n  if (typeof model.receiveCustomMessage === \"function\") {\n    model.receiveCustomMessage(content, buffers);\n  } else if (typeof model.trigger === \"function\") {\n    model.trigger(\"msg:custom\", content, buffers);\n  }\n}\nfunction getStaticRegistry() {\n  const hosts = globalThis.__myst_anywidget_hosts;\n  if (!hosts || typeof hosts.values !== \"function\") return null;\n  for (const v of hosts.values()) return v;\n  return null;\n}\nfunction findAllInRegistry(reg, id) {\n  const out = [];\n  const seen = /* @__PURE__ */ new Set();\n  const push = (m) => {\n    if (m && !seen.has(m)) {\n      seen.add(m);\n      out.push(m);\n    }\n  };\n  if (typeof reg.get === \"function\") push(reg.get(id));\n  const all = typeof reg.filter === \"function\" ? reg.filter((w) => !!w && w.model_id === id) : typeof reg.all === \"function\" ? reg.all().filter((w) => !!w && w.model_id === id) : [];\n  for (const m of all) push(m);\n  return out;\n}\nfunction makeHandle(getModels) {\n  return {\n    get models() {\n      return getModels();\n    },\n    get(field) {\n      const ms = getModels();\n      return ms.length ? ms[0].get(field) : void 0;\n    },\n    set(field, value) {\n      for (const m of getModels()) m.set(field, value);\n    },\n    setByPath(path, value) {\n      for (const m of getModels()) setByPath(m, path, value);\n    },\n    save() {\n      for (const m of getModels()) safeSaveChanges(m);\n    },\n    on(field, fn) {\n      for (const m of getModels()) m.on?.(`change:${field}`, () => fn(m.get(field)));\n    },\n    sendCustom(content, buffers = []) {\n      for (const m of getModels()) deliverCustomMessage(m, content, buffers);\n    }\n  };\n}\nasync function resolveModel(model, ref, { timeout = 5e3 } = {}) {\n  const id = stripIpy(ref);\n  const reg = getStaticRegistry();\n  if (reg) {\n    return makeHandle(() => findAllInRegistry(reg, id));\n  }\n  if (model.widget_manager?.get_model) {\n    const resolved = await withTimeout(model.widget_manager.get_model(id), timeout);\n    let current = resolved ?? null;\n    return makeHandle(() => current ? [current] : []);\n  }\n  throw new Error(`[manywidgets] cannot resolve model \"${id}\": no host registry and no widget_manager`);\n}\nfunction withTimeout(promise, ms) {\n  return new Promise((resolve, reject) => {\n    const t = setTimeout(() => reject(new Error(`timed out after ${ms}ms`)), ms);\n    promise.then(\n      (v) => {\n        clearTimeout(t);\n        resolve(v);\n      },\n      (e) => {\n        clearTimeout(t);\n        reject(e);\n      }\n    );\n  });\n}\n\n// src/manywidgets/lonboard/layer_toggle/src/index.ts\nvar POLL_MS = 100;\nvar MAX_RUN_MS = 30 * 60 * 1e3;\nasync function render({ model, el }) {\n  const container = document.createElement(\"label\");\n  container.className = \"manywidgets-layertoggle\";\n  const input = document.createElement(\"input\");\n  input.type = \"checkbox\";\n  input.className = \"manywidgets-layertoggle__input\";\n  input.checked = !!model.get(\"value\");\n  const track = document.createElement(\"span\");\n  track.className = \"manywidgets-layertoggle__track\";\n  const label = document.createElement(\"span\");\n  label.className = \"manywidgets-layertoggle__label\";\n  label.textContent = model.get(\"label\");\n  container.append(input, track, label);\n  el.appendChild(container);\n  let handle = null;\n  try {\n    handle = await resolveModel(model, idOf(model.get(\"layer\")));\n  } catch (err) {\n    console.warn(\"[manywidgets:layer-toggle] could not resolve layer\", err);\n  }\n  let lastKey = \"\";\n  function apply() {\n    if (!handle) return;\n    const visible = !!model.get(\"value\");\n    const key = `${visible}:${handle.models.length}`;\n    if (key === lastKey) return;\n    lastKey = key;\n    handle.set(\"visible\", visible);\n    handle.save();\n  }\n  input.addEventListener(\"change\", () => {\n    model.set(\"value\", input.checked);\n    safeSaveChanges(model);\n    apply();\n  });\n  model.on(\"change:value\", () => {\n    input.checked = !!model.get(\"value\");\n    apply();\n  });\n  model.on(\"change:label\", () => {\n    label.textContent = model.get(\"label\");\n  });\n  apply();\n  const stopAt = Date.now() + MAX_RUN_MS;\n  const loop = () => {\n    try {\n      apply();\n    } catch (err) {\n      console.warn(\"[manywidgets:layer-toggle] tick error\", err);\n    }\n    if (Date.now() < stopAt) setTimeout(loop, POLL_MS);\n  };\n  setTimeout(loop, POLL_MS);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "label": "Exposed share",
       "layer": "IPY_MODEL_e73833c24286410eab47e92427225e44",
       "layout": "IPY_MODEL_3751cfa831cd4513a494d7e178e0becd",
       "tabbable": null,
       "tooltip": null,
       "value": true,
       "widget_id": "layertoggle_1"
      }
     },
     "cfe8fe833f2a436da2f4ddc9510843e2": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "2.0.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "2.0.0",
       "_model_name": "VBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "2.0.0",
       "_view_name": "VBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_f132ded4ff41415fade72a6c1d58d010",
        "IPY_MODEL_b6c1904085144b3c9af4b7a35ca7a7c8",
        "IPY_MODEL_b16917cd632e4368af5bff43e628cae0",
        "IPY_MODEL_91875a6a76ac465aa1747d5d9272c619",
        "IPY_MODEL_8c23f46fc5d24ebb9da7b17bb44e0edb",
        "IPY_MODEL_2dd53f4de47e41d1993a285012f8b353"
       ],
       "layout": "IPY_MODEL_6f04e500abee4d31a6ec2a945e3e9f7f",
       "tabbable": null,
       "tooltip": null
      }
     },
     "e73833c24286410eab47e92427225e44": {
      "buffers": [
       {
        "data": "UEFSMRUEFRgVKkwVBhUAEgAAKLUv/SAMYQAAfwAAAAAAAAD/AAAAFQAVIBUyLBUIFRAVBhUGHDYAKAT/AAAAGAQAAAAAEREAAAAotS/9IBCBAAACAAAAAw4CAAAACAMCA5QAFQQZTDUAGAZzY2hlbWEVAgA1AhgFdmFsdWUVAhUGTDwAAAA1BBgEbGlzdBUCABUCJQIYB2VsZW1lbnQlFkysEwgSAAAAFgIZHBkcJgAcFQIZNQAGEBk4BXZhbHVlBGxpc3QHZWxlbWVudBUMFggWmgEWvgEmTiYIHDYAKAT/AAAAGAQAAAAAEREAGSwVBBUAFQIAFQAVEBUCADwpJgIGGUYAAAAIAAAAFpoBFgImCBa+AQAZHBgMQVJST1c6c2NoZW1hGOABLy8vLy82QUFBQUFRQUFBQUFBQUtBQXdBQmdBRkFBZ0FDZ0FBQUFBQkJBQU1BQUFBQ0FBSUFBQUFCQUFJQUFBQUJBQUFBQUVBQUFBRUFBQUEwUC8vL3dBQUFSQVVBQUFBSEFBQUFBUUFBQUFCQUFBQUtBQUFBQVVBQUFCMllXeDFaUUFBQU1yLy8vOEVBQUFBRUFBVUFBZ0FCZ0FIQUF3QUFBQVFBQkFBQUFBQUFBRUNFQUFBQUJnQUFBQUVBQUFBQUFBQUFBQUFBQUFBQUFZQUNBQUVBQVlBQUFBSUFBQUEAGCBwYXJxdWV0LWNwcC1hcnJvdyB2ZXJzaW9uIDI1LjAuMRkcHAAAAM8BAABQQVIx",
        "encoding": "base64",
        "path": [
         "get_fill_color",
         0
        ]
       },
       {
        "data": "UEFSMRUEFRYVKEwVAhUAEgAAKLUv/SALWQAABwAAAEdhbmRha2kVABUSFSQsFQIVEBUGFQYcNgAoB0dhbmRha2kYB0dhbmRha2kREQAAACi1L/0gCUkAAAIAAAACAQECABUEFRAVIkwVAhUAEgAAKLUv/SAIQQAA0wfPSno3DkEVABUSFSQsFQIVEBUGFQYcGAjTB89KejcOQRgI0wfPSno3DkEWACgI0wfPSno3DkEYCNMHz0p6Nw5BEREAAAAotS/9IAlJAAACAAAAAgEBAgAVBBUQFSJMFQIVABIAACi1L/0gCEEAAFKTgc7ZewJBFQAVEhUkLBUCFRAVBhUGHBgIUpOBztl7AkEYCFKTgc7ZewJBFgAoCFKTgc7ZewJBGAhSk4HO2XsCQRERAAAAKLUv/SAJSQAAAgAAAAIBAQIAFQQVCBUaTBUCFQASAAAotS/9IAQhAADfmBw/FQAVEhUkLBUCFRAVBhUGHBgE35gcPxgE35gcPxYAKATfmBw/GATfmBw/EREAAAAotS/9IAlJAAACAAAAAgEBAgAVBBWQ0QEVinhMFZIaFQASAAAotS/9YEgz3e8A+lB5STsQIHEVOuuGa0kkaBWsBbBDOVfu6vthMjIOriK1A4v/+JGnD4J5oECsBGN+jBoMNIT0sDmPj2+NFcXoAb4EkQRkBG+nAr6C7RQo7fGlhcHbicUXMNJUDiN7byenLyBgOyG62clS4BtIwdtpBZ28nx5AGziEvoFNhmAAUvV+CuLYV4Ck99PTFD/ByyxfwQYdApFB31BzYe64wPoKUr2huGg5UhjkO9hQSxhkggUXTN5QewYTrWV9Cb8AQYLnwhvK8Tu4SQfwUe0NhcCXEOsd9aECQzsifAvZbEh7gL2jtrCjCOeg6TNpb6k6BMwIgfElDNvi+ITnLTXmAReG+xXklLAnieRbKu0ANn5VX0EyihIZQPGWglEh0lSObyAfCLaLvqX8wJC08vUdDBJFUzDDW0pTEIMe43fwy6QAFtJ7agNpvLlSqMN7CtDqPVWHhWfY5gv4qMZmQ/qeYiR1xDnhG/inkgB69N5TjIy8sha/gtHNFJgGeE9BGgGnRgJfQcchDqSge1OxHXTQBN/APCoQipB5UxFBRAntyjfQ6k314m3CdOoLmAYohUef99RfAmmAUnq8qaa+f0MwAGHQ96YClGCPVYOwNwM5MjmkMr9/gg7QOXL1ZpAnGd1U8QX0eldVmPtQgaHvnxmnJRva3lVhGqyaPH39rhTisEAE76qouyY2Rb6UEiW7UoR4Vz0tpfEy9q7aP0LvKgjYRMng8LZ6utMH0sE3UExRAhLseVvtG4DnN7CvOEA24cP0BVTxA80ryvuKCI5NOoFfv6vKyMrUyPvKbwXa5Jnf+wpPA2k6xPj+fXhfgbE6LKzgffWoByUKsO/fFQHgLinfWEvJggsmOQDfWF1whFUy9PUD8cbK8fXDfGPNIeGkwZfvHxI8YIfq3lh7rBp0CPTGkuxKAcLN988LyqC3Bd4Nnl0QQU35/r3xajTD927g9f3LIYUZpu3dgHAM5gchX0p2oMwYcvl2QCnE+8GGtioJ5L59DzKsqUPAzLfvQd3hksz3gxoOeLSo4EsJigIYJXfvB1jAEI7B/FIacvl1IcQbwiIKTNRw8N0TA4mIR8s7Ag21OSScfCfF4XQc4sA7wgQ3aKjN+U6S0kBIxvWOkEaTgRBAXz26QGQUKb4j+LDRRYfqKykLQtSd0zuCkrsgUTa/kWZAUQCz5B2h0RYJcmRyvCMsIwLsuKjMvLO4AmFUiPRdBEiRA0di7ywVehHifAji2PfjnUUFQpExD3wN2bCCBUzhO2tGnyQ5kb6Fqg45Pgy9s/CuomEPvLMmzyip4fEdhCOsUqEubwlZincV3HhLsDI1YoCKL94BJzijfHlLkLRiwU+Mb94ZEUSUTLwnfFUuctHyHSQHkh2VxfcECeTIqCjwzcs0RoOS+tZKIWaK1IZvISAM+MRQeGu1DQ7QI8vX0I80mgyGvLWY5PirQ+eLSJIcSHZV3lpmhLzAU/lNZIYPBKN5ayV6MxlBnq+iuUtaAgG9KZio4YBHAF9FNRIrzIF4U/DwTYTlgxMAcO8KZ1CRcFu+iJJE6vmh5l2h7nAJ5qVvIUslKFhz9t7KYCJPUvotdEJMUQJv3luFCyb10foSAiCPGMjEN1eUDA5ahb55N/K2SCi+twAnYPng9B2Ex2QRBSbeW4Zt1hgZfQcZ2fuqZHxznVFSs4Pxi2fZIsgEC2+uNymOIDjxxXPBJMefnTfXFho8JowCIs5O1XHB+cnqsHCvgddGvyQUOl98M10IgcDTy2vjpcbOCmxYwRLmlZHLBboYgr6bjJt0XhnNdjzhCvxqVsYQX83KqFkXV7NEXKI301dFs6+m4mZVlJEZCVDrVXEtpfES4vDqNTGzrwBJKCpfE1vsUcbp/GZqvSaGwJoBVeGLCdmE79LlayLYNzOHkb0vy1dEP8FLLJe+mIibSUiQmwcRvB4mWsuCIPXdZOBUuGDv9XA3q+EYDUpkdPlyDvBqyEn1WriaaTrEqDteCwUxiQdnX00hf7ZECXstfPDFrISFBtRhO/S93GCn8an5upSDT74/0F4HB6WDgze+0kp4wHeSxithmTJlypj5Rsdgfgjy+FoIDXs1pND54k3rG92jjMPp+Gq4UTZDjKSPXg+j9VCKiAiOzTqvh/UQiKADdKAz+iTNeT2E8Z0eOuNGsb4e2n2nS14PM+cuaRF8RaSLIYhJfKEYXhEXOmiCGzTWXhGlbeAQqo1eE7UICXID4TvtEKPqkPOaePWddr0m7mRNVCAPJkREvlIcXyYFwK+JSab4CVb6RmtimTK8q+g3CiiFBx87r4pKvlEtgX8q2XhV3MmquJN1Mch3utjiS1kXJ5F8JyujlMnrIt8lSz5tX+mS10Vpbcxyguhm5wutjQt99OjRI0ivjmhf6dgEh8wavTpGq+M3Wh+hecRAIk7w2uMbeTn9U6H36mi4Pmx4fSNJPDiDivxCSh1xStjzuo+VCnXBIfb6uI31cY2IOqxB38b6WCEZMV8h576NU6kH/AR6hdzGSxcyjbF4jYSmeI3caJXcEeEBuPlCqyS0SkoeWcLlAt2r5EZWyRnfSM4oXjKNeYUutEIlfCP1vELLvpI1upE1ykAcMFaIXxjQVylklRpQh81Qo+8jGCV3QaS8TkrYkyRSz9dxyOukiW9jjr86c9C8Tt75NgoAdzn9e510+zYGep3UROK2wsTr5JsrhThM+T7WyUcPZcrwsF6nIQ6vuI58HevU0cfrFA6hyujK97HO63QfEyvMfeB7nUp+HSulIDcP6hJF1GHhHb5WGvoiVksMeow62L6GXugCkVn0anlXgQ0rWb6GfSAbaCJ5vayXdKieHCBfK1nyWaHG0bfw7fGNl+MrpmHFJGDE2hPpF/EJVyCMrVfMGF/Eiunliwh2I2+rxCvmGmIa1kwNSmRwsfwe9msmYs3cxDhgrA4NXy1JPeAHkKKvYrXUlmSK3+BXEYQbJ02GvFpCwIyQFxN8EUm8WqryTdRj1IGigVfNtSfRL0C+ThBfN5++h2z8qtKOfA158LEDZcbr5pNvYd003FfOqm/hvnK+wFOpgJ6voYurKi2aXjkdQXBCTNFr5xaJRMmu7yGeSgXyZHrtjBvgUQ/Kb2Hja6ccH4UsoX0LqSxusNP4esnpa1gvIfDsgijqW4hn2Gat8RVTh69hn0mbWvSKaQsrpq9XTEvo5zUTIqgpRhZ8Ccm20OAh8JppwReQTwwFD2XeTWjfwLI22/Hk3RTmjourKu+mKi2aToB5N+1glHfTDjrwbpryFSThpIGXMe8mKAGc115MyIsNtRcfioTbIqHFu4sTdRcv6i7u2uL4dMfP2REB7y6GxKXXXLzXXJjOe82l4cxHSc2Oxcz3FvOZvbdGvCswpa7gtyhugEc+3lu8FdgVeLArEDYFnhPz1tKawIYTuFACE7aEwc76Oxd2Fhd2Vkfgw4aAuGMxcw7TG0JDSHzAi/2AGR8wtgNWbAe82A14sbF4sbH6qlAXHGGY58a2mjwzlr2tEK34sKsMI3hXcVchMoAy6E3KozNihAfQJs6bASc2lWJTsWKWc2JTUTgj9hQn9pTiW4oRGygRlwjOW4oRO2oxc+6SA+eWEuAcFdhRcefAFJhwfJn0joJwBmzyjuI/9msoptRQ7Nfs9/Z+YkpoVwSAq/R+Yr5+enE+wfl+Yr12iqIpiGHSWRJD6iZI3cSPuonV3gsiLWC9TBUTT6qYuO9SH/cx8spSFPR6yYAzX2cFtZMnvXaypNrJkmpnpNrJjDp5UeVUtMmKkrxu2jgjqppMzoc0mVDVnHHOe5swleLyqomneWcJEP/JZD+dr5n8R8UrJqCK+aeSn1qp7Nwn0uvluQ/zqZfMp4CzHs6z47WSJzCyAIjgltdKxlMt2c4lCLaD5p3pXPZZ4IxIorOcFK+V4FTMN5hWsIAhJHN2I4AevSdWXjE5TWaTs10m19VMPlMz2UzFNFMxKzGZSzoOUy0ZzJpXSwiqJXux5C6WnX8yrKk7a6nEWSphSeD1kqvUS65iyVReLReolFIrOUqtZCi1UsfZCSUnwE38vE6ZSYzXKS+RwUGLEN7rlA/gIpMspEo5SAMvdIHKvE4ykDrJPxy8TvKPD04AsAD0OuUfdco/+MfcK/uYTucivEp5rka5gBrluUuvUPYR5R6VdUghnHX0q9RHIUsl9pxzSJkAxiFdoaZRHpXzDbgMJvJqnFe8SplGnTTgPKNOytB7UmUP4TkGA++zwNnrlMz5hQvKPmc4Dq/TM4tKqUfvSRU+5zfKOmyGGE2e2yijzm1xr5QXMo29QZ5VPF8peUWlPKvQcWazZDYKr5d8Hi32KOW8XvIJS0arlozm9mrJaJZcziOqZVyiN5N2ZxFsRuS10kkDL3R3Z7NayWa1kkVQMjmbVUp+1imX1SmWzj8Z2JzHtBwpNKDO6xTElPH8wY2ijExJr5QsJvg65TDuUCl5gw4UDZSQe53enTlMgjlvqFLGIGUMNZrnDFa4lyXSAa9RJG4r0CbPXzXq5GyhRtmr6QQEbKJeo1wB8VXKFRi8SlmrSqvOWlEPZwk1yjauvEalnCOIeGUIjV6jbIqMTXDo7CDKVwe8Riecr3pkmQtz5xXKAFQoW1UoV6F5hTZwroIyA6hZIxpvsJwZVKaqUKaCejlTVagjMQLsuM5TDl6hLNUnSQ4kNK/QKUYWABk8T3GUncanJTWv0Ke2wQF8nCtD3XmVHHt7fGPh/FT5ycVrJJGzU43kpwrJUPVRk4GQP1vOUPXxjBtFGZbOTtx04/WRn6pjkvOTY19BXHjNNfXF666u9sqzUKgtFPkeaguLqL1WUXs1+Crqrl3E1YjLryrtgDZfva697prUXrvnNam/dq+/Jhl5g60emF5fOPHd6wt8feFCX2PAA3bojARfvs6wfRnoHAEgD907g+A7g2Br2A1bqOS9YQ17w4bD5rCHHAybwxp26HDYHTogBvDuEGYYVhi2gx22gysmKEb2FttAMcD2sH7tYfnaQ3vwsHr9YSX1h43UISCF2Ech9hGksX00to56bB2N7SOyhUS2kbpsI3WZXtlOKqv8Turn6j1X0nMjPSU9V89s9/q5fM/te/bTr5/7188FfO6zn2VdVraHi9jlTZZYtmSLZIxkZBtJttAmWyiG99hGbbzJpGRkX18p2U6SbeWSN5mT72WTbaUmW8yyzSzbzH6upeduPjefy/lczjbbzjbbS2ZtVsDbLFOLWNAieIGIBX3mdAbVIi6xdP7RcI7qs6kzqhbBVmTQGX167zMAMLzPGKvPHFy9zxycSYDzHsETegRT6BFbPaKrSTSJLxIWusRXCQslvNC60LgLbQuNK5jgahOHzBrRgHPe6hO81Se4etlruZfB+KuZv5q/0sDSMHQaa+g03tBpHTqNw6S80z6kMYhOC9FpZK3Gz1ZTYxFqZy3eakwijdFajU+QeKuprXHa085q/QlTqQf+nNf677+Pos8oZLzP1iggzyuazY0Nji2u2bgF29rZRbMxDDYZnYJl8AwVNXoF11jBNbqtRrvdSJtaFEfA220AtwXebjzcfLzN9VsBbkDajYO4FWm3I0CQ4AFD9HZD0pakjZVkvdt4SbdJOjdx4sYKuLVbg/OTN35CRkUBuAzvtycs+EmzYCjNIu0sRQsDp8KmN9yIMwNwTKXhqsCxlYbjK3Cc5ckBsknfG46zwHGWjssiV3nWIrflLfeAXJc49gL2lvvScj/OYTpODNN1XN55TByTeXzj1XjmHYeiEoJfkrMZuTNydS3Hdi3Hdi2XRk5Nx3EbOTdxbRqOJWg4hsOC4zQLOc2C5fQbozOdN77j5tZtXKfbeM4KnrOC5xy+V3CdVkHB2U6nsNMpxJzrsIDBQBww7xQ8p1PwnGZrNn7TbBI0CjsqixvunNnEeaNg00fTXzuzxmXWeo3HrLUa06kxXdo5jJM385hmJlOCgjUi6t7MZHjMMpka7+0TTBemLcmUv/eJC+cxbYKuTdCZYDEW3mgshsIbjcM0GospwWC6BH/J9CaBCRERHJznuiY2RcbyvM247lnXZRwB15ElXDC8y+zIKM8RNBnb9Zhdj3GaMV7TIdY0CDZ8VqhpROgNYtLZDZB3iDcg5nQIFOc5ILjOoDeIOh/svD0wnghYwGBAztsD52kPLSbGfcTYjxj/aTEGJBaow+46bMH5rjtwIA1vDmznOw4jzncJvDfwnQZBiN4aMnBeZ8CAAe4sqC8AImDEGpTzoL7AeA2G12CCGoz19NeeL+bTX33eFviuv1hQf/EgCzyoLXBee22mwIQDggeFO6hjgETWPUQERElFEoiUwqTQASMQgIDAwAAh4RFiI94+EwAMAW/vAeMZJxhuuuRjSxqnmzTWMWULYs5TDpHC2Ion5j/Q8vTyceG4fuLRkXvB7Z8xxAp6pvX4e/VXwbfR3XY6uaF6M9qoel/xytPNiEYYXSw08/bzV4sL48YwbLljMjVLhscr3DZgP2K+s3Zgx48bzpWvY+nsqZz2xxo27n8sL83yOWBPZXW7WqjrUMiOcciZ4l4wfqxrZE0SnmvVPpr1RQ1BbmCb0BwwcHWdKr1u3olUKJfZoehyguYjfvPAKizmB1ZtTbVpSve8FVydttE20QoyhjtF3CP0KMlt6zOo+XU6N0XoTz9znIu5hsdWA2AaIToT6FDqqclJ5c2Vi92GtJH1B4zNjGVdG+9rXsb2NStncp2WFTYuMv81ReYQAHuKnCXc4j32bO/NLj9e/HoJJ2THPHjQtGaDzg7huC/MB7b6lHZem+ccouyC24WaC3Zyoe+F4blh2Xk9thBsYIxQl7zlqvOIzeuIW+EXuIpmxPGXk0zzsIg4ktz4ImV3YAPUBmY8G5YEedalBZQ2CnEE8fab3xc9kzEQY3+bcFISb4+vjIYFV63j9vVDzNgkfV94oiXT5lgfvREtTeBtZof6rsbNd4ufI8iBOvYDrqGn0y7uvKQaY8xdlF/f/+MaH9qwXp9vYO3ZuzKpfWJGqcucqYU45ulvX7PBbeQD6F1sZnUm1z+c5ePL7qVFjUnO0YMNcls5h6m7bKEZkgtFDd1KU+VC5bE1jidcMn65MkL3DrhRzsTi1A4TSG1qBswLxrPqTjE8eP/O6IKKIwaskN8na/BrAZ5zmgm/Vi1POweIheVeyVNyWS1lcuKSyYaHmhjUnmjrd7ulz/SeHI5NXdzct5eKGB8Oo7M9l6Qn42wdM1qLqbvPFbruAeU1ZnGH6jztOr1u7uIO6QsQo73ZNZ4zMnM1yk06n8hqgzCFY800AlI6zmkap488Cl7ya1bIyvoNfY+SsLCxnUHNSI7IXKuu1bEQ6jjek3PP7Rk2lxP2yNmtOVM8btiRgxSvLWiX6+/En2AMIwaEdun3Qp/DksJZ12T3G0e5rZoxxhsg6r5olvJsnzd/fpSp9VI6V3rlf5s21hI7uWxyQ+OgAdYpH+O89rU7Y1V0ueB9xWaOPAhiUWGfmyLIeaiwvh0pM5w7WU7L3Qh0oQjPoevf5lkhXWwDtYrmuboX+qj9MKEthckV2k+9LG1gv8Axdjxf2FgikdPnv7NvCJw1tAZrEvYAafux7zRClt0e5VHLvZFTg2k6O6M7KUyVQ8/HTn5elGXz9W8UjP7ucrGzQiiTLWSTHUuqLHhcwvtTERtDm9R8OVs9l+alu/0kZv/uJNY4zNfmQfv6weWM1BUvJoPHYkajw395+RNTcyTu2hvwqVgv65nAcymmw20zDPAv3kZAjXHnSljVZ+rV4c5jJHMDZ4LPhkyfjUSYAG5s2IC94p86c3rPyN6W+o4F31i2+Bbp9i20LlcLmTmEFoLu2Zoc3f79luu0VfPxibwH2U3ZRNRIo+mOW8vZRoyFG+3nBLu/njHb/DadMBrCdD1qpO0fib8efqBuY3Xa/8XwKziTGtWLtDUAB/JTKl/pmWTeNZ+F8QZQV3RGom60Q2gkT00M/+w49x8aEGATdavhqpHmrDQEM1NeJJ5JpsdAZ8eDaI5WmlDs0JjhMRZqed7qXxffvrHliheyLYRCqW9zdwdONvyfRzimH21s5pS7ukcSNcaO384Lck8x+p7vHdWsxD5+rnBaVznesDbegriaGAZcFV92+ZB2nTex3sQbkmd7OGMPnk3S+NSZzgvQ7sOP7LOeLu+lUR210+boPC/q82dsB8oCDbe5GnA7uyttcD2MNubkJN2TMJfnjLHMr5MmYowS85S3wfiVBSvrguRolNXVmdT7DpMTMk2tqNyMz35fXB025j3+A5pF9NnCsXsL5tfGeRr+PA5xLIFD0llyjKUlZovVDWQGedkYi2kNZaHP5Z+AjAPcg+bqBr4PwLBrG/jQtEnTOsqZXuBr4m2PbSODtcrGItLW/KU+Oyub+yzY4lugNS5V9dBlwEWiI2ka6J6vGnLOcOVdcwJhgvj1PFssbHYLe7LC9jrDz+R4yGjpz3a09iHrPdmGji4Mm55qAkCeFpow21WmEf2T/CVwDiwSCgaljRJbD72cRTeh3R6yBd6lHQ2bijgWSwgz7MZPH0zt7m1WQkGiG5gMhqP0QenH2oEbJqxhFhoJy2vLKCJ2eLJwPWYKPGV41LetRyMtSzWGIXCwZoUuqYOz7nYiTlQzlVkObA6yZnFNtgwnqkahXxM7GTLrRE8yhwjT3a7YqP0U+SDOI1xG44vS4FLeGC/y7VkFCoMDYZAu+dfqR+bl6Okhg6qjmZ3q7ei3Ed0LNgUCyFqPucX/aAaftXA9V0ubvFIbJWDHOxq0AxLG6tk4adt+32GDEAVAJ9bNrvNcNAZutlig2zmX/BOemZNAMEjfWHjckTS1F67n7TpUP7xUHdwZgBuV/GUwbWeFKkXG/LHYGT/kMdzM+compR7j7IkpdvH1moGZ5Wpkeecx7LLCaGDOVb95O5K+LPtMGarHO+rPFw1WtfZPWLZTD7usrYThJGYCi4rvE1vrxSyMOcM9SDXGbfmzA+dzZ79a7ojh8Gp9lLRTA8OBOSsL3Xs34QOVfAs5k/XeKj2zxlumeMe37DUm5uGyRjTIoiFKiB3P62Nr1kKTcDY2IaGN5RgPzOldAYNTHmbu2Zji7FtNPhWH7eDZJRaE41Pv7qZOkYhcXjGzALvz2VbVWG5elQZHxpJdujkyMxYoimFJaHYNJKBnn2Vea8rnXjaUanMJxyflLAU2hmxjRjRHdXx4HsBGQXbkN4O+FP8U8Dlb7vSXYoON3fWcNmScPf6btCVGuqWYN/CKBZdgGQFr3KKkvXZI1+vw5I/pc6z9DE4bB8bzdBWalXVEA/bNlO9ssZwYU668RmIF61L4elwTWhM/xuH+FX9HNC98rstrbJt1/2x5bxQtjQZBeKcmvGCKUqKBI3Hd2biB8IxyHXXDFgyf6HuS/Hc5M8CzYq/qgYwYt16xzwA1V+ggCmcJ5EftgL11VwxcrEQs753n3HSk2t/WM5fLbDLHzRfA+damrFOmRRhwamTCNLxEcmHmLryCIU/rqvZ5XepxJ4RkfcEz9BypF6PvDdkX+Wsrerxrz7DMIXzz9OYYhypzT3ll7RI6EFzG2pWSWectV+u92ZNGXbqymylKd7kwYWzTO4fnZ4NPgV1gbGwDGXHNqXW5W5tP2Cb4ZhjtMl75Kms523Of4LfnMBWNOGYSsvNhJrBOZmj3SqYsjcf89ZHYG0C3IlMbyxCQPYz6VEEpYnQmhISr+BayF3U6vzC7Aq6VWEHMmo3z65XAQchqyowSkBRv4lyBnFTKmmQT/qpGDgfpjCHD2aXpOSmhLqI3uCFRbkad72bO/+cW2aOTC884id3OQXbGoFauY4G9gDGhSbXMLxq3fRIVU5zvQ97mc5oD3qA9jHJYciY5NfAy2jV8C1cCgA0/S59flC0TA4FyrJJ3OlYobooGbrVegrlORfy03Ok0r4nYbBEgYE8Amie0J2USW95Ih2OqHVpsX6OD7s7VzSuMPouJfXxbS83Hq53XC+Q2HtbQuIQW3JHdcN1zcTmWmBZ2jjh1RpiI2LcMbs4hQzQnqE+Qwv6C5IK6SrIuWPAz4+6R92SMF7l6mfxfssFh5OcLpR7VQhZzIxViRVWMkagdPd4W2hypDmwcZOPnMqyPE45nvoGl5MKOtQnLiTbNe0E4uo7gzf0ins8stbVgvV7GdR3SYU1PJ/OkjRzJhy56R0fX93lcizaJbiXNj2sFQqtDshyMJHReu4uqQwdELiQGRmb0M7tKtBy3SvECMqvhOIn1t0Smz2601HJPFo2ek7pCFDvSrhUAFYwxFY4nLBXoGxUQFQYVBhwYCBueXinLTFVAGAgEVg4tsr07QBYAKAgbnl4py0xVQBgIBFYOLbK9O0AREQAAACi1L/1gRgvtTQD0mqECAAB/4DiO43/jRQgAAwAAAOgbCQt/AAiAAAZAgAIY4AAISIACFsCABjjgARCIgAQmQIEKWOACGMiABjbAgQ544AMgCIEIRkCCEpjgBCgYQQpUsIIRsKAFLngBDGIggxnQoAY2uAEOcqCDHfCgBz74ARCCIIQhEKEIRjgCEpKghCUwoQlOeAIUoiCFKVChClaYwhWwkAUtbIELXfDCF8AQhimIYQxkKIMZnnAGNKRBDWtgQxum4IY3wAEMcZDDHNBAhzrY4Q54yIMe9sCHPvjhD4AIhCAGQYhCGOIQiEiEIhbBiEY44hGQiIQkJkGJSljiEpjIhCY2wYlOeOIToAiFKEZBilKY4hSoSIUqVsGKVrjiFbCIhSxmQYta2EINt/gDLnKhi13wohe++AUwgiGMYRCjGMY4BjI6kQxlLIMZzXDGM2YBjUdEQxrToEY1dmGNa2AjG9oYxTa40Q1vfAMc4RDHOMhRDnOcAx3pQIc61sGOdrjjHfCIhzzmAQ961MMe98BHPvSxD370wx//AEhABDIQghTEIAdBSEIUshCGNMQhD4FIRCQykXZQhB4VschFMJIRjWyEIx3Bh0c+ApKQiGQkJCmJSU6CkpSoZCUsKUlLXPISmMREJjOhSU1schOc5EQnO+FJT3zyE6AERShDIUpRjHIUpCRFKUthSlOc8hSoREUqU6FKVaxyFapgJSta2QpXuuKVr4AlLGIZC1nKYpazoCUtalkLW9rilrfAJS5ymQtd6mKXu9gFL3nRy1740he//AUwgRHMYAhTGMMcBjGJUcxiGNMYxzwGMpGRzGQoU5m5WOYymMmMZjbDGcB0xjOfAU1oRDMa0pTGNKdBTWpUsxrWtAY0rnkNbGIjm9nQpja2uQ1ucqOb3fCmN775DXCCI5zhEKc4xjkOcpKjnOUwpznOeQ50oiOd6VBnOtWxznWwkx3tbIc7f93xznfAEx7xjIc85THPedCTHvWshz3tcc974BMf+cyHPvOpj33ug5/86Gc//OmPf/4DoAAJaEAEKpCBDoSgBCloQQxqkIMeBKEISWhCFKqQhS6EoQxpaEMc6pCHPgSiEIloRCQqkYlOhKIUqWhFLGqRi14EoxjJaEY0qpGNanQjHOVIRzviUY989CMgBUlIQyJSkYx0JCQlSUlJWhKTmuSkJ0EpSlKaEpWqZKUrYSlLWtoSl7rkpS+BKUwdEdOYyFQmM50JTWlS05rY1CY3vQlOcZITl+ZEpzrZ6U54ypOe9sSnPvnpT4AKlKAGBShCFcpQLzkUohKlqEUxqlGOehSkIhUkSU2KUpWy1KUwlSlNbYpTnfLUp0AVKlGNilSl4pSpToWqVBVKVatiVatc9SpYxUpWs6JVrWx1K1zlSle74lWvfPUrYJkkWMIaFrGKZaxjIStZyloWs5rlrGdBK1rSmha1qmWta2ErW9raFre65a1vgStcaRLXuMhVLnKZ61zoSpe61sWudrnrXfCKl7zmRa962ete+MqXvvbFr375618AC5jABuYtgvGrYAY7mLQQljCFLYxhDXPYwyAWMYlNjGIVs9jFMJYxjW2MYx3z2MdAFjKRjYxkJTPZyVCWMpWtjGUtc9nLYBYzmc2MZjWz2c1wljOdhWNnPOuZz34GtJ8FTWhDI1rRjHY0pCVNadFQ2tKYtrSmOe1pUIua1KZGtapZ7WpYy5rWtsa1rpnCa18DW9jENjaylc1sZ0Nb2tS2Nra1zW1vg1vc5DY3uimibna7G97ypre98a1vfvsb4AInuMERrnCGOxziEqe4wy2OcY1z3OMgFznJTY5ylbPc5TCXOc1tjnOd89znQBc60Y2OdKUz3elQlzrVrY51rXPd62AXO9nNjna1s93tcJc73e2Od3+9893vgBe8qQlveMQrnvGOh7zkKW95zGue854HvehJb3rUq571roe97Glve9zrnve+B77wiW985Cuf+c6HvvSpb33sa5/73ge/+MlvfvSrn/3uh7/86a9++5sf//rnv/D9D4ABFOAACVhAAx4QgQlU4AIZ2EAHPhCCEZTgBClYQQtesGAYJFgGNbhBDnbQgx8EYQhFOEISltCEJ0RhClW4Qha20IUvhGEMZThDGtbQhjfEYQ51uEMe9tCHPwRiEIU4RCIW0YhHRGISlbhEJjbRiU+EYhSlOEUqVtGKV4QiFrOoxS1ysYte/CIYwyjGMZKxjGY8IxrFlUY1rvGLbGyjG98IRx/GUY5zpGMd7XhHPOZRj3u8Fx/76Mc/AjKQghwkIQtpyEMiMpGKXCQjG+nIR0KyX5H0oCQnSclKWvKSmMykJjfJyU568pOgDKUoR0nKUprylKhMpSpXycpWuvKVsIylLGdJy1ra8pa4zKUud8nLXvryl8AMpjCHScxiGvOYyEymMpfJzGY685nQjKY0p0nNalrzmtjMpja3yc1uevOb4AynOMdJznKa85zoDGc61blOdq6zne58JzzjKc950rOe9rwnPvOpz33ys5/+/CdAAyrQgRK0oAal1EERmlCFLpShDXXoQyEaUYlOlKJ+rKhFL4rRjGp0oxztqEc/CtKQinSkJC2pSU+K0pSqdKUsbalLXwrTmMp0pjStqU1vitOc6nSnPO2pT38K1KAKdahE/VJRjXrUKgkVqUlV6lKZ2lSnPhWqUZXqVKlaVateFatZ1epWudpVr34VrGEV61jJWlaznhWtaVXrWtnaVre+Fa5xletc6VpXu94Vr3nV61752le//hWwgTWrYAdL2MIa9rCITaxiF8vYxjr2sZCNrGRHJNnJUraylr0sZjOr2c1ytrNFnv0saEMr2tGStrSmPS1qT5ta9ah2taxtrWtfC9vYyna2tK2tbW+L29zqdre87a1vfwvc4Ap3uMQtrnGPi9y4JFe5yQXNcpnbXOc+F7rRle50U0Ld6lr3utjNrna3y93u5tC738UIeJkR3kaId7zkLa95z4ve9Kp3vex9Qnvd+174xle+86Vvfe17X/zmV7/75W9//ftfAAdYwAMmcIENfGAEJ1jBC2Zwgx38YAhHWMIvnDCFK2zhC2M4wxreMIc77GEAfxjEIRbxiElcYhOfGMUp7oWKV8ziFrv4xTCOMYxPIeMZ07jGNqbHjXGcY3voeMc8FkePffxjIAdZyEMmcpEVYuQjIznJSl4yk53xvyY7uRP8y8WTAwHlKEt5ylSuspWTcGUsZ1nLW+Zyl738ZTCHWcxjJnOZzXxmNKdZzWtmc5vd/GY4x1nOc6Zzne18ZzznWc975nOf/fxnP2uvBYBuQaAFPWhCF9rQh0Y0AAIAAAAAAAADAAFScRc0KrZJuSMVBBnsNQAYBnNjaGVtYRUKABUMJQIYBG5hbWUlAEwcAAAAFQolAhgKcG9wdWxhdGlvbgAVCiUCGAdleHBvc2VkABUIJQIYDWV4cG9zZWRfc2hhcmUANQIYCGdlb21ldHJ5FQIVBkw8AAAANQQYBGxpc3QVAgA1AhgHZWxlbWVudBUCFQZMPAAAADUEGARsaXN0FQIANQIYB2VsZW1lbnQVAhUGTDwAAAA1BBgEbGlzdBUCADUCGAdlbGVtZW50FQIVBkw8AAAANQQYBGxpc3QVAgAVCiUCGAdlbGVtZW50ABYCGRwZXCYAHBUMGTUABhAZGARuYW1lFQwWAhaWARa6ASZMJggcNgAoB0dhbmRha2kYB0dhbmRha2kREQAZLBUEFQAVAgAVABUQFQIAPBYOGQYZJgACAAAAJgAcFQoZNQAGEBkYCnBvcHVsYXRpb24VDBYCFrwBFuABJoACJsIBHBgI0wfPSno3DkEYCNMHz0p6Nw5BFgAoCNMHz0p6Nw5BGAjTB89KejcOQRERABksFQQVABUCABUAFRAVAgA8KQYZJgACAAAAJgAcFQoZNQAGEBkYB2V4cG9zZWQVDBYCFrwBFuABJuADJqIDHBgIUpOBztl7AkEYCFKTgc7ZewJBFgAoCFKTgc7ZewJBGAhSk4HO2XsCQRERABksFQQVABUCABUAFRAVAgA8KQYZJgACAAAAJgAcFQgZNQAGEBkYDWV4cG9zZWRfc2hhcmUVDBYCFpQBFrgBJrgFJoIFHBgE35gcPxgE35gcPxYAKATfmBw/GATfmBw/EREAGSwVBBUAFQIAFQAVEBUCADwpBhkmAAIAAAAmABwVChk1AAYQGZgIZ2VvbWV0cnkEbGlzdAdlbGVtZW50BGxpc3QHZWxlbWVudARsaXN0B2VsZW1lbnQEbGlzdAdlbGVtZW50FQwW6BsWxIMCFsCgASbofia6BhwYCBueXinLTFVAGAgEVg4tsr07QBYAKAgbnl4py0xVQBgIBFYOLbK9O0AREQAZLBUEFQAVAgAVABUQFQIAPClWAgAA8g30DRmmAAAAAAAAAAAA6BsAAAAW5ogCFgImCBbypgEAGSwYBnBhbmRhcxjJBnsiaW5kZXhfY29sdW1ucyI6IFt7ImtpbmQiOiAicmFuZ2UiLCAibmFtZSI6IG51bGwsICJzdGFydCI6IDAsICJzdG9wIjogMSwgInN0ZXAiOiAxfV0sICJjb2x1bW5faW5kZXhlcyI6IFt7Im5hbWUiOiBudWxsLCAiZmllbGRfbmFtZSI6IG51bGwsICJwYW5kYXNfdHlwZSI6ICJ1bmljb2RlIiwgIm51bXB5X3R5cGUiOiAic3RyIiwgIm1ldGFkYXRhIjogeyJlbmNvZGluZyI6ICJVVEYtOCJ9fV0sICJjb2x1bW5zIjogW3sibmFtZSI6ICJuYW1lIiwgImZpZWxkX25hbWUiOiAibmFtZSIsICJwYW5kYXNfdHlwZSI6ICJ1bmljb2RlIiwgIm51bXB5X3R5cGUiOiAic3RyaW5nW3B5YXJyb3ddIiwgIm1ldGFkYXRhIjogbnVsbH0sIHsibmFtZSI6ICJwb3B1bGF0aW9uIiwgImZpZWxkX25hbWUiOiAicG9wdWxhdGlvbiIsICJwYW5kYXNfdHlwZSI6ICJmbG9hdDY0IiwgIm51bXB5X3R5cGUiOiAiZG91YmxlW3B5YXJyb3ddIiwgIm1ldGFkYXRhIjogbnVsbH0sIHsibmFtZSI6ICJleHBvc2VkIiwgImZpZWxkX25hbWUiOiAiZXhwb3NlZCIsICJwYW5kYXNfdHlwZSI6ICJmbG9hdDY0IiwgIm51bXB5X3R5cGUiOiAiZG91YmxlW3B5YXJyb3ddIiwgIm1ldGFkYXRhIjogbnVsbH0sIHsibmFtZSI6ICJleHBvc2VkX3NoYXJlIiwgImZpZWxkX25hbWUiOiAiZXhwb3NlZF9zaGFyZSIsICJwYW5kYXNfdHlwZSI6ICJmbG9hdDMyIiwgIm51bXB5X3R5cGUiOiAiZmxvYXRbcHlhcnJvd10iLCAibWV0YWRhdGEiOiBudWxsfV0sICJhdHRyaWJ1dGVzIjoge30sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogInB5YXJyb3ciLCAidmVyc2lvbiI6ICIyNS4wLjEifSwgInBhbmRhc192ZXJzaW9uIjogIjMuMC41In0AGAxBUlJPVzpzY2hlbWEYzCAvLy8vL3pBTUFBQVFBQUFBQUFBS0FBNEFCZ0FGQUFnQUNnQUFBQUFCQkFBUUFBQUFBQUFLQUF3QUFBQUVBQWdBQ2dBQUFIZ0RBQUFFQUFBQUFRQUFBQVFBQUFEcysvLy9XQU1BQUFRQUFBQkpBd0FBZXlKcGJtUmxlRjlqYjJ4MWJXNXpJam9nVzNzaWEybHVaQ0k2SUNKeVlXNW5aU0lzSUNKdVlXMWxJam9nYm5Wc2JDd2dJbk4wWVhKMElqb2dNQ3dnSW5OMGIzQWlPaUF4TENBaWMzUmxjQ0k2SURGOVhTd2dJbU52YkhWdGJsOXBibVJsZUdWeklqb2dXM3NpYm1GdFpTSTZJRzUxYkd3c0lDSm1hV1ZzWkY5dVlXMWxJam9nYm5Wc2JDd2dJbkJoYm1SaGMxOTBlWEJsSWpvZ0luVnVhV052WkdVaUxDQWliblZ0Y0hsZmRIbHdaU0k2SUNKemRISWlMQ0FpYldWMFlXUmhkR0VpT2lCN0ltVnVZMjlrYVc1bklqb2dJbFZVUmkwNEluMTlYU3dnSW1OdmJIVnRibk1pT2lCYmV5SnVZVzFsSWpvZ0ltNWhiV1VpTENBaVptbGxiR1JmYm1GdFpTSTZJQ0p1WVcxbElpd2dJbkJoYm1SaGMxOTBlWEJsSWpvZ0luVnVhV052WkdVaUxDQWliblZ0Y0hsZmRIbHdaU0k2SUNKemRISnBibWRiY0hsaGNuSnZkMTBpTENBaWJXVjBZV1JoZEdFaU9pQnVkV3hzZlN3Z2V5SnVZVzFsSWpvZ0luQnZjSFZzWVhScGIyNGlMQ0FpWm1sbGJHUmZibUZ0WlNJNklDSndiM0IxYkdGMGFXOXVJaXdnSW5CaGJtUmhjMTkwZVhCbElqb2dJbVpzYjJGME5qUWlMQ0FpYm5WdGNIbGZkSGx3WlNJNklDSmtiM1ZpYkdWYmNIbGhjbkp2ZDEwaUxDQWliV1YwWVdSaGRHRWlPaUJ1ZFd4c2ZTd2dleUp1WVcxbElqb2dJbVY0Y0c5elpXUWlMQ0FpWm1sbGJHUmZibUZ0WlNJNklDSmxlSEJ2YzJWa0lpd2dJbkJoYm1SaGMxOTBlWEJsSWpvZ0ltWnNiMkYwTmpRaUxDQWliblZ0Y0hsZmRIbHdaU0k2SUNKa2IzVmliR1ZiY0hsaGNuSnZkMTBpTENBaWJXVjBZV1JoZEdFaU9pQnVkV3hzZlN3Z2V5SnVZVzFsSWpvZ0ltVjRjRzl6WldSZmMyaGhjbVVpTENBaVptbGxiR1JmYm1GdFpTSTZJQ0psZUhCdmMyVmtYM05vWVhKbElpd2dJbkJoYm1SaGMxOTBlWEJsSWpvZ0ltWnNiMkYwTXpJaUxDQWliblZ0Y0hsZmRIbHdaU0k2SUNKbWJHOWhkRnR3ZVdGeWNtOTNYU0lzSUNKdFpYUmhaR0YwWVNJNklHNTFiR3g5WFN3Z0ltRjBkSEpwWW5WMFpYTWlPaUI3ZlN3Z0ltTnlaV0YwYjNJaU9pQjdJbXhwWW5KaGNua2lPaUFpY0hsaGNuSnZkeUlzSUNKMlpYSnphVzl1SWpvZ0lqSTFMakF1TVNKOUxDQWljR0Z1WkdGelgzWmxjbk5wYjI0aU9pQWlNeTR3TGpVaWZRQUFBQVlBQUFCd1lXNWtZWE1BQUFVQUFBQmNDQUFBRUFnQUFPQUhBQUNvQndBQUdBQUFBQUFBRWdBWUFBZ0FCZ0FIQUF3QUFBQVFBQlFBRWdBQUFBQUFBUXdZQUFBQXpBWUFBQWdBQUFBY0FBQUFBUUFBQU1BR0FBQUlBQUFBWjJWdmJXVjBjbmtBQUFBQUFnQUFBRlFBQUFBRUFBQUF2UC8vL3lRQUFBQUVBQUFBRlFBQUFHZGxiMkZ5Y205M0xtMTFiSFJwY0c5c2VXZHZiZ0FBQUJRQUFBQkJVbEpQVnpwbGVIUmxibk5wYjI0NmJtRnRaUUFBQUFBSUFBd0FCQUFJQUFnQUFBQXNCZ0FBQkFBQUFCNEdBQUI3SW1OeWN5STZJSHNpSkhOamFHVnRZU0k2SUNKb2RIUndjem92TDNCeWIyb3ViM0puTDNOamFHVnRZWE12ZGpBdU55OXdjbTlxYW5OdmJpNXpZMmhsYldFdWFuTnZiaUlzSUNKMGVYQmxJam9nSWtkbGIyZHlZWEJvYVdORFVsTWlMQ0FpYm1GdFpTSTZJQ0pYUjFNZ09EUWlMQ0FpWkdGMGRXMWZaVzV6WlcxaWJHVWlPaUI3SW01aGJXVWlPaUFpVjI5eWJHUWdSMlZ2WkdWMGFXTWdVM2x6ZEdWdElERTVPRFFnWlc1elpXMWliR1VpTENBaWJXVnRZbVZ5Y3lJNklGdDdJbTVoYldVaU9pQWlWMjl5YkdRZ1IyVnZaR1YwYVdNZ1UzbHpkR1Z0SURFNU9EUWdLRlJ5WVc1emFYUXBJaXdnSW1sa0lqb2dleUpoZFhSb2IzSnBkSGtpT2lBaVJWQlRSeUlzSUNKamIyUmxJam9nTVRFMk5uMTlMQ0I3SW01aGJXVWlPaUFpVjI5eWJHUWdSMlZ2WkdWMGFXTWdVM2x6ZEdWdElERTVPRFFnS0VjM016QXBJaXdnSW1sa0lqb2dleUpoZFhSb2IzSnBkSGtpT2lBaVJWQlRSeUlzSUNKamIyUmxJam9nTVRFMU1uMTlMQ0I3SW01aGJXVWlPaUFpVjI5eWJHUWdSMlZ2WkdWMGFXTWdVM2x6ZEdWdElERTVPRFFnS0VjNE56TXBJaXdnSW1sa0lqb2dleUpoZFhSb2IzSnBkSGtpT2lBaVJWQlRSeUlzSUNKamIyUmxJam9nTVRFMU0zMTlMQ0I3SW01aGJXVWlPaUFpVjI5eWJHUWdSMlZ2WkdWMGFXTWdVM2x6ZEdWdElERTVPRFFnS0VjeE1UVXdLU0lzSUNKcFpDSTZJSHNpWVhWMGFHOXlhWFI1SWpvZ0lrVlFVMGNpTENBaVkyOWtaU0k2SURFeE5UUjlmU3dnZXlKdVlXMWxJam9nSWxkdmNteGtJRWRsYjJSbGRHbGpJRk41YzNSbGJTQXhPVGcwSUNoSE1UWTNOQ2tpTENBaWFXUWlPaUI3SW1GMWRHaHZjbWwwZVNJNklDSkZVRk5ISWl3Z0ltTnZaR1VpT2lBeE1UVTFmWDBzSUhzaWJtRnRaU0k2SUNKWGIzSnNaQ0JIWlc5a1pYUnBZeUJUZVhOMFpXMGdNVGs0TkNBb1J6RTNOaklwSWl3Z0ltbGtJam9nZXlKaGRYUm9iM0pwZEhraU9pQWlSVkJUUnlJc0lDSmpiMlJsSWpvZ01URTFObjE5TENCN0ltNWhiV1VpT2lBaVYyOXliR1FnUjJWdlpHVjBhV01nVTNsemRHVnRJREU1T0RRZ0tFY3lNVE01S1NJc0lDSnBaQ0k2SUhzaVlYVjBhRzl5YVhSNUlqb2dJa1ZRVTBjaUxDQWlZMjlrWlNJNklERXpNRGw5ZlN3Z2V5SnVZVzFsSWpvZ0lsZHZjbXhrSUVkbGIyUmxkR2xqSUZONWMzUmxiU0F4T1RnMElDaEhNakk1TmlraUxDQWlhV1FpT2lCN0ltRjFkR2h2Y21sMGVTSTZJQ0pGVUZOSElpd2dJbU52WkdVaU9pQXhNemd6ZlgxZExDQWlaV3hzYVhCemIybGtJam9nZXlKdVlXMWxJam9nSWxkSFV5QTROQ0lzSUNKelpXMXBYMjFoYW05eVgyRjRhWE1pT2lBMk16YzRNVE0zTENBaWFXNTJaWEp6WlY5bWJHRjBkR1Z1YVc1bklqb2dNams0TGpJMU56SXlNelUyTTMwc0lDSmhZMk4xY21GamVTSTZJQ0l5TGpBaUxDQWlhV1FpT2lCN0ltRjFkR2h2Y21sMGVTSTZJQ0pGVUZOSElpd2dJbU52WkdVaU9pQTJNekkyZlgwc0lDSmpiMjl5WkdsdVlYUmxYM041YzNSbGJTSTZJSHNpYzNWaWRIbHdaU0k2SUNKbGJHeHBjSE52YVdSaGJDSXNJQ0poZUdseklqb2dXM3NpYm1GdFpTSTZJQ0pIWlc5a1pYUnBZeUJzWVhScGRIVmtaU0lzSUNKaFltSnlaWFpwWVhScGIyNGlPaUFpVEdGMElpd2dJbVJwY21WamRHbHZiaUk2SUNKdWIzSjBhQ0lzSUNKMWJtbDBJam9nSW1SbFozSmxaU0o5TENCN0ltNWhiV1VpT2lBaVIyVnZaR1YwYVdNZ2JHOXVaMmwwZFdSbElpd2dJbUZpWW5KbGRtbGhkR2x2YmlJNklDSk1iMjRpTENBaVpHbHlaV04wYVc5dUlqb2dJbVZoYzNRaUxDQWlkVzVwZENJNklDSmtaV2R5WldVaWZWMTlMQ0FpYzJOdmNHVWlPaUFpU0c5eWFYcHZiblJoYkNCamIyMXdiMjVsYm5RZ2IyWWdNMFFnYzNsemRHVnRMaUlzSUNKaGNtVmhJam9nSWxkdmNteGtMaUlzSUNKaVltOTRJam9nZXlKemIzVjBhRjlzWVhScGRIVmtaU0k2SUMwNU1Dd2dJbmRsYzNSZmJHOXVaMmwwZFdSbElqb2dMVEU0TUN3Z0ltNXZjblJvWDJ4aGRHbDBkV1JsSWpvZ09UQXNJQ0psWVhOMFgyeHZibWRwZEhWa1pTSTZJREU0TUgwc0lDSnBaQ0k2SUhzaVlYVjBhRzl5YVhSNUlqb2dJa1ZRVTBjaUxDQWlZMjlrWlNJNklEUXpNalo5ZlN3Z0ltTnljMTkwZVhCbElqb2dJbkJ5YjJwcWMyOXVJbjBBQUJnQUFBQkJVbEpQVnpwbGVIUmxibk5wYjI0NmJXVjBZV1JoZEdFQUFBQUFnUDcvLzdqKy8vOEFBQUVNRkFBQUFCZ0FBQUFFQUFBQUFRQUFBQkFBQUFBQUFBQUFBQUFBQUtqKy8vL2cvdi8vQUFBQkRCUUFBQUFZQUFBQUJBQUFBQUVBQUFBUUFBQUFBQUFBQUFBQUFBRFEvdi8vQ1AvLy93QUFBUkFVQUFBQUpBQUFBQVFBQUFBQkFBQUFJQUFBQUFnQUFBQjJaWEowYVdObGN3QUFCZ0FJQUFRQUJnQUFBQUlBQUFCQS8vLy9BQUFCQXhBQUFBQVVBQUFBQkFBQUFBQUFBQUFDQUFBQWVIa0FBRzcvLy84QUFBSUFhUC8vL3dBQUFRTVFBQUFBSUFBQUFBUUFBQUFBQUFBQURRQUFBR1Y0Y0c5elpXUmZjMmhoY21VQUFBQ2kvLy8vQUFBQkFKei8vLzhBQUFFREVBQUFBQmdBQUFBRUFBQUFBQUFBQUFjQUFBQmxlSEJ2YzJWa0FNNy8vLzhBQUFJQXlQLy8vd0FBQVFNUUFBQUFKQUFBQUFRQUFBQUFBQUFBQ2dBQUFIQnZjSFZzWVhScGIyNEFBQUFBQmdBSUFBWUFCZ0FBQUFBQUFnQVFBQlFBQ0FBR0FBY0FEQUFBQUJBQUVBQUFBQUFBQVFVUUFBQUFIQUFBQUFRQUFBQUFBQUFBQkFBQUFHNWhiV1VBQUFBQUJBQUVBQVFBQUFBPQAYIHBhcnF1ZXQtY3BwLWFycm93IHZlcnNpb24gMjUuMC4xGVwcAAAcAAAcAAAcAAAcAAAAIBcAAFBBUjE=",
        "encoding": "base64",
        "path": [
         "table",
         0
        ]
       }
      ],
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_layer_type": "polygon",
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "auto_highlight": false,
       "before_id": null,
       "elevation_scale": null,
       "extensions": [],
       "extruded": null,
       "filled": null,
       "get_elevation": null,
       "get_fill_color": [
        null
       ],
       "get_line_color": [
        60,
        60,
        60
       ],
       "get_line_width": null,
       "highlight_color": [
        0,
        0,
        128,
        128
       ],
       "line_joint_rounded": null,
       "line_miter_limit": null,
       "line_width_max_pixels": null,
       "line_width_min_pixels": 1.0,
       "line_width_scale": null,
       "line_width_units": null,
       "opacity": 0.75,
       "pickable": true,
       "selected_index": null,
       "stroked": null,
       "table": [
        null
       ],
       "visible": true,
       "wireframe": null
      }
     },
     "ea9359ac0f8545a79e42b557de733ddf": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.lonboard.layer_toggle.widget.LayerToggle",
       "_css": ".manywidgets-layertoggle {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  margin: 10px 0;\n  cursor: pointer;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n  user-select: none;\n}\n\n.manywidgets-layertoggle__input {\n  position: absolute;\n  opacity: 0;\n  width: 0;\n  height: 0;\n}\n\n.manywidgets-layertoggle__track {\n  position: relative;\n  width: 40px;\n  height: 22px;\n  border-radius: 11px;\n  background: #d0d7de;\n  transition: background 0.2s ease;\n  flex: none;\n}\n\n.manywidgets-layertoggle__track::after {\n  content: \"\";\n  position: absolute;\n  top: 2px;\n  left: 2px;\n  width: 18px;\n  height: 18px;\n  border-radius: 50%;\n  background: #fff;\n  transition: transform 0.2s ease;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);\n}\n\n.manywidgets-layertoggle__input:checked + .manywidgets-layertoggle__track {\n  background: #0366d6;\n}\n\n.manywidgets-layertoggle__input:checked + .manywidgets-layertoggle__track::after {\n  transform: translateX(18px);\n}\n\n.manywidgets-layertoggle__label {\n  color: #24292e;\n  font-size: 14px;\n  font-weight: 600;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction safeSaveChanges(model) {\n  try {\n    model?.save_changes?.();\n  } catch {\n  }\n}\nfunction stripIpy(id) {\n  return id ? String(id).replace(/^IPY_MODEL_/, \"\") : \"\";\n}\nfunction idOf(ref) {\n  if (typeof ref === \"string\") return stripIpy(ref);\n  const m = ref;\n  return m && typeof m.model_id === \"string\" ? m.model_id : \"\";\n}\nfunction setByPath(model, path, value) {\n  const parts = path.split(\".\");\n  if (parts.length === 1) {\n    model.set(parts[0], value);\n    return;\n  }\n  const topKey = parts[0];\n  const existing = model.get(topKey);\n  const next = existing && typeof existing === \"object\" ? { ...existing } : {};\n  let cursor = next;\n  for (let i = 1; i < parts.length - 1; i++) {\n    const k = parts[i];\n    const child = cursor[k];\n    cursor[k] = child && typeof child === \"object\" ? { ...child } : {};\n    cursor = cursor[k];\n  }\n  cursor[parts[parts.length - 1]] = value;\n  model.set(topKey, next);\n}\nfunction deliverCustomMessage(model, content, buffers = []) {\n  if (typeof model.receiveCustomMessage === \"function\") {\n    model.receiveCustomMessage(content, buffers);\n  } else if (typeof model.trigger === \"function\") {\n    model.trigger(\"msg:custom\", content, buffers);\n  }\n}\nfunction getStaticRegistry() {\n  const hosts = globalThis.__myst_anywidget_hosts;\n  if (!hosts || typeof hosts.values !== \"function\") return null;\n  for (const v of hosts.values()) return v;\n  return null;\n}\nfunction findAllInRegistry(reg, id) {\n  const out = [];\n  const seen = /* @__PURE__ */ new Set();\n  const push = (m) => {\n    if (m && !seen.has(m)) {\n      seen.add(m);\n      out.push(m);\n    }\n  };\n  if (typeof reg.get === \"function\") push(reg.get(id));\n  const all = typeof reg.filter === \"function\" ? reg.filter((w) => !!w && w.model_id === id) : typeof reg.all === \"function\" ? reg.all().filter((w) => !!w && w.model_id === id) : [];\n  for (const m of all) push(m);\n  return out;\n}\nfunction makeHandle(getModels) {\n  return {\n    get models() {\n      return getModels();\n    },\n    get(field) {\n      const ms = getModels();\n      return ms.length ? ms[0].get(field) : void 0;\n    },\n    set(field, value) {\n      for (const m of getModels()) m.set(field, value);\n    },\n    setByPath(path, value) {\n      for (const m of getModels()) setByPath(m, path, value);\n    },\n    save() {\n      for (const m of getModels()) safeSaveChanges(m);\n    },\n    on(field, fn) {\n      for (const m of getModels()) m.on?.(`change:${field}`, () => fn(m.get(field)));\n    },\n    sendCustom(content, buffers = []) {\n      for (const m of getModels()) deliverCustomMessage(m, content, buffers);\n    }\n  };\n}\nasync function resolveModel(model, ref, { timeout = 5e3 } = {}) {\n  const id = stripIpy(ref);\n  const reg = getStaticRegistry();\n  if (reg) {\n    return makeHandle(() => findAllInRegistry(reg, id));\n  }\n  if (model.widget_manager?.get_model) {\n    const resolved = await withTimeout(model.widget_manager.get_model(id), timeout);\n    let current = resolved ?? null;\n    return makeHandle(() => current ? [current] : []);\n  }\n  throw new Error(`[manywidgets] cannot resolve model \"${id}\": no host registry and no widget_manager`);\n}\nfunction withTimeout(promise, ms) {\n  return new Promise((resolve, reject) => {\n    const t = setTimeout(() => reject(new Error(`timed out after ${ms}ms`)), ms);\n    promise.then(\n      (v) => {\n        clearTimeout(t);\n        resolve(v);\n      },\n      (e) => {\n        clearTimeout(t);\n        reject(e);\n      }\n    );\n  });\n}\n\n// src/manywidgets/lonboard/layer_toggle/src/index.ts\nvar POLL_MS = 100;\nvar MAX_RUN_MS = 30 * 60 * 1e3;\nasync function render({ model, el }) {\n  const container = document.createElement(\"label\");\n  container.className = \"manywidgets-layertoggle\";\n  const input = document.createElement(\"input\");\n  input.type = \"checkbox\";\n  input.className = \"manywidgets-layertoggle__input\";\n  input.checked = !!model.get(\"value\");\n  const track = document.createElement(\"span\");\n  track.className = \"manywidgets-layertoggle__track\";\n  const label = document.createElement(\"span\");\n  label.className = \"manywidgets-layertoggle__label\";\n  label.textContent = model.get(\"label\");\n  container.append(input, track, label);\n  el.appendChild(container);\n  let handle = null;\n  try {\n    handle = await resolveModel(model, idOf(model.get(\"layer\")));\n  } catch (err) {\n    console.warn(\"[manywidgets:layer-toggle] could not resolve layer\", err);\n  }\n  let lastKey = \"\";\n  function apply() {\n    if (!handle) return;\n    const visible = !!model.get(\"value\");\n    const key = `${visible}:${handle.models.length}`;\n    if (key === lastKey) return;\n    lastKey = key;\n    handle.set(\"visible\", visible);\n    handle.save();\n  }\n  input.addEventListener(\"change\", () => {\n    model.set(\"value\", input.checked);\n    safeSaveChanges(model);\n    apply();\n  });\n  model.on(\"change:value\", () => {\n    input.checked = !!model.get(\"value\");\n    apply();\n  });\n  model.on(\"change:label\", () => {\n    label.textContent = model.get(\"label\");\n  });\n  apply();\n  const stopAt = Date.now() + MAX_RUN_MS;\n  const loop = () => {\n    try {\n      apply();\n    } catch (err) {\n      console.warn(\"[manywidgets:layer-toggle] tick error\", err);\n    }\n    if (Date.now() < stopAt) setTimeout(loop, POLL_MS);\n  };\n  setTimeout(loop, POLL_MS);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "label": "Exposed facilities",
       "layer": "IPY_MODEL_9c41188f01e44e3496c2dc72f6720a81",
       "layout": "IPY_MODEL_ba202f2652b04a05b3177accfba4cf34",
       "tabbable": null,
       "tooltip": null,
       "value": true,
       "widget_id": "layertoggle_2"
      }
     },
     "ea99951f120240ef9930fd0cbef48063": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "ec7e437229794497bb4fb01e692803c2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "WidgetModel",
      "state": {
       "_control_type": "fullscreen",
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "WidgetModel",
       "_view_count": null,
       "_view_module": null,
       "_view_module_version": "",
       "_view_name": null,
       "position": null
      }
     },
     "f132ded4ff41415fade72a6c1d58d010": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/output",
       "_model_module_version": "1.0.0",
       "_model_name": "OutputModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/output",
       "_view_module_version": "1.0.0",
       "_view_name": "OutputView",
       "layout": "IPY_MODEL_ea99951f120240ef9930fd0cbef48063",
       "msg_id": "",
       "outputs": [],
       "tabbable": null,
       "tooltip": null
      }
     },
     "f24e418eb8954fe4bec6482cfda60d83": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "f4a9d6ca70e24e2385d2d9d77251826c": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "2.0.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "2.0.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border_bottom": null,
       "border_left": null,
       "border_right": null,
       "border_top": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "fe6a66aac1754dd390c9d5f2ed22571b": {
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "manywidgets.stat.widget.Stat",
       "_css": ".manywidgets-stat {\n  display: inline-block;\n  min-width: 140px;\n  padding: 14px 18px;\n  border: 1px solid #e1e4e8;\n  border-radius: 10px;\n  background: #ffffff;\n  margin: 10px 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen,\n    Ubuntu, sans-serif;\n}\n\n.manywidgets-stat__label {\n  color: #586069;\n  font-size: 12px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.manywidgets-stat__value-row {\n  display: flex;\n  align-items: baseline;\n  gap: 4px;\n  margin-top: 6px;\n}\n\n.manywidgets-stat__value {\n  font-size: 30px;\n  font-weight: 700;\n  color: #24292e;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__unit {\n  font-size: 14px;\n  color: #586069;\n}\n\n.manywidgets-stat__delta {\n  margin-top: 4px;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n}\n\n.manywidgets-stat__delta--up {\n  color: #1a7f37;\n}\n.manywidgets-stat__delta--down {\n  color: #cf222e;\n}\n.manywidgets-stat__delta--flat {\n  color: #586069;\n}\n",
       "_dom_classes": [],
       "_esm": "// packages/core/src/index.ts\nfunction onChanges(model, names, fn) {\n  for (const name of names) model.on?.(`change:${name}`, fn);\n  return () => {\n    for (const name of names) model.off?.(`change:${name}`, fn);\n  };\n}\n\n// src/manywidgets/stat/src/index.ts\nfunction render({ model, el }) {\n  const card = document.createElement(\"div\");\n  card.className = \"manywidgets-stat\";\n  const labelEl = document.createElement(\"div\");\n  labelEl.className = \"manywidgets-stat__label\";\n  const valueRow = document.createElement(\"div\");\n  valueRow.className = \"manywidgets-stat__value-row\";\n  const valueEl = document.createElement(\"span\");\n  valueEl.className = \"manywidgets-stat__value\";\n  const unitEl = document.createElement(\"span\");\n  unitEl.className = \"manywidgets-stat__unit\";\n  valueRow.appendChild(valueEl);\n  valueRow.appendChild(unitEl);\n  const deltaEl = document.createElement(\"div\");\n  deltaEl.className = \"manywidgets-stat__delta\";\n  card.appendChild(labelEl);\n  card.appendChild(valueRow);\n  card.appendChild(deltaEl);\n  el.appendChild(card);\n  function update() {\n    labelEl.textContent = model.get(\"label\");\n    valueEl.textContent = String(model.get(\"value\"));\n    unitEl.textContent = model.get(\"unit\");\n    const delta = model.get(\"delta\");\n    if (delta == null || delta === \"\") {\n      deltaEl.textContent = \"\";\n      deltaEl.className = \"manywidgets-stat__delta\";\n      return;\n    }\n    const n = Number(delta);\n    const sign = n > 0 ? \"\\u25B2\" : n < 0 ? \"\\u25BC\" : \"\\u2022\";\n    const dir = n > 0 ? \"up\" : n < 0 ? \"down\" : \"flat\";\n    deltaEl.textContent = `${sign} ${Math.abs(n)}`;\n    deltaEl.className = `manywidgets-stat__delta manywidgets-stat__delta--${dir}`;\n  }\n  update();\n  onChanges(model, [\"label\", \"value\", \"unit\", \"delta\"], update);\n}\nvar index_default = { render };\nexport {\n  index_default as default\n};\n",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_count": null,
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "delta": null,
       "label": "Exposed population",
       "layout": "IPY_MODEL_699e8340aa814f73822aa6dfb1b9fa06",
       "tabbable": null,
       "tooltip": null,
       "unit": "",
       "value": "151,419",
       "widget_id": "stat_2"
      }
     }
    },
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}